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.
361 lines
991 KiB
361 lines
991 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[252,7,8,10],{"+NIl":function(_e,Oe,ee){(function(fe){fe(ee("VrN/"))})(function(fe){"use strict";fe.defineMode("stex",function(Z,R){"use strict";function Q(w,A){w.cmdState.push(A)}function _(w){return w.cmdState.length>0?w.cmdState[w.cmdState.length-1]:null}function L(w){var A=w.cmdState.pop();A&&A.closeBracket()}function W(w){for(var A=w.cmdState,S=A.length-1;S>=0;S--){var h=A[S];if(h.name=="DEFAULT")continue;return h}return{styleIdentifier:function(){return null}}}function U(w,A,S){return function(){this.name=w,this.bracketNo=0,this.style=A,this.styles=S,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 M(w,A){w.f=A}function y(w,A){var S;if(w.match(/^\\[a-zA-Z@]+/)){var h=w.current().slice(1);return S=O.hasOwnProperty(h)?O[h]:O.DEFAULT,S=new S,Q(A,S),M(A,I),S.style}if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/\\]/))return"tag";if(w.match("\\["))return M(A,function(s,u){return C(s,u,"\\]")}),"keyword";if(w.match("\\("))return M(A,function(s,u){return C(s,u,"\\)")}),"keyword";if(w.match("$$"))return M(A,function(s,u){return C(s,u,"$$")}),"keyword";if(w.match("$"))return M(A,function(s,u){return C(s,u,"$")}),"keyword";var o=w.next();if(o=="%")return w.skipToEnd(),"comment";if(o=="}"||o=="]"){if(S=_(A),S)S.closeBracket(o),M(A,I);else return"error";return"bracket"}else return o=="{"||o=="["?(S=O.DEFAULT,S=new S,Q(A,S),"bracket"):/\d/.test(o)?(w.eatWhile(/[\w.%]/),"atom"):(w.eatWhile(/[\w\-_]/),S=W(A),S.name=="begin"&&(S.argument=w.current()),S.styleIdentifier())}function C(w,A,S){if(w.eatSpace())return null;if(S&&w.match(S))return M(A,y),"keyword";if(w.match(/^\\[a-zA-Z@]+/))return"tag";if(w.match(/^[a-zA-Z]+/))return"variable-2";if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/]/))return"tag";if(w.match(/^[\^_&]/))return"tag";if(w.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(w.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var h=w.next();return h=="{"||h=="}"||h=="["||h=="]"||h=="("||h==")"?"bracket":h=="%"?(w.skipToEnd(),"comment"):"error"}function I(w,A){var S=w.peek(),h;return S=="{"||S=="["?(h=_(A),h.openBracket(S),w.eat(S),M(A,y),"bracket"):/[ \t\r]/.test(S)?(w.eat(S),null):(M(A,y),L(A),y(w,A))}return{startState:function(){var w=R.inMathMode?function(A,S){return C(A,S)}:y;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=y,w.cmdState.length=0},lineComment:"%"}}),fe.defineMIME("text/x-stex","stex"),fe.defineMIME("text/x-latex","stex")})},"/GNS":function(_e,Oe,ee){_e.exports=ee.p+"static/search1.c4136dd4.png"},"19Vz":function(_e,Oe,ee){(function(fe){fe(ee("VrN/"))})(function(fe){fe.defineOption("placeholder","",function(U,O,M){var y=M&&M!=fe.Init;if(O&&!y)U.on("blur",_),U.on("change",L),U.on("swapDoc",L),fe.on(U.getInputField(),"compositionupdate",U.state.placeholderCompose=function(){Q(U)}),L(U);else if(!O&&y){U.off("blur",_),U.off("change",L),U.off("swapDoc",L),fe.off(U.getInputField(),"compositionupdate",U.state.placeholderCompose),Z(U);var C=U.getWrapperElement();C.className=C.className.replace(" CodeMirror-empty","")}O&&!U.hasFocus()&&_(U)});function Z(U){U.state.placeholder&&(U.state.placeholder.parentNode.removeChild(U.state.placeholder),U.state.placeholder=null)}function R(U){Z(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 M=U.getOption("placeholder");typeof M=="string"&&(M=document.createTextNode(M)),O.appendChild(M),U.display.lineSpace.insertBefore(O,U.display.lineSpace.firstChild)}function Q(U){setTimeout(function(){var O=!1,M=U.getInputField();M.nodeName=="TEXTAREA"?O=!M.value:U.lineCount()==1&&(O=!/[^\u200b]/.test(M.querySelector(".CodeMirror-line").textContent)),O?R(U):Z(U)},20)}function _(U){W(U)&&R(U)}function L(U){var O=U.getWrapperElement(),M=W(U);O.className=O.className.replace(" CodeMirror-empty","")+(M?" CodeMirror-empty":""),M?R(U):Z(U)}function W(U){return U.lineCount()===1&&U.getLine(0)===""}})},"1eCo":function(_e,Oe,ee){(function(fe){fe(ee("VrN/"))})(function(fe){"use strict";var Z={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},R={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};fe.defineMode("xml",function(Q,_){var L=Q.indentUnit,W={},U=_.htmlMode?Z:R;for(var O in U)W[O]=U[O];for(var O in _)W[O]=_[O];var M,y;function C(a,g){function m(H){return g.tokenize=H,H(a,g)}var b=a.next();if(b=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?m(A("atom","]]>")):null:a.match("--")?m(A("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),m(S(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),g.tokenize=A("meta","?>"),"meta"):(M=a.eat("/")?"closeTag":"openTag",g.tokenize=I,"tag bracket");if(b=="&"){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}C.isInText=!0;function I(a,g){var m=a.next();if(m==">"||m=="/"&&a.eat(">"))return g.tokenize=C,M=m==">"?"endTag":"selfcloseTag","tag bracket";if(m=="=")return M="equals",null;if(m=="<"){g.tokenize=C,g.state=u,g.tagName=g.tagStart=null;var b=g.tokenize(a,g);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(m)?(g.tokenize=w(m),g.stringStartCol=a.column(),g.tokenize(a,g)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function w(a){var g=function(m,b){for(;!m.eol();)if(m.next()==a){b.tokenize=I;break}return"string"};return g.isInAttribute=!0,g}function A(a,g){return function(m,b){for(;!m.eol();){if(m.match(g)){b.tokenize=C;break}m.next()}return a}}function S(a){return function(g,m){for(var b;(b=g.next())!=null;){if(b=="<")return m.tokenize=S(a+1),m.tokenize(g,m);if(b==">")if(a==1){m.tokenize=C;break}else return m.tokenize=S(a-1),m.tokenize(g,m)}return"meta"}}function h(a,g,m){this.prev=a.context,this.tagName=g,this.indent=a.indented,this.startOfLine=m,(W.doNotIndent.hasOwnProperty(g)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function s(a,g){for(var m;;){if(!a.context)return;if(m=a.context.tagName,!W.contextGrabbers.hasOwnProperty(m)||!W.contextGrabbers[m].hasOwnProperty(g))return;o(a)}}function u(a,g,m){return a=="openTag"?(m.tagStart=g.column(),x):a=="closeTag"?c:u}function x(a,g,m){return a=="word"?(m.tagName=g.current(),y="tag",v):W.allowMissingTagName&&a=="endTag"?(y="tag bracket",v(a,g,m)):(y="error",x)}function c(a,g,m){if(a=="word"){var b=g.current();return m.context&&m.context.tagName!=b&&W.implicitlyClosed.hasOwnProperty(m.context.tagName)&&o(m),m.context&&m.context.tagName==b||W.matchClosing===!1?(y="tag",p):(y="tag error",D)}else return W.allowMissingTagName&&a=="endTag"?(y="tag bracket",p(a,g,m)):(y="error",D)}function p(a,g,m){return a!="endTag"?(y="error",p):(o(m),u)}function D(a,g,m){return y="error",p(a,g,m)}function v(a,g,m){if(a=="word")return y="attribute",f;if(a=="endTag"||a=="selfcloseTag"){var b=m.tagName,P=m.tagStart;return m.tagName=m.tagStart=null,a=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(b)?s(m,b):(s(m,b),m.context=new h(m,b,P==m.indented)),u}return y="error",v}function f(a,g,m){return a=="equals"?d:(W.allowMissing||(y="error"),v(a,g,m))}function d(a,g,m){return a=="string"?l:a=="word"&&W.allowUnquoted?(y="string",v):(y="error",v(a,g,m))}function l(a,g,m){return a=="string"?l:v(a,g,m)}return{startState:function(a){var g={tokenize:C,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;M=null;var m=g.tokenize(a,g);return(m||M)&&m!="comment"&&(y=null,g.state=g.state(M||m,a,g),y&&(m=y=="error"?m+" error":y)),m},indent:function(a,g,m){var b=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+L;if(b&&b.noIndent)return fe.Pass;if(a.tokenize!=I&&a.tokenize!=C)return m?m.match(/^(\s*)/)[0].length:0;if(a.tagName)return W.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+L*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/<!\[CDATA\[/.test(g))return 0;var P=g&&/^<(\/)?([\w_:\.-]*)/.exec(g);if(P&&P[1])for(;b;)if(b.tagName==P[2]){b=b.prev;break}else if(W.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(P)for(;b;){var H=W.contextGrabbers[b.tagName];if(H&&H.hasOwnProperty(P[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+L:a.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(a){a.state==d&&(a.state=v)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var g=[],m=a.context;m;m=m.prev)m.tagName&&g.push(m.tagName);return g.reverse()}}}),fe.defineMIME("text/xml","xml"),fe.defineMIME("application/xml","xml"),fe.mimeModes.hasOwnProperty("text/html")||fe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2RCv":function(_e,Oe,ee){"use strict";var fe=ee("Awhp"),Z=ee("KrTs"),R=ee("+L6B"),Q=ee("2/Rp"),_=ee("5NDa"),L=ee("5rEg"),W=ee("0Owb"),U=ee("oBTY"),O=ee("tJVT"),M=ee("PpiC"),y=ee("q1tI"),C=ee.n(y),I=function(A){var S=A.InputRight,h=A.value,o=h===void 0?[]:h,s=A.onChange,u=s===void 0?function(){}:s,x=Object(M.a)(A,["InputRight","value","onChange"]),c=Object(y.useState)(),p=Object(O.a)(c,2),D=p[0],v=p[1],f=function(a){var g=o.filter(function(m,b){return b!==a});u(g)},d=function(a){if(a.preventDefault(),!D)return;u([].concat(Object(U.a)(o),[D])),v(null)};return C.a.createElement("div",null,C.a.createElement(L.a,Object(W.a)({},x,{value:D,onChange:function(a){return v(a.target.value)},onPressEnter:d,onBlur:d})),S,C.a.createElement("div",{className:"mt20"},o==null?void 0:o.map(function(l,a){return C.a.createElement(Z.a,{className:"ml10 mr10",count:"x",onClick:function(){return f(a)}},C.a.createElement(Q.a,{type:"primary",ghost:!0},l))})))};Oe.a=I},"4qgm":function(_e,Oe){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLp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iupdKNDEw+GeH00G5/LgKxQ+A80bVUmpLhzcVSMHbDuyO5CMQGAS/Rtf6U55Q3sNnZj2jFRgZ3FBcBSwQ83pTOG7z5EQMy11i2cyu4COQqBDxaMq8BvXPVrN3JugiEiYClC0CY/bnVXQRii0DHWkEJbYKG95ABnmSX6LFdFnc0pxEISXTPWTxaN+Ztn+US3Wng3f5ii4A50U/hydOZeT94P8rkEj22y+KO5jQCRkT3eI6T5GnPHH/ea5foTgPv9hdbBLIS/RD58t7C7C0rAyfiEj22y+KO5jQCmYm+j3yeG5m97ZvgYVyiOw28219sEfATfTd5klozZ2vAR6b8U3GJHttlcUdzGgFF9J8gbyvmb/nFrHuX6E4D7/YXWwTurLWJQnnbMGPLnlADu0SP7bK4ozmNQLe6pZn2wwGrbv8PSygpSs9Cw9cAAAAASUVORK5CYII="},"55Ip":function(_e,Oe,ee){"use strict";ee.d(Oe,"a",function(){return s});var fe=ee("Ty5D"),Z=ee("dI71"),R=ee("q1tI"),Q=ee.n(R),_=ee("YS25"),L=ee("17x9"),W=ee.n(L),U=ee("wx14"),O=ee("zLVn"),M=ee("9R94"),y=function(d){Object(Z.a)(l,d);function l(){for(var g,m=arguments.length,b=new Array(m),P=0;P<m;P++)b[P]=arguments[P];return g=d.call.apply(d,[this].concat(b))||this,g.history=Object(_.a)(g.props),g}var a=l.prototype;return a.render=function(){return Q.a.createElement(fe.c,{history:this.history,children:this.props.children})},l}(Q.a.Component),C=function(d){Object(Z.a)(l,d);function l(){for(var g,m=arguments.length,b=new Array(m),P=0;P<m;P++)b[P]=arguments[P];return g=d.call.apply(d,[this].concat(b))||this,g.history=Object(_.b)(g.props),g}var a=l.prototype;return a.render=function(){return Q.a.createElement(fe.c,{history:this.history,children:this.props.children})},l}(Q.a.Component),I=function(l,a){return typeof l=="function"?l(a):l},w=function(l,a){return typeof l=="string"?Object(_.c)(l,null,null,a):l},A=function(l){return l},S=Q.a.forwardRef;typeof S=="undefined"&&(S=A);function h(d){return!!(d.metaKey||d.altKey||d.ctrlKey||d.shiftKey)}var o=S(function(d,l){var a=d.innerRef,g=d.navigate,m=d.onClick,b=Object(O.a)(d,["innerRef","navigate","onClick"]),P=b.target,H=Object(U.a)({},b,{onClick:function(re){try{m&&m(re)}catch(z){throw re.preventDefault(),z}!re.defaultPrevented&&re.button===0&&(!P||P==="_self")&&!h(re)&&(re.preventDefault(),g())}});return A!==S?H.ref=l||a:H.ref=a,Q.a.createElement("a",H)}),s=S(function(d,l){var a=d.component,g=a===void 0?o:a,m=d.replace,b=d.to,P=d.innerRef,H=Object(O.a)(d,["component","replace","to","innerRef"]);return Q.a.createElement(fe.e.Consumer,null,function(V){V||Object(M.a)(!1);var re=V.history,z=w(I(b,V.location),V.location),F=z?re.createHref(z):"",ae=Object(U.a)({},H,{href:F,navigate:function(){var me=I(b,V.location),be=m?re.replace:re.push;be(me)}});return A!==S?ae.ref=l||P:ae.innerRef=P,Q.a.createElement(g,ae)})});if(!1)var u,x;var c=function(l){return l},p=Q.a.forwardRef;typeof p=="undefined"&&(p=c);function D(){for(var d=arguments.length,l=new Array(d),a=0;a<d;a++)l[a]=arguments[a];return l.filter(function(g){return g}).join(" ")}var v=p(function(d,l){var a=d["aria-current"],g=a===void 0?"page":a,m=d.activeClassName,b=m===void 0?"active":m,P=d.activeStyle,H=d.className,V=d.exact,re=d.isActive,z=d.location,F=d.sensitive,ae=d.strict,ce=d.style,me=d.to,be=d.innerRef,Be=Object(O.a)(d,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return Q.a.createElement(fe.e.Consumer,null,function(Ce){Ce||Object(M.a)(!1);var Le=z||Ce.location,Te=w(I(me,Le),Le),we=Te.pathname,ve=we&&we.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),j=ve?Object(fe.f)(Le.pathname,{path:ve,exact:V,sensitive:F,strict:ae}):null,T=!!(re?re(j,Le):j),k=T?D(H,b):H,G=T?Object(U.a)({},ce,{},P):ce,$=Object(U.a)({"aria-current":T&&g||null,className:k,style:G,to:Te},Be);return c!==p?$.ref=l||be:$.innerRef=be,Q.a.createElement(s,$)})});if(!1)var f},"5D2P":function(_e,Oe){_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,Oe,ee){"use strict";var fe=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Z=new Uint8Array(16);function R(){if(!fe)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fe(Z)}var Q=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function _(I){return typeof I=="string"&&Q.test(I)}for(var L=_,W=[],U=0;U<256;++U)W.push((U+256).toString(16).substr(1));function O(I){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=(W[I[w+0]]+W[I[w+1]]+W[I[w+2]]+W[I[w+3]]+"-"+W[I[w+4]]+W[I[w+5]]+"-"+W[I[w+6]]+W[I[w+7]]+"-"+W[I[w+8]]+W[I[w+9]]+"-"+W[I[w+10]]+W[I[w+11]]+W[I[w+12]]+W[I[w+13]]+W[I[w+14]]+W[I[w+15]]).toLowerCase();if(!L(A))throw TypeError("Stringified UUID is invalid");return A}var M=O;function y(I,w,A){I=I||{};var S=I.random||(I.rng||R)();if(S[6]=S[6]&15|64,S[8]=S[8]&63|128,w){A=A||0;for(var h=0;h<16;++h)w[A+h]=S[h];return w}return M(S)}var C=Oe.a=y},"7ZXX":function(_e,Oe,ee){_e.exports=ee.p+"static/err.6e7c5817.png"},"7ahc":function(_e,Oe,ee){"use strict";ee.d(Oe,"a",function(){return x});var fe=ee("k1fw"),Z=ee("0Owb"),R=ee("+L6B"),Q=ee("2/Rp"),_=ee("y8nQ"),L=ee("Vl3Y"),W=ee("tJVT"),U=ee("OaEy"),O=ee("2fM7"),M=ee("q1tI"),y=ee.n(M),C=ee("VrN/"),I=ee.n(C),w=ee("p77/"),A=ee.n(w),S=ee("c5Ni"),h=ee.n(S),o=O.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},u={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Oe.b=function(c){var p=c.callback,D=c.onCancel,v=Object(M.useState)("python"),f=Object(W.a)(v,2),d=f[0],l=f[1];function a(m){l(u[m][1])}function g(m){p(m)}return y.a.createElement(L.a,Object(Z.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:g}),y.a.createElement(L.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(O.a,{onChange:a},Object.keys(u).map(function(m){return y.a.createElement(o,{key:m,value:m},u[m][0])}))),y.a.createElement(L.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(x,{mode:d})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(Q.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function x(c){var p=c.value,D=c.onChange,v=c.mode,f=c.options,d=f===void 0?{}:f,l=Object(M.useRef)(),a=Object(M.useState)(),g=Object(W.a)(a,2),m=g[0],b=g[1];return Object(M.useEffect)(function(){if(m){function P(H){var V=H.getValue();D&&D(V)}return m.on("change",P),function(){m.off("change",P)}}},[m,D]),Object(M.useEffect)(function(){m&&m.setOption("mode",v)},[m,v]),Object(M.useEffect)(function(){m&&((p!==m.getValue()||p==="")&&setTimeout(function(){m.setValue(p||" ")},300))},[m,p]),Object(M.useEffect)(function(){if(l.current&&!m){var P=I.a.fromTextArea(l.current,Object(fe.a)({mode:v,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},d));b(P)}},[l.current,m]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:l}))}},"7v3h":function(_e,Oe,ee){_e.exports=ee.p+"static/empty2.dd73f390.png"},"8/bI":function(_e,Oe,ee){_e.exports=ee.p+"static/empty.8918e228.png"},"8EBN":function(_e,Oe,ee){(function(fe){fe(ee("VrN/"))})(function(fe){"use strict";fe.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 Z=0;Z<fe.modeInfo.length;Z++){var R=fe.modeInfo[Z];R.mimes&&(R.mime=R.mimes[0])}fe.findModeByMIME=function(Q){Q=Q.toLowerCase();for(var _=0;_<fe.modeInfo.length;_++){var L=fe.modeInfo[_];if(L.mime==Q)return L;if(L.mimes){for(var W=0;W<L.mimes.length;W++)if(L.mimes[W]==Q)return L}}if(/\+xml$/.test(Q))return fe.findModeByMIME("application/xml");if(/\+json$/.test(Q))return fe.findModeByMIME("application/json")},fe.findModeByExtension=function(Q){Q=Q.toLowerCase();for(var _=0;_<fe.modeInfo.length;_++){var L=fe.modeInfo[_];if(L.ext){for(var W=0;W<L.ext.length;W++)if(L.ext[W]==Q)return L}}},fe.findModeByFileName=function(Q){for(var _=0;_<fe.modeInfo.length;_++){var L=fe.modeInfo[_];if(L.file&&L.file.test(Q))return L}var W=Q.lastIndexOf("."),U=W>-1&&Q.substring(W+1,Q.length);if(U)return fe.findModeByExtension(U)},fe.findModeByName=function(Q){Q=Q.toLowerCase();for(var _=0;_<fe.modeInfo.length;_++){var L=fe.modeInfo[_];if(L.name.toLowerCase()==Q)return L;if(L.alias){for(var W=0;W<L.alias.length;W++)if(L.alias[W].toLowerCase()==Q)return L}}}})},"8hTe":function(_e,Oe,ee){_e.exports={button:"button___1wy9m"}},"9Bee":function(_e,Oe,ee){"use strict";var fe=ee("DYRE"),Z=ee("zeV3"),R=ee("+L6B"),Q=ee("2/Rp"),_=ee("k1fw"),L=ee("9og8"),W=ee("tJVT"),U=ee("WmNS"),O=ee.n(U),M=ee("q1tI"),y=ee.n(M),C=ee("vg9a"),I=ee("DlQD"),w=ee.n(I),A=ee("rUJ1");function S(oe,X){var J=oe.match(/^(\s+)(?:```)/);if(J===null)return X;var ne=J[1];return X.split(`
|
|
`).map(function(se){var q=se.match(/^\s+/);if(q===null)return se;var ie=Object(W.a)(q,1),le=ie[0];return le.length>=ne.length?se.slice(ne.length):se}).join(`
|
|
`)}var h=[],o=["<ul>"],s=new w.a.Renderer,u=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function x(){h.length=0,o=["<ul>"]}var c={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function p(oe,X,J,ne){if(X>=oe.length||oe[X].level<=J)return X;var se=oe[X];ne.push("<li><a href='#"+se.anchor+"'>"+se.text+"</a>"),X++;var q=[];return X=p(oe,X,se.level,q),q.length>0&&(ne.push("<ul>"),q.forEach(function(ie){ne.push(ie)}),ne.push("</ul>")),ne.push("</li>"),X=p(oe,X,J,ne),X}function D(){return p(h,0,0,o),o.push("</ul>"),o.join("")}var v={heading:function(X){var J=u.exec(X);if(J)return{type:"heading",raw:J[0],depth:J[1].length,text:J[2]}},fences:function(X){var J=this.rules.block.fences.exec(X);if(J){var ne=J[0],se=S(ne,J[3]||""),q=J[2]?J[2].trim():J[2];if(["latex","katex","math"].indexOf(q)>=0){var ie=l(),le=se;se=ie,a[ie]={type:"block",expression:le}}return{type:"code",raw:ne,lang:q,text:se}}}},f=/(?:\${2})([^\n`]+?)(?:\${2})/gi,d=0,l=function(){return"__special_katext_id_".concat(d++,"__")},a={};function g(){return a}function m(){d=0,a={}}function b(oe){return oe=oe.replace(f,function(X,J){var ne=l();return a[ne]={type:"inline",expression:J},ne}),oe}var P=s.listitem;s.listitem=function(oe){return P(b(oe))};var H=s.paragraph;s.paragraph=function(oe){return H(b(oe))};var V=s.tablecell;s.tablecell=function(oe,X){return V(b(oe),X)},s.code=function(oe,X,J){var ne=(X||"").match(/\S*/)[0];return ne?["latex","katex","math"].indexOf(ne)>=0?"<p class='editormd-tex'>".concat(oe,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(X,'">').concat(J?oe:Object(A.escape)(oe,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(J?oe:Object(A.escape)(oe,!0))+"</code></pre>"},s.heading=function(oe,X,J){var ne=this.options.headerPrefix+J.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return h.push({anchor:ne,level:X,text:oe}),"<h"+X+' id="'+ne+'">'+oe+"</h"+X+">"},w.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),w.a.use({tokenizer:v,renderer:s});var re=w.a,z=ee("SJMd"),F=ee("ulZh"),ae=ee.n(F),ce=ee("m3rI"),me=ee("Oy/b"),be=ee("p5ED"),Be=ee("ErOA"),Ce=ee("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,X){return(Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,ne){J.__proto__=ne}||function(J,ne){for(var se in ne)Object.prototype.hasOwnProperty.call(ne,se)&&(J[se]=ne[se])})(oe,X)};function Te(oe,X){if(typeof X!="function"&&X!==null)throw new TypeError("Class extends value "+String(X)+" is not a constructor or null");function J(){this.constructor=oe}Le(oe,X),oe.prototype=X===null?Object.create(X):(J.prototype=X.prototype,new J)}function we(oe,X,J,ne){return new(J||(J=Promise))(function(se,q){function ie(ge){try{he(ne.next(ge))}catch(ye){q(ye)}}function le(ge){try{he(ne.throw(ge))}catch(ye){q(ye)}}function he(ge){var ye;ge.done?se(ge.value):(ye=ge.value,ye instanceof J?ye:new J(function(ke){ke(ye)})).then(ie,le)}he((ne=ne.apply(oe,X||[])).next())})}function ve(oe,X){var J,ne,se,q,ie={label:0,sent:function(){if(1&se[0])throw se[1];return se[1]},trys:[],ops:[]};return q={next:le(0),throw:le(1),return:le(2)},typeof Symbol=="function"&&(q[Symbol.iterator]=function(){return this}),q;function le(he){return function(ge){return function(ye){if(J)throw new TypeError("Generator is already executing.");for(;ie;)try{if(J=1,ne&&(se=2&ye[0]?ne.return:ye[0]?ne.throw||((se=ne.return)&&se.call(ne),0):ne.next)&&!(se=se.call(ne,ye[1])).done)return se;switch(ne=0,se&&(ye=[2&ye[0],se.value]),ye[0]){case 0:case 1:se=ye;break;case 4:return ie.label++,{value:ye[1],done:!1};case 5:ie.label++,ne=ye[1],ye=[0];continue;case 7:ye=ie.ops.pop(),ie.trys.pop();continue;default:if(!(se=ie.trys,(se=se.length>0&&se[se.length-1])||ye[0]!==6&&ye[0]!==2)){ie=0;continue}if(ye[0]===3&&(!se||ye[1]>se[0]&&ye[1]<se[3])){ie.label=ye[1];break}if(ye[0]===6&&ie.label<se[1]){ie.label=se[1],se=ye;break}if(se&&ie.label<se[2]){ie.label=se[2],ie.ops.push(ye);break}se[2]&&ie.ops.pop(),ie.trys.pop();continue}ye=X.call(oe,ie)}catch(ke){ye=[6,ke],ne=0}finally{J=se=0}if(5&ye[0])throw ye[1];return{value:ye[0]?ye[1]:void 0,done:!0}}([he,ge])}}}var j=function(){function oe(){}return oe.addKey=function(X){oe.key=X},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(X,J){for(var ne=0,se=J;ne<se.length;ne++){var q=se[ne],ie=q[0],le=q[1];X.setAttribute(ie,le)}},oe.createRect=function(X,J,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","rect");return se.setAttribute("width",X.toString()),se.setAttribute("height",J.toString()),ne&&oe.setAttributes(se,ne),se},oe.createLine=function(X,J,ne,se,q){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",X.toString()),ie.setAttribute("y1",J.toString()),ie.setAttribute("x2",ne.toString()),ie.setAttribute("y2",se.toString()),q&&oe.setAttributes(ie,q),ie},oe.createPolygon=function(X,J){var ne=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ne.setAttribute("points",X),J&&oe.setAttributes(ne,J),ne},oe.createCircle=function(X,J){var ne=document.createElementNS("http://www.w3.org/2000/svg","circle");return ne.setAttribute("cx",(X/2).toString()),ne.setAttribute("cy",(X/2).toString()),ne.setAttribute("r",X.toString()),J&&oe.setAttributes(ne,J),ne},oe.createEllipse=function(X,J,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return se.setAttribute("cx",(X/2).toString()),se.setAttribute("cy",(J/2).toString()),se.setAttribute("rx",(X/2).toString()),se.setAttribute("ry",(J/2).toString()),ne&&oe.setAttributes(se,ne),se},oe.createGroup=function(X){var J=document.createElementNS("http://www.w3.org/2000/svg","g");return X&&oe.setAttributes(J,X),J},oe.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},oe.createMarker=function(X,J,ne,se,q,ie,le){var he=document.createElementNS("http://www.w3.org/2000/svg","marker");return oe.setAttributes(he,[["id",X],["orient",J],["markerWidth",ne.toString()],["markerHeight",se.toString()],["refX",q.toString()],["refY",ie.toString()]]),he.appendChild(le),he},oe.createText=function(X){var J=document.createElementNS("http://www.w3.org/2000/svg","text");return J.setAttribute("x","0"),J.setAttribute("y","0"),X&&oe.setAttributes(J,X),J},oe.createTSpan=function(X,J){var ne=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ne.textContent=X,J&&oe.setAttributes(ne,J),ne},oe.createImage=function(X){var J=document.createElementNS("http://www.w3.org/2000/svg","image");return X&&oe.setAttributes(J,X),J},oe.createPoint=function(X,J){var ne=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ne.x=X,ne.y=J,ne},oe.createPath=function(X,J){var ne=document.createElementNS("http://www.w3.org/2000/svg","path");return ne.setAttribute("d",X),J&&oe.setAttributes(ne,J),ne},oe.createElement=function(X,J){var ne=document.createElementNS("http://www.w3.org/2000/svg",X);return J&&oe.setAttributes(ne,J),ne},oe.getHollowRectanglePath=function(X,J,ne,se,q,ie,le,he){return"M"+X+","+J+"V"+(J+se)+"H"+(X+ne)+"V"+J+"H"+q+"V"+ie+"H"+(q+le)+"V"+(ie+he)+"H"+q+"V"+J+"Z"},oe}(),k=function(){function oe(X){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+X+"_"}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(X){return this.styleSheet===void 0&&this.addStyleSheet(),X.name=""+this.classNamePrefix+X.localName,this.classes.push(X),this.styleSheet.sheet.insertRule("."+X.name+" {"+X.style+"}",this.styleSheet.sheet.cssRules.length),X},oe.prototype.addRule=function(X){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(X),this.styleSheet.sheet.insertRule(X.selector+" {"+X.style+"}",this.styleSheet.sheet.cssRules.length)},oe.prototype.addStyleSheet=function(){var X;this.styleSheet=document.createElement("style"),((X=this.styleSheetRoot)!==null&&X!==void 0?X:document.head).appendChild(this.styleSheet),this.addRule(new G("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new G("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new G("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new $("_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 X;this.styleSheet&&(((X=this.styleSheetRoot)!==null&&X!==void 0?X:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},oe}(),G=function(oe,X){this.selector=oe,this.style=X},$=function(oe,X){this.localName=oe,this.style=X},N=function(){function oe(){this.blocks=[],this.display=""}return oe.prototype.addButtonBlock=function(X){X.className=this.blockClassName,X.buttonClassName=this.buttonClassName,X.buttonColorsClassName=this.buttonColorsClassName,X.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(X)},oe.prototype.addElementBlock=function(X){X.className===void 0&&(X.className=this.blockClassName),this.blocks.push(X)},oe.prototype.getUI=function(){var X=document.createElement("div");return X.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,X.style.display=this.display,this.blocks.forEach(function(J){return X.appendChild(J.getUI())}),X},oe}(),ue=function(){function oe(){}return oe.prototype.getUI=function(){var X=document.createElement("div");if(X.className=this.className,this.minWidth!==void 0&&(X.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":X.style.justifyContent="flex-start";break;case"center":X.style.justifyContent="center";break;case"end":X.style.justifyContent="flex-end"}return X.style.whiteSpace="nowrap",X},oe}(),Ee=function(oe){function X(){var J=oe!==null&&oe.apply(this,arguments)||this;return J.buttons=[],J}return Te(X,oe),X.prototype.addButton=function(J){J.className=this.buttonClassName,J.colorsClassName=this.buttonColorsClassName,J.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(J)},X.prototype.getUI=function(){var J=oe.prototype.getUI.call(this);return this.buttons.forEach(function(ne){return J.appendChild(ne.getUI())}),J},X}(ue),De=function(){function oe(X,J){this._isActive=!1,this._isHidden=!1,this._icon=X,this.title=J,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(oe.prototype,"icon",{get:function(){return this._icon},set:function(X){this._icon=X,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"isActive",{get:function(){return this._isActive},set:function(X){this._isActive=X,this.adjustClassName()},enumerable:!1,configurable:!0}),oe.prototype.getUI=function(){var X=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 X.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 X(){var J=oe!==null&&oe.apply(this,arguments)||this;return J.elements=[],J}return Te(X,oe),X.prototype.addElement=function(J){this.elements.push(J)},X.prototype.getUI=function(){var J=oe.prototype.getUI.call(this);return this.elements.forEach(function(ne){return J.appendChild(ne)}),J},X}(ue),Re=function(){function oe(X,J){this.horizontal=X,this.vertical=J}return Object.defineProperty(oe.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),oe.prototype.getVerticalLength=function(X){return X/this.ratio},oe.prototype.getHorizontalLength=function(X){return X*this.ratio},oe}(),Ie=function(){function oe(){}return oe.getIcon=function(X,J){if(X>0&&J>0){var ne=new Re(X,J),se=ne.ratio>=1?20:ne.getHorizontalLength(20),q=ne.ratio<1?20:ne.getVerticalLength(20),ie=document.createElementNS("http://www.w3.org/2000/svg","svg");ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),ie.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ie);var le=T.createDefs();ie.appendChild(le);var he=T.createElement("clipPath",[["id","text-bg-clip"]]);le.appendChild(he);var ge=T.createPath(T.getHollowRectanglePath((24-se)/2,(24-q)/2,se,q,(24-se)/2+2,(24-q)/2+2,se-4,q-4));ie.appendChild(ge);var ye=T.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ye.appendChild(T.createTSpan(X+":"+J)),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(ge,[["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 X(J,ne,se){var q=oe.call(this,J,ne)||this;return q.isDropdownOpen=!1,q.onClick=q.dropdownButtonClicked,q.dropdownButtons=se,q}return Te(X,oe),X.prototype.setupDropdown=function(){var J=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ne){ne.className=J.className,ne.colorsClassName=J.colorsClassName,J.dropdownBlock.appendChild(ne.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},X.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},X.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},X.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},X.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},X.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},X}(De),Ge=function(){function oe(X,J){this.GRIP_SIZE=10,this.color=X,this.fillColor=J,this.visual=T.createGroup(),this.visual.appendChild(T.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(T.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return oe.prototype.ownsTarget=function(X){return X===this.visual||X===this.visual.childNodes[0]||X===this.visual.childNodes[1]},oe.prototype.setCenter=function(X,J){this.visual.childNodes.forEach(function(ne){return T.setAttributes(ne,[["cx",X.toString()],["cy",J.toString()]])})},oe}(),Ke=function(){function oe(X,J,ne,se){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=X,this.canvasHeight=J,this.margin=ne,this.container=se,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(oe.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(X){this._aspectRatio=X,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(X){this._isGridVisible=X,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(X){this._zoomFactor=X,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),oe.prototype.open=function(){var X=this;this.cropShadeElement=T.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=T.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var J=0;J<this.numberOfGridLines;J++)this.horizontalGridLines.push(T.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(T.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ne){return X.gridContainer.appendChild(ne)}),this.verticalGridLines.forEach(function(ne){return X.gridContainer.appendChild(ne)}),this.cropRectElement=T.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ge(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ge(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ge(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ge(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},oe.prototype.setCropRectangle=function(X){this.cropRect=X;var J=Object.assign({},this.cropRect);this.zoomFactor!==1&&(J.width=this.cropRect.width*this.zoomFactor,J.height=this.cropRect.height*this.zoomFactor,J.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-J.width/2,J.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-J.height/2),T.setAttributes(this.cropRectElement,[["x",J.x.toString()],["y",J.y.toString()],["width",J.width.toString()],["height",J.height.toString()]]);var ne=J.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(q,ie){var le=J.y+ne*(ie+1);T.setAttributes(q,[["x1",""+J.x],["y1",""+le],["x2",""+(J.x+J.width)],["y2",""+le]])});var se=J.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(q,ie){var le=J.x+se*(ie+1);T.setAttributes(q,[["x1",""+le],["y1",""+J.y],["x2",""+le],["y2",""+(J.y+J.height)]])}),T.setAttributes(this.cropShadeElement,[["d",T.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,J.x,J.y,J.width,J.height)]]),this.topLeftGrip.setCenter(J.x,J.y),this.topRightGrip.setCenter(J.x+J.width,J.y),this.bottomLeftGrip.setCenter(J.x,J.y+J.height),this.bottomRightGrip.setCenter(J.x+J.width,J.y+J.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},oe.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},oe.prototype.clientToLocalCoordinates=function(X,J){var ne=this.container.getBoundingClientRect();return{x:X-ne.left+this.margin,y:J-ne.top+this.margin}},oe.prototype.onPointerDown=function(X){this.container.setPointerCapture(X.pointerId),this.previousPoint=this.clientToLocalCoordinates(X.clientX,X.clientY),this.cropRectElement===X.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(X.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(X.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(X.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(X.target)&&(this.activeGrip=this.bottomRightGrip)},oe.prototype.onPointerMove=function(X){if(this.isMoving)this.move(this.clientToLocalCoordinates(X.clientX,X.clientY));else if(this.activeGrip){var J=this.clientToLocalCoordinates(X.clientX,X.clientY);this.resize(J)}X.preventDefault()},oe.prototype.onPointerUp=function(X){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(X.pointerId)},oe.prototype.move=function(X){var J=X.x-this.previousPoint.x,ne=X.y-this.previousPoint.y;this.zoomFactor!==1&&(J=-J/this.zoomFactor,ne=-ne/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+J),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ne),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=X},oe.prototype.resize=function(X){var J=Object.assign({},this.cropRect),ne=X.x-this.previousPoint.x,se=X.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:J.x+ne<this.margin&&(ne=this.margin-J.x),J.x+=ne,J.width=this.cropRect.x+this.cropRect.width-J.x;break;case this.bottomRightGrip:case this.topRightGrip:J.width+ne>this.canvasWidth*this.zoomFactor&&(ne=this.canvasWidth*this.zoomFactor-J.width),J.width+=ne}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(J.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ne),J.height=this.aspectRatio.getVerticalLength(J.width)):(J.y+=se,J.height=this.cropRect.y+this.cropRect.height-J.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?J.height=this.aspectRatio.getVerticalLength(J.width):J.height+=se}J.width<10&&(J.x=this.cropRect.x,J.width=10),J.height<10&&(J.y=this.cropRect.y,J.height=10),this.previousPoint=X,J.x>=this.margin&&J.y>=this.margin&&J.x-this.margin+J.width<=this.canvasWidth&&J.y-this.margin+J.height<=this.canvasHeight&&(this.cropRect=J,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},oe.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var X=this.cropRect.x+this.cropRect.width/2,J=this.cropRect.y+this.cropRect.height/2,ne=this.aspectRatio.getHorizontalLength(this.cropRect.height),se=this.aspectRatio.getVerticalLength(this.cropRect.width);ne/this.canvasWidth<se/this.canvasHeight?this.cropRect.width=ne:this.cropRect.height=se,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=X-this.cropRect.width/2,this.cropRect.y=J-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},oe.prototype.getRescaledRect=function(X,J,ne,se,q,ie){var le=ne/X,he=se/J;return{x:(q.x-ie)*le+ie,y:(q.y-ie)*he+ie,width:q.width*le,height:q.height*he}},oe.prototype.scaleCanvas=function(X,J){var ne=this.getRescaledRect(this.canvasWidth,this.canvasHeight,X,J,this.cropRect,this.margin);this.canvasWidth=X,this.canvasHeight=J,this.onCropChange&&this.onCropChange(ne),this.setCropRectangle(ne)},oe}(),Ye=function(){function oe(X){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=X,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(X){this._angle=X,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(X){this.controlContainer.setPointerCapture(X.pointerId),this.isDragging=!0,this.previousPoint={x:X.clientX,y:X.clientY}},oe.prototype.onPointerMove=function(X){this.isDragging&&(this.onAngleChange&&this.onAngleChange((X.clientX-this.previousPoint.x)/5),this.previousPoint.x=X.clientX)},oe.prototype.onPointerUp=function(X){this.isDragging&&this.onAngleChange&&this.onAngleChange((X.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(X.pointerId)},oe.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var X=this.angleLabelText.getBBox();T.setAttributes(this.angleLabelElement,[["x",((this.width-X.width)/2).toString()],["y",(this.height/2).toString()]])}},oe.prototype.positionScaleShape=function(){if(this.scaleShape){var X=this.scaleShape.transform.baseVal.getItem(0);X.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(X,0)}},oe.prototype.getVisual=function(){var X=document.createElementNS("http://www.w3.org/2000/svg","svg");X.setAttribute("xmlns","http://www.w3.org/2000/svg"),X.setAttribute("width",this.width+"px"),X.setAttribute("height",this.height+"px"),X.setAttribute("viewBox","0 0 "+this.width+" "+this.height),X.style.flexShrink="0",document.body.appendChild(X);for(var J="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ne=1;ne<=this.width/5+10;ne++){var se=ne%5==0?this.height/3:this.height/6;J+="h4v"+-se+"h1v"+se}J+="v1H0Z",this.scaleShape=T.createPath(J);var q=T.createTransform();this.scaleShape.transform.baseVal.appendItem(q),X.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="°",this.angleLabelElement.appendChild(ie),X.appendChild(this.angleLabelElement),document.body.removeChild(X),X},oe}(),Xe=function(){function oe(){this.naturalSize=!1,this.imageType="image/png"}return oe.prototype.rasterize=function(X,J,ne,se,q,ie,le){var he=this;return new Promise(function(ge){var ye=document.createElement("canvas");ye.width=X.width.baseVal.value-2*se,ye.height=X.height.baseVal.value-2*se;var ke=1,He=1;he.naturalSize===!0?(ke=J.naturalWidth/(X.width.baseVal.value-2*se)/ie,He=J.naturalHeight/(X.height.baseVal.value-2*se)/le,ye.width=J.naturalWidth/ie,ye.height=J.naturalHeight/le):he.width!==void 0&&he.height!==void 0&&(ke=he.width/ne.width,He=he.height/ne.height,ye.width*=ke,ye.height*=He);var tt=ye.getContext("2d");tt.translate(ye.width/2,ye.height/2),tt.rotate(q*Math.PI/180),tt.scale(ie,le),tt.translate(-ye.width/2,-ye.height/2),tt.drawImage(J,0,0,ye.width,ye.height);var it=document.createElement("canvas");it.width=ne.width*ke,it.height=ne.height*He,it.getContext("2d").putImageData(tt.getImageData((ne.x-se)*ke,(ne.y-se)*He,ne.width*ke,ne.height*He),0,0),ge(it.toDataURL(he.imageType,he.imageQuality))})},oe}(),at=function(){function oe(X){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 k(this.instanceNo),this.target=X,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(X){this._zoomToCropEnabled=X,X?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(X){this._isGridVisible=X,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"gridLines",{get:function(){return this._gridLines},set:function(X){this._gridLines=X,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(X){this._rotationAngle=X,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 X;return(X=this._aspectRatio)!==null&&X!==void 0?X:this.aspectRatios[0]},set:function(X){this._aspectRatio=X},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(X){X===void 0&&(X=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),X||this.closeEventListeners.forEach(function(J){return J()}),this._isOpen=!1)},oe.prototype.addRenderEventListener=function(X){this.renderEventListeners.push(X)},oe.prototype.removeRenderEventListener=function(X){this.renderEventListeners.indexOf(X)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(X),1)},oe.prototype.addCloseEventListener=function(X){this.closeEventListeners.push(X)},oe.prototype.removeCloseEventListener=function(X){this.closeEventListeners.indexOf(X)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(X),1)},oe.prototype.setupResizeObserver=function(){var X=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){X.resize(X.target.clientWidth,X.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 X=1*this.target.clientWidth/this.target.clientHeight,J=this.contentDiv.clientWidth/X>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*X:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ne=J+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/X;this.resize(J,ne)}},oe.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},oe.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",T.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},oe.prototype.resize=function(X,J){this.imageWidth=Math.round(X),this.imageHeight=Math.round(J),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},oe.prototype.setEditingTarget=function(){var X=document.createElement("canvas");X.width=this.target.naturalWidth,X.height=this.target.naturalHeight,X.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var J=X.toDataURL();T.setAttributes(this.editingTarget,[["href",J]]),this.setEditingTargetSize()},oe.prototype.setTopLeft=function(){var X=this.target.getBoundingClientRect(),J=this.editorCanvas.getBoundingClientRect();this.left=X.left-J.left-this.CANVAS_MARGIN,this.top=X.top-J.top-this.CANVAS_MARGIN},oe.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=T.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=T.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=T.createGroup(),this.editingTargetRotationScaleContainer=T.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var X=T.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(X);var J=T.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(J),this.editingTargetContainer=T.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},oe.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},oe.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=T.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ke(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 X=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,J=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=X+"px "+J+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-X+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-J+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},oe.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},oe.prototype.cropRectChanged=function(X){this.cropRect=X,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 X=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,J=this.target.offsetTop>X+this.CANVAS_MARGIN?this.target.offsetTop-(X+this.CANVAS_MARGIN):0;this.coverDiv.style.top=J+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},oe.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},oe.prototype.addTopToolbar=function(){var X=this;this.topToolbar=new N,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var J=new Ee;J.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(J);var ne=[];this.aspectRatios.forEach(function(He){var tt=new De(Ie.getIcon(He.horizontal,He.vertical),He.horizontal===0&&He.vertical===0?"FREE":He.horizontal+":"+He.vertical);tt.onClick=function(){return X.ratioButtonClicked(He)},ne.push(tt)}),this.aspectRatioButton=new Pe(Ie.getIcon(0,0),"Aspect ratio",ne),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,J.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var se=new De('<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(){X.isGridVisible=!X.isGridVisible,se.isActive=X.isGridVisible},J.addButton(se);var q=new De('<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(q.isActive=this.zoomToCropEnabled,q.onClick=function(){X.zoomToCropEnabled=!X.zoomToCropEnabled,q.isActive=X.zoomToCropEnabled},J.addButton(q),!j.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 ge=new Ee;ge.minWidth=3*this.toolbarHeight+"px",ge.contentAlign="end",this.topToolbar.addButtonBlock(ge);var ye=new De('<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,ge.addButton(ye),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ye.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var ke=new De('<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,ge.addButton(ke),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(ke.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},oe.prototype.addBottomToolbar=function(){var X=this;this.bottomToolbar=new N,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var J=new Ee;J.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(J);var ne=new De('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");ne.onClick=this.rotateLeftButtonClicked,J.addButton(ne);var se=new De('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");se.onClick=this.rotateRightButtonClicked,J.addButton(se);var q=new Ne;q.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(q),this.straightener=new Ye("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(ge){X.rotateBy(ge),X.straightener.angle=X.rotationAngle},q.addElement(this.straightener.getUI());var ie=new Ee;ie.minWidth=2*this.toolbarHeight+"px",ie.contentAlign="end",this.bottomToolbar.addButtonBlock(ie);var le=new De('<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 De('<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(X){this.aspectRatio=X,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},oe.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Ie.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 Re(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(X){if(X){var J=this.cropLayer.getRescaledRect(X.width,X.height,this.imageWidth,this.imageHeight,X.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(J),this.cropRectChanged(J),this.flippedHorizontally=X.flippedHorizontally,this.flippedVertically=X.flippedVertically,this.applyFlip(),this.rotationAngle=X.rotationAngle,this.applyRotation()}},oe.prototype.clientToLocalCoordinates=function(X,J){var ne=this.cropImage.getBoundingClientRect();return{x:X-ne.left,y:J-ne.top}},oe.prototype.onWindowResize=function(){this.positionUI()},oe.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var X=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=X+"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 X=this.rotationAngle-90;this.rotationAngle%90!=0&&(X+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(X)},oe.prototype.rotateRightButtonClicked=function(){var X=this.rotationAngle+90;this.rotationAngle%90!=0&&(X-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(X)},oe.prototype.rotateTo=function(X){X=(X=X>180?X-360:X)<=-180?X+360:X,this.rotationAngle=X,this.applyRotation()},oe.prototype.rotateBy=function(X){this.rotateTo((this.rotationAngle+X)%360)},oe.prototype.applyRotation=function(){var X=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var J=this.editingTargetRotationContainer.transform.baseVal.getItem(0);J.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(J,0);var ne=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ne.width,this.imageHeight/ne.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=X},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 X,J;return ve(this,function(ne){switch(ne.label){case 0:return[4,this.render()];case 1:return X=ne.sent(),J=this.getState(),this.renderEventListeners.forEach(function(se){return se(X,J)}),this.close(!0),[2]}})})},oe.prototype.render=function(){return we(this,void 0,void 0,function(){var X;return ve(this,function(J){switch(J.label){case 0:return(X=new Xe).naturalSize=this.renderAtNaturalSize,X.imageType=this.renderImageType,X.imageQuality=this.renderImageQuality,X.width=this.renderWidth,X.height=this.renderHeight,this.unzoomFromCrop(),T.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,X.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return J.sent(),[4,X.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,J.sent()]}})})},oe.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new $("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 X=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new $("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*X)+`px;
|
|
height: `+(this.toolbarHeight-2*X)+`px;
|
|
padding: `+X+`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 G("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new G("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new $("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*X)+`px;
|
|
padding: `+X+`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}(),qe=ee("8hTe"),ze=ee.n(qe),Ae=/<pre[^>]*>/g;function Je(oe){var X=document.createElement("div");return X.innerHTML=oe,X.childNodes.length===0?"":X.childNodes[0].nodeValue}var Ze=Oe.a=function(oe){var X=oe.value,J=X===void 0?"":X,ne=oe.edit,se=ne===void 0?!1:ne,q=oe.className,ie=oe.showTextOnly,le=oe.showLines,he=oe.replaces,ge=oe.zoomImg,ye=oe.hasMask,ke=oe.style,He=ke===void 0?{}:ke,tt=oe.stylesPrev,it=tt===void 0?{}:tt,vt=String(J),st=Object(M.useRef)(),nt=Object(M.useRef)(),Tt=Object(M.useState)(""),Et=Object(W.a)(Tt,2),_t=Et[0],Mt=Et[1],xt=Object(M.useState)("office"),mr=Object(W.a)(xt,2),Cr=mr[0],Yt=mr[1],gr=function(){var Ct=new at(nt.current);Ct.displayMode="popup",Ct.addRenderEventListener(function(){var Jt=Object(L.a)(O.a.mark(function mt(pt){var wt;return O.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:return st.current.style.display="none",Ft.next=3,Object(Be.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:pt}});case 3:wt=Ft.sent,wt!=null&&wt.id&&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 Ft.stop()}},mt)}));return function(mt){return Jt.apply(this,arguments)}}()),Ct.show()},cr=function(){var Ct=new Ce.a(nt.current);Ct.settings.displayMode="popup",Ct.addEventListener("render",function(){var Jt=Object(L.a)(O.a.mark(function mt(pt){var wt;return O.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:if(st.current.style.display="none",!nt.current){Ft.next=6;break}return Ft.next=4,Object(Be.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:pt.dataUrl}});case 4:wt=Ft.sent,wt!=null&&wt.id&&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 Ft.stop()}},mt)}));return function(mt){return Jt.apply(this,arguments)}}()),Ct.show(),window.markerArea=Ct},zr=Object(M.useMemo)(function(){st.current&&(st.current.style.zIndex=-1);try{var $e=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ct=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Jt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;vt=vt.replace($e,"("+ce.a.API_SERVER+"/api/attachments/").replace(Ct,'"'+ce.a.API_SERVER+"/api/attachments/").replace(Jt,'"'+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(vr){}var mt=re(vt),pt=g();if(vt.match(/\[TOC\]/)&&(mt=mt.replace("<p>[TOC]</p>",D()),x()),mt=mt.replace(/(__special_katext_id_\d+__)/g,function(vr,Ft){var Fe=pt[Ft],dt=Fe.type,ri=Fe.expression;return Object(me.renderToString)(Je(ri)||"",{displayMode:dt==="block",throwOnError:!1,output:"html"})}),mt=mt.replace(/▁/g,"\u2581\u2581\u2581"),m(),ie){var wt=document.createElement("div");return wt.innerHTML=mt,wt.innerText}return setTimeout(function(){return ti()},500),mt},[vt]),Xt=Object(M.useRef)();c.WebkitLineClamp=le,le&&(He=Object(_.a)(Object(_.a)({},He),c));function Br($e){var Ct=$e.target;if(Ct.tagName.toUpperCase()==="IMG"){if(ge){var Jt=Ct.getAttribute("src");Mt(Jt),Yt("image")}}else if(Ct.tagName.toUpperCase()==="A"){var mt=Ct.getAttribute("href");if(mt.indexOf("office")>-1)$e.preventDefault(),Mt(mt),Yt("office");else if(mt.indexOf("application/pdf")>-1)$e.preventDefault(),Mt(mt),Yt("pdf");else if(mt.indexOf("text/html")>-1)$e.preventDefault(),Mt(mt),Yt("html");else if(mt.startsWith("#")){$e.preventDefault();var pt=document.getElementById(mt.replace("#",""));pt&&pt.scrollIntoView(!0)}}}var ti=function(){var Ct,Jt=(Ct=Xt.current)===null||Ct===void 0?void 0:Ct.querySelectorAll("video");Jt==null||Jt.forEach(function(mt){if(mt.oncontextmenu=function(){return!1},mt.src.indexOf(".m3u8")>-1&&!mt.canPlayType("application/vnd.apple.mpegurl")){if(ae.a.isSupported()){var pt=new ae.a;pt.loadSource(mt.src),pt.attachMedia(mt)}}})};Object(M.useEffect)(function(){if(Xt.current&&zr&&(zr.match(Ae)&&window.PR.prettyPrint()),Xt.current)return Xt.current.addEventListener("click",Br),function(){Xt.current.removeEventListener("click",Br),m(),x()}},[zr,Xt.current,Br]);var Ot=function(Ct){if(!se)return;Ct.target.nodeName==="IMG"?(st.current.style.zIndex=1,st.current.style.display="flex",st.current.style.width=Ct.target.clientWidth+"px",st.current.style.height=Ct.target.clientHeight+"px",st.current.style.top=Ct.target.offsetTop+"px",st.current.style.left=Ct.target.offsetLeft+"px",nt.current.src=Ct.target.getAttribute("src")):st.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:Xt,style:Object(_.a)({},He),className:"".concat(q||""," markdown-body ").concat(ze.a.mdBody),onMouseOver:Ot,dangerouslySetInnerHTML:{__html:zr}}),y.a.createElement("div",{ref:st,className:ze.a.button},y.a.createElement(Z.a,null,y.a.createElement(Q.a,{onClick:function(){return gr()}},"\u88C1\u526A"),y.a.createElement(Q.a,{onClick:function(){return cr()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:nt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(be.a,{close:!0,data:_t,type:_t!=null&&_t.length?Cr:"",style:Object(_.a)({},it),onClose:function(){return Mt("")}}))}},"9VGf":function(_e,Oe,ee){"use strict";ee.d(Oe,"a",function(){return R});var fe=ee("q1tI"),Z=ee.n(fe);function R(Q,_){var L=Object(fe.useRef)();Object(fe.useEffect)(function(){L.current=Q}),Object(fe.useEffect)(function(){function W(){L.current()}if(_!==null){var U=setInterval(W,_);return function(){return clearInterval(U)}}},[_])}},"9ZNV":function(_e,Oe,ee){"use strict";ee.d(Oe,"a",function(){return M});var fe=ee("0Owb"),Z=ee("+L6B"),R=ee("2/Rp"),Q=ee("q1tI"),_=ee.n(Q),L=ee("UUDw"),W=ee.n(L),U=ee("TSYQ"),O=ee.n(U),M=function(C){var I=C.cancelText,w=I===void 0?"\u53D6\u6D88":I,A=C.okText,S=A===void 0?"\u786E\u5B9A":A,h=C.loading,o=h===void 0?!1:h,s=C.hasOkBtn,u=s===void 0?!0:s,x=C.okButtonProps,c=x===void 0?{}:x,p=C.onCancel,D=p===void 0?function(){}:p,v=C.onOk,f=v===void 0?function(){}:v,d=C.className,l=d===void 0?"":d;return _.a.createElement("div",{className:O()(W.a.buttonFixed,l)},_.a.createElement("div",{className:W.a.buttonWrap},_.a.createElement(R.a,{size:"large",className:"".concat(W.a.button," mr20"),onClick:D},w),u&&_.a.createElement(R.a,Object(fe.a)({size:"large",type:"primary",className:"".concat(W.a.button," mr20"),loading:o,onClick:f},c),S)))}},"A/g1":function(_e,Oe){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6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XwurL9tp4kN7fsUQz5fTnxbGH8GFt7DcwpecTuMFmlIaZ+bjOgvF2u7d/gnIWZR+Q1KPowcIIaAhQSarqmH/xE0TpQbb92M9uT7kdz+/HqfDB0EcF/ZRi1ggYFER/cYcMtMOO3jzlmVjXKDrkt5uv9are9ZLJ8L6UcJ+HplVotygVRlYLFwM4GWf2njl/ymq1fqrSgM3J1Sfz5Rnd15ulp/tiGtPV6h0aIwaCDxUPc/F8sfOQdqTKnbrvjMf9fOK7ZLCyv8Jom1s9qvsHANttQw4dhY++6BW+sKFlNJr7E9K6wOZEoT0YU3ogvXm5OSMK5KQ347v7oggZbr3j/+PWwUnoj9jyHCk+OP7p3Kry+6nL33uvazqbD+6+W35RDmrtGOPW8Va7JcjzemtC+frTKWfgJyCQmxI/GZ7x+warfdUKy/rj47UZXdnlHZXHprJWBcFKZsGX1k16t2spI7oqbr3iOTkdzGyz7z8tK5s4eAN4UiHxx5dO94Ka2jLd2Gq95TI/e9tXoqbBytZLJzwAUGdY+273nc6Y294z3p1sRW2ZhSt02Gsg+eDxknyl07FYWRY8I+aZptYx27B0Bw/Bp3faHRcs13EsCWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},Bd2K:function(_e,Oe,ee){(function(fe){fe(ee("VrN/"),ee("osHv"))})(function(fe){fe.defineOption("autoCloseTags",!1,function(O,M,y){if(y!=fe.Init&&y&&O.removeKeyMap("autoCloseTags"),!M)return;var C={name:"autoCloseTags"};(typeof M!="object"||M.whenClosing!==!1)&&(C["'/'"]=function(I){return L(I)}),(typeof M!="object"||M.whenOpening!==!1)&&(C["'>'"]=function(I){return Q(I)}),O.addKeyMap(C)});var Z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],R=["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 Q(O){if(O.getOption("disableInput"))return fe.Pass;for(var M=O.listSelections(),y=[],C=O.getOption("autoCloseTags"),I=0;I<M.length;I++){if(!M[I].empty())return fe.Pass;var w=M[I].head,A=O.getTokenAt(w),S=fe.innerMode(O.getMode(),A.state),h=S.state,o=S.mode.xmlCurrentTag&&S.mode.xmlCurrentTag(h),s=o&&o.name;if(!s)return fe.Pass;var u=S.mode.configuration=="html",x=typeof C=="object"&&C.dontCloseTags||u&&Z,c=typeof C=="object"&&C.indentTags||u&&R;A.end>w.ch&&(s=s.slice(0,s.length-A.end+w.ch));var p=s.toLowerCase();if(!s||A.type=="string"&&(A.end!=w.ch||!/[\"\']/.test(A.string.charAt(A.string.length-1))||A.string.length==1)||A.type=="tag"&&o.close||A.string.indexOf("/")==w.ch-A.start-1||x&&W(x,p)>-1||U(O,S.mode.xmlCurrentContext&&S.mode.xmlCurrentContext(h)||[],s,w,!0))return fe.Pass;var D=typeof C=="object"&&C.emptyTags;if(D&&W(D,s)>-1){y[I]={text:"/>",newPos:fe.Pos(w.line,w.ch+2)};continue}var v=c&&W(c,p)>-1;y[I]={indent:v,text:">"+(v?`
|
|
|
|
`:"")+"</"+s+">",newPos:v?fe.Pos(w.line+1,0):fe.Pos(w.line,w.ch+1)}}for(var f=typeof C=="object"&&C.dontIndentOnAutoClose,I=M.length-1;I>=0;I--){var d=y[I];O.replaceRange(d.text,M[I].head,M[I].anchor,"+insert");var l=O.listSelections().slice(0);l[I]={head:d.newPos,anchor:d.newPos},O.setSelections(l),!f&&d.indent&&(O.indentLine(d.newPos.line,null,!0),O.indentLine(d.newPos.line+1,null,!0))}}function _(O,M){for(var y=O.listSelections(),C=[],I=M?"/":"</",w=O.getOption("autoCloseTags"),A=typeof w=="object"&&w.dontIndentOnSlash,S=0;S<y.length;S++){if(!y[S].empty())return fe.Pass;var h=y[S].head,o=O.getTokenAt(h),s=fe.innerMode(O.getMode(),o.state),u=s.state;if(M&&(o.type=="string"||o.string.charAt(0)!="<"||o.start!=h.ch-1))return fe.Pass;var x,c=s.mode.name!="xml"&&O.getMode().name=="htmlmixed";if(c&&s.mode.name=="javascript")x=I+"script";else if(c&&s.mode.name=="css")x=I+"style";else{var p=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(u);if(!p||p.length&&U(O,p,p[p.length-1],h))return fe.Pass;x=I+p[p.length-1]}O.getLine(h.line).charAt(o.end)!=">"&&(x+=">"),C[S]=x}if(O.replaceSelections(C),y=O.listSelections(),!A)for(var S=0;S<y.length;S++)(S==y.length-1||y[S].head.line<y[S+1].head.line)&&O.indentLine(y[S].head.line)}function L(O){return O.getOption("disableInput")?fe.Pass:_(O,!0)}fe.commands.closeTag=function(O){return _(O)};function W(O,M){if(O.indexOf)return O.indexOf(M);for(var y=0,C=O.length;y<C;++y)if(O[y]==M)return y;return-1}function U(O,M,y,C,I){if(!fe.scanForClosingTag)return!1;var w=Math.min(O.lastLine()+1,C.line+500),A=fe.scanForClosingTag(O,C,null,w);if(!A||A.tag!=y)return!1;for(var S=I?1:0,h=M.length-1;h>=0&&M[h]==y;h--)++S;C=A.to;for(var h=1;h<S;h++){var o=fe.scanForClosingTag(O,C,null,w);if(!o||o.tag!=y)return!1;C=o.to}return!0}})},BjJ7:function(_e,Oe,ee){"use strict";ee.d(Oe,"d",function(){return Z}),ee.d(Oe,"c",function(){return R}),ee.d(Oe,"e",function(){return Q}),ee.d(Oe,"b",function(){return _}),ee.d(Oe,"a",function(){return W});var fe=ee("m3rI");function Z(U){var O=!0;if(U.length>0){for(var M=0;M<U.length;M++)if(U[M].compile_success==0||!U[M].compile_success){O=!1;break}}else O=!1;return O}function R(U){for(var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",M=[],y=0;y<U.length;y++){var C=U[y],I=O?"".concat(O,"/").concat(C.name):"".concat(C.name);M.push({title:C.name,isLeaf:!(C.type==="tree"),key:I})}return M}function Q(U,O,M){for(var y=0;y<U.length;y++){var C=U[y];if(C.key===O){C.children=M;break}C.children&&Q(C.children,O,M)}return U}function _(U,O,M){var y;return function(){var C=this,I=arguments,w=function(){y=null,M||U.apply(C,I)},A=M&&!y;clearTimeout(y),y=setTimeout(w,O),A&&U.apply(C,I)}}var L=!0,W=fe.a.API_SERVER},"C+DQ":function(_e,Oe,ee){},CJF0:function(_e,Oe,ee){"use strict";var fe=ee("14J3"),Z=ee("BMrR"),R=ee("+L6B"),Q=ee("2/Rp"),_=ee("jCWc"),L=ee("kPKH"),W=ee("PpiC"),U=ee("q1tI"),O=ee.n(U),M=ee("Ty5D"),y=ee("9kvl"),C=ee("55Ip"),I=ee("lzim"),w=ee("nZ20"),A=ee.n(w),S=function(o){var s,u,x,c,p=o.shixunsDetail,D=o.dispatch,v=o.loading,f=o.match,d=o.data,l=d===void 0?{}:d,a=o.title,g=Object(W.a)(o,["shixunsDetail","dispatch","loading","match","data","title"]),m=Object(M.i)(),b=!(((s=p.detail)===null||s===void 0?void 0:s.identity)>4||((u=p.detail)===null||u===void 0?void 0:u.identity)===void 0||((x=p.detail)===null||x===void 0?void 0:x.shixun_status)===2||((c=p.detail)===null||c===void 0?void 0:c.shixun_status)===1);return O.a.createElement("aside",{className:"bg-white mb10 pl20 pr20 ".concat(A.a.wrap)},O.a.createElement(Z.a,{gutter:[20,20],align:"middle"},O.a.createElement(L.a,{flex:1},O.a.createElement("span",{className:A.a.icons},O.a.createElement("img",{src:I.d,width:"14"})),O.a.createElement("span",{className:"font16"},"\u7B2C ",l==null?void 0:l.position," \u5173\uFF1A",a)),O.a.createElement(L.a,null,(l==null?void 0:l.prev_challenge)&&O.a.createElement(Q.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var H,V=l.prev_challenge.st===0?"/editcheckpoint":"/editquestion",re="/shixuns/".concat(m.id,"/challenges/").concat(l==null||((H=l.prev_challenge)===null||H===void 0)?void 0:H.id).concat(V);y.d.replace(re)}},"\u4E0A\u4E00\u5173"),l.next_challenge&&O.a.createElement(Q.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var H,V=l.next_challenge.st===0?"/editcheckpoint":"/editquestion",re="/shixuns/".concat(m.id,"/challenges/").concat(l==null||((H=l.next_challenge)===null||H===void 0)?void 0:H.id).concat(V);y.d.replace(re)}},"\u4E0B\u4E00\u5173"),b&&O.a.createElement(Q.a,{type:"primary"},O.a.createElement(C.a,{to:"/shixuns/".concat(m.id,"/challenges/newquestion")},"\u65B0\u589E\u9009\u62E9\u9898\u4EFB\u52A1")),b&&O.a.createElement(Q.a,{type:"primary",className:"ml5"},O.a.createElement(C.a,{to:"/shixuns/".concat(m.id,"/challenges/new")},"\u65B0\u589E\u5B9E\u8DF5\u4EFB\u52A1")),O.a.createElement(Q.a,{type:"primary",className:"ml5"},O.a.createElement(C.a,{to:"/shixuns/".concat(m.id,"/challenges")},"\u8FD4\u56DE")))))};Oe.a=Object(y.a)(function(h){var o=h.shixunsDetail,s=h.newCourse,u=h.loading,x=h.globalSetting;return{shixunsDetail:o,newCourse:s,globalSetting:x,loading:u.effects}})(S)},DlQD:function(_e,Oe,ee){(function(fe,Z){_e.exports=Z()})(this,function(){"use strict";function fe(J,ne){for(var se=0;se<ne.length;se++){var q=ne[se];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(J,q.key,q)}}function Z(J,ne,se){return ne&&fe(J.prototype,ne),se&&fe(J,se),J}function R(J,ne){if(!J)return;if(typeof J=="string")return Q(J,ne);var se=Object.prototype.toString.call(J).slice(8,-1);if(se==="Object"&&J.constructor&&(se=J.constructor.name),se==="Map"||se==="Set")return Array.from(J);if(se==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(se))return Q(J,ne)}function Q(J,ne){(ne==null||ne>J.length)&&(ne=J.length);for(var se=0,q=new Array(ne);se<ne;se++)q[se]=J[se];return q}function _(J,ne){var se;if(typeof Symbol=="undefined"||J[Symbol.iterator]==null){if(Array.isArray(J)||(se=R(J))||ne&&J&&typeof J.length=="number"){se&&(J=se);var q=0;return function(){return q>=J.length?{done:!0}:{done:!1,value:J[q++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return se=J[Symbol.iterator](),se.next.bind(se)}function L(J,ne){return ne={exports:{}},J(ne,ne.exports),ne.exports}var W=L(function(J){function ne(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function se(q){J.exports.defaults=q}J.exports={defaults:ne(),getDefaults:ne,changeDefaults:se}}),U=W.defaults,O=W.getDefaults,M=W.changeDefaults,y=/[&<>"']/,C=/[&<>"']/g,I=/[<>"']|&(?!#?\w+;)/,w=/[<>"']|&(?!#?\w+;)/g,A={"&":"&","<":"<",">":">",'"':""","'":"'"},S=function(ne){return A[ne]};function h(J,ne){if(ne){if(y.test(J))return J.replace(C,S)}else if(I.test(J))return J.replace(w,S);return J}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(J){return J.replace(o,function(ne,se){return se=se.toLowerCase(),se==="colon"?":":se.charAt(0)==="#"?se.charAt(1)==="x"?String.fromCharCode(parseInt(se.substring(2),16)):String.fromCharCode(+se.substring(1)):""})}var u=/(^|[^\[])\^/g;function x(J,ne){J=J.source||J,ne=ne||"";var se={replace:function(ie,le){return le=le.source||le,le=le.replace(u,"$1"),J=J.replace(ie,le),se},getRegex:function(){return new RegExp(J,ne)}};return se}var c=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(J,ne,se){if(J){var q;try{q=decodeURIComponent(s(se)).replace(c,"").toLowerCase()}catch(ie){return null}if(q.indexOf("javascript:")===0||q.indexOf("vbscript:")===0||q.indexOf("data:")===0)return null}ne&&!p.test(se)&&(se=a(ne,se));try{se=encodeURI(se).replace(/%25/g,"%")}catch(ie){return null}return se}var v={},f=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(J,ne){v[" "+J]||(f.test(J)?v[" "+J]=J+"/":v[" "+J]=P(J,"/",!0)),J=v[" "+J];var se=J.indexOf(":")===-1;return ne.substring(0,2)==="//"?se?ne:J.replace(d,"$1")+ne:ne.charAt(0)==="/"?se?ne:J.replace(l,"$1")+ne:J+ne}var g={exec:function(){}};function m(J){for(var ne=1,se,q;ne<arguments.length;ne++){se=arguments[ne];for(q in se)Object.prototype.hasOwnProperty.call(se,q)&&(J[q]=se[q])}return J}function b(J,ne){var se=J.replace(/\|/g,function(le,he,ge){for(var ye=!1,ke=he;--ke>=0&&ge[ke]==="\\";)ye=!ye;return ye?"|":" |"}),q=se.split(/ \|/),ie=0;if(q.length>ne)q.splice(ne);else for(;q.length<ne;)q.push("");for(;ie<q.length;ie++)q[ie]=q[ie].trim().replace(/\\\|/g,"|");return q}function P(J,ne,se){var q=J.length;if(q===0)return"";for(var ie=0;ie<q;){var le=J.charAt(q-ie-1);if(le===ne&&!se)ie++;else if(le!==ne&&se)ie++;else break}return J.substr(0,q-ie)}function H(J,ne){if(J.indexOf(ne[1])===-1)return-1;for(var se=J.length,q=0,ie=0;ie<se;ie++)if(J[ie]==="\\")ie++;else if(J[ie]===ne[0])q++;else if(J[ie]===ne[1]&&(q--,q<0))return ie;return-1}function V(J){J&&J.sanitize&&!J.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var re={escape:h,unescape:s,edit:x,cleanUrl:D,resolveUrl:a,noopTest:g,merge:m,splitCells:b,rtrim:P,findClosingBracket:H,checkSanitizeDeprecation:V},z=W.defaults,F=re.rtrim,ae=re.splitCells,ce=re.escape,me=re.findClosingBracket;function be(J,ne,se){var q=ne.href,ie=ne.title?ce(ne.title):null,le=J[1].replace(/\\([\[\]])/g,"$1");return J[0].charAt(0)!=="!"?{type:"link",raw:se,href:q,title:ie,text:le}:{type:"image",raw:se,href:q,title:ie,text:ce(le)}}function Be(J,ne){var se=J.match(/^(\s+)(?:```)/);if(se===null)return ne;var q=se[1];return ne.split(`
|
|
`).map(function(ie){var le=ie.match(/^\s+/);if(le===null)return ie;var he=le[0];return he.length>=q.length?ie.slice(q.length):ie}).join(`
|
|
`)}var Ce=function(){function J(se){this.options=se||z}var ne=J.prototype;return ne.space=function(q){var ie=this.rules.block.newline.exec(q);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
|
|
`}},ne.code=function(q,ie){var le=this.rules.block.code.exec(q);if(le){var he=ie[ie.length-1];if(he&&he.type==="paragraph")return{raw:le[0],text:le[0].trimRight()};var ge=le[0].replace(/^ {4}/gm,"");return{type:"code",raw:le[0],codeBlockStyle:"indented",text:this.options.pedantic?ge:F(ge,`
|
|
`)}}},ne.fences=function(q){var ie=this.rules.block.fences.exec(q);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}}},ne.heading=function(q){var ie=this.rules.block.heading.exec(q);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},ne.nptable=function(q){var ie=this.rules.block.nptable.exec(q);if(ie){var le={type:"table",header:ae(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ie[0]};if(le.header.length===le.align.length){var he=le.align.length,ge;for(ge=0;ge<he;ge++)/^ *-+: *$/.test(le.align[ge])?le.align[ge]="right":/^ *:-+: *$/.test(le.align[ge])?le.align[ge]="center":/^ *:-+ *$/.test(le.align[ge])?le.align[ge]="left":le.align[ge]=null;for(he=le.cells.length,ge=0;ge<he;ge++)le.cells[ge]=ae(le.cells[ge],le.header.length);return le}}},ne.hr=function(q){var ie=this.rules.block.hr.exec(q);if(ie)return{type:"hr",raw:ie[0]}},ne.blockquote=function(q){var ie=this.rules.block.blockquote.exec(q);if(ie){var le=ie[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ie[0],text:le}}},ne.list=function(q){var ie=this.rules.block.list.exec(q);if(ie){for(var le=ie[0],he=ie[2],ge=he.length>1,ye=he[he.length-1]===")",ke={type:"list",raw:le,ordered:ge,start:ge?+he.slice(0,-1):"",loose:!1,items:[]},He=ie[0].match(this.rules.block.item),tt=!1,it,vt,st,nt,Tt,Et,_t,Mt=He.length,xt=0;xt<Mt;xt++)it=He[xt],le=it,vt=it.length,it=it.replace(/^ *([*+-]|\d+[.)]) */,""),~it.indexOf(`
|
|
`)&&(vt-=it.length,it=this.options.pedantic?it.replace(/^ {1,4}/gm,""):it.replace(new RegExp("^ {1,"+vt+"}","gm"),"")),xt!==Mt-1&&(st=this.rules.block.bullet.exec(He[xt+1])[0],(ge?st.length===1||!ye&&st[st.length-1]===")":st.length>1||this.options.smartLists&&st!==he)&&(nt=He.slice(xt+1).join(`
|
|
`),ke.raw=ke.raw.substring(0,ke.raw.length-nt.length),xt=Mt-1)),Tt=tt||/\n\n(?!\s*$)/.test(it),xt!==Mt-1&&(tt=it.charAt(it.length-1)===`
|
|
`,Tt||(Tt=tt)),Tt&&(ke.loose=!0),Et=/^\[[ xX]\] /.test(it),_t=void 0,Et&&(_t=it[1]!==" ",it=it.replace(/^\[[ xX]\] +/,"")),ke.items.push({type:"list_item",raw:le,task:Et,checked:_t,loose:Tt,text:it});return ke}},ne.html=function(q){var ie=this.rules.block.html.exec(q);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]}},ne.def=function(q){var ie=this.rules.block.def.exec(q);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var le=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:le,raw:ie[0],href:ie[2],title:ie[3]}}},ne.table=function(q){var ie=this.rules.block.table.exec(q);if(ie){var le={type:"table",header:ae(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[]};if(le.header.length===le.align.length){le.raw=ie[0];var he=le.align.length,ge;for(ge=0;ge<he;ge++)/^ *-+: *$/.test(le.align[ge])?le.align[ge]="right":/^ *:-+: *$/.test(le.align[ge])?le.align[ge]="center":/^ *:-+ *$/.test(le.align[ge])?le.align[ge]="left":le.align[ge]=null;for(he=le.cells.length,ge=0;ge<he;ge++)le.cells[ge]=ae(le.cells[ge].replace(/^ *\| *| *\| *$/g,""),le.header.length);return le}}},ne.lheading=function(q){var ie=this.rules.block.lheading.exec(q);if(ie)return{type:"heading",raw:ie[0],depth:ie[2].charAt(0)==="="?1:2,text:ie[1]}},ne.paragraph=function(q){var ie=this.rules.block.paragraph.exec(q);if(ie)return{type:"paragraph",raw:ie[0],text:ie[1].charAt(ie[1].length-1)===`
|
|
`?ie[1].slice(0,-1):ie[1]}},ne.text=function(q,ie){var le=this.rules.block.text.exec(q);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]}}},ne.escape=function(q){var ie=this.rules.inline.escape.exec(q);if(ie)return{type:"escape",raw:ie[0],text:ce(ie[1])}},ne.tag=function(q,ie,le){var he=this.rules.inline.tag.exec(q);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]}},ne.link=function(q){var ie=this.rules.inline.link.exec(q);if(ie){var le=me(ie[2],"()");if(le>-1){var he=ie[0].indexOf("!")===0?5:4,ge=he+ie[1].length+le;ie[2]=ie[2].substring(0,le),ie[0]=ie[0].substring(0,ge).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 tt=be(ie,{href:ye&&ye.replace(this.rules.inline._escapes,"$1"),title:ke&&ke.replace(this.rules.inline._escapes,"$1")},ie[0]);return tt}},ne.reflink=function(q,ie){var le;if((le=this.rules.inline.reflink.exec(q))||(le=this.rules.inline.nolink.exec(q))){var he=(le[2]||le[1]).replace(/\s+/g," ");if(he=ie[he.toLowerCase()],!he||!he.href){var ge=le[0].charAt(0);return{type:"text",raw:ge,text:ge}}var ye=be(le,he,le[0]);return ye}},ne.strong=function(q,ie,le){le===void 0&&(le="");var he=this.rules.inline.strong.start.exec(q);if(he&&(!he[1]||he[1]&&(le===""||this.rules.inline.punctuation.exec(le)))){ie=ie.slice(-1*q.length);var ge=he[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ge.lastIndex=0;for(var ye;(he=ge.exec(ie))!=null;)if(ye=this.rules.inline.strong.middle.exec(ie.slice(0,he.index+3)),ye)return{type:"strong",raw:q.slice(0,ye[0].length),text:q.slice(2,ye[0].length-2)}}},ne.em=function(q,ie,le){le===void 0&&(le="");var he=this.rules.inline.em.start.exec(q);if(he&&(!he[1]||he[1]&&(le===""||this.rules.inline.punctuation.exec(le)))){ie=ie.slice(-1*q.length);var ge=he[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ge.lastIndex=0;for(var ye;(he=ge.exec(ie))!=null;)if(ye=this.rules.inline.em.middle.exec(ie.slice(0,he.index+2)),ye)return{type:"em",raw:q.slice(0,ye[0].length),text:q.slice(1,ye[0].length-1)}}},ne.codespan=function(q){var ie=this.rules.inline.code.exec(q);if(ie){var le=ie[2].replace(/\n/g," "),he=/[^ ]/.test(le),ge=le.startsWith(" ")&&le.endsWith(" ");return he&&ge&&(le=le.substring(1,le.length-1)),le=ce(le,!0),{type:"codespan",raw:ie[0],text:le}}},ne.br=function(q){var ie=this.rules.inline.br.exec(q);if(ie)return{type:"br",raw:ie[0]}},ne.del=function(q){var ie=this.rules.inline.del.exec(q);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},ne.autolink=function(q,ie){var le=this.rules.inline.autolink.exec(q);if(le){var he,ge;return le[2]==="@"?(he=ce(this.options.mangle?ie(le[1]):le[1]),ge="mailto:"+he):(he=ce(le[1]),ge=he),{type:"link",raw:le[0],text:he,href:ge,tokens:[{type:"text",raw:he,text:he}]}}},ne.url=function(q,ie){var le;if(le=this.rules.inline.url.exec(q)){var he,ge;if(le[2]==="@")he=ce(this.options.mangle?ie(le[0]):le[0]),ge="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."?ge="http://"+he:ge=he}return{type:"link",raw:le[0],text:he,href:ge,tokens:[{type:"text",raw:he,text:he}]}}},ne.inlineText=function(q,ie,le){var he=this.rules.inline.text.exec(q);if(he){var ge;return ie?ge=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):ce(he[0]):he[0]:ge=ce(this.options.smartypants?le(he[0]):he[0]),{type:"text",raw:he[0],text:ge}}},J}(),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 j={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])/};j._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",j.punctuation=Te(j.punctuation).replace(/punctuation/g,j._punctuation).getRegex(),j._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",j._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",j.em.start=Te(j.em.start).replace(/punctuation/g,j._punctuation).getRegex(),j.em.middle=Te(j.em.middle).replace(/punctuation/g,j._punctuation).replace(/overlapSkip/g,j._overlapSkip).getRegex(),j.em.endAst=Te(j.em.endAst,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.em.endUnd=Te(j.em.endUnd,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.strong.start=Te(j.strong.start).replace(/punctuation/g,j._punctuation).getRegex(),j.strong.middle=Te(j.strong.middle).replace(/punctuation/g,j._punctuation).replace(/blockSkip/g,j._blockSkip).getRegex(),j.strong.endAst=Te(j.strong.endAst,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.strong.endUnd=Te(j.strong.endUnd,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.blockSkip=Te(j._blockSkip,"g").getRegex(),j.overlapSkip=Te(j._overlapSkip,"g").getRegex(),j._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,j._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,j._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,j.autolink=Te(j.autolink).replace("scheme",j._scheme).replace("email",j._email).getRegex(),j._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,j.tag=Te(j.tag).replace("comment",ve._comment).replace("attribute",j._attribute).getRegex(),j._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,j._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,j._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,j.link=Te(j.link).replace("label",j._label).replace("href",j._href).replace("title",j._title).getRegex(),j.reflink=Te(j.reflink).replace("label",j._label).getRegex(),j.reflinkSearch=Te(j.reflinkSearch,"g").replace("reflink",j.reflink).replace("nolink",j.nolink).getRegex(),j.normal=we({},j),j.pedantic=we({},j.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",j._label).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",j._label).getRegex()}),j.gfm=we({},j.normal,{escape:Te(j.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),j.gfm.url=Te(j.gfm.url,"i").replace("email",j.gfm._extended_email).getRegex(),j.breaks=we({},j.gfm,{br:Te(j.br).replace("{2,}","*").getRegex(),text:Te(j.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var T={block:ve,inline:j},k=W.defaults,G=T.block,$=T.inline;function N(J){return J.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function ue(J){var ne="",se,q,ie=J.length;for(se=0;se<ie;se++)q=J.charCodeAt(se),Math.random()>.5&&(q="x"+q.toString(16)),ne+="&#"+q+";";return ne}var Ee=function(){function J(se){this.tokens=[],this.tokens.links=Object.create(null),this.options=se||k,this.options.tokenizer=this.options.tokenizer||new Ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var q={block:G.normal,inline:$.normal};this.options.pedantic?(q.block=G.pedantic,q.inline=$.pedantic):this.options.gfm&&(q.block=G.gfm,this.options.breaks?q.inline=$.breaks:q.inline=$.gfm),this.tokenizer.rules=q}J.lex=function(q,ie){var le=new J(ie);return le.lex(q)};var ne=J.prototype;return ne.lex=function(q){return q=q.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(q,this.tokens,!0),this.inline(this.tokens),this.tokens},ne.blockTokens=function(q,ie,le){ie===void 0&&(ie=[]),le===void 0&&(le=!0),q=q.replace(/^ +$/gm,"");for(var he,ge,ye,ke;q;){if(he=this.tokenizer.space(q)){q=q.substring(he.raw.length),he.type&&ie.push(he);continue}if(he=this.tokenizer.code(q,ie)){q=q.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(q)){q=q.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.heading(q)){q=q.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.nptable(q)){q=q.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.hr(q)){q=q.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.blockquote(q)){q=q.substring(he.raw.length),he.tokens=this.blockTokens(he.text,[],le),ie.push(he);continue}if(he=this.tokenizer.list(q)){for(q=q.substring(he.raw.length),ye=he.items.length,ge=0;ge<ye;ge++)he.items[ge].tokens=this.blockTokens(he.items[ge].text,[],!1);ie.push(he);continue}if(he=this.tokenizer.html(q)){q=q.substring(he.raw.length),ie.push(he);continue}if(le&&(he=this.tokenizer.def(q))){q=q.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(q)){q=q.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.lheading(q)){q=q.substring(he.raw.length),ie.push(he);continue}if(le&&(he=this.tokenizer.paragraph(q))){q=q.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.text(q,ie)){q=q.substring(he.raw.length),he.type?ie.push(he):(ke=ie[ie.length-1],ke.raw+=`
|
|
`+he.raw,ke.text+=`
|
|
`+he.text);continue}if(q){var He="Infinite loop on byte: "+q.charCodeAt(0);if(this.options.silent){console.error(He);break}else throw new Error(He)}}return ie},ne.inline=function(q){var ie,le,he,ge,ye,ke,He=q.length;for(ie=0;ie<He;ie++){ke=q[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:[]},ge=ke.header.length,le=0;le<ge;le++)ke.tokens.header[le]=[],this.inlineTokens(ke.header[le],ke.tokens.header[le]);for(ge=ke.cells.length,le=0;le<ge;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(ge=ke.items.length,le=0;le<ge;le++)this.inline(ke.items[le].tokens);break}}}return q},ne.inlineTokens=function(q,ie,le,he,ge){ie===void 0&&(ie=[]),le===void 0&&(le=!1),he===void 0&&(he=!1),ge===void 0&&(ge="");var ye,ke=q,He;if(this.tokens.links){var tt=Object.keys(this.tokens.links);if(tt.length>0)for(;(He=this.tokenizer.rules.inline.reflinkSearch.exec(ke))!=null;)tt.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(;q;){if(ye=this.tokenizer.escape(q)){q=q.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.tag(q,le,he)){q=q.substring(ye.raw.length),le=ye.inLink,he=ye.inRawBlock,ie.push(ye);continue}if(ye=this.tokenizer.link(q)){q=q.substring(ye.raw.length),ye.type==="link"&&(ye.tokens=this.inlineTokens(ye.text,[],!0,he)),ie.push(ye);continue}if(ye=this.tokenizer.reflink(q,this.tokens.links)){q=q.substring(ye.raw.length),ye.type==="link"&&(ye.tokens=this.inlineTokens(ye.text,[],!0,he)),ie.push(ye);continue}if(ye=this.tokenizer.strong(q,ke,ge)){q=q.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],le,he),ie.push(ye);continue}if(ye=this.tokenizer.em(q,ke,ge)){q=q.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],le,he),ie.push(ye);continue}if(ye=this.tokenizer.codespan(q)){q=q.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.br(q)){q=q.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.del(q)){q=q.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],le,he),ie.push(ye);continue}if(ye=this.tokenizer.autolink(q,ue)){q=q.substring(ye.raw.length),ie.push(ye);continue}if(!le&&(ye=this.tokenizer.url(q,ue))){q=q.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.inlineText(q,he,N)){q=q.substring(ye.raw.length),ge=ye.raw.slice(-1),ie.push(ye);continue}if(q){var it="Infinite loop on byte: "+q.charCodeAt(0);if(this.options.silent){console.error(it);break}else throw new Error(it)}}return ie},Z(J,null,[{key:"rules",get:function(){return{block:G,inline:$}}}]),J}(),De=W.defaults,Ne=re.cleanUrl,Re=re.escape,Ie=function(){function J(se){this.options=se||De}var ne=J.prototype;return ne.code=function(q,ie,le){var he=(ie||"").match(/\S*/)[0];if(this.options.highlight){var ge=this.options.highlight(q,he);ge!=null&&ge!==q&&(le=!0,q=ge)}return he?'<pre><code class="'+this.options.langPrefix+Re(he,!0)+'">'+(le?q:Re(q,!0))+`</code></pre>
|
|
`:"<pre><code>"+(le?q:Re(q,!0))+`</code></pre>
|
|
`},ne.blockquote=function(q){return`<blockquote>
|
|
`+q+`</blockquote>
|
|
`},ne.html=function(q){return q},ne.heading=function(q,ie,le,he){return this.options.headerIds?"<h"+ie+' id="'+this.options.headerPrefix+he.slug(le)+'">'+q+"</h"+ie+`>
|
|
`:"<h"+ie+">"+q+"</h"+ie+`>
|
|
`},ne.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ne.list=function(q,ie,le){var he=ie?"ol":"ul",ge=ie&&le!==1?' start="'+le+'"':"";return"<"+he+ge+`>
|
|
`+q+"</"+he+`>
|
|
`},ne.listitem=function(q){return"<li>"+q+`</li>
|
|
`},ne.checkbox=function(q){return"<input "+(q?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ne.paragraph=function(q){return"<p>"+q+`</p>
|
|
`},ne.table=function(q,ie){return ie&&(ie="<tbody>"+ie+"</tbody>"),`<table>
|
|
<thead>
|
|
`+q+`</thead>
|
|
`+ie+`</table>
|
|
`},ne.tablerow=function(q){return`<tr>
|
|
`+q+`</tr>
|
|
`},ne.tablecell=function(q,ie){var le=ie.header?"th":"td",he=ie.align?"<"+le+' align="'+ie.align+'">':"<"+le+">";return he+q+"</"+le+`>
|
|
`},ne.strong=function(q){return"<strong>"+q+"</strong>"},ne.em=function(q){return"<em>"+q+"</em>"},ne.codespan=function(q){return"<code>"+q+"</code>"},ne.br=function(){return this.options.xhtml?"<br/>":"<br>"},ne.del=function(q){return"<del>"+q+"</del>"},ne.link=function(q,ie,le){if(q=Ne(this.options.sanitize,this.options.baseUrl,q),q===null)return le;var he='<a href="'+Re(q)+'"';return ie&&(he+=' title="'+ie+'"'),he+=">"+le+"</a>",he},ne.image=function(q,ie,le){if(q=Ne(this.options.sanitize,this.options.baseUrl,q),q===null)return le;var he='<img src="'+q+'" alt="'+le+'"';return ie&&(he+=' title="'+ie+'"'),he+=this.options.xhtml?"/>":">",he},ne.text=function(q){return q},J}(),Pe=function(){function J(){}var ne=J.prototype;return ne.strong=function(q){return q},ne.em=function(q){return q},ne.codespan=function(q){return q},ne.del=function(q){return q},ne.html=function(q){return q},ne.text=function(q){return q},ne.link=function(q,ie,le){return""+le},ne.image=function(q,ie,le){return""+le},ne.br=function(){return""},J}(),Ge=function(){function J(){this.seen={}}var ne=J.prototype;return ne.slug=function(q){var ie=q.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var le=ie;do this.seen[le]++,ie=le+"-"+this.seen[le];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},J}(),Ke=W.defaults,Ye=re.unescape,Xe=function(){function J(se){this.options=se||Ke,this.options.renderer=this.options.renderer||new Ie,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Pe,this.slugger=new Ge}J.parse=function(q,ie){var le=new J(ie);return le.parse(q)};var ne=J.prototype;return ne.parse=function(q,ie){ie===void 0&&(ie=!0);var le="",he,ge,ye,ke,He,tt,it,vt,st,nt,Tt,Et,_t,Mt,xt,mr,Cr,Yt,gr=q.length;for(he=0;he<gr;he++){nt=q[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,Ye(this.parseInline(nt.tokens,this.textRenderer)),this.slugger);continue}case"code":{le+=this.renderer.code(nt.text,nt.lang,nt.escaped);continue}case"table":{for(vt="",it="",ke=nt.header.length,ge=0;ge<ke;ge++)it+=this.renderer.tablecell(this.parseInline(nt.tokens.header[ge]),{header:!0,align:nt.align[ge]});for(vt+=this.renderer.tablerow(it),st="",ke=nt.cells.length,ge=0;ge<ke;ge++){for(tt=nt.tokens.cells[ge],it="",He=tt.length,ye=0;ye<He;ye++)it+=this.renderer.tablecell(this.parseInline(tt[ye]),{header:!1,align:nt.align[ye]});st+=this.renderer.tablerow(it)}le+=this.renderer.table(vt,st);continue}case"blockquote":{st=this.parse(nt.tokens),le+=this.renderer.blockquote(st);continue}case"list":{for(Tt=nt.ordered,Et=nt.start,_t=nt.loose,ke=nt.items.length,st="",ge=0;ge<ke;ge++)xt=nt.items[ge],mr=xt.checked,Cr=xt.task,Mt="",xt.task&&(Yt=this.renderer.checkbox(mr),_t?xt.tokens.length>0&&xt.tokens[0].type==="text"?(xt.tokens[0].text=Yt+" "+xt.tokens[0].text,xt.tokens[0].tokens&&xt.tokens[0].tokens.length>0&&xt.tokens[0].tokens[0].type==="text"&&(xt.tokens[0].tokens[0].text=Yt+" "+xt.tokens[0].tokens[0].text)):xt.tokens.unshift({type:"text",text:Yt}):Mt+=Yt),Mt+=this.parse(xt.tokens,_t),st+=this.renderer.listitem(Mt,Cr,mr);le+=this.renderer.list(st,Tt,Et);continue}case"html":{le+=this.renderer.html(nt.text);continue}case"paragraph":{le+=this.renderer.paragraph(this.parseInline(nt.tokens));continue}case"text":{for(st=nt.tokens?this.parseInline(nt.tokens):nt.text;he+1<gr&&q[he+1].type==="text";)nt=q[++he],st+=`
|
|
`+(nt.tokens?this.parseInline(nt.tokens):nt.text);le+=ie?this.renderer.paragraph(st):st;continue}default:{var cr='Token with "'+nt.type+'" type was not found.';if(this.options.silent){console.error(cr);return}else throw new Error(cr)}}}return le},ne.parseInline=function(q,ie){ie=ie||this.renderer;var le="",he,ge,ye=q.length;for(he=0;he<ye;he++){ge=q[he];switch(ge.type){case"escape":{le+=ie.text(ge.text);break}case"html":{le+=ie.html(ge.text);break}case"link":{le+=ie.link(ge.href,ge.title,this.parseInline(ge.tokens,ie));break}case"image":{le+=ie.image(ge.href,ge.title,ge.text);break}case"strong":{le+=ie.strong(this.parseInline(ge.tokens,ie));break}case"em":{le+=ie.em(this.parseInline(ge.tokens,ie));break}case"codespan":{le+=ie.codespan(ge.text);break}case"br":{le+=ie.br();break}case"del":{le+=ie.del(this.parseInline(ge.tokens,ie));break}case"text":{le+=ie.text(ge.text);break}default:{var ke='Token with "'+ge.type+'" type was not found.';if(this.options.silent){console.error(ke);return}else throw new Error(ke)}}}return le},J}(),at=re.merge,qe=re.checkSanitizeDeprecation,ze=re.escape,Ae=W.getDefaults,Je=W.changeDefaults,Ze=W.defaults;function oe(J,ne,se){if(typeof J=="undefined"||J===null)throw new Error("marked(): input parameter is undefined or null");if(typeof J!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(J)+", string expected");if(typeof ne=="function"&&(se=ne,ne=null),ne=at({},oe.defaults,ne||{}),qe(ne),se){var q=ne.highlight,ie;try{ie=Ee.lex(J,ne)}catch(ye){return se(ye)}var le=function(ke){var He;if(!ke)try{He=Xe.parse(ie,ne)}catch(tt){ke=tt}return ne.highlight=q,ke?se(ke):se(null,He)};if(!q||q.length<3)return le();if(delete ne.highlight,!ie.length)return le();var he=0;oe.walkTokens(ie,function(ye){ye.type==="code"&&(he++,setTimeout(function(){q(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 ge=Ee.lex(J,ne);return ne.walkTokens&&oe.walkTokens(ge,ne.walkTokens),Xe.parse(ge,ne)}catch(ye){if(ye.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ne.silent)return"<p>An error occurred:</p><pre>"+ze(ye.message+"",!0)+"</pre>";throw ye}}oe.options=oe.setOptions=function(J){return at(oe.defaults,J),Je(oe.defaults),oe},oe.getDefaults=Ae,oe.defaults=Ze,oe.use=function(J){var ne=at({},J);if(J.renderer&&function(){var q=oe.defaults.renderer||new Ie,ie=function(ge){var ye=q[ge];q[ge]=function(){for(var ke=arguments.length,He=new Array(ke),tt=0;tt<ke;tt++)He[tt]=arguments[tt];var it=J.renderer[ge].apply(q,He);return it===!1&&(it=ye.apply(q,He)),it}};for(var le in J.renderer)ie(le);ne.renderer=q}(),J.tokenizer&&function(){var q=oe.defaults.tokenizer||new Ce,ie=function(ge){var ye=q[ge];q[ge]=function(){for(var ke=arguments.length,He=new Array(ke),tt=0;tt<ke;tt++)He[tt]=arguments[tt];var it=J.tokenizer[ge].apply(q,He);return it===!1&&(it=ye.apply(q,He)),it}};for(var le in J.tokenizer)ie(le);ne.tokenizer=q}(),J.walkTokens){var se=oe.defaults.walkTokens;ne.walkTokens=function(q){J.walkTokens(q),se&&se(q)}}oe.setOptions(ne)},oe.walkTokens=function(J,ne){for(var se=_(J),q;!(q=se()).done;){var ie=q.value;ne(ie);switch(ie.type){case"table":{for(var le=_(ie.tokens.header),he;!(he=le()).done;){var ge=he.value;oe.walkTokens(ge,ne)}for(var ye=_(ie.tokens.cells),ke;!(ke=ye()).done;)for(var He=ke.value,tt=_(He),it;!(it=tt()).done;){var vt=it.value;oe.walkTokens(vt,ne)}break}case"list":{oe.walkTokens(ie.items,ne);break}default:ie.tokens&&oe.walkTokens(ie.tokens,ne)}}},oe.Parser=Xe,oe.parser=Xe.parse,oe.Renderer=Ie,oe.TextRenderer=Pe,oe.Lexer=Ee,oe.lexer=Ee.lex,oe.Tokenizer=Ce,oe.Slugger=Ge,oe.parse=oe;var X=oe;return X})},E7E6:function(_e,Oe){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADUCAYAAADZTGx+AAAgAElEQVR4Xu2dC3BU13nHv7MrIQkQQoCEtAIEAmxig4GACxhogpM6NY7jOKZO4nimwcFot23SNNNO02napJN0JjN9TNMm5eG3x4+YSeI3ftUGjCDGQMBgG4wxb+0u4mEeQhJI2tP539WR7i77uPfuvXfvar8zs7Mr7bnn8Z3vt9/5zlMQB5aAQQmsW7fO397eHujp6Rkfi8XGExFeDX2vABHVSSlrhBDDiKhdSnlOCBGWUu4mol1lZWWv3nfffccNZueJaMITpeBCeEICjz/++LCOjo5GIpogpWwUQjT2vU/A/wCClNJvtbBCCCml3CaEeGzChAmPLF269LLVtNx6jgFxS9IeyOehhx6q7OnpmSilnEhE2gsA4L0PhjHZillRUUHl5WUUf6+giopyKi+Pv8rKyrSX3++nnp4e7XXpUgedP3+ezp37lE6ebKPe3l4tCyFEhIj+UwjxaHNz8+ls+ebrewYkX5J3IN9169YNv3DhwsRYLIbXJAWBDoZRmbKFYkPRhw4dqgEwdCgAwOfyPiDKyefzWS454Dh58iQdPPiJBk0fKN1E9KyU8gehUKjVcuIOPciAOCRYJ5J95JFHyq9cuaJZACHEJCklIOgHQUqZ0QIAACg/FB+//niPwxD/H3793QqwJkePHqW2tjaSUsKinCOibwWDwfVulcFIPgyIESm5FGfDhg0lBw8ehOM7qbe3dxIggC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Q7W1tUdwsnmOOjWoHmdALDbn+fPnR3V2dgKW0ULEqmIxUSWlHCmErJJSVAlBVVIS3kcS4X9ULoQolVKWZnpHcaSU3UKI7szv1EUkzuNSKSEI7+eFkOelFOeFEOd8Pnz24fOZioqKcFVV1VmLVS3qx/4fQLyzKIIkCJoAAAAASUVORK5CYII="},ELLl:function(_e,Oe,ee){(function(fe){fe(ee("VrN/"))})(function(fe){var Z={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},R=fe.Pos;fe.defineOption("autoCloseBrackets",!1,function(A,S,h){h&&h!=fe.Init&&(A.removeKeyMap(_),A.state.closeBrackets=null),S&&(L(Q(S,"pairs")),A.state.closeBrackets=S,A.addKeyMap(_))});function Q(A,S){return S=="pairs"&&typeof A=="string"?A:typeof A=="object"&&A[S]!=null?A[S]:Z[S]}var _={Backspace:O,Enter:M};function L(A){for(var S=0;S<A.length;S++){var h=A.charAt(S),o="'"+h+"'";_[o]||(_[o]=W(h))}}L(Z.pairs+"`");function W(A){return function(S){return C(S,A)}}function U(A){var S=A.state.closeBrackets;if(!S||S.override)return S;var h=A.getModeAt(A.getCursor());return h.closeBrackets||S}function O(A){var S=U(A);if(!S||A.getOption("disableInput"))return fe.Pass;for(var h=Q(S,"pairs"),o=A.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return fe.Pass;var u=I(A,o[s].head);if(!u||h.indexOf(u)%2!=0)return fe.Pass}for(var s=o.length-1;s>=0;s--){var x=o[s].head;A.replaceRange("",R(x.line,x.ch-1),R(x.line,x.ch+1),"+delete")}}function M(A){var S=U(A),h=S&&Q(S,"explode");if(!h||A.getOption("disableInput"))return fe.Pass;for(var o=A.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return fe.Pass;var u=I(A,o[s].head);if(!u||h.indexOf(u)%2!=0)return fe.Pass}A.operation(function(){var x=A.lineSeparator()||`
|
|
`;A.replaceSelection(x+x,null),A.execCommand("goCharLeft"),o=A.listSelections();for(var c=0;c<o.length;c++){var p=o[c].head.line;A.indentLine(p,null,!0),A.indentLine(p+1,null,!0)}})}function y(A){var S=fe.cmpPos(A.anchor,A.head)>0;return{anchor:new R(A.anchor.line,A.anchor.ch+(S?-1:1)),head:new R(A.head.line,A.head.ch+(S?1:-1))}}function C(A,S){var h=U(A);if(!h||A.getOption("disableInput"))return fe.Pass;var o=Q(h,"pairs"),s=o.indexOf(S);if(s==-1)return fe.Pass;for(var u=Q(h,"closeBefore"),x=Q(h,"triples"),c=o.charAt(s+1)==S,p=A.listSelections(),D=s%2==0,v,f=0;f<p.length;f++){var d=p[f],l=d.head,a,g=A.getRange(l,R(l.line,l.ch+1));if(D&&!d.empty())a="surround";else if((c||!D)&&g==S)c&&w(A,l)?a="both":x.indexOf(S)>=0&&A.getRange(l,R(l.line,l.ch+3))==S+S+S?a="skipThree":a="skip";else if(c&&l.ch>1&&x.indexOf(S)>=0&&A.getRange(R(l.line,l.ch-2),l)==S+S){if(l.ch>2&&/\bstring/.test(A.getTokenTypeAt(R(l.line,l.ch-2))))return fe.Pass;a="addFour"}else if(c){var m=l.ch==0?" ":A.getRange(R(l.line,l.ch-1),l);if(!fe.isWordChar(g)&&m!=S&&!fe.isWordChar(m))a="both";else return fe.Pass}else if(D&&(g.length===0||/\s/.test(g)||u.indexOf(g)>-1))a="both";else return fe.Pass;if(!v)v=a;else if(v!=a)return fe.Pass}var b=s%2?o.charAt(s-1):S,P=s%2?S:o.charAt(s+1);A.operation(function(){if(v=="skip")A.execCommand("goCharRight");else if(v=="skipThree")for(var H=0;H<3;H++)A.execCommand("goCharRight");else if(v=="surround"){for(var V=A.getSelections(),H=0;H<V.length;H++)V[H]=b+V[H]+P;A.replaceSelections(V,"around"),V=A.listSelections().slice();for(var H=0;H<V.length;H++)V[H]=y(V[H]);A.setSelections(V)}else v=="both"?(A.replaceSelection(b+P,null),A.triggerElectric(b+P),A.execCommand("goCharLeft")):v=="addFour"&&(A.replaceSelection(b+b+b+b,"before"),A.execCommand("goCharRight"))})}function I(A,S){var h=A.getRange(R(S.line,S.ch-1),R(S.line,S.ch+1));return h.length==2?h:null}function w(A,S){var h=A.getTokenAt(R(S.line,S.ch+1));return/\bstring/.test(h.type)&&h.start==S.ch&&(S.ch==0||!/\bstring/.test(A.getTokenTypeAt(S)))}})},FOrL:function(_e,Oe,ee){_e.exports=ee.p+"static/nodata.a6b3f948.png"},FPkq:function(_e,Oe,ee){_e.exports=ee.p+"static/qrCode.dd0fe9b2.png"},GABl:function(_e,Oe){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAKi0lEQVRoQ71ae3BU1Rn//e7dzYuioNRsHlSqRiUB2eUx0hbaKAHEAMWxiQ6PTUAUGCuIQNVOZ0xnrHUE5GHHIqOwCag8BlQiQnnUokgt5AEIK5GnBpIFXwjkAdl7vs7dkJCETXLvEj3/5d7v9/u+337nfN8554bowBHo16+3YRh3K7IPBHcRSIDI9QJ0AWkA8h0E3xM8DWAvde5x6Pqe+D17jnVUGLxWogqPp78SGSeC3wP4ZUR8pJ+Ct50O7e344uKjEXFcBkUkSERY6e43RkE9JcCgawngaiw3O6A/l7CvaHckvLYFhTKi5B8C3B2JQ6sYEhvpcMxKKioqs4ox7SwLkvT0mFNnz82HqKkCaHacRGxL1gDybHJp6WKSYoXHkqBytzuF4FoR6WOFtKNtCP4b0c7s5N27v22Pu11B5e7+6ZTgBgE6t0f2Y74n8IUjOuo+1+7dx9vy06agcrf7fgjXARLzYwZrnZsB6BzevaRkf2uYVgWdcruHKnAjRJzWHf4ElmSl5nTcnbRnT3k4b2EFVfTt29NQ8l+zKf4EIUbi4kAnhz7ohuLiH1qCwwo62cf9ccf3l0jibh1DckPy3lKzmTcbYQWV9+k7HlArOjaEjmejRm9yaWmzOMMKMncCp9x9dwlkYEeEQUCBrO0IrqYcApx1xsV6XLt2nWl43kyQqyB38dQJPZ7MY56qdLsHGIL/iY3m24R0p2jc6BDZrkVHf3XTiBFfMy9Pd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LXlvfblZ0whG58nPWCvCHyJy0gyKPde7WOdVcP3JkWHfUqkOAxNn2Rcxn2vbZLXFhr15vW/nEdeeNcyUArr5ctO25OUAjH6z0+tZfzs4qRFJZiU1IHTySvPoDQKt3yeb1cFDJNhHcdI0amhQk7gh4fen1YoYPhgQ/ss/NzxHtHGj2nHDYNi/Hk9/MTQka2CoiN9t3fNVkUDr0/hU5b5SK5Gnw7yyCiMcWL+GH5sxkz80nWsO1e9uftHJysqHqtoigpy3nLYxJLgt4fY+EsnMg41FAltriIzciyjm2tcy0WuXCOUnKf/xGg1VvishwW0Fc8XIhNoYpJ7J9gfpLRByGyM8tc5FzkTromXBrxlJRaM2ReW0sSi0QQTfLwZiG1P582rv876Hs+DNehpKZFvEnoWE2U7dbbrrtTrmWjhPfeqybEby0ECLjrARF8ETML9DzxD2+WikbdifqDHND2vb/PpDm5/oXcV3XRey+tsaKH1tTLhyh661H0xCsmyaQCW1dg1HTHwpMWLbmcpneBJH7Wg+QVdCwFKI/z7R/fWdHyDULaiCIL5jdScM3Y6X+m04/aXIPQGJnwJs/OCTm8yEjYSDMLSurQPkI5CrcoK2ja0vobBTpsD3l2nKU/mGe43DFiV5Ksb8SNUCj9lrlhOUl5r8JwG9evjMBhDmdjkJYBp2luLPHHrL+nq8jxv8BV2A7FHmr6w0AAAAASUVORK5CYII="},HmJG:function(_e,Oe,ee){},HpTS:function(_e,Oe,ee){_e.exports=ee.p+"static/small_program.f74069ec.png"},JWDV:function(_e,Oe,ee){_e.exports=ee.p+"static/charpter-white.5fa14f93.svg"},JeFH:function(_e,Oe){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAAwCAYAAAD9wT87AAAe2UlEQVR4XtVcB5QUVbr+blV1T+ieGWaYBAwgOSgooJLjENeA6a2KCVfZNbum3VXXsG9VdFfc1TXtGlfXLCKgEiRnUAHJWRzAyTl3V9V957vV1dPTM+M4Hn2Pd8/xIHRV9f3vn77/+/9qgVaWlHIggHMB+AA8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T0LvEYnuqyvnIrIChHo/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,Oe,ee){_e.exports=ee.p+"static/qrcode.2267e4d5.png"},LdHM:function(_e,Oe,ee){"use strict";ee.d(Oe,"b",function(){return u}),ee.d(Oe,"a",function(){return c});var fe=ee("1OyB"),Z=ee("vuIU"),R=ee("Ji7U"),Q=ee("LK+K"),_=ee("q1tI"),L=ee("rePB"),W=ee("Ff2n"),U=ee("ODXe"),O=ee("4IlW"),M=ee("bX4T"),y=ee("YrtM"),C=ee("TSYQ"),I=ee.n(C),w=ee("+nKL"),A=ee("8OUc"),S=function(ae,ce){var me=ae.prefixCls,be=ae.id,Be=ae.flattenOptions,Ce=ae.childrenAsData,Le=ae.values,Te=ae.searchValue,we=ae.multiple,ve=ae.defaultActiveFirstOption,j=ae.height,T=ae.itemHeight,k=ae.notFoundContent,G=ae.open,$=ae.menuItemSelectedIcon,N=ae.virtual,ue=ae.onSelect,Ee=ae.onToggleOpen,De=ae.onActiveValue,Ne=ae.onScroll,Re=ae.onMouseEnter,Ie="".concat(me,"-item"),Pe=Object(y.a)(function(){return Be},[G,Be],function(X,J){return J[0]&&X[1]!==J[1]}),Ge=_.useRef(null),Ke=function(J){J.preventDefault()},Ye=function(J){Ge.current&&Ge.current.scrollTo({index:J})},Xe=function(J){for(var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,se=Pe.length,q=0;q<se;q+=1){var ie=(J+q*ne+se)%se,le=Pe[ie],he=le.group,ge=le.data;if(!he&&!ge.disabled)return ie}return-1},at=_.useState(function(){return Xe(0)}),qe=Object(U.a)(at,2),ze=qe[0],Ae=qe[1],Je=function(J){Ae(J);var ne=Pe[J];if(!ne){De(null,-1);return}De(ne.data.value,J)};_.useEffect(function(){Je(ve!==!1?Xe(0):-1)},[Pe.length,Te]),_.useEffect(function(){var X=setTimeout(function(){if(!we&&G&&Le.size===1){var J=Array.from(Le)[0],ne=Pe.findIndex(function(se){var q=se.data;return q.value===J});Je(ne),Ye(ne)}});return function(){return clearTimeout(X)}},[G]);var Ze=function(J){J!==void 0&&ue(J,{selected:!Le.has(J)}),we||Ee(!1)};if(_.useImperativeHandle(ce,function(){return{onKeyDown:function(J){var ne=J.which;switch(ne){case O.a.UP:case O.a.DOWN:{var se=0;if(ne===O.a.UP?se=-1:ne===O.a.DOWN&&(se=1),se!==0){var q=Xe(ze+se,se);Ye(q),Je(q)}break}case O.a.ENTER:{var ie=Pe[ze];ie&&!ie.data.disabled?Ze(ie.data.value):Ze(void 0),G&&J.preventDefault();break}case O.a.ESC:Ee(!1)}},onKeyUp:function(){},scrollTo:function(J){Ye(J)}}}),Pe.length===0)return _.createElement("div",{role:"listbox",id:"".concat(be,"_list"),className:"".concat(Ie,"-empty"),onMouseDown:Ke},k);function oe(X){var J=Pe[X];if(!J)return null;var ne=J.data||{},se=ne.value,q=ne.label,ie=ne.children,le=Object(M.a)(ne,!0),he=Ce?ie:q;return J?_.createElement("div",Object.assign({"aria-label":typeof he=="string"?he:null},le,{key:X,role:"option",id:"".concat(be,"_list_").concat(X),"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:Ge,data:Pe,height:j,itemHeight:T,fullHeight:!1,onMouseDown:Ke,onScroll:Ne,virtual:N,onMouseEnter:Re},function(X,J){var ne,se=X.group,q=X.groupOption,ie=X.data,le=ie.label,he=ie.key;if(se)return _.createElement("div",{className:I()(Ie,"".concat(Ie,"-group"))},le!==void 0?le:he);var ge=ie.disabled,ye=ie.value,ke=ie.title,He=ie.children,tt=ie.style,it=ie.className,vt=Object(W.a)(ie,["disabled","value","title","children","style","className"]),st=Le.has(ye),nt="".concat(Ie,"-option"),Tt=I()(Ie,nt,it,(ne={},Object(L.a)(ne,"".concat(nt,"-grouped"),q),Object(L.a)(ne,"".concat(nt,"-active"),ze===J&&!ge),Object(L.a)(ne,"".concat(nt,"-disabled"),ge),Object(L.a)(ne,"".concat(nt,"-selected"),st),ne)),Et=Ce?He:le,_t=!$||typeof $=="function"||st;return _.createElement("div",Object.assign({},vt,{"aria-selected":st,className:Tt,title:ke,onMouseMove:function(){if(ze===J||ge)return;Je(J)},onClick:function(){ge||Ze(ye)},style:tt}),_.createElement("div",{className:"".concat(nt,"-content")},Et||ye),_.isValidElement($)||st,_t&&_.createElement(A.a,{className:"".concat(Ie,"-option-state"),customizeIcon:$,customizeIconProps:{isSelected:st}},st?"\u2713":null))}))},h=_.forwardRef(S);h.displayName="OptionList";var o=h,s=function(){return null};s.isSelectOption=!0;var u=s,x=function(){return null};x.isSelectOptGroup=!0;var c=x,p=ee("VTBJ"),D=ee("Zm9Q");function v(F){var ae=F.key,ce=F.props,me=ce.children,be=ce.value,Be=Object(W.a)(ce,["children","value"]);return Object(p.a)({key:ae,value:be!==void 0?be:ae,children:me},Be)}function f(F){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(F).map(function(ce,me){if(!_.isValidElement(ce)||!ce.type)return null;var be=ce.type.isSelectOptGroup,Be=ce.key,Ce=ce.props,Le=Ce.children,Te=Object(W.a)(Ce,["children"]);return ae||!be?v(ce):Object(p.a)(Object(p.a)({key:"__RC_SELECT_GRP__".concat(Be===null?me:Be,"__"),label:Be},Te),{},{options:f(Le)})}).filter(function(ce){return ce})}var d=ee("2Qr1"),l=ee("qNPg"),a=ee("U8pU"),g=ee("Kwbf"),m=ee("WKfj");function b(F){var ae=F.mode,ce=F.options,me=F.children,be=F.backfill,Be=F.allowClear,Ce=F.placeholder,Le=F.getInputElement,Te=F.showSearch,we=F.onSearch,ve=F.defaultOpen,j=F.autoFocus,T=F.labelInValue,k=F.value,G=F.inputValue,$=F.optionLabelProp,N=ae==="multiple"||ae==="tags",ue=Te!==void 0?Te:N||ae==="combobox",Ee=ce||f(me);if(Object(g.a)(ae!=="tags"||Ee.every(function(Ie){return!Ie.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),ae==="tags"||ae==="combobox"){var De=Ee.some(function(Ie){return Ie.options?Ie.options.some(function(Pe){return typeof("value"in Pe?Pe.value:Pe.key)=="number"}):typeof("value"in Ie?Ie.value:Ie.key)=="number"});Object(g.a)(!De,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(g.a)(ae!=="combobox"||!$,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(g.a)(ae==="combobox"||!be,"`backfill` only works with `combobox` mode."),Object(g.a)(ae==="combobox"||!Le,"`getInputElement` only work with `combobox` mode."),Object(g.b)(ae!=="combobox"||!Le||!Be||!Ce,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),we&&!ue&&ae!=="combobox"&&ae!=="tags"&&Object(g.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(g.b)(!ve||j,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),k!=null){var Ne=Object(m.d)(k);Object(g.a)(!T||Ne.every(function(Ie){return Object(a.a)(Ie)==="object"&&("key"in Ie||"value"in Ie)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(g.a)(!N||Array.isArray(k),"`value` should be array when `mode` is `multiple` or `tags`")}if(me){var Re=null;Object(D.a)(me).some(function(Ie){if(!_.isValidElement(Ie)||!Ie.type)return!1;var Pe=Ie.type;if(Pe.isSelectOption)return!1;if(Pe.isSelectOptGroup){var Ge=Object(D.a)(Ie.props.children).every(function(Ke){return!_.isValidElement(Ke)||!Ie.type||Ke.type.isSelectOption?!0:(Re=Ke.type,!1)});return!Ge}return Re=Pe,!0}),Re&&Object(g.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Re.displayName||Re.name||Re,"`.")),Object(g.a)(G===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=b,H=Object(l.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:f,flattenOptions:d.d,getLabeledValue:d.e,filterOptions:d.b,isValueDisabled:d.g,findValueOption:d.c,warningProps:P,fillOptionsWithMissingValue:d.a}),V=function(F){Object(R.a)(ce,F);var ae=Object(Q.a)(ce);function ce(){var me;return Object(fe.a)(this,ce),me=ae.apply(this,arguments),me.selectRef=_.createRef(),me.focus=function(){me.selectRef.current.focus()},me.blur=function(){me.selectRef.current.blur()},me}return Object(Z.a)(ce,[{key:"render",value:function(){return _.createElement(H,Object.assign({ref:this.selectRef},this.props))}}]),ce}(_.Component);V.Option=u,V.OptGroup=c;var re=V,z=Oe.c=re},M8RZ:function(_e,Oe,ee){"use strict";ee.d(Oe,"a",function(){return O});var fe=ee("fWQN"),Z=ee("mtLc"),R=ee("yKVA"),Q=ee("879j"),_=ee("q1tI"),L=ee.n(_),W=ee("i8i4"),U=ee.n(W),O=function(M){Object(R.a)(C,M);var y=Object(Q.a)(C);function C(I){var w;Object(fe.a)(this,C),w=y.call(this,I);var A=window.document;return w.node=A.createElement("div"),A.body.appendChild(w.node),w}return Object(Z.a)(C,[{key:"render",value:function(){var w=this.props.children;return Object(W.createPortal)(w,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),C}(L.a.Component)},Nmxd:function(_e,Oe){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ0lthgv3V0LSqB9IAQeNNEIaKKwZbcFnuQJoZ1piyYawJjIiwZDwiVBaHd28QItaWeLD4KJPgimiA+YCAZj6Z7fzPZiu7e57WriJE0f5v++//tm/j3nn3MOoQyXcmJ/LdfeCBOjEUA9EdUzUA9g0ST9VQJGmXkU5n/CAN2q043Vm295TU9uCRS9MwCiFWBqAmD++R1yjQNIgTgF5tNGuCPtEJ8Nd2xgWarzPil9UbBsA1G1m6R5GOYxkOgRItM71NRxzQmnIwMBvStKoCiAB50kcRB7mcG96XB7r12MLQNPJXrvzdD4QQZW2yX2EkfACR/7N56PRH+14rE0sDSpLRaM4wA/YEVW3vt0RRLWjIRi35biLWkgmOhaz0SflleYMzZi3jAcaf+sGKqoAUVX3wbwnrN0FYveYoTj7xdiL2ggqKsvMnCyYnJcEBPw0nA4/kUuNM9AINX9MMnMIEDzXeSpIISvs/A1pJu2/TgzSZ4BRVf7ALxQQSVeqPuNcLy5qIHJcb7HS4ZKYxncNnOemH4DyqmehaiW58D8UKVFeOIn+gljYrmxsu2XWa2Eomt7AN7uidwd+CKBPy8EZdA7hSlprxGO7Zg2EPxSW8q35WDZehv7Ri4KEuuGQtu+y4UoSe0DML9ZkI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xHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},Ohmc:function(_e,Oe,ee){_e.exports=ee.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(_e,Oe,ee){"use strict";var fe=ee("2qtc"),Z=ee("kLXV"),R=ee("rAM+"),Q=ee("miYZ"),_=ee("tsqr"),L=ee("9og8"),W=ee("tJVT"),U=ee("jrin"),O=ee("WmNS"),M=ee.n(O),y=ee("q1tI"),C=ee.n(y),I=ee("VrN/"),w=ee.n(I),A=ee("bdgK"),S=ee("p77/"),h=ee("Bd2K"),o=ee("ELLl"),s=ee("19Vz"),u=ee("lZu9"),x=ee("+NIl"),c=ee("kSUc"),p=ee("9Bee"),D=function(ge){var ye=ge.value,ke=ye===void 0?"":ye,He=ge.className,tt=ge.showTextOnly,it=ge.showLines,vt=ge.style,st=vt===void 0?{}:vt,nt=Object(y.useMemo)(function(){return""},[ke]);return C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{dangerouslySetInnerHTML:{__html:nt}}))},v=ee("0Owb"),f=ee("dejd"),d=ee("C+DQ"),l=ee("1vsH"),a=ee("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 m(ge){var ye=ge.onActionCallback,ke=ge.title,He=ge.icon,tt=ge.actionName,it=ge.className,vt=it===void 0?"":it,st=ge.children;function nt(){ye(tt)}return C.a.createElement("a",{title:ke,className:vt,onClick:nt},C.a.createElement("i",{className:"md-iconfont ".concat(He)}),st)}var b=function(ge){var ye=ge.watch,ke=ge.showNullButton,He=ge.onActionCallback,tt=ge.fullScreen,it=ge.insertTemp,vt=ge.hidetoolBar,st=ge.uuid,nt=ge.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(l.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(l.F)("_educoder_session"),"&key=").concat(st,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var Tt=[].concat(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 C.a.createElement("ul",{className:"markdown-toolbar-container"},!vt&&Tt.map(function(Et,_t){return C.a.createElement("li",{key:_t},Et.actionName?C.a.createElement(m,Object(v.a)({},Et,{onActionCallback:He})):C.a.createElement("span",{className:"v-line"}))}),ke?C.a.createElement("li",null,C.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:He},C.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,it&&C.a.createElement("li",null,C.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(it),onActionCallback:He},C.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),C.a.createElement("li",{className:"btn-full-screen"},C.a.createElement(m,{icon:"".concat(tt?"icon-shrink":"icon-enlarge"),title:tt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:He})))},P=ee("M8RZ"),H=ee("+L6B"),V=ee("2/Rp"),re=ee("y8nQ"),z=ee("Vl3Y"),F=ee("5NDa"),ae=ee("5rEg"),ce={labelCol:{span:4},wrapperCol:{span:20}},me=function(ge){var ye=ge.callback,ke=ge.onCancel;function He(tt){ye(tt)}return C.a.createElement(z.a,Object(v.a)({},ce,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:He}),C.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},C.a.createElement(ae.a,null)),C.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},C.a.createElement(ae.a,null)),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(V.a,{type:"ghost",onClick:ke},"\u53D6\u6D88")))},be=ee("7ahc"),Be=ee("HmJG"),Ce=ee("BjJ7"),Le=z.a.useForm,Te={width:280,marginRight:10},we={labelCol:{span:5},wrapperCol:{span:19}},ve=function(ge){var ye=ge.callback,ke=ge.onCancel,He=Le(),tt=Object(W.a)(He,1),it=tt[0];function vt(Tt){ye(Tt)}function st(Tt,Et){if(Tt.status===-1){_.b.error(Tt.message);return}it.setFieldsValue({src:"/api/attachments/".concat(Tt.id),type:Et.type})}function nt(Tt){var Et=Tt.target.files[0];T(Et,st)}return C.a.createElement(z.a,Object(v.a)({form:it},we,{className:"upload-image-panel",onFinish:vt}),C.a.createElement(z.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},C.a.createElement("div",{className:"flex-container"},C.a.createElement(z.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},C.a.createElement(ae.a,{style:Te})),C.a.createElement(j,{onFileChange:nt}))),C.a.createElement(z.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},C.a.createElement(ae.a,{style:{width:264}})),C.a.createElement(z.a.Item,{style:{textAlign:"right"}},C.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(V.a,{type:"ghost",onClick:ke},"\u53D6\u6D88")))};function j(ge){var ye=ge.onFileChange;return C.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",C.a.createElement("input",{type:"file",onChange:ye}))}function T(ge,ye){if(!ge)throw new String("\u6CA1\u6709\u6587\u4EF6");var ke=new FormData;ke.append("editormd-image-file",ge),ke.append("file_param_name","editormd-image-file"),ke.append("byxhr","true");var He=new window.XMLHttpRequest;He.withCredentials=!0,He.addEventListener("load",function(tt){ye(JSON.parse(tt.target.responseText),ge)},!1),He.addEventListener("error",function(tt){console.error(tt)},!1),He.open("POST","".concat(Ce.a,"/api/attachments.json")),He.send(ke)}var k=ee("giR+"),G=ee("fyUT"),$=ee("7Kak"),N=ee("9yH6"),ue=N.a.Group,Ee={margin:"0 8px"},De=function(ge){var ye=ge.callback,ke=ge.onCancel;function He(tt){ye(tt)}return C.a.createElement(z.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:He},C.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},C.a.createElement("span",{style:Ee},"\u5355\u5143\u683C\u6570\uFF1A"),C.a.createElement("span",{style:Ee},"\u884C\u6570"),C.a.createElement(z.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},C.a.createElement(G.a,null)),C.a.createElement("span",{style:Ee},"\u5217\u6570"),C.a.createElement(z.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},C.a.createElement(G.a,null))),C.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},C.a.createElement("span",{style:Ee},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),C.a.createElement(z.a.Item,{name:"align"},C.a.createElement(ue,null,C.a.createElement(N.a,{value:"default"},C.a.createElement("i",{className:"fa fa-align-justify"})),C.a.createElement(N.a,{value:"left"},C.a.createElement("i",{className:"fa fa-align-left"})),C.a.createElement(N.a,{value:"center"},C.a.createElement("i",{className:"fa fa-align-center"})),C.a.createElement(N.a,{value:"right"},C.a.createElement("i",{className:"fa fa-align-right"}))))),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(V.a,{type:"ghost",onClick:ke},"\u53D6\u6D88")))},Ne=ee("ErOA"),Re=ee("7Cbv"),Ie="link",Pe="upload-image",Ge="code-block",Ke="add-table",Ye="------------",Xe={default:Ye,left:":".concat(Ye),center:":".concat(Ye,":"),right:"".concat(Ye,":")},at=ee("9VGf"),qe,ze;function Ae(){}var Je=0,Ze=1e4,oe="\u2581",X=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function J(ge){return/^\d+$/.test(ge)?"".concat(ge,"px"):ge}var ne=navigator.platform.toUpperCase().indexOf("MAC")>=0,se=ne?"Cmd":"Ctrl",q=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ie=(qe={},Object(U.a)(qe,se+"-B","bold"),Object(U.a)(qe,se+"-I","italic"),qe),le=(ze={},Object(U.a)(ze,Ie,"\u6DFB\u52A0\u94FE\u63A5"),Object(U.a)(ze,Ge,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(U.a)(ze,Pe,"\u6DFB\u52A0\u6587\u4EF6"),Object(U.a)(ze,Ke,"\u6DFB\u52A0\u8868\u683C"),ze),he=Oe.a=function(ge){var ye=ge.defaultValue,ke=ye===void 0?"":ye,He=ge.onChange,tt=ge.width,it=tt===void 0?"100%":tt,vt=ge.height,st=vt===void 0?400:vt,nt=ge.miniToolbar,Tt=nt===void 0?!1:nt,Et=ge.isFocus,_t=Et===void 0?!1:Et,Mt=ge.watch,xt=ge.insertTemp,mr=ge.mode,Cr=mr===void 0?"markdown":mr,Yt=ge.id,gr=Yt===void 0?"markdown-editor-id":Yt,cr=ge.showResizeBar,zr=cr===void 0?!1:cr,Xt=ge.noStorage,Br=Xt===void 0?!1:Xt,ti=ge.showNullButton,Ot=ti===void 0?!1:ti,$e=ge.hidetoolBar,Ct=$e===void 0?!1:$e,Jt=ge.fullScreen,mt=Jt===void 0?!1:Jt,pt=ge.onBlur,wt=ge.onCMBeforeChange,vr=ge.onFullScreen,Ft=ge.className,Fe=Ft===void 0?"":Ft,dt=ge.disablePaste,ri=dt===void 0?!1:dt,bi=ge.placeholder,Ei=bi===void 0?"":bi,ii=ge.values,xi=ii===void 0?"":ii,ft=Object(y.useState)(null),Dn=Object(W.a)(ft,2),We=Dn[0],Si=Dn[1],xr=Object(y.useState)(ke),Ki=Object(W.a)(xr,2),ni=Ki[0],Ar=Ki[1],Vi=Object(y.useState)(Mt),Qi=Object(W.a)(Vi,2),Tr=Qi[0],Yi=Qi[1],kn=Object(y.useState)(mt),Xi=Object(W.a)(kn,2),wr=Xi[0],Rn=Xi[1],aa=Object(y.useState)(""),Ji=Object(W.a)(aa,2),rr=Ji[0],Kr=Ji[1],oa=Object(y.useState)(0),ai=Object(W.a)(oa,2),Dr=ai[0],Zi=ai[1],sa=Object(y.useState)(st),Ln=Object(W.a)(sa,2),In=Ln[0],Ci=Ln[1],Mn=Object(y.useState)(!1),On=Object(W.a)(Mn,2),la=On[0],Ai=On[1],oi=Object(y.useRef)(Object(Re.a)()),si=Object(y.useRef)(!1),Ti=Object(y.useRef)(),Nr=Object(y.useRef)(),Ur=Object(y.useRef)(),Fr=Object(y.useRef)(),wi=Object(y.useRef)(),Pn=function(){var ot=Object(L.a)(M.a.mark(function ct(){var ut,yt;return M.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:return Lt.next=2,Object(Ne.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:oi.current}});case 2:yt=Lt.sent,yt!=null&&(ut=yt.attachments)!==null&&ut!==void 0&&ut.length&&(console.log("cm:",We,Nr),yt.attachments.map(function(St){St.content_type.indexOf("image")>-1?We.replaceSelection(".concat(St.content_type,")")):St.content_type.indexOf("video")>-1?We.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):St.content_type.indexOf("pdf")>-1?We.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(St.id,"?type=").concat(St.content_type,'&disposition=inline" target="_blank">').concat(St.name,"</a>")):We.replaceSelection("[".concat(St.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(St.id,"?type=").concat(St.content_type,")"))}));case 4:case"end":return Lt.stop()}},ct)}));return function(){return ot.apply(this,arguments)}}();Object(y.useEffect)(function(){Ar(xi),We==null||We.setValue(xi)},[xi]),Object(y.useEffect)(function(){vr==null||vr(wr)},[wr]),Object(y.useEffect)(function(){if(Nr.current){var ot=w.a.fromTextArea(Nr.current,{mode:Cr,lineNumbers:!Tt,lineWrapping:!0,value:ke,autoCloseTags:!0,autoCloseBrackets:!0});_t&&ot.focus();function ct(ut,yt){if(ri){yt.preventDefault();return}var At=yt.clipboardData;if(At){var Lt=At.types.toString(),St=At.items;if(Lt==="Files"||At.types.indexOf("Files")>-1){if(yt.preventDefault(),Cr=="stex")return;try{var Ht,ar=St[1];((Ht=St[0])===null||Ht===void 0?void 0:Ht.kind)==="file"&&(ar=St[0]);var bt=ar.getAsFile(),Wr=bt.name.split(".").pop();T(bt,function(Dt){if(Dt.id){var or,$t,Sr;(bt==null||((or=bt.type)===null||or===void 0)?void 0:or.indexOf("image"))>-1?ot.replaceSelection(".concat(Dt.content_type,")")):(bt==null||(($t=bt.type)===null||$t===void 0)?void 0:$t.indexOf("video"))>-1?ot.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,'"></video>')):(bt==null||((Sr=bt.type)===null||Sr===void 0)?void 0:Sr.indexOf("pdf"))>-1?ot.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(bt.type,'&disposition=inline" target="_blank">').concat(bt.name,"</a>")):q.includes(Wr)?ot.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,'?type=office&disposition=inline" target="_blank">').concat(bt.name,"</a>")):ot.replaceSelection("[".concat(bt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(Dt.content_type,")"))}else(Dt==null?void 0:Dt.status)===401&&(document.location.href="/user/login")})}catch(Dt){_.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ot.on("paste",ct),ot.on("dragleave",function(ut,yt){Ur.current.classList.remove("mouse-hover-md")}),ot.on("dragover",function(ut,yt){Ur.current.classList.add("mouse-hover-md")}),ot.on("drop",function(ut,yt){Ur.current.classList.add("mouse-hover-md");var At;if(At=yt.dataTransfer.files,At.length>0){yt.preventDefault(),yt.stopPropagation();for(var Lt=function(ar){var bt=At[ar],Wr=bt.name.split(".").pop();T(bt,function(Dt){if(Dt.id){var or,$t,Sr;(bt==null||((or=bt.type)===null||or===void 0)?void 0:or.indexOf("image"))>-1?ot.replaceSelection(".concat(Dt.content_type,")")):(bt==null||(($t=bt.type)===null||$t===void 0)?void 0:$t.indexOf("video"))>-1?ot.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,'"></video>')):(bt==null||((Sr=bt.type)===null||Sr===void 0)?void 0:Sr.indexOf("pdf"))>-1?ot.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(bt.type,'&disposition=inline" target="_blank">').concat(bt.name,"</a>")):q.includes(Wr)?ot.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,'?type=office&disposition=inline" target="_blank">').concat(bt.name,"</a>")):ot.replaceSelection("[".concat(bt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(Dt.content_type,")"))}else(Dt==null?void 0:Dt.status)===401&&(document.location.href="/user/login")})},St=0;St<At.length;St++)Lt(St)}}),Si(ot),function(){ot.off("paste",ct)}}},[]);var yr=Object(y.useCallback)(function(){if(Ur.current)try{}catch(ot){console.log(ot,"---- to set md editor body height")}},[In,Ur,wr]);Object(y.useEffect)(function(){function ot(){var ut=new A.default(function(yt){var At=Object(R.a)(yt),Lt;try{for(At.s();!(Lt=At.n()).done;){var St=Lt.value;(St.target.offsetHeight>0||St.target.offsetWidth>0)&&(yr(),We.setSize("100%","100%"),We.refresh())}}catch(Ht){At.e(Ht)}finally{At.f()}});return ut.observe(Nr.current.parentElement),ut}if(We){var ct=ot();return function(){ct.unobserve(Nr.current.parentElement)}}},[We,yr]),Object(y.useEffect)(function(){if(We){for(var ot=[],ct=function(){var St=yt[ut];At=Object(W.a)(St,2);var Ht=At[0],ar=At[1],bt=Object(U.a)({},Ht,function(){_n(ar)});ot.push(bt),We.addKeyMap(bt)},ut=0,yt=Object.entries(ie);ut<yt.length;ut++){var At;ct()}return Ti.current=setInterval(function(){si.current&&Pn()},4e3),function(){clearInterval(Ti.current);var Lt=Object(R.a)(ot),St;try{for(Lt.s();!(St=Lt.n()).done;){var Ht=St.value;We.removeKeyMap(Ht)}}catch(ar){Lt.e(ar)}finally{Lt.f()}}}},[We]),Object(y.useEffect)(function(){mt!==wr&&Rn(mt)},[mt]),Object(at.a)(function(){if(!Br&&Dr>0){var ot=new Date().getTime(),ct=window.sessionStorage.getItem(gr);ot>=Dr+Ze&&(!ct||ct!==ni)&&(window.sessionStorage.setItem(gr,ni),Ai(!0))}},Ze),Object(y.useEffect)(function(){Yi(Mt)},[We,Mt]),Object(y.useEffect)(function(){We&&(_t&&We.focus())},[We,_t]),Object(y.useEffect)(function(){if(Tr&&We){var ot=We.getScrollerElement();function ct(ut){var yt=ut.target;if(wi.current){var At=yt.scrollTop/yt.scrollHeight;wi.current.scrollTop=wi.current.scrollHeight*At}}return ot.addEventListener("scroll",ct),function(){ot.removeEventListener("scroll",ct)}}},[We,Tr]),Object(y.useEffect)(function(){if(We&&wt){function ot(ct,ut){wt(ct,ut)}return We.on("beforeChange",ot),function(){We.off("beforeChange",ot)}}},[We,wt]),Object(y.useEffect)(function(){if(We&&pt){function ot(){pt(We.getValue())}return We.on("blur",ot),function(){We.off("blur",ot)}}},[We,pt]),Object(y.useEffect)(function(){if(We){function ot(ct){var ut=ct.getValue();Ar(ut),Zi(new Date().getTime()),ct.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),He&&He(ut)}return We.on("change",ot),function(){We.off("change",ot)}}},[We,He]),Object(y.useEffect)(function(){We&&(ke==null?(We.setValue(""),Ar("")):ke!==We.getValue()&&(We.setValue(ke),Ar(ke),We.setCursor(We.lineCount(),0)))},[We,ke]);var _n=Object(y.useCallback)(function(ot){var ct=We.getCursor(),ut=We.getSelection(),yt=ut.split(`
|
|
`);switch(ot){case"bold":return We.replaceSelection("**"+ut+"**"),ut===""&&We.setCursor(ct.line,ct.ch+2),We.focus();case"italic":return We.replaceSelection("*"+ut+"*"),ut===""&&We.setCursor(ct.line,ct.ch+1),We.focus();case"code":return We.replaceSelection("`"+ut+"`"),ut===""&&We.setCursor(ct.line,ct.ch+1),We.focus();case"inline-latex":return We.replaceSelection("`$$"+ut+"$$`"),ut===""&&We.setCursor(ct.line,ct.ch+3),We.focus();case"latex":return We.replaceSelection("```latex\n"+ut+"\n```"),We.setCursor(ct.line+1,ut.length+1),We.focus();case"line-break":return We.replaceSelection(`<br/>
|
|
`),We.focus();case"list-ul":return ut===""?We.replaceSelection("- "+ut):We.replaceSelection(yt.map(function(At){return At===""?"":"- ".concat(At)}).join(`
|
|
`)),We.focus();case"list-ol":return ut===""?We.replaceSelection("1. "+ut):We.replaceSelection(yt.map(function(At,Lt){return At===""?"":"".concat(Lt+1,". ").concat(At)}).join(`
|
|
`)),We.focus();case"add-null-ch":return ut===""&&We.setCursor(ct.line,ct.ch+1),We.replaceSelection(oe),We.focus();case"inster-template-1":return ut===""&&We.setCursor(ct.line,ct.ch),We.replaceSelection(X),We.focus();case"eraser":return We.setValue(""),We.focus();case"trigger-watch":return Yi(!Tr),We.focus();case"trigger-full-screen":return Rn(!wr),We.focus();case Ie:Kr(Ie);return;case Ge:Kr(Ge);return;case Pe:Kr(Pe);return;case Ke:Kr(Ke);return;default:throw new Error}},[We,Tr,wr]),Di=Object(y.useCallback)(function(ot){Kr("");switch(rr){case Ie:var ct=ot.title,ut=ot.link;return We.replaceSelection("[".concat(ct,"](").concat(ut,")")),We.focus();case Ge:var yt=ot.language,At=ot.content;return We.replaceSelection(["```"+yt,At,"```"].join(`
|
|
`)),We.focus();case Pe:var Lt=ot.src,St=ot.alt;return St?We.replaceSelection(".concat(Lt,' "').concat(St,'" )')):We.replaceSelection("")),We.focus();case Ke:for(var Ht=ot.row,ar=ot.col,bt=ot.align,Wr=`
|
|
`,Dt=0;Dt<Ht;Dt++){for(var or=[],$t=[],Sr=0;Sr<ar;Sr++)Dt===1&&$t.push(Xe[bt]),or.push(" ");Dt===1&&(Wr+="| ".concat($t.join(" | "),` |
|
|
`)),Wr+="| ".concat(or.join(ar===1?"":" | "),` |
|
|
`)}return We.replaceSelection(Wr+`
|
|
`),We.focus();default:throw new Error}},[We,rr]),qi=Object(y.useMemo)(function(){switch(rr){case Ie:return C.a.createElement(me,{callback:Di,onCancel:Vr});case Ge:return C.a.createElement(be.b,{callback:Di,onCancel:Vr});case Pe:return C.a.createElement(ve,{callback:Di,onCancel:Vr});case Ke:return C.a.createElement(De,{callback:Di,onCancel:Vr});default:return null}},[rr]);function Vr(){Kr("")}Object(y.useEffect)(function(){if(Fr.current){var ot=Fr.current,ct=!1,ut=0;function yt(St){ct=!0,ut=St.pageY}function At(){ct=!1}function Lt(St){if(ct){var Ht=St.pageY-ut;Ht<0&&(Ht=0),Ht>300&&(Ht=300);var ar=st+Ht+"px";Ci(ar)}}return ot.addEventListener("mousedown",yt),document.addEventListener("mousemove",Lt),document.addEventListener("mouseup",At),function(){ot.removeEventListener("mousedown",yt),document.removeEventListener("mousemove",Lt),document.removeEventListener("mouseup",At)}}},[We,Fr]),Object(y.useEffect)(function(){Ci(st)},[st]);var Mr=J(it),$i=J(In),kr={width:Mr,height:$i},en=Object(y.useMemo)(function(){if(Dr){var ot=new Date(Dr),ct=ot.getHours(),ut=ot.getMinutes(),yt=ot.getSeconds();return ct=ct<10?"0"+ct:ct,ut=ut<10?"0"+ut:ut,yt=yt<10?"0"+yt:yt,"".concat(ct,":").concat(ut,":").concat(yt)}return 0},[Dr]);function Bn(){window.sessionStorage.removeItem(gr),Ai(!1),Zi(0)}function li(){Ai(!1),Zi(0),We.setValue(window.sessionStorage.getItem(gr))}function ua(ot,ct){var ut=We.getValue();ut=ut.replace(ot,ct),Ar(ut),We==null||We.setValue(ut)}return C.a.createElement(y.Fragment,null,C.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ur},C.a.createElement("div",{className:"markdown-editor-container ".concat(Fe," ").concat(Tr?"on-preview":""," ").concat(Tt?"mini":""," ").concat(wr?"full-screen":""),style:kr},C.a.createElement(b,{insertTemp:xt,watch:Tr,fullScreen:wr,showNullButton:Ot,onActionCallback:_n,hidetoolBar:Ct,uuid:oi.current,setOpenPhones:function(){si.current=!0}}),C.a.createElement("div",{className:"markdown-editor-body"},C.a.createElement("div",{className:"codemirror-container"},C.a.createElement("textarea",{ref:Nr,placeholder:Ei})),Tr?C.a.createElement("div",{ref:wi,className:"preview-container"},Cr==="stex"&&C.a.createElement(D,{value:ni}),Cr!=="stex"&&C.a.createElement(p.a,{edit:!0,value:ni,replaces:ua})):null))),zr?C.a.createElement("a",{ref:Fr,className:"editor-resize"}):null,C.a.createElement(P.a,null,le[rr]?C.a.createElement(Z.a,{centered:!0,title:le[rr],visible:!0,onCancel:Vr,footer:null,className:"markdown-popup-form"},qi):null))}},RMFE:function(_e,Oe){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAoAAAAAXNSR0IArs4c6QAADetJREFUeAHt1jFqXUEQRUHLaP9b/jZObmYU9MAJSlGDxNBUPw76+vz9+eWHAAECBHICv3MbWYgAAQIE/gkItA+BAAECUQGBjh7GWgQIEBBo3wABAgSiAgIdPYy1CBAgINC+AQIECEQFBDp6GGsRIEBAoH0DBAgQiAoIdPQw1iJAgIBA+wYIECAQFRDo6GGsRYAAAYH2DRAgQCAqINDRw1iLAAECAu0bIECAQFRAoKOHsRYBAgQE2jdAgACBqIBARw9jLQIECAi0b4AAAQJRAYGOHsZaBAgQEGjfAAECBKICAh09jLUIECAg0L4BAgQIRAUEOnoYaxEgQECgfQMECBCICgh09DDWIkCAgED7BggQIBAVEOjoYaxFgAABgfYNECBAICog0NHDWIsA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AElFTkSuQmCC"},S3tb:function(_e,Oe,ee){_e.exports={flex_box_center:"flex_box_center___2JPaF",flex_space_between:"flex_space_between___2Xc04",flex_box_vertical_center:"flex_box_vertical_center___2dKRj",flex_box_center_end:"flex_box_center_end___1mhGC",flex_box_column:"flex_box_column___3_40N",bg:"bg___2hbcT",flexRow:"flexRow___1-nzu",flexJustifyCenter:"flexJustifyCenter___3gMIE",flexAlignEnd:"flexAlignEnd___ofjNV",flexAlignCenter:"flexAlignCenter___ozmjE",flexColumn:"flexColumn___2ijgP",formWrap:"formWrap___1fz8-",titleWrap:"titleWrap___Sj-tB",fieldWrap:"fieldWrap___49q9k",mdWrap:"mdWrap___3TEhM",backgroundFa:"backgroundFa___1anEp",button:"button___3i0ZA",icons:"icons___1IO0Z",navBar:"navBar___11xzI",active:"active___tYbqS"}},SJMd:function(_e,Oe){/**
|
|
* @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 ee,fe,Z,R=!1,Q,_;window.PR_SHOULD_USE_CONTINUATION=!0;var L,W;(function(){var U=window,O=["break,continue,do,else,for,if,return,while"],M=[O,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],y=[M,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],C=[y,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],I=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],w=[y,"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",S=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],h="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",o=[O,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],s=[O,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],u=[O,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],x=[C,w,I,S,h,o,s,u],c=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,p="str",D="kwd",v="com",f="typ",d="lit",l="pun",a="pln",g="tag",m="dec",b="src",P="atn",H="atv",V="nocode",re="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function z(ue){for(var Ee=0,De=!1,Ne=!1,Re=0,Ie=ue.length;Re<Ie;++Re){var Pe=ue[Re];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,""))){De=!0,Ne=!1;break}}var Ge={b:8,t:9,n:10,v:11,f:12,r:13};function Ke(ze){var Ae=ze.charCodeAt(0);if(Ae!==92)return Ae;var Je=ze.charAt(1);return Ae=Ge[Je],Ae||("0"<=Je&&Je<="7"?parseInt(ze.substring(1),8):Je==="u"||Je==="x"?parseInt(ze.substring(2),16):ze.charCodeAt(1))}function Ye(ze){if(ze<32)return(ze<16?"\\x0":"\\x")+ze.toString(16);var Ae=String.fromCharCode(ze);return Ae==="\\"||Ae==="-"||Ae==="]"||Ae==="^"?"\\"+Ae:Ae}function Xe(ze){var Ae=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")),Je=[],Ze=Ae[0]==="^",oe=["["];Ze&&oe.push("^");for(var X=Ze?1:0,J=Ae.length;X<J;++X){var ne=Ae[X];if(/\\[bdsw]/i.test(ne))oe.push(ne);else{var se=Ke(ne),q;X+2<J&&Ae[X+1]==="-"?(q=Ke(Ae[X+2]),X+=2):q=se,Je.push([se,q]),q<65||se>122||(q<65||se>90||Je.push([Math.max(65,se)|32,Math.min(q,90)|32]),q<97||se>122||Je.push([Math.max(97,se)&~32,Math.min(q,122)&~32]))}}Je.sort(function(ge,ye){return ge[0]-ye[0]||ye[1]-ge[1]});for(var ie=[],le=[],X=0;X<Je.length;++X){var he=Je[X];he[0]<=le[1]+1?le[1]=Math.max(le[1],he[1]):ie.push(le=he)}for(var X=0;X<ie.length;++X){var he=ie[X];oe.push(Ye(he[0])),he[1]>he[0]&&(he[1]+1>he[0]&&oe.push("-"),oe.push(Ye(he[1])))}return oe.push("]"),oe.join("")}function at(ze){for(var Ae=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")),Je=Ae.length,Ze=[],oe=0,X=0;oe<Je;++oe){var J=Ae[oe];if(J==="(")++X;else if(J.charAt(0)==="\\"){var ne=+J.substring(1);ne&&(ne<=X?Ze[ne]=-1:Ae[oe]=Ye(ne))}}for(var oe=1;oe<Ze.length;++oe)Ze[oe]===-1&&(Ze[oe]=++Ee);for(var oe=0,X=0;oe<Je;++oe){var J=Ae[oe];if(J==="(")++X,Ze[X]||(Ae[oe]="(?:");else if(J.charAt(0)==="\\"){var ne=+J.substring(1);ne&&ne<=X&&(Ae[oe]="\\"+Ze[ne])}}for(var oe=0;oe<Je;++oe)Ae[oe]==="^"&&Ae[oe+1]!=="^"&&(Ae[oe]="");if(ze.ignoreCase&&De)for(var oe=0;oe<Je;++oe){var J=Ae[oe],se=J.charAt(0);J.length>=2&&se==="["?Ae[oe]=Xe(J):se!=="\\"&&(Ae[oe]=J.replace(/[a-zA-Z]/g,function(le){var he=le.charCodeAt(0);return"["+String.fromCharCode(he&~32,he|32)+"]"}))}return Ae.join("")}for(var qe=[],Re=0,Ie=ue.length;Re<Ie;++Re){var Pe=ue[Re];if(Pe.global||Pe.multiline)throw new Error(""+Pe);qe.push("(?:"+at(Pe)+")")}return new RegExp(qe.join("|"),Ne?"gi":"g")}function F(ue,Ee){var De=/(?:^|\s)nocode(?:\s|$)/,Ne=[],Re=0,Ie=[],Pe=0;function Ge(Ke){var Ye=Ke.nodeType;if(Ye==1){if(De.test(Ke.className))return;for(var Xe=Ke.firstChild;Xe;Xe=Xe.nextSibling)Ge(Xe);var at=Ke.nodeName.toLowerCase();(at==="br"||at==="li")&&(Ne[Pe]=`
|
|
`,Ie[Pe<<1]=Re++,Ie[Pe++<<1|1]=Ke)}else if(Ye==3||Ye==4){var qe=Ke.nodeValue;qe.length&&(Ee?qe=qe.replace(/\r\n?/g,`
|
|
`):qe=qe.replace(/[ \t\r\n]+/g," "),Ne[Pe]=qe,Ie[Pe<<1]=Re,Re+=qe.length,Ie[Pe++<<1|1]=Ke)}}return Ge(ue),{sourceCode:Ne.join("").replace(/\n$/,""),spans:Ie}}function ae(ue,Ee,De,Ne,Re){if(!De)return;var Ie={sourceNode:ue,pre:1,langExtension:null,numberLines:null,sourceCode:De,spans:null,basePos:Ee,decorations:null};Ne(Ie),Re.push.apply(Re,Ie.decorations)}var ce=/\S/;function me(ue){for(var Ee=void 0,De=ue.firstChild;De;De=De.nextSibling){var Ne=De.nodeType;Ee=Ne===1?Ee?ue:De:Ne===3&&ce.test(De.nodeValue)?ue:Ee}return Ee===ue?void 0:Ee}function be(ue,Ee){var De={},Ne;(function(){for(var Pe=ue.concat(Ee),Ge=[],Ke={},Ye=0,Xe=Pe.length;Ye<Xe;++Ye){var at=Pe[Ye],qe=at[3];if(qe)for(var ze=qe.length;--ze>=0;)De[qe.charAt(ze)]=at;var Ae=at[1],Je=""+Ae;Ke.hasOwnProperty(Je)||(Ge.push(Ae),Ke[Je]=null)}Ge.push(/[\0-\uffff]/),Ne=z(Ge)})();var Re=Ee.length,Ie=function(Pe){for(var Ge=Pe.sourceCode,Ke=Pe.basePos,Ye=Pe.sourceNode,Xe=[Ke,a],at=0,qe=Ge.match(Ne)||[],ze={},Ae=0,Je=qe.length;Ae<Je;++Ae){var Ze=qe[Ae],oe=ze[Ze],X=void 0,J;if(typeof oe=="string")J=!1;else{var ne=De[Ze.charAt(0)];if(ne)X=Ze.match(ne[1]),oe=ne[0];else{for(var se=0;se<Re;++se)if(ne=Ee[se],X=Ze.match(ne[1]),X){oe=ne[0];break}X||(oe=a)}J=oe.length>=5&&oe.substring(0,5)==="lang-",J&&!(X&&typeof X[1]=="string")&&(J=!1,oe=b),J||(ze[Ze]=oe)}var q=at;if(at+=Ze.length,!J)Xe.push(Ke+q,oe);else{var ie=X[1],le=Ze.indexOf(ie),he=le+ie.length;X[2]&&(he=Ze.length-X[2].length,le=he-ie.length);var ge=oe.substring(5);ae(Ye,Ke+q,Ze.substring(0,le),Ie,Xe),ae(Ye,Ke+q+le,ie,j(ge,ie),Xe),ae(Ye,Ke+q+he,Ze.substring(he),Ie,Xe)}}Pe.decorations=Xe};return Ie}function Be(ue){var Ee=[],De=[];ue.tripleQuotedStrings?Ee.push([p,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ue.multiLineStrings?Ee.push([p,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ee.push([p,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ue.verbatimStrings&&De.push([p,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ne=ue.hashComments;Ne&&(ue.cStyleComments?(Ne>1?Ee.push([v,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ee.push([v,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),De.push([p,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ee.push([v,/^#[^\r\n]*/,null,"#"])),ue.cStyleComments&&(De.push([v,/^\/\/[^\r\n]*/,null]),De.push([v,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Re=ue.regexLiterals;if(Re){var Ie=Re>1?"":`
|
|
\r`,Pe=Ie?".":"[\\S\\s]",Ge="/(?=[^/*"+Ie+"])(?:[^/\\x5B\\x5C"+Ie+"]|\\x5C"+Pe+"|\\x5B(?:[^\\x5C\\x5D"+Ie+"]|\\x5C"+Pe+")*(?:\\x5D|$))+/";De.push(["lang-regex",RegExp("^"+re+"("+Ge+")")])}var Ke=ue.types;Ke&&De.push([f,Ke]);var Ye=(""+ue.keywords).replace(/^ | $/g,"");Ye.length&&De.push([D,new RegExp("^(?:"+Ye.replace(/[\s,]+/g,"|")+")\\b"),null]),Ee.push([a,/^\s+/,null,` \r
|
|
\xA0`]);var Xe="^.[^\\s\\w.$@'\"`/\\\\]*";return ue.regexLiterals&&(Xe+="(?!s*/)"),De.push([d,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[d,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[l,new RegExp(Xe),null]),be(Ee,De)}var Ce=Be({keywords:x,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Le(ue,Ee,De){for(var Ne=/(?:^|\s)nocode(?:\s|$)/,Re=/\r\n?|\n/,Ie=ue.ownerDocument,Pe=Ie.createElement("li");ue.firstChild;)Pe.appendChild(ue.firstChild);var Ge=[Pe];function Ke(Ae){var Je=Ae.nodeType;if(Je==1&&!Ne.test(Ae.className))if(Ae.nodeName==="br")Ye(Ae),Ae.parentNode&&Ae.parentNode.removeChild(Ae);else for(var Ze=Ae.firstChild;Ze;Ze=Ze.nextSibling)Ke(Ze);else if((Je==3||Je==4)&&De){var oe=Ae.nodeValue,X=oe.match(Re);if(X){var J=oe.substring(0,X.index);Ae.nodeValue=J;var ne=oe.substring(X.index+X[0].length);if(ne){var se=Ae.parentNode;se.insertBefore(Ie.createTextNode(ne),Ae.nextSibling)}Ye(Ae),J||Ae.parentNode.removeChild(Ae)}}}function Ye(Ae){for(;!Ae.nextSibling;)if(Ae=Ae.parentNode,!Ae)return;function Je(X,J){var ne=J?X.cloneNode(!1):X,se=X.parentNode;if(se){var q=Je(se,1),ie=X.nextSibling;q.appendChild(ne);for(var le=ie;le;le=ie)ie=le.nextSibling,q.appendChild(le)}return ne}for(var Ze=Je(Ae.nextSibling,0),oe;(oe=Ze.parentNode)&&oe.nodeType===1;)Ze=oe;Ge.push(Ze)}for(var Xe=0;Xe<Ge.length;++Xe)Ke(Ge[Xe]);Ee===(Ee|0)&&Ge[0].setAttribute("value",Ee);var at=Ie.createElement("ol");at.className="linenums";for(var qe=Math.max(0,Ee-1|0)||0,Xe=0,ze=Ge.length;Xe<ze;++Xe)Pe=Ge[Xe],Pe.className="L"+(Xe+qe)%10,Pe.firstChild||Pe.appendChild(Ie.createTextNode("\xA0")),at.appendChild(Pe);ue.appendChild(at)}function Te(ue){var Ee=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ee=Ee&&+Ee[1]<=8;var De=/\n/g,Ne=ue.sourceCode,Re=Ne.length,Ie=0,Pe=ue.spans,Ge=Pe.length,Ke=0,Ye=ue.decorations,Xe=Ye.length,at=0;Ye[Xe]=Re;var qe,ze;for(ze=qe=0;ze<Xe;)Ye[ze]!==Ye[ze+2]?(Ye[qe++]=Ye[ze++],Ye[qe++]=Ye[ze++]):ze+=2;for(Xe=qe,ze=qe=0;ze<Xe;){for(var Ae=Ye[ze],Je=Ye[ze+1],Ze=ze+2;Ze+2<=Xe&&Ye[Ze+1]===Je;)Ze+=2;Ye[qe++]=Ae,Ye[qe++]=Je,ze=Ze}Xe=Ye.length=qe;var oe=ue.sourceNode,X="";oe&&(X=oe.style.display,oe.style.display="none");try{for(var J=null;Ke<Ge;){var ne=Pe[Ke],se=Pe[Ke+2]||Re,q=Ye[at+2]||Re,Ze=Math.min(se,q),ie=Pe[Ke+1],le;if(ie.nodeType!==1&&(le=Ne.substring(Ie,Ze))){Ee&&(le=le.replace(De,"\r")),ie.nodeValue=le;var he=ie.ownerDocument,ge=he.createElement("span");ge.className=Ye[at+1];var ye=ie.parentNode;ye.replaceChild(ge,ie),ge.appendChild(ie),Ie<se&&(Pe[Ke+1]=ie=he.createTextNode(Ne.substring(Ze,se)),ye.insertBefore(ie,ge.nextSibling))}Ie=Ze,Ie>=se&&(Ke+=2),Ie>=q&&(at+=2)}}finally{oe&&(oe.style.display=X)}}var we={};function ve(ue,Ee){for(var De=Ee.length;--De>=0;){var Ne=Ee[De];we.hasOwnProperty(Ne)?U.console&&console.warn("cannot override language handler %s",Ne):we[Ne]=ue}}function j(ue,Ee){return ue&&we.hasOwnProperty(ue)||(ue=/^\s*</.test(Ee)?"default-markup":"default-code"),we[ue]}ve(Ce,["default-code"]),ve(be([],[[a,/^[^<?]+/],[m,/^<!\w[^>]*(?:>|$)/],[v,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[l,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ve(be([[a,/^[\s]+/,null,` \r
|
|
`],[H,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[g,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[l,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ve(be([],[[H,/^[\s\S]+/]]),["uq.val"]),ve(Be({keywords:C,hashComments:!0,cStyleComments:!0,types:c}),["c","cc","cpp","cxx","cyc","m"]),ve(Be({keywords:"null,true,false"}),["json"]),ve(Be({keywords:w,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:c}),["cs"]),ve(Be({keywords:I,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:h,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ve(Be({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ve(Be({keywords:S,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([],[[p,/^[\s\S]+/]]),["regex"]);function T(ue){var Ee=ue.langExtension;try{var De=F(ue.sourceNode,ue.pre),Ne=De.sourceCode;ue.sourceCode=Ne,ue.spans=De.spans,ue.basePos=0,j(Ee,Ne)(ue),Te(ue)}catch(Re){U.console&&console.log(Re&&Re.stack||Re)}}function k(ue,Ee,De){var Ne=De||!1,Re=Ee||null,Ie=document.createElement("div");Ie.innerHTML="<pre>"+ue+"</pre>",Ie=Ie.firstChild,Ne&&Le(Ie,Ne,!0);var Pe={langExtension:Re,numberLines:Ne,sourceNode:Ie,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return T(Pe),Ie.innerHTML}function G(ue,Ee){var De=Ee||document.body,Ne=De.ownerDocument||document;function Re(ne){return De.getElementsByTagName(ne)}for(var Ie=[Re("pre"),Re("code"),Re("xmp")],Pe=[],Ge=0;Ge<Ie.length;++Ge)for(var Ke=0,Ye=Ie[Ge].length;Ke<Ye;++Ke)Pe.push(Ie[Ge][Ke]);Ie=null;var Xe=Date;Xe.now||(Xe={now:function(){return+new Date}});var at=0,qe=/\blang(?:uage)?-([\w.]+)(?!\S)/,ze=/\bprettyprint\b/,Ae=/\bprettyprinted\b/,Je=/pre|xmp/i,Ze=/^code$/i,oe=/^(?:pre|code|xmp)$/i,X={};function J(){for(var ne=U.PR_SHOULD_USE_CONTINUATION?Xe.now()+250:Infinity;at<Pe.length&&Xe.now()<ne;at++){for(var se=Pe[at],q=X,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){q={},he.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Mt,xt,mr){q[xt]=mr});break}}var ge=se.className;if((q!==X||ze.test(ge))&&!Ae.test(ge)){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 tt=q.lang;if(!tt){tt=ge.match(qe);var it;!tt&&(it=me(se))&&Ze.test(it.tagName)&&(tt=it.className.match(qe)),tt&&(tt=tt[1])}var vt;if(Je.test(se.tagName))vt=1;else{var st=se.currentStyle,nt=Ne.defaultView,Tt=st?st.whiteSpace:nt&&nt.getComputedStyle?nt.getComputedStyle(se,null).getPropertyValue("white-space"):0;vt=Tt&&Tt.substring(0,3)==="pre"}var Et=q.linenums;(Et=Et==="true"||+Et)||(Et=ge.match(/\blinenums\b(?::(\d+))?/),Et=Et?Et[1]&&Et[1].length?+Et[1]:!0:!1),Et&&Le(se,Et,vt);var _t={langExtension:tt,sourceNode:se,numberLines:Et,pre:vt,sourceCode:null,basePos:null,spans:null,decorations:null};T(_t)}}}at<Pe.length?U.setTimeout(J,250):typeof ue=="function"&&ue()}J()}var $=U.PR={createSimpleLexer:be,registerLangHandler:ve,sourceDecorator:Be,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:H,PR_COMMENT:v,PR_DECLARATION:m,PR_KEYWORD:D,PR_LITERAL:d,PR_NOCODE:V,PR_PLAIN:a,PR_PUNCTUATION:l,PR_SOURCE:b,PR_STRING:p,PR_TAG:g,PR_TYPE:f,prettyPrintOne:R?U.prettyPrintOne=k:L=k,prettyPrint:W=R?U.prettyPrint=G:W=G},N=U.define;typeof N=="function"&&N.amd&&N("google-code-prettify",[],function(){return $})})()},SMhR:function(_e,Oe){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAHGCAYAAADuYispAAAAAklEQVR4AewaftIAABHTSURBVO3BQY4cy5IEQdNA3//KNo2/8NU8XzCQyCpSReivSJKk/zmRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNH7yMiB/s7a5AWTTNhsgN9pmA2TTNp8MyI22uQHkv7TNDSCbttkAudE2bwJyo22eBGTTNhsgf7O2ecuJJEkaJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpPGTD9c2nw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0gN9pmA2QDZNM2GyCbtrnRNk8BcqNtNkA2QN7UNhsgTwKyaZsNkE3bvAnIjbb5VCeSJGmcSJKkcSJJksaJJEkaJ5IkaZxIkqRxIkmSBv2VFwH5m7XNk4Bs2uZJQJ7UNjeA3GibTwXkRttsgNxomw2QG22zAXKjbW4AeVLbbIDcaJsNkCe1zVtOJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJA36K5Ik6X9OJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ4/8ATrCgy9kbxW8AAAAASUVORK5CYII="},STEk:function(_e,Oe,ee){"use strict";ee.d(Oe,"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 fe=function(j,T){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,G){k.__proto__=G}||function(k,G){for(var $ in G)Object.prototype.hasOwnProperty.call(G,$)&&(k[$]=G[$])})(j,T)};function Z(j,T){function k(){this.constructor=j}fe(j,T),j.prototype=T===null?Object.create(T):(k.prototype=T.prototype,new k)}function R(j,T,k,G){return new(k||(k=Promise))(function($,N){function ue(Ne){try{De(G.next(Ne))}catch(Re){N(Re)}}function Ee(Ne){try{De(G.throw(Ne))}catch(Re){N(Re)}}function De(Ne){var Re;Ne.done?$(Ne.value):(Re=Ne.value,Re instanceof k?Re:new k(function(Ie){Ie(Re)})).then(ue,Ee)}De((G=G.apply(j,T||[])).next())})}function Q(j,T){var k,G,$,N,ue={label:0,sent:function(){if(1&$[0])throw $[1];return $[1]},trys:[],ops:[]};return N={next:Ee(0),throw:Ee(1),return:Ee(2)},typeof Symbol=="function"&&(N[Symbol.iterator]=function(){return this}),N;function Ee(De){return function(Ne){return function(Re){if(k)throw new TypeError("Generator is already executing.");for(;ue;)try{if(k=1,G&&($=2&Re[0]?G.return:Re[0]?G.throw||(($=G.return)&&$.call(G),0):G.next)&&!($=$.call(G,Re[1])).done)return $;switch(G=0,$&&(Re=[2&Re[0],$.value]),Re[0]){case 0:case 1:$=Re;break;case 4:return ue.label++,{value:Re[1],done:!1};case 5:ue.label++,G=Re[1],Re=[0];continue;case 7:Re=ue.ops.pop(),ue.trys.pop();continue;default:if(!($=ue.trys,($=$.length>0&&$[$.length-1])||Re[0]!==6&&Re[0]!==2)){ue=0;continue}if(Re[0]===3&&(!$||Re[1]>$[0]&&Re[1]<$[3])){ue.label=Re[1];break}if(Re[0]===6&&ue.label<$[1]){ue.label=$[1],$=Re;break}if($&&ue.label<$[2]){ue.label=$[2],ue.ops.push(Re);break}$[2]&&ue.ops.pop(),ue.trys.pop();continue}Re=T.call(j,ue)}catch(Ie){Re=[6,Ie],G=0}finally{k=$=0}if(5&Re[0])throw Re[1];return{value:Re[0]?Re[1]:void 0,done:!0}}([De,Ne])}}}function _(){for(var j=0,T=0,k=arguments.length;T<k;T++)j+=arguments[T].length;var G=Array(j),$=0;for(T=0;T<k;T++)for(var N=arguments[T],ue=0,Ee=N.length;ue<Ee;ue++,$++)G[$]=N[ue];return G}var L=function(){function j(){}return j.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},j.setAttributes=function(T,k){for(var G=0,$=k;G<$.length;G++){var N=$[G],ue=N[0],Ee=N[1];T.setAttribute(ue,Ee)}},j.createRect=function(T,k,G){var $=document.createElementNS("http://www.w3.org/2000/svg","rect");return $.setAttribute("width",T.toString()),$.setAttribute("height",k.toString()),G&&j.setAttributes($,G),$},j.createLine=function(T,k,G,$,N){var ue=document.createElementNS("http://www.w3.org/2000/svg","line");return ue.setAttribute("x1",T.toString()),ue.setAttribute("y1",k.toString()),ue.setAttribute("x2",G.toString()),ue.setAttribute("y2",$.toString()),N&&j.setAttributes(ue,N),ue},j.createPolygon=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","polygon");return G.setAttribute("points",T),k&&j.setAttributes(G,k),G},j.createCircle=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","circle");return G.setAttribute("cx",(T/2).toString()),G.setAttribute("cy",(T/2).toString()),G.setAttribute("r",T.toString()),k&&j.setAttributes(G,k),G},j.createEllipse=function(T,k,G){var $=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return $.setAttribute("cx",(T/2).toString()),$.setAttribute("cy",(k/2).toString()),$.setAttribute("rx",(T/2).toString()),$.setAttribute("ry",(k/2).toString()),G&&j.setAttributes($,G),$},j.createGroup=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return T&&j.setAttributes(k,T),k},j.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},j.createMarker=function(T,k,G,$,N,ue,Ee){var De=document.createElementNS("http://www.w3.org/2000/svg","marker");return j.setAttributes(De,[["id",T],["orient",k],["markerWidth",G.toString()],["markerHeight",$.toString()],["refX",N.toString()],["refY",ue.toString()]]),De.appendChild(Ee),De},j.createText=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),T&&j.setAttributes(k,T),k},j.createTSpan=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","tspan");return G.textContent=T,k&&j.setAttributes(G,k),G},j.createImage=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return T&&j.setAttributes(k,T),k},j.createPoint=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return G.x=T,G.y=k,G},j.createPath=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","path");return G.setAttribute("d",T),k&&j.setAttributes(G,k),G},j}(),W=function(){function j(){}return j.addKey=function(T){j.key=T},Object.defineProperty(j,"isLicensed",{get:function(){return!!j.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(j.key)},enumerable:!1,configurable:!0}),j}(),U=function(){function j(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return j.prototype.rasterize=function(T,k,G){var $=this;return new Promise(function(N){var ue=G!==void 0?G:document.createElement("canvas");T===null&&($.markersOnly=!0,$.naturalSize=!1);var Ee=document.createElementNS("http://www.w3.org/2000/svg","svg");Ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ee.setAttribute("width",k.width.baseVal.valueAsString),Ee.setAttribute("height",k.height.baseVal.valueAsString),Ee.setAttribute("viewBox","0 0 "+k.viewBox.baseVal.width.toString()+" "+k.viewBox.baseVal.height.toString()),Ee.innerHTML=k.innerHTML,$.naturalSize===!0?(Ee.width.baseVal.value=T.naturalWidth,Ee.height.baseVal.value=T.naturalHeight):$.width!==void 0&&$.height!==void 0&&(Ee.width.baseVal.value=$.width,Ee.height.baseVal.value=$.height),ue.width=Ee.width.baseVal.value,ue.height=Ee.height.baseVal.value;var De=Ee.outerHTML,Ne=ue.getContext("2d");$.markersOnly!==!0&&Ne.drawImage(T,0,0,ue.width,ue.height);var Re=window.URL,Ie=new Image(ue.width,ue.height);Ie.setAttribute("crossOrigin","anonymous");var Pe=new Blob([De],{type:"image/svg+xml"}),Ge=Re.createObjectURL(Pe);Ie.onload=function(){Ne.drawImage(Ie,0,0),Re.revokeObjectURL(Ge);var Ke=ue.toDataURL($.imageType,$.imageQuality);N(Ke)},Ie.src=Ge})},j}(),O=function(){},M=function(){function j(T){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+T+"_"}return Object.defineProperty(j.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),j.prototype.addClass=function(T){return this.styleSheet===void 0&&this.addStyleSheet(),T.name=""+this.classNamePrefix+T.localName,this.classes.push(T),this.styleSheet.sheet.insertRule("."+T.name+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length),T},j.prototype.addRule=function(T){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(T),this.styleSheet.sheet.insertRule(T.selector+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length)},j.prototype.addStyleSheet=function(){var T;this.styleSheet=document.createElement("style"),((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).appendChild(this.styleSheet),this.addRule(new y("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new y("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new y("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new C("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new C("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},j.prototype.removeStyleSheet=function(){var T;this.styleSheet&&(((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},j}(),y=function(j,T){this.selector=j,this.style=T},C=function(j,T){this.localName=j,this.style=T},I=function(){function j(T,k,G,$,N){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=T,this.displayMode=k,this.markerItems=G,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 j.prototype.show=function(T){var k=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var G=document.createElement("div");G.className=this.toolbarBlockStyleClass.name,G.style.whiteSpace="nowrap",this.uiContainer.appendChild(G),this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(N){var ue=document.createElement("div");ue.className=""+k.toolbarButtonStyleClass.name,ue.setAttribute("data-type-name",N.typeName),ue.innerHTML=N.icon,ue.addEventListener("click",function(){k.markerToolbarButtonClicked(ue,N)}),k.buttons.push(ue),k.markerButtons.push(ue)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var $=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()},j.prototype.addButtonClickListener=function(T){this.buttonClickListeners.push(T)},j.prototype.removeButtonClickListener=function(T){this.buttonClickListeners.indexOf(T)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(T),1)},j.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},j.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var T=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var k=0;k<this.markerButtons.length;k++)k<T||k===T&&this.markerButtons.length-1===T?this.markerButtonBlock.appendChild(this.markerButtons[k]):(k===T&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[k]))}},j.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},j.prototype.resetButtonStyles=function(){var T=this;this.buttons.forEach(function(k){k.className=k.className.replace(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name,"").trim(),k.className=k.className.replace(T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:T.toolbarActiveButtonStyleColorsClass.name,"").trim(),k.className+=" "+(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name)})},j.prototype.addActionButton=function(T,k,G){var $=this,N=document.createElement("div");switch(N.className=""+this.toolbarButtonStyleClass.name,N.innerHTML=k,N.setAttribute("data-action",G),N.addEventListener("click",function(){$.actionToolbarButtonClicked(N,G)}),G){case"select":N.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":N.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":N.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":N.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":N.style.fill=this.uiStyleSettings.closeButtonColor}T.appendChild(N),this.buttons.push(N)},j.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new C("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 C("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new C("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new C("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 C("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var T=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new C("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 C("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new C("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new y("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new y("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},j.prototype.markerToolbarButtonClicked=function(T,k){this.setActiveButton(T),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},j.prototype.actionToolbarButtonClicked=function(T,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},j.prototype.setActiveButton=function(T){this.resetButtonStyles(),T.className=T.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),T.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},j.prototype.setActiveMarkerButton=function(T){var k=this.markerButtons.find(function(G){return G.getAttribute("data-type-name")===T});k&&this.setActiveButton(k)},j.prototype.setCurrentMarker=function(T){var k=this;this.currentMarker=T,this.buttons.filter(function(G){return/delete|notes/.test(G.getAttribute("data-action"))}).forEach(function(G){k.currentMarker===void 0?(G.style.fillOpacity="0.4",G.style.pointerEvents="none"):(G.style.fillOpacity="1",G.style.pointerEvents="all")})},j}(),w=function(){function j(T,k,G,$){this.panels=[],this.panelButtons=[],this.markerjsContainer=T,this.displayMode=k,this.uiStyleSettings=G,this.styles=$,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return j.prototype.addStyles=function(){var T;this.toolboxStyleClass=this.styles.addClass(new C("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 C("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new C("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new C("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new C("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 C("toolbox-panel-row_colors",`
|
|
background-color: `+((T=this.uiStyleSettings.toolboxBackgroundColor)!==null&&T!==void 0?T:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new C("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
|
|
padding: `+k+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new C("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new C("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new y("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new y("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},j.prototype.show=function(T){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},j.prototype.setPanelButtons=function(T){var k,G,$=this;this.panels=T,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((G=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&G!==void 0?G:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(N){var ue;N.uiStyleSettings=$.uiStyleSettings;var Ee=document.createElement("div");Ee.className=$.toolboxButtonStyleClass.name+" "+((ue=$.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ue!==void 0?ue:$.toolboxButtonStyleColorsClass.name),Ee.innerHTML=N.icon,Ee.title=N.title,Ee.addEventListener("click",function(){$.panelButtonClick(N)}),$.panelButtons.push(Ee),$.buttonRow.appendChild(Ee)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},j.prototype.panelButtonClick=function(T){var k=this,G=-1;if(T!==this.activePanel){G=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(){k.displayMode==="inline"?k.panelRow.style.display="none":k.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(N,ue){var Ee,De;N.className=k.toolboxButtonStyleClass.name+" "+(ue===G?""+((Ee=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:k.toolboxActiveButtonStyleColorsClass.name):""+((De=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&De!==void 0?De:k.toolboxButtonStyleColorsClass.name))})},j}(),A=function(j,T){this.title=j,this.icon=T},S=function(j){function T(k,G,$,N){var ue=j.call(this,k,N||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return ue.colors=[],ue.addTransparent=!1,ue.colorBoxes=[],ue.colors=G,ue.currentColor=$,ue.setCurrentColor=ue.setCurrentColor.bind(ue),ue.getColorBox=ue.getColorBox.bind(ue),ue}return Z(T,j),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.whiteSpace="nowrap",this.colors.forEach(function($){var N=k.getColorBox($);G.appendChild(N),k.colorBoxes.push(N)}),G},T.prototype.getColorBox=function(k){var G=this,$=this.uiStyleSettings.toolbarHeight/4,N=this.uiStyleSettings.toolbarHeight-$,ue=document.createElement("div");ue.style.display="inline-block",ue.style.boxSizing="content-box",ue.style.width=N-2+"px",ue.style.height=N-2+"px",ue.style.padding="1px",ue.style.marginRight="2px",ue.style.marginBottom="2px",ue.style.borderWidth="2px",ue.style.borderStyle="solid",ue.style.borderRadius=(N+2)/2+"px",ue.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ue.addEventListener("click",function(){G.setCurrentColor(k,ue)});var Ee=document.createElement("div");return Ee.style.display="inline-block",Ee.style.width=N-2+"px",Ee.style.height=N-2+"px",Ee.style.backgroundColor=k,Ee.style.borderRadius=N/2+"px",k==="transparent"&&(Ee.style.fill=this.uiStyleSettings.toolboxAccentColor,Ee.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),ue.appendChild(Ee),ue},T.prototype.setCurrentColor=function(k,G){var $=this;this.currentColor=k,this.colorBoxes.forEach(function(N){N.style.borderColor=N===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},T}(A),h=function(){function j(T,k,G){this._state="new",this._isSelected=!1,this._container=T,this._overlayContainer=k,this.globalSettings=G,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(j.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),j.prototype.ownsTarget=function(T){return!1},Object.defineProperty(j.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),j.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},j.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},j.prototype.pointerDown=function(T,k){},j.prototype.dblClick=function(T,k){},j.prototype.manipulate=function(T){},j.prototype.pointerUp=function(T){this.stateChanged()},j.prototype.dispose=function(){},j.prototype.addMarkerVisualToContainer=function(T){this.container.childNodes.length>0?this.container.insertBefore(T,this.container.childNodes[0]):this.container.appendChild(T)},j.prototype.getState=function(){return{typeName:j.typeName,state:this.state,notes:this.notes}},j.prototype.restoreState=function(T){this._state=T.state,this.notes=T.notes},j.prototype.scale=function(T,k){},j.prototype.colorChanged=function(T){this.onColorChanged&&this.onColorChanged(T),this.stateChanged()},j.prototype.fillColorChanged=function(T){this.onFillColorChanged&&this.onFillColorChanged(T),this.stateChanged()},j.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var T=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),T.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(T)&&this.onStateChanged(this)}},j.typeName="MarkerBase",j}(),o=function(){function j(){this.findGripByVisual=this.findGripByVisual.bind(this)}return j.prototype.findGripByVisual=function(T){return this.topLeft.ownsTarget(T)?this.topLeft:this.topCenter.ownsTarget(T)?this.topCenter:this.topRight.ownsTarget(T)?this.topRight:this.centerLeft.ownsTarget(T)?this.centerLeft:this.centerRight.ownsTarget(T)?this.centerRight:this.bottomLeft.ownsTarget(T)?this.bottomLeft:this.bottomCenter.ownsTarget(T)?this.bottomCenter:this.bottomRight.ownsTarget(T)?this.bottomRight:void 0},j}(),s=function(){function j(){this.GRIP_SIZE=10,this.visual=L.createGroup(),this.visual.appendChild(L.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(L.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return j.prototype.ownsTarget=function(T){return T===this.visual||T===this.visual.childNodes[0]||T===this.visual.childNodes[1]},j}(),u=function(){function j(){}return j.toITransformMatrix=function(T){return{a:T.a,b:T.b,c:T.c,d:T.d,e:T.e,f:T.f}},j.toSVGMatrix=function(T,k){return T.a=k.a,T.b=k.b,T.c=k.c,T.d=k.d,T.e=k.e,T.f=k.f,T},j}(),x=function(j){function T(k,G,$){var N=j.call(this,k,G,$)||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(L.createTransform()),N.setupControlBox(),N}return Z(T,j),Object.defineProperty(T.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var G=L.createTransform();this._visual.transform.baseVal.appendItem(G)},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(k){return!!j.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},T.prototype.pointerDown=function(k,G){j.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.left=k.x,this.top=k.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var $=this.unrotatePoint(k);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(G),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(G)){this.activeGrip=this.rotatorGrip;var N=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=N.x-this.width/2,this.top=N.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ue=this.container.transform.baseVal.getItem(0);ue.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ue,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},T.prototype.pointerUp=function(k){var G=this.state;j.prototype.pointerUp.call(this,k),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(k),this._state="select",G==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},T.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},T.prototype.manipulate=function(k){var G=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(G.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(G.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(G):this.state==="rotate"&&this.rotate(k)},T.prototype.resize=function(k){var G=this.manipulationStartLeft,$=this.manipulationStartWidth,N=this.manipulationStartTop,ue=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:G=this.manipulationStartLeft+k.x-this.manipulationStartX,$=this.manipulationStartWidth+this.manipulationStartLeft-G;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:$=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:N=this.manipulationStartTop+k.y-this.manipulationStartY,ue=this.manipulationStartHeight+this.manipulationStartTop-N;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ue=this.manipulationStartHeight+k.y-this.manipulationStartY}$>=0?(this.left=G,this.width=$):(this.left=G+$,this.width=-$),ue>=0?(this.top=N,this.height=ue):(this.top=N+ue,this.height=-ue),this.setSize()},T.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},T.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var G=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*G,this.applyRotation()}},T.prototype.applyRotation=function(){var k=this.container.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(k,0)},T.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var G=this.container.getCTM(),$=L.createPoint(k.x,k.y);return{x:($=$.matrixTransform(G)).x,y:$.y}},T.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var G=this.container.getCTM();G=G.inverse();var $=L.createPoint(k.x,k.y);return{x:($=$.matrixTransform(G)).x,y:$.y}},T.prototype.select=function(){j.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){j.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=L.createGroup();var k=L.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=L.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=L.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 k=this.controlBox.transform.baseVal.getItem(0);k.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(k,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 k=new s;return k.visual.transform.baseVal.appendItem(L.createTransform()),this.controlBox.appendChild(k.visual),k},T.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,G=-k/2,$=G,N=(this.width+this.CB_DISTANCE)/2-k/2,ue=(this.height+this.CB_DISTANCE)/2-k/2,Ee=this.height+this.CB_DISTANCE-k/2,De=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,G,$),this.positionGrip(this.controlGrips.topCenter.visual,N,$),this.positionGrip(this.controlGrips.topRight.visual,De,$),this.positionGrip(this.controlGrips.centerLeft.visual,G,ue),this.positionGrip(this.controlGrips.centerRight.visual,De,ue),this.positionGrip(this.controlGrips.bottomLeft.visual,G,Ee),this.positionGrip(this.controlGrips.bottomCenter.visual,N,Ee),this.positionGrip(this.controlGrips.bottomRight.visual,De,Ee),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,N,$-3*this.CB_DISTANCE)},T.prototype.positionGrip=function(k,G,$){var N=k.transform.baseVal.getItem(0);N.setTranslate(G,$),k.transform.baseVal.replaceItem(N,0)},T.prototype.hideControlBox=function(){this.controlBox.style.display="none"},T.prototype.showControlBox=function(){this.controlBox.style.display=""},T.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:u.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:u.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},j.prototype.getState.call(this))},T.prototype.restoreState=function(k){j.prototype.restoreState.call(this,k);var G=k;this.left=G.left,this.top=G.top,this.width=G.width,this.height=G.height,this.rotationAngle=G.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(u.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,G.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(u.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,G.containerTransformMatrix))},T.prototype.scale=function(k,G){j.prototype.scale.call(this,k,G);var $=this.rotatePoint({x:this.left,y:this.top}),N=this.unrotatePoint({x:$.x*k,y:$.y*G});this.left=N.x,this.top=N.y,this.width=this.width*k,this.height=this.height*G,this.adjustControlBox()},T}(h),c=function(j){function T(k,G,$){var N=j.call(this,k,G,$)||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 Z(T,j),T.prototype.ownsTarget=function(k){return!(!j.prototype.ownsTarget.call(this,k)&&k!==this.visual)},T.prototype.createVisual=function(){this.visual=L.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(k,G){j.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},T.prototype.manipulate=function(k){j.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){j.prototype.resize.call(this,k),this.setSize()},T.prototype.setSize=function(){j.prototype.setSize.call(this),L.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(k){j.prototype.pointerUp.call(this,k),this.setSize()},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&L.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},T.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&L.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&L.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&L.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},j.prototype.getState.call(this))},T.prototype.restoreState=function(k){var G=k;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),j.prototype.restoreState.call(this,k),this.setSize()},T.prototype.scale=function(k,G){j.prototype.scale.call(this,k,G),this.setSize()},T.title="Rectangle marker",T}(x),p=function(j){function T(k,G,$,N){var ue=j.call(this,k,N||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ue.widths=[],ue.widthBoxes=[],ue.widths=G,ue.currentWidth=$,ue.setCurrentWidth=ue.setCurrentWidth.bind(ue),ue}return Z(T,j),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.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=$===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){k.setCurrentWidth($,N)}),G.appendChild(N);var ue=document.createElement("div");ue.innerText=$.toString(),ue.style.marginRight="5px",N.appendChild(ue);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.display="flex",Ee.style.alignItems="center";var De=document.createElement("hr");De.style.minWidth="20px",De.style.border="0px",De.style.borderTop=$+"px solid "+k.uiStyleSettings.toolboxColor,De.style.flexGrow="2",Ee.appendChild(De),N.appendChild(Ee),k.widthBoxes.push(N)}),G},T.prototype.setCurrentWidth=function(k,G){var $=this;this.currentWidth=k,this.widthBoxes.forEach(function(N){N.style.borderColor=N===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},T}(A),D=function(j){function T(k,G,$,N){var ue=j.call(this,k,N||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return ue.styles=[],ue.styleBoxes=[],ue.styles=G,ue.currentStyle=$,ue.setCurrentStyle=ue.setCurrentStyle.bind(ue),ue}return Z(T,j),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.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/k.styles.length-5+"%",N.style.borderColor=$===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){k.setCurrentStyle($,N)}),G.appendChild(N);var ue=document.createElement("div");ue.style.minHeight="20px",ue.style.flexGrow="2",ue.style.overflow="hidden";var Ee=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+k.uiStyleSettings.toolboxColor+'" stroke-width="3" '+($!==""?'stroke-dasharray="'+$+'"':"")+` />
|
|
</svg>`;ue.innerHTML=Ee,N.appendChild(ue),k.styleBoxes.push(N)}),G},T.prototype.setCurrentStyle=function(k,G){var $=this;this.currentStyle=k,this.styleBoxes.forEach(function(N){N.style.borderColor=N===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},T}(A),v=function(j){function T(k,G,$){var N=j.call(this,k,G,$)||this;return N.strokeColor=$.defaultColor,N.strokeWidth=$.defaultStrokeWidth,N.strokeDasharray=$.defaultStrokeDasharray,N.strokePanel=new S("Line color",$.defaultColorSet,$.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new p("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new D("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return Z(T,j),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=j.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="FrameMarker",T.title="Frame marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',T}(c),f=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},d=function(j){function T(k,G,$){var N=j.call(this,k,G,$)||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 Z(T,j),T.prototype.ownsTarget=function(k){return!!j.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},T.prototype.pointerDown=function(k,G){j.prototype.pointerDown.call(this,k,G),this.manipulationStartX=k.x,this.manipulationStartY=k.y,this.state==="new"&&(this.x1=k.x,this.y1=k.y,this.x2=k.x,this.y2=k.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(G)?this.activeGrip=this.grip1:this.grip2.ownsTarget(G)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},T.prototype.pointerUp=function(k){var G=this.state;j.prototype.pointerUp.call(this,k),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(k),this._state="select",G==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},T.prototype.adjustVisual=function(){},T.prototype.manipulate=function(k){this.state==="creating"?this.resize(k):this.state==="move"?(this.x1=this.manipulationStartX1+k.x-this.manipulationStartX,this.y1=this.manipulationStartY1+k.y-this.manipulationStartY,this.x2=this.manipulationStartX2+k.x-this.manipulationStartX,this.y2=this.manipulationStartY2+k.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(k)},T.prototype.resize=function(k){switch(this.activeGrip){case this.grip1:this.x1=k.x,this.y1=k.y;break;case this.grip2:case void 0:this.x2=k.x,this.y2=k.y}this.adjustVisual(),this.adjustControlBox()},T.prototype.select=function(){j.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){j.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=L.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 k=new s;return k.visual.transform.baseVal.appendItem(L.createTransform()),this.controlBox.appendChild(k.visual),k},T.prototype.positionGrips=function(){var k=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-k/2,this.y1-k/2),this.positionGrip(this.grip2.visual,this.x2-k/2,this.y2-k/2)},T.prototype.positionGrip=function(k,G,$){var N=k.transform.baseVal.getItem(0);N.setTranslate(G,$),k.transform.baseVal.replaceItem(N,0)},T.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},j.prototype.getState.call(this))},T.prototype.restoreState=function(k){j.prototype.restoreState.call(this,k);var G=k;this.x1=G.x1,this.y1=G.y1,this.x2=G.x2,this.y2=G.y2},T.prototype.scale=function(k,G){j.prototype.scale.call(this,k,G),this.x1=this.x1*k,this.y1=this.y1*G,this.x2=this.x2*k,this.y2=this.y2*G,this.adjustVisual(),this.adjustControlBox()},T}(h),l=function(j){function T(k,G,$){var N=j.call(this,k,G,$)||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 S("Line color",$.defaultColorSet,$.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new p("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new D("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return Z(T,j),T.prototype.ownsTarget=function(k){return!(!j.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},T.prototype.createVisual=function(){this.visual=L.createGroup(),this.selectorLine=L.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=L.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(k,G){j.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},T.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),L.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),L.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),L.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,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 k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},j.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){j.prototype.restoreState.call(this,k);var G=k;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.createVisual(),this.adjustVisual()},T.typeName="LineMarker",T.title="Line marker",T.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',T}(d),a=function(j){function T(k,G,$,N){var ue=j.call(this,k,N||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return ue.fonts=[],ue.fontBoxes=[],ue.fonts=G,ue.currentFont=$,ue.setCurrentFont=ue.setCurrentFont.bind(ue),ue}return Z(T,j),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.overflow="hidden",G.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/k.fonts.length-5+"%",N.style.borderColor=$===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){k.setCurrentFont($,N)}),G.appendChild(N);var ue=document.createElement("div");ue.style.display="flex",ue.style.minHeight="20px",ue.style.flexGrow="2",ue.style.fontFamily=$,ue.style.overflow="hidden";var Ee=document.createElement("div");Ee.style.whiteSpace="nowrap",Ee.style.overflow="hidden",Ee.style.textOverflow="ellipsis",Ee.innerHTML="The quick brown fox jumps over the lazy dog",ue.appendChild(Ee),N.appendChild(ue),k.fontBoxes.push(N)}),G},T.prototype.setCurrentFont=function(k,G){var $=this;this.currentFont=k,this.fontBoxes.forEach(function(N){N.style.borderColor=N===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},T}(A),g=function(j){function T(k,G,$){var N=j.call(this,k,G,$)||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 S("Color",$.defaultColorSet,$.defaultColor),N.colorPanel.onColorChanged=N.setColor,N.fontFamilyPanel=new a("Font",$.defaultFontFamilies,$.defaultFontFamily),N.fontFamilyPanel.onFontChanged=N.setFont,N}return Z(T,j),T.prototype.ownsTarget=function(k){if(j.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var G=!1;return this.textElement.childNodes.forEach(function($){$===k&&(G=!0)}),G},T.prototype.createVisual=function(){this.visual=L.createGroup(),this.bgRectangle=L.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=L.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(L.createTransform()),this.textElement.transform.baseVal.appendItem(L.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},T.prototype.pointerDown=function(k,G){j.prototype.pointerDown.call(this,k,G),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},T.prototype.renderText=function(){var k=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(G){k.textElement.appendChild(L.createTSpan(G.trim()===""?" ":G.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},T.prototype.getTextScale=function(){var k=this.textElement.getBBox(),G=1;if(k.width>0&&k.height>0){var $=(1*this.width-this.width*this.padding*2/100)/k.width,N=(1*this.height-this.height*this.padding*2/100)/k.height;G=Math.min($,N)}return G},T.prototype.getTextPosition=function(k){var G=this.textElement.getBBox(),$=0,N=0;return G.width>0&&G.height>0&&($=(this.width-G.width*k)/2,N=this.height/2-G.height*k/2),{x:$,y:N}},T.prototype.sizeText=function(){var k=this.textElement.getBBox(),G=this.getTextScale(),$=this.getTextPosition(G);$.y-=k.y*G,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+$.x+"px, "+$.y+"px) scale("+G+", "+G+")":(this.textElement.transform.baseVal.getItem(0).setTranslate($.x,$.y),this.textElement.transform.baseVal.getItem(1).setScale(G,G))},T.prototype.manipulate=function(k){j.prototype.manipulate.call(this,k),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(k.x-this.pointerDownPoint.x)>5||Math.abs(k.y-this.pointerDownPoint.y)>5)},T.prototype.resize=function(k){j.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},T.prototype.setSize=function(){j.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(L.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),L.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},T.prototype.pointerUp=function(k){var G=this.state;G==="creating"&&(this._suppressMarkerCreateEvent=!0),j.prototype.pointerUp.call(this,k),this.setSize(),(G==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},T.prototype.showTextEditor=function(){var k=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(G){G.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var G=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&G>.9;)G-=.1,k.textEditor.style.fontSize=Math.max(G,.9)+"em"}),this.textEditor.addEventListener("keyup",function(G){G.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(G){if(G.clipboardData){var $=G.clipboardData.getData("text"),N=window.getSelection();if(!N.rangeCount)return!1;N.deleteFromDocument(),N.getRangeAt(0).insertNode(document.createTextNode($)),G.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){k.textEditDivClicked(k.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 k=this.getTextScale(),G=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),$=this.textElement.getBBox(),N={x:$.width*k,y:$.height*k};G.x-=N.x/2,G.y-=N.y/2,this.textEditor.style.top=G.y+"px",this.textEditor.style.left=G.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-G.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},T.prototype.textEditDivClicked=function(k){this.text=k.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},T.prototype.select=function(){j.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},T.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),j.prototype.deselect.call(this)},T.prototype.dblClick=function(k,G){j.prototype.dblClick.call(this,k,G),this.showTextEditor()},T.prototype.setColor=function(k){this.textElement&&L.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},T.prototype.setFont=function(k){this.textElement&&L.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,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 k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},j.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){var G=k;this.color=G.color,this.fontFamily=G.fontFamily,this.padding=G.padding,this.text=G.text,this.createVisual(),j.prototype.restoreState.call(this,k),this.setSize()},T.prototype.scale=function(k,G){j.prototype.scale.call(this,k,G),this.setSize(),this.sizeText(),this.positionTextEditor()},T.typeName="TextMarker",T.title="Text marker",T.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',T}(x),m=function(j){function T(k,G,$){var N=j.call(this,k,G,$)||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 S("Color",$.defaultColorSet,$.defaultColor),N.colorPanel.onColorChanged=N.setColor,N.lineWidthPanel=new p("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),N.lineWidthPanel.onWidthChanged=N.setLineWidth,N}return Z(T,j),T.prototype.ownsTarget=function(k){return!(!j.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},T.prototype.createVisual=function(){this.visual=L.createGroup(),this.drawingImage=L.createImage(),this.visual.appendChild(this.drawingImage);var k=L.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,G){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(k.x,k.y),this.drawing=!0):j.prototype.pointerDown.call(this,k,G)},T.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):j.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){j.prototype.resize.call(this,k),L.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),L.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):j.prototype.pointerUp.call(this,k)},T.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},T.prototype.select=function(){this.state==="creating"&&this.finishCreation(),j.prototype.select.call(this)},T.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),j.prototype.deselect.call(this)},T.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),G=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],$=G[0],N=G[1],ue=G[2],Ee=G[3],De=!1,Ne=0;Ne<this.canvasElement.height;Ne++)for(var Re=0;Re<this.canvasElement.width;Re++)k.data[Ne*this.canvasElement.width*4+4*Re+3]>0&&(De=!0,Ne<N&&(N=Ne),Re<$&&($=Re),Ne>Ee&&(Ee=Ne),Re>ue&&(ue=Re));if(De){this.left=$/this.pixelRatio,this.top=N/this.pixelRatio,this.width=(ue-$)/this.pixelRatio,this.height=(Ee-N)/this.pixelRatio;var Ie=document.createElement("canvas");Ie.width=ue-$,Ie.height=Ee-N,Ie.getContext("2d").putImageData(this.canvasContext.getImageData($,N,ue-$,Ee-N),0,0),this.drawingImgUrl=Ie.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},T.prototype.setDrawingImage=function(){L.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),L.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},T.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},T.prototype.setLineWidth=function(k){this.lineWidth=k},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 k=Object.assign({drawingImgUrl:this.drawingImgUrl},j.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){this.createVisual(),j.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},T.prototype.scale=function(k,G){j.prototype.scale.call(this,k,G),this.setDrawingImage()},T.typeName="FreehandMarker",T.title="Freehand marker",T.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',T}(x),b=function(j){function T(k,G,$){var N=j.call(this,k,$||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return N.typeBoxes=[],N.currentType=G,N.setCurrentType=N.setCurrentType.bind(N),N}return Z(T,j),T.prototype.getUi=function(){var k=this,G=document.createElement("div");G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2";for(var $=function(Ee){var De="both";switch(Ee){case 0:De="both";break;case 1:De="start";break;case 2:De="end";break;case 3:De="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=De===N.currentType?N.uiStyleSettings.toolboxAccentColor:"transparent",Ne.addEventListener("click",function(){k.setCurrentType(De,Ne)}),G.appendChild(Ne),De==="both"||De==="start"){var Re=document.createElement("div");Re.style.display="flex",Re.style.alignItems="center",Re.style.minHeight="20px",Re.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>`,Re.style.marginLeft="5px",Ne.appendChild(Re)}var Ie=document.createElement("div");Ie.style.display="flex",Ie.style.alignItems="center",Ie.style.minHeight="20px",Ie.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",Ie.appendChild(Pe),Ne.appendChild(Ie),De==="both"||De==="end"){var Ge=document.createElement("div");Ge.style.display="flex",Ge.style.alignItems="center",Ge.style.minHeight="20px",Ge.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(N.uiStyleSettings!==void 0?N.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Ge.style.marginRight="5px",Ne.appendChild(Ge)}N.typeBoxes.push(Ne)},N=this,ue=0;ue<4;ue++)$(ue);return G},T.prototype.setCurrentType=function(k,G){var $=this;this.currentType=k,this.typeBoxes.forEach(function(N){N.style.borderColor=N===G?$.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},T}(A),P=function(j){function T(k,G,$){var N=j.call(this,k,G,$)||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 b("Arrow type","end"),N.arrowTypePanel.onArrowTypeChanged=N.setArrowType,N}return Z(T,j),T.prototype.ownsTarget=function(k){return!(!j.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},T.prototype.getArrowPoints=function(k,G){var $=this.arrowBaseWidth+2*this.strokeWidth,N=this.arrowBaseHeight+2*this.strokeWidth;return k-$/2+","+(G+N/2)+" "+k+","+(G-N/2)+" "+(k+$/2)+","+(G+N/2)},T.prototype.createTips=function(){this.arrow1=L.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(L.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=L.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(L.createTransform()),this.visual.appendChild(this.arrow2)},T.prototype.pointerDown=function(k,G){j.prototype.pointerDown.call(this,k,G),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(j.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",L.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),L.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.arrow1.transform.baseVal.getItem(0);G.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(G,0);var $=this.arrow2.transform.baseVal.getItem(0);$.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem($,0)}},T.prototype.setArrowType=function(k){this.arrowType=k,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 k=Object.assign({arrowType:this.arrowType},j.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){j.prototype.restoreState.call(this,k);var G=k;this.arrowType=G.arrowType,this.createTips(),this.adjustVisual()},T.typeName="ArrowMarker",T.title="Arrow marker",T.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',T}(l),H=function(j){function T(k,G,$){var N=j.call(this,k,G,$)||this;return N.fillColor=$.defaultFillColor,N.strokeWidth=0,N.fillPanel=new S("Color",$.defaultColorSet,$.defaultFillColor),N.fillPanel.onColorChanged=N.setFillColor,N}return Z(T,j),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=j.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="CoverMarker",T.title="Cover marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',T}(c),V=function(j){function T(k,G,$,N){var ue=j.call(this,k,N||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return ue.opacities=[],ue.opacityBoxes=[],ue.opacities=G,ue.currentOpacity=$,ue.setCurrentOpacity=ue.setCurrentOpacity.bind(ue),ue}return Z(T,j),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",G.style.justifyContent="space-between",this.opacities.forEach(function($){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=$===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){k.setCurrentOpacity($,N)}),G.appendChild(N);var ue=document.createElement("div");ue.innerText=100*$+"%",N.appendChild(ue),k.opacityBoxes.push(N)}),G},T.prototype.setCurrentOpacity=function(k,G){var $=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(N){N.style.borderColor=N===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},T}(A),re=function(j){function T(k,G,$){var N=j.call(this,k,G,$)||this;return N.setOpacity=N.setOpacity.bind(N),N.fillColor=$.defaultHighlightColor,N.strokeWidth=0,N.opacity=$.defaultHighlightOpacity,N.fillPanel=new S("Color",$.defaultColorSet,N.fillColor),N.fillPanel.onColorChanged=N.setFillColor,N.opacityPanel=new V("Opacity",$.defaultOpacitySteps,N.opacity),N.opacityPanel.onOpacityChanged=N.setOpacity,N}return Z(T,j),T.prototype.setOpacity=function(k){this.opacity=k,this.visual&&L.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 k=j.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="HighlightMarker",T.title="Highlight marker",T.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',T}(H),z='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',F=function(j){function T(k,G,$){var N=j.call(this,k,G,$)||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 S("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 S("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 s,N.tipGrip.visual.transform.baseVal.appendItem(L.createTransform()),N.controlBox.appendChild(N.tipGrip.visual),N}return Z(T,j),T.prototype.ownsTarget=function(k){return j.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},T.prototype.createTip=function(){L.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=L.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},T.prototype.pointerDown=function(k,G){this.state==="new"&&j.prototype.pointerDown.call(this,k,G),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(G)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):j.prototype.pointerDown.call(this,k,G)},T.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,j.prototype.pointerUp.call(this,k);else{var G=this.state==="creating";j.prototype.pointerUp.call(this,k),this.setTipPoints(G),this.positionTip()}},T.prototype.manipulate=function(k){if(this.tipMoving){var G=this.unrotatePoint(k);this.tipPosition={x:G.x-this.manipulationStartLeft,y:G.y-this.manipulationStartTop},this.positionTip()}else j.prototype.manipulate.call(this,k)},T.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(L.setAttributes(this.bgRectangle,[["fill",k]]),L.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},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(k){k===void 0&&(k=!1);var G=Math.min(this.height/2,15),$=this.height/5;k&&(this.tipPosition={x:G+$/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,G=Math.min(this.width/2,15),this.tipBase1Position={x:G,y:0},this.tipBase2Position={x:G+$,y:0}):(this.tipBase1Position={x:0,y:G},this.tipBase2Position={x:0,y:G+$}):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,G=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-G-$,y:0},this.tipBase2Position={x:this.width-G,y:0}):(this.tipBase1Position={x:this.width,y:G},this.tipBase2Position={x:this.width,y:G+$}):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,G=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-G-$,y:this.height},this.tipBase2Position={x:this.width-G,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-G-$},this.tipBase2Position={x:this.width,y:this.height-G}):N<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?($=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:G,y:this.height},this.tipBase2Position={x:G+$,y:this.height}):(this.tipBase1Position={x:0,y:this.height-G},this.tipBase2Position={x:0,y:this.height-G-$})},T.prototype.resize=function(k){j.prototype.resize.call(this,k),this.positionTip()},T.prototype.positionTip=function(){L.setAttributes(this.tip,[["points",this.getTipPoints()]]);var k=this.tipGrip.visual.transform.baseVal.getItem(0);k.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(k,0)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),T.prototype.select=function(){this.positionTip(),j.prototype.select.call(this)},T.prototype.getState=function(){var k=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},j.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){var G=k;this.bgColor=G.bgColor,this.tipPosition=G.tipPosition,j.prototype.restoreState.call(this,k),this.createTip(),this.setTipPoints()},T.prototype.scale=function(k,G){j.prototype.scale.call(this,k,G),this.tipPosition={x:this.tipPosition.x*k,y:this.tipPosition.y*G},this.positionTip()},T.typeName="CalloutMarker",T.title="Callout marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',T}(g),ae=function(j){function T(k,G,$){var N=j.call(this,k,G,$)||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 S("Line color",_($.defaultColorSet,["transparent"]),$.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.fillPanel=new S("Fill color",_($.defaultColorSet,["transparent"]),N.fillColor,z),N.fillPanel.onColorChanged=N.setFillColor,N.strokeWidthPanel=new p("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 V("Opacity",$.defaultOpacitySteps,N.opacity),N.opacityPanel.onOpacityChanged=N.setOpacity,N}return Z(T,j),T.prototype.ownsTarget=function(k){return!(!j.prototype.ownsTarget.call(this,k)&&k!==this.visual)},T.prototype.createVisual=function(){this.visual=L.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(k,G){j.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},T.prototype.manipulate=function(k){j.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){j.prototype.resize.call(this,k),this.setSize()},T.prototype.setSize=function(){j.prototype.setSize.call(this),L.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(k){j.prototype.pointerUp.call(this,k),this.setSize()},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&L.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},T.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&L.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&L.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&L.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.setOpacity=function(k){this.opacity=k,this.visual&&L.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 k=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},j.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){var G=k;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),j.prototype.restoreState.call(this,k),this.setSize()},T.prototype.scale=function(k,G){j.prototype.scale.call(this,k,G),this.setSize()},T.typeName="EllipseMarker",T.title="Ellipse marker",T.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',T}(x),ce=function(j){function T(k,G,$){return j.call(this,k,G,$)||this}return Z(T,j),Object.defineProperty(T.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(k){return!(!j.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},T.prototype.createTips=function(){this.tip1=L.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(L.createTransform()),this.visual.appendChild(this.tip1),this.tip2=L.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(L.createTransform()),this.visual.appendChild(this.tip2)},T.prototype.pointerDown=function(k,G){j.prototype.pointerDown.call(this,k,G),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(j.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(L.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()]]),L.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 k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.tip1.transform.baseVal.getItem(0);G.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(G,0);var $=this.tip2.transform.baseVal.getItem(0);$.setRotate(k+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 k=j.prototype.getState.call(this);return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){j.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},T.typeName="MeasurementMarker",T.title="Measurement marker",T.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',T}(l),me=function(j){function T(k,G,$){var N=j.call(this,k,G,$)||this;return N.strokePanel.colors=$.defaultColorSet,N.fillColor="transparent",N}return Z(T,j),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=j.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="EllipseFrameMarker",T.title="Ellipse frame marker",T.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',T}(ae),be=function(){function j(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(j.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),j.prototype.addUndoStep=function(T){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(T)||(this.undoStack.push(T),JSON.stringify(this.lastRedoStep)!==JSON.stringify(T)&&this.redoStack.splice(0,this.redoStack.length))},j.prototype.replaceLastUndoStep=function(T){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=T)},j.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},j.prototype.undo=function(){if(this.undoStack.length>1){var T=this.undoStack.pop();return T!==void 0&&this.redoStack.push(T),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},j.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},j}(),Be=function(j){function T(k,G,$){var N=j.call(this,k,G,$)||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 S("Line color",$.defaultColorSet,$.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new p("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new D("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return Z(T,j),T.prototype.ownsTarget=function(k){return!(!j.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},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=L.createGroup(),this.selectorCurve=L.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=L.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(k,G){j.prototype.pointerDown.call(this,k,G),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=k.x,this.curveY=k.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(G)&&(this.activeGrip=this.curveGrip,this._state="resize")},T.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),L.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),L.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),L.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setupControlBox=function(){j.prototype.setupControlBox.call(this),this.curveControlLine1=L.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=L.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},T.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,j.prototype.addControlGrips.call(this)},T.prototype.positionGrips=function(){j.prototype.positionGrips.call(this);var k=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-k/2,this.curveY-k/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(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),j.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),j.prototype.resize.call(this,k),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(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},T.prototype.scale=function(k,G){this.curveX=this.curveX*k,this.curveY=this.curveY*G,j.prototype.scale.call(this,k,G)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},j.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){j.prototype.restoreState.call(this,k);var G=k;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.curveX=G.curveX,this.curveY=G.curveY,this.createVisual(),this.adjustVisual()},T.typeName="CurveMarker",T.title="Curve marker",T.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',T}(d),Ce=function(){function j(T,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=T,this.cancelable=k}return Object.defineProperty(j.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),j.prototype.preventDefault=function(){this._defaultPrevented=!0},j}(),Le=function(j){function T(k,G,$){var N=j.call(this,k,!1)||this;return N.dataUrl=G,N.state=$,N}return Z(T,j),T}(Ce),Te=function(j){function T(k,G,$){$===void 0&&($=!1);var N=j.call(this,k,$)||this;return N.marker=G,N}return Z(T,j),T}(Ce),we=function(){function j(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return j.prototype.addEventListener=function(T,k){this[T].push(k)},j.prototype.removeEventListener=function(T,k){var G=this[T].indexOf(k);G>-1&&this[T].splice(G,1)},j}(),ve=function(){function j(T){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new f,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=j.instanceCounter++,this.styles=new M(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=T,this.targetRoot=document.body,this.width=T.clientWidth,this.height=T.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(j.prototype,"ALL_MARKER_TYPES",{get:function(){return[v,m,P,g,me,ae,re,F,ce,H,l,Be]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[v,m,P,g,ae,re,F]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"BASIC_MARKER_TYPES",{get:function(){return[v,m,P,g,re]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(T){var k=this;this._availableMarkerTypes.splice(0),T.forEach(function(G){if(typeof G=="string"){var $=k.ALL_MARKER_TYPES.find(function(N){return N.typeName===G});$!==void 0&&k._availableMarkerTypes.push($)}else k._availableMarkerTypes.push(G)})},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(T){this._zoomLevel=T,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),j.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),W.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},j.prototype.show=function(){var T=this;this.styles.styleSheetRoot===void 0&&O.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=O.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new Ce(T))})},j.prototype.render=function(){return R(this,void 0,void 0,function(){var T;return Q(this,function(k){switch(k.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 k.sent(),[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},j.prototype.close=function(T){var k=this;if(T===void 0&&(T=!1),this.isOpen){var G=!1;T||this.eventListeners.beforeclose.forEach(function($){var N=new Ce(k,!0);$(N),N.defaultPrevented&&(G=!0)}),G||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function($){return $(new Ce(k))}),this.detachEvents(),this._isOpen=!1)}},j.prototype.addMarkersToToolbar=function(){for(var T,k=[],G=0;G<arguments.length;G++)k[G]=arguments[G];(T=this._availableMarkerTypes).push.apply(T,k)},j.prototype.addRenderEventListener=function(T){this.addEventListener("render",function(k){T(k.dataUrl,k.state)})},j.prototype.removeRenderEventListener=function(T){},j.prototype.addCloseEventListener=function(T){this.addEventListener("close",function(){T()})},j.prototype.removeCloseEventListener=function(T){},j.prototype.setupResizeObserver=function(){var T=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){T.resize(T.target.clientWidth,T.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return T.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},j.prototype.onPopupTargetResize=function(){var T=1*this.target.clientWidth/this.target.clientHeight,k=this.editorCanvas.clientWidth/T>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*T:this.editorCanvas.clientWidth,G=k<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/T;this.resize(k,G)},j.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},j.prototype.resize=function(T,k){this._isResizing=!0;var G=T/this.imageWidth,$=k/this.imageHeight;this.imageWidth=Math.round(T),this.imageHeight=Math.round(k),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(G,$),this._isResizing=!1},j.prototype.scaleMarkers=function(T,k){var G,$=this;this._currentMarker&&this._currentMarker instanceof g?this._currentMarker.scale(T,k):(G=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(N){N!==$._currentMarker&&N.scale(T,k)}),G!==void 0&&this.setCurrentMarker(G)},j.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},j.prototype.setTopLeft=function(){var T=this.editingTarget.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=T.left-k.left,this.top=T.top-k.top},j.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},j.prototype.addDefs=function(){for(var T,k=[],G=0;G<arguments.length;G++)k[G]=arguments[G];this.defs=L.createDefs(),this.addDefsToImage(),(T=this.defs).append.apply(T,k)},j.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},j.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},j.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},j.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},j.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},j.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},j.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},j.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var T=document.createElement("a");T.href="https://markerjs.com/",T.target="_blank",T.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',T.title="Powered by marker.js",T.style.display="grid",T.style.alignItems="center",T.style.justifyItems="center",T.style.padding="3px",T.style.width="20px",T.style.height="20px",this.logoUI.appendChild(T),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},j.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},j.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},j.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},j.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new I(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new w(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},j.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},j.prototype.removeMarker=function(T){this.markerImage.removeChild(T.container),this.markers.indexOf(T)>-1&&this.markers.splice(this.markers.indexOf(T),1),T.dispose()},j.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},j.prototype.toolbarButtonClicked=function(T,k){if(T==="marker"&&k!==void 0)this.createNewMarker(k);else if(T==="action")switch(k){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},j.prototype.deleteSelectedMarker=function(){var T=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function($){var N=new Te(T,T._currentMarker,!0);$(N),N.defaultPrevented&&(k=!0)}),!k){var G=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function($){return $(new Te(T,G))})}}},j.prototype.clear=function(){var T=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ue){var Ee=new Te(T,void 0,!0);ue(Ee),Ee.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var G=function(ue){var Ee=$.markers[ue];$.setCurrentMarker($.markers[ue]),$._currentMarker.dispose(),$.markerImage.removeChild($._currentMarker.container),$.markers.splice($.markers.indexOf($._currentMarker),1),$.eventListeners.markerdelete.forEach(function(De){return De(new Te(T,Ee))})},$=this,N=this.markers.length-1;N>=0;N--)G(N);this.addUndoStep()}},Object.defineProperty(j.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),j.prototype.showNotesEditor=function(){var T;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(T=this._currentMarker.notes)!==null&&T!==void 0?T:"",this.overlayContainer.appendChild(this.notesArea))},j.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},j.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},j.prototype.addUndoStep=function(){var T=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),G=this.undoRedoManager.getLastUndoStep();if(!G||G.width===k.width&&G.height===k.height){var $=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),$<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(N){return N(new Ce(T))})}else this.undoRedoManager.replaceLastUndoStep(k),this.eventListeners.statechange.forEach(function(N){return N(new Ce(T))})}},j.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},j.prototype.undoStep=function(){var T=this,k=this.undoRedoManager.undo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(G){return G(new Ce(T))}))},j.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},j.prototype.redoStep=function(){var T=this,k=this.undoRedoManager.redo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(G){return G(new Ce(T))}))},j.prototype.stepZoom=function(){var T=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=T<this.zoomSteps.length-1?this.zoomSteps[T+1]:this.zoomSteps[0]},j.prototype.panTo=function(T){this.contentDiv.scrollBy({left:this.prevPanPoint.x-T.x,top:this.prevPanPoint.y-T.y}),this.prevPanPoint=T},j.prototype.startRenderAndClose=function(){return R(this,void 0,void 0,function(){var T,k,G=this;return Q(this,function($){switch($.label){case 0:return[4,this.render()];case 1:return T=$.sent(),k=this.getState(),this.eventListeners.render.forEach(function(N){return N(new Le(G,T,k))}),this.close(!0),[2]}})})},j.prototype.getState=function(T){T===!0&&this.setCurrentMarker();var k={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(G){return k.markers.push(G.getState())}),k},j.prototype.restoreState=function(T){var k=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);T.markers.forEach(function(G){var $=k._availableMarkerTypes.find(function(ue){return ue.typeName===G.typeName});if($!==void 0){var N=k.addNewMarker($);N.restoreState(G),k.markers.push(N)}}),T.width&&T.height&&(T.width!==this.imageWidth||T.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/T.width,this.imageHeight/T.height),this.eventListeners.restorestate.forEach(function(G){return G(new Ce(k))})},j.prototype.addNewMarker=function(T){var k=L.createGroup();return this.markerImage.appendChild(k),new T(k,this.overlayContainer,this.settings)},j.prototype.createNewMarker=function(T){var k,G=this;(k=typeof T=="string"?this._availableMarkerTypes.find(function($){return $.typeName===T}):T)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(k),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(k.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function($){return $(new Te(G,G._currentMarker))}))},j.prototype.markerCreated=function(T){var k=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(T),this.setCurrentMarker(T),T instanceof m&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(m):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(G){return G(new Te(k,k._currentMarker))})},j.prototype.colorChanged=function(T){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=T,this.settings.defaultStrokeColor=T)},j.prototype.fillColorChanged=function(T){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=T)},j.prototype.markerStateChanged=function(T){var k=this;this.eventListeners.markerchange.forEach(function(G){return G(new Te(k,T))})},j.prototype.setCurrentMarker=function(T){var k=this;this._currentMarker!==T&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(G){return G(new Te(k,k._currentMarker))})),this._currentMarker=T,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(G){return G(new Te(k,k._currentMarker))}))},j.prototype.onPointerDown=function(T){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||T.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var k=this.markers.find(function(G){return G.ownsTarget(T.target)});k!==void 0?(this.setCurrentMarker(k),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(T.clientX,T.clientY),T.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:T.clientX,y:T.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(T.clientX,T.clientY))},j.prototype.onDblClick=function(T){if(this._isFocused||this.focus(),this.mode==="select"){var k=this.markers.find(function(G){return G.ownsTarget(T.target)});k!==void 0&&k!==this._currentMarker&&this.setCurrentMarker(k),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(T.clientX,T.clientY),T.target):this.setCurrentMarker()}},j.prototype.onPointerMove=function(T){this.touchPoints!==1&&T.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||T.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(T.clientX,T.clientY)):this.zoomLevel>1&&this.panTo({x:T.clientX,y:T.clientY}))},j.prototype.onPointerUp=function(T){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(T.clientX,T.clientY)),this.isDragging=!1,this.addUndoStep()},j.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},j.prototype.onKeyUp=function(T){this._currentMarker===void 0||this.notesArea!==void 0||T.key!=="Delete"&&T.key!=="Backspace"||this.deleteSelectedMarker()},j.prototype.clientToLocalCoordinates=function(T,k){var G=this.markerImage.getBoundingClientRect();return{x:(T-G.left)/this.zoomLevel,y:(k-G.top)/this.zoomLevel}},j.prototype.onWindowResize=function(){this.positionUI()},j.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},j.prototype.addLicenseKey=function(T){W.addKey(T)},j.prototype.addEventListener=function(T,k){this.eventListeners.addEventListener(T,k)},j.prototype.removeEventListener=function(T,k){this.eventListeners.removeEventListener(T,k)},j.prototype.renderState=function(T){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(T),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(j.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),j.prototype.focus=function(){var T=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(k){return k(new Ce(T))}))},j.prototype.blur=function(){var T=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new Ce(T))}))},j.instanceCounter=0,j}()},TGq3:function(_e,Oe,ee){_e.exports=ee.p+"static/lockclose.365036e8.svg"},UUDw:function(_e,Oe,ee){_e.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},"VrN/":function(_e,Oe,ee){(function(fe,Z){_e.exports=Z()})(this,function(){"use strict";var fe=navigator.userAgent,Z=navigator.platform,R=/gecko\/\d/i.test(fe),Q=/MSIE \d/.test(fe),_=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(fe),L=/Edge\/(\d+)/.exec(fe),W=Q||_||L,U=W&&(Q?document.documentMode||6:+(L||_)[1]),O=!L&&/WebKit\//.test(fe),M=O&&/Qt\/\d+\.\d+/.test(fe),y=!L&&/Chrome\//.test(fe),C=/Opera\//.test(fe),I=/Apple Computer/.test(navigator.vendor),w=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(fe),A=/PhantomJS/.test(fe),S=!L&&/AppleWebKit/.test(fe)&&/Mobile\/\w+/.test(fe),h=/Android/.test(fe),o=S||h||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(fe),s=S||/Mac/.test(Z),u=/\bCrOS\b/.test(fe),x=/win/i.test(Z),c=C&&fe.match(/Version\/(\d*\.\d*)/);c&&(c=Number(c[1])),c&&c>=15&&(C=!1,O=!0);var p=s&&(M||C&&(c==null||c<12.11)),D=R||W&&U>=9;function v(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var f=function(e,t){var i=e.className,r=v(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function d(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function l(e,t){return d(e).appendChild(t)}function a(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var 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 m;document.createRange?m=function(e,t,i,r){var n=document.createRange();return n.setEnd(r||e,i),n.setStart(e,t),n}:m=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 b(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function P(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function H(e,t){var i=e.className;v(t).test(i)||(e.className+=(i?" ":"")+t)}function V(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!v(i[r]).test(t)&&(t+=" "+i[r]);return t}var re=function(e){e.select()};S?re=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:W&&(re=function(e){try{e.select()}catch(t){}});function z(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function 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 ae(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 me(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"}},Ce={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 j(e){for(;ve.length<=e;)ve.push(T(ve)+" ");return ve[e]}function T(e){return e[e.length-1]}function k(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function G(e,t,i){for(var r=0,n=i(t);r<e.length&&i(e[r])<=n;)r++;e.splice(r,0,t)}function $(){}function N(e,t){var i;return Object.create?i=Object.create(e):($.prototype=e,i=new $),t&&F(t,i),i}var ue=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ee(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ue.test(e))}function De(e,t){return t?t.source.indexOf("\\w")>-1&&Ee(e)?!0:t.test(e):Ee(e)}function Ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ie(e){return e.charCodeAt(0)>=768&&Re.test(e)}function Pe(e,t,i){for(;(i<0?t>0:t<e.length)&&Ie(e.charAt(t));)t+=i;return t}function Ge(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var n=(t+i)/2,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 Ke(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 Ye=null;function Xe(e,t,i){var r;Ye=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:Ye=n),E.from==t&&(E.from!=E.to&&i!="before"?r=n:Ye=n)}return r!=null?r:Ye}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 Y(te,de,pe){this.level=te,this.from=de,this.to=pe}return function(te,de){var pe=de=="ltr"?"L":"R";if(te.length==0||de=="ltr"&&!r.test(te))return!1;for(var Se=te.length,xe=[],Me=0;Me<Se;++Me)xe.push(i(te.charCodeAt(Me)));for(var Ue=0,je=pe;Ue<Se;++Ue){var Ve=xe[Ue];Ve=="m"?xe[Ue]=je:je=Ve}for(var et=0,Qe=pe;et<Se;++et){var rt=xe[et];rt=="1"&&Qe=="r"?xe[et]="n":E.test(rt)&&(Qe=rt,rt=="r"&&(xe[et]="R"))}for(var ht=1,lt=xe[0];ht<Se-1;++ht){var gt=xe[ht];gt=="+"&<=="1"&&xe[ht+1]=="1"?xe[ht]="1":gt==","&<==xe[ht+1]&&(lt=="1"||lt=="n")&&(xe[ht]=lt),lt=gt}for(var It=0;It<Se;++It){var Vt=xe[It];if(Vt==",")xe[It]="N";else if(Vt=="%"){var Bt=void 0;for(Bt=It+1;Bt<Se&&xe[Bt]=="%";++Bt);for(var pr=It&&xe[It-1]=="!"||Bt<Se&&xe[Bt]=="1"?"1":"N",ur=It;ur<Bt;++ur)xe[ur]=pr;It=Bt-1}}for(var Wt=0,hr=pe;Wt<Se;++Wt){var qt=xe[Wt];hr=="L"&&qt=="1"?xe[Wt]="L":E.test(qt)&&(hr=qt)}for(var Gt=0;Gt<Se;++Gt)if(n.test(xe[Gt])){var jt=void 0;for(jt=Gt+1;jt<Se&&n.test(xe[jt]);++jt);for(var Nt=(Gt?xe[Gt-1]:pe)=="L",dr=(jt<Se?xe[jt]:pe)=="L",Gi=Nt==dr?Nt?"L":"R":pe,ei=Gt;ei<jt;++ei)xe[ei]=Gi;Gt=jt-1}for(var tr=[],_r,Qt=0;Qt<Se;)if(B.test(xe[Qt])){var Va=Qt;for(++Qt;Qt<Se&&B.test(xe[Qt]);++Qt);tr.push(new Y(0,Va,Qt))}else{var Gr=Qt,vi=tr.length,yi=de=="rtl"?1:0;for(++Qt;Qt<Se&&xe[Qt]!="L";++Qt);for(var nr=Gr;nr<Qt;)if(K.test(xe[nr])){Gr<nr&&(tr.splice(vi,0,new Y(1,Gr,nr)),vi+=yi);var zi=nr;for(++nr;nr<Qt&&K.test(xe[nr]);++nr);tr.splice(vi,0,new Y(2,zi,nr)),vi+=yi,Gr=nr}else++nr;Gr<Qt&&tr.splice(vi,0,new Y(1,Gr,Qt))}return de=="ltr"&&(tr[0].level==1&&(_r=te.match(/^\s+/))&&(tr[0].from=_r[0].length,tr.unshift(new Y(0,0,_r[0].length))),T(tr).level==1&&(_r=te.match(/\s+$/))&&(T(tr).to-=_r[0].length,tr.push(new Y(0,Se-_r[0].length,Se)))),de=="rtl"?tr.reverse():tr}}();function qe(e,t){var i=e.order;return i==null&&(i=e.order=at(e.text,t)),i}var ze=[],Ae=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 Je(e,t){return e._handlers&&e._handlers[t]||ze}function Ze(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=me(n,i);E>-1&&(r[t]=n.slice(0,E).concat(n.slice(E+1)))}}}function oe(e,t){var i=Je(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 X(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),oe(e,i||t.type,e,t),le(t)||t.codemirrorIgnore}function J(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)me(i,t[r])==-1&&i.push(t[r])}function ne(e,t){return Je(e,t).length>0}function se(e){e.prototype.on=function(t,i){Ae(this,t,i)},e.prototype.off=function(t,i){Ze(this,t,i)}}function q(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){q(e),ie(e)}function ge(e){return e.target||e.srcElement}function ye(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var ke=function(){if(W&&U<9)return!1;var e=a("div");return"draggable"in e||"dragDrop"in e}(),He;function tt(e){if(He==null){var t=a("span","\u200B");l(e,a("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(He=t.offsetWidth<=1&&t.offsetHeight>2&&!(W&&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 it;function vt(e){if(it!=null)return it;var t=l(e,document.createTextNode("A\u062EA")),i=m(t,0,1).getBoundingClientRect(),r=m(t,1,2).getBoundingClientRect();return d(e),!i||i.left==i.right?!1:it=r.right-i.right<3}var st=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf(`
|
|
`,t);n==-1&&(n=e.length);var 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},Tt=function(){var e=a("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Et=null;function _t(e){if(Et!=null)return Et;var t=l(e,a("span","x")),i=t.getBoundingClientRect(),r=m(t,0,1).getBoundingClientRect();return Et=Math.abs(i.left-r.left)>1}var Mt={},xt={};function mr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Mt[e]=t}function Cr(e,t){xt[e]=t}function Yt(e){if(typeof e=="string"&&xt.hasOwnProperty(e))e=xt[e];else if(e&&typeof e.name=="string"&&xt.hasOwnProperty(e.name)){var t=xt[e.name];typeof t=="string"&&(t={name:t}),e=N(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Yt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Yt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function gr(e,t){t=Yt(t);var i=Mt[t.name];if(!i)return gr(e,"text/plain");var r=i(e,t);if(cr.hasOwnProperty(t.name)){var n=cr[t.name];for(var 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 cr={};function zr(e,t){var i=cr.hasOwnProperty(e)?cr[e]:cr[e]={};F(t,i)}function Xt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function Br(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function ti(e,t,i){return e.startState?e.startState(t,i):!0}var Ot=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Ot.prototype.eol=function(){return this.pos>=this.string.length},Ot.prototype.sol=function(){return this.pos==this.lineStart},Ot.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ot.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ot.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Ot.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ot.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ot.prototype.skipToEnd=function(){this.pos=this.string.length},Ot.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ot.prototype.backUp=function(e){this.pos-=e},Ot.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ae(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ae(this.string,this.lineStart,this.tabSize):0)},Ot.prototype.indentation=function(){return ae(this.string,null,this.tabSize)-(this.lineStart?ae(this.string,this.lineStart,this.tabSize):0)},Ot.prototype.match=function(e,t,i){if(typeof e=="string"){var r=function(B){return i?B.toLowerCase():B},n=this.string.substr(this.pos,e.length);if(r(n)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var E=this.string.slice(this.pos).match(e);return E&&E.index>0?null:(E&&t!==!1&&(this.pos+=E[0].length),E)}},Ot.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ot.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ot.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ot.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function $e(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 Ct(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 Jt(e,t,i){var r=[];return e.iter(t,i,function(n){r.push(n.text)}),r}function mt(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function pt(e){if(e.parent==null)return null;for(var t=e.parent,i=me(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],Y=K.height;if(t<Y)break;t-=Y}return i+B}function vr(e,t){return t>=e.first&&t<e.first+e.size}function Ft(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Fe(e,t,i){if(i===void 0&&(i=null),!(this instanceof Fe))return new Fe(e,t,i);this.line=e,this.ch=t,this.sticky=i}function dt(e,t){return e.line-t.line||e.ch-t.ch}function ri(e,t){return e.sticky==t.sticky&&dt(e,t)==0}function bi(e){return Fe(e.line,e.ch)}function Ei(e,t){return dt(e,t)<0?t:e}function ii(e,t){return dt(e,t)<0?e:t}function xi(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ft(e,t){if(t.line<e.first)return Fe(e.first,0);var i=e.first+e.size-1;return t.line>i?Fe(i,$e(e,i).text.length):Dn(t,$e(e,t.line).text.length)}function Dn(e,t){var i=e.ch;return i==null||i>t?Fe(e.line,t):i<0?Fe(e.line,0):e}function We(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=ft(e,t[r]);return i}var Si=function(e,t){this.state=e,this.lookAhead=t},xr=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};xr.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},xr.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},xr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},xr.fromSaved=function(e,t,i){return t instanceof Si?new xr(e,Xt(e.mode,t.state),i,t.lookAhead):new xr(e,Xt(e.mode,t),i)},xr.prototype.save=function(e){var t=e!==!1?Xt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Si(t,this.maxLookAhead):t};function Ki(e,t,i,r){var n=[e.state.modeGen],E={};wr(e,t.text,e.doc.mode,i,function(te,de){return n.push(te,de)},E,r);for(var B=i.state,K=function(te){i.baseTokens=n;var de=e.state.overlays[te],pe=1,Se=0;i.state=!0,wr(e,t.text,de.mode,i,function(xe,Me){for(var Ue=pe;Se<xe;){var je=n[pe];je>xe&&n.splice(pe,1,xe,n[pe+1],je),pe+=2,Se=Math.min(xe,je)}if(!Me)return;if(de.opaque)n.splice(Ue,pe-Ue,xe,"overlay "+Me),pe=Ue+2;else for(;Ue<pe;Ue+=2){var Ve=n[Ue+1];n[Ue+1]=(Ve?Ve+" ":"")+"overlay "+Me}},E),i.state=B,i.baseTokens=null,i.baseTokenPos=1},Y=0;Y<e.state.overlays.length;++Y)K(Y);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=Ar(e,pt(t)),n=t.text.length>e.options.maxHighlightLength&&Xt(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 Ar(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new xr(r,!0,t);var E=Rn(e,t,i),B=E>r.first&&$e(r,E-1).stateAfter,K=B?xr.fromSaved(r,B,E):new xr(r,ti(r.mode),E);return r.iter(E,t,function(Y){Vi(e,Y.text,K);var te=K.line;Y.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 Ot(t,e.options.tabSize,i);for(E.start=E.pos=r||0,t==""&&Qi(n,i.state);!E.eol();)Tr(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=Br(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Tr(e,t,i,r){for(var n=0;n<10;n++){r&&(r[0]=Br(e,i).mode);var E=e.token(t,i);if(t.pos>t.start)return E}throw new Error("Mode "+e.name+" failed to advance stream.")}var Yi=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function kn(e,t,i,r){var n=e.doc,E=n.mode,B;t=ft(n,t);var K=$e(n,t.line),Y=Ar(e,t.line,i),te=new Ot(K.text,e.options.tabSize,Y),de;for(r&&(de=[]);(r||te.pos<t.ch)&&!te.eol();)te.start=te.pos,B=Tr(E,te,Y.state),r&&de.push(new Yi(te,B,Xt(n.mode,Y.state)));return r?de:new Yi(te,B,Y.state)}function Xi(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";t[r]==null?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function wr(e,t,i,r,n,E,B){var K=i.flattenSpans;K==null&&(K=e.options.flattenSpans);var Y=0,te=null,de=new Ot(t,e.options.tabSize,r),pe,Se=e.options.addModeClass&&[null];for(t==""&&Xi(Qi(i,r.state),E);!de.eol();){if(de.pos>e.options.maxHighlightLength?(K=!1,B&&Vi(e,t,r,de.pos),de.pos=t.length,pe=null):pe=Xi(Tr(i,de,r.state,Se),E),Se){var xe=Se[0].name;xe&&(pe="m-"+(pe?xe+" "+pe:xe))}if(!K||te!=pe){for(;Y<de.start;)Y=Math.min(de.start,Y+5e3),n(Y,te);te=pe}de.start=de.pos}for(;Y<de.pos;){var Me=Math.min(de.pos,Y+5e3);n(Me,te),Y=Me}}function Rn(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 Y=$e(E,K-1),te=Y.stateAfter;if(te&&(!i||K+(te instanceof Si?te.lookAhead:0)<=E.modeFrontier))return K;var de=ae(Y.text,null,e.options.tabSize);(n==null||r>de)&&(n=K-1,r=de)}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=$e(e,r).stateAfter;if(n&&(!(n instanceof Si)||r+n.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Ji=!1,rr=!1;function Kr(){Ji=!0}function oa(){rr=!0}function ai(e,t,i){this.marker=e,this.from=t,this.to=i}function Dr(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function Zi(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i||(i=[])).push(e[r]);return i}function sa(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ln(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 Y=E.to==null||(B.inclusiveRight?E.to>=t:E.to>t);(r||(r=[])).push(new ai(B,E.from,Y?null:E.to))}}return r}function In(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 Y=E.from==null||(B.inclusiveLeft?E.from<=t:E.from<t);(r||(r=[])).push(new ai(B,Y?null:E.from-t,E.to==null?null:E.to-t))}}return r}function Ci(e,t){if(t.full)return null;var i=vr(e,t.from.line)&&$e(e,t.from.line).markedSpans,r=vr(e,t.to.line)&&$e(e,t.to.line).markedSpans;if(!i&&!r)return null;var n=t.from.ch,E=t.to.ch,B=dt(t.from,t.to)==0,K=Ln(i,n,B),Y=In(r,E,B),te=t.text.length==1,de=T(t.text).length+(te?n:0);if(K)for(var pe=0;pe<K.length;++pe){var Se=K[pe];if(Se.to==null){var xe=Dr(Y,Se.marker);xe?te&&(Se.to=xe.to==null?null:xe.to+de):Se.to=n}}if(Y)for(var Me=0;Me<Y.length;++Me){var Ue=Y[Me];if(Ue.to!=null&&(Ue.to+=de),Ue.from==null){var je=Dr(K,Ue.marker);je||(Ue.from=de,te&&(K||(K=[])).push(Ue))}else Ue.from+=de,te&&(K||(K=[])).push(Ue)}K&&(K=Mn(K)),Y&&Y!=K&&(Y=Mn(Y));var Ve=[K];if(!te){var et=t.text.length-2,Qe;if(et>0&&K)for(var rt=0;rt<K.length;++rt)K[rt].to==null&&(Qe||(Qe=[])).push(new ai(K[rt].marker,null,null));for(var ht=0;ht<et;++ht)Ve.push(Qe);Ve.push(Y)}return Ve}function Mn(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function On(e,t,i){var r=null;if(e.iter(t.line,i.line+1,function(xe){if(xe.markedSpans)for(var Me=0;Me<xe.markedSpans.length;++Me){var Ue=xe.markedSpans[Me].marker;Ue.readOnly&&(!r||me(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),Y=0;Y<n.length;++Y){var te=n[Y];if(dt(te.to,K.from)<0||dt(te.from,K.to)>0)continue;var de=[Y,1],pe=dt(te.from,K.from),Se=dt(te.to,K.to);(pe<0||!B.inclusiveLeft&&!pe)&&de.push({from:te.from,to:K.from}),(Se>0||!B.inclusiveRight&&!Se)&&de.push({from:K.to,to:te.to}),n.splice.apply(n,de),Y+=de.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=dt(r.from,n.from)||oi(e)-oi(t);if(E)return-E;var B=dt(r.to,n.to)||si(e)-si(t);return B||t.id-e.id}function Nr(e,t){var i=rr&&e.markedSpans,r;if(i)for(var n=void 0,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 Ur(e){return Nr(e,!0)}function Fr(e){return Nr(e,!1)}function wi(e,t){var i=rr&&e.markedSpans,r;if(i)for(var n=0;n<i.length;++n){var 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=$e(e,t),B=rr&&E.markedSpans;if(B)for(var K=0;K<B.length;++K){var Y=B[K];if(!Y.marker.collapsed)continue;var te=Y.marker.find(0),de=dt(te.from,i)||oi(Y.marker)-oi(n),pe=dt(te.to,r)||si(Y.marker)-si(n);if(de>=0&&pe<=0||de<=0&&pe>=0)continue;if(de<=0&&(Y.marker.inclusiveRight&&n.inclusiveLeft?dt(te.to,i)>=0:dt(te.to,i)>0)||de>=0&&(Y.marker.inclusiveRight&&n.inclusiveLeft?dt(te.from,r)<=0:dt(te.from,r)<0))return!0}}function yr(e){for(var t;t=Ur(e);)e=t.find(-1,!0).line;return e}function _n(e){for(var t;t=Fr(e);)e=t.find(1,!0).line;return e}function Di(e){for(var t,i;t=Fr(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function qi(e,t){var i=$e(e,t),r=yr(i);return i==r?t:pt(r)}function Vr(e,t){if(t>e.lastLine())return t;var i=$e(e,t),r;if(!Mr(e,i))return t;for(;r=Fr(i);)i=r.find(1,!0).line;return pt(i)+1}function Mr(e,t){var i=rr&&t.markedSpans;if(i)for(var r=void 0,n=0;n<i.length;++n){if(r=i[n],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&$i(e,t,r))return!0}}function $i(e,t,i){if(i.to==null){var r=i.marker.find(1,!0);return $i(e,r.line,Dr(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var n=void 0,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 kr(e){e=yr(e);for(var t=0,i=e.parent,r=0;r<i.lines.length;++r){var n=i.lines[r];if(n==e)break;t+=n.height}for(var 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=Ur(r);){var n=i.find(0,!0);r=n.from.line,t+=n.from.ch-n.to.ch}for(r=e;i=Fr(r);){var 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=$e(i,i.first),t.maxLineLength=en(t.maxLine),t.maxLineChanged=!0,i.iter(function(r){var n=en(r);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var li=function(e,t,i){this.text=e,Ai(this,t),this.height=i?i(this):1};li.prototype.lineNo=function(){return pt(this)},se(li);function ua(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),la(e),Ai(e,i);var n=r?r(e):1;n!=e.height&&mt(e,n)}function ot(e){e.parent=null,la(e)}var ct={},ut={};function yt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?ut:ct;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function At(e,t){var i=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=St,vt(e.display.measure)&&(B=qe(E,e.doc.direction))&&(r.addToken=ar(r.addToken,B)),r.map=[];var K=t!=e.display.externalMeasured&&pt(E);Wr(E,r,ni(e,E,K)),E.styleClasses&&(E.styleClasses.bgClass&&(r.bgClass=V(E.styleClasses.bgClass,r.bgClass||"")),E.styleClasses.textClass&&(r.textClass=V(E.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(tt(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 Y=r.content.lastChild;(/\bcm-tab\b/.test(Y.className)||Y.querySelector&&Y.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return oe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=V(r.pre.className,r.textClass||"")),r}function Lt(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 St(e,t,i,r,n,E,B){if(!t)return;var K=e.splitSpaces?Ht(t,e.trailingSpace):t,Y=e.cm.state.specialChars,te=!1,de;if(!Y.test(t))e.col+=t.length,de=document.createTextNode(K),e.map.push(e.pos,e.pos+t.length,de),W&&U<9&&(te=!0),e.pos+=t.length;else{de=document.createDocumentFragment();for(var pe=0;;){Y.lastIndex=pe;var Se=Y.exec(t),xe=Se?Se.index-pe:t.length-pe;if(xe){var Me=document.createTextNode(K.slice(pe,pe+xe));W&&U<9?de.appendChild(a("span",[Me])):de.appendChild(Me),e.map.push(e.pos,e.pos+xe,Me),e.col+=xe,e.pos+=xe}if(!Se)break;pe+=xe+1;var Ue=void 0;if(Se[0]==" "){var je=e.cm.options.tabSize,Ve=je-e.col%je;Ue=de.appendChild(a("span",j(Ve),"cm-tab")),Ue.setAttribute("role","presentation"),Ue.setAttribute("cm-text"," "),e.col+=Ve}else Se[0]=="\r"||Se[0]==`
|
|
`?(Ue=de.appendChild(a("span",Se[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ue.setAttribute("cm-text",Se[0]),e.col+=1):(Ue=e.cm.options.specialCharPlaceholder(Se[0]),Ue.setAttribute("cm-text",Se[0]),W&&U<9?de.appendChild(a("span",[Ue])):de.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 et=i||"";r&&(et+=r),n&&(et+=n);var Qe=a("span",[de],et,E);if(B)for(var rt in B)B.hasOwnProperty(rt)&&rt!="style"&&rt!="class"&&Qe.setAttribute(rt,B[rt]);return e.content.appendChild(Qe)}e.content.appendChild(de)}function Ht(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 ar(e,t){return function(i,r,n,E,B,K,Y){n=n?n+" cm-force-border":"cm-force-border";for(var te=i.pos,de=te+r.length;;){for(var pe=void 0,Se=0;Se<t.length&&!(pe=t[Se],pe.to>te&&pe.from<=te);Se++);if(pe.to>=de)return e(i,r,n,E,B,K,Y);e(i,r.slice(0,pe.to-te),n,E,null,K,Y),E=null,r=r.slice(pe.to-te),te=pe.to}}}function bt(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function Wr(e,t,i){var r=e.markedSpans,n=e.text,E=0;if(!r){for(var B=1;B<i.length;B+=2)t.addToken(t,n.slice(E,E=i[B]),yt(i[B+1],t.cm.options));return}for(var K=n.length,Y=0,te=1,de="",pe,Se,xe=0,Me,Ue,je,Ve,et;;){if(xe==Y){Me=Ue=je=Se="",et=null,Ve=null,xe=Infinity;for(var Qe=[],rt=void 0,ht=0;ht<r.length;++ht){var lt=r[ht],gt=lt.marker;if(gt.type=="bookmark"&<.from==Y&>.widgetNode)Qe.push(gt);else if(lt.from<=Y&&(lt.to==null||lt.to>Y||gt.collapsed&<.to==Y&<.from==Y)){if(lt.to!=null&<.to!=Y&&xe>lt.to&&(xe=lt.to,Ue=""),gt.className&&(Me+=" "+gt.className),gt.css&&(Se=(Se?Se+";":"")+gt.css),gt.startStyle&<.from==Y&&(je+=" "+gt.startStyle),gt.endStyle&<.to==xe&&(rt||(rt=[])).push(gt.endStyle,lt.to),gt.title&&((et||(et={})).title=gt.title),gt.attributes)for(var It in gt.attributes)(et||(et={}))[It]=gt.attributes[It];gt.collapsed&&(!Ve||Ti(Ve.marker,gt)<0)&&(Ve=lt)}else lt.from>Y&&xe>lt.from&&(xe=lt.from)}if(rt)for(var Vt=0;Vt<rt.length;Vt+=2)rt[Vt+1]==xe&&(Ue+=" "+rt[Vt]);if(!Ve||Ve.from==Y)for(var Bt=0;Bt<Qe.length;++Bt)bt(t,0,Qe[Bt]);if(Ve&&(Ve.from||0)==Y){if(bt(t,(Ve.to==null?K+1:Ve.to)-Y,Ve.marker,Ve.from==null),Ve.to==null)return;Ve.to==Y&&(Ve=!1)}}if(Y>=K)break;for(var pr=Math.min(K,xe);;){if(de){var ur=Y+de.length;if(!Ve){var Wt=ur>pr?de.slice(0,pr-Y):de;t.addToken(t,Wt,pe?pe+Me:Me,je,Y+Wt.length==xe?Ue:"",Se,et)}if(ur>=pr){de=de.slice(pr-Y),Y=pr;break}Y=ur,je=""}de=n.slice(E,E=i[te++]),pe=yt(i[te++],t.cm.options)}}}function Dt(e,t,i){this.line=t,this.rest=Di(t),this.size=this.rest?pt(T(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Mr(e,t)}function or(e,t,i){for(var r=[],n,E=t;E<i;E=n){var B=new Dt(e.doc,$e(e.doc,E),E);n=E+B.size,r.push(B)}return r}var $t=null;function Sr(e){$t?$t.ops.push(e):e.ownsGroup=$t={ops:[e],delayedCallbacks:[]}}function Ls(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var n=e.ops[r];if(n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}while(i<t.length)}function Is(e,t){var i=e.ownsGroup;if(!i)return;try{Ls(i)}finally{$t=null,t(i)}}var tn=null;function Zt(e,t){var i=Je(e,t);if(!i.length)return;var r=Array.prototype.slice.call(arguments,2),n;$t?n=$t.delayedCallbacks:tn?n=tn:(n=tn=[],setTimeout(Ms,0));for(var E=function(K){n.push(function(){return i[K].apply(null,r)})},B=0;B<i.length;++B)E(B)}function Ms(){var e=tn;tn=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,i,r){for(var n=0;n<t.changes.length;n++){var E=t.changes[n];E=="text"?Ps(e,t):E=="gutter"?Ja(e,t,i,r):E=="class"?ha(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),W&&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 Xa(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):At(e,t)}function Ps(e,t){var i=t.text.className,r=Xa(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,ha(e,t)):i&&(t.text.className=i)}function ha(e,t){Os(e,t),t.line.wrapClass?rn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Ja(e,t,i,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var n=rn(t);t.gutterBackground=a("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),n.insertBefore(t.gutterBackground,t.text)}var 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",Ft(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),E)for(var Y=0;Y<e.display.gutterSpecs.length;++Y){var te=e.display.gutterSpecs[Y].className,de=E.hasOwnProperty(te)&&E[te];de&&K.appendChild(a("div",[de],"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=v("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=Xa(e,t);return t.text=t.node=n.pre,n.bgClass&&(t.bgClass=n.bgClass),n.textClass&&(t.textClass=n.textClass),ha(e,t),Ja(e,t,i,r),Za(e,t,r),t.node}function Za(e,t,i){if(qa(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)qa(e,t.rest[r],t,i,!1)}function qa(e,t,i,r,n){if(!t.widgets)return;for(var E=rn(i),B=0,K=t.widgets;B<K.length;++B){var Y=K[B],te=a("div",[Y.node],"CodeMirror-linewidget"+(Y.className?" "+Y.className:""));Y.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Ns(Y,te,i,r),e.display.input.setUneditable(te),n&&Y.above?E.insertBefore(te,i.gutter||i.text):E.appendChild(te),Zt(Y,"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(!b(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),l(t.display.measure,a("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function jr(e,t){for(var i=ge(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Nn(e){return e.lineSpace.offsetTop}function da(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function $a(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=l(e.measure,a("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Or(e){return be-e.display.nativeBarWidth}function ui(e){return e.display.scroller.clientWidth-Or(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-Or(e)-e.display.barHeight}function Us(e,t,i){var r=e.options.lineWrapping,n=r&&ui(e);if(!t.measure.heights||r&&t.measure.width!=n){var 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 Y=B[K],te=B[K+1];Math.abs(Y.bottom-te.bottom)>2&&E.push((Y.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(pt(e.rest[n])>i)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Fs(e,t){t=yr(t);var i=pt(t),r=e.display.externalMeasured=new Dt(e.doc,t,i);r.lineN=i;var n=r.built=At(e,r);return r.text=n.pre,l(e.display.lineMeasure,n.pre),r}function to(e,t,i,r){return Pr(e,ki(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 ki(e,t){var i=pt(t),r=fa(e,i);r&&!r.text?r=null:r&&r.changes&&(Ya(e,r,i,ba(e)),e.curOp.forceUpdate=!0),r||(r=Fs(e,t));var n=eo(r,t,i);return{line:t,view:r,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function Pr(e,t,i,r,n){t.before&&(i=-1);var 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=js(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,Y,te=0;te<e.length;te+=3)if(K=e[te],Y=e[te+1],t<K?(n=0,E=1,B="left"):t<Y?(n=t-K,E=n+1):(te==e.length-3||t==Y&&e[te+3]>t)&&(E=Y-K,n=E-1,t>=Y&&(B="right")),n!=null){if(r=e[te+2],K==Y&&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==Y-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:Y}}function Ws(e,t){var i=ro;if(t=="left")for(var r=0;r<e.length&&!((i=e[r]).left!=i.right);r++);else for(var n=e.length-1;n>=0&&!((i=e[n]).left!=i.right);n--);return i}function js(e,t,i,r){var n=io(t.map,i,r),E=n.node,B=n.start,K=n.end,Y=n.collapse,te;if(E.nodeType==3){for(var de=0;de<4;de++){for(;B&&Ie(t.line.text.charAt(n.coverStart+B));)--B;for(;n.coverStart+K<n.coverEnd&&Ie(t.line.text.charAt(n.coverStart+K));)++K;if(W&&U<9&&B==0&&K==n.coverEnd-n.coverStart?te=E.parentNode.getBoundingClientRect():te=Ws(m(E,B,K).getClientRects(),r),te.left||te.right||B==0)break;K=B,B=B-1,Y="right"}W&&U<11&&(te=Hs(e.display.measure,te))}else{B>0&&(Y=r="right");var pe;e.options.lineWrapping&&(pe=E.getClientRects()).length>1?te=pe[r=="right"?pe.length-1:0]:te=E.getBoundingClientRect()}if(W&&U<9&&!B&&(!te||!te.left&&!te.right)){var Se=E.parentNode.getClientRects()[0];Se?te={left:Se.left,right:Se.left+Li(e.display),top:Se.top,bottom:Se.bottom}:te=ro}for(var xe=te.top-t.rect.top,Me=te.bottom-t.rect.top,Ue=(xe+Me)/2,je=t.view.measure.heights,Ve=0;Ve<je.length-1&&!(Ue<je[Ve]);Ve++);var et=Ve?je[Ve-1]:0,Qe=je[Ve],rt={left:(Y=="right"?te.right:te.left)-t.rect.left,right:(Y=="left"?te.left:te.right)-t.rect.left,top:et,bottom:Qe};return!te.left&&!te.right&&(rt.bogus=!0),e.options.singleCursorHeightPerLine||(rt.rtop=xe,rt.rbottom=Me),rt}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!_t(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}function no(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function ao(e){e.display.externalMeasure=null,d(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)no(e.display.view[t])}function an(e){ao(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function oo(){return y&&h?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function so(){return y&&h?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=nn(e.widgets[i]));return t}function Un(e,t,i,r,n){if(!n){var E=pa(t);i.top+=E,i.bottom+=E}if(r=="line")return i;r||(r="local");var B=kr(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 Y=K.left+(r=="window"?0:oo());i.left+=Y,i.right+=Y}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=$e(e.doc,t.line)),Un(e,r,to(e,r,t.ch,n),i)}function Rr(e,t,i,r,n,E){r=r||$e(e.doc,t.line),n||(n=ki(e,r));function B(Me,Ue){var je=Pr(e,n,Me,Ue?"right":"left",E);return Ue?je.left=je.right:je.right=je.left,Un(e,r,je,i)}var K=qe(r,e.doc.direction),Y=t.ch,te=t.sticky;if(Y>=r.text.length?(Y=r.text.length,te="before"):Y<=0&&(Y=0,te="after"),!K)return B(te=="before"?Y-1:Y,te=="before");function de(Me,Ue,je){var Ve=K[Ue],et=Ve.level==1;return B(je?Me-1:Me,et!=je)}var pe=Xe(K,Y,te),Se=Ye,xe=de(Y,pe,te=="before");return Se!=null&&(xe.other=de(Y,Se,te!="before")),xe}function uo(e,t){var i=0;t=ft(e.doc,t),e.options.lineWrapping||(i=Li(e.display)*t.ch);var r=$e(e.doc,t.line),n=kr(r)+Nn(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function ga(e,t,i,r,n){var E=Fe(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,$e(r,E).text.length,null,1,1);t<0&&(t=0);for(var B=$e(r,n);;){var K=Gs(e,B,n,t,i),Y=wi(B,K.ch+(K.xRel>0||K.outside>0?1:0));if(!Y)return K;var te=Y.find(1);if(te.line==n)return te;B=$e(r,n=te.line)}}function ho(e,t,i,r){r-=pa(t);var n=t.text.length,E=Ge(function(B){return Pr(e,i,B-1).bottom<=r},n,0);return n=Ge(function(B){return Pr(e,i,B).top>r},E,n),{begin:E,end:n}}function co(e,t,i,r){i||(i=ki(e,t));var n=Un(e,t,Pr(e,i,r),"line").top;return ho(e,t,i,n)}function ya(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Gs(e,t,i,r,n){n-=kr(t);var E=ki(e,t),B=pa(t),K=0,Y=t.text.length,te=!0,de=qe(t,e.doc.direction);if(de){var pe=(e.options.lineWrapping?Ks:zs)(e,t,i,E,de,r,n);te=pe.level!=1,K=te?pe.from:pe.to-1,Y=te?pe.to:pe.from-1}var Se=null,xe=null,Me=Ge(function(ht){var lt=Pr(e,E,ht);return lt.top+=B,lt.bottom+=B,ya(lt,r,n,!1)?(lt.top<=n&<.left<=r&&(Se=ht,xe=lt),!0):!1},K,Y),Ue,je,Ve=!1;if(xe){var et=r-xe.left<xe.right-r,Qe=et==te;Me=Se+(Qe?0:1),je=Qe?"after":"before",Ue=et?xe.left:xe.right}else{!te&&(Me==Y||Me==K)&&Me++,je=Me==0?"after":Me==t.text.length?"before":Pr(e,E,Me-(te?1:0)).bottom+B<=n==te?"after":"before";var rt=Rr(e,Fe(i,Me,je),"line",t,E);Ue=rt.left,Ve=n<rt.top?-1:n>=rt.bottom?1:0}return Me=Pe(t.text,Me,1),ga(i,Me,je,Ve,r-Ue)}function zs(e,t,i,r,n,E,B){var K=Ge(function(pe){var Se=n[pe],xe=Se.level!=1;return ya(Rr(e,Fe(i,xe?Se.to:Se.from,xe?"before":"after"),"line",t,r),E,B,!0)},0,n.length-1),Y=n[K];if(K>0){var te=Y.level!=1,de=Rr(e,Fe(i,te?Y.from:Y.to,te?"after":"before"),"line",t,r);ya(de,E,B,!0)&&de.top>B&&(Y=n[K-1])}return Y}function Ks(e,t,i,r,n,E,B){var K=ho(e,t,r,B),Y=K.begin,te=K.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var de=null,pe=null,Se=0;Se<n.length;Se++){var xe=n[Se];if(xe.from>=te||xe.to<=Y)continue;var Me=xe.level!=1,Ue=Pr(e,r,Me?Math.min(te,xe.to)-1:Math.max(Y,xe.from)).right,je=Ue<E?E-Ue+1e9:Ue-E;(!de||pe>je)&&(de=xe,pe=je)}return de||(de=n[n.length-1]),de.from<Y&&(de={from:Y,to:de.to,level:de.level}),de.to>te&&(de={from:de.from,to:te,level:de.level}),de}var hi;function Ri(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(hi==null){hi=a("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)hi.appendChild(document.createTextNode("x")),hi.appendChild(a("br"));hi.appendChild(document.createTextNode("x"))}l(e.measure,hi);var i=hi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),d(e.measure),i||1}function Li(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=a("span","xxxxxxxxxx"),i=a("pre",[t],"CodeMirror-line-like");l(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function ba(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,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=Ri(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Li(e.display)-3);return function(n){if(Mr(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&&mt(r,n)})}function di(e,t,i,r){var n=e.display;if(!i&&ge(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 Y=va(e,E,B),te;if(r&&Y.xRel>0&&(te=$e(e.doc,Y.line).text).length==Y.ch){var de=ae(te,te.length,e.options.tabSize)-te.length;Y=Fe(Y.line,Math.max(0,Math.round((E-$a(e.display).left)/Li(e.display))-de))}return Y}function ci(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,r=0;r<i.length;r++)if(t-=i[r].size,t<0)return r}function sr(e,t,i,r){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),r||(r=0);var n=e.display;if(r&&i<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)rr&&qi(e.doc,t)<n.viewTo&&Yr(e);else if(i<=n.viewFrom)rr&&Vr(e.doc,i+r)>n.viewFrom?Yr(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Yr(e);else if(t<=n.viewFrom){var 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),Y=Fn(e,i,i+r,1);K&&Y?(n.view=n.view.slice(0,K.index).concat(or(e,K.lineN,Y.lineN)).concat(n.view.slice(Y.index)),n.viewTo+=r):Yr(e)}var te=n.externalMeasured;te&&(i<te.lineN?te.lineN+=r:t<te.lineN+te.size&&(n.externalMeasured=null))}function Qr(e,t,i){e.curOp.viewChanged=!0;var r=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var E=r.view[ci(e,t)];if(E.node==null)return;var B=E.changes||(E.changes=[]);me(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(!rr||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var K=e.display.viewFrom,Y=0;Y<n;Y++)K+=B[Y].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=or(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=or(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(ci(e,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(or(e,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,ci(e,i)))),r.viewTo=i}function po(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var n=t[r];!n.hidden&&(!n.node||n.changes)&&++i}return i}function on(e){e.display.input.showSelection(e.display.input.prepareSelection())}function mo(e,t){t===void 0&&(t=!0);for(var i=e.doc,r={},n=r.cursors=document.createDocumentFragment(),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 Y=K.empty();(Y||e.options.showCursorWhenSelecting)&&go(e,K.head,n),Y||Qs(e,K,E)}return r}function go(e,t,i){var r=Rr(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 Wn(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,Y=Math.max(r.sizerWidth,ui(e)-r.sizer.offsetLeft)-B.right,te=n.direction=="ltr";function de(Qe,rt,ht,lt){rt<0&&(rt=0),rt=Math.round(rt),lt=Math.round(lt),E.appendChild(a("div",null,"CodeMirror-selected","position: absolute; left: "+Qe+`px;
|
|
top: `+rt+"px; width: "+(ht==null?Y-Qe:ht)+`px;
|
|
height: `+(lt-rt)+"px"))}function pe(Qe,rt,ht){var lt=$e(n,Qe),gt=lt.text.length,It,Vt;function Bt(Wt,hr){return ma(e,Fe(Qe,Wt),"div",lt,hr)}function pr(Wt,hr,qt){var Gt=co(e,lt,null,Wt),jt=hr=="ltr"==(qt=="after")?"left":"right",Nt=qt=="after"?Gt.begin:Gt.end-(/\s/.test(lt.text.charAt(Gt.end-1))?2:1);return Bt(Nt,jt)[jt]}var ur=qe(lt,n.direction);return Ke(ur,rt||0,ht==null?gt:ht,function(Wt,hr,qt,Gt){var jt=qt=="ltr",Nt=Bt(Wt,jt?"left":"right"),dr=Bt(hr-1,jt?"right":"left"),Gi=rt==null&&Wt==0,ei=ht==null&&hr==gt,tr=Gt==0,_r=!ur||Gt==ur.length-1;if(dr.top-Nt.top<=3){var Qt=(te?Gi:ei)&&tr,Va=(te?ei:Gi)&&_r,Gr=Qt?K:(jt?Nt:dr).left,vi=Va?Y:(jt?dr:Nt).right;de(Gr,Nt.top,vi-Gr,Nt.bottom)}else{var yi,nr,zi,Qa;jt?(yi=te&&Gi&&tr?K:Nt.left,nr=te?Y:pr(Wt,qt,"before"),zi=te?K:pr(hr,qt,"after"),Qa=te&&ei&&_r?Y:dr.right):(yi=te?pr(Wt,qt,"before"):K,nr=!te&&Gi&&tr?Y:Nt.right,zi=!te&&ei&&_r?K:dr.left,Qa=te?pr(hr,qt,"after"):Y),de(yi,Nt.top,nr-yi,Nt.bottom),Nt.bottom<dr.top&&de(K,Nt.bottom,null,dr.top),de(zi,dr.top,Qa-zi,dr.bottom)}(!It||Wn(Nt,It)<0)&&(It=Nt),Wn(dr,It)<0&&(It=dr),(!Vt||Wn(Nt,Vt)<0)&&(Vt=Nt),Wn(dr,Vt)<0&&(Vt=dr)}),{start:It,end:Vt}}var Se=t.from(),xe=t.to();if(Se.line==xe.line)pe(Se.line,Se.ch,xe.ch);else{var Me=$e(n,Se.line),Ue=$e(n,xe.line),je=yr(Me)==yr(Ue),Ve=pe(Se.line,Se.ch,je?Me.text.length+1:null).end,et=pe(xe.line,je?0:null,xe.ch).start;je&&(Ve.top<et.top-2?(de(Ve.right,Ve.top,null,Ve.bottom),de(K,et.top,et.left,et.bottom)):de(Ve.right,Ve.top,et.left-Ve.right,Ve.bottom)),Ve.bottom<et.top&&de(K,Ve.bottom,null,et.top)}i.appendChild(E)}function Sa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ii(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function vo(e){e.state.focused||(e.display.input.focus(),Ca(e))}function yo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ii(e))},100)}function Ca(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(oe(e,"focus",e,t),e.state.focused=!0,H(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),O&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Sa(e)}function Ii(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(oe(e,"blur",e,t),e.state.focused=!1,f(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function jn(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var n=t.view[r],E=e.options.lineWrapping,B=void 0,K=0;if(n.hidden)continue;if(W&&U<8){var Y=n.node.offsetTop+n.node.offsetHeight;B=Y-i,i=Y}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 de=n.line.height-B;if((de>.005||de<-.005)&&(mt(n.line,B),bo(n.line),n.rest))for(var pe=0;pe<n.rest.length;pe++)bo(n.rest[pe]);if(K>e.display.sizerWidth){var Se=Math.ceil(K/Li(e.display));Se>e.display.maxLineLength&&(e.display.maxLineLength=Se,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,Y=i.ensure.to.line;K<E?(E=K,B=wt(t,kr($e(t,K))+e.wrapper.clientHeight)):Math.min(Y,t.lastLine())>=B&&(E=wt(t,kr($e(t,Y))-e.wrapper.clientHeight),B=Y)}return{from:E,to:Math.max(B,E+1)}}function Ys(e,t){if(X(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+Or(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 Xs(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(t=t.ch?Fe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Fe(t.line,t.ch+1,"before"):t);for(var E=0;E<5;E++){var B=!1,K=Rr(e,t),Y=!i||i==t?K:Rr(e,i);n={left:Math.min(K.left,Y.left),top:Math.min(K.top,Y.top)-r,right:Math.max(K.left,Y.left),bottom:Math.max(K.bottom,Y.bottom)+r};var te=Aa(e,n),de=e.doc.scrollTop,pe=e.doc.scrollLeft;if(te.scrollTop!=null&&(ln(e,te.scrollTop),Math.abs(e.doc.scrollTop-de)>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=Ri(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+da(i),Y=t.top<r,te=t.bottom>K-r;if(t.top<n)B.scrollTop=Y?0:t.top;else if(t.bottom>n+E){var de=Math.min(t.top,(te?K:t.bottom)-E);de!=n&&(B.scrollTop=de)}var pe=e.options.fixedGutter?0:i.gutters.offsetWidth,Se=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-pe,xe=ui(e)-i.gutters.offsetWidth,Me=t.right-t.left>xe;return Me&&(t.right=t.left+xe),t.left<10?B.scrollLeft=0:t.left<Se?B.scrollLeft=Math.max(0,t.left+pe-(Me?0:10)):t.right>xe+Se-3&&(B.scrollLeft=t.right+(Me?0:10)-xe),B}function Ta(e,t){if(t==null)return;Gn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Mi(e){Gn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function sn(e,t,i){(t!=null||i!=null)&&Gn(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Gn(e),e.curOp.scrollToPos=t}function Gn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=uo(e,t.from),r=uo(e,t.to);Eo(e,i,r,t.margin)}}function Eo(e,t,i,r){var n=Aa(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});sn(e,n.scrollLeft,n.scrollTop)}function ln(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;R||Da(e,{top:t}),xo(e,t,!0),R&&Da(e),dn(e,100)}function xo(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function fi(e,t,i,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,wo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function un(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+da(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+Or(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var pi=function(e,t,i){this.cm=i;var r=this.vert=a("div",[a("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=a("div",[a("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),Ae(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ae(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,W&&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=s&&!w?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new 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 hn=function(){};hn.prototype.update=function(){return{bottom:0,right:0}},hn.prototype.setScrollLeft=function(){},hn.prototype.setScrollTop=function(){},hn.prototype.clear=function(){};function Oi(e,t){t||(t=un(e));var i=e.display.barWidth,r=e.display.barHeight;So(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&jn(e),So(e,un(e)),i=e.display.barWidth,r=e.display.barHeight}function So(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 Co={native:pi,null:hn};function Ao(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&f(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Co[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ae(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?fi(e,t):ln(e,t)},e),e.display.scrollbars.addClass&&H(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function mi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qs},Sr(e.curOp)}function gi(e){var t=e.curOp;t&&Is(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;$s(i)})}function $s(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var r=0;r<t.length;r++)tl(t[r]);for(var n=0;n<t.length;n++)rl(t[n]);for(var 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&&jn(t),e.barMeasure=un(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=to(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Or(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-ui(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&fi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==P();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Oi(t,e.barMeasure),e.updatedDisplay&&Ra(t,e.barMeasure),e.selectionChanged&&Sa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&vo(e.cm)}function nl(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&To(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&xo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&fi(t,e.scrollLeft,!0,!0),e.scrollToPos){var n=Xs(t,ft(r,e.scrollToPos.from),ft(r,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,n)}var 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 Y=0;Y<B.length;++Y)B[Y].lines.length&&oe(B[Y],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&oe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function fr(e,t){if(e.curOp)return t();mi(e);try{return t()}finally{gi(e)}}function zt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);mi(e);try{return t.apply(e,arguments)}finally{gi(e)}}}function ir(e){return function(){if(this.curOp)return e.apply(this,arguments);mi(this);try{return e.apply(this,arguments)}finally{gi(this)}}}function Kt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);mi(t);try{return e.apply(this,arguments)}finally{gi(t)}}}function dn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,z(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,r=Ar(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(E){if(r.line>=e.display.viewFrom){var B=E.styles,K=E.text.length>e.options.maxHighlightLength?Xt(t.mode,r.state):null,Y=Ki(e,E,r,!0);K&&(r.state=K),E.styles=Y.styles;var te=E.styleClasses,de=Y.classes;de?E.styleClasses=de:te&&(E.styleClasses=null);for(var pe=!B||B.length!=E.styles.length||te!=de&&(!te||!de||te.bgClass!=de.bgClass||te.textClass!=de.textClass),Se=0;!pe&&Se<B.length;++Se)pe=B[Se]!=E.styles[Se];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 dn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&fr(e,function(){for(var E=0;E<n.length;E++)Qr(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){ne(e,t)&&this.events.push(arguments)},zn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)oe.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Or(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Or(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=P();if(!t||!b(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&b(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&&b(document.body,e.anchorNode)&&b(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)),rr&&(E=qi(e.doc,E),B=Vr(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=kr($e(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var Y=po(e);if(!K&&Y==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var te=sl(e);return Y>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),Y>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(te),d(i.cursorDiv),d(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,K&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,dn(e,400)),i.updateLineNumbers=null,!0}function To(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==ui(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+da(e.display)-ca(e),i.top)}),t.visible=Hn(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Hn(e.display,e.doc,i));if(!wa(e,t))break;jn(e);var n=un(e);on(e),Oi(e,n),Ra(e,n),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Da(e,t){var i=new zn(e,t);if(wa(e,i)){jn(e),To(e,i);var r=un(e);on(e),Oi(e,r),Ra(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(Me){var Ue=Me.nextSibling;return O&&s&&e.display.currentWheelTarget==Me?Me.style.display="none":Me.parentNode.removeChild(Me),Ue}for(var Y=r.view,te=r.viewFrom,de=0;de<Y.length;de++){var pe=Y[de];if(!pe.hidden)if(!pe.node||pe.node.parentNode!=E){var Se=Bs(e,pe,te,i);E.insertBefore(Se,B)}else{for(;B!=pe.node;)B=K(B);var xe=n&&t!=null&&t<=te&&pe.lineNumber;pe.changes&&(me(pe.changes,"gutter")>-1&&(xe=!1),Ya(e,pe,te,i)),xe&&(d(pe.lineNumber),pe.lineNumber.appendChild(document.createTextNode(Ft(e.options,te)))),B=pe.node.nextSibling}te+=pe.size}for(;B;)B=K(B)}function ka(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ra(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Or(e)+"px"}function wo(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Ea(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,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 Y=0;Y<K.length;Y++)K[Y].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=Ft(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var n=r.measure.appendChild(a("div",[a("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),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",ka(e.display),!0}return!1}function La(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 ko(e){var t=e.gutters,i=e.gutterSpecs;d(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var n=i[r],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",ka(e)}function cn(e){ko(e.display),sr(e),wo(e)}function hl(e,t,i,r){var n=this;this.input=i,n.scrollbarFiller=a("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=a("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=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"),W&&U<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),!O&&!(R&&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=La(r.gutters,r.lineNumbers),ko(n),i.init(n)}var Kn=0,br=null;W?br=-.53:R?br=15:y?br=-.7:I&&(br=-1/3);function Ro(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function dl(e){var t=Ro(e);return t.x*=br,t.y*=br,t}function Lo(e,t){var i=Ro(t),r=i.x,n=i.y,E=e.display,B=E.scroller,K=B.scrollWidth>B.clientWidth,Y=B.scrollHeight>B.clientHeight;if(!(r&&K||n&&Y))return;if(n&&s&&O){e:for(var te=t.target,de=E.view;te!=B;te=te.parentNode)for(var pe=0;pe<de.length;pe++)if(de[pe].node==te){e.display.currentWheelTarget=te;break e}}if(r&&!R&&!C&&br!=null){n&&Y&&ln(e,Math.max(0,B.scrollTop+n*br)),fi(e,Math.max(0,B.scrollLeft+r*br)),(!n||n&&Y)&&q(t),E.wheelStartX=null;return}if(n&&br!=null){var Se=n*br,xe=e.doc.scrollTop,Me=xe+E.wrapper.clientHeight;Se<0?xe=Math.max(0,xe+Se-50):Me=Math.min(e.doc.height,Me+Se+50),Da(e,{top:xe,bottom:Me})}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,je=B.scrollTop-E.wheelStartY,Ve=je&&E.wheelDY&&je/E.wheelDY||Ue&&E.wheelDX&&Ue/E.wheelDX;if(E.wheelStartX=E.wheelStartY=null,!Ve)return;br=(br*Kn+Ve)/(Kn+1),++Kn},200)):(E.wheelDX+=r,E.wheelDY+=n))}var Er=function(e,t){this.ranges=e,this.primIndex=t};Er.prototype.primary=function(){return this.ranges[this.primIndex]},Er.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],r=e.ranges[t];if(!ri(i.anchor,r.anchor)||!ri(i.head,r.head))return!1}return!0},Er.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new kt(bi(this.ranges[t].anchor),bi(this.ranges[t].head));return new Er(e,this.primIndex)},Er.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Er.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(dt(t,r.from())>=0&&dt(e,r.to())<=0)return i}return-1};var kt=function(e,t){this.anchor=e,this.head=t};kt.prototype.from=function(){return ii(this.anchor,this.head)},kt.prototype.to=function(){return Ei(this.anchor,this.head)},kt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Lr(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(Se,xe){return dt(Se.from(),xe.from())}),i=me(t,n);for(var E=1;E<t.length;E++){var B=t[E],K=t[E-1],Y=dt(K.to(),B.from());if(r&&!B.empty()?Y>0:Y>=0){var te=ii(K.from(),B.from()),de=Ei(K.to(),B.to()),pe=K.empty()?B.from()==B.head:K.from()==K.head;E<=i&&--i,t.splice(--E,2,new kt(pe?de:te,pe?te:de))}}return new Er(t,i)}function Xr(e,t){return new Er([new kt(e,t||e)],0)}function Jr(e){return e.text?Fe(e.from.line+e.text.length-1,T(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Io(e,t){if(dt(e,t.from)<0)return e;if(dt(e,t.to)<=0)return Jr(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Jr(t).ch-t.to.ch),Fe(i,r)}function Ia(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var n=e.sel.ranges[r];i.push(new kt(Io(n.anchor,t),Io(n.head,t)))}return Lr(e.cm,i,e.sel.primIndex)}function Mo(e,t,i){return e.line==t.line?Fe(i.line,e.ch-t.ch+i.ch):Fe(i.line+(e.line-t.line),e.ch)}function cl(e,t,i){for(var r=[],n=Fe(e.first,0),E=n,B=0;B<t.length;B++){var K=t[B],Y=Mo(K.from,n,E),te=Mo(Jr(K),n,E);if(n=K.to,E=te,i=="around"){var de=e.sel.ranges[B],pe=dt(de.head,de.anchor)<0;r[B]=new kt(pe?te:Y,pe?Y:te)}else r[B]=new kt(Y,Y)}return new Er(r,e.sel.primIndex)}function Ma(e){e.doc.mode=gr(e.options,e.doc.modeOption),fn(e)}function fn(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,dn(e,100),e.state.modeGen++,e.curOp&&sr(e)}function Oo(e,t){return t.from.ch==0&&t.to.ch==0&&T(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Oa(e,t,i,r){function n(et){return i?i[et]:null}function E(et,Qe,rt){ua(et,Qe,rt,r),Zt(et,"change",et,t)}function B(et,Qe){for(var rt=[],ht=et;ht<Qe;++ht)rt.push(new li(te[ht],n(ht),r));return rt}var K=t.from,Y=t.to,te=t.text,de=$e(e,K.line),pe=$e(e,Y.line),Se=T(te),xe=n(te.length-1),Me=Y.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,xe),Me&&e.remove(K.line,Me),Ue.length&&e.insert(K.line,Ue)}else if(de==pe)if(te.length==1)E(de,de.text.slice(0,K.ch)+Se+de.text.slice(Y.ch),xe);else{var je=B(1,te.length-1);je.push(new li(Se+de.text.slice(Y.ch),xe,r)),E(de,de.text.slice(0,K.ch)+te[0],n(0)),e.insert(K.line+1,je)}else if(te.length==1)E(de,de.text.slice(0,K.ch)+te[0]+pe.text.slice(Y.ch),n(0)),e.remove(K.line+1,Me);else{E(de,de.text.slice(0,K.ch)+te[0],n(0)),E(pe,Se+pe.text.slice(Y.ch),xe);var Ve=B(1,te.length-1);Me>1&&e.remove(K.line+1,Me-1),e.insert(K.line+1,Ve)}Zt(e,"change",e,t)}function Zr(e,t,i){function r(n,E,B){if(n.linked)for(var K=0;K<n.linked.length;++K){var Y=n.linked[K];if(Y.doc==E)continue;var te=B&&Y.sharedHist;if(i&&!te)continue;t(Y.doc,te),r(Y.doc,n,te)}}r(e,null,!0)}function Po(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,xa(e),Ma(e),_o(e),e.options.lineWrapping||Bn(e),e.options.mode=t.modeOption,sr(e)}function _o(e){(e.doc.direction=="rtl"?H:f)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){fr(e,function(){_o(e),sr(e)})}function Vn(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Pa(e,t){var i={from:bi(t.from),to:Jr(t),text:Ct(e,t.from,t.to)};return Uo(e,i,t.from.line,t.to.line+1),Zr(e,function(r){return Uo(r,i,t.from.line,t.to.line+1)},!0),i}function Bo(e){for(;e.length;){var t=T(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Bo(e.done),T(e.done);if(e.done.length&&!T(e.done).ranges)return T(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),T(e.done)}function No(e,t,i,r){var n=e.history;n.undone.length=0;var 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),dt(t.from,t.to)==0&&dt(t.from,K.to)==0?K.to=Jr(t):B.changes.push(Pa(e,t));else{var Y=T(n.done);for((!Y||!Y.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=Ci(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 Y=B[K],te=0;te<E.length;++te)if(E[te].marker==Y.marker)continue e;E.push(Y)}}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?Er.prototype.deepCopy.call(E):E);continue}var B=E.changes,K=[];r.push({changes:K});for(var Y=0;Y<B.length;++Y){var te=B[Y],de=void 0;if(K.push({from:te.from,to:te.to,text:te.text}),t)for(var pe in te)(de=pe.match(/^spans_(\d+)$/))&&(me(t,Number(de[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=dt(t,n)<0;E!=dt(i,n)<0?(n=t,t=i):E!=dt(t,i)<0&&(t=i)}return new kt(n,t)}else return new kt(i||t,t)}function Yn(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),er(e,new Er([_a(e.sel.primary(),t,i,n)],0),r)}function Wo(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),E=0;E<e.sel.ranges.length;E++)r[E]=_a(e.sel.ranges[E],t[E],null,n);var B=Lr(e.cm,r,e.sel.primIndex);er(e,B,i)}function Ba(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i,er(e,Lr(e.cm,n,e.sel.primIndex),r)}function jo(e,t,i,r){er(e,Xr(t,i),r)}function bl(e,t,i){var r={ranges:t.ranges,update:function(n){this.ranges=[];for(var E=0;E<n.length;E++)this.ranges[E]=new kt(ft(e,n[E].anchor),ft(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?Lr(e.cm,r.ranges,r.ranges.length-1):t}function Ho(e,t,i){var r=e.history.done,n=T(r);n&&n.ranges?(r[r.length-1]=t,Xn(e,t,i)):er(e,t,i)}function er(e,t,i){Xn(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Xn(e,t,i){(ne(e,"beforeSelectionChange")||e.cm&&ne(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var r=i&&i.bias||(dt(t.primary().head,e.sel.primary().head)<0?-1:1);Go(e,Ko(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&Mi(e.cm)}function Go(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,J(e.cm)),Zt(e,"cursorActivity",e)}function zo(e){Go(e,Ko(e,e.sel,null,!1))}function Ko(e,t,i,r){for(var n,E=0;E<t.ranges.length;E++){var B=t.ranges[E],K=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[E],Y=Jn(e,B.anchor,K&&K.anchor,i,r),te=Jn(e,B.head,K&&K.head,i,r);(n||Y!=B.anchor||te!=B.head)&&(n||(n=t.ranges.slice(0,E)),n[E]=new kt(Y,te))}return n?Lr(e.cm,n,t.primIndex):t}function _i(e,t,i,r,n){var E=$e(e,t.line);if(E.markedSpans)for(var B=0;B<E.markedSpans.length;++B){var K=E.markedSpans[B],Y=K.marker,te="selectLeft"in Y?!Y.selectLeft:Y.inclusiveLeft,de="selectRight"in Y?!Y.selectRight:Y.inclusiveRight;if((K.from==null||(te?K.from<=t.ch:K.from<t.ch))&&(K.to==null||(de?K.to>=t.ch:K.to>t.ch))){if(n&&(oe(Y,"beforeCursorEnter"),Y.explicitlyCleared))if(E.markedSpans){--B;continue}else break;if(!Y.atomic)continue;if(i){var pe=Y.find(r<0?1:-1),Se=void 0;if((r<0?de:te)&&(pe=Vo(e,pe,-r,pe&&pe.line==t.line?E:null)),pe&&pe.line==t.line&&(Se=dt(pe,i))&&(r<0?Se<0:Se>0))return _i(e,pe,t,r,n)}var xe=Y.find(r<0?-1:1);return(r<0?te:de)&&(xe=Vo(e,xe,r,xe.line==t.line?E:null)),xe?_i(e,xe,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,Fe(e.first,0))}function Vo(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?ft(e,Fe(t.line-1)):null:i>0&&t.ch==(r||$e(e,t.line)).text.length?t.line<e.first+e.size-1?Fe(t.line+1,0):null:new Fe(t.line,t.ch+i)}function Qo(e){e.setSelection(Fe(e.firstLine(),0),Fe(e.lastLine()),Ce)}function Yo(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(n,E,B,K){n&&(r.from=ft(e,n)),E&&(r.to=ft(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 zt(e.cm,Bi)(e,t,i);if(e.cm.state.suppressEdits)return}if((ne(e,"beforeChange")||e.cm&&ne(e.cm,"beforeChange"))&&(t=Yo(e,t,!0),!t))return;var r=Ji&&!i&&On(e,t.from,t.to);if(r)for(var n=r.length-1;n>=0;--n)Xo(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else Xo(e,t)}function Xo(e,t){if(t.text.length==1&&t.text[0]==""&&dt(t.from,t.to)==0)return;var i=Ia(e,t);No(e,t,i,e.cm?e.cm.curOp.id:NaN),pn(e,t,i,Ci(e,t));var r=[];Zr(e,function(n,E){!E&&me(r,n.history)==-1&&($o(n.history,t),r.push(n.history)),pn(n,t,null,Ci(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,Y=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,Y),i&&!E.equals(e.sel)){er(e,E,{clearRedo:!1});return}B=E}else if(r){K.push(E);return}else break;var de=[];Qn(B,Y),Y.push({changes:de,generation:n.generation}),n.generation=E.generation||++n.maxGeneration;for(var pe=ne(e,"beforeChange")||e.cm&&ne(e.cm,"beforeChange"),Se=function(Ue){var je=E.changes[Ue];if(je.origin=t,pe&&!Yo(e,je,!1))return K.length=0,{};de.push(Pa(e,je));var Ve=Ue?Ia(e,je):T(K);pn(e,je,Ve,Fo(e,je)),!Ue&&e.cm&&e.cm.scrollIntoView({from:je.from,to:Jr(je)});var et=[];Zr(e,function(Qe,rt){!rt&&me(et,Qe.history)==-1&&($o(Qe.history,je),et.push(Qe.history)),pn(Qe,je,null,Fo(Qe,je))})},xe=E.changes.length-1;xe>=0;--xe){var Me=Se(xe);if(Me)return Me.v}}function Jo(e,t){if(t==0)return;if(e.first+=t,e.sel=new Er(k(e.sel.ranges,function(n){return new kt(Fe(n.anchor.line+t,n.anchor.ch),Fe(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm){sr(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)Qr(e.cm,r,"gutter")}}function pn(e,t,i,r){if(e.cm&&!e.cm.curOp)return zt(e.cm,pn)(e,t,i,r);if(t.to.line<e.first){Jo(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var n=t.text.length-1-(e.first-t.from.line);Jo(e,n),t={from:Fe(e.first,0),to:Fe(t.to.line+n,t.to.ch),text:[T(t.text)],origin:t.origin}}var E=e.lastLine();t.to.line>E&&(t={from:t.from,to:Fe(E,$e(e,E).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ct(e,t.from,t.to),i||(i=Ia(e,t)),e.cm?El(e.cm,t,r):Oa(e,t,r),Xn(e,i,Ce),e.cantEdit&&Jn(e,Fe(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,Y=E.line;e.options.lineWrapping||(Y=pt(yr($e(r,E.line))),r.iter(Y,B.line+1,function(xe){if(xe==n.maxLine)return K=!0,!0})),r.sel.contains(t.from,t.to)>-1&&J(e),Oa(r,t,i,fo(e)),e.options.lineWrapping||(r.iter(Y,E.line+t.text.length,function(xe){var Me=en(xe);Me>n.maxLineLength&&(n.maxLine=xe,n.maxLineLength=Me,n.maxLineChanged=!0,K=!1)}),K&&(e.curOp.updateMaxLine=!0)),aa(r,E.line),dn(e,400);var te=t.text.length-(B.line-E.line)-1;t.full?sr(e):E.line==B.line&&t.text.length==1&&!Oo(e.doc,t)?Qr(e,E.line,"text"):sr(e,E.line,B.line+1,te);var de=ne(e,"changes"),pe=ne(e,"change");if(pe||de){var Se={from:E,to:B,text:t.text,removed:t.removed,origin:t.origin};pe&&Zt(e,"change",e,Se),de&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Se)}e.display.selForContextMenu=null}function Ni(e,t,i,r,n){var E;r||(r=i),dt(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 Y=0;Y<E.changes.length;++Y){var te=E.changes[Y];if(i<te.from.line)te.from=Fe(te.from.line+r,te.from.ch),te.to=Fe(te.to.line+r,te.to.ch);else if(t<=te.to.line){B=!1;break}}B||(e.splice(0,n+1),n=0)}}function $o(e,t){var i=t.from.line,r=t.to.line,n=t.text.length-(r-i)-1;qo(e.done,i,r,n),qo(e.undone,i,r,n)}function mn(e,t,i,r){var n=t,E=t;return typeof t=="number"?E=$e(e,xi(e,t)):n=pt(t),n==null?null:(r(E,n)&&e.cm&&Qr(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,ot(n),Zt(n,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function vn(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var n=e[r];t+=n.chunkSize(),i+=n.height,n.parent=this}this.size=t,this.height=i,this.parent=null}vn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],n=r.chunkSize();if(e<n){var 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 Y=new gn(n.lines.slice(K,K+=25));n.height-=Y.height,this.children.splice(++r,0,Y),Y.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=me(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=pt(i);if(r==null||!t)return;for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(i.widgets=null);var E=nn(this);mt(i,Math.max(0,i.height-E)),e&&(fr(e,function(){es(e,i,-E),Qr(e,r,"widget")}),Zt(e,"lineWidgetCleared",e,this,r))},yn.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var n=nn(this)-t;if(!n)return;Mr(this.doc,r)||mt(r,r.height+n),i&&fr(i,function(){i.curOp.forceUpdate=!0,es(i,r,n),Zt(i,"lineWidgetChanged",i,e,pt(r))})},se(yn);function es(e,t,i){kr(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&&!Mr(e,B)){var Y=kr(B)<e.scrollTop;mt(B,B.height+nn(n)),Y&&Ta(E,n.height),E.curOp.forceUpdate=!0}return!0}),E&&Zt(E,"lineWidgetAdded",E,n,typeof t=="number"?t:pt(t)),n}var ts=0,qr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ts};qr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&mi(e),ne(this,"clear")){var i=this.find();i&&Zt(this,"clear",i.from,i.to)}for(var r=null,n=null,E=0;E<this.lines.length;++E){var B=this.lines[E],K=Dr(B.markedSpans,this);e&&!this.collapsed?Qr(e,pt(B),"text"):e&&(K.to!=null&&(n=pt(B)),K.from!=null&&(r=pt(B))),B.markedSpans=Zi(B.markedSpans,K),K.from==null&&this.collapsed&&!Mr(this.doc,B)&&e&&mt(B,Ri(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var Y=0;Y<this.lines.length;++Y){var te=yr(this.lines[Y]),de=en(te);de>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=de,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&sr(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&zo(e.doc)),e&&Zt(e,"markerCleared",e,this,r,n),t&&gi(e),this.parent&&this.parent.clear()},qr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n<this.lines.length;++n){var E=this.lines[n],B=Dr(E.markedSpans,this);if(B.from!=null&&(i=Fe(t?E:pt(E),B.from),e==-1))return i;if(B.to!=null&&(r=Fe(t?E:pt(E),B.to),e==1))return r}return i&&{from:i,to:r}},qr.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;if(!t||!r)return;fr(r,function(){var n=t.line,E=pt(t.line),B=fa(r,E);if(B&&(no(B),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Mr(i.doc,n)&&i.height!=null){var K=i.height;i.height=null;var Y=nn(i)-K;Y&&mt(n,n.height+Y)}Zt(r,"markerChanged",r,e)})},qr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||me(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},qr.prototype.detachLine=function(e){if(this.lines.splice(me(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},se(qr);function Ui(e,t,i,r,n){if(r&&r.shared)return Sl(e,t,i,r,n);if(e.cm&&!e.cm.curOp)return zt(e.cm,Ui)(e,t,i,r,n);var E=new qr(e,n),B=dt(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,Y=e.cm,te;if(e.iter(K,i.line+1,function(pe){Y&&E.collapsed&&!Y.options.lineWrapping&&yr(pe)==Y.display.maxLine&&(te=!0),E.collapsed&&K!=t.line&&mt(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){Mr(e,pe)&&mt(pe,0)}),E.clearOnEnter&&Ae(E,"beforeCursorEnter",function(){return E.clear()}),E.readOnly&&(Kr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),E.collapsed&&(E.id=++ts,E.atomic=!0),Y){if(te&&(Y.curOp.updateMaxLine=!0),E.collapsed)sr(Y,t.line,i.line+1);else if(E.className||E.startStyle||E.endStyle||E.css||E.attributes||E.title)for(var de=t.line;de<=i.line;de++)Qr(Y,de,"text");E.atomic&&zo(Y.doc),Zt(Y,"markerAdded",Y,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();Zt(this,"clear")},bn.prototype.find=function(e,t){return this.primary.find(e,t)},se(bn);function Sl(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 Zr(e,function(Y){K&&(r.widgetNode=K.cloneNode(!0)),E.push(Ui(Y,ft(Y,t),ft(Y,i),r,n));for(var te=0;te<Y.linked.length;++te)if(Y.linked[te].isParent)return;B=T(E)}),new bn(E,B)}function rs(e){return e.findMarks(Fe(e.first,0),e.clipPos(Fe(e.lastLine())),function(t){return t.parent})}function Cl(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(dt(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];Zr(n.primary.doc,function(Y){return E.push(Y)});for(var B=0;B<n.markers.length;B++){var K=n.markers[B];me(E,K.doc)==-1&&(K.parent=null,n.markers.splice(B--,1))}},i=0;i<e.length;i++)t(i)}var Tl=0,lr=function(e,t,i,r,n){if(!(this instanceof lr))return new lr(e,t,i,r,n);i==null&&(i=0),vn.call(this,[new gn([new li("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var E=Fe(i,0);this.sel=Xr(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}),er(this,Xr(E),Ce)};lr.prototype=N(vn.prototype,{constructor:lr,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Jt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Kt(function(e){var t=Fe(this.first,0),i=this.first+this.size-1;Bi(this,{from:t,to:Fe(i,$e(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&sn(this.cm,0,0),er(this,Xr(t),Ce)}),replaceRange:function(e,t,i,r){t=ft(this,t),i=i?ft(this,i):t,Ni(this,e,t,i,r)},getRange:function(e,t,i){var r=Ct(this,ft(this,e),ft(this,t));return i===!1?r:r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(vr(this,e))return $e(this,e)},getLineNumber:function(e){return pt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=$e(this,e)),yr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ft(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Kt(function(e,t,i){jo(this,ft(this,typeof e=="number"?Fe(e,t||0):e),null,i)}),setSelection:Kt(function(e,t,i){jo(this,ft(this,e),ft(this,t||e),i)}),extendSelection:Kt(function(e,t,i){Yn(this,ft(this,e),t&&ft(this,t),i)}),extendSelections:Kt(function(e,t){Wo(this,We(this,e),t)}),extendSelectionsBy:Kt(function(e,t){var i=k(this.sel.ranges,e);Wo(this,We(this,i),t)}),setSelections:Kt(function(e,t,i){if(!e.length)return;for(var r=[],n=0;n<e.length;n++)r[n]=new kt(ft(this,e[n].anchor),ft(this,e[n].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),er(this,Lr(this.cm,r,t),i)}),addSelection:Kt(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new kt(ft(this,e),ft(this,t||e))),er(this,Lr(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=Ct(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=Ct(this,i[r].from(),i[r].to());e!==!1&&(n=n.join(e||this.lineSeparator())),t[r]=n}return t},replaceSelection:function(e,t,i){for(var r=[],n=0;n<this.sel.ranges.length;n++)r[n]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:Kt(function(e,t,i){for(var r=[],n=this.sel,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),Y=r.length-1;Y>=0;Y--)Bi(this,r[Y]);K?Ho(this,K):this.cm&&Mi(this.cm)}),undo:Kt(function(){Zn(this,"undo")}),redo:Kt(function(){Zn(this,"redo")}),undoSelection:Kt(function(){Zn(this,"undo",!0)}),redoSelection:Kt(function(){Zn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Vn(this.history.maxGeneration),Zr(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Pi(this.history.done),undone:Pi(this.history.undone)}},setHistory:function(e){var t=this.history=new Vn(this.history.maxGeneration);t.done=Pi(e.done.slice(0),null,!0),t.undone=Pi(e.undone.slice(0),null,!0)},setGutterMarker:Kt(function(e,t,i){return mn(this,e,"gutter",function(r){var n=r.gutterMarkers||(r.gutterMarkers={});return n[t]=i,!i&&Ne(n)&&(r.gutterMarkers=null),!0})}),clearGutter:Kt(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&mn(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Ne(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!vr(this,e))return null;if(t=e,e=$e(this,e),!e)return null}else if(t=pt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Kt(function(e,t,i){return mn(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[n])r[n]=i;else{if(v(i).test(r[n]))return!1;r[n]+=" "+i}return!0})}),removeLineClass:Kt(function(e,t,i){return mn(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",E=r[n];if(E)if(i==null)r[n]=null;else{var B=E.match(v(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:Kt(function(e,t,i){return xl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Ui(this,ft(this,e),ft(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ft(this,e),Ui(this,e,e,i,"bookmark")},findMarksAt:function(e){e=ft(this,e);var t=[],i=$e(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var n=i[r];(n.from==null||n.from<=e.ch)&&(n.to==null||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=ft(this,e),t=ft(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(E){var B=E.markedSpans;if(B)for(var K=0;K<B.length;K++){var Y=B[K];!(Y.to!=null&&n==e.line&&e.ch>=Y.to||Y.from==null&&n!=e.line||Y.from!=null&&n==t.line&&Y.from>=t.ch)&&(!i||i(Y.marker))&&r.push(Y.marker.parent||Y.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}),ft(this,Fe(i,t))},indexFromPos:function(e){e=ft(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new lr(Jt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new lr(Jt(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cl(r,rs(this)),r},unlinkDoc:function(e){if(e instanceof Pt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Al(rs(this));break}if(e.history==this.history){var r=[e.id];Zr(e,function(n){return r.push(n.id)},!0),e.history=new Vn(null),e.history.done=Pi(this.history.done,r),e.history.undone=Pi(this.history.undone,r)}},iterLinkedDocs:function(e){Zr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):st(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Kt(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),lr.prototype.eachLine=lr.prototype.iter;var is=0;function wl(e){var t=this;if(ns(t),X(t,e)||jr(t.display,e))return;q(e),W&&(is=+new Date);var i=di(t,e,!0),r=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var n=r.length,E=Array(n),B=0,K=function(){++B==n&&zt(t,function(){i=ft(t.doc,i);var xe={from:i,to:i,text:t.doc.splitLines(E.filter(function(Me){return Me!=null}).join(t.doc.lineSeparator())),origin:"paste"};Bi(t.doc,xe),Ho(t.doc,Xr(ft(t.doc,i),ft(t.doc,Jr(xe))))})()},Y=function(xe,Me){if(t.options.allowDropFileTypes&&me(t.options.allowDropFileTypes,xe.type)==-1){K();return}var Ue=new FileReader;Ue.onerror=function(){return K()},Ue.onload=function(){var je=Ue.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(je)){K();return}E[Me]=je,K()},Ue.readAsText(xe)},te=0;te<r.length;te++)Y(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 de=e.dataTransfer.getData("Text");if(de){var pe;if(t.state.draggingText&&!t.state.draggingText.copy&&(pe=t.listSelections()),Xn(t.doc,Xr(i,i)),pe)for(var Se=0;Se<pe.length;++Se)Ni(t.doc,"",pe[Se].anchor,pe[Se].head,"drag");t.replaceSelection(de,"around","paste"),t.display.input.focus()}}catch(xe){}}}function Dl(e,t){if(W&&(!e.state.draggingText||+new Date-is<100)){he(t);return}if(X(e,t)||jr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!I){var i=a("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",C&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),C&&i.parentNode.removeChild(i)}}function kl(e,t){var i=di(e,t);if(!i)return;var r=document.createDocumentFragment();go(e,i,r),e.display.dragCursor||(e.display.dragCursor=a("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),l(e.display.dragCursor,r)}function ns(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function as(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&i.push(n)}i.length&&i[0].operation(function(){for(var E=0;E<i.length;E++)e(i[E])})}var os=!1;function Rl(){if(os)return;Ll(),os=!0}function Ll(){var e;Ae(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,as(Il)},100))}),Ae(window,"blur",function(){return as(Ii)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var $r={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},En=0;En<10;En++)$r[En+48]=$r[En+96]=String(En);for(var qn=65;qn<=90;qn++)$r[qn]=String.fromCharCode(qn);for(var xn=1;xn<=12;xn++)$r[xn+111]=$r[xn+63235]="F"+xn;var Hr={};Hr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Hr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Hr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Hr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Hr.default=s?Hr.macDefault:Hr.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,n,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=k(i.split(" "),Ml),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 Y=t[K];if(!Y)t[K]=B;else if(Y!=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:$r[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ls(e,t,i){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(p?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(p?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function us(e,t){if(C&&e.keyCode==34&&e.char)return!1;var i=$r[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),ls(i,e,t))}function $n(e){return typeof e=="string"?Hr[e]:e}function Wi(e,t){for(var i=e.doc.sel.ranges,r=[],n=0;n<i.length;n++){for(var E=t(i[n]);r.length&&dt(E.from,T(r).to)<=0;){var B=r.pop();if(dt(B.from,E.from)<0){E.from=B.from;break}}r.push(E)}fr(e,function(){for(var K=r.length-1;K>=0;K--)Ni(e.doc,"",r[K].from,r[K].to,"+delete");Mi(e)})}function Na(e,t,i){var r=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 Fe(t.line,r,i<0?"after":"before")}function Fa(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var E=qe(i,t.doc.direction);if(E){var B=n<0?T(E):E[0],K=n<0==(B.level==1),Y=K?"after":"before",te;if(B.level>0||t.doc.direction=="rtl"){var de=ki(t,i);te=n<0?i.text.length-1:0;var pe=Pr(t,de,te).top;te=Ge(function(Se){return Pr(t,de,Se).top==pe},n<0==(B.level==1)?B.from:B.to-1,te),Y=="before"&&(te=Na(i,te,1))}else te=n<0?B.to:B.from;return new Fe(r,te,Y)}}return new Fe(r,n<0?i.text.length:0,n<0?"before":"after")}function Pl(e,t,i,r){var n=qe(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=Xe(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(Ve,et){return Na(t,Ve instanceof Fe?Ve.ch:Ve,et)},Y,te=function(Ve){return e.options.lineWrapping?(Y=Y||ki(e,t),co(e,t,Y,Ve)):{begin:0,end:t.text.length}},de=te(i.sticky=="before"?K(i,-1):i.ch);if(e.doc.direction=="rtl"||B.level==1){var pe=B.level==1==r<0,Se=K(i,pe?1:-1);if(Se!=null&&(pe?Se<=B.to&&Se<=de.end:Se>=B.from&&Se>=de.begin)){var xe=pe?"before":"after";return new Fe(i.line,Se,xe)}}var Me=function(Ve,et,Qe){for(var rt=function(It,Vt){return Vt?new Fe(i.line,K(It,1),"before"):new Fe(i.line,It,"after")};Ve>=0&&Ve<n.length;Ve+=et){var ht=n[Ve],lt=et>0==(ht.level!=1),gt=lt?Qe.begin:K(Qe.end,-1);if(ht.from<=gt&><ht.to)return rt(gt,lt);if(gt=lt?ht.from:K(ht.to,-1),Qe.begin<=gt&><Qe.end)return rt(gt,lt)}},Ue=Me(E+r,r,de);if(Ue)return Ue;var je=r>0?de.end:K(de.begin,-1);return je!=null&&!(r>0&&je==t.text.length)&&(Ue=Me(r>0?0:n.length-1,r,te(je)),Ue)?Ue:null}var Sn={selectAll:Qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ce)},killLine:function(e){return Wi(e,function(t){if(t.empty()){var i=$e(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Fe(t.head.line+1,0)}:{from:t.head,to:Fe(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Wi(e,function(t){return{from:Fe(t.from().line,0),to:ft(e.doc,Fe(t.to().line+1,0))}})},delLineLeft:function(e){return Wi(e,function(t){return{from:Fe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Wi(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Wi(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Fe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Fe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return hs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return _l(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},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/)?ds(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=ae(e.getLine(E.line),E.ch,r);t.push(j(r-B%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return fr(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var n=t[r].head,E=$e(e.doc,n.line).text;if(E){if(n.ch==E.length&&(n=new Fe(n.line,n.ch-1)),n.ch>0)n=new Fe(n.line,n.ch+1),e.replaceRange(E.charAt(n.ch-1)+E.charAt(n.ch-2),Fe(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var B=$e(e.doc,n.line-1).text;B&&(n=new Fe(n.line,1),e.replaceRange(E.charAt(0)+e.doc.lineSeparator()+B.charAt(B.length-1),Fe(n.line-1,B.length-1),n,"+transpose"))}}i.push(new kt(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return fr(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Mi(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function hs(e,t){var i=$e(e.doc,t),r=yr(i);return r!=i&&(t=pt(r)),Fa(!0,e,r,t,1)}function _l(e,t){var i=$e(e.doc,t),r=_n(i);return r!=i&&(t=pt(r)),Fa(!0,e,i,t,-1)}function ds(e,t){var i=hs(e,t.line),r=$e(e.doc,i.line),n=qe(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 Fe(i.line,B?0:E,i.sticky)}return i}function ea(e,t,i){if(typeof t=="string"&&(t=Sn[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 Cn(e,t,i,r){var n=e.state.keySeq;if(n){if(ss(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Nl.set(50,function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())}),cs(e,n+" "+t,i,r))return!0}return cs(e,t,i,r)}function cs(e,t,i,r){var n=Bl(e,t,r);return n=="multi"&&(e.state.keySeq=t),n=="handled"&&Zt(e,"keyHandled",e,t,i),(n=="handled"||n=="multi")&&(q(i),Sa(e)),!!n}function fs(e,t){var i=us(t,!0);return i?t.shiftKey&&!e.state.keySeq?Cn(e,"Shift-"+i,t,function(r){return ea(e,r,!0)})||Cn(e,i,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return ea(e,r)}):Cn(e,i,t,function(r){return ea(e,r)}):!1}function Ul(e,t,i){return Cn(e,"'"+i+"'",t,function(r){return ea(e,r,!0)})}var Wa=null;function ps(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=P(),X(t,e))return;W&&U<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=fs(t,e);C&&(Wa=r?i:null,!r&&i==88&&!Tt&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),R&&!s&&!r&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;H(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(f(t,"CodeMirror-crosshair"),Ze(document,"keyup",i),Ze(document,"mouseover",i))}Ae(document,"keyup",i),Ae(document,"mouseover",i)}function ms(e){e.keyCode==16&&(this.doc.sel.shift=!1),X(this,e)}function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(jr(t.display,e)||X(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var i=e.keyCode,r=e.charCode;if(C&&i==Wa){Wa=null,q(e);return}if(C&&(!e.which||e.which<10)&&fs(t,e))return;var n=String.fromCharCode(r==null?i:r);if(n=="\b")return;if(Ul(t,e,n))return;t.display.input.onKeyPress(e)}var Wl=400,ja=function(e,t,i){this.time=e,this.pos=t,this.button=i};ja.prototype.compare=function(e,t,i){return this.time+Wl>e&&dt(t,this.pos)==0&&i==this.button};var An,Tn;function jl(e,t){var i=+new Date;return Tn&&Tn.compare(i,e,t)?(An=Tn=null,"triple"):An&&An.compare(i,e,t)?(Tn=new ja(i,e,t),An=null,"double"):(An=new ja(i,e,t),Tn=null,"single")}function vs(e){var t=this,i=t.display;if(X(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,jr(i,e)){O||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Ha(t,e))return;var r=di(t,e),n=ye(e),E=r?jl(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):ge(e)==i.scroller&&q(e):n==2?(r&&Yn(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(D?t.display.input.onContextMenu(e):yo(t))}function Hl(e,t,i,r,n){var E="Click";return r=="double"?E="Double"+E:r=="triple"&&(E="Triple"+E),E=(t==1?"Left":t==2?"Middle":"Right")+E,Cn(e,ls(E,n),n,function(B){if(typeof B=="string"&&(B=Sn[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=s?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(s?i.altKey:i.ctrlKey)),n}function zl(e,t,i,r){W?setTimeout(z(vo,e),0):e.curOp.focus=P();var n=Gl(e,i,r),E=e.doc.sel,B;e.options.dragDrop&&ke&&!e.isReadOnly()&&i=="single"&&(B=E.contains(t))>-1&&(dt((B=E.ranges[B]).from(),t)<0||t.xRel>0)&&(dt(B.to(),t)>0||t.xRel<0)?Kl(e,r,t,n):Vl(e,r,t,n)}function Kl(e,t,i,r){var n=e.display,E=!1,B=zt(e,function(te){O&&(n.scroller.draggable=!1),e.state.draggingText=!1,Ze(n.wrapper.ownerDocument,"mouseup",B),Ze(n.wrapper.ownerDocument,"mousemove",K),Ze(n.scroller,"dragstart",Y),Ze(n.scroller,"drop",B),E||(q(te),r.addNew||Yn(e.doc,i,null,null,r.extend),O&&!I||W&&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},Y=function(){return E=!0};O&&(n.scroller.draggable=!0),e.state.draggingText=B,B.copy=!r.moveOnDrag,n.scroller.dragDrop&&n.scroller.dragDrop(),Ae(n.wrapper.ownerDocument,"mouseup",B),Ae(n.wrapper.ownerDocument,"mousemove",K),Ae(n.scroller,"dragstart",Y),Ae(n.scroller,"drop",B),yo(e),setTimeout(function(){return n.input.focus()},20)}function ys(e,t,i){if(i=="char")return new kt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new kt(Fe(t.line,0),ft(e.doc,Fe(t.line+1,0)));var r=i(e,t);return new kt(r.from,r.to)}function Vl(e,t,i,r){var n=e.display,E=e.doc;q(t);var B,K,Y=E.sel,te=Y.ranges;if(r.addNew&&!r.extend?(K=E.sel.contains(i),K>-1?B=te[K]:B=new kt(i,i)):(B=E.sel.primary(),K=E.sel.primIndex),r.unit=="rectangle")r.addNew||(B=new kt(i,i)),i=di(e,t,!0,!0),K=-1;else{var de=ys(e,i,r.unit);r.extend?B=_a(B,de.anchor,de.head,r.extend):B=de}r.addNew?K==-1?(K=te.length,er(E,Lr(e,te.concat([B]),K),{scroll:!1,origin:"*mouse"})):te.length>1&&te[K].empty()&&r.unit=="char"&&!r.extend?(er(E,Lr(e,te.slice(0,K).concat(te.slice(K+1)),0),{scroll:!1,origin:"*mouse"}),Y=E.sel):Ba(E,K,B,Le):(K=0,er(E,new Er([B],0),Le),Y=E.sel);var pe=i;function Se(Qe){if(dt(pe,Qe)==0)return;if(pe=Qe,r.unit=="rectangle"){for(var rt=[],ht=e.options.tabSize,lt=ae($e(E,i.line).text,i.ch,ht),gt=ae($e(E,Qe.line).text,Qe.ch,ht),It=Math.min(lt,gt),Vt=Math.max(lt,gt),Bt=Math.min(i.line,Qe.line),pr=Math.min(e.lastLine(),Math.max(i.line,Qe.line));Bt<=pr;Bt++){var ur=$e(E,Bt).text,Wt=we(ur,It,ht);It==Vt?rt.push(new kt(Fe(Bt,Wt),Fe(Bt,Wt))):ur.length>Wt&&rt.push(new kt(Fe(Bt,Wt),Fe(Bt,we(ur,Vt,ht))))}rt.length||rt.push(new kt(i,i)),er(E,Lr(e,Y.ranges.slice(0,K).concat(rt),K),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Qe)}else{var hr=B,qt=ys(e,Qe,r.unit),Gt=hr.anchor,jt;dt(qt.anchor,Gt)>0?(jt=qt.head,Gt=ii(hr.from(),qt.anchor)):(jt=qt.anchor,Gt=Ei(hr.to(),qt.head));var Nt=Y.ranges.slice(0);Nt[K]=Ql(e,new kt(ft(E,Gt),jt)),er(E,Lr(e,Nt,K),Le)}}var xe=n.wrapper.getBoundingClientRect(),Me=0;function Ue(Qe){var rt=++Me,ht=di(e,Qe,!0,r.unit=="rectangle");if(!ht)return;if(dt(ht,pe)!=0){e.curOp.focus=P(),Se(ht);var lt=Hn(n,E);(ht.line>=lt.to||ht.line<lt.from)&&setTimeout(zt(e,function(){Me==rt&&Ue(Qe)}),150)}else{var gt=Qe.clientY<xe.top?-20:Qe.clientY>xe.bottom?20:0;gt&&setTimeout(zt(e,function(){if(Me!=rt)return;n.scroller.scrollTop+=gt,Ue(Qe)}),50)}}function je(Qe){e.state.selectingText=!1,Me=Infinity,Qe&&(q(Qe),n.input.focus()),Ze(n.wrapper.ownerDocument,"mousemove",Ve),Ze(n.wrapper.ownerDocument,"mouseup",et),E.history.lastSelOrigin=null}var Ve=zt(e,function(Qe){Qe.buttons===0||!ye(Qe)?je(Qe):Ue(Qe)}),et=zt(e,je);e.state.selectingText=et,Ae(n.wrapper.ownerDocument,"mousemove",Ve),Ae(n.wrapper.ownerDocument,"mouseup",et)}function Ql(e,t){var i=t.anchor,r=t.head,n=$e(e.doc,i.line);if(dt(i,r)==0&&i.sticky==r.sticky)return t;var E=qe(n);if(!E)return t;var B=Xe(E,i.ch,i.sticky),K=E[B];if(K.from!=i.ch&&K.to!=i.ch)return t;var Y=B+(K.from==i.ch==(K.level!=1)?0:1);if(Y==0||Y==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 de=Xe(E,r.ch,r.sticky),pe=de-B||(r.ch-i.ch)*(K.level==1?-1:1);de==Y-1||de==Y?te=pe<0:te=pe>0}var Se=E[Y+(te?-1:0)],xe=te==(Se.level==1),Me=xe?Se.from:Se.to,Ue=xe?"after":"before";return i.ch==Me&&i.sticky==Ue?t:new kt(new Fe(i.line,Me,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(Se){return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&q(t);var B=e.display,K=B.lineDiv.getBoundingClientRect();if(E>K.bottom||!ne(e,i))return le(t);E-=K.top-B.viewOffset;for(var Y=0;Y<e.display.gutterSpecs.length;++Y){var te=B.gutters.childNodes[Y];if(te&&te.getBoundingClientRect().right>=n){var de=wt(e.doc,E),pe=e.display.gutterSpecs[Y];return oe(e,i,e,de,pe.className,t),le(t)}}}function Ha(e,t){return bs(e,t,"gutterClick",!0)}function Es(e,t){if(jr(e.display,t)||Yl(e,t))return;if(X(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Yl(e,t){return ne(e,"gutterContextMenu")?bs(e,t,"gutterContextMenu",!1):!1}function xs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),an(e)}var ji={toString:function(){return"CodeMirror.Init"}},Ss={},ta={};function Xl(e){var t=e.optionHandlers;function i(r,n,E,B){e.defaults[r]=n,E&&(t[r]=B?function(K,Y,te){te!=ji&&E(K,Y,te)}:E)}e.defineOption=i,e.Init=ji,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,Ma(r)},!0),i("indentUnit",2,Ma,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){fn(r),an(r),sr(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!n)return;var E=[],B=r.doc.first;r.doc.iter(function(Y){for(var te=0;;){var de=Y.text.indexOf(n,te);if(de==-1)break;te=de+n.length,E.push(Fe(B,de))}B++});for(var K=E.length-1;K>=0;K--)Ni(r.doc,n,E[K],Fe(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!=ji&&r.refresh()}),i("specialCharPlaceholder",Lt,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!=ji&&$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=La(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=La(r.options.gutters,n),cn(r)},!0),i("firstLineNumber",1,cn,!0),i("lineNumberFormatter",function(r){return r},cn,!0),i("showCursorWhenSelecting",!1,on,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(Ii(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,on,!0),i("singleCursorHeightPerLine",!0,on,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,fn,!0),i("addModeClass",!1,fn,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,fn,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function Jl(e,t,i){var r=i&&i!=ji;if(!t!=!r){var n=e.display.dragFunctions,E=t?Ae:Ze;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?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(f(e.display.wrapper,"CodeMirror-wrap"),Bn(e)),xa(e),sr(e),an(e),setTimeout(function(){return Oi(e)},100)}function Pt(e,t){var i=this;if(!(this instanceof Pt))return new Pt(e,t);this.options=t=t?F(t):{},F(Ss,t,!1);var r=t.value;typeof r=="string"?r=new lr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new Pt.inputStyles[t.inputStyle](this),E=this.display=new hl(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(),W&&U<11&&setTimeout(function(){return i.display.input.reset(!0)},20),ql(this),Rl(),mi(this),this.curOp.forceUpdate=!0,Po(this,r),t.autofocus&&!o||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Ca(i)},20):Ii(this);for(var B in ta)ta.hasOwnProperty(B)&&ta[B](this,t[B],ji);Do(this),t.finishInit&&t.finishInit(this);for(var K=0;K<Ga.length;++K)Ga[K](this);gi(this),O&&t.lineWrapping&&getComputedStyle(E.lineDiv).textRendering=="optimizelegibility"&&(E.lineDiv.style.textRendering="auto")}Pt.defaults=Ss,Pt.optionHandlers=ta;function ql(e){var t=e.display;Ae(t.scroller,"mousedown",zt(e,vs)),W&&U<11?Ae(t.scroller,"dblclick",zt(e,function(Y){if(X(e,Y))return;var te=di(e,Y);if(!te||Ha(e,Y)||jr(e.display,Y))return;q(Y);var de=e.findWordAt(te);Yn(e.doc,de.anchor,de.head)})):Ae(t.scroller,"dblclick",function(Y){return X(e,Y)||q(Y)}),Ae(t.scroller,"contextmenu",function(Y){return Es(e,Y)}),Ae(t.input.getField(),"contextmenu",function(Y){t.scroller.contains(Y.target)||Es(e,Y)});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(Y){if(Y.touches.length!=1)return!1;var te=Y.touches[0];return te.radiusX<=1&&te.radiusY<=1}function B(Y,te){if(te.left==null)return!0;var de=te.left-Y.left,pe=te.top-Y.top;return de*de+pe*pe>20*20}Ae(t.scroller,"touchstart",function(Y){if(!X(e,Y)&&!E(Y)&&!Ha(e,Y)){t.input.ensurePolled(),clearTimeout(i);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-r.end<=300?r:null},Y.touches.length==1&&(t.activeTouch.left=Y.touches[0].pageX,t.activeTouch.top=Y.touches[0].pageY)}}),Ae(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ae(t.scroller,"touchend",function(Y){var te=t.activeTouch;if(te&&!jr(t,Y)&&te.left!=null&&!te.moved&&new Date-te.start<300){var de=e.coordsChar(t.activeTouch,"page"),pe;!te.prev||B(te,te.prev)?pe=new kt(de,de):!te.prev.prev||B(te,te.prev.prev)?pe=e.findWordAt(de):pe=new kt(Fe(de.line,0),ft(e.doc,Fe(de.line+1,0))),e.setSelection(pe.anchor,pe.head),e.focus(),q(Y)}n()}),Ae(t.scroller,"touchcancel",n),Ae(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ln(e,t.scroller.scrollTop),fi(e,t.scroller.scrollLeft,!0),oe(e,"scroll",e))}),Ae(t.scroller,"mousewheel",function(Y){return Lo(e,Y)}),Ae(t.scroller,"DOMMouseScroll",function(Y){return Lo(e,Y)}),Ae(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Y){X(e,Y)||he(Y)},over:function(Y){X(e,Y)||(kl(e,Y),he(Y))},start:function(Y){return Dl(e,Y)},drop:zt(e,wl),leave:function(Y){X(e,Y)||ns(e)}};var K=t.input.getField();Ae(K,"keyup",function(Y){return ms.call(e,Y)}),Ae(K,"keydown",zt(e,ps)),Ae(K,"keypress",zt(e,gs)),Ae(K,"focus",function(Y){return Ca(e,Y)}),Ae(K,"blur",function(Y){return Ii(e,Y)})}var Ga=[];Pt.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=Ar(e,t).state:i="prev");var B=e.options.tabSize,K=$e(n,t),Y=ae(K.text,null,B);K.stateAfter&&(K.stateAfter=null);var te=K.text.match(/^\s*/)[0],de;if(!r&&!/\S/.test(K.text))de=0,i="not";else if(i=="smart"&&(de=n.mode.indent(E,K.text.slice(te.length),K.text),de==Be||de>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?de=ae($e(n,t-1).text,null,B):de=0:i=="add"?de=Y+e.options.indentUnit:i=="subtract"?de=Y-e.options.indentUnit:typeof i=="number"&&(de=Y+i),de=Math.max(0,de);var pe="",Se=0;if(e.options.indentWithTabs)for(var xe=Math.floor(de/B);xe;--xe)Se+=B,pe+=" ";if(Se<de&&(pe+=j(de-Se)),pe!=te)return Ni(n,pe,Fe(t,0),Fe(t,te.length),"+input"),K.stateAfter=null,!0;for(var Me=0;Me<n.sel.ranges.length;Me++){var Ue=n.sel.ranges[Me];if(Ue.head.line==t&&Ue.head.ch<te.length){var je=Fe(t,te.length);Ba(n,Me,new kt(je,je));break}}}var Ir=null;function ra(e){Ir=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,Y=st(t),te=null;if(K&&r.ranges.length>1)if(Ir&&Ir.text.join(`
|
|
`)==t){if(r.ranges.length%Ir.text.length==0){te=[];for(var de=0;de<Ir.text.length;de++)te.push(E.splitLines(Ir.text[de]))}}else Y.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(te=k(Y,function(Ve){return[Ve]}));for(var pe=e.curOp.updateInput,Se=r.ranges.length-1;Se>=0;Se--){var xe=r.ranges[Se],Me=xe.from(),Ue=xe.to();xe.empty()&&(i&&i>0?Me=Fe(Me.line,Me.ch-i):e.state.overwrite&&!K?Ue=Fe(Ue.line,Math.min($e(E,Ue.line).text.length,Ue.ch+T(Y).length)):K&&Ir&&Ir.lineWise&&Ir.text.join(`
|
|
`)==Y.join(`
|
|
`)&&(Me=Ue=Fe(Me.line,0)));var je={from:Me,to:Ue,text:te?te[Se%te.length]:Y,origin:n||(K?"paste":e.state.cutIncoming>B?"cut":"+input")};Bi(e.doc,je),Zt(e,"inputRead",e,je)}t&&!K&&As(e,t),Mi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=pe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Cs(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&fr(t,function(){return za(t,i,0,null,"paste")}),!0}function As(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)continue;var 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($e(e.doc,n.head.line).text.slice(0,n.head.ch))&&(B=wn(e,n.head.line,"smart")));B&&Zt(e,"electricInput",e,n.head.line)}}function Ts(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var n=e.doc.sel.ranges[r].head.line,E={anchor:Fe(n,0),head:Fe(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"),S&&(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)&&zt(this,t[r])(this,n,B),oe(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,n){this.state.keyMaps[n?"push":"unshift"]($n(r))},removeKeyMap:function(r){for(var n=this.state.keyMaps,E=0;E<n.length;++E)if(n[E]==r||n[E].name==r)return n.splice(E,1),!0},addOverlay:ir(function(r,n){var E=r.token?r:e.getMode(this.options,r);if(E.startState)throw new Error("Overlays may not be stateful.");G(this.state.overlays,{mode:E,modeSpec:r,opaque:n&&n.opaque,priority:n&&n.priority||0},function(B){return B.priority}),this.state.modeGen++,sr(this)}),removeOverlay:ir(function(r){for(var n=this.state.overlays,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++,sr(this);return}}}),indentLine:ir(function(r,n,E){typeof n!="string"&&typeof n!="number"&&(n==null?n=this.options.smartIndent?"smart":"prev":n=n?"add":"subtract"),vr(this.doc,r)&&wn(this,r,n,E)}),indentSelection:ir(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&&Mi(this));else{var Y=K.from(),te=K.to(),de=Math.max(E,Y.line);E=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var pe=de;pe<E;++pe)wn(this,pe,r);var Se=this.doc.sel.ranges;Y.ch==0&&n.length==Se.length&&Se[B].from().ch>0&&Ba(this.doc,B,new kt(Y,Se[B].to()),Ce)}}}),getTokenAt:function(r,n){return kn(this,r,n)},getLineTokens:function(r,n){return kn(this,Fe(r),n,!0)},getTokenTypeAt:function(r){r=ft(this.doc,r);var n=ni(this,$e(this.doc,r.line)),E=0,B=(n.length-1)/2,K=r.ch,Y;if(K==0)Y=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{Y=n[te*2+2];break}}var de=Y?Y.indexOf("overlay "):-1;return de<0?Y:de==0?null:Y.slice(0,de-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 Y=0;Y<K[n].length;Y++){var te=B[K[n][Y]];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 de=0;de<B._global.length;de++){var pe=B._global[de];pe.pred(K,this)&&me(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),Ar(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=ft(this.doc,r):E=r?B.from():B.to(),Rr(this,E,n||"page")},charCoords:function(r,n){return ma(this,ft(this.doc,r),n||"page")},coordsChar:function(r,n){return r=lo(this,r,n||"page"),va(this,r.left,r.top)},lineAtHeight:function(r,n){return r=lo(this,{top:r,left:0},n||"page").top,wt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,n,E){var B=!1,K;if(typeof r=="number"){var Y=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>Y&&(r=Y,B=!0),K=$e(this.doc,r)}else K=r;return Un(this,K,{top:0,left:0},n||"page",E||B).top+(B?this.doc.height-kr(K):0)},defaultTextHeight:function(){return Ri(this.display)},defaultCharWidth:function(){return Li(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,E,B,K){var Y=this.display;r=Rr(this,ft(this.doc,r));var te=r.bottom,de=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),Y.sizer.appendChild(n),B=="over")te=r.top;else if(B=="above"||B=="near"){var pe=Math.max(Y.wrapper.clientHeight,this.doc.height),Se=Math.max(Y.sizer.clientWidth,Y.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),de+n.offsetWidth>Se&&(de=Se-n.offsetWidth)}n.style.top=te+"px",n.style.left=n.style.right="",K=="right"?(de=Y.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(K=="left"?de=0:K=="middle"&&(de=(Y.sizer.clientWidth-n.offsetWidth)/2),n.style.left=de+"px"),E&&Js(this,{left:de,top:te,right:de+n.offsetWidth,bottom:te+n.offsetHeight})},triggerOnKeyDown:ir(ps),triggerOnKeyPress:ir(gs),triggerOnKeyUp:ms,triggerOnMouseDown:ir(vs),execCommand:function(r){if(Sn.hasOwnProperty(r))return Sn[r].call(null,this)},triggerElectric:ir(function(r){As(this,r)}),findPosH:function(r,n,E,B){var K=1;n<0&&(K=-1,n=-n);for(var Y=ft(this.doc,r),te=0;te<n&&!(Y=Ka(this.doc,Y,K,E,B),Y.hitSide);++te);return Y},moveH:ir(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:ir(function(r,n){var E=this.doc.sel,B=this.doc;E.somethingSelected()?B.replaceSelection("",null,"+delete"):Wi(this,function(K){var Y=Ka(B,K.head,r,n,!1);return r<0?{from:Y,to:K.head}:{from:K.head,to:Y}})}),findPosV:function(r,n,E,B){var K=1,Y=B;n<0&&(K=-1,n=-n);for(var te=ft(this.doc,r),de=0;de<n;++de){var pe=Rr(this,te,"div");if(Y==null?Y=pe.left:pe.left=Y,te=ks(this,pe,K,E),te.hitSide)break}return te},moveV:ir(function(r,n){var E=this,B=this.doc,K=[],Y=!this.display.shift&&!B.extend&&B.sel.somethingSelected();if(B.extendSelectionsBy(function(de){if(Y)return r<0?de.from():de.to();var pe=Rr(E,de.head,"div");de.goalColumn!=null&&(pe.left=de.goalColumn),K.push(pe.left);var Se=ks(E,pe,r,n);return n=="page"&&de==B.sel.primary()&&Ta(E,ma(E,Se,"div").top-pe.top),Se},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=$e(n,r.line).text,B=r.ch,K=r.ch;if(E){var Y=this.getHelper(r,"wordChars");(r.sticky=="before"||K==E.length)&&B?--B:++K;for(var te=E.charAt(B),de=De(te,Y)?function(pe){return De(pe,Y)}:/\s/.test(te)?function(pe){return/\s/.test(pe)}:function(pe){return!/\s/.test(pe)&&!De(pe)};B>0&&de(E.charAt(B-1));)--B;for(;K<E.length&&de(E.charAt(K));)++K}return new kt(Fe(r.line,B),Fe(r.line,K))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?H(this.display.cursorDiv,"CodeMirror-overwrite"):f(this.display.cursorDiv,"CodeMirror-overwrite"),oe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==P()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ir(function(r,n){sn(this,r,n)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Or(this)-this.display.barHeight,width:r.scrollWidth-Or(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:ui(this)}},scrollIntoView:ir(function(r,n){r==null?(r={from:this.doc.sel.primary().head,to:null},n==null&&(n=this.options.cursorScrollMargin)):typeof r=="number"?r={from:Fe(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=n||0,r.from.line!=null?Zs(this,r):Eo(this,r.from,r.to,r.margin)}),setSize:ir(function(r,n){var E=this,B=function(Y){return typeof Y=="number"||/^\d+$/.test(String(Y))?Y+"px":Y};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(Y){if(Y.widgets){for(var te=0;te<Y.widgets.length;te++)if(Y.widgets[te].noHScroll){Qr(E,K,"widget");break}}++K}),this.curOp.forceUpdate=!0,oe(this,"refresh",this)}),operation:function(r){return fr(this,r)},startOperation:function(){return mi(this)},endOperation:function(){return gi(this)},refresh:ir(function(){var r=this.display.cachedTextHeight;sr(this),this.curOp.forceUpdate=!0,an(this),sn(this,this.doc.scrollLeft,this.doc.scrollTop),ka(this.display),(r==null||Math.abs(r-Ri(this.display))>.5||this.options.lineWrapping)&&xa(this),oe(this,"refresh",this)}),swapDoc:ir(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),Po(this,r),an(this),this.display.input.reset(),sn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Zt(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},se(e),e.registerHelper=function(r,n,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=$e(e,t.line),Y=n&&e.direction=="rtl"?-i:i;function te(){var et=t.line+Y;return et<e.first||et>=e.first+e.size?!1:(t=new Fe(et,t.ch,t.sticky),K=$e(e,et))}function de(et){var Qe;if(r=="codepoint"){var rt=K.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(rt)?Qe=null:Qe=new Fe(t.line,Math.max(0,Math.min(K.text.length,t.ch+i*(rt>=55296&&rt<56320?2:1))),-i)}else n?Qe=Pl(e.cm,K,t,i):Qe=Ua(K,t,i);if(Qe==null)if(!et&&te())t=Fa(n,e.cm,K,t.line,Y);else return!1;else t=Qe;return!0}if(r=="char"||r=="codepoint")de();else if(r=="column")de(!0);else if(r=="word"||r=="group")for(var pe=null,Se=r=="group",xe=e.cm&&e.cm.getHelper(t,"wordChars"),Me=!0;!(i<0&&!de(!Me));Me=!1){var Ue=K.text.charAt(t.ch)||`
|
|
`,je=De(Ue,xe)?"w":Se&&Ue==`
|
|
`?"n":!Se||/\s/.test(Ue)?null:"p";if(Se&&!Me&&!je&&(je="s"),pe&&pe!=je){i<0&&(i=1,de(),t.sticky="after");break}if(je&&(pe=je),i>0&&!de(!Me))break}var Ve=Jn(e,t,E,B,!0);return ri(E,Ve)&&(Ve.hitSide=!0),Ve}function ks(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),Y=Math.max(K-.5*Ri(e.display),3);B=(i>0?t.bottom:t.top)+i*Y}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 Rt=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};Rt.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 Y=K.target;Y;Y=Y.parentNode){if(Y==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Y.className))break}return!1}Ae(n,"paste",function(K){if(!E(K)||X(r,K)||Cs(K,r))return;U<=11&&setTimeout(zt(r,function(){return t.updateFromDOM()}),20)}),Ae(n,"compositionstart",function(K){t.composing={data:K.data,done:!1}}),Ae(n,"compositionupdate",function(K){t.composing||(t.composing={data:K.data,done:!1})}),Ae(n,"compositionend",function(K){t.composing&&(K.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ae(n,"touchstart",function(){return i.forceCompositionEnd()}),Ae(n,"input",function(){t.composing||t.readFromDOMSoon()});function B(K){if(!E(K)||X(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 Y=Ts(r);ra({lineWise:!0,text:Y.text}),K.type=="cut"&&r.operation(function(){r.setSelections(Y.ranges,0,Ce),r.replaceSelection("",null,"cut")})}else return;if(K.clipboardData){K.clipboardData.clearData();var te=Ir.text.join(`
|
|
`);if(K.clipboardData.setData("Text",te),K.clipboardData.getData("Text")==te){K.preventDefault();return}}var de=Ds(),pe=de.firstChild;r.display.lineSpace.insertBefore(de,r.display.lineSpace.firstChild),pe.value=Ir.text.join(`
|
|
`);var Se=document.activeElement;re(pe),setTimeout(function(){r.display.lineSpace.removeChild(de),Se.focus(),Se==n&&i.showPrimarySelection()},50)}Ae(n,"copy",B),Ae(n,"cut",B)},Rt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Rt.prototype.prepareSelection=function(){var e=mo(this.cm,!1);return e.focus=document.activeElement==this.div,e},Rt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Rt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Rt.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&&dt(ii(E,B),r)==0&&dt(Ei(E,B),n)==0)return;var K=t.display.view,Y=r.line>=t.display.viewFrom&&Rs(t,r)||{node:K[0].measure.map[2],offset:0},te=n.line<t.display.viewTo&&Rs(t,n);if(!te){var de=K[K.length-1].measure,pe=de.maps?de.maps[de.maps.length-1]:de.map;te={node:pe[pe.length-1],offset:pe[pe.length-2]-pe[pe.length-3]}}if(!Y||!te){e.removeAllRanges();return}var Se=e.rangeCount&&e.getRangeAt(0),xe;try{xe=m(Y.node,Y.offset,te.offset,te.node)}catch(Me){}xe&&(!R&&t.state.focused?(e.collapse(Y.node,Y.offset),xe.collapsed||(e.removeAllRanges(),e.addRange(xe))):(e.removeAllRanges(),e.addRange(xe)),Se&&e.anchorNode==null?e.addRange(Se):R&&this.startGracePeriod()),this.rememberSelection()},Rt.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)},Rt.prototype.showMultipleSelections=function(e){l(this.cm.display.cursorDiv,e.cursors),l(this.cm.display.selectionDiv,e.selection)},Rt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Rt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return b(this.div,t)},Rt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Rt.prototype.blur=function(){this.div.blur()},Rt.prototype.getField=function(){return this.div},Rt.prototype.supportsTouch=function(){return!0},Rt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():fr(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Rt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Rt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(h&&y&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=ia(t,e.anchorNode,e.anchorOffset),r=ia(t,e.focusNode,e.focusOffset);i&&r&&fr(t,function(){er(t.doc,Xr(i,r),Ce),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},Rt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),r=i.from(),n=i.to();if(r.ch==0&&r.line>e.firstLine()&&(r=Fe(r.line-1,$e(e.doc,r.line-1).length)),n.ch==$e(e.doc,n.line).text.length&&n.line<e.lastLine()&&(n=Fe(n.line+1,0)),r.line<t.viewFrom||n.line>t.viewTo-1)return!1;var E,B,K;r.line==t.viewFrom||(E=ci(e,r.line))==0?(B=pt(t.view[0].line),K=t.view[0].node):(B=pt(t.view[E].line),K=t.view[E-1].node.nextSibling);var Y=ci(e,n.line),te,de;if(Y==t.view.length-1?(te=t.viewTo-1,de=t.lineDiv.lastChild):(te=pt(t.view[Y+1].line)-1,de=t.view[Y+1].node.previousSibling),!K)return!1;for(var pe=e.doc.splitLines(tu(e,K,de,B,te)),Se=Ct(e.doc,Fe(B,0),Fe(te,$e(e.doc,te).text.length));pe.length>1&&Se.length>1;)if(T(pe)==T(Se))pe.pop(),Se.pop(),te--;else if(pe[0]==Se[0])pe.shift(),Se.shift(),B++;else break;for(var xe=0,Me=0,Ue=pe[0],je=Se[0],Ve=Math.min(Ue.length,je.length);xe<Ve&&Ue.charCodeAt(xe)==je.charCodeAt(xe);)++xe;for(var et=T(pe),Qe=T(Se),rt=Math.min(et.length-(pe.length==1?xe:0),Qe.length-(Se.length==1?xe:0));Me<rt&&et.charCodeAt(et.length-Me-1)==Qe.charCodeAt(Qe.length-Me-1);)++Me;if(pe.length==1&&Se.length==1&&B==r.line)for(;xe&&xe>r.ch&&et.charCodeAt(et.length-Me-1)==Qe.charCodeAt(Qe.length-Me-1);)xe--,Me++;pe[pe.length-1]=et.slice(0,et.length-Me).replace(/^\u200b+/,""),pe[0]=pe[0].slice(xe).replace(/\u200b+$/,"");var ht=Fe(B,xe),lt=Fe(te,Se.length?T(Se).length-Me:0);if(pe.length>1||pe[0]||dt(ht,lt))return Ni(e.doc,pe,ht,lt,"+input"),!0},Rt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Rt.prototype.reset=function(){this.forceCompositionEnd()},Rt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Rt.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)},Rt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&fr(this.cm,function(){return sr(e.cm)})},Rt.prototype.setUneditable=function(e){e.contentEditable="false"},Rt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||zt(this.cm,za)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Rt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Rt.prototype.onContextMenu=function(){},Rt.prototype.resetPosition=function(){},Rt.prototype.needsContentAttribute=!0;function Rs(e,t){var i=fa(e,t.line);if(!i||i.hidden)return null;var r=$e(e.doc,t.line),n=eo(i,r,t.line),E=qe(r,e.doc.direction),B="left";if(E){var K=Xe(E,t.ch);B=K%2?"right":"left"}var Y=io(n.map,t.ch,B);return Y.offset=Y.collapse=="right"?Y.end:Y.start,Y}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(),Y=!1;function te(xe){return function(Me){return Me.id==xe}}function de(){B&&(E+=K,Y&&(E+=K),B=Y=!1)}function pe(xe){xe&&(de(),E+=xe)}function Se(xe){if(xe.nodeType==1){var Me=xe.getAttribute("cm-text");if(Me){pe(Me);return}var Ue=xe.getAttribute("cm-marker"),je;if(Ue){var Ve=e.findMarks(Fe(r,0),Fe(n+1,0),te(+Ue));Ve.length&&(je=Ve[0].find(0))&&pe(Ct(e.doc,je.from,je.to).join(K));return}if(xe.getAttribute("contenteditable")=="false")return;var et=/^(pre|div|p|li|table|br)$/i.test(xe.nodeName);if(!/^br$/i.test(xe.nodeName)&&xe.textContent.length==0)return;et&&de();for(var Qe=0;Qe<xe.childNodes.length;Qe++)Se(xe.childNodes[Qe]);/^(pre|p)$/i.test(xe.nodeName)&&(Y=!0),et&&(B=!0)}else xe.nodeType==3&&pe(xe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Se(t),t==i);)t=t.nextSibling,Y=!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(Fe(e.display.viewTo-1)),!0);t=null,i=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var n=0;n<e.display.view.length;n++){var 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||!b(r,t))return Hi(Fe(pt(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(Fe(pt(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 Y=e.measure,te=Y.maps;function de(je,Ve,et){for(var Qe=-1;Qe<(te?te.length:0);Qe++)for(var rt=Qe<0?Y.map:te[Qe],ht=0;ht<rt.length;ht+=3){var lt=rt[ht+2];if(lt==je||lt==Ve){var gt=pt(Qe<0?e.line:e.rest[Qe]),It=rt[ht]+et;return(et<0||lt!=je)&&(It=rt[ht+(et?1:0)]),Fe(gt,It)}}}var pe=de(B,K,i);if(pe)return Hi(pe,n);for(var Se=K.nextSibling,xe=B?B.nodeValue.length-i:0;Se;Se=Se.nextSibling){if(pe=de(Se,Se.firstChild,0),pe)return Hi(Fe(pe.line,pe.ch-xe),n);xe+=Se.textContent.length}for(var Me=K.previousSibling,Ue=i;Me;Me=Me.previousSibling){if(pe=de(Me,Me.firstChild,-1),pe)return Hi(Fe(pe.line,pe.ch+Ue),n);Ue+=Me.textContent.length}}var Ut=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ce,this.hasSelection=!1,this.composing=null};Ut.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var n=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),S&&(n.style.width="0px"),Ae(n,"input",function(){W&&U>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Ae(n,"paste",function(B){if(X(r,B)||Cs(B,r))return;r.state.pasteIncoming=+new Date,i.fastPoll()});function E(B){if(X(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,Ce):(i.prevInput="",n.value=K.text.join(`
|
|
`),re(n))}else return;B.type=="cut"&&(r.state.cutIncoming=+new Date)}Ae(n,"cut",E),Ae(n,"copy",E),Ae(e.scroller,"paste",function(B){if(jr(e,B)||X(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)}),Ae(e.lineSpace,"selectstart",function(B){jr(e,B)||q(B)}),Ae(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"})}}),Ae(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Ut.prototype.createField=function(e){this.wrapper=Ds(),this.textarea=this.wrapper.firstChild},Ut.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ut.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=mo(e);if(e.options.moveInputWithCursor){var n=Rr(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},Ut.prototype.showSelection=function(e){var t=this.cm,i=t.display;l(i.cursorDiv,e.cursors),l(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ut.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&re(this.textarea),W&&U>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",W&&U>=9&&(this.hasSelection=null))},Ut.prototype.getField=function(){return this.textarea},Ut.prototype.supportsTouch=function(){return!1},Ut.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!o||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ut.prototype.blur=function(){this.textarea.blur()},Ut.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ut.prototype.receivedFocus=function(){this.slowPoll()},Ut.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ut.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Ut.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||nt(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(W&&U>=9&&this.hasSelection===n||s&&/[\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 fr(t,function(){za(t,n.slice(B),r.length-B,null,e.composing?"*compose":null),n.length>1e3||n.indexOf(`
|
|
`)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ut.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ut.prototype.onKeyPress=function(){W&&U>=9&&(this.hasSelection=null),this.fastPoll()},Ut.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var E=di(i,e),B=r.scroller.scrollTop;if(!E||C)return;var K=i.options.resetSelectionOnContextMenu;K&&i.doc.sel.contains(E)==-1&&zt(i,er)(i.doc,Xr(E),Ce);var Y=n.style.cssText,te=t.wrapper.style.cssText,de=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-de.top-5)+"px; left: "+(e.clientX-de.left-5)+`px;
|
|
z-index: 1000; background: `+(W?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var pe;O&&(pe=window.scrollY),r.input.focus(),O&&window.scrollTo(null,pe),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=xe,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function Se(){if(n.selectionStart!=null){var Ue=i.somethingSelected(),je="\u200B"+(Ue?n.value:"");n.value="\u21DA",n.value=je,t.prevInput=Ue?"":"\u200B",n.selectionStart=1,n.selectionEnd=je.length,r.selForContextMenu=i.doc.sel}}function xe(){if(t.contextMenuPending!=xe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,n.style.cssText=Y,W&&U<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=B),n.selectionStart!=null){(!W||W&&U<9)&&Se();var Ue=0,je=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?zt(i,Qo)(i):Ue++<10?r.detectingSelectAll=setTimeout(je,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(je,200)}}if(W&&U>=9&&Se(),D){he(e);var Me=function(){Ze(window,"mouseup",Me),setTimeout(xe,20)};Ae(window,"mouseup",Me)}else setTimeout(xe,50)},Ut.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ut.prototype.setUneditable=function(){},Ut.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?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&&(Ae(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(Y){}}t.finishInit=function(Y){Y.save=r,Y.getTextArea=function(){return e},Y.toTextArea=function(){Y.toTextArea=isNaN,r(),e.parentNode.removeChild(Y.getWrapperElement()),e.style.display="",e.form&&(Ze(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var K=Pt(function(Y){return e.parentNode.insertBefore(Y,e.nextSibling)},t);return K}function nu(e){e.off=Ze,e.on=Ae,e.wheelEventPixels=dl,e.Doc=lr,e.splitLines=st,e.countColumn=ae,e.findColumn=we,e.isWordChar=Ee,e.Pass=Be,e.signal=oe,e.Line=li,e.changeEnd=Jr,e.scrollbarModel=Co,e.Pos=Fe,e.cmpPos=dt,e.modes=Mt,e.mimeModes=xt,e.resolveMode=Yt,e.getMode=gr,e.modeExtensions=cr,e.extendMode=zr,e.copyState=Xt,e.startState=ti,e.innerMode=Br,e.commands=Sn,e.keyMap=Hr,e.keyName=us,e.isModifierKey=ss,e.lookupKey=Fi,e.normalizeKeyMap=Ol,e.StringStream=Ot,e.SharedTextMarker=bn,e.TextMarker=qr,e.LineWidget=yn,e.e_preventDefault=q,e.e_stopPropagation=ie,e.e_stop=he,e.addClass=H,e.contains=b,e.rmClass=f,e.keyNames=$r}Xl(Pt),$l(Pt);var au="iter insert remove copy getEditor constructor".split(" ");for(var na in lr.prototype)lr.prototype.hasOwnProperty(na)&&me(au,na)<0&&(Pt.prototype[na]=function(e){return function(){return e.apply(this.doc,arguments)}}(lr.prototype[na]));return se(lr),Pt.inputStyles={textarea:Ut,contenteditable:Rt},Pt.defineMode=function(e){!Pt.defaults.mode&&e!="null"&&(Pt.defaults.mode=e),mr.apply(this,arguments)},Pt.defineMIME=Cr,Pt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Pt.defineMIME("text/plain","null"),Pt.defineExtension=function(e,t){Pt.prototype[e]=t},Pt.defineDocExtension=function(e,t){lr.prototype[e]=t},Pt.fromTextArea=iu,nu(Pt),Pt.version="5.58.2",Pt})},W6BS:function(_e,Oe){_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+FoWC7Yl11curQpFVCoyJQsvDThP6crNdVldi0KLcwogyzJGssVrxYWXAOWzwWg84eXd92UByoK0WHEJqBCA4oC6ChstYHRJIW6lZHWQlsoYQH6rypyOLZ5Xuahx3NIi1TAvLBIcHIlUw8rfcWFLFmzhmPBUxi0NKIRdAVi5qmPAL88LrS9z/AigmHBpCcOaCIUA1BVj4ma6LCi1FkjLBZRoVRrLR9piXjhkysI2mqJxhY2lQU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7RbbbrdrgElYE5Aua57u4962etfNYAvx7YISJIkxrXFxdvtlnFJW+Yiy+MnecrtIn/VAN7uQl6t618D+GpZ9md139cY/FlZ+tV6zmsMvlqW/Vnd9/8CAe3hZpCQX/4AAAAASUVORK5CYII="},Xsq0:function(_e,Oe,ee){_e.exports=ee.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(_e,Oe,ee){"use strict";ee.r(Oe),ee.d(Oe,"ResizableTextArea",function(){return me});var fe=ee("wx14"),Z=ee("1OyB"),R=ee("vuIU"),Q=ee("Ji7U"),_=ee("LK+K"),L=ee("q1tI"),W=ee("VTBJ"),U=ee("rePB"),O=ee("Zm9Q"),M=ee("Kwbf"),y=ee("c+Xe"),C=ee("m+aA"),I=ee("bdgK"),w=new Map;function A(Ce){Ce.forEach(function(Le){var Te,we=Le.target;(Te=w.get(we))===null||Te===void 0||Te.forEach(function(ve){return ve(we)})})}var S=new I.default(A),h=null,o=null;function s(Ce,Le){w.has(Ce)||(w.set(Ce,new Set),S.observe(Ce)),w.get(Ce).add(Le)}function u(Ce,Le){w.has(Ce)&&(w.get(Ce).delete(Le),w.get(Ce).size||(S.unobserve(Ce),w.delete(Ce)))}var x=function(Ce){Object(Q.a)(Te,Ce);var Le=Object(_.a)(Te);function Te(){return Object(Z.a)(this,Te),Le.apply(this,arguments)}return Object(R.a)(Te,[{key:"render",value:function(){return this.props.children}}]),Te}(L.Component),c=L.createContext(null);function p(Ce){var Le=Ce.children,Te=Ce.onBatchResize,we=L.useRef(0),ve=L.useRef([]),j=L.useContext(c),T=L.useCallback(function(k,G,$){we.current+=1;var N=we.current;ve.current.push({size:k,element:G,data:$}),Promise.resolve().then(function(){N===we.current&&(Te==null||Te(ve.current),ve.current=[])}),j==null||j(k,G,$)},[Te,j]);return L.createElement(c.Provider,{value:T},Le)}function D(Ce){var Le=Ce.children,Te=Ce.disabled,we=L.useRef(null),ve=L.useRef(null),j=L.useContext(c),T=L.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),k=L.isValidElement(Le)&&Object(y.c)(Le),G=k?Le.ref:null,$=L.useMemo(function(){return Object(y.a)(G,we)},[G,we]),N=L.useRef(Ce);N.current=Ce;var ue=L.useCallback(function(Ee){var De=N.current,Ne=De.onResize,Re=De.data,Ie=Ee.getBoundingClientRect(),Pe=Ie.width,Ge=Ie.height,Ke=Ee.offsetWidth,Ye=Ee.offsetHeight,Xe=Math.floor(Pe),at=Math.floor(Ge);if(T.current.width!==Xe||T.current.height!==at||T.current.offsetWidth!==Ke||T.current.offsetHeight!==Ye){var qe={width:Xe,height:at,offsetWidth:Ke,offsetHeight:Ye};T.current=qe;var ze=Ke===Math.round(Pe)?Pe:Ke,Ae=Ye===Math.round(Ge)?Ge:Ye,Je=Object(W.a)(Object(W.a)({},qe),{},{offsetWidth:ze,offsetHeight:Ae});j==null||j(Je,Ee,Re),Ne&&Promise.resolve().then(function(){Ne(Je,Ee)})}},[]);return L.useEffect(function(){var Ee=Object(C.a)(we.current)||Object(C.a)(ve.current);return Ee&&!Te&&s(Ee,ue),function(){return u(Ee,ue)}},[we.current,Te]),L.createElement(x,{ref:ve},k?L.cloneElement(Le,{ref:$}):Le)}var v="rc-observer-key";function f(Ce){var Le=Ce.children,Te=Object(O.a)(Le);return Te.map(function(we,ve){var j=(we==null?void 0:we.key)||"".concat(v,"-").concat(ve);return L.createElement(D,Object(fe.a)({},Ce,{key:j}),we)})}f.Collection=p;var d=f,l=ee("bT9E"),a=ee("TSYQ"),g=ee.n(a),m=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,b=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],P={},H;function V(Ce){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=Ce.getAttribute("id")||Ce.getAttribute("data-reactid")||Ce.getAttribute("name");if(Le&&P[Te])return P[Te];var we=window.getComputedStyle(Ce),ve=we.getPropertyValue("box-sizing")||we.getPropertyValue("-moz-box-sizing")||we.getPropertyValue("-webkit-box-sizing"),j=parseFloat(we.getPropertyValue("padding-bottom"))+parseFloat(we.getPropertyValue("padding-top")),T=parseFloat(we.getPropertyValue("border-bottom-width"))+parseFloat(we.getPropertyValue("border-top-width")),k=b.map(function($){return"".concat($,":").concat(we.getPropertyValue($))}).join(";"),G={sizingStyle:k,paddingSize:j,borderSize:T,boxSizing:ve};return Le&&Te&&(P[Te]=G),G}function re(Ce){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;H||(H=document.createElement("textarea"),H.setAttribute("tab-index","-1"),H.setAttribute("aria-hidden","true"),document.body.appendChild(H)),Ce.getAttribute("wrap")?H.setAttribute("wrap",Ce.getAttribute("wrap")):H.removeAttribute("wrap");var ve=V(Ce,Le),j=ve.paddingSize,T=ve.borderSize,k=ve.boxSizing,G=ve.sizingStyle;H.setAttribute("style","".concat(G,";").concat(m)),H.value=Ce.value||Ce.placeholder||"";var $=Number.MIN_SAFE_INTEGER,N=Number.MAX_SAFE_INTEGER,ue=H.scrollHeight,Ee;if(k==="border-box"?ue+=T:k==="content-box"&&(ue-=j),Te!==null||we!==null){H.value=" ";var De=H.scrollHeight-j;Te!==null&&($=De*Te,k==="border-box"&&($=$+j+T),ue=Math.max($,ue)),we!==null&&(N=De*we,k==="border-box"&&(N=N+j+T),Ee=ue>N?"":"hidden",ue=Math.min(N,ue))}return{height:ue,minHeight:$,maxHeight:N,overflowY:Ee,resize:"none"}}var z=ee("Gytx"),F=ee.n(z),ae;(function(Ce){Ce[Ce.NONE=0]="NONE",Ce[Ce.RESIZING=1]="RESIZING",Ce[Ce.RESIZED=2]="RESIZED"})(ae||(ae={}));var ce=function(Ce){Object(Q.a)(Te,Ce);var Le=Object(_.a)(Te);function Te(we){var ve;return Object(Z.a)(this,Te),ve=Le.call(this,we),ve.nextFrameActionId=void 0,ve.resizeFrameId=void 0,ve.textArea=void 0,ve.saveTextArea=function(j){ve.textArea=j},ve.handleResize=function(j){var T=ve.state.resizeStatus,k=ve.props,G=k.autoSize,$=k.onResize;if(T!==ae.NONE)return;typeof $=="function"&&$(j),G&&ve.resizeOnNextFrame()},ve.resizeOnNextFrame=function(){cancelAnimationFrame(ve.nextFrameActionId),ve.nextFrameActionId=requestAnimationFrame(ve.resizeTextarea)},ve.resizeTextarea=function(){var j=ve.props.autoSize;if(!j||!ve.textArea)return;var T=j.minRows,k=j.maxRows,G=re(ve.textArea,!1,T,k);ve.setState({textareaStyles:G,resizeStatus:ae.RESIZING},function(){cancelAnimationFrame(ve.resizeFrameId),ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:ae.RESIZED},function(){ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:ae.NONE}),ve.fixFirefoxAutoScroll()})})})})},ve.renderTextArea=function(){var j=ve.props,T=j.prefixCls,k=T===void 0?"rc-textarea":T,G=j.autoSize,$=j.onResize,N=j.className,ue=j.disabled,Ee=ve.state,De=Ee.textareaStyles,Ne=Ee.resizeStatus,Re=Object(l.a)(ve.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ie=g()(k,N,Object(U.a)({},"".concat(k,"-disabled"),ue));"value"in Re&&(Re.value=Re.value||"");var Pe=Object(W.a)(Object(W.a)(Object(W.a)({},ve.props.style),De),Ne===ae.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return L.createElement(d,{onResize:ve.handleResize,disabled:!(G||$)},L.createElement("textarea",Object(fe.a)({},Re,{className:Ie,style:Pe,ref:ve.saveTextArea})))},ve.state={textareaStyles:{},resizeStatus:ae.NONE},ve}return Object(R.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,j=this.textArea.selectionEnd;this.textArea.setSelectionRange(ve,j)}}catch(T){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Te}(L.Component),me=ce,be=function(Ce){Object(Q.a)(Te,Ce);var Le=Object(_.a)(Te);function Te(we){var ve;Object(Z.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 k=ve.props.onChange;ve.setValue(T.target.value,function(){ve.resizableTextArea.resizeTextarea()}),k&&k(T)},ve.handleKeyDown=function(T){var k=ve.props,G=k.onPressEnter,$=k.onKeyDown;T.keyCode===13&&G&&G(T),$&&$(T)};var j=typeof we.value=="undefined"||we.value===null?we.defaultValue:we.value;return ve.state={value:j},ve}return Object(R.a)(Te,[{key:"setValue",value:function(ve,j){"value"in this.props||this.setState({value:ve},j)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return L.createElement(me,Object(fe.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}(L.Component),Be=Oe.default=be},bT9E:function(_e,Oe,ee){"use strict";ee.d(Oe,"a",function(){return Z});var fe=ee("VTBJ");function Z(R,Q){var _=Object(fe.a)({},R);return Array.isArray(Q)&&Q.forEach(function(L){delete _[L]}),_}},c5Ni:function(_e,Oe,ee){},cRFk:function(_e,Oe,ee){_e.exports=ee.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(_e,Oe,ee){_e.exports=ee.p+"static/choose.4ad1045f.svg"},dNgX:function(_e,Oe,ee){"use strict";ee.r(Oe);var fe=ee("14J3"),Z=ee("BMrR"),R=ee("jCWc"),Q=ee("kPKH"),_=ee("OaEy"),L=ee("2fM7"),W=ee("7Kak"),U=ee("9yH6"),O=ee("5NDa"),M=ee("5rEg"),y=ee("miYZ"),C=ee("tsqr"),I=ee("9og8"),w=ee("k1fw"),A=ee("y8nQ"),S=ee("Vl3Y"),h=ee("tJVT"),o=ee("PpiC"),s=ee("WmNS"),u=ee.n(s),x=ee("q1tI"),c=ee.n(x),p=ee("9kvl"),D=ee("Ot1p"),v=ee("HBuW"),f=ee("S3tb"),d=ee.n(f),l=ee("9ZNV"),a=ee("CJF0"),g=ee("2RCv"),m={1:[100,200],2:[300,400,500,600],3:[700,800,900,1e3]},b=function(H){var V,re,z,F=H.shixunsDetail,ae=H.dispatch,ce=H.loading,me=H.match,be=Object(o.a)(H,["shixunsDetail","dispatch","loading","match"]),Be=S.a.useForm(),Ce=Object(h.a)(Be,1),Le=Ce[0],Te=Object(x.useState)({}),we=Object(h.a)(Te,2),ve=we[0],j=we[1],T=Object(x.useState)([100,200]),k=Object(h.a)(T,2),G=k[0],$=k[1],N=F.challengesNew,ue=Object(x.useState)(),Ee=Object(h.a)(ue,2),De=Ee[0],Ne=Ee[1],Re=Object(x.useState)(),Ie=Object(h.a)(Re,2),Pe=Ie[0],Ge=Ie[1];Object(x.useEffect)(function(){return ae({type:"globalSetting/footerToggle",payload:!1}),function(){ae({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(x.useEffect)(function(){me.params.challengesId?(Ge(!0),Ke()):(Ge(!1),ae({type:"shixunsDetail/getChallengesNew",payload:Object(w.a)({},me.params)}))},[me.params]);var Ke=function(){var ze=Object(I.a)(u.a.mark(function Ae(){var Je;return u.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(v.J)({id:me.params.id,challengeId:me.params.challengesId,tab:0});case 2:Je=oe.sent,Je&&(Ne(Je),Ye(Je));case 4:case"end":return oe.stop()}},Ae)}));return function(){return ze.apply(this,arguments)}}(),Ye=function(Ae){var Je={subject:Ae.name,difficulty:Ae.difficulty,score:Ae.score,challenge_tag:Ae.tags,task_pass:Ae.task_pass},Ze=m[Ae.difficulty];$(Ze),Le.setFieldsValue(Object(w.a)({},Je)),j(Object(w.a)({},Je))},Xe=function(Ae){var Je=m[Ae],Ze=Je==null?void 0:Je[0];$(Je),Le.setFieldsValue({score:Ze}),j(Object(w.a)(Object(w.a)({},Le.getFieldsValue()),{score:Ze}))},at=function(Ae,Je){j(Object(w.a)({},Le.getFieldsValue())),"difficulty"in Ae&&Xe(Ae.difficulty)},qe=function(){var ze=Object(I.a)(u.a.mark(function Ae(){var Je,Ze,oe,X,J,ne=arguments;return u.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:if(Ze=ne.length>0&&ne[0]!==void 0?ne[0]:{},!(!Pe&&((Je=F.detail)===null||Je===void 0?void 0:Je.shixun_status)===2)){q.next=4;break}return C.b.info("\u8BE5\u5B9E\u8BAD\u5DF2\u7ECF\u53D1\u5E03\u4E0D\u80FD\u65B0\u5EFA"),q.abrupt("return");case 4:if(!Pe){q.next=10;break}return q.next=7,Object(v.Ob)(Object(w.a)(Object(w.a)({},me.params),{},{tab:0,challenge:Object(w.a)({},Ze),challenge_tag:Ze.challenge_tag}));case 7:return oe=q.sent,oe&&p.d.replace("/shixuns/".concat(me.params.id,"/challenges/").concat(me.params.challengesId,"/tab=2")),q.abrupt("return");case 10:return X=Object(w.a)({},ve),X.identifier=me.params.id,X.st=0,q.next=15,Object(v.b)(Object(w.a)({},X));case 15:J=q.sent,J.status===1&&be.history.replace("/shixuns/".concat(me.params.id,"/challenges/").concat(J.challenge_id,"/tab=2"));case 17:case"end":return q.stop()}},Ae)}));return function(){return ze.apply(this,arguments)}}();return c.a.createElement("section",{className:d.a.bg},c.a.createElement(a.a,{data:De||N,title:"\u5B9E\u8DF5\u9898"}),c.a.createElement(S.a,{form:Le,className:d.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:at,onFinish:qe},c.a.createElement("aside",{className:["bg-white",d.a.navBar,d.a.flexRow].join(" ")},c.a.createElement("li",{className:"".concat(d.a.active," current")},c.a.createElement("a",null,"1\u3001\u672C\u5173\u4EFB\u52A1")),Pe&&c.a.createElement(c.a.Fragment,null,c.a.createElement("li",{className:"current"},c.a.createElement("a",{onClick:function(){p.d.push("/shixuns/".concat(me.params.id,"/challenges/").concat(me.params.challengesId,"/tab=2"))}},"2\u3001\u8BC4\u6D4B\u8BBE\u7F6E")),c.a.createElement("li",{className:"current"},c.a.createElement("a",{onClick:function(){p.d.push("/shixuns/".concat(me.params.id,"/challenges/").concat(me.params.challengesId,"/tab=3"))}},"3\u3001\u53C2\u8003\u7B54\u6848")),c.a.createElement("li",{className:"current"},c.a.createElement("a",{onClick:function(){p.d.push("/shixuns/".concat(me.params.id,"/challenges/").concat(me.params.challengesId,"/tab=4"))}},"4\u3001\u5173\u5361\u6392\u884C\u699C")))),c.a.createElement("div",{className:d.a.fieldWrap},c.a.createElement(S.a.Item,{name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},c.a.createElement(M.a,{maxLength:60,suffix:"".concat(((V=ve.subject)===null||V===void 0?void 0:V.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),c.a.createElement("div",{className:d.a.mdWrap},c.a.createElement(S.a.Item,{name:"task_pass",label:"\u8FC7\u5173\u4EFB\u52A1:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u8FC7\u5173\u4EFB\u52A1\u7B80\u4ECB\u6700\u5927\u9650\u523635000\u4E2A\u5B57\u7B26"}]},c.a.createElement(D.a,{watch:!0,defaultValue:Pe?De==null?void 0:De.task_pass:N.task_pass_default})),c.a.createElement(S.a.Item,{name:"difficulty",label:"\u96BE\u5EA6\u7CFB\u6570:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6\u7CFB\u6570"}]},c.a.createElement(U.a.Group,{disabled:((re=F.detail)===null||re===void 0?void 0:re.shixun_status)===2},c.a.createElement(U.a,{value:1},"\u7B80\u5355"),c.a.createElement(U.a,{value:2},"\u4E2D\u7B49"),c.a.createElement(U.a,{value:3},"\u56F0\u96BE"))),c.a.createElement(Z.a,null,c.a.createElement(Q.a,null,c.a.createElement(S.a.Item,{name:"score",label:"\u5956\u52B1\u7ECF\u9A8C\u503C:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5956\u52B1\u7ECF\u9A8C\u503C"}]},c.a.createElement(L.a,{disabled:((z=F.detail)===null||z===void 0?void 0:z.shixun_status)===2},G==null?void 0:G.map(function(ze){return c.a.createElement(L.a.Option,{value:ze},ze)})))),c.a.createElement(Q.a,{flex:1},c.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",c.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"))),c.a.createElement(S.a.Item,{name:"challenge_tag",label:c.a.createElement("div",null,"\u6280\u80FD\u6807\u7B7E"," ",c.a.createElement("span",{className:"pl20 font12 c-light-black"},"\u5B66\u5458\u7B54\u9898\u6B63\u786E\u5C06\u83B7\u5F97\u6280\u80FD\uFF0C\u5426\u5219\u4E0D\u80FD\u83B7\u5F97\u6280\u80FD\uFF08\u56DE\u8F66\u6DFB\u52A0\u6807\u7B7E\uFF09")),rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6280\u80FD\u6807\u7B7E"}]},c.a.createElement(g.a,{placeholder:"\u6DFB\u52A0\u6807\u7B7E",style:{width:"260px"},InputRight:c.a.createElement("span",{className:"ml5"},"(\u56DE\u8F66\u6DFB\u52A0\u6807\u7B7E)")}))),c.a.createElement(S.a.Item,{noStyle:!0},c.a.createElement(l.a,{okButtonProps:{htmlType:"submit"},onCancel:function(){return p.d.push("/shixuns/".concat(me.params.id,"/challenges"))}}))))};Oe.default=Object(p.a)(function(P){var H=P.shixunsDetail,V=P.newCourse,re=P.loading,z=P.globalSetting;return{shixunsDetail:H,newCourse:V,globalSetting:z,loading:re.effects}})(b)},dejd:function(_e,Oe,ee){},djh8:function(_e,Oe,ee){_e.exports=ee.p+"static/qrCode.d852fdfc.png"},dmUQ:function(_e,Oe,ee){"use strict";var fe=ee("Ff2n"),Z=ee("rePB"),R=ee("1OyB"),Q=ee("vuIU"),_=ee("Ji7U"),L=ee("md7G"),W=ee("foSv"),U=ee("q1tI"),O=ee.n(U),M=ee("TSYQ"),y=ee.n(M),C=ee("4IlW");function I(l,a){var g=Object.keys(l);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(l);a&&(m=m.filter(function(b){return Object.getOwnPropertyDescriptor(l,b).enumerable})),g.push.apply(g,m)}return g}function w(l){for(var a=1;a<arguments.length;a++){var g=arguments[a]!=null?arguments[a]:{};a%2?I(Object(g),!0).forEach(function(m){Object(Z.a)(l,m,g[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(g)):I(Object(g)).forEach(function(m){Object.defineProperty(l,m,Object.getOwnPropertyDescriptor(g,m))})}return l}function A(l){var a=S();return function(){var m=Object(W.a)(l),b;if(a){var P=Object(W.a)(this).constructor;b=Reflect.construct(m,arguments,P)}else b=m.apply(this,arguments);return Object(L.a)(this,b)}}function S(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(l){return!1}}function h(){}function o(l){l.preventDefault()}var s=function(a){return a.replace(/[^\w.-]+/g,"")},u=200,x=600,c=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,p=function(a){return a!=null},D=function(a,g){return g===a||typeof g=="number"&&typeof a=="number"&&isNaN(g)&&isNaN(a)},v=function(l){Object(_.a)(g,l);var a=A(g);function g(m){var b;Object(R.a)(this,g),b=a.call(this,m),b.onKeyDown=function(V){var re=b.props,z=re.onKeyDown,F=re.onPressEnter;if(V.keyCode===C.a.UP){var ae=b.getRatio(V);b.up(V,ae,null),b.stop()}else if(V.keyCode===C.a.DOWN){var ce=b.getRatio(V);b.down(V,ce,null),b.stop()}else V.keyCode===C.a.ENTER&&F&&F(V);if(b.recordCursorPosition(),b.lastKeyCode=V.keyCode,z){for(var me=arguments.length,be=new Array(me>1?me-1:0),Be=1;Be<me;Be++)be[Be-1]=arguments[Be];z.apply(void 0,[V].concat(be))}},b.onKeyUp=function(V){var re=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),re){for(var z=arguments.length,F=new Array(z>1?z-1:0),ae=1;ae<z;ae++)F[ae-1]=arguments[ae];re.apply(void 0,[V].concat(F))}},b.onChange=function(V){var re=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(V)),b.setState({inputValue:b.rawInput}),re(b.toNumber(b.rawInput))},b.onMouseUp=function(){var V=b.props.onMouseUp;b.recordCursorPosition(),V&&V.apply(void 0,arguments)},b.onFocus=function(){var V;b.setState({focused:!0}),(V=b.props).onFocus.apply(V,arguments)},b.onBlur=function(){var V=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var re=b.getCurrentValidValue(b.state.inputValue),z=b.setValue(re,h);if(V){var F=b.input.value,ae=b.getInputDisplayValue({focus:!1,value:z});b.input.value=ae&&Number(ae),V.apply(void 0,arguments),b.input.value=F}},b.getRatio=function(V){var re=1;return V.metaKey||V.ctrlKey?re=.1:V.shiftKey&&(re=10),re},b.getFullNum=function(V){return isNaN(V)?V:/e/i.test(String(V))?Number(V).toFixed(18).replace(/\.?0+$/,""):V},b.getPrecision=function(V){if(p(b.props.precision))return b.props.precision;var re=String(V);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},b.getInputDisplayValue=function(V){var re=V||b.state,z=re.focused,F=re.inputValue,ae=re.value,ce;z?ce=F:ce=b.toPrecisionAsStep(ae),ce==null&&(ce="");var me=b.formatWrapper(ce);return p(b.props.decimalSeparator)&&(me=me.toString().replace(".",b.props.decimalSeparator)),me},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(V){}},b.restoreByAfter=function(V){if(V===void 0)return!1;var re=b.input.value,z=re.lastIndexOf(V);if(z===-1)return!1;var F=b.cursorBefore.length;return b.lastKeyCode===C.a.DELETE&&b.cursorBefore.charAt(F-1)===V[0]?(b.fixCaret(F,F),!0):z+V.length===re.length?(b.fixCaret(z,z),!0):!1},b.partRestoreByAfter=function(V){return V===void 0?!1:Array.prototype.some.call(V,function(re,z){var F=V.substring(z);return b.restoreByAfter(F)})},b.isNotCompleteNumber=function(V){return isNaN(V)||V===""||V===null||V&&V.toString().indexOf(".")===V.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(V,re,z){b.pressingUpOrDown=!0,b.step("down",V,re,z)},b.up=function(V,re,z){b.pressingUpOrDown=!0,b.step("up",V,re,z)},b.saveInput=function(V){b.input=V};var P=m.value;P===void 0&&(P=m.defaultValue),b.state={focused:m.autoFocus};var H=b.getValidValue(b.toNumber(P));return b.state=w(w({},b.state),{},{inputValue:b.toPrecisionAsStep(H),value:H}),b}return Object(Q.a)(g,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var P=this.props,H=P.value,V=P.onChange,re=P.max,z=P.min,F=this.state.focused;if(b){if(!D(b.value,H)||!D(b.max,re)||!D(b.min,z)){var ae=F?H:this.getValidValue(H),ce;this.pressingUpOrDown?ce=ae:this.inputting?ce=this.rawInput:ce=this.toPrecisionAsStep(ae),this.setState({value:ae,inputValue:ce})}var me="value"in this.props?H:this.state.value;"max"in this.props&&b.max!==re&&typeof me=="number"&&me>re&&V&&V(re),"min"in this.props&&b.min!==z&&typeof me=="number"&&me<z&&V&&V(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===C.a.BACKSPACE?be=this.cursorStart-1:this.lastKeyCode===C.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 C.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case C.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(b){var P=b;return P===""?P="":this.isNotCompleteNumber(parseFloat(P))?P=this.state.value:P=this.getValidValue(P),this.toNumber(P)}},{key:"getValueFromEvent",value:function(b){var P=b.target.value.trim().replace(/。/g,".");return p(this.props.decimalSeparator)&&(P=P.replace(this.props.decimalSeparator,".")),P}},{key:"getValidValue",value:function(b){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,V=parseFloat(b);return isNaN(V)?b:(V<P&&(V=P),V>H&&(V=H),V)}},{key:"setValue",value:function(b,P){var H=this.props.precision,V=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),re=this.state.value,z=re===void 0?null:re,F=this.state.inputValue,ae=F===void 0?null:F,ce=typeof V=="number"?V.toFixed(H):"".concat(V),me=V!==z||ce!=="".concat(ae);return"value"in this.props?(ae=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:ae},P)):this.setState({value:V,inputValue:this.toPrecisionAsStep(b)},P),me&&this.props.onChange(V),V}},{key:"getMaxPrecision",value:function(b){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.props,V=H.precision,re=H.step;if(p(V))return V;var z=this.getPrecision(P),F=this.getPrecision(re),ae=this.getPrecision(b);return b?Math.max(ae,z+F):z+F}},{key:"getPrecisionFactor",value:function(b){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.getMaxPrecision(b,P);return Math.pow(10,H)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var P=Math.abs(this.getMaxPrecision(b));return isNaN(P)?b.toString():Number(b).toFixed(P)}},{key:"toNumber",value:function(b){var P=this.props.precision,H=this.state.focused,V=b&&b.length>16&&H;return this.isNotCompleteNumber(b)||V?b:p(P)?Math.round(b*Math.pow(10,P))/Math.pow(10,P):Number(b)}},{key:"upStep",value:function(b,P){var H=this.props.step,V=this.getPrecisionFactor(b,P),re=Math.abs(this.getMaxPrecision(b,P)),z=((V*b+V*H*P)/V).toFixed(re);return this.toNumber(z)}},{key:"downStep",value:function(b,P){var H=this.props.step,V=this.getPrecisionFactor(b,P),re=Math.abs(this.getMaxPrecision(b,P)),z=((V*b-V*H*P)/V).toFixed(re);return this.toNumber(z)}},{key:"step",value:function(b,P){var H=this,V=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 ae=this["".concat(b,"Step")](F,V),ce=ae>z.max||ae<z.min;if(ae>z.max?ae=z.max:ae<z.min&&(ae=z.min),this.setValue(ae,null),this.setState({focused:!0},function(){H.pressingUpOrDown=!1}),ce)return;this.autoStepTimer=setTimeout(function(){H[b](P,V,!0)},re?u:x)}},{key:"fixCaret",value:function(b,P){if(b===void 0||P===void 0||!this.input||!this.input.value)return;try{var H=this.input.selectionStart,V=this.input.selectionEnd;(b!==H||P!==V)&&this.input.setSelectionRange(b,P)}catch(re){}}},{key:"render",value:function(){var b,P=this.props,H=P.prefixCls,V=P.disabled,re=P.readOnly,z=P.useTouch,F=P.autoComplete,ae=P.upHandler,ce=P.downHandler,me=P.className,be=P.max,Be=P.min,Ce=P.style,Le=P.title,Te=P.onMouseEnter,we=P.onMouseLeave,ve=P.onMouseOver,j=P.onMouseOut,T=P.required,k=P.onClick,G=P.tabIndex,$=P.type,N=P.placeholder,ue=P.id,Ee=P.inputMode,De=P.pattern,Ne=P.step,Re=P.maxLength,Ie=P.autoFocus,Pe=P.name,Ge=P.onPaste,Ke=P.onInput,Ye=Object(fe.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"]),Xe=this.state,at=Xe.value,qe=Xe.focused,ze=y()(H,(b={},Object(Z.a)(b,me,!!me),Object(Z.a)(b,"".concat(H,"-disabled"),V),Object(Z.a)(b,"".concat(H,"-focused"),qe),b)),Ae={};Object.keys(Ye).forEach(function(he){(he.substr(0,5)==="data-"||he.substr(0,5)==="aria-"||he==="role")&&(Ae[he]=Ye[he])});var Je=!re&&!V,Ze=this.getInputDisplayValue(null),oe=(at||at===0)&&(isNaN(at)||Number(at)>=be),X=(at||at===0)&&(isNaN(at)||Number(at)<=Be),J=oe||V||re,ne=X||V||re,se=y()("".concat(H,"-handler"),"".concat(H,"-handler-up"),Object(Z.a)({},"".concat(H,"-handler-up-disabled"),J)),q=y()("".concat(H,"-handler"),"".concat(H,"-handler-down"),Object(Z.a)({},"".concat(H,"-handler-down-disabled"),ne)),ie=z?{onTouchStart:J?h:this.up,onTouchEnd:this.stop}:{onMouseDown:J?h:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},le=z?{onTouchStart:ne?h:this.down,onTouchEnd:this.stop}:{onMouseDown:ne?h:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return O.a.createElement("div",{className:ze,style:Ce,title:Le,onMouseEnter:Te,onMouseLeave:we,onMouseOver:ve,onMouseOut:j,onFocus:function(){return null},onBlur:function(){return null}},O.a.createElement("div",{className:"".concat(H,"-handler-wrap")},O.a.createElement("span",Object.assign({unselectable:"on"},ie,{role:"button","aria-label":"Increase Value","aria-disabled":J,className:se}),ae||O.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-up-inner"),onClick:o})),O.a.createElement("span",Object.assign({unselectable:"on"},le,{role:"button","aria-label":"Decrease Value","aria-disabled":ne,className:q}),ce||O.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-down-inner"),onClick:o}))),O.a.createElement("div",{className:"".concat(H,"-input-wrap")},O.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Be,"aria-valuemax":be,"aria-valuenow":at,required:T,type:$,placeholder:N,onPaste:Ge,onClick:k,onMouseUp:this.onMouseUp,className:"".concat(H,"-input"),tabIndex:G,autoComplete:F,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Je?this.onKeyDown:h,onKeyUp:Je?this.onKeyUp:h,autoFocus:Ie,maxLength:Re,readOnly:re,disabled:V,max:be,min:Be,step:Ne,name:Pe,title:Le,id:ue,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ze),pattern:De,inputMode:Ee,onInput:Ke},Ae))))}}]),g}(O.a.Component);v.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:c,min:-c,step:1,style:{},onChange:h,onKeyDown:h,onPressEnter:h,onFocus:h,onBlur:h,parser:s,required:!1,autoComplete:"off"};var f=v,d=Oe.a=f},ji0R:function(_e,Oe,ee){_e.exports=ee.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(_e,Oe,ee){_e.exports=ee.p+"static/question.cb52bef9.gif"},kPYp:function(_e,Oe){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAUCAYAAADr0+FaAAANEklEQVRYR8WZe5RX1XXHP/vce3/zHoaXgFp5DQyOQLRgUTEtDW1qYyVmZUGNklRdiRpKE3lHfPyc4TngIBgfC0wx1ixt1NRWal2kotbE2lbRiCIISBCGhzDAvGd+87v37K5z5zfDzMCM46pr9fw1a+45+5zz3fvs/d3fn4yr1F8Do0UIUb74UFR8Gm3IO/Wf8MThat7mOYnaDZUmNUF/htpWLlePK4xwCcoQICHQbOGoKDuM4U1p5r0Px1DNrDPrezzQs+qNPUh/o4xXj6tRJhlhGEqeQNrCCYXdGvGfFt5JNHLoozJp7WyvdI0OtR4LEK7CstUIWyJLTSRcLfCnvlAiUKSgCEfV8o6NeMVE/G53itOUiXX3Sxcx2ov4qhG+qjBWoFChWYUqIt6VgFeblR0H5lEL0oGyjKvU1yHezPviyHdZ0Ro180basvD398n77svIFTokK5vrgW8LTELJRwgA6bTSHcaBckot/yWGX2YZtv5untT0dJ7SpOZrAX9mLTeIYarAIIQEYLrZTQNNFj7A8rx6/GrPfDncPmdihV6Y9nkA+Ot4nrIXaDSGElH6KfjdzpBSpVo8ttVU8Xitx/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6X8EfV6ljRfk5EmNxJvIdn09ksdYIs7oV2d7h7uGrhUOEzP14ibzoNgXmC3wjQx3dbwZdwM6YcbHpNJFDKjxr4dHOunv3rcY9rANNC7dbR4WFkbhIP7ddFxSxTK3Cr0nzgFMz2+05Su37saTsWJRVS5VnuHnnAnmtp8vPnKne+1NY4jlZwtDfWpob6ijzhQ098fyLVmn/bJ97PMPtQJ5r8Dxck5VUMyqXP0wEzEHjNFHQR438rPPZtuyiKpTtmsdjrji7SGmJmBJrGYZSlIsyfYD7oaJVlVqEAwbejSJeafR5t6dOsfOGTuXMTTHeBExHmCzCaDTurLPEFWOlXqFKlI+s8prfwG92lnXVXkoq9HwTcD/KdSp8mGrmyVSaf+pJJmjff/gKHZaTxR3G8E1rKWyoY4MvbOwJfIdIcSUX+8Ic1yg6yT6Eb7Q1Wc4BORRk+RQZQ2DD3n8Y+Lwn4edT/cEcOd0xL6nmyn5knWghPzuL7JQQJMC0umjzafUbaG5J0XigjFSfeHuHYZXSJIH0Iz+VJtczBL6H58pLZAhTaVqKCmnYfoSWc4l6Tko/nscg8clvMtQPyOFUn/oRVCauJZcs+jeHJFLHOX1wFTW9MkEnyg0kP2EpitJ4+YVU/S8v1xqrW4H9MAAAAABJRU5ErkJggg=="},kSUc:function(_e,Oe,ee){},l2Kq:function(_e,Oe,ee){_e.exports=ee.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(_e,Oe,ee){(function(fe){fe(ee("VrN/"),ee("1eCo"),ee("8EBN"))})(function(fe){"use strict";fe.defineMode("markdown",function(Z,R){var Q=fe.getMode(Z,"text/html"),_=Q.name=="null";function L(z){if(fe.findModeByName){var F=fe.findModeByName(z);F&&(z=F.mime||F.mimes[0])}var ae=fe.getMode(Z,z);return ae.name=="null"?null:ae}R.highlightFormatting===void 0&&(R.highlightFormatting=!1),R.maxBlockquoteDepth===void 0&&(R.maxBlockquoteDepth=0),R.taskLists===void 0&&(R.taskLists=!1),R.strikethrough===void 0&&(R.strikethrough=!1),R.emoji===void 0&&(R.emoji=!1),R.fencedCodeBlockHighlighting===void 0&&(R.fencedCodeBlockHighlighting=!0),R.fencedCodeBlockDefaultMode===void 0&&(R.fencedCodeBlockDefaultMode="text/plain"),R.xml===void 0&&(R.xml=!0),R.tokenTypeOverrides===void 0&&(R.tokenTypeOverrides={});var W={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var U in W)W.hasOwnProperty(U)&&R.tokenTypeOverrides[U]&&(W[U]=R.tokenTypeOverrides[U]);var O=/^([*\-_])(?:\s*\1){2,}\s*$/,M=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,C=R.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,I=/^ {0,3}(?:\={1,}|-{2,})\s*$/,w=/^[^#!\[\]*_\\<>` "'(~:]+/,A=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,S=/^\s*\[[^\]]+?\]:.*$/,h=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,o=" ";function s(z,F,ae){return F.f=F.inline=ae,ae(z,F)}function u(z,F,ae){return F.f=F.block=ae,ae(z,F)}function x(z){return!z||!/\S/.test(z.string)}function c(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 ae=fe.innerMode(Q,z.htmlState);F=ae.mode.name=="xml"&&ae.state.tagStart===null&&!ae.state.context&&ae.state.tokenize.isInText}F&&(z.f=l,z.block=p,z.htmlState=null)}return z.trailingSpace=0,z.trailingSpaceNewLine=!1,z.prevLine=z.thisLine,z.thisLine={stream:null},null}function p(z,F){var ae=z.column()===F.indentation,ce=x(F.prevLine.stream),me=F.indentedCode,be=F.prevLine.hr,Be=F.list!==!1,Ce=(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||!me)&&!F.prevLine.fencedCodeEnd,we=(F.list===!1||be||ce)&&F.indentation<=Ce&&z.match(O),ve=null;if(F.indentationDiff>=4&&(me||F.prevLine.fencedCodeEnd||F.prevLine.header||ce))return z.skipToEnd(),F.indentedCode=!0,W.code;if(z.eatSpace())return null;if(ae&&F.indentation<=Ce&&(ve=z.match(C))&&ve[1].length<=6)return F.quote=0,F.header=ve[1].length,F.thisLine.header=!0,R.highlightFormatting&&(F.formatting="header"),F.f=F.inline,f(F);if(F.indentation<=Ce&&z.eat(">"))return F.quote=ae?1:F.quote+1,R.highlightFormatting&&(F.formatting="quote"),z.eatSpace(),f(F);if(!we&&!F.setext&&ae&&F.indentation<=Ce&&(ve=z.match(M))){var j=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,R.taskLists&&z.match(y,!1)&&(F.taskList=!0),F.f=F.inline,R.highlightFormatting&&(F.formatting=["list","list-"+j]),f(F)}else{if(ae&&F.indentation<=Ce&&(ve=z.match(A,!0)))return F.quote=0,F.fencedEndRE=new RegExp(ve[1]+"+ *$"),F.localMode=R.fencedCodeBlockHighlighting&&L(ve[2]||R.fencedCodeBlockDefaultMode),F.localMode&&(F.localState=fe.startState(F.localMode)),F.f=F.block=v,R.highlightFormatting&&(F.formatting="code-block"),F.code=-1,f(F);if(F.setext||(!Te||!Be)&&!F.quote&&F.list===!1&&!F.code&&!we&&!S.test(z.string)&&(ve=z.lookAhead(1))&&(ve=ve.match(I)))return F.setext?(F.header=F.setext,F.setext=0,z.skipToEnd(),R.highlightFormatting&&(F.formatting="header")):(F.header=ve[0].charAt(0)=="="?1:2,F.setext=F.header),F.thisLine.header=!0,F.f=F.inline,f(F);if(we)return z.skipToEnd(),F.hr=!0,F.thisLine.hr=!0,W.hr;if(z.peek()==="[")return s(z,F,P)}return s(z,F,F.inline)}function D(z,F){var ae=Q.token(z,F.htmlState);if(!_){var ce=fe.innerMode(Q,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=l,F.block=p,F.htmlState=null)}return ae}function v(z,F){var ae=F.listStack[F.listStack.length-1]||0,ce=F.indentation<ae,me=ae+3;if(F.fencedEndRE&&F.indentation<=me&&(ce||z.match(F.fencedEndRE))){R.highlightFormatting&&(F.formatting="code-block");var be;return ce||(be=f(F)),F.localMode=F.localState=null,F.block=p,F.f=l,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(),W.code)}function f(z){var F=[];if(z.formatting){F.push(W.formatting),typeof z.formatting=="string"&&(z.formatting=[z.formatting]);for(var ae=0;ae<z.formatting.length;ae++)F.push(W.formatting+"-"+z.formatting[ae]),z.formatting[ae]==="header"&&F.push(W.formatting+"-"+z.formatting[ae]+"-"+z.header),z.formatting[ae]==="quote"&&(!R.maxBlockquoteDepth||R.maxBlockquoteDepth>=z.quote?F.push(W.formatting+"-"+z.formatting[ae]+"-"+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(W.linkHref,"url"):(z.strong&&F.push(W.strong),z.em&&F.push(W.em),z.strikethrough&&F.push(W.strikethrough),z.emoji&&F.push(W.emoji),z.linkText&&F.push(W.linkText),z.code&&F.push(W.code),z.image&&F.push(W.image),z.imageAltText&&F.push(W.imageAltText,"link"),z.imageMarker&&F.push(W.imageMarker)),z.header&&F.push(W.header,W.header+"-"+z.header),z.quote&&(F.push(W.quote),!R.maxBlockquoteDepth||R.maxBlockquoteDepth>=z.quote?F.push(W.quote+"-"+z.quote):F.push(W.quote+"-"+R.maxBlockquoteDepth)),z.list!==!1){var ce=(z.listStack.length-1)%3;ce?ce===1?F.push(W.list2):F.push(W.list3):F.push(W.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 d(z,F){return z.match(w,!0)?f(F):void 0}function l(z,F){var ae=F.text(z,F);if(typeof ae!="undefined")return ae;if(F.list)return F.list=null,f(F);if(F.taskList){var ce=z.match(y,!0)[1]===" ";return ce?F.taskOpen=!0:F.taskClosed=!0,R.highlightFormatting&&(F.formatting="task"),F.taskList=!1,f(F)}if(F.taskOpen=!1,F.taskClosed=!1,F.header&&z.match(/^#+$/,!0))return R.highlightFormatting&&(F.formatting="header"),f(F);var me=z.next();if(F.linkTitle){F.linkTitle=!1;var be=me;me==="("&&(be=")"),be=(be+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Be="^\\s*(?:[^"+be+"\\\\]+|\\\\\\\\|\\\\.)"+be;if(z.match(new RegExp(Be),!0))return W.linkHref}if(me==="`"){var Ce=F.formatting;R.highlightFormatting&&(F.formatting="code"),z.eatWhile("`");var Le=z.current().length;if(F.code==0&&(!F.quote||Le==1))return F.code=Le,f(F);if(Le==F.code){var Te=f(F);return F.code=0,Te}else return F.formatting=Ce,f(F)}else if(F.code)return f(F);if(me==="\\"&&(z.next(),R.highlightFormatting)){var we=f(F),ve=W.formatting+"-escape";return we?we+" "+ve:ve}if(me==="!"&&z.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return F.imageMarker=!0,F.image=!0,R.highlightFormatting&&(F.formatting="image"),f(F);if(me==="["&&F.imageMarker&&z.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return F.imageMarker=!1,F.imageAltText=!0,R.highlightFormatting&&(F.formatting="image"),f(F);if(me==="]"&&F.imageAltText){R.highlightFormatting&&(F.formatting="image");var we=f(F);return F.imageAltText=!1,F.image=!1,F.inline=F.f=g,we}if(me==="["&&!F.image)return F.linkText&&z.match(/^.*?\]/)||(F.linkText=!0,R.highlightFormatting&&(F.formatting="link")),f(F);if(me==="]"&&F.linkText){R.highlightFormatting&&(F.formatting="link");var we=f(F);return F.linkText=!1,F.inline=F.f=z.match(/\(.*?\)| ?\[.*?\]/,!1)?g:l,we}if(me==="<"&&z.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){F.f=F.inline=a,R.highlightFormatting&&(F.formatting="link");var we=f(F);return we?we+=" ":we="",we+W.linkInline}if(me==="<"&&z.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){F.f=F.inline=a,R.highlightFormatting&&(F.formatting="link");var we=f(F);return we?we+=" ":we="",we+W.linkEmail}if(R.xml&&me==="<"&&z.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var j=z.string.indexOf(">",z.pos);if(j!=-1){var T=z.string.substring(z.start,j);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(T)&&(F.md_inside=!0)}return z.backUp(1),F.htmlState=fe.startState(Q),u(z,F,D)}if(R.xml&&me==="<"&&z.match(/^\/\w*?>/))return F.md_inside=!1,"tag";if(me==="*"||me==="_"){for(var k=1,G=z.pos==1?" ":z.string.charAt(z.pos-2);k<3&&z.eat(me);)k++;var $=z.peek()||" ",N=!/\s/.test($)&&(!h.test($)||/\s/.test(G)||h.test(G)),ue=!/\s/.test(G)&&(!h.test(G)||/\s/.test($)||h.test($)),Ee=null,De=null;if(k%2&&(!F.em&&N&&(me==="*"||!ue||h.test(G))?Ee=!0:F.em==me&&ue&&(me==="*"||!N||h.test($))&&(Ee=!1)),k>1&&(!F.strong&&N&&(me==="*"||!ue||h.test(G))?De=!0:F.strong==me&&ue&&(me==="*"||!N||h.test($))&&(De=!1)),De!=null||Ee!=null){R.highlightFormatting&&(F.formatting=Ee==null?"strong":De==null?"em":"strong em"),Ee===!0&&(F.em=me),De===!0&&(F.strong=me);var Te=f(F);return Ee===!1&&(F.em=!1),De===!1&&(F.strong=!1),Te}}else if(me===" "&&(z.eat("*")||z.eat("_"))){if(z.peek()===" ")return f(F);z.backUp(1)}if(R.strikethrough){if(me==="~"&&z.eatWhile(me)){if(F.strikethrough){R.highlightFormatting&&(F.formatting="strikethrough");var Te=f(F);return F.strikethrough=!1,Te}else if(z.match(/^[^\s]/,!1))return F.strikethrough=!0,R.highlightFormatting&&(F.formatting="strikethrough"),f(F)}else if(me===" "&&z.match(/^~~/,!0)){if(z.peek()===" ")return f(F);z.backUp(2)}}if(R.emoji&&me===":"&&z.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){F.emoji=!0,R.highlightFormatting&&(F.formatting="emoji");var Ne=f(F);return F.emoji=!1,Ne}return me===" "&&(z.match(/^ +$/,!1)?F.trailingSpace++:F.trailingSpace&&(F.trailingSpaceNewLine=!0)),f(F)}function a(z,F){var ae=z.next();if(ae===">"){F.f=F.inline=l,R.highlightFormatting&&(F.formatting="link");var ce=f(F);return ce?ce+=" ":ce="",ce+W.linkInline}return z.match(/^[^>]+/,!0),W.linkInline}function g(z,F){if(z.eatSpace())return null;var ae=z.next();return ae==="("||ae==="["?(F.f=F.inline=b(ae==="("?")":"]"),R.highlightFormatting&&(F.formatting="link-string"),F.linkHref=!0,f(F)):"error"}var m={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(z){return function(F,ae){var ce=F.next();if(ce===z){ae.f=ae.inline=l,R.highlightFormatting&&(ae.formatting="link-string");var me=f(ae);return ae.linkHref=!1,me}return F.match(m[z]),ae.linkHref=!0,f(ae)}}function P(z,F){return z.match(/^([^\]\\]|\\.)*\]:/,!1)?(F.f=H,z.next(),R.highlightFormatting&&(F.formatting="link"),F.linkText=!0,f(F)):s(z,F,l)}function H(z,F){if(z.match(/^\]:/,!0)){F.f=F.inline=V,R.highlightFormatting&&(F.formatting="link");var ae=f(F);return F.linkText=!1,ae}return z.match(/^([^\]\\]|\\.)+/,!0),W.linkText}function V(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=l,W.linkHref+" url")}var re={startState:function(){return{f:p,prevLine:{stream:null},thisLine:{stream:null},block:p,htmlState:null,indentation:0,inline:l,text:d,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(z){return{f:z.f,prevLine:z.prevLine,thisLine:z.thisLine,block:z.block,htmlState:z.htmlState&&fe.copyState(Q,z.htmlState),indentation:z.indentation,localMode:z.localMode,localState:z.localMode?fe.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 c(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 ae=z.match(/^\s*/,!0)[0].replace(/\t/g,o).length;if(F.indentation=ae,F.indentationDiff=null,ae>0)return null}}return F.f(z,F)},innerMode:function(z){return z.block==D?{state:z.htmlState,mode:Q}:z.localState?{state:z.localState,mode:z.localMode}:{state:z,mode:re}},indent:function(z,F,ae){return z.block==D&&Q.indent?Q.indent(z.htmlState,F,ae):z.localState&&z.localMode.indent?z.localMode.indent(z.localState,F,ae):fe.Pass},blankLine:c,getType:f,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return re},"xml"),fe.defineMIME("text/markdown","markdown"),fe.defineMIME("text/x-markdown","markdown")})},lzim:function(_e,Oe,ee){"use strict";var fe=ee("E7E6"),Z=ee.n(fe);ee.d(Oe,"w",function(){return Z.a});var R=ee("/GNS"),Q=ee.n(R);ee.d(Oe,"v",function(){return Q.a});var _=ee("FOrL"),L=ee.n(_);ee.d(Oe,"q",function(){return L.a});var W=ee("HpTS"),U=ee.n(W);ee.d(Oe,"x",function(){return U.a});var O=ee("tWlo"),M=ee.n(O);ee.d(Oe,"a",function(){return M.a});var y=ee("7ZXX"),C=ee.n(y);ee.d(Oe,"l",function(){return C.a});var I=ee("GABl"),w=ee.n(I);ee.d(Oe,"e",function(){return w.a});var A=ee("onxn"),S=ee.n(A);ee.d(Oe,"n",function(){return S.a});var h=ee("nKGa"),o=ee.n(h);ee.d(Oe,"m",function(){return o.a});var s=ee("4qgm"),u=ee.n(s);ee.d(Oe,"y",function(){return u.a});var x=ee("JeFH"),c=ee.n(x);ee.d(Oe,"b",function(){return c.a});var p=ee("ji0R"),D=ee.n(p);ee.d(Oe,"i",function(){return D.a});var v=ee("W6BS"),f=ee.n(v);ee.d(Oe,"z",function(){return f.a});var d=ee("kPYp"),l=ee.n(d);ee.d(Oe,"A",function(){return l.a});var a=ee("nukY"),g=ee.n(a),m=ee("4u4S"),b=ee.n(m),P=ee("yslc"),H=ee.n(P),V=ee("l2Kq"),re=ee.n(V),z=ee("RMFE"),F=ee.n(z);ee.d(Oe,"o",function(){return F.a});var ae=ee("TGq3"),ce=ee.n(ae),me=ee("SMhR"),be=ee.n(me),Be=ee("8/bI"),Ce=ee.n(Be);ee.d(Oe,"j",function(){return Ce.a});var Le=ee("JWDV"),Te=ee.n(Le),we=ee("Xsq0"),ve=ee.n(we);ee.d(Oe,"p",function(){return ve.a});var j=ee("Ohmc"),T=ee.n(j);ee.d(Oe,"c",function(){return T.a});var k=ee("csWT"),G=ee.n(k);ee.d(Oe,"d",function(){return G.a});var $=ee("7v3h"),N=ee.n($);ee.d(Oe,"k",function(){return N.a});var ue=ee("cRFk"),Ee=ee.n(ue);ee.d(Oe,"u",function(){return Ee.a});var De=ee("kPWJ"),Ne=ee.n(De);ee.d(Oe,"t",function(){return Ne.a});var Re=ee("qgvg"),Ie=ee.n(Re);ee.d(Oe,"r",function(){return Ie.a});var Pe=ee("FPkq"),Ge=ee.n(Pe);ee.d(Oe,"s",function(){return Ge.a});var Ke=ee("A/g1"),Ye=ee.n(Ke);ee.d(Oe,"f",function(){return Ye.a});var Xe=ee("Nmxd"),at=ee.n(Xe);ee.d(Oe,"g",function(){return at.a});var qe=ee("5D2P"),ze=ee.n(qe);ee.d(Oe,"h",function(){return ze.a});var Ae=ee("djh8"),Je=ee.n(Ae),Ze=ee("Jq4h"),oe=ee.n(Ze)},nKGa:function(_e,Oe,ee){_e.exports=ee.p+"static/export_exercise-template.f7655c19.png"},nZ20:function(_e,Oe,ee){_e.exports={icons:"icons___3O80F"}},nukY:function(_e,Oe){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAMkklEQVR4Xu2dWWwcSRnHv7Yd577v+74vkgWEQCAEy6IVWuCB62GVICFIYkcsvMC+LW8LL7BIiTiEhCweInjgPrRCC2KBJTBVYzm24yRO4ty3kziJj9ie+tC/d9oaT2b67ume7irJsjdbVf19X/266quvjjaEEG8w8yukk7ZAii1gMHODEOK3RPRSivXUqmXcAgb07+jomDk2NvYPZn4u4/bQ6qfUAiboSEKI5cz8XyJanVJdtVoZtsAE6EXYdzPzv4hoToZtolVPoQUmgV6E/QVm/hMRNaVQX61SRi3wDOiwg5Tya0qpn2TUJlrtFFqgIujFnv27zPztFOqsVcqgBaqCzsyGlPJXzPy5DNpFq5wyC1QFHXr29fVN6+/v/zszfyBlemt1MmYBW9Bhi3w+v7hQKJwkog0Zs41WN0UWcAS96K9vI6J3mHl+inTXqmTIAq5Ahz1yudxHDcN4k5mbM2QfrWpKLOAa9CLsB4ioLSW6azUyZAFPoBdh/w4RvZYhG2lVU2ABz6AXYf8FEb2cAv21ChmxgC/Qu7q6moeHh/9KRB/JiJ20mnVuAV+gQ+fu7u4FQ0ND/yGiLXVuAy1+BizgG/Ri2HEj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VziZp3Zl/FigUiZ3wOIYWZ/52pLR35oOU6oPtuw+dNdl6QfsAHmYlMZcEpiXsak6tnQY70bWubrUepjkNJTKTbGv8s8SSlOaD5Z0LwhL4XWmQvSa42rWrgf7+Fn7byVVV5KX6mLbTWcKueEa6etz+M+OphwqlZtmnSUME1bjJyb6vOmm8tc3PvrCeMIJZTLt5zBb1i59tUxuvDeRm+14RscbD1IB9Uo6ZnHRfp2XsX4489Ujy8eT08YTAjSg6Plf333p9HDLpzPlpnEvg4kYH83TrZrxcugy7IkU4SnrdszlW6AS5iOzndzu2FAbexmKY2RCgDR5zVsfrFm2YSrc92cqveNe2xMF9pk4HZvFMmQwflxrqMZFXKub49R1+ZtOne5hJaZpwoAG1GpXjhf/YXuxTK37pyLFPZSGErM7JleYCPVGRN7kreaXsp45OnY7aAwN3xvQcH1b1y65VabMwzMU5zQ79bMKmLHLm2GCEXC0jUkVRSLUF6hdW62c8n7WyzXHfsianBVAg16rqGCOerYt+E4tuOIbviR3suK+cBp1Zdpp0GRVRfZl4/XHD7AzTpnYSFWB0vHlzS2TDiz/cPn4vx2YAML/AxiD3K8wfl5pAAAAAElFTkSuQmCC"},osHv:function(_e,Oe,ee){(function(fe){fe(ee("VrN/"))})(function(fe){"use strict";var Z=fe.Pos;function R(h,o){return h.line-o.line||h.ch-o.ch}var Q="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",_=Q+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",L=new RegExp("<(/?)(["+Q+"]["+_+"]*)","g");function W(h,o,s,u){this.line=o,this.ch=s,this.cm=h,this.text=h.getLine(o),this.min=u?Math.max(u.from,h.firstLine()):h.firstLine(),this.max=u?Math.min(u.to-1,h.lastLine()):h.lastLine()}function U(h,o){var s=h.cm.getTokenTypeAt(Z(h.line,o));return s&&/\btag\b/.test(s)}function O(h){return h.line>=h.max?void 0:(h.ch=0,h.text=h.cm.getLine(++h.line),!0)}function M(h){return h.line<=h.min?void 0:(h.text=h.cm.getLine(--h.line),h.ch=h.text.length,!0)}function y(h){for(;;){var o=h.text.indexOf(">",h.ch);if(o==-1){if(O(h))continue;return}if(!U(h,o+1)){h.ch=o+1;continue}var s=h.text.lastIndexOf("/",o),u=s>-1&&!/\S/.test(h.text.slice(s+1,o));return h.ch=o+1,u?"selfClose":"regular"}}function C(h){for(;;){var o=h.ch?h.text.lastIndexOf("<",h.ch-1):-1;if(o==-1){if(M(h))continue;return}if(!U(h,o+1)){h.ch=o;continue}L.lastIndex=o,h.ch=o;var s=L.exec(h.text);if(s&&s.index==o)return s}}function I(h){for(;;){L.lastIndex=h.ch;var o=L.exec(h.text);if(!o){if(O(h))continue;return}if(!U(h,o.index+1)){h.ch=o.index+1;continue}return h.ch=o.index+o[0].length,o}}function w(h){for(;;){var o=h.ch?h.text.lastIndexOf(">",h.ch-1):-1;if(o==-1){if(M(h))continue;return}if(!U(h,o+1)){h.ch=o;continue}var s=h.text.lastIndexOf("/",o),u=s>-1&&!/\S/.test(h.text.slice(s+1,o));return h.ch=o+1,u?"selfClose":"regular"}}function A(h,o){for(var s=[];;){var u=I(h),x,c=h.line,p=h.ch-(u?u[0].length:0);if(!u||!(x=y(h)))return;if(x=="selfClose")continue;if(u[1]){for(var D=s.length-1;D>=0;--D)if(s[D]==u[2]){s.length=D;break}if(D<0&&(!o||o==u[2]))return{tag:u[2],from:Z(c,p),to:Z(h.line,h.ch)}}else s.push(u[2])}}function S(h,o){for(var s=[];;){var u=w(h);if(!u)return;if(u=="selfClose"){C(h);continue}var x=h.line,c=h.ch,p=C(h);if(!p)return;if(p[1])s.push(p[2]);else{for(var D=s.length-1;D>=0;--D)if(s[D]==p[2]){s.length=D;break}if(D<0&&(!o||o==p[2]))return{tag:p[2],from:Z(h.line,h.ch),to:Z(x,c)}}}}fe.registerHelper("fold","xml",function(h,o){for(var s=new W(h,o.line,0);;){var u=I(s);if(!u||s.line!=o.line)return;var x=y(s);if(!x)return;if(!u[1]&&x!="selfClose"){var c=Z(s.line,s.ch),p=A(s,u[2]);return p&&R(p.from,c)>0?{from:c,to:p.from}:null}}}),fe.findMatchingTag=function(h,o,s){var u=new W(h,o.line,o.ch,s);if(u.text.indexOf(">")==-1&&u.text.indexOf("<")==-1)return;var x=y(u),c=x&&Z(u.line,u.ch),p=x&&C(u);if(!x||!p||R(u,o)>0)return;var D={from:Z(u.line,u.ch),to:c,tag:p[2]};return x=="selfClose"?{open:D,close:null,at:"open"}:p[1]?{open:S(u,p[2]),close:D,at:"close"}:(u=new W(h,c.line,c.ch,s),{open:D,close:A(u,p[2]),at:"open"})},fe.findEnclosingTag=function(h,o,s,u){for(var x=new W(h,o.line,o.ch,s);;){var c=S(x,u);if(!c)break;var p=new W(h,o.line,o.ch,s),D=A(p,c.tag);if(D)return{open:c,close:D}}},fe.scanForClosingTag=function(h,o,s,u){var x=new W(h,o.line,o.ch,u?{from:0,to:u}:null);return A(x,s)}})},p5ED:function(_e,Oe,ee){"use strict";var fe=ee("+L6B"),Z=ee("2/Rp"),R=ee("5Dmo"),Q=ee("3S7+"),_=ee("k1fw"),L=ee("9og8"),W=ee("tJVT"),U=ee("WmNS"),O=ee.n(U),M=ee("q1tI"),y=ee.n(M),C=ee("vHTk"),I=ee.n(C),w=ee("yEEn"),A=ee("ZW9T"),S=ee("1vsH"),h=ee("V0Rq"),o=ee("m3rI");Oe.a=function(s){var u,x,c,p,D,v,f,d=s.editOffice,l=d===void 0?"view":d,a=s.data,g=s.theme,m=s.type,b=s.filename,P=s.monacoEditor,H=s.className,V=s.style,re=s.close,z=s.onClose,F=s.hasMask,ae=s.disabledDownload,ce=Object(M.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),me=Object(W.a)(ce,2),be=me[0],Be=me[1],Ce=Object(M.useState)(""),Le=Object(W.a)(Ce,2),Te=Le[0],we=Le[1],ve=Object(M.useState)(),j=Object(W.a)(ve,2),T=j[0],k=j[1],G=window.ENV==="build"?"/react/build":"",$=o.a.PROXY_SERVER||location.origin,N,ue=1024*1024,Ee=10*ue,De=Object(M.useRef)();(u=a)!==null&&u!==void 0&&u.startsWith("/api")&&m!=="txt"&&(a=(o.a.API_SERVER||location.origin)+a),m==="office"&&(N=Object(S.T)(a).filesize,N>Ee&&(m="other")),b&&P&&(P.filename=b),Object(M.useEffect)(function(){var Pe,Ge,Ke=(Pe=document.cookie)===null||Pe===void 0||((Ge=Pe.replace(/\s/g,""))===null||Ge===void 0)?void 0:Ge.split(";");Ke==null||Ke.map(function(Ye){var Xe=Ye.split("=");Xe[0]==="_educoder_session"&&we(Xe[1])})},[]),Object(M.useEffect)(function(){m==="office"&&Ne()},[m,a]);var Ne=function(){var Pe=Object(L.a)(O.a.mark(function Ge(){var Ke,Ye,Xe;return O.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:return console.log("data:",a),Ke=a,a.startsWith("http")||(Ke=location.origin+Ke),Ye=new URL(Ke).pathname.split("/").pop(),qe.next=6,Object(h.V)({attachment_id:Ye});case 6:Xe=qe.sent,k(Xe);case 8:case"end":return qe.stop()}},Ge)}));return function(){return Pe.apply(this,arguments)}}(),Re=function(){if(a.startsWith("http")||a.startsWith("blob:")){Ie();return}Object(S.z)(b||"educoder",a,b)},Ie=function(){Object(S.x)(b||"educoder",decodeURIComponent(a))};return y.a.createElement("div",{style:Object(_.a)({},V||{}),className:"".concat(F&&I.a.bgBlack," ").concat(m?I.a.wrp:"hide")},re&&y.a.createElement("div",{className:I.a.close,ref:De},!ae&&y.a.createElement(Q.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return De.current}},y.a.createElement("span",{onClick:Ie},y.a.createElement("i",{className:"icon-quxiaozhiding"}))),y.a.createElement(Q.a,{title:"\u5173\u95ED",getPopupContainer:function(){return De.current}},y.a.createElement("span",{className:"",onClick:z},y.a.createElement("i",{className:"icon-guanbi1"})))),y.a.createElement("div",{className:"".concat(I.a[H]," ").concat(H," ").concat(I.a.monaco," ").concat(m==="txt"?"show":"hide")},m==="txt"&&y.a.createElement(A.b,P)),m==="audio"&&y.a.createElement("audio",{src:"".concat(((x=a)===null||x===void 0?void 0:x.indexOf("http://"))>-1||((c=a)===null||c===void 0?void 0:c.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(a),autoPlay:!0}),m==="video"&&y.a.createElement(y.a.Fragment,null,((p=a)===null||p===void 0?void 0:p.indexOf("http"))>-1?y.a.createElement("video",{controls:!0,src:"".concat(a),autoPlay:!0}):y.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(a),autoPlay:!0})),m==="office"&&T&&y.a.createElement("iframe",{src:"".concat(G,"/office.html?key=").concat(T.key,"&url=").concat($+T.url,"&callbackUrl=").concat($+T.callbackUrl,"&fileType=").concat(T.fileType,"&title=").concat(T.title,"&model=").concat(l,"&officeServer=").concat(o.a.OFFICE_SERVER,"&disabledDownload=").concat(!!ae)}),m==="html"&&y.a.createElement("iframe",{src:a+"&disposition=inline"}),m==="pdf"&&y.a.createElement("iframe",{src:"".concat(G,"/js/pdfview/index.html?url=").concat(a,"&disabledDownload=").concat(!!ae)}),m==="image"&&y.a.createElement("img",{src:"".concat(((D=a)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((v=a)===null||v===void 0?void 0:v.indexOf("https://"))>-1||(f=a)!==null&&f!==void 0&&f.startsWith("/api")?"":"data:image/png;base64,").concat(a)}),m==="other"&&y.a.createElement("div",null,y.a.createElement(Z.a,{type:"primary",size:"large",onClick:Re},y.a.createElement(w.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),m==="download"&&y.a.createElement(Z.a,{type:"primary",size:"large",onClick:Re},y.a.createElement(w.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(_e,Oe,ee){},qgvg:function(_e,Oe){_e.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6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ACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},rUJ1:function(_e,Oe){const ee=/[&<>"']/,fe=/[&<>"']/g,Z=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&","<":"<",">":">",'"':""","'":"'"},_=v=>Q[v];function L(v,f){if(f){if(ee.test(v))return v.replace(fe,_)}else if(Z.test(v))return v.replace(R,_);return v}const W=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(v){return v.replace(W,(f,d)=>(d=d.toLowerCase(),d==="colon"?":":d.charAt(0)==="#"?d.charAt(1)==="x"?String.fromCharCode(parseInt(d.substring(2),16)):String.fromCharCode(+d.substring(1)):""))}const O=/(^|[^\[])\^/g;function M(v,f){v=v.source||v,f=f||"";const d={replace:(l,a)=>(a=a.source||a,a=a.replace(O,"$1"),v=v.replace(l,a),d),getRegex:()=>new RegExp(v,f)};return d}const y=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function I(v,f,d){if(v){let l;try{l=decodeURIComponent(U(d)).replace(y,"").toLowerCase()}catch(a){return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}f&&!C.test(d)&&(d=o(f,d));try{d=encodeURI(d).replace(/%25/g,"%")}catch(l){return null}return d}const w={},A=/^[^:]+:\/*[^/]*$/,S=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(v,f){w[" "+v]||(A.test(v)?w[" "+v]=v+"/":w[" "+v]=c(v,"/",!0)),v=w[" "+v];const d=v.indexOf(":")===-1;return f.substring(0,2)==="//"?d?f:v.replace(S,"$1")+f:f.charAt(0)==="/"?d?f:v.replace(h,"$1")+f:v+f}const s={exec:function(){}};function u(v){let f=1,d,l;for(;f<arguments.length;f++){d=arguments[f];for(l in d)Object.prototype.hasOwnProperty.call(d,l)&&(v[l]=d[l])}return v}function x(v,f){const d=v.replace(/\|/g,(g,m,b)=>{let P=!1,H=m;for(;--H>=0&&b[H]==="\\";)P=!P;return P?"|":" |"}),l=d.split(/ \|/);let a=0;if(l.length>f)l.splice(f);else for(;l.length<f;)l.push("");for(;a<l.length;a++)l[a]=l[a].trim().replace(/\\\|/g,"|");return l}function c(v,f,d){const l=v.length;if(l===0)return"";let a=0;for(;a<l;){const g=v.charAt(l-a-1);if(g===f&&!d)a++;else if(g!==f&&d)a++;else break}return v.substr(0,l-a)}function p(v,f){if(v.indexOf(f[1])===-1)return-1;const d=v.length;let l=0,a=0;for(;a<d;a++)if(v[a]==="\\")a++;else if(v[a]===f[0])l++;else if(v[a]===f[1]&&(l--,l<0))return a;return-1}function D(v){v&&v.sanitize&&!v.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:L,unescape:U,edit:M,cleanUrl:I,resolveUrl:o,noopTest:s,merge:u,splitCells:x,rtrim:c,findClosingBracket:p,checkSanitizeDeprecation:D}},tWlo:function(_e,Oe){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZ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1f79jxaWgsRLbDY7XKj/Dlb405I+ItDDqz2/sACnTp9DEqNc+qfO1MLwyKiYCewNEPov3EK+G59k39BOp3Nt+YiUViLQKNjBH8sV7EXNivhslgb4xb2J28SMtMSRmbrwBBYpZPOI+xw4J2aka23tzB4VETrdct6zoCECC7wjjWIy1tbewZT//9R4RYzxZOtZTwK0C2vEjHjT2Ov3sx2d3TA7ZxPzuhrB5nVdiQ8pNPPvKP+XkEjjbYKtXm0VOpHe5x01KDDI72dFtmI+EGz1IkDyOeIvnlETH/T/digqKoLXeLLts3UNgY0REXGQZpmpqtCmrjV1/ZWcrEzIzEhnTtwQhwQb/5vNDc1dkinak4gDsMUFSEhwMJQ9vhueqihnWhYBMhnokYRGowGLZRwcW9fWLsGxTV6HqA8F6sMfR5z0qiDUKsjQpoEuPQ1SsSILVPDd1FJTrDA/Fwry9NDX1w9dxh7MSs2+ytTjcI+7gc0IkHwpMD+JnpbnZGdCXk4WPJSUKFlHzj0bGTrtGqhZNjJqgQHzIHRjWMbzhd7/MqLaZxqzxfjVFU+UjhcZCs+gp7f9nowcszMhfg17SoptSKDyym9N9cbePt8O2GrQ5pbrDRMTkwbe6MQpN6hfFRUVWa+Qb+7je23ideLAtPdGZ/cUZpw1iTsTFtFLJcBwEc2RIryHqELvW2q/qQPT4JA4AmupL5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},ulZh:function(_e,Oe,ee){typeof window!="undefined"&&function(Z,R){_e.exports=R()}(this,function(){return function(fe){var Z={};function R(Q){if(Z[Q])return Z[Q].exports;var _=Z[Q]={i:Q,l:!1,exports:{}};return fe[Q].call(_.exports,_,_.exports,R),_.l=!0,_.exports}return R.m=fe,R.c=Z,R.d=function(Q,_,L){R.o(Q,_)||Object.defineProperty(Q,_,{enumerable:!0,get:L})},R.r=function(Q){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Q,"__esModule",{value:!0})},R.t=function(Q,_){if(_&1&&(Q=R(Q)),_&8)return Q;if(_&4&&typeof Q=="object"&&Q&&Q.__esModule)return Q;var L=Object.create(null);if(R.r(L),Object.defineProperty(L,"default",{enumerable:!0,value:Q}),_&2&&typeof Q!="string")for(var W in Q)R.d(L,W,function(U){return Q[U]}.bind(null,W));return L},R.n=function(Q){var _=Q&&Q.__esModule?function(){return Q.default}:function(){return Q};return R.d(_,"a",_),_},R.o=function(Q,_){return Object.prototype.hasOwnProperty.call(Q,_)},R.p="/dist/",R(R.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(fe,Z,R){"use strict";var Q=Object.prototype.hasOwnProperty,_="~";function L(){}Object.create&&(L.prototype=Object.create(null),new L().__proto__||(_=!1));function W(y,C,I){this.fn=y,this.context=C,this.once=I||!1}function U(y,C,I,w,A){if(typeof I!="function")throw new TypeError("The listener must be a function");var S=new W(I,w||y,A),h=_?_+C:C;return y._events[h]?y._events[h].fn?y._events[h]=[y._events[h],S]:y._events[h].push(S):(y._events[h]=S,y._eventsCount++),y}function O(y,C){--y._eventsCount===0?y._events=new L:delete y._events[C]}function M(){this._events=new L,this._eventsCount=0}M.prototype.eventNames=function(){var C=[],I,w;if(this._eventsCount===0)return C;for(w in I=this._events)Q.call(I,w)&&C.push(_?w.slice(1):w);return Object.getOwnPropertySymbols?C.concat(Object.getOwnPropertySymbols(I)):C},M.prototype.listeners=function(C){var I=_?_+C:C,w=this._events[I];if(!w)return[];if(w.fn)return[w.fn];for(var A=0,S=w.length,h=new Array(S);A<S;A++)h[A]=w[A].fn;return h},M.prototype.listenerCount=function(C){var I=_?_+C:C,w=this._events[I];return w?w.fn?1:w.length:0},M.prototype.emit=function(C,I,w,A,S,h){var o=_?_+C:C;if(!this._events[o])return!1;var s=this._events[o],u=arguments.length,x,c;if(s.fn){s.once&&this.removeListener(C,s.fn,void 0,!0);switch(u){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,I),!0;case 3:return s.fn.call(s.context,I,w),!0;case 4:return s.fn.call(s.context,I,w,A),!0;case 5:return s.fn.call(s.context,I,w,A,S),!0;case 6:return s.fn.call(s.context,I,w,A,S,h),!0}for(c=1,x=new Array(u-1);c<u;c++)x[c-1]=arguments[c];s.fn.apply(s.context,x)}else{var p=s.length,D;for(c=0;c<p;c++){s[c].once&&this.removeListener(C,s[c].fn,void 0,!0);switch(u){case 1:s[c].fn.call(s[c].context);break;case 2:s[c].fn.call(s[c].context,I);break;case 3:s[c].fn.call(s[c].context,I,w);break;case 4:s[c].fn.call(s[c].context,I,w,A);break;default:if(!x)for(D=1,x=new Array(u-1);D<u;D++)x[D-1]=arguments[D];s[c].fn.apply(s[c].context,x)}}}return!0},M.prototype.on=function(C,I,w){return U(this,C,I,w,!1)},M.prototype.once=function(C,I,w){return U(this,C,I,w,!0)},M.prototype.removeListener=function(C,I,w,A){var S=_?_+C:C;if(!this._events[S])return this;if(!I)return O(this,S),this;var h=this._events[S];if(h.fn)h.fn===I&&(!A||h.once)&&(!w||h.context===w)&&O(this,S);else{for(var o=0,s=[],u=h.length;o<u;o++)(h[o].fn!==I||A&&!h[o].once||w&&h[o].context!==w)&&s.push(h[o]);s.length?this._events[S]=s.length===1?s[0]:s:O(this,S)}return this},M.prototype.removeAllListeners=function(C){var I;return C?(I=_?_+C:C,this._events[I]&&O(this,I)):(this._events=new L,this._eventsCount=0),this},M.prototype.off=M.prototype.removeListener,M.prototype.addListener=M.prototype.on,M.prefixed=_,M.EventEmitter=M,fe.exports=M},"./node_modules/url-toolkit/src/url-toolkit.js":function(fe,Z,R){(function(Q){var _=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,L=/^([^\/?#]*)([^]*)$/,W=/(?:\/|^)\.(?=\/)/g,U=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,O={buildAbsoluteURL:function(M,y,C){if(C=C||{},M=M.trim(),y=y.trim(),!y){if(!C.alwaysNormalize)return M;var I=O.parseURL(M);if(!I)throw new Error("Error trying to parse base URL.");return I.path=O.normalizePath(I.path),O.buildURLFromParts(I)}var w=O.parseURL(y);if(!w)throw new Error("Error trying to parse relative URL.");if(w.scheme)return C.alwaysNormalize?(w.path=O.normalizePath(w.path),O.buildURLFromParts(w)):y;var A=O.parseURL(M);if(!A)throw new Error("Error trying to parse base URL.");if(!A.netLoc&&A.path&&A.path[0]!=="/"){var S=L.exec(A.path);A.netLoc=S[1],A.path=S[2]}A.netLoc&&!A.path&&(A.path="/");var h={scheme:A.scheme,netLoc:w.netLoc,path:null,params:w.params,query:w.query,fragment:w.fragment};if(!w.netLoc&&(h.netLoc=A.netLoc,w.path[0]!=="/"))if(!w.path)h.path=A.path,w.params||(h.params=A.params,w.query||(h.query=A.query));else{var o=A.path,s=o.substring(0,o.lastIndexOf("/")+1)+w.path;h.path=O.normalizePath(s)}return h.path===null&&(h.path=C.alwaysNormalize?O.normalizePath(w.path):w.path),O.buildURLFromParts(h)},parseURL:function(M){var y=_.exec(M);return y?{scheme:y[1]||"",netLoc:y[2]||"",path:y[3]||"",params:y[4]||"",query:y[5]||"",fragment:y[6]||""}:null},normalizePath:function(M){for(M=M.split("").reverse().join("").replace(W,"");M.length!==(M=M.replace(U,"")).length;);return M.split("").reverse().join("")},buildURLFromParts:function(M){return M.scheme+M.netLoc+M.path+M.params+M.query+M.fragment}};fe.exports=O})(this)},"./node_modules/webworkify-webpack/index.js":function(fe,Z,R){function Q(C){var I={};function w(S){if(I[S])return I[S].exports;var h=I[S]={i:S,l:!1,exports:{}};return C[S].call(h.exports,h,h.exports,w),h.l=!0,h.exports}w.m=C,w.c=I,w.i=function(S){return S},w.d=function(S,h,o){w.o(S,h)||Object.defineProperty(S,h,{configurable:!1,enumerable:!0,get:o})},w.r=function(S){Object.defineProperty(S,"__esModule",{value:!0})},w.n=function(S){var h=S&&S.__esModule?function(){return S.default}:function(){return S};return w.d(h,"a",h),h},w.o=function(S,h){return Object.prototype.hasOwnProperty.call(S,h)},w.p="/",w.oe=function(S){throw console.error(S),S};var A=w(w.s=ENTRY_MODULE);return A.default||A}var _="[\\.|\\-|\\+|\\w|/|@]+",L="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+_+").*?\\)";function W(C){return(C+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function U(C){return!isNaN(1*C)}function O(C,I,w){var A={};A[w]=[];var S=I.toString(),h=S.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!h)return A;for(var o=h[1],s=new RegExp("(\\\\n|\\W)"+W(o)+L,"g"),u;u=s.exec(S);){if(u[3]==="dll-reference")continue;A[w].push(u[3])}for(s=new RegExp("\\("+W(o)+'\\("(dll-reference\\s('+_+'))"\\)\\)'+L,"g");u=s.exec(S);)C[u[2]]||(A[w].push(u[1]),C[u[2]]=R(u[1]).m),A[u[2]]=A[u[2]]||[],A[u[2]].push(u[4]);for(var x=Object.keys(A),c=0;c<x.length;c++)for(var p=0;p<A[x[c]].length;p++)U(A[x[c]][p])&&(A[x[c]][p]=1*A[x[c]][p]);return A}function M(C){var I=Object.keys(C);return I.reduce(function(w,A){return w||C[A].length>0},!1)}function y(C,I){for(var w={main:[I]},A={main:[]},S={main:{}};M(w);)for(var h=Object.keys(w),o=0;o<h.length;o++){var s=h[o],u=w[s],x=u.pop();if(S[s]=S[s]||{},S[s][x]||!C[s][x])continue;S[s][x]=!0,A[s]=A[s]||[],A[s].push(x);for(var c=O(C,C[s][x],s),p=Object.keys(c),D=0;D<p.length;D++)w[p[D]]=w[p[D]]||[],w[p[D]]=w[p[D]].concat(c[p[D]])}return A}fe.exports=function(C,I){I=I||{};var w={main:R.m},A=I.all?{main:Object.keys(w.main)}:y(w,C),S="";Object.keys(A).filter(function(x){return x!=="main"}).forEach(function(x){for(var c=0;A[x][c];)c++;A[x].push(c),w[x][c]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",S=S+"var "+x+" = ("+Q.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+A[x].map(function(p){return""+JSON.stringify(p)+": "+w[x][p].toString()}).join(",")+`});
|
|
`}),S=S+"new (("+Q.toString().replace("ENTRY_MODULE",JSON.stringify(C))+")({"+A.main.map(function(x){return""+JSON.stringify(x)+": "+w.main[x].toString()}).join(",")+"}))(self);";var h=new window.Blob([S],{type:"text/javascript"});if(I.bare)return h;var o=window.URL||window.webkitURL||window.mozURL||window.msURL,s=o.createObjectURL(h),u=new window.Worker(s);return u.objectURL=s,u}},"./src/config.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"hlsDefaultConfig",function(){return D}),R.d(Z,"mergeConfig",function(){return f}),R.d(Z,"enableStreamingMode",function(){return d});var Q=R("./src/controller/abr-controller.ts"),_=R("./src/controller/audio-stream-controller.ts"),L=R("./src/controller/audio-track-controller.ts"),W=R("./src/controller/subtitle-stream-controller.ts"),U=R("./src/controller/subtitle-track-controller.ts"),O=R("./src/controller/buffer-controller.ts"),M=R("./src/controller/timeline-controller.ts"),y=R("./src/controller/cap-level-controller.ts"),C=R("./src/controller/fps-controller.ts"),I=R("./src/controller/eme-controller.ts"),w=R("./src/controller/cmcd-controller.ts"),A=R("./src/utils/xhr-loader.ts"),S=R("./src/utils/fetch-loader.ts"),h=R("./src/utils/cues.ts"),o=R("./src/utils/mediakeys-helper.ts"),s=R("./src/utils/logger.ts");function u(){return u=Object.assign||function(l){for(var a=1;a<arguments.length;a++){var g=arguments[a];for(var m in g)Object.prototype.hasOwnProperty.call(g,m)&&(l[m]=g[m])}return l},u.apply(this,arguments)}function x(l,a){var g=Object.keys(l);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(l);a&&(m=m.filter(function(b){return Object.getOwnPropertyDescriptor(l,b).enumerable})),g.push.apply(g,m)}return g}function c(l){for(var a=1;a<arguments.length;a++){var g=arguments[a]!=null?arguments[a]:{};a%2?x(Object(g),!0).forEach(function(m){p(l,m,g[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(g)):x(Object(g)).forEach(function(m){Object.defineProperty(l,m,Object.getOwnPropertyDescriptor(g,m))})}return l}function p(l,a,g){return a in l?Object.defineProperty(l,a,{value:g,enumerable:!0,configurable:!0,writable:!0}):l[a]=g,l}var D=c(c({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:Q.default,bufferController:O.default,capLevelController:y.default,fpsController:C.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},v()),{},{subtitleStreamController:W.SubtitleStreamController,subtitleTrackController:U.default,timelineController:M.TimelineController,audioStreamController:_.default,audioTrackController:L.default,emeController:I.default,cmcdController:w.default});function v(){return{cueHandler:h.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function f(l,a){if((a.liveSyncDurationCount||a.liveMaxLatencyDurationCount)&&(a.liveSyncDuration||a.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(a.liveMaxLatencyDurationCount!==void 0&&(a.liveSyncDurationCount===void 0||a.liveMaxLatencyDurationCount<=a.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(a.liveMaxLatencyDuration!==void 0&&(a.liveSyncDuration===void 0||a.liveMaxLatencyDuration<=a.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return u({},l,a)}function d(l){var a=l.loader;if(a!==S.default&&a!==A.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),l.progressive=!1;else{var g=Object(S.fetchSupported)();g&&(l.loader=S.default,l.progressive=!0,l.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/polyfills/number.ts"),_=R("./src/utils/ewma-bandwidth-estimator.ts"),L=R("./src/events.ts"),W=R("./src/utils/buffer-helper.ts"),U=R("./src/errors.ts"),O=R("./src/types/loader.ts"),M=R("./src/utils/logger.ts");function y(w,A){for(var S=0;S<A.length;S++){var h=A[S];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(w,h.key,h)}}function C(w,A,S){return A&&y(w.prototype,A),S&&y(w,S),w}var I=function(){function w(S){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=S;var h=S.config;this.bwEstimator=new _.default(h.abrEwmaSlowVoD,h.abrEwmaFastVoD,h.abrEwmaDefaultEstimate),this.registerListeners()}var A=w.prototype;return A.registerListeners=function(){var h=this.hls;h.on(L.Events.FRAG_LOADING,this.onFragLoading,this),h.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),h.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(L.Events.ERROR,this.onError,this)},A.unregisterListeners=function(){var h=this.hls;h.off(L.Events.FRAG_LOADING,this.onFragLoading,this),h.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),h.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(L.Events.ERROR,this.onError,this)},A.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},A.onFragLoading=function(h,o){var s=o.frag;if(s.type===O.PlaylistLevelType.MAIN&&!this.timer){var u;this.fragCurrent=s,this.partCurrent=(u=o.part)!=null?u:null,this.timer=self.setInterval(this.onCheck,100)}},A.onLevelLoaded=function(h,o){var s=this.hls.config;o.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},A._abandonRulesCheck=function(){var h=this.fragCurrent,o=this.partCurrent,s=this.hls,u=s.autoLevelEnabled,x=s.config,c=s.media;if(!h||!c)return;var p=o?o.stats:h.stats,D=o?o.duration:h.duration;if(p.aborted){M.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!u||c.paused||!c.playbackRate||!c.readyState)return;var v=performance.now()-p.loading.start,f=Math.abs(c.playbackRate);if(v<=500*D/f)return;var d=s.levels,l=s.minAutoLevel,a=d[h.level],g=p.total||Math.max(p.loaded,Math.round(D*a.maxBitrate/8)),m=Math.max(1,p.bwEstimate?p.bwEstimate/8:p.loaded*1e3/v),b=(g-p.loaded)/m,P=c.currentTime,H=(W.BufferHelper.bufferInfo(c,P,x.maxBufferHole).end-P)/f;if(H>=2*D/f||b<=H)return;var V=Number.POSITIVE_INFINITY,re;for(re=h.level-1;re>l;re--){var z=d[re].maxBitrate;if(V=D*z/(8*.8*m),V<H)break}if(V>=b)return;var F=this.bwEstimator.getEstimate();M.logger.warn("Fragment "+h.sn+(o?" part "+o.index:"")+" of level "+h.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+re+`
|
|
Current BW estimate: `+(Object(Q.isFiniteNumber)(F)?(F/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+b.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+V.toFixed(3)+` s
|
|
Time to underbuffer: `+H.toFixed(3)+" s"),s.nextLoadLevel=re,this.bwEstimator.sample(v,p.loaded),this.clearTimer(),h.loader&&(this.fragCurrent=this.partCurrent=null,h.loader.abort()),s.trigger(L.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:h,part:o,stats:p})},A.onFragLoaded=function(h,o){var s=o.frag,u=o.part;if(s.type===O.PlaylistLevelType.MAIN&&Object(Q.isFiniteNumber)(s.sn)){var x=u?u.stats:s.stats,c=u?u.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var p=this.hls.levels[s.level],D=(p.loaded?p.loaded.bytes:0)+x.loaded,v=(p.loaded?p.loaded.duration:0)+c;p.loaded={bytes:D,duration:v},p.realBitrate=Math.round(8*D/v)}if(s.bitrateTest){var f={stats:x,frag:s,part:u,id:s.type};this.onFragBuffered(L.Events.FRAG_BUFFERED,f),s.bitrateTest=!1}}},A.onFragBuffered=function(h,o){var s=o.frag,u=o.part,x=u?u.stats:s.stats;if(x.aborted)return;if(s.type!==O.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var c=x.parsing.end-x.loading.start;this.bwEstimator.sample(c,x.loaded),x.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=c/1e3:this.bitrateTestDelay=0},A.onError=function(h,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 h=this.fragCurrent,o=this.partCurrent,s=this.hls,u=s.maxAutoLevel,x=s.config,c=s.minAutoLevel,p=s.media,D=o?o.duration:h?h.duration:0,v=p?p.currentTime:0,f=p&&p.playbackRate!==0?Math.abs(p.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():x.abrEwmaDefaultEstimate,l=(W.BufferHelper.bufferInfo(p,v,x.maxBufferHole).end-v)/f,a=this.findBestLevel(d,c,u,l,x.abrBandWidthFactor,x.abrBandWidthUpFactor);if(a>=0)return a;M.logger.trace((l?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var g=D?Math.min(D,x.maxStarvationDelay):x.maxStarvationDelay,m=x.abrBandWidthFactor,b=x.abrBandWidthUpFactor;if(!l){var P=this.bitrateTestDelay;if(P){var H=D?Math.min(D,x.maxLoadingDelay):x.maxLoadingDelay;g=H-P,M.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),m=b=1}}return a=this.findBestLevel(d,c,u,l+g,m,b),Math.max(a,0)},A.findBestLevel=function(h,o,s,u,x,c){for(var p,D=this.fragCurrent,v=this.partCurrent,f=this.lastLoadedFragLevel,d=this.hls.levels,l=d[f],a=!!(l!=null&&(p=l.details)!==null&&p!==void 0&&p.live),g=l==null?void 0:l.codecSet,m=v?v.duration:D?D.duration:0,b=s;b>=o;b--){var P=d[b];if(!P||g&&P.codecSet!==g)continue;var H=P.details,V=(v?H==null?void 0:H.partTarget:H==null?void 0:H.averagetargetduration)||m,re=void 0;b<=f?re=x*h:re=c*h;var z=d[b].maxBitrate,F=z*V/re;if(M.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(re)+"/"+z+"/"+V+"/"+u+"/"+F),re>z&&(!F||a&&!this.bitrateTestDelay||F<u))return b}return-1},C(w,[{key:"nextAutoLevel",get:function(){var h=this._nextAutoLevel,o=this.bwEstimator;if(h!==-1&&(!o||!o.canEstimate()))return h;var s=this.getNextABRAutoLevel();return h!==-1&&(s=Math.min(h,s)),s},set:function(h){this._nextAutoLevel=h}}]),w}();Z.default=I},"./src/controller/audio-stream-controller.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/polyfills/number.ts"),_=R("./src/controller/base-stream-controller.ts"),L=R("./src/events.ts"),W=R("./src/utils/buffer-helper.ts"),U=R("./src/controller/fragment-tracker.ts"),O=R("./src/types/level.ts"),M=R("./src/types/loader.ts"),y=R("./src/loader/fragment.ts"),C=R("./src/demux/chunk-cache.ts"),I=R("./src/demux/transmuxer-interface.ts"),w=R("./src/types/transmuxer.ts"),A=R("./src/controller/fragment-finders.ts"),S=R("./src/utils/discontinuities.ts"),h=R("./src/errors.ts"),o=R("./src/utils/logger.ts");function s(){return s=Object.assign||function(D){for(var v=1;v<arguments.length;v++){var f=arguments[v];for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(D[d]=f[d])}return D},s.apply(this,arguments)}function u(D,v){D.prototype=Object.create(v.prototype),D.prototype.constructor=D,x(D,v)}function x(D,v){return x=Object.setPrototypeOf||function(d,l){return d.__proto__=l,d},x(D,v)}var c=100,p=function(D){u(v,D);function v(d,l){var a;return a=D.call(this,d,l,"[audio-stream-controller]")||this,a.videoBuffer=null,a.videoTrackCC=-1,a.waitingVideoCC=-1,a.audioSwitch=!1,a.trackId=-1,a.waitingData=null,a.mainDetails=null,a.bufferFlushed=!1,a._registerListeners(),a}var f=v.prototype;return f.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},f._registerListeners=function(){var l=this.hls;l.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(L.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),l.on(L.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.on(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(L.Events.ERROR,this.onError,this),l.on(L.Events.BUFFER_RESET,this.onBufferReset,this),l.on(L.Events.BUFFER_CREATED,this.onBufferCreated,this),l.on(L.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f._unregisterListeners=function(){var l=this.hls;l.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(L.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),l.off(L.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.off(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(L.Events.ERROR,this.onError,this),l.off(L.Events.BUFFER_RESET,this.onBufferReset,this),l.off(L.Events.BUFFER_CREATED,this.onBufferCreated,this),l.off(L.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f.onInitPtsFound=function(l,a){var g=a.frag,m=a.id,b=a.initPTS;if(m==="main"){var P=g.cc;this.initPTS[g.cc]=b,this.log("InitPTS for cc: "+P+" found from main: "+b),this.videoTrackCC=P,this.state===_.State.WAITING_INIT_PTS&&this.tick()}},f.startLoad=function(l){if(!this.levels){this.startPosition=l,this.state=_.State.STOPPED;return}var a=this.lastCurrentTime;this.stopLoad(),this.setInterval(c),this.fragLoadError=0,a>0&&l===-1?(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=_.State.IDLE):(this.loadedmetadata=!1,this.state=_.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=l,this.tick()},f.doTick=function(){switch(this.state){case _.State.IDLE:this.doTickIdle();break;case _.State.WAITING_TRACK:{var l,a=this.levels,g=this.trackId,m=a==null||((l=a[g])===null||l===void 0)?void 0:l.details;if(m){if(this.waitForCdnTuneIn(m))break;this.state=_.State.WAITING_INIT_PTS}break}case _.State.FRAG_LOADING_WAITING_RETRY:{var b,P=performance.now(),H=this.retryDate;(!H||P>=H||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=_.State.IDLE);break}case _.State.WAITING_INIT_PTS:{var V=this.waitingData;if(V){var re=V.frag,z=V.part,F=V.cache,ae=V.complete;if(this.initPTS[re.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=_.State.FRAG_LOADING;var ce=F.flush(),me={frag:re,part:z,payload:ce,networkDetails:null};this._handleFragmentLoadProgress(me),ae&&D.prototype._handleFragmentLoadComplete.call(this,me)}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=W.BufferHelper.bufferInfo(this.mediaBuffer,be,this.config.maxBufferHole),Ce=Object(A.fragmentWithinToleranceTest)(Be.end,this.config.maxFragLookUpTolerance,re);Ce<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()},f.clearWaitingFragment=function(){var l=this.waitingData;l&&(this.fragmentTracker.removeFragment(l.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=_.State.IDLE)},f.onTickEnd=function(){var l=this.media;if(!l||!l.readyState)return;var a=this.mediaBuffer?this.mediaBuffer:l,g=a.buffered;!this.loadedmetadata&&g.length&&(this.loadedmetadata=!0),this.lastCurrentTime=l.currentTime},f.doTickIdle=function(){var l,a,g=this.hls,m=this.levels,b=this.media,P=this.trackId,H=g.config;if(!m||!m[P])return;if(!b&&(this.startFragRequested||!H.startFragPrefetch))return;var V=m[P],re=V.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,y.ElementaryStreamTypes.AUDIO,M.PlaylistLevelType.AUDIO));var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,M.PlaylistLevelType.AUDIO);if(z===null)return;var F=z.len,ae=this.getMaxBufferLength(),ce=this.audioSwitch;if(F>=ae&&!ce)return;if(!ce&&this._streamEnded(z,re)){g.trigger(L.Events.BUFFER_EOS,{type:"audio"}),this.state=_.State.ENDED;return}var me=re.fragments,be=me[0].start,Be=z.end;if(ce){var Ce=this.getLoadPosition();Be=Ce,re.PTSKnown&&Ce<be&&((z.end>be||z.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=be+.05))}var Le=this.getNextFragment(Be,re);if(!Le){this.bufferFlushed=!0;return}((l=Le.decryptdata)===null||l===void 0?void 0:l.keyFormat)==="identity"&&!((a=Le.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(Le,re):this.loadFragment(Le,re,Be)},f.getMaxBufferLength=function(){var l=D.prototype.getMaxBufferLength.call(this),a=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,M.PlaylistLevelType.MAIN);return a===null?l:Math.max(l,a.len)},f.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},f.onAudioTracksUpdated=function(l,a){var g=a.audioTracks;this.resetTransmuxer(),this.levels=g.map(function(m){return new O.Level(m)})},f.onAudioTrackSwitching=function(l,a){var g=!!a.url;this.trackId=a.id;var m=this.fragCurrent;m!=null&&m.loader&&m.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),g?this.setInterval(c):this.resetTransmuxer(),g?(this.audioSwitch=!0,this.state=_.State.IDLE):this.state=_.State.STOPPED,this.tick()},f.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},f.onLevelLoaded=function(l,a){this.mainDetails=a.details},f.onAudioTrackLoaded=function(l,a){var g,m=this.levels,b=a.details,P=a.id;if(!m){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var H=m[P],V=0;if(b.live||(g=H.details)!==null&&g!==void 0&&g.live){var re=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!re)return;!H.details&&b.hasProgramDateTime&&re.hasProgramDateTime?(Object(S.alignMediaPlaylistByPDT)(b,re),V=b.fragments[0].start):V=this.alignPlaylists(b,H.details)}H.details=b,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(H.details,V),this.state===_.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=_.State.IDLE),this.tick()},f._handleFragmentLoadProgress=function(l){var a,g=l.frag,m=l.part,b=l.payload,P=this.config,H=this.trackId,V=this.levels;if(!V){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=V[H];console.assert(re,"Audio track is defined on fragment load progress");var z=re.details;console.assert(z,"Audio track details are defined on fragment load progress");var F=P.defaultAudioCodec||re.audioCodec||"mp4a.40.2",ae=this.transmuxer;ae||(ae=this.transmuxer=new I.default(this.hls,M.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ce=this.initPTS[g.cc],me=(a=g.initSegment)===null||a===void 0?void 0:a.data;if(ce!==void 0){var be=!1,Be=m?m.index:-1,Ce=Be!==-1,Le=new w.ChunkMetadata(g.level,g.sn,g.stats.chunkCount,b.byteLength,Be,Ce);ae.push(b,me,F,"",g,m,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 "+H);var Te=this.waitingData=this.waitingData||{frag:g,part:m,cache:new C.default,complete:!1},we=Te.cache;we.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=_.State.WAITING_INIT_PTS}},f._handleFragmentLoadComplete=function(l){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,l)},f.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},f.onBufferCreated=function(l,a){var g=a.tracks.audio;g&&(this.mediaBuffer=g.buffer),a.tracks.video&&(this.videoBuffer=a.tracks.video.buffer)},f.onFragBuffered=function(l,a){var g=a.frag,m=a.part;if(g.type!==M.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(g)){this.warn("Fragment "+g.sn+(m?" p: "+m.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(L.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(g,m)},f.onError=function(l,a){switch(a.details){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:case h.ErrorDetails.KEY_LOAD_ERROR:case h.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(M.PlaylistLevelType.AUDIO,a);break;case h.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case h.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==_.State.ERROR&&this.state!==_.State.STOPPED&&(this.state=a.fatal?_.State.ERROR:_.State.IDLE,this.warn(a.details+" while loading frag, switching to "+this.state+" state"));break;case h.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="audio"&&(this.state===_.State.PARSING||this.state===_.State.PARSED)){var g=!0,m=this.getFwdBufferInfo(this.mediaBuffer,M.PlaylistLevelType.AUDIO);m&&m.len>.5&&(g=!this.reduceMaxBufferLength(m.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}},f.onBufferFlushed=function(l,a){var g=a.type;g===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},f._handleTransmuxComplete=function(l){var a,g="audio",m=this.hls,b=l.remuxResult,P=l.chunkMeta,H=this.getCurrentContext(P);if(!H){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var V=H.frag,re=H.part,z=b.audio,F=b.text,ae=b.id3,ce=b.initSegment;if(this.fragContextChanged(V))return;if(this.state=_.State.PARSING,this.audioSwitch&&z&&this.completeAudioSwitch(),ce!=null&&ce.tracks&&(this._bufferInitSegment(ce.tracks,V,P),m.trigger(L.Events.FRAG_PARSING_INIT_SEGMENT,{frag:V,id:g,tracks:ce.tracks})),z){var me=z.startPTS,be=z.endPTS,Be=z.startDTS,Ce=z.endDTS;re&&(re.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:me,endPTS:be,startDTS:Be,endDTS:Ce}),V.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,me,be,Be,Ce),this.bufferFragmentData(z,V,re,P)}if(ae!=null&&(a=ae.samples)!==null&&a!==void 0&&a.length){var Le=s({frag:V,id:g},ae);m.trigger(L.Events.FRAG_PARSING_METADATA,Le)}if(F){var Te=s({frag:V,id:g},F);m.trigger(L.Events.FRAG_PARSING_USERDATA,Te)}},f._bufferInitSegment=function(l,a,g){if(this.state!==_.State.PARSING)return;l.video&&delete l.video;var m=l.audio;if(!m)return;m.levelCodec=m.codec,m.id="audio",this.log("Init audio buffer, container:"+m.container+", codecs[parsed]=["+m.codec+"]"),this.hls.trigger(L.Events.BUFFER_CODECS,l);var b=m.initSegment;if(b!=null&&b.byteLength){var P={type:"audio",frag:a,part:null,chunkMeta:g,parent:a.type,data:b};this.hls.trigger(L.Events.BUFFER_APPENDING,P)}this.tick()},f.loadFragment=function(l,a,g){var m=this.fragmentTracker.getState(l);this.fragCurrent=l,(this.audioSwitch||m===U.FragmentState.NOT_LOADED||m===U.FragmentState.PARTIAL)&&(l.sn==="initSegment"?this._loadInitSegment(l):a.live&&!Object(Q.isFiniteNumber)(this.initPTS[l.cc])?(this.log("Waiting for video PTS in continuity counter "+l.cc+" of live stream before loading audio fragment "+l.sn+" of level "+this.trackId),this.state=_.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,l,a,g)))},f.completeAudioSwitch=function(){var l=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,l.trigger(L.Events.AUDIO_TRACK_SWITCHED,{id:g})},v}(_.default);Z.default=p},"./src/controller/audio-track-controller.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/events.ts"),_=R("./src/errors.ts"),L=R("./src/controller/base-playlist-controller.ts"),W=R("./src/types/loader.ts");function U(I,w){for(var A=0;A<w.length;A++){var S=w[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}function O(I,w,A){return w&&U(I.prototype,w),A&&U(I,A),I}function M(I,w){I.prototype=Object.create(w.prototype),I.prototype.constructor=I,y(I,w)}function y(I,w){return y=Object.setPrototypeOf||function(S,h){return S.__proto__=h,S},y(I,w)}var C=function(I){M(w,I);function w(S){var h;return h=I.call(this,S,"[audio-track-controller]")||this,h.tracks=[],h.groupId=null,h.tracksInGroup=[],h.trackId=-1,h.trackName="",h.selectDefaultTrack=!0,h.registerListeners(),h}var A=w.prototype;return A.registerListeners=function(){var h=this.hls;h.on(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.on(Q.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(Q.Events.ERROR,this.onError,this)},A.unregisterListeners=function(){var h=this.hls;h.off(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.off(Q.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(Q.Events.ERROR,this.onError,this)},A.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,I.prototype.destroy.call(this)},A.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},A.onManifestParsed=function(h,o){this.tracks=o.audioTracks||[]},A.onAudioTrackLoaded=function(h,o){var s=o.id,u=o.details,x=this.tracksInGroup[s];if(!x){this.warn("Invalid audio track id "+s);return}var c=x.details;x.details=o.details,this.log("audioTrack "+s+" loaded ["+u.startSN+"-"+u.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,o,c))},A.onLevelLoading=function(h,o){this.switchLevel(o.level)},A.onLevelSwitching=function(h,o){this.switchLevel(o.level)},A.switchLevel=function(h){var o=this.hls.levels[h];if(!(o!=null&&o.audioGroupIds))return;var s=o.audioGroupIds[o.urlId];if(this.groupId!==s){this.groupId=s;var u=this.tracks.filter(function(c){return!s||c.groupId===s});this.selectDefaultTrack&&!u.some(function(c){return c.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=u;var x={audioTracks:u};this.log("Updating audio tracks, "+u.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(Q.Events.AUDIO_TRACKS_UPDATED,x),this.selectInitialTrack()}},A.onError=function(h,o){if(I.prototype.onError.call(this,h,o),o.fatal||!o.context)return;o.context.type===W.PlaylistContextType.AUDIO_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},A.setAudioTrack=function(h){var o=this.tracksInGroup;if(h<0||h>=o.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=o[this.trackId];this.log("Now switching to audio-track index "+h);var u=o[h],x=u.id,c=u.groupId,p=c===void 0?"":c,D=u.name,v=u.type,f=u.url;if(this.trackId=h,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(Q.Events.AUDIO_TRACK_SWITCHING,{id:x,groupId:p,name:D,type:v,url:f}),u.details&&!u.details.live)return;var d=this.switchParams(u.url,s==null?void 0:s.details);this.loadPlaylist(d)},A.selectInitialTrack=function(){var h=this.tracksInGroup;console.assert(h.length,"Initial audio track should be selected when tracks are known");var o=this.trackName,s=this.findTrackId(o)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(Q.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},A.findTrackId=function(h){for(var o=this.tracksInGroup,s=0;s<o.length;s++){var u=o[s];if((!this.selectDefaultTrack||u.default)&&(!h||h===u.name))return u.id}return-1},A.loadPlaylist=function(h){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var s=o.id,u=o.groupId,x=o.url;if(h)try{x=h.addDirectives(x)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(Q.Events.AUDIO_TRACK_LOADING,{url:x,id:s,groupId:u,deliveryDirectives:h||null})}},O(w,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(h){this.selectDefaultTrack=!1,this.setAudioTrack(h)}}]),w}(L.default);Z.default=C},"./src/controller/base-playlist-controller.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return O});var Q=R("./src/polyfills/number.ts"),_=R("./src/types/level.ts"),L=R("./src/controller/level-helper.ts"),W=R("./src/utils/logger.ts"),U=R("./src/errors.ts"),O=function(){function M(C,I){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=W.logger.log.bind(W.logger,I+":"),this.warn=W.logger.warn.bind(W.logger,I+":"),this.hls=C}var y=M.prototype;return y.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},y.onError=function(I,w){w.fatal&&w.type===U.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},y.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},y.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},y.stopLoad=function(){this.canLoad=!1,this.clearTimer()},y.switchParams=function(I,w){var A=w==null?void 0:w.renditionReports;if(A)for(var S=0;S<A.length;S++){var h=A[S],o=""+h.URI;if(o===I.substr(-o.length)){var s=parseInt(h["LAST-MSN"]),u=parseInt(h["LAST-PART"]);if(w&&this.hls.config.lowLatencyMode){var x=Math.min(w.age-w.partTarget,w.targetduration);u!==void 0&&x>w.partTarget&&(u+=1)}if(Object(Q.isFiniteNumber)(s))return new _.HlsUrlParameters(s,Object(Q.isFiniteNumber)(u)?u:void 0,_.HlsSkip.No)}}},y.loadPlaylist=function(I){},y.shouldLoadTrack=function(I){return this.canLoad&&I&&!!I.url&&(!I.details||I.details.live)},y.playlistLoaded=function(I,w,A){var S=this,h=w.details,o=w.stats,s=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(h.advancedDateTime=Date.now()-s,h.live||A!=null&&A.live){if(h.reloaded(A),A&&this.log("live playlist "+I+" "+(h.advanced?"REFRESHED "+h.lastPartSn+"-"+h.lastPartIndex:"MISSED")),A&&h.fragments.length>0&&Object(L.mergeDetails)(A,h),!this.canLoad||!h.live)return;var u,x=void 0,c=void 0;if(h.canBlockReload&&h.endSN&&h.advanced){var p=this.hls.config.lowLatencyMode,D=h.lastPartSn,v=h.endSN,f=h.lastPartIndex,d=f!==-1,l=D===v,a=p?0:f;d?(x=l?v+1:D,c=l?a:f+1):x=v+1;var g=h.age,m=g+h.ageHeader,b=Math.min(m-h.partTarget,h.targetduration*1.5);if(b>0){if(A&&b>A.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+A.tuneInGoal+" to: "+b+" with playlist age: "+h.age),b=0;else{var P=Math.floor(b/h.targetduration);if(x+=P,c!==void 0){var H=Math.round(b%h.targetduration/h.partTarget);c+=H}this.log("CDN Tune-in age: "+h.ageHeader+"s last advanced "+g.toFixed(2)+"s goal: "+b+" skip sn "+P+" to part "+c)}h.tuneInGoal=b}if(u=this.getDeliveryDirectives(h,w.deliveryDirectives,x,c),p||!l){this.loadPlaylist(u);return}}else u=this.getDeliveryDirectives(h,w.deliveryDirectives,x,c);var V=Object(L.computeReloadInterval)(h,o);x!==void 0&&h.canBlockReload&&(V-=h.partTarget||1),this.log("reload live playlist "+I+" in "+Math.round(V)+" ms"),this.timer=self.setTimeout(function(){return S.loadPlaylist(u)},V)}else this.clearTimer()},y.getDeliveryDirectives=function(I,w,A,S){var h=Object(_.getSkipValue)(I,A);return w!=null&&w.skip&&I.deltaUpdateFailed&&(A=w.msn,S=w.part,h=_.HlsSkip.No),new _.HlsUrlParameters(A,S,h)},y.retryLoadingOrFail=function(I){var w=this,A=this.hls.config,S=this.retryCount<A.levelLoadingMaxRetry;if(S){var h;if(this.retryCount++,I.details.indexOf("LoadTimeOut")>-1&&(h=I.context)!==null&&h!==void 0&&h.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+I.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*A.levelLoadingRetryDelay,A.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return w.loadPlaylist()},o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+I.details+'"')}}else this.warn('cannot recover from error "'+I.details+'"'),this.clearTimer(),I.fatal=!0;return S},M}()},"./src/controller/base-stream-controller.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"State",function(){return v}),R.d(Z,"default",function(){return f});var Q=R("./src/polyfills/number.ts"),_=R("./src/task-loop.ts"),L=R("./src/controller/fragment-tracker.ts"),W=R("./src/utils/buffer-helper.ts"),U=R("./src/utils/logger.ts"),O=R("./src/events.ts"),M=R("./src/errors.ts"),y=R("./src/types/transmuxer.ts"),C=R("./src/utils/mp4-tools.ts"),I=R("./src/utils/discontinuities.ts"),w=R("./src/controller/fragment-finders.ts"),A=R("./src/controller/level-helper.ts"),S=R("./src/loader/fragment-loader.ts"),h=R("./src/crypt/decrypter.ts"),o=R("./src/utils/time-ranges.ts"),s=R("./src/types/loader.ts");function u(d,l){for(var a=0;a<l.length;a++){var g=l[a];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(d,g.key,g)}}function x(d,l,a){return l&&u(d.prototype,l),a&&u(d,a),d}function c(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function p(d,l){d.prototype=Object.create(l.prototype),d.prototype.constructor=d,D(d,l)}function D(d,l){return D=Object.setPrototypeOf||function(g,m){return g.__proto__=m,g},D(d,l)}var v={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"},f=function(d){p(l,d);function l(g,m,b){var P;return P=d.call(this)||this,P.hls=void 0,P.fragPrevious=null,P.fragCurrent=null,P.fragmentTracker=void 0,P.transmuxer=null,P._state=v.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=b,P.log=U.logger.log.bind(U.logger,b+":"),P.warn=U.logger.warn.bind(U.logger,b+":"),P.hls=g,P.fragmentLoader=new S.default(g.config),P.fragmentTracker=m,P.config=g.config,P.decrypter=new h.default(g,g.config),g.on(O.Events.KEY_LOADED,P.onKeyLoaded,c(P)),P}var a=l.prototype;return a.doTick=function(){this.onTickEnd()},a.onTickEnd=function(){},a.startLoad=function(m){},a.stopLoad=function(){this.fragmentLoader.abort();var m=this.fragCurrent;m&&this.fragmentTracker.removeFragment(m),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=v.STOPPED},a._streamEnded=function(m,b){var P=this.fragCurrent,H=this.fragmentTracker;if(!b.live&&P&&P.sn===b.endSN&&!m.nextStart){var V=H.getState(P);return V===L.FragmentState.PARTIAL||V===L.FragmentState.OK}return!1},a.onMediaAttached=function(m,b){var P=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),P.addEventListener("seeking",this.onvseeking),P.addEventListener("ended",this.onvended);var H=this.config;this.levels&&H.autoStartLoad&&this.state===v.STOPPED&&this.startLoad(H.startPosition)},a.onMediaDetaching=function(){var m=this.media;m!=null&&m.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),m&&(m.removeEventListener("seeking",this.onvseeking),m.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 m=this.config,b=this.fragCurrent,P=this.media,H=this.mediaBuffer,V=this.state,re=P?P.currentTime:0,z=W.BufferHelper.bufferInfo(H||P,re,m.maxBufferHole);if(this.log("media seeking to "+(Object(Q.isFiniteNumber)(re)?re.toFixed(3):re)+", state: "+V),V===v.ENDED)this.resetLoadingState();else if(b&&!z.len){var F=m.maxFragLookUpTolerance,ae=b.start-F,ce=b.start+b.duration+F,me=re>ce;(re<ae||me)&&(me&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.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(m,b){if(this.state!==v.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=v.IDLE;var P=this.levels[b.frag.level].details;P&&this.loadFragment(b.frag,P,b.frag.start)},a.onHandlerDestroying=function(){this.stopLoad(),d.prototype.onHandlerDestroying.call(this)},a.onHandlerDestroyed=function(){this.state=v.STOPPED,this.hls.off(O.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,d.prototype.onHandlerDestroyed.call(this)},a.loadKey=function(m,b){this.log("Loading key for "+m.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+m.level),this.state=v.KEY_LOADING,this.fragCurrent=m,this.hls.trigger(O.Events.KEY_LOADING,{frag:m})},a.loadFragment=function(m,b,P){this._loadFragForPlayback(m,b,P)},a._loadFragForPlayback=function(m,b,P){var H=this,V=function(z){if(H.fragContextChanged(m)){H.warn("Fragment "+m.sn+(z.part?" p: "+z.part.index:"")+" of level "+m.level+" was dropped during download."),H.fragmentTracker.removeFragment(m);return}m.stats.chunkCount++,H._handleFragmentLoadProgress(z)};this._doFragLoad(m,b,P,V).then(function(re){if(!re)return;H.fragLoadError=0;var z=H.state;if(H.fragContextChanged(m)){(z===v.FRAG_LOADING||z===v.BACKTRACKING||!H.fragCurrent&&z===v.PARSING)&&(H.fragmentTracker.removeFragment(m),H.state=v.IDLE);return}if("payload"in re&&(H.log("Loaded fragment "+m.sn+" of level "+m.level),H.hls.trigger(O.Events.FRAG_LOADED,re),H.state===v.BACKTRACKING)){H.fragmentTracker.backtrack(m,re),H.resetFragmentLoading(m);return}H._handleFragmentLoadComplete(re)}).catch(function(re){H.warn(re),H.resetFragmentLoading(m)})},a.flushMainBuffer=function(m,b,P){if(P===void 0&&(P=null),!(m-b))return;var H={startOffset:m,endOffset:b,type:P};this.fragLoadError=0,this.hls.trigger(O.Events.BUFFER_FLUSHING,H)},a._loadInitSegment=function(m){var b=this;this._doFragLoad(m).then(function(P){if(!P||b.fragContextChanged(m)||!b.levels)throw new Error("init load aborted");return P}).then(function(P){var H=b.hls,V=P.payload,re=m.decryptdata;if(V&&V.byteLength>0&&re&&re.key&&re.iv&&re.method==="AES-128"){var z=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(V),re.key.buffer,re.iv.buffer).then(function(F){var ae=self.performance.now();return H.trigger(O.Events.FRAG_DECRYPTED,{frag:m,payload:F,stats:{tstart:z,tdecrypt:ae}}),P.payload=F,P})}return P}).then(function(P){var H=b.fragCurrent,V=b.hls,re=b.levels;if(!re)throw new Error("init load aborted, missing levels");var z=re[m.level].details;console.assert(z,"Level details are defined when init segment is loaded");var F=m.stats;b.state=v.IDLE,b.fragLoadError=0,m.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===H&&V.trigger(O.Events.FRAG_BUFFERED,{stats:F,frag:H,part:null,id:m.type}),b.tick()}).catch(function(P){b.warn(P),b.resetFragmentLoading(m)})},a.fragContextChanged=function(m){var b=this.fragCurrent;return!m||!b||m.level!==b.level||m.sn!==b.sn||m.urlId!==b.urlId},a.fragBufferedComplete=function(m,b){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+m.type+" sn: "+m.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+m.level+" "+o.default.toString(W.BufferHelper.getBuffered(P))),this.state=v.IDLE,this.tick()},a._handleFragmentLoadComplete=function(m){var b=this.transmuxer;if(!b)return;var P=m.frag,H=m.part,V=m.partsLoaded,re=!V||V.length===0||V.some(function(F){return!F}),z=new y.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,H?H.index:-1,!re);b.flush(z)},a._handleFragmentLoadProgress=function(m){},a._doFragLoad=function(m,b,P,H){var V=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(m.start,P||0),this.config.lowLatencyMode&&b){var re=b.partList;if(re&&H){P>m.end&&b.fragmentHint&&(m=b.fragmentHint);var z=this.getNextPart(re,m,P);if(z>-1){var F=re[z];return this.log("Loading part sn: "+m.sn+" p: "+F.index+" cc: "+m.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+z+"-"+(re.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+m.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=F.start+F.duration,this.state=v.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:m,part:re[z],targetBufferTime:P}),this.doFragPartsLoad(m,re,z,H).catch(function(ae){return V.handleFragLoadError(ae)})}else if(!m.url||this.loadedEndOfParts(re,P))return Promise.resolve(null)}}return this.log("Loading fragment "+m.sn+" cc: "+m.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+m.level+", target: "+parseFloat(P.toFixed(3))),Object(Q.isFiniteNumber)(m.sn)&&!this.bitrateTest&&(this.nextLoadPosition=m.start+m.duration),this.state=v.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:m,targetBufferTime:P}),this.fragmentLoader.load(m,H).catch(function(ae){return V.handleFragLoadError(ae)})},a.doFragPartsLoad=function(m,b,P,H){var V=this;return new Promise(function(re,z){var F=[],ae=function ce(me){var be=b[me];V.fragmentLoader.loadPart(m,be,H).then(function(Be){F[be.index]=Be;var Ce=Be.part;V.hls.trigger(O.Events.FRAG_LOADED,Be);var Le=b[me+1];if(Le&&Le.fragment===m)ce(me+1);else return re({frag:m,part:Ce,partsLoaded:F})}).catch(z)};ae(P)})},a.handleFragLoadError=function(m){var b=m.data;return b&&b.details===M.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(O.Events.ERROR,b),null},a._handleTransmuxerFlush=function(m){var b=this.getCurrentContext(m);if(!b||this.state!==v.PARSING){this.fragCurrent||(this.state=v.IDLE);return}var P=b.frag,H=b.part,V=b.level,re=self.performance.now();P.stats.parsing.end=re,H&&(H.stats.parsing.end=re),this.updateLevelTiming(P,H,V,m.partial)},a.getCurrentContext=function(m){var b=this.levels,P=m.level,H=m.sn,V=m.part;if(!b||!b[P])return this.warn("Levels object was unset while buffering fragment "+H+" of level "+P+". The current chunk will not be buffered."),null;var re=b[P],z=V>-1?Object(A.getPartWith)(re,H,V):null,F=z?z.fragment:Object(A.getFragmentWithSN)(re,H,this.fragCurrent);return F?{frag:F,part:z,level:re}:null},a.bufferFragmentData=function(m,b,P,H){if(!m||this.state!==v.PARSING)return;var V=m.data1,re=m.data2,z=V;if(V&&re&&(z=Object(C.appendUint8Array)(V,re)),!z||!z.length)return;var F={type:m.type,frag:b,part:P,chunkMeta:H,parent:b.type,data:z};this.hls.trigger(O.Events.BUFFER_APPENDING,F),m.dropped&&m.independent&&!P&&this.flushBufferGap(b)},a.flushBufferGap=function(m){var b=this.media;if(!b)return;if(!W.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,m.start);return}var P=b.currentTime,H=W.BufferHelper.bufferInfo(b,P,0),V=m.duration,re=Math.min(this.config.maxFragLookUpTolerance*2,V*.25),z=Math.max(Math.min(m.start-re,H.end-re),P+re);m.start-z>re&&this.flushMainBuffer(z,m.start)},a.getFwdBufferInfo=function(m,b){var P=this.config,H=this.getLoadPosition();if(!Object(Q.isFiniteNumber)(H))return null;var V=W.BufferHelper.bufferInfo(m,H,P.maxBufferHole);if(V.len===0&&V.nextStart!==void 0){var re=this.fragmentTracker.getBufferedFrag(H,b);if(re&&V.nextStart<re.end)return W.BufferHelper.bufferInfo(m,H,Math.max(V.nextStart,P.maxBufferHole))}return V},a.getMaxBufferLength=function(m){var b=this.config,P;return m?P=Math.max(8*b.maxBufferSize/m,b.maxBufferLength):P=b.maxBufferLength,Math.min(P,b.maxMaxBufferLength)},a.reduceMaxBufferLength=function(m){var b=this.config,P=m||b.maxBufferLength;return b.maxMaxBufferLength>=P?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},a.getNextFragment=function(m,b){var P,H,V=b.fragments,re=V.length;if(!re)return null;var z=this.config,F=V[0].start,ae;if(b.live){var ce=z.initialLiveManifestSize;if(re<ce)return this.warn("Not enough fragments to start playback (have: "+re+", need: "+ce+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(ae=this.getInitialLiveFragment(b,V),this.startPosition=ae?this.hls.liveSyncPosition||ae.start:m)}else m<=F&&(ae=V[0]);if(!ae){var me=z.lowLatencyMode?b.partEnd:b.fragmentEnd;ae=this.getFragmentAtPosition(m,me,b)}return(P=ae)!==null&&P!==void 0&&P.initSegment&&!((H=ae)!==null&&H!==void 0&&H.initSegment.data)&&!this.bitrateTest&&(ae=ae.initSegment),ae},a.getNextPart=function(m,b,P){for(var H=-1,V=!1,re=!0,z=0,F=m.length;z<F;z++){var ae=m[z];if(re=re&&!ae.independent,H>-1&&P<ae.start)break;var ce=ae.loaded;!ce&&(V||ae.independent||re)&&ae.fragment===b&&(H=z),V=ce}return H},a.loadedEndOfParts=function(m,b){var P=m[m.length-1];return P&&b>P.start&&P.loaded},a.getInitialLiveFragment=function(m,b){var P=this.fragPrevious,H=null;if(P){if(m.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),H=Object(w.findFragmentByPDT)(b,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!H){var V=P.sn+1;if(V>=m.startSN&&V<=m.endSN){var re=b[V-m.startSN];P.cc===re.cc&&(H=re,this.log("Live playlist, switching playlist, load frag with next SN: "+H.sn))}H||(H=Object(w.findFragWithCC)(b,P.cc),H&&this.log("Live playlist, switching playlist, load frag with same CC: "+H.sn))}}else{var z=this.hls.liveSyncPosition;z!==null&&(H=this.getFragmentAtPosition(z,this.bitrateTest?m.fragmentEnd:m.edge,m))}return H},a.getFragmentAtPosition=function(m,b,P){var H=this.config,V=this.fragPrevious,re=P.fragments,z=P.endSN,F=P.fragmentHint,ae=H.maxFragLookUpTolerance,ce=!!(H.lowLatencyMode&&P.partList&&F);ce&&F&&!this.bitrateTest&&(re=re.concat(F),z=F.sn);var me;if(m<b){var be=m>b-ae?0:ae;me=Object(w.findFragmentByPTS)(V,re,m,be)}else me=re[re.length-1];if(me){var Be=me.sn-P.startSN,Ce=V&&me.level===V.level,Le=re[Be+1],Te=this.fragmentTracker.getState(me);if(Te===L.FragmentState.BACKTRACKED){me=null;for(var we=Be;re[we]&&this.fragmentTracker.getState(re[we])===L.FragmentState.BACKTRACKED;)V?me=re[we--]:me=re[--we];me||(me=Le)}else V&&me.sn===V.sn&&!ce&&(Ce&&(me.sn<z&&this.fragmentTracker.getState(Le)!==L.FragmentState.OK?(this.log("SN "+me.sn+" just loaded, load next one: "+Le.sn),me=Le):me=null))}return me},a.synchronizeToLiveEdge=function(m){var b=this.config,P=this.media;if(!P)return;var H=this.hls.liveSyncPosition,V=P.currentTime,re=m.fragments[0].start,z=m.edge,F=V>=re-b.maxFragLookUpTolerance&&V<=z;if(H!==null&&P.duration>H&&(V<H||!F)){var ae=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*m.targetduration;(!F&&P.readyState<4||V<z-ae)&&(this.loadedmetadata||(this.nextLoadPosition=H),P.readyState&&(this.warn("Playback: "+V.toFixed(3)+" is located too far from the end of live sliding playlist: "+z+", reset currentTime to : "+H.toFixed(3)),P.currentTime=H))}},a.alignPlaylists=function(m,b){var P=this.levels,H=this.levelLastLoaded,V=this.fragPrevious,re=H!==null?P[H]:null,z=m.fragments.length;if(!z)return this.warn("No fragments in live playlist"),0;var F=m.fragments[0].start,ae=!b,ce=m.alignedSliding&&Object(Q.isFiniteNumber)(F);if(ae||!ce&&!F){Object(I.alignStream)(V,re,m);var me=m.fragments[0].start;return this.log("Live playlist sliding: "+me.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+m.startSN+" prev-sn: "+(V?V.sn:"na")+" fragments: "+z),me}return F},a.waitForCdnTuneIn=function(m){var b=3;return m.live&&m.canBlockReload&&m.tuneInGoal>Math.max(m.partHoldBack,m.partTarget*b)},a.setStartPosition=function(m,b){var P=this.startPosition;if(P<b&&(P=-1),P===-1||this.lastCurrentTime===-1){var H=m.startTimeOffset;Object(Q.isFiniteNumber)(H)?(P=b+H,H<0&&(P+=m.totalduration),P=Math.min(Math.max(b,P),b+m.totalduration),this.log("Start time offset "+H+" found in playlist, adjust startPosition to "+P),this.startPosition=P):m.live?P=this.hls.liveSyncPosition||b:this.startPosition=P=0,this.lastCurrentTime=P}this.nextLoadPosition=P},a.getLoadPosition=function(){var m=this.media,b=0;return this.loadedmetadata&&m?b=m.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},a.handleFragLoadAborted=function(m,b){this.transmuxer&&m.sn!=="initSegment"&&m.stats.aborted&&(this.warn("Fragment "+m.sn+(b?" part"+b.index:"")+" of level "+m.level+" was aborted"),this.resetFragmentLoading(m))},a.resetFragmentLoading=function(m){(!this.fragCurrent||!this.fragContextChanged(m))&&(this.state=v.IDLE)},a.onFragmentOrKeyLoadError=function(m,b){if(b.fatal)return;var P=b.frag;if(!P||P.type!==m)return;var H=this.fragCurrent;console.assert(H&&P.sn===H.sn&&P.level===H.level&&P.urlId===H.urlId,"Frag load error must match current frag to retry");var V=this.config;if(this.fragLoadError+1<=V.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(P.level))return;var re=Math.min(Math.pow(2,this.fragLoadError)*V.fragLoadingRetryDelay,V.fragLoadingMaxRetryTimeout);this.warn("Fragment "+P.sn+" of "+m+" "+P.level+" failed to load, retrying in "+re+"ms"),this.retryDate=self.performance.now()+re,this.fragLoadError++,this.state=v.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(m===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=v.IDLE):(U.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=v.ERROR)},a.afterBufferFlushed=function(m,b,P){if(!m)return;var H=W.BufferHelper.getBuffered(m);this.fragmentTracker.detectEvictedFragments(b,H,P),this.state===v.ENDED&&this.resetLoadingState()},a.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=v.IDLE},a.resetLiveStartWhenNotLoaded=function(m){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[m].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},a.updateLevelTiming=function(m,b,P,H){var V=this,re=P.details;console.assert(!!re,"level.details must be defined");var z=Object.keys(m.elementaryStreams).reduce(function(F,ae){var ce=m.elementaryStreams[ae];if(ce){var me=ce.endPTS-ce.startPTS;if(me<=0)return V.warn("Could not parse fragment "+m.sn+" "+ae+" duration reliably ("+me+") resetting transmuxer to fallback to playlist timing"),V.resetTransmuxer(),F||!1;var be=H?0:Object(A.updateFragPTSDTS)(re,m,ce.startPTS,ce.endPTS,ce.startDTS,ce.endDTS);return V.hls.trigger(O.Events.LEVEL_PTS_UPDATED,{details:re,level:P,drift:be,type:ae,frag:m,start:ce.startPTS,end:ce.endPTS}),!0}return F},!1);z?(this.state=v.PARSED,this.hls.trigger(O.Events.FRAG_PARSED,{frag:m,part:b})):this.resetLoadingState()},a.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},x(l,[{key:"state",get:function(){return this._state},set:function(m){var b=this._state;b!==m&&(this._state=m,this.log(b+"->"+m))}}]),l}(_.default)},"./src/controller/buffer-controller.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return w});var Q=R("./src/polyfills/number.ts"),_=R("./src/events.ts"),L=R("./src/utils/logger.ts"),W=R("./src/errors.ts"),U=R("./src/utils/buffer-helper.ts"),O=R("./src/utils/mediasource-helper.ts"),M=R("./src/loader/fragment.ts"),y=R("./src/controller/buffer-operation-queue.ts"),C=Object(O.getMediaSource)(),I=/([ha]vc.)(?:\.[^.,]+)+/,w=function(){function A(h){var o=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var s=o.hls,u=o.media,x=o.mediaSource;L.logger.log("[buffer-controller]: Media source opened"),u&&(o.updateMediaElementDuration(),s.trigger(_.Events.MEDIA_ATTACHED,{media:u})),x&&x.removeEventListener("sourceopen",o._onMediaSourceOpen),o.checkPendingTracks()},this._onMediaSourceClose=function(){L.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){L.logger.log("[buffer-controller]: Media source ended")},this.hls=h,this._initSourceBuffer(),this.registerListeners()}var S=A.prototype;return S.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},S.destroy=function(){this.unregisterListeners(),this.details=null},S.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)},S.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)},S._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new y.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},S.onManifestParsed=function(o,s){var u=2;(s.audio&&!s.video||!s.altAudio)&&(u=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=u,this.details=null,L.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},S.onMediaAttaching=function(o,s){var u=this.media=s.media;if(u&&C){var x=this.mediaSource=new C;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}},S.onMediaDetaching=function(){var o=this.media,s=this.mediaSource,u=this._objectUrl;if(s){if(L.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(x){L.logger.warn("[buffer-controller]: onMediaDetaching: "+x.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),o&&(u&&self.URL.revokeObjectURL(u),o.src===u?(o.removeAttribute("src"),o.load()):L.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)},S.onBufferReset=function(){var o=this;this.getSourceBufferTypes().forEach(function(s){var u=o.sourceBuffer[s];try{u&&(o.removeBufferListeners(s),o.mediaSource&&o.mediaSource.removeSourceBuffer(u),o.sourceBuffer[s]=void 0)}catch(x){L.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",x)}}),this._initSourceBuffer()},S.onBufferCodecs=function(o,s){var u=this,x=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(c){if(x){var p=u.tracks[c];if(p&&typeof p.buffer.changeType=="function"){var D=s[c],v=D.codec,f=D.levelCodec,d=D.container,l=(p.levelCodec||p.codec).replace(I,"$1"),a=(f||v).replace(I,"$1");if(l!==a){var g=d+";codecs="+(f||v);u.appendChangeType(c,g)}}}else u.pendingTracks[c]=s[c]}),x)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},S.appendChangeType=function(o,s){var u=this,x=this.operationQueue,c={execute:function(){var D=u.sourceBuffer[o];D&&(L.logger.log("[buffer-controller]: changing "+o+" sourceBuffer type to "+s),D.changeType(s)),x.shiftAndExecuteNext(o)},onStart:function(){},onComplete:function(){},onError:function(D){L.logger.warn("[buffer-controller]: Failed to change "+o+" SourceBuffer type",D)}};x.append(c,o)},S.onBufferAppending=function(o,s){var u=this,x=this.hls,c=this.operationQueue,p=this.tracks,D=s.data,v=s.type,f=s.frag,d=s.part,l=s.chunkMeta,a=l.buffering[v],g=self.performance.now();a.start=g;var m=f.stats.buffering,b=d?d.stats.buffering:null;m.start===0&&(m.start=g),b&&b.start===0&&(b.start=g);var P=p.audio,H=v==="audio"&&l.id===1&&(P==null?void 0:P.container)==="audio/mpeg",V={execute:function(){if(a.executeStart=self.performance.now(),H){var z=u.sourceBuffer[v];if(z){var F=f.start-z.timestampOffset;Math.abs(F)>=.1&&(L.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+f.start+" (delta: "+F+") sn: "+f.sn+")"),z.timestampOffset=f.start)}}u.appendExecutor(D,v)},onStart:function(){},onComplete:function(){var z=self.performance.now();a.executeEnd=a.end=z,m.first===0&&(m.first=z),b&&b.first===0&&(b.first=z);var F=u.sourceBuffer,ae={};for(var ce in F)ae[ce]=U.BufferHelper.getBuffered(F[ce]);u.appendError=0,u.hls.trigger(_.Events.BUFFER_APPENDED,{type:v,frag:f,part:d,chunkMeta:l,parent:f.type,timeRanges:ae})},onError:function(z){L.logger.error("[buffer-controller]: Error encountered while trying to append to the "+v+" SourceBuffer",z);var F={type:W.ErrorTypes.MEDIA_ERROR,parent:f.type,details:W.ErrorDetails.BUFFER_APPEND_ERROR,err:z,fatal:!1};z.code===DOMException.QUOTA_EXCEEDED_ERR?F.details=W.ErrorDetails.BUFFER_FULL_ERROR:(u.appendError++,F.details=W.ErrorDetails.BUFFER_APPEND_ERROR,u.appendError>x.config.appendErrorMaxRetry&&(L.logger.error("[buffer-controller]: Failed "+x.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),F.fatal=!0)),x.trigger(_.Events.ERROR,F)}};c.append(V,v)},S.onBufferFlushing=function(o,s){var u=this,x=this.operationQueue,c=function(D){return{execute:u.removeExecutor.bind(u,D,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){u.hls.trigger(_.Events.BUFFER_FLUSHED,{type:D})},onError:function(f){L.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",f)}}};s.type?x.append(c(s.type),s.type):this.getSourceBufferTypes().forEach(function(p){x.append(c(p),p)})},S.onFragParsed=function(o,s){var u=this,x=s.frag,c=s.part,p=[],D=c?c.elementaryStreams:x.elementaryStreams;D[M.ElementaryStreamTypes.AUDIOVIDEO]?p.push("audiovideo"):(D[M.ElementaryStreamTypes.AUDIO]&&p.push("audio"),D[M.ElementaryStreamTypes.VIDEO]&&p.push("video"));var v=function(){var d=self.performance.now();x.stats.buffering.end=d,c&&(c.stats.buffering.end=d);var l=c?c.stats:x.stats;u.hls.trigger(_.Events.FRAG_BUFFERED,{frag:x,part:c,stats:l,id:x.type})};p.length===0&&L.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+x.type+" level: "+x.level+" sn: "+x.sn),this.blockBuffers(v,p)},S.onFragChanged=function(o,s){this.flushBackBuffer()},S.onBufferEos=function(o,s){var u=this,x=this.getSourceBufferTypes().reduce(function(c,p){var D=u.sourceBuffer[p];return(!s.type||s.type===p)&&(D&&!D.ended&&(D.ended=!0,L.logger.log("[buffer-controller]: "+p+" sourceBuffer now EOS"))),c&&!!(!D||D.ended)},!0);x&&this.blockBuffers(function(){var c=u.mediaSource;if(!c||c.readyState!=="open")return;c.endOfStream()})},S.onLevelUpdated=function(o,s){var u=s.details;if(!u.fragments.length)return;this.details=u,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},S.flushBackBuffer=function(){var o=this.hls,s=this.details,u=this.media,x=this.sourceBuffer;if(!u||s===null)return;var c=this.getSourceBufferTypes();if(!c.length)return;var p=s.live&&o.config.liveBackBufferLength!==null?o.config.liveBackBufferLength:o.config.backBufferLength;if(!Object(Q.isFiniteNumber)(p)||p<0)return;var D=u.currentTime,v=s.levelTargetDuration,f=Math.max(p,v),d=Math.floor(D/v)*v-f;c.forEach(function(l){var a=x[l];if(a){var g=U.BufferHelper.getBuffered(a);g.length>0&&d>g.start(0)&&(o.trigger(_.Events.BACK_BUFFER_REACHED,{bufferEnd:d}),s.live&&o.trigger(_.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),o.trigger(_.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:l}))}})},S.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var o=this.details,s=this.hls,u=this.media,x=this.mediaSource,c=o.fragments[0].start+o.totalduration,p=u.duration,D=Object(Q.isFiniteNumber)(x.duration)?x.duration:0;o.live&&s.config.liveDurationInfinity?(L.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),x.duration=Infinity,this.updateSeekableRange(o)):(c>D&&c>p||!Object(Q.isFiniteNumber)(p))&&(L.logger.log("[buffer-controller]: Updating Media Source duration to "+c.toFixed(3)),x.duration=c)},S.updateSeekableRange=function(o){var s=this.mediaSource,u=o.fragments,x=u.length;if(x&&o.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var c=Math.max(0,u[0].start),p=Math.max(c,c+o.totalduration);s.setLiveSeekableRange(c,p)}},S.checkPendingTracks=function(){var o=this.bufferCodecEventsExpected,s=this.operationQueue,u=this.pendingTracks,x=Object.keys(u).length;if(x&&!o||x===2){this.createSourceBuffers(u),this.pendingTracks={};var c=this.getSourceBufferTypes();if(c.length===0){this.hls.trigger(_.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}c.forEach(function(p){s.executeNext(p)})}},S.createSourceBuffers=function(o){var s=this.sourceBuffer,u=this.mediaSource;if(!u)throw Error("createSourceBuffers called when mediaSource was null");var x=0;for(var c in o)if(!s[c]){var p=o[c];if(!p)throw Error("source buffer exists for track "+c+", however track does not");var D=p.levelCodec||p.codec,v=p.container+";codecs="+D;L.logger.log("[buffer-controller]: creating sourceBuffer("+v+")");try{var f=s[c]=u.addSourceBuffer(v),d=c;this.addBufferListener(d,"updatestart",this._onSBUpdateStart),this.addBufferListener(d,"updateend",this._onSBUpdateEnd),this.addBufferListener(d,"error",this._onSBUpdateError),this.tracks[c]={buffer:f,codec:D,container:p.container,levelCodec:p.levelCodec,id:p.id},x++}catch(l){L.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+l.message),this.hls.trigger(_.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:l,mimeType:v})}}x&&this.hls.trigger(_.Events.BUFFER_CREATED,{tracks:this.tracks})},S._onSBUpdateStart=function(o){var s=this.operationQueue,u=s.current(o);u.onStart()},S._onSBUpdateEnd=function(o){var s=this.operationQueue,u=s.current(o);u.onComplete(),s.shiftAndExecuteNext(o)},S._onSBUpdateError=function(o,s){L.logger.error("[buffer-controller]: "+o+" SourceBuffer error",s),this.hls.trigger(_.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var u=this.operationQueue.current(o);u&&u.onError(s)},S.removeExecutor=function(o,s,u){var x=this.media,c=this.mediaSource,p=this.operationQueue,D=this.sourceBuffer,v=D[o];if(!x||!c||!v){L.logger.warn("[buffer-controller]: Attempting to remove from the "+o+" SourceBuffer, but it does not exist"),p.shiftAndExecuteNext(o);return}var f=Object(Q.isFiniteNumber)(x.duration)?x.duration:Infinity,d=Object(Q.isFiniteNumber)(c.duration)?c.duration:Infinity,l=Math.max(0,s),a=Math.min(u,f,d);a>l?(L.logger.log("[buffer-controller]: Removing ["+l+","+a+"] from the "+o+" SourceBuffer"),console.assert(!v.updating,o+" sourceBuffer must not be updating"),v.remove(l,a)):p.shiftAndExecuteNext(o)},S.appendExecutor=function(o,s){var u=this.operationQueue,x=this.sourceBuffer,c=x[s];if(!c){L.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),u.shiftAndExecuteNext(s);return}c.ended=!1,console.assert(!c.updating,s+" sourceBuffer must not be updating"),c.appendBuffer(o)},S.blockBuffers=function(o,s){var u=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){L.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(o);return}var x=this.operationQueue,c=s.map(function(p){return x.appendBlocker(p)});Promise.all(c).then(function(){o(),s.forEach(function(p){var D=u.sourceBuffer[p];(!D||!D.updating)&&x.shiftAndExecuteNext(p)})})},S.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},S.addBufferListener=function(o,s,u){var x=this.sourceBuffer[o];if(!x)return;var c=u.bind(this,o);this.listeners[o].push({event:s,listener:c}),x.addEventListener(s,c)},S.removeBufferListeners=function(o){var s=this.sourceBuffer[o];if(!s)return;this.listeners[o].forEach(function(u){s.removeEventListener(u.event,u.listener)})},A}()},"./src/controller/buffer-operation-queue.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return _});var Q=R("./src/utils/logger.ts"),_=function(){function L(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var W=L.prototype;return W.append=function(O,M){var y=this.queues[M];y.push(O),y.length===1&&this.buffers[M]&&this.executeNext(M)},W.insertAbort=function(O,M){var y=this.queues[M];y.unshift(O),this.executeNext(M)},W.appendBlocker=function(O){var M,y=new Promise(function(I){M=I}),C={execute:M,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(C,O),y},W.executeNext=function(O){var M=this.buffers,y=this.queues,C=M[O],I=y[O];if(I.length){var w=I[0];try{w.execute()}catch(A){Q.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),w.onError(A),(!C||!C.updating)&&(I.shift(),this.executeNext(O))}}},W.shiftAndExecuteNext=function(O){this.queues[O].shift(),this.executeNext(O)},W.current=function(O){return this.queues[O][0]},L}()},"./src/controller/cap-level-controller.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/events.ts");function _(U,O){for(var M=0;M<O.length;M++){var y=O[M];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(U,y.key,y)}}function L(U,O,M){return O&&_(U.prototype,O),M&&_(U,M),U}var W=function(){function U(M){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=M,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var O=U.prototype;return O.setStreamController=function(y){this.streamController=y},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 y=this.hls;y.on(Q.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.on(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(Q.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},O.unregisterListener=function(){var y=this.hls;y.off(Q.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.off(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(Q.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},O.onFpsDropLevelCapping=function(y,C){U.isLevelAllowed(C.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(C.droppedLevel)},O.onMediaAttaching=function(y,C){this.media=C.media instanceof HTMLVideoElement?C.media:null},O.onManifestParsed=function(y,C){var I=this.hls;this.restrictedLevels=[],this.firstLevel=C.firstLevel,I.config.capLevelToPlayerSize&&C.video&&this.startCapping()},O.onBufferCodecs=function(y,C){var I=this.hls;I.config.capLevelToPlayerSize&&C.video&&this.startCapping()},O.onMediaDetaching=function(){this.stopCapping()},O.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var y=this.hls.levels;if(y.length){var C=this.hls;C.autoLevelCapping=this.getMaxLevel(y.length-1),C.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=C.autoLevelCapping}}},O.getMaxLevel=function(y){var C=this,I=this.hls.levels;if(!I.length)return-1;var w=I.filter(function(A,S){return U.isLevelAllowed(S,C.restrictedLevels)&&S<=y});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 y=this.media,C={width:0,height:0};if(y){var I=y.getBoundingClientRect();C.width=I.width,C.height=I.height,!C.width&&!C.height&&(C.width=I.right-I.left||y.width||0,C.height=I.bottom-I.top||y.height||0)}return this.clientRect=C,C},U.isLevelAllowed=function(y,C){return C===void 0&&(C=[]),C.indexOf(y)===-1},U.getMaxLevelByMediaSize=function(y,C,I){if(!y||!y.length)return-1;for(var w=function(s,u){return u?s.width!==u.width||s.height!==u.height:!0},A=y.length-1,S=0;S<y.length;S+=1){var h=y[S];if((h.width>=C||h.height>=I)&&w(h,y[S+1])){A=S;break}}return A},L(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 y=1;try{y=self.devicePixelRatio}catch(C){}return y}}]),U}();Z.default=W},"./src/controller/cmcd-controller.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return w});var Q=R("./src/events.ts"),_=R("./src/types/cmcd.ts"),L=R("./src/utils/buffer-helper.ts"),W=R("./src/utils/logger.ts");function U(A,S){for(var h=0;h<S.length;h++){var o=S[h];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(A,o.key,o)}}function O(A,S,h){return S&&U(A.prototype,S),h&&U(A,h),A}function M(A,S){var h=typeof Symbol!="undefined"&&A[Symbol.iterator]||A["@@iterator"];if(h)return(h=h.call(A)).next.bind(h);if(Array.isArray(A)||(h=y(A))||S&&A&&typeof A.length=="number"){h&&(A=h);var o=0;return function(){return o>=A.length?{done:!0}:{done:!1,value:A[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y(A,S){if(!A)return;if(typeof A=="string")return C(A,S);var h=Object.prototype.toString.call(A).slice(8,-1);if(h==="Object"&&A.constructor&&(h=A.constructor.name),h==="Map"||h==="Set")return Array.from(A);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return C(A,S)}function C(A,S){(S==null||S>A.length)&&(S=A.length);for(var h=0,o=new Array(S);h<S;h++)o[h]=A[h];return o}function I(){return I=Object.assign||function(A){for(var S=1;S<arguments.length;S++){var h=arguments[S];for(var o in h)Object.prototype.hasOwnProperty.call(h,o)&&(A[o]=h[o])}return A},I.apply(this,arguments)}var w=function(){function A(h){var o=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){o.initialized&&(o.starved=!0),o.buffering=!0},this.onPlaying=function(){o.initialized||(o.initialized=!0),o.buffering=!1},this.applyPlaylistData=function(x){try{o.apply(x,{ot:_.CMCDObjectType.MANIFEST,su:!o.initialized})}catch(c){W.logger.warn("Could not generate manifest CMCD data.",c)}},this.applyFragmentData=function(x){try{var c=x.frag,p=o.hls.levels[c.level],D=o.getObjectType(c),v={d:c.duration*1e3,ot:D};(D===_.CMCDObjectType.VIDEO||D===_.CMCDObjectType.AUDIO||D==_.CMCDObjectType.MUXED)&&(v.br=p.bitrate/1e3,v.tb=o.getTopBandwidth(D),v.bl=o.getBufferLength(D)),o.apply(x,v)}catch(f){W.logger.warn("Could not generate segment CMCD data.",f)}},this.hls=h;var s=this.config=h.config,u=s.cmcd;u!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=u.sessionId||A.uuid(),this.cid=u.contentId,this.useHeaders=u.useHeaders===!0,this.registerListeners())}var S=A.prototype;return S.registerListeners=function(){var o=this.hls;o.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.on(Q.Events.BUFFER_CREATED,this.onBufferCreated,this)},S.unregisterListeners=function(){var o=this.hls;o.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.off(Q.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},S.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},S.onMediaAttached=function(o,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},S.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},S.onBufferCreated=function(o,s){var u,x;this.audioBuffer=(u=s.tracks.audio)===null||u===void 0?void 0:u.buffer,this.videoBuffer=(x=s.tracks.video)===null||x===void 0?void 0:x.buffer},S.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}},S.apply=function(o,s){s===void 0&&(s={}),I(s,this.createData());var u=s.ot===_.CMCDObjectType.INIT||s.ot===_.CMCDObjectType.VIDEO||s.ot===_.CMCDObjectType.MUXED;if(this.starved&&u&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var x=A.toHeaders(s);if(!Object.keys(x).length)return;o.headers||(o.headers={}),I(o.headers,x)}else{var c=A.toQuery(s);if(!c)return;o.url=A.appendQueryToUri(o.url,c)}},S.getObjectType=function(o){var s=o.type;return s==="subtitle"?_.CMCDObjectType.TIMED_TEXT:o.sn==="initSegment"?_.CMCDObjectType.INIT:s==="audio"?_.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?_.CMCDObjectType.VIDEO:_.CMCDObjectType.MUXED:void 0},S.getTopBandwidth=function(o){for(var s=0,u=o===_.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,x=M(u),c;!(c=x()).done;){var p=c.value;p.bitrate>s&&(s=p.bitrate)}return s>0?s:NaN},S.getBufferLength=function(o){var s=this.hls.media,u=o===_.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!u||!s)return NaN;var x=L.BufferHelper.bufferInfo(u,s.currentTime,this.config.maxBufferHole);return x.len*1e3},S.createPlaylistLoader=function(){var o=this.config.pLoader,s=this.applyPlaylistData,u=o||this.config.loader;return function(){function x(p){this.loader=void 0,this.loader=new u(p)}var c=x.prototype;return c.destroy=function(){this.loader.destroy()},c.abort=function(){this.loader.abort()},c.load=function(D,v,f){s(D),this.loader.load(D,v,f)},O(x,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),x}()},S.createFragmentLoader=function(){var o=this.config.fLoader,s=this.applyFragmentData,u=o||this.config.loader;return function(){function x(p){this.loader=void 0,this.loader=new u(p)}var c=x.prototype;return c.destroy=function(){this.loader.destroy()},c.abort=function(){this.loader.abort()},c.load=function(D,v,f){s(D),this.loader.load(D,v,f)},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),s=o.toString();return URL.revokeObjectURL(o),s.substr(s.lastIndexOf("/")+1)},A.serialize=function(o){for(var s=[],u=function(H){return!Number.isNaN(H)&&H!=null&&H!==""&&H!==!1},x=function(H){return Math.round(H)},c=function(H){return x(H/100)*100},p=function(H){return encodeURIComponent(H)},D={br:x,d:x,bl:c,dl:c,mtp:c,nor:p,rtp:c,tb:x},v=Object.keys(o||{}).sort(),f=M(v),d;!(d=f()).done;){var l=d.value,a=o[l];if(!u(a))continue;if(l==="v"&&a===1)continue;if(l=="pr"&&a===1)continue;var g=D[l];g&&(a=g(a));var m=typeof a,b=void 0;l==="ot"||l==="sf"||l==="st"?b=l+"="+a:m==="boolean"?b=l:m==="number"?b=l+"="+a:b=l+"="+JSON.stringify(a),s.push(b)}return s.join(",")},A.toHeaders=function(o){for(var s=Object.keys(o),u={},x=["Object","Request","Session","Status"],c=[{},{},{},{}],p={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},D=0,v=s;D<v.length;D++){var f=v[D],d=p[f]!=null?p[f]:1;c[d][f]=o[f]}for(var l=0;l<c.length;l++){var a=A.serialize(c[l]);a&&(u["CMCD-"+x[l]]=a)}return u},A.toQuery=function(o){return"CMCD="+encodeURIComponent(A.serialize(o))},A.appendQueryToUri=function(o,s){if(!s)return o;var u=o.includes("?")?"&":"?";return""+o+u+s},A}()},"./src/controller/eme-controller.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/events.ts"),_=R("./src/errors.ts"),L=R("./src/utils/logger.ts"),W=R("./src/utils/mediakeys-helper.ts");function U(w,A){for(var S=0;S<A.length;S++){var h=A[S];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(w,h.key,h)}}function O(w,A,S){return A&&U(w.prototype,A),S&&U(w,S),w}var M=3,y=function(A,S,h){var o={audioCapabilities:[],videoCapabilities:[]};return A.forEach(function(s){o.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:h.audioRobustness||""})}),S.forEach(function(s){o.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:h.videoRobustness||""})}),[o]},C=function(A,S,h,o){switch(A){case W.KeySystems.WIDEVINE:return y(S,h,o);default:throw new Error("Unknown key-system: "+A)}},I=function(){function w(S){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=S,this._config=S.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(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this)},A._unregisterListeners=function(){this.hls.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this)},A.getLicenseServerUrl=function(h){switch(h){case W.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+h+'"')},A._attemptKeySystemAccess=function(h,o,s){var u=this,x=C(h,o,s,this._drmSystemOptions);L.logger.log("Requesting encrypted media key-system access");var c=this.requestMediaKeySystemAccess(h,x);this.mediaKeysPromise=c.then(function(p){return u._onMediaKeySystemAccessObtained(h,p)}),c.catch(function(p){L.logger.error('Failed to obtain key-system "'+h+'" access:',p)})},A._onMediaKeySystemAccessObtained=function(h,o){var s=this;L.logger.log('Access for key-system "'+h+'" obtained');var u={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:o,mediaKeySystemDomain:h};this._mediaKeysList.push(u);var x=Promise.resolve().then(function(){return o.createMediaKeys()}).then(function(c){return u.mediaKeys=c,L.logger.log('Media-keys created for key-system "'+h+'"'),s._onMediaKeysCreated(),c});return x.catch(function(c){L.logger.error("Failed to create media-keys:",c)}),x},A._onMediaKeysCreated=function(){var h=this;this._mediaKeysList.forEach(function(o){o.mediaKeysSession||(o.mediaKeysSession=o.mediaKeys.createSession(),h._onNewMediaKeySession(o.mediaKeysSession))})},A._onNewMediaKeySession=function(h){var o=this;L.logger.log("New key-system session "+h.sessionId),h.addEventListener("message",function(s){o._onKeySessionMessage(h,s.message)},!1)},A._onKeySessionMessage=function(h,o){L.logger.log("Got EME message event, creating license request"),this._requestLicense(o,function(s){L.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),h.update(s)})},A.onMediaEncrypted=function(h){var o=this;if(L.logger.log('Media is encrypted using "'+h.initDataType+'" init data type'),!this.mediaKeysPromise){L.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(Q.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(x){if(!o._media)return;o._attemptSetMediaKeys(x),o._generateRequestWithPreferredKeySession(h.initDataType,h.initData)};this.mediaKeysPromise.then(s).catch(s)},A._attemptSetMediaKeys=function(h){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var o=this._mediaKeysList[0];if(!o||!o.mediaKeys){L.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(Q.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}L.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(o.mediaKeys),this._hasSetMediaKeys=!0}},A._generateRequestWithPreferredKeySession=function(h,o){var s=this,u=this._mediaKeysList[0];if(!u){L.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(Q.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(u.mediaKeysSessionInitialized){L.logger.warn("Key-Session already initialized but requested again");return}var x=u.mediaKeysSession;if(!x){L.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(Q.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!o){L.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(Q.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}L.logger.log('Generating key-session request for "'+h+'" init data type'),u.mediaKeysSessionInitialized=!0,x.generateRequest(h,o).then(function(){L.logger.debug("Key-session generation succeeded")}).catch(function(c){L.logger.error("Error generating key-session request:",c),s.hls.trigger(Q.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},A._createLicenseXhr=function(h,o,s){var u=new XMLHttpRequest;u.responseType="arraybuffer",u.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,u,h,o,s);var x=this._licenseXhrSetup;if(x)try{x.call(this.hls,u,h),x=void 0}catch(c){L.logger.error(c)}try{u.readyState||u.open("POST",h,!0),x&&x.call(this.hls,u,h)}catch(c){throw new Error("issue setting up KeySystem license XHR "+c)}return u},A._onLicenseRequestReadyStageChange=function(h,o,s,u){switch(h.readyState){case 4:if(h.status===200){this._requestLicenseFailureCount=0,L.logger.log("License request succeeded");var x=h.response,c=this._licenseResponseCallback;if(c)try{x=c.call(this.hls,h,o)}catch(D){L.logger.error(D)}u(x)}else{if(L.logger.error("License Request XHR failed ("+o+"). Status: "+h.status+" ("+h.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>M){this.hls.trigger(Q.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var p=M-this._requestLicenseFailureCount+1;L.logger.warn("Retrying license request, "+p+" attempts left"),this._requestLicense(s,u)}break}},A._generateLicenseRequestChallenge=function(h,o){switch(h.mediaKeySystemDomain){case W.KeySystems.WIDEVINE:return o}throw new Error("unsupported key-system: "+h.mediaKeySystemDomain)},A._requestLicense=function(h,o){L.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){L.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(Q.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var u=this.getLicenseServerUrl(s.mediaKeySystemDomain),x=this._createLicenseXhr(u,h,o);L.logger.log("Sending license request to URL: "+u);var c=this._generateLicenseRequestChallenge(s,h);x.send(c)}catch(p){L.logger.error("Failure requesting DRM license: "+p),this.hls.trigger(Q.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},A.onMediaAttached=function(h,o){if(!this._emeEnabled)return;var s=o.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},A.onMediaDetached=function(){var h=this._media,o=this._mediaKeysList;if(!h)return;h.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(o.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return h.setMediaKeys(null)}).catch(function(){})},A.onManifestParsed=function(h,o){if(!this._emeEnabled)return;var s=o.levels.map(function(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(W.KeySystems.WIDEVINE,s,u)},O(w,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),w}();Z.default=I},"./src/controller/fps-controller.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/events.ts"),_=R("./src/utils/logger.ts"),L=function(){function W(O){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=O,this.registerListeners()}var U=W.prototype;return U.setStreamController=function(M){this.streamController=M},U.registerListeners=function(){this.hls.on(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},U.unregisterListeners=function(){this.hls.off(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching)},U.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},U.onMediaAttaching=function(M,y){var C=this.hls.config;if(C.capLevelOnFPSDrop){var I=y.media instanceof self.HTMLVideoElement?y.media:null;this.media=I,I&&typeof I.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),C.fpsDroppedMonitoringPeriod)}},U.checkFPS=function(M,y,C){var I=performance.now();if(y){if(this.lastTime){var w=I-this.lastTime,A=C-this.lastDroppedFrames,S=y-this.lastDecodedFrames,h=1e3*A/w,o=this.hls;if(o.trigger(Q.Events.FPS_DROP,{currentDropped:A,currentDecoded:S,totalDroppedFrames:C}),h>0&&A>o.config.fpsDroppedMonitoringThreshold*S){var s=o.currentLevel;_.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(o.autoLevelCapping===-1||o.autoLevelCapping>=s)&&(s=s-1,o.trigger(Q.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:o.currentLevel}),o.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=I,this.lastDroppedFrames=C,this.lastDecodedFrames=y}},U.checkFPSInterval=function(){var M=this.media;if(M)if(this.isVideoPlaybackQualityAvailable){var y=M.getVideoPlaybackQuality();this.checkFPS(M,y.totalVideoFrames,y.droppedVideoFrames)}else this.checkFPS(M,M.webkitDecodedFrameCount,M.webkitDroppedFrameCount)},W}();Z.default=L},"./src/controller/fragment-finders.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"findFragmentByPDT",function(){return L}),R.d(Z,"findFragmentByPTS",function(){return W}),R.d(Z,"fragmentWithinToleranceTest",function(){return U}),R.d(Z,"pdtWithinToleranceTest",function(){return O}),R.d(Z,"findFragWithCC",function(){return M});var Q=R("./src/polyfills/number.ts"),_=R("./src/utils/binary-search.ts");function L(y,C,I){if(C===null||!Array.isArray(y)||!y.length||!Object(Q.isFiniteNumber)(C))return null;var w=y[0].programDateTime;if(C<(w||0))return null;var A=y[y.length-1].endProgramDateTime;if(C>=(A||0))return null;I=I||0;for(var S=0;S<y.length;++S){var h=y[S];if(O(C,I,h))return h}return null}function W(y,C,I,w){I===void 0&&(I=0),w===void 0&&(w=0);var A=null;if(y?A=C[y.sn-C[0].sn+1]||null:I===0&&C[0].start===0&&(A=C[0]),A&&U(I,w,A)===0)return A;var S=_.default.search(C,U.bind(null,I,w));return S||A}function U(y,C,I){y===void 0&&(y=0),C===void 0&&(C=0);var w=Math.min(C,I.duration+(I.deltaPTS?I.deltaPTS:0));return I.start+I.duration-w<=y?1:I.start-w>y&&I.start?-1:0}function O(y,C,I){var w=Math.min(C,I.duration+(I.deltaPTS?I.deltaPTS:0))*1e3,A=I.endProgramDateTime||0;return A-w>y}function M(y,C){return _.default.search(y,function(I){return I.cc<C?1:I.cc>C?-1:0})}},"./src/controller/fragment-tracker.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"FragmentState",function(){return L}),R.d(Z,"FragmentTracker",function(){return W});var Q=R("./src/events.ts"),_=R("./src/types/loader.ts"),L;(function(M){M.NOT_LOADED="NOT_LOADED",M.BACKTRACKED="BACKTRACKED",M.APPENDING="APPENDING",M.PARTIAL="PARTIAL",M.OK="OK"})(L||(L={}));var W=function(){function M(C){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=C,this._registerListeners()}var y=M.prototype;return y._registerListeners=function(){var I=this.hls;I.on(Q.Events.BUFFER_APPENDED,this.onBufferAppended,this),I.on(Q.Events.FRAG_BUFFERED,this.onFragBuffered,this),I.on(Q.Events.FRAG_LOADED,this.onFragLoaded,this)},y._unregisterListeners=function(){var I=this.hls;I.off(Q.Events.BUFFER_APPENDED,this.onBufferAppended,this),I.off(Q.Events.FRAG_BUFFERED,this.onFragBuffered,this),I.off(Q.Events.FRAG_LOADED,this.onFragLoaded,this)},y.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},y.getAppendedFrag=function(I,w){if(w===_.PlaylistLevelType.MAIN){var A=this.activeFragment,S=this.activeParts;if(!A)return null;if(S)for(var h=S.length;h--;){var o=S[h],s=o?o.end:A.appendedPTS;if(o.start<=I&&s!==void 0&&I<=s)return h>9&&(this.activeParts=S.slice(h-9)),o}else if(A.start<=I&&A.appendedPTS!==void 0&&I<=A.appendedPTS)return A}return this.getBufferedFrag(I,w)},y.getBufferedFrag=function(I,w){for(var A=this.fragments,S=Object.keys(A),h=S.length;h--;){var o=A[S[h]];if((o==null?void 0:o.body.type)===w&&o.buffered){var s=o.body;if(s.start<=I&&I<=s.end)return s}}return null},y.detectEvictedFragments=function(I,w,A){var S=this;Object.keys(this.fragments).forEach(function(h){var o=S.fragments[h];if(!o)return;if(!o.buffered){o.body.type===A&&S.removeFragment(o.body);return}var s=o.range[I];if(!s)return;s.time.some(function(u){var x=!S.isTimeBuffered(u.startPTS,u.endPTS,w);return x&&S.removeFragment(o.body),x})})},y.detectPartialFragments=function(I){var w=this,A=this.timeRanges,S=I.frag,h=I.part;if(!A||S.sn==="initSegment")return;var o=O(S),s=this.fragments[o];if(!s)return;Object.keys(A).forEach(function(u){var x=S.elementaryStreams[u];if(!x)return;var c=A[u],p=h!==null||x.partial===!0;s.range[u]=w.getBufferedTimes(S,h,p,c)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},y.fragBuffered=function(I){var w=O(I),A=this.fragments[w];A&&(A.backtrack=A.loaded=null,A.buffered=!0)},y.getBufferedTimes=function(I,w,A,S){for(var h={time:[],partial:A},o=w?w.start:I.start,s=w?w.end:I.end,u=I.minEndPTS||s,x=I.maxStartPTS||o,c=0;c<S.length;c++){var p=S.start(c)-this.bufferPadding,D=S.end(c)+this.bufferPadding;if(x>=p&&u<=D){h.time.push({startPTS:Math.max(o,S.start(c)),endPTS:Math.min(s,S.end(c))});break}else if(o<D&&s>p)h.partial=!0,h.time.push({startPTS:Math.max(o,S.start(c)),endPTS:Math.min(s,S.end(c))});else if(s<=p)break}return h},y.getPartialFragment=function(I){var w=null,A,S,h,o=0,s=this.bufferPadding,u=this.fragments;return Object.keys(u).forEach(function(x){var c=u[x];if(!c)return;U(c)&&(S=c.body.start-s,h=c.body.end+s,I>=S&&I<=h&&(A=Math.min(I-S,h-I),o<=A&&(w=c.body,o=A)))}),w},y.getState=function(I){var w=O(I),A=this.fragments[w];return A?A.buffered?U(A)?L.PARTIAL:L.OK:A.backtrack?L.BACKTRACKED:L.APPENDING:L.NOT_LOADED},y.backtrack=function(I,w){var A=O(I),S=this.fragments[A];if(!S||S.backtrack)return null;var h=S.backtrack=w||S.loaded;return S.loaded=null,h},y.getBacktrackData=function(I){var w=O(I),A=this.fragments[w];if(A){var S,h=A.backtrack;if(h!=null&&(S=h.payload)!==null&&S!==void 0&&S.byteLength)return h;this.removeFragment(I)}return null},y.isTimeBuffered=function(I,w,A){for(var S,h,o=0;o<A.length;o++){if(S=A.start(o)-this.bufferPadding,h=A.end(o)+this.bufferPadding,I>=S&&w<=h)return!0;if(w<=S)return!1}return!1},y.onFragLoaded=function(I,w){var A=w.frag,S=w.part;if(A.sn==="initSegment"||A.bitrateTest||S)return;var h=O(A);this.fragments[h]={body:A,loaded:w,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(I,w){var A=this,S=w.frag,h=w.part,o=w.timeRanges;if(S.type===_.PlaylistLevelType.MAIN)if(this.activeFragment=S,h){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(h)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach(function(u){var x=o[u];if(A.detectEvictedFragments(u,x),!h)for(var c=0;c<x.length;c++)S.appendedPTS=Math.max(x.end(c),S.appendedPTS||0)})},y.onFragBuffered=function(I,w){this.detectPartialFragments(w)},y.hasFragment=function(I){var w=O(I);return!!this.fragments[w]},y.removeFragmentsInRange=function(I,w,A){var S=this;Object.keys(this.fragments).forEach(function(h){var o=S.fragments[h];if(!o)return;if(o.buffered){var s=o.body;s.type===A&&s.start<w&&s.end>I&&S.removeFragment(s)}})},y.removeFragment=function(I){var w=O(I);I.stats.loaded=0,I.clearElementaryStreamInfo(),delete this.fragments[w]},y.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},M}();function U(M){var y,C;return M.buffered&&(((y=M.range.video)===null||y===void 0?void 0:y.partial)||((C=M.range.audio)===null||C===void 0?void 0:C.partial))}function O(M){return M.type+"_"+M.level+"_"+M.urlId+"_"+M.sn}},"./src/controller/gap-controller.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"STALL_MINIMUM_DURATION_MS",function(){return U}),R.d(Z,"MAX_START_GAP_JUMP",function(){return O}),R.d(Z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return M}),R.d(Z,"SKIP_BUFFER_RANGE_START",function(){return y}),R.d(Z,"default",function(){return C});var Q=R("./src/utils/buffer-helper.ts"),_=R("./src/errors.ts"),L=R("./src/events.ts"),W=R("./src/utils/logger.ts"),U=250,O=2,M=.1,y=.05,C=function(){function I(A,S,h,o){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=A,this.media=S,this.fragmentTracker=h,this.hls=o}var w=I.prototype;return w.destroy=function(){this.hls=this.fragmentTracker=this.media=null},w.poll=function(S){var h=this.config,o=this.media,s=this.stalled,u=o.currentTime,x=o.seeking,c=this.seeking&&!x,p=!this.seeking&&x;if(this.seeking=x,u!==S){if(this.moved=!0,s!==null){if(this.stallReported){var D=self.performance.now()-s;W.logger.warn("playback not stuck anymore @"+u+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((p||c)&&(this.stalled=null),o.paused||o.ended||o.playbackRate===0||!Q.BufferHelper.getBuffered(o).length)return;var v=Q.BufferHelper.bufferInfo(o,u,0),f=v.len>0,d=v.nextStart||0;if(!f&&!d)return;if(x){var l=v.len>O,a=!d||d-u>O&&!this.fragmentTracker.getPartialFragment(u);if(l||a)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var g,m=Math.max(d,v.start||0)-u,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=b==null||((g=b.details)===null||g===void 0)?void 0:g.live,H=P?b.details.targetduration*2:O;if(m>0&&m<=H){this._trySkipBufferHole(null);return}}var V=self.performance.now();if(s===null){this.stalled=V;return}var re=V-s;!x&&re>=U&&this._reportStall(v.len);var z=Q.BufferHelper.bufferInfo(o,u,h.maxBufferHole);this._tryFixBufferStall(z,re)},w._tryFixBufferStall=function(S,h){var o=this.config,s=this.fragmentTracker,u=this.media,x=u.currentTime,c=s.getPartialFragment(x);if(c){var p=this._trySkipBufferHole(c);if(p)return}S.len>o.maxBufferHole&&h>o.highBufferWatchdogPeriod*1e3&&(W.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},w._reportStall=function(S){var h=this.hls,o=this.media,s=this.stallReported;s||(this.stallReported=!0,W.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer (buffer="+S+")"),h.trigger(L.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:S}))},w._trySkipBufferHole=function(S){for(var h=this.config,o=this.hls,s=this.media,u=s.currentTime,x=0,c=Q.BufferHelper.getBuffered(s),p=0;p<c.length;p++){var D=c.start(p);if(u+h.maxBufferHole>=x&&u<D){var v=Math.max(D+y,s.currentTime+M);return W.logger.warn("skipping hole, adjusting currentTime from "+u+" to "+v),this.moved=!0,this.stalled=null,s.currentTime=v,S&&o.trigger(L.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+u+" to "+v,frag:S}),v}x=c.end(p)}return 0},w._tryNudgeBuffer=function(){var S=this.config,h=this.hls,o=this.media,s=o.currentTime,u=(this.nudgeRetry||0)+1;if(this.nudgeRetry=u,u<S.nudgeMaxRetry){var x=s+u*S.nudgeOffset;W.logger.warn("Nudging 'currentTime' from "+s+" to "+x),o.currentTime=x,h.trigger(L.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else W.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+S.nudgeMaxRetry+" nudges"),h.trigger(L.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},I}()},"./src/controller/id3-track-controller.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/events.ts"),_=R("./src/utils/texttrack-utils.ts"),L=R("./src/demux/id3.ts"),W=.25,U=function(){function O(y){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=y,this._registerListeners()}var M=O.prototype;return M.destroy=function(){this._unregisterListeners()},M._registerListeners=function(){var C=this.hls;C.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(Q.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),C.on(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},M._unregisterListeners=function(){var C=this.hls;C.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(Q.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),C.off(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},M.onMediaAttached=function(C,I){this.media=I.media},M.onMediaDetaching=function(){if(!this.id3Track)return;Object(_.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},M.getID3Track=function(C){if(!this.media)return;for(var I=0;I<C.length;I++){var w=C[I];if(w.kind==="metadata"&&w.label==="id3")return Object(_.sendAddTrackEvent)(w,this.media),w}return this.media.addTextTrack("metadata","id3")},M.onFragParsingMetadata=function(C,I){if(!this.media)return;var w=I.frag,A=I.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var S=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,h=0;h<A.length;h++){var o=L.getID3Frames(A[h].data);if(o){var s=A[h].pts,u=h<A.length-1?A[h+1].pts:w.end,x=u-s;x<=0&&(u=s+W);for(var c=0;c<o.length;c++){var p=o[c];if(!L.isTimeStampFrame(p)){var D=new S(s,u,"");D.value=p,this.id3Track.addCue(D)}}}}},M.onBufferFlushing=function(C,I){var w=I.startOffset,A=I.endOffset,S=I.type;if(!S||S==="audio"){var h=this.id3Track;h&&Object(_.removeCuesInRange)(h,w,A)}},O}();Z.default=U},"./src/controller/latency-controller.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return O});var Q=R("./src/errors.ts"),_=R("./src/events.ts"),L=R("./src/utils/logger.ts");function W(M,y){for(var C=0;C<y.length;C++){var I=y[C];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(M,I.key,I)}}function U(M,y,C){return y&&W(M.prototype,y),C&&W(M,C),M}var O=function(){function M(C){var I=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return I.timeupdate()},this.hls=C,this.config=C.config,this.registerListeners()}var y=M.prototype;return y.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},y.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)},y.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)},y.onMediaAttached=function(I,w){this.media=w.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},y.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},y.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},y.onLevelUpdated=function(I,w){var A=w.details;this.levelDetails=A,A.advanced&&this.timeupdate(),!A.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},y.onError=function(I,w){if(w.details!==Q.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,L.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},y.timeupdate=function(){var I=this.media,w=this.levelDetails;if(!I||!w)return;this.currentTime=I.currentTime;var A=this.computeLatency();if(A===null)return;this._latency=A;var S=this.config,h=S.lowLatencyMode,o=S.maxLiveSyncPlaybackRate;if(!h||o===1)return;var s=this.targetLatency;if(s===null)return;var u=A-s,x=Math.min(this.maxLatency,s+w.targetduration),c=u<x;if(w.live&&c&&u>.05&&this.forwardBufferLength>1){var p=Math.min(2,Math.max(1,o)),D=Math.round(2/(1+Math.exp(-.75*u-this.edgeStalled))*20)/20;I.playbackRate=Math.min(p,Math.max(1,D))}else I.playbackRate!==1&&I.playbackRate!==0&&(I.playbackRate=1)},y.estimateLiveEdge=function(){var I=this.levelDetails;return I===null?null:I.edge+I.age},y.computeLatency=function(){var I=this.estimateLiveEdge();return I===null?null:I-this.currentTime},U(M,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var I=this.config,w=this.levelDetails;return I.liveMaxLatencyDuration!==void 0?I.liveMaxLatencyDuration:w?I.liveMaxLatencyDurationCount*w.targetduration:0}},{key:"targetLatency",get:function(){var I=this.levelDetails;if(I===null)return null;var w=I.holdBack,A=I.partHoldBack,S=I.targetduration,h=this.config,o=h.liveSyncDuration,s=h.liveSyncDurationCount,u=h.lowLatencyMode,x=this.hls.userConfig,c=u&&A||w;(x.liveSyncDuration||x.liveSyncDurationCount||c===0)&&(c=o!==void 0?o:s*S);var p=S,D=1;return c+Math.min(this.stallCount*D,p)}},{key:"liveSyncPosition",get:function(){var I=this.estimateLiveEdge(),w=this.targetLatency,A=this.levelDetails;if(I===null||w===null||A===null)return null;var S=A.edge,h=I-w-this.edgeStalled,o=S-A.totalduration,s=S-(this.config.lowLatencyMode&&A.partTarget||A.targetduration);return Math.min(Math.max(o,h),s)}},{key:"drift",get:function(){var I=this.levelDetails;return I===null?1:I.drift}},{key:"edgeStalled",get:function(){var I=this.levelDetails;if(I===null)return 0;var w=(this.config.lowLatencyMode&&I.partTarget||I.targetduration)*3;return Math.max(I.age-w,0)}},{key:"forwardBufferLength",get:function(){var I=this.media,w=this.levelDetails;if(!I||!w)return 0;var A=I.buffered.length;return A?I.buffered.end(A-1):w.edge-this.currentTime}}]),M}()},"./src/controller/level-controller.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return h});var Q=R("./src/types/level.ts"),_=R("./src/events.ts"),L=R("./src/errors.ts"),W=R("./src/utils/codecs.ts"),U=R("./src/controller/level-helper.ts"),O=R("./src/controller/base-playlist-controller.ts"),M=R("./src/types/loader.ts");function y(){return y=Object.assign||function(o){for(var s=1;s<arguments.length;s++){var u=arguments[s];for(var x in u)Object.prototype.hasOwnProperty.call(u,x)&&(o[x]=u[x])}return o},y.apply(this,arguments)}function C(o,s){for(var u=0;u<s.length;u++){var x=s[u];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(o,x.key,x)}}function I(o,s,u){return s&&C(o.prototype,s),u&&C(o,u),o}function w(o,s){o.prototype=Object.create(s.prototype),o.prototype.constructor=o,A(o,s)}function A(o,s){return A=Object.setPrototypeOf||function(x,c){return x.__proto__=c,x},A(o,s)}var S=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),h=function(o){w(s,o);function s(x){var c;return c=o.call(this,x,"[level-controller]")||this,c._levels=[],c._firstLevel=-1,c._startLevel=void 0,c.currentLevelIndex=-1,c.manualLevelIndex=-1,c.onParsedComplete=void 0,c._registerListeners(),c}var u=s.prototype;return u._registerListeners=function(){var c=this.hls;c.on(_.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.on(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(_.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.on(_.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(_.Events.ERROR,this.onError,this)},u._unregisterListeners=function(){var c=this.hls;c.off(_.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.off(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(_.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.off(_.Events.FRAG_LOADED,this.onFragLoaded,this),c.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 c=this._levels;c.forEach(function(p){p.loadError=0}),o.prototype.startLoad.call(this)},u.onManifestLoaded=function(c,p){var D=[],v=[],f=[],d,l={},a,g=!1,m=!1,b=!1;if(p.levels.forEach(function(re){var z=re.attrs;g=g||!!(re.width&&re.height),m=m||!!re.videoCodec,b=b||!!re.audioCodec,S&&re.audioCodec&&re.audioCodec.indexOf("mp4a.40.34")!==-1&&(re.audioCodec=void 0);var F=re.bitrate+"-"+re.attrs.RESOLUTION+"-"+re.attrs.CODECS;a=l[F],a?a.url.push(re.url):(a=new Q.Level(re),l[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||m)&&b&&(D=D.filter(function(re){var z=re.videoCodec,F=re.width,ae=re.height;return!!z||!!(F&&ae)})),D=D.filter(function(re){var z=re.audioCodec,F=re.videoCodec;return(!z||Object(W.isCodecSupportedInMp4)(z,"audio"))&&(!F||Object(W.isCodecSupportedInMp4)(F,"video"))}),p.audioTracks&&(v=p.audioTracks.filter(function(re){return!re.audioCodec||Object(W.isCodecSupportedInMp4)(re.audioCodec,"audio")}),Object(U.assignTrackIdsByGroup)(v)),p.subtitles&&(f=p.subtitles,Object(U.assignTrackIdsByGroup)(f)),D.length>0){d=D[0].bitrate,D.sort(function(re,z){return re.bitrate-z.bitrate}),this._levels=D;for(var P=0;P<D.length;P++)if(D[P].bitrate===d){this._firstLevel=P,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+d);break}var H=b&&!m,V={levels:D,audioTracks:v,subtitleTracks:f,firstLevel:this._firstLevel,stats:p.stats,audio:b,video:m,altAudio:!H&&v.some(function(re){return!!re.url})};this.hls.trigger(_.Events.MANIFEST_PARSED,V),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:p.url,reason:"no level with compatible codecs found in manifest"})},u.onError=function(c,p){if(o.prototype.onError.call(this,c,p),p.fatal)return;var D=p.context,v=this._levels[this.currentLevelIndex];if(D&&(D.type===M.PlaylistContextType.AUDIO_TRACK&&v.audioGroupIds&&D.groupId===v.audioGroupIds[v.urlId]||D.type===M.PlaylistContextType.SUBTITLE_TRACK&&v.textGroupIds&&D.groupId===v.textGroupIds[v.urlId])){this.redundantFailover(this.currentLevelIndex);return}var f=!1,d=!0,l;switch(p.details){case L.ErrorDetails.FRAG_LOAD_ERROR:case L.ErrorDetails.FRAG_LOAD_TIMEOUT:case L.ErrorDetails.KEY_LOAD_ERROR:case L.ErrorDetails.KEY_LOAD_TIMEOUT:if(p.frag){var a=this._levels[p.frag.level];a?(a.fragmentError++,a.fragmentError>this.hls.config.fragLoadingMaxRetry&&(l=p.frag.level)):l=p.frag.level}break;case L.ErrorDetails.LEVEL_LOAD_ERROR:case L.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(d=!1),l=D.level),f=!0;break;case L.ErrorDetails.REMUX_ALLOC_ERROR:l=p.level,f=!0;break}l!==void 0&&this.recoverLevel(p,l,f,d)},u.recoverLevel=function(c,p,D,v){var f=c.details,d=this._levels[p];if(d.loadError++,D){var l=this.retryLoadingOrFail(c);if(l)c.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(v){var a=d.url.length;if(a>1&&d.loadError<a)c.levelRetry=!0,this.redundantFailover(p);else if(this.manualLevelIndex===-1){var g=p===0?this._levels.length-1:p-1;this.currentLevelIndex!==g&&this._levels[g].loadError===0&&(this.warn(f+": switch to "+g),c.levelRetry=!0,this.hls.nextAutoLevel=g)}}},u.redundantFailover=function(c){var p=this._levels[c],D=p.url.length;if(D>1){var v=(p.urlId+1)%D;this.warn("Switching to redundant URL-id "+v),this._levels.forEach(function(f){f.urlId=v}),this.level=c}},u.onFragLoaded=function(c,p){var D=p.frag;if(D!==void 0&&D.type===M.PlaylistLevelType.MAIN){var v=this._levels[D.level];v!==void 0&&(v.fragmentError=0,v.loadError=0)}},u.onLevelLoaded=function(c,p){var D,v=p.level,f=p.details,d=this._levels[v];if(!d){var l;this.warn("Invalid level index "+v),(l=p.deliveryDirectives)!==null&&l!==void 0&&l.skip&&(f.deltaUpdateFailed=!0);return}v===this.currentLevelIndex?(d.fragmentError===0&&(d.loadError=0,this.retryCount=0),this.playlistLoaded(v,p,d.details)):(D=p.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(f.deltaUpdateFailed=!0)},u.onAudioTrackSwitched=function(c,p){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var v=-1,f=this.hls.audioTracks[p.id].groupId,d=0;d<D.audioGroupIds.length;d++)if(D.audioGroupIds[d]===f){v=d;break}v!==D.urlId&&(D.urlId=v,this.startLoad())}},u.loadPlaylist=function(c){var p=this.currentLevelIndex,D=this._levels[p];if(this.canLoad&&D&&D.url.length>0){var v=D.urlId,f=D.url[v];if(c)try{f=c.addDirectives(f)}catch(d){this.warn("Could not construct new URL with HLS Delivery Directives: "+d)}this.log("Attempt loading level index "+p+(c?" at sn "+c.msn+" part "+c.part:"")+" with URL-id "+v+" "+f),this.clearTimer(),this.hls.trigger(_.Events.LEVEL_LOADING,{url:f,level:p,id:v,deliveryDirectives:c||null})}},u.removeLevel=function(c,p){var D=function(d,l){return l!==p},v=this._levels.filter(function(f,d){return d!==c?!0:f.url.length>1&&p!==void 0?(f.url=f.url.filter(D),f.audioGroupIds&&(f.audioGroupIds=f.audioGroupIds.filter(D)),f.textGroupIds&&(f.textGroupIds=f.textGroupIds.filter(D)),f.urlId=0,!0):!1}).map(function(f,d){var l=f.details;return l!=null&&l.fragments&&l.fragments.forEach(function(a){a.level=d}),f});this._levels=v,this.hls.trigger(_.Events.LEVELS_UPDATED,{levels:v})},I(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(c){var p,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===c&&(p=D[c])!==null&&p!==void 0&&p.details)return;if(c<0||c>=D.length){var v=c<0;if(this.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.OTHER_ERROR,details:L.ErrorDetails.LEVEL_SWITCH_ERROR,level:c,fatal:v,reason:"invalid level idx"}),v)return;c=Math.min(c,D.length-1)}this.clearTimer();var f=this.currentLevelIndex,d=D[f],l=D[c];this.log("switching to level "+c+" from "+f),this.currentLevelIndex=c;var a=y({},l,{level:c,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete a._urlId,this.hls.trigger(_.Events.LEVEL_SWITCHING,a);var g=l.details;if(!g||g.live){var m=this.switchParams(l.uri,d==null?void 0:d.details);this.loadPlaylist(m)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(c){this.manualLevelIndex=c,this._startLevel===void 0&&(this._startLevel=c),c!==-1&&(this.level=c)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(c){this._firstLevel=c}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var c=this.hls.config.startLevel;return c!==void 0?c:this._firstLevel}else return this._startLevel},set:function(c){this._startLevel=c}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(c){this.level=c,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=c)}}]),s}(O.default)},"./src/controller/level-helper.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"addGroupId",function(){return L}),R.d(Z,"assignTrackIdsByGroup",function(){return W}),R.d(Z,"updatePTS",function(){return U}),R.d(Z,"updateFragPTSDTS",function(){return M}),R.d(Z,"mergeDetails",function(){return y}),R.d(Z,"mapPartIntersection",function(){return C}),R.d(Z,"mapFragmentIntersection",function(){return I}),R.d(Z,"adjustSliding",function(){return w}),R.d(Z,"addSliding",function(){return A}),R.d(Z,"computeReloadInterval",function(){return S}),R.d(Z,"getFragmentWithSN",function(){return h}),R.d(Z,"getPartWith",function(){return o});var Q=R("./src/polyfills/number.ts"),_=R("./src/utils/logger.ts");function L(s,u,x){switch(u){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(x);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(x);break}}function W(s){var u={};s.forEach(function(x){var c=x.groupId||"";x.id=u[c]=u[c]||0,u[c]++})}function U(s,u,x){var c=s[u],p=s[x];O(c,p)}function O(s,u){var x=u.startPTS;if(Object(Q.isFiniteNumber)(x)){var c=0,p;u.sn>s.sn?(c=x-s.start,p=s):(c=s.start-x,p=u),p.duration!==c&&(p.duration=c)}else if(u.sn>s.sn){var D=s.cc===u.cc;D&&s.minEndPTS?u.start=s.start+(s.minEndPTS-s.start):u.start=s.start+s.duration}else u.start=Math.max(s.start-u.duration,0)}function M(s,u,x,c,p,D){var v=c-x;v<=0&&(_.logger.warn("Fragment should have a positive duration",u),c=x+u.duration,D=p+u.duration);var f=x,d=c,l=u.startPTS,a=u.endPTS;if(Object(Q.isFiniteNumber)(l)){var g=Math.abs(l-x);Object(Q.isFiniteNumber)(u.deltaPTS)?u.deltaPTS=Math.max(g,u.deltaPTS):u.deltaPTS=g,f=Math.max(x,l),x=Math.min(x,l),p=Math.min(p,u.startDTS),d=Math.min(c,a),c=Math.max(c,a),D=Math.max(D,u.endDTS)}u.duration=c-x;var m=x-u.start;u.appendedPTS=c,u.start=u.startPTS=x,u.maxStartPTS=f,u.startDTS=p,u.endPTS=c,u.minEndPTS=d,u.endDTS=D;var b=u.sn;if(!s||b<s.startSN||b>s.endSN)return 0;var P,H=b-s.startSN,V=s.fragments;for(V[H]=u,P=H;P>0;P--)O(V[P],V[P-1]);for(P=H;P<V.length-1;P++)O(V[P],V[P+1]);return s.fragmentHint&&O(V[V.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,m}function y(s,u){for(var x=null,c=s.fragments,p=c.length-1;p>=0;p--){var D=c[p].initSegment;if(D){x=D;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var v=0,f;if(I(s,u,function(P,H){P.relurl&&(v=P.cc-H.cc),Object(Q.isFiniteNumber)(P.startPTS)&&Object(Q.isFiniteNumber)(P.endPTS)&&(H.start=H.startPTS=P.startPTS,H.startDTS=P.startDTS,H.appendedPTS=P.appendedPTS,H.maxStartPTS=P.maxStartPTS,H.endPTS=P.endPTS,H.endDTS=P.endDTS,H.minEndPTS=P.minEndPTS,H.duration=P.endPTS-P.startPTS,H.duration&&(f=H),u.PTSKnown=u.alignedSliding=!0),H.elementaryStreams=P.elementaryStreams,H.loader=P.loader,H.stats=P.stats,H.urlId=P.urlId,P.initSegment&&(H.initSegment=P.initSegment,x=P.initSegment)}),x){var d=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments;d.forEach(function(P){var H;(!P.initSegment||P.initSegment.relurl===((H=x)===null||H===void 0?void 0:H.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 l=u.skippedSegments;l--;)u.fragments.shift();u.startSN=u.fragments[0].sn,u.startCC=u.fragments[0].cc}var a=u.fragments;if(v){_.logger.warn("discontinuity sliding from playlist, take drift into account");for(var g=0;g<a.length;g++)a[g].cc+=v}u.skippedSegments&&(u.startCC=u.fragments[0].cc),C(s.partList,u.partList,function(P,H){H.elementaryStreams=P.elementaryStreams,H.stats=P.stats}),f?M(u,f,f.startPTS,f.endPTS,f.startDTS,f.endDTS):w(s,u),a.length&&(u.totalduration=u.edge-a[0].start),u.driftStartTime=s.driftStartTime,u.driftStart=s.driftStart;var m=u.advancedDateTime;if(u.advanced&&m){var b=u.edge;u.driftStart||(u.driftStartTime=m,u.driftStart=b),u.driftEndTime=m,u.driftEnd=b}else u.driftEndTime=s.driftEndTime,u.driftEnd=s.driftEnd,u.advancedDateTime=s.advancedDateTime}function C(s,u,x){if(s&&u)for(var c=0,p=0,D=s.length;p<=D;p++){var v=s[p],f=u[p+c];v&&f&&v.index===f.index&&v.fragment.sn===f.fragment.sn?x(v,f):c--}}function I(s,u,x){for(var c=u.skippedSegments,p=Math.max(s.startSN,u.startSN)-u.startSN,D=(s.fragmentHint?1:0)+(c?u.endSN:Math.min(s.endSN,u.endSN))-u.startSN,v=u.startSN-s.startSN,f=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,d=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,l=p;l<=D;l++){var a=d[v+l],g=f[l];c&&!g&&l<c&&(g=u.fragments[l]=a),a&&g&&x(a,g)}}function w(s,u){var x=u.startSN+u.skippedSegments-s.startSN,c=s.fragments;if(x<0||x>=c.length)return;A(u,c[x].start)}function A(s,u){if(u){for(var x=s.fragments,c=s.skippedSegments;c<x.length;c++)x[c].start+=u;s.fragmentHint&&(s.fragmentHint.start+=u)}}function S(s,u){var x=1e3*s.levelTargetDuration,c=x/2,p=s.age,D=p>0&&p<x*3,v=u.loading.end-u.loading.start,f,d=s.availabilityDelay;if(s.updated===!1)if(D){var l=333*s.misses;f=Math.max(Math.min(c,v*2),l),s.availabilityDelay=(s.availabilityDelay||0)+f}else f=c;else D?(d=Math.min(d||x/2,p),s.availabilityDelay=d,f=d+x-p):f=x-v;return Math.round(f)}function h(s,u,x){if(!s||!s.details)return null;var c=s.details,p=c.fragments[u-c.startSN];return p||(p=c.fragmentHint,p&&p.sn===u?p:u<c.startSN&&x&&x.sn===u?x:null)}function o(s,u,x){if(!s||!s.details)return null;var c=s.details.partList;if(c)for(var p=c.length;p--;){var D=c[p];if(D.index===x&&D.fragment.sn===u)return D}return null}},"./src/controller/stream-controller.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return c});var Q=R("./src/polyfills/number.ts"),_=R("./src/controller/base-stream-controller.ts"),L=R("./src/is-supported.ts"),W=R("./src/events.ts"),U=R("./src/utils/buffer-helper.ts"),O=R("./src/controller/fragment-tracker.ts"),M=R("./src/types/loader.ts"),y=R("./src/loader/fragment.ts"),C=R("./src/demux/transmuxer-interface.ts"),I=R("./src/types/transmuxer.ts"),w=R("./src/controller/gap-controller.ts"),A=R("./src/errors.ts"),S=R("./src/utils/logger.ts");function h(p,D){for(var v=0;v<D.length;v++){var f=D[v];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(p,f.key,f)}}function o(p,D,v){return D&&h(p.prototype,D),v&&h(p,v),p}function s(p,D){p.prototype=Object.create(D.prototype),p.prototype.constructor=p,u(p,D)}function u(p,D){return u=Object.setPrototypeOf||function(f,d){return f.__proto__=d,f},u(p,D)}var x=100,c=function(p){s(D,p);function D(f,d){var l;return l=p.call(this,f,d,"[stream-controller]")||this,l.audioCodecSwap=!1,l.gapController=null,l.level=-1,l._forceStartLoad=!1,l.altAudio=!1,l.audioOnly=!1,l.fragPlaying=null,l.onvplaying=null,l.onvseeked=null,l.fragLastKbps=0,l.stalled=!1,l.couldBacktrack=!1,l.audioCodecSwitch=!1,l.videoBuffer=null,l._registerListeners(),l}var v=D.prototype;return v._registerListeners=function(){var d=this.hls;d.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),d.on(W.Events.ERROR,this.onError,this),d.on(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.on(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),d.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this),d.on(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.on(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),d.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var d=this.hls;d.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),d.off(W.Events.ERROR,this.onError,this),d.off(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.off(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),d.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),d.off(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.off(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),d.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},v.startLoad=function(d){if(this.levels){var l=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}l>0&&d===-1&&(this.log("Override startPosition with lastCurrentTime @"+l.toFixed(3)),d=l),this.state=_.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=d,this.tick()}else this._forceStartLoad=!0,this.state=_.State.STOPPED},v.stopLoad=function(){this._forceStartLoad=!1,p.prototype.stopLoad.call(this)},v.doTick=function(){switch(this.state){case _.State.IDLE:this.doTickIdle();break;case _.State.WAITING_LEVEL:{var d,l=this.levels,a=this.level,g=l==null||((d=l[a])===null||d===void 0)?void 0:d.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 m,b=self.performance.now(),P=this.retryDate;(!P||b>=P||(m=this.media)!==null&&m!==void 0&&m.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=_.State.IDLE)}break;default:break}this.onTickEnd()},v.onTickEnd=function(){p.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},v.doTickIdle=function(){var d,l,a=this.hls,g=this.levelLastLoaded,m=this.levels,b=this.media,P=a.config,H=a.nextLoadLevel;if(g===null||!b&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!m||!m[H])return;var V=m[H];this.level=a.nextLoadLevel=H;var re=V.details;if(!re||this.state===_.State.WAITING_LEVEL||re.live&&this.levelLastLoaded!==H){this.state=_.State.WAITING_LEVEL;return}var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,M.PlaylistLevelType.MAIN);if(z===null)return;var F=z.len,ae=this.getMaxBufferLength(V.maxBitrate);if(F>=ae)return;if(this._streamEnded(z,re)){var ce={};this.altAudio&&(ce.type="video"),this.hls.trigger(W.Events.BUFFER_EOS,ce),this.state=_.State.ENDED;return}var me=z.end,be=this.getNextFragment(me,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>me){var Ce=this.audioOnly&&!this.altAudio?y.ElementaryStreamTypes.AUDIO:y.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,Ce,M.PlaylistLevelType.MAIN),be=this.getNextFragment(this.nextLoadPosition,re)}if(!be)return;be.initSegment&&!be.initSegment.data&&!this.bitrateTest&&(be=be.initSegment),((d=be.decryptdata)===null||d===void 0?void 0:d.keyFormat)==="identity"&&!((l=be.decryptdata)!==null&&l!==void 0&&l.key)?this.loadKey(be,re):this.loadFragment(be,re,me)},v.loadFragment=function(d,l,a){var g,m=this.fragmentTracker.getState(d);if(this.fragCurrent=d,m===O.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(d);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else m=O.FragmentState.NOT_LOADED}m===O.FragmentState.NOT_LOADED||m===O.FragmentState.PARTIAL?d.sn==="initSegment"?this._loadInitSegment(d):this.bitrateTest?(d.bitrateTest=!0,this.log("Fragment "+d.sn+" of level "+d.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(d)):(this.startFragRequested=!0,p.prototype.loadFragment.call(this,d,l,a)):m===O.FragmentState.APPENDING?this.reduceMaxBufferLength(d.duration)&&this.fragmentTracker.removeFragment(d):((g=this.media)===null||g===void 0?void 0:g.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},v.getAppendedFrag=function(d){var l=this.fragmentTracker.getAppendedFrag(d,M.PlaylistLevelType.MAIN);return l&&"fragment"in l?l.fragment:l},v.getBufferedFrag=function(d){return this.fragmentTracker.getBufferedFrag(d,M.PlaylistLevelType.MAIN)},v.followingBufferedFrag=function(d){return d?this.getBufferedFrag(d.end+.5):null},v.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},v.nextLevelSwitch=function(){var d=this.levels,l=this.media;if(l!=null&&l.readyState){var a,g=this.getAppendedFrag(l.currentTime);if(g&&g.start>1&&this.flushMainBuffer(0,g.start-1),!l.paused&&d){var m=this.hls.nextLoadLevel,b=d[m],P=this.fragLastKbps;P&&this.fragCurrent?a=this.fragCurrent.duration*b.maxBitrate/(1e3*P)+1:a=0}else a=0;var H=this.getBufferedFrag(l.currentTime+a);if(H){var V=this.followingBufferedFrag(H);if(V){this.abortCurrentFrag();var re=V.maxStartPTS?V.maxStartPTS:V.start,z=V.duration,F=Math.max(H.end,re+Math.min(Math.max(z-this.config.maxFragLookUpTolerance,z*.5),z*.75));this.flushMainBuffer(F,Number.POSITIVE_INFINITY)}}}},v.abortCurrentFrag=function(){var d=this.fragCurrent;this.fragCurrent=null,d!=null&&d.loader&&d.loader.abort(),this.state===_.State.KEY_LOADING&&(this.state=_.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},v.flushMainBuffer=function(d,l){p.prototype.flushMainBuffer.call(this,d,l,this.altAudio?"video":null)},v.onMediaAttached=function(d,l){p.prototype.onMediaAttached.call(this,d,l);var a=l.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new w.default(this.config,a,this.fragmentTracker,this.hls)},v.onMediaDetaching=function(){var d=this.media;d&&(d.removeEventListener("playing",this.onvplaying),d.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),p.prototype.onMediaDetaching.call(this)},v.onMediaPlaying=function(){this.tick()},v.onMediaSeeked=function(){var d=this.media,l=d?d.currentTime:null;Object(Q.isFiniteNumber)(l)&&this.log("Media seeked to "+l.toFixed(3)),this.tick()},v.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(W.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},v.onManifestParsed=function(d,l){var a=!1,g=!1,m;l.levels.forEach(function(b){m=b.audioCodec,m&&(m.indexOf("mp4a.40.2")!==-1&&(a=!0),m.indexOf("mp4a.40.5")!==-1&&(g=!0))}),this.audioCodecSwitch=a&&g&&!Object(L.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=l.levels,this.startFragRequested=!1},v.onLevelLoading=function(d,l){var a=this.levels;if(!a||this.state!==_.State.IDLE)return;var g=a[l.level];(!g.details||g.details.live&&this.levelLastLoaded!==l.level||this.waitForCdnTuneIn(g.details))&&(this.state=_.State.WAITING_LEVEL)},v.onLevelLoaded=function(d,l){var a,g=this.levels,m=l.level,b=l.details,P=b.totalduration;if(!g){this.warn("Levels were reset while loading level "+m);return}this.log("Level "+m+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+P);var H=this.fragCurrent;H&&(this.state===_.State.FRAG_LOADING||this.state===_.State.FRAG_LOADING_WAITING_RETRY)&&(H.level!==l.level&&H.loader&&(this.state=_.State.IDLE,H.loader.abort()));var V=g[m],re=0;if(b.live||(a=V.details)!==null&&a!==void 0&&a.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;re=this.alignPlaylists(b,V.details)}if(V.details=b,this.levelLastLoaded=m,this.hls.trigger(W.Events.LEVEL_UPDATED,{details:b,level:m}),this.state===_.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=_.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,re),this.tick()},v._handleFragmentLoadProgress=function(d){var l,a=d.frag,g=d.part,m=d.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+a.sn+" of level "+a.level+" will not be buffered");return}var P=b[a.level],H=P.details;if(!H){this.warn("Dropping fragment "+a.sn+" of level "+a.level+" after level details were reset");return}var V=P.videoCodec,re=H.PTSKnown||!H.live,z=(l=a.initSegment)===null||l===void 0?void 0:l.data,F=this._getAudioCodec(P),ae=this.transmuxer=this.transmuxer||new C.default(this.hls,M.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ce=g?g.index:-1,me=ce!==-1,be=new I.ChunkMetadata(a.level,a.sn,a.stats.chunkCount,m.byteLength,ce,me),Be=this.initPTS[a.cc];ae.push(m,z,F,V,a,g,H.totalduration,re,be,Be)},v.onAudioTrackSwitching=function(d,l){var a=this.altAudio,g=!!l.url,m=l.id;if(!g){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;a&&P.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(W.Events.AUDIO_TRACK_SWITCHED,{id:m})}},v.onAudioTrackSwitched=function(d,l){var a=l.id,g=!!this.hls.audioTracks[a].url;if(g){var m=this.videoBuffer;m&&this.mediaBuffer!==m&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=m)}this.altAudio=g,this.tick()},v.onBufferCreated=function(d,l){var a=l.tracks,g,m,b=!1;for(var P in a){var H=a[P];if(H.id==="main"){if(m=P,g=H,P==="video"){var V=a[P];V&&(this.videoBuffer=V.buffer)}}else b=!0}b&&g?(this.log("Alternate track found, use "+m+".buffered to schedule main fragment loading"),this.mediaBuffer=g.buffer):this.mediaBuffer=this.media},v.onFragBuffered=function(d,l){var a=l.frag,g=l.part;if(a&&a.type!==M.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 m=g?g.stats:a.stats;this.fragLastKbps=Math.round(8*m.total/(m.buffering.end-m.loading.first)),a.sn!=="initSegment"&&(this.fragPrevious=a),this.fragBufferedComplete(a,g)},v.onError=function(d,l){switch(l.details){case A.ErrorDetails.FRAG_LOAD_ERROR:case A.ErrorDetails.FRAG_LOAD_TIMEOUT:case A.ErrorDetails.KEY_LOAD_ERROR:case A.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(M.PlaylistLevelType.MAIN,l);break;case A.ErrorDetails.LEVEL_LOAD_ERROR:case A.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==_.State.ERROR&&(l.fatal?(this.warn(""+l.details),this.state=_.State.ERROR):!l.levelRetry&&this.state===_.State.WAITING_LEVEL&&(this.state=_.State.IDLE));break;case A.ErrorDetails.BUFFER_FULL_ERROR:if(l.parent==="main"&&(this.state===_.State.PARSING||this.state===_.State.PARSED)){var a=!0,g=this.getFwdBufferInfo(this.media,M.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}},v.checkBuffer=function(){var d=this.media,l=this.gapController;if(!d||!l||!d.readyState)return;var a=U.BufferHelper.getBuffered(d);!this.loadedmetadata&&a.length?(this.loadedmetadata=!0,this.seekToStartPos()):l.poll(this.lastCurrentTime),this.lastCurrentTime=d.currentTime},v.onFragLoadEmergencyAborted=function(){this.state=_.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},v.onBufferFlushed=function(d,l){var a=l.type;if(a!==y.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var g=(a===y.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(g,a,M.PlaylistLevelType.MAIN)}},v.onLevelsUpdated=function(d,l){this.levels=l.levels},v.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},v.seekToStartPos=function(){var d=this.media,l=d.currentTime,a=this.startPosition;if(a>=0&&l<a){if(d.seeking){S.logger.log("could not seek to "+a+", already seeking at "+l);return}var g=U.BufferHelper.getBuffered(d),m=g.length?g.start(0):0,b=m-a;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(S.logger.log("adjusting start position by "+b+" to match buffer start"),a+=b,this.startPosition=a),this.log("seek to target start position "+a+" from current time "+l),d.currentTime=a}},v._getAudioCodec=function(d){var l=this.config.defaultAudioCodec||d.audioCodec;return this.audioCodecSwap&&l&&(this.log("Swapping audio codec"),l.indexOf("mp4a.40.5")!==-1?l="mp4a.40.2":l="mp4a.40.5"),l},v._loadBitrateTestFrag=function(d){var l=this;this._doFragLoad(d).then(function(a){var g=l.hls;if(!a||g.nextLoadLevel||l.fragContextChanged(d))return;l.fragLoadError=0,l.state=_.State.IDLE,l.startFragRequested=!1,l.bitrateTest=!1;var m=d.stats;m.parsing.start=m.parsing.end=m.buffering.start=m.buffering.end=self.performance.now(),g.trigger(W.Events.FRAG_LOADED,a)})},v._handleTransmuxComplete=function(d){var l,a="main",g=this.hls,m=d.remuxResult,b=d.chunkMeta,P=this.getCurrentContext(b);if(!P){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(b.level);return}var H=P.frag,V=P.part,re=P.level,z=m.video,F=m.text,ae=m.id3,ce=m.initSegment,me=this.altAudio?void 0:m.audio;if(this.fragContextChanged(H))return;if(this.state=_.State.PARSING,ce){ce.tracks&&(this._bufferInitSegment(re,ce.tracks,H,b),g.trigger(W.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:a,tracks:ce.tracks}));var be=ce.initPTS,Be=ce.timescale;Object(Q.isFiniteNumber)(be)&&(this.initPTS[H.cc]=be,g.trigger(W.Events.INIT_PTS_FOUND,{frag:H,id:a,initPTS:be,timescale:Be}))}if(z&&m.independent!==!1){if(re.details){var Ce=z.startPTS,Le=z.endPTS,Te=z.startDTS,we=z.endDTS;if(V)V.elementaryStreams[z.type]={startPTS:Ce,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<Ce){this.backtrack(H);return}H.setElementaryStreamInfo(z.type,H.start,Le,H.start,we,!0)}H.setElementaryStreamInfo(z.type,Ce,Le,Te,we),this.bufferFragmentData(z,H,V,b)}}else if(m.independent===!1){this.backtrack(H);return}if(me){var j=me.startPTS,T=me.endPTS,k=me.startDTS,G=me.endDTS;V&&(V.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:j,endPTS:T,startDTS:k,endDTS:G}),H.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,j,T,k,G),this.bufferFragmentData(me,H,V,b)}if(ae!=null&&(l=ae.samples)!==null&&l!==void 0&&l.length){var $={frag:H,id:a,samples:ae.samples};g.trigger(W.Events.FRAG_PARSING_METADATA,$)}if(F){var N={frag:H,id:a,samples:F.samples};g.trigger(W.Events.FRAG_PARSING_USERDATA,N)}},v._bufferInitSegment=function(d,l,a,g){var m=this;if(this.state!==_.State.PARSING)return;this.audioOnly=!!l.audio&&!l.video,this.altAudio&&!this.audioOnly&&delete l.audio;var b=l.audio,P=l.video,H=l.audiovideo;if(b){var V=d.audioCodec,re=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(V&&(V.indexOf("mp4a.40.5")!==-1?V="mp4a.40.2":V="mp4a.40.5"),b.metadata.channelCount!==1&&re.indexOf("firefox")===-1&&(V="mp4a.40.5")),re.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(V="mp4a.40.2",this.log("Android: force audio codec to "+V)),d.audioCodec&&d.audioCodec!==V&&this.log('Swapping manifest audio codec "'+d.audioCodec+'" for "'+V+'"'),b.levelCodec=V,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(V||"")+"/"+(d.audioCodec||"")+"/"+b.codec+"]")}P&&(P.levelCodec=d.videoCodec,P.id="main",this.log("Init video buffer, container:"+P.container+", codecs[level/parsed]=["+(d.videoCodec||"")+"/"+P.codec+"]")),H&&this.log("Init audiovideo buffer, container:"+H.container+", codecs[level/parsed]=["+(d.attrs.CODECS||"")+"/"+H.codec+"]"),this.hls.trigger(W.Events.BUFFER_CODECS,l),Object.keys(l).forEach(function(z){var F=l[z],ae=F.initSegment;ae!=null&&ae.byteLength&&m.hls.trigger(W.Events.BUFFER_APPENDING,{type:z,data:ae,frag:a,part:null,chunkMeta:g,parent:a.type})}),this.tick()},v.backtrack=function(d){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(d);var l=this.fragmentTracker.backtrack(d);this.fragPrevious=null,this.nextLoadPosition=d.start,l?this.resetFragmentLoading(d):this.state=_.State.BACKTRACKING},v.checkFragmentChanged=function(){var d=this.media,l=null;if(d&&d.readyState>1&&d.seeking===!1){var a=d.currentTime;if(U.BufferHelper.isBuffered(d,a)?l=this.getAppendedFrag(a):U.BufferHelper.isBuffered(d,a+.1)&&(l=this.getAppendedFrag(a+.1)),l){var g=this.fragPlaying,m=l.level;(!g||l.sn!==g.sn||g.level!==m||l.urlId!==g.urlId)&&(this.hls.trigger(W.Events.FRAG_CHANGED,{frag:l}),(!g||g.level!==m)&&this.hls.trigger(W.Events.LEVEL_SWITCHED,{level:m}),this.fragPlaying=l)}}},o(D,[{key:"nextLevel",get:function(){var d=this.nextBufferedFrag;return d?d.level:-1}},{key:"currentLevel",get:function(){var d=this.media;if(d){var l=this.getAppendedFrag(d.currentTime);if(l)return l.level}return-1}},{key:"nextBufferedFrag",get:function(){var d=this.media;if(d){var l=this.getAppendedFrag(d.currentTime);return this.followingBufferedFrag(l)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(_.default)},"./src/controller/subtitle-stream-controller.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"SubtitleStreamController",function(){return s});var Q=R("./src/events.ts"),_=R("./src/utils/logger.ts"),L=R("./src/utils/buffer-helper.ts"),W=R("./src/controller/fragment-finders.ts"),U=R("./src/utils/discontinuities.ts"),O=R("./src/controller/level-helper.ts"),M=R("./src/controller/fragment-tracker.ts"),y=R("./src/controller/base-stream-controller.ts"),C=R("./src/types/loader.ts"),I=R("./src/types/level.ts");function w(u,x){for(var c=0;c<x.length;c++){var p=x[c];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(u,p.key,p)}}function A(u,x,c){return x&&w(u.prototype,x),c&&w(u,c),u}function S(u,x){u.prototype=Object.create(x.prototype),u.prototype.constructor=u,h(u,x)}function h(u,x){return h=Object.setPrototypeOf||function(p,D){return p.__proto__=D,p},h(u,x)}var o=500,s=function(u){S(x,u);function x(p,D){var v;return v=u.call(this,p,D,"[subtitle-stream-controller]")||this,v.levels=[],v.currentTrackId=-1,v.tracksBuffered=[],v.mainDetails=null,v._registerListeners(),v}var c=x.prototype;return c.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},c._registerListeners=function(){var D=this.hls;D.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on(Q.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on(Q.Events.ERROR,this.onError,this),D.on(Q.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on(Q.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on(Q.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},c._unregisterListeners=function(){var D=this.hls;D.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off(Q.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off(Q.Events.ERROR,this.onError,this),D.off(Q.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off(Q.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off(Q.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},c.startLoad=function(){this.stopLoad(),this.state=y.State.IDLE,this.setInterval(o),this.tick()},c.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},c.onLevelLoaded=function(D,v){this.mainDetails=v.details},c.onSubtitleFragProcessed=function(D,v){var f=v.frag,d=v.success;if(this.fragPrevious=f,this.state=y.State.IDLE,!d)return;var l=this.tracksBuffered[this.currentTrackId];if(!l)return;for(var a,g=f.start,m=0;m<l.length;m++)if(g>=l[m].start&&g<=l[m].end){a=l[m];break}var b=f.start+f.duration;a?a.end=b:(a={start:g,end:b},l.push(a)),this.fragmentTracker.fragBuffered(f)},c.onBufferFlushing=function(D,v){var f=v.startOffset,d=v.endOffset;if(f===0&&d!==Number.POSITIVE_INFINITY){var l=this.currentTrackId,a=this.levels;if(!a.length||!a[l]||!a[l].details)return;var g=a[l].details,m=g.targetduration,b=d-m;if(b<=0)return;v.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(P){for(var H=0;H<P.length;){if(P[H].end<=b){P.shift();continue}else if(P[H].start<b)P[H].start=b;else break;H++}}),this.fragmentTracker.removeFragmentsInRange(f,b,C.PlaylistLevelType.SUBTITLE)}},c.onError=function(D,v){var f,d=v.frag;if(!d||d.type!==C.PlaylistLevelType.SUBTITLE)return;(f=this.fragCurrent)!==null&&f!==void 0&&f.loader&&this.fragCurrent.loader.abort(),this.state=y.State.IDLE},c.onSubtitleTracksUpdated=function(D,v){var f=this,d=v.subtitleTracks;this.tracksBuffered=[],this.levels=d.map(function(l){return new I.Level(l)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(l){f.tracksBuffered[l.id]=[]}),this.mediaBuffer=null},c.onSubtitleTrackSwitch=function(D,v){if(this.currentTrackId=v.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var f=this.levels[this.currentTrackId];f!=null&&f.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,f&&this.setInterval(o)},c.onSubtitleTrackLoaded=function(D,v){var f,d=v.details,l=v.id,a=this.currentTrackId,g=this.levels;if(!g.length)return;var m=g[a];if(l>=g.length||l!==a||!m)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,d.live||(f=m.details)!==null&&f!==void 0&&f.live){var b=this.mainDetails;if(d.deltaUpdateFailed||!b)return;var P=b.fragments[0];if(!m.details)d.hasProgramDateTime&&b.hasProgramDateTime?Object(U.alignMediaPlaylistByPDT)(d,b):P&&Object(O.addSliding)(d,P.start);else{var H=this.alignPlaylists(d,m.details);H===0&&P&&Object(O.addSliding)(d,P.start)}}if(m.details=d,this.levelLastLoaded=l,this.tick(),d.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var V=Object(W.findFragmentByPTS)(null,d.fragments,this.media.currentTime,0);V||(this.warn("Subtitle playlist not aligned with playback"),m.details=void 0)}},c._handleFragmentLoadComplete=function(D){var v=D.frag,f=D.payload,d=v.decryptdata,l=this.hls;if(this.fragContextChanged(v))return;if(f&&f.byteLength>0&&d&&d.key&&d.iv&&d.method==="AES-128"){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(f),d.key.buffer,d.iv.buffer).then(function(g){var m=performance.now();l.trigger(Q.Events.FRAG_DECRYPTED,{frag:v,payload:g,stats:{tstart:a,tdecrypt:m}})})}},c.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var D,v=this.currentTrackId,f=this.levels;if(!f.length||!f[v]||!f[v].details)return;var d=f[v].details,l=d.targetduration,a=this.config,g=this.media,m=L.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,g.currentTime-l,a.maxBufferHole),b=m.end,P=m.len,H=this.getMaxBufferLength()+l;if(P>H)return;console.assert(d,"Subtitle track details are defined on idle subtitle stream controller tick");var V=d.fragments,re=V.length,z=d.edge,F,ae=this.fragPrevious;if(b<z){var ce=a.maxFragLookUpTolerance;ae&&d.hasProgramDateTime&&(F=Object(W.findFragmentByPDT)(V,ae.endProgramDateTime,ce)),F||(F=Object(W.findFragmentByPTS)(ae,V,b,ce),!F&&ae&&ae.start<V[0].start&&(F=V[0]))}else F=V[re-1];(D=F)!==null&&D!==void 0&&D.encrypted?(_.logger.log("Loading key for "+F.sn),this.state=y.State.KEY_LOADING,this.hls.trigger(Q.Events.KEY_LOADING,{frag:F})):F&&this.fragmentTracker.getState(F)===M.FragmentState.NOT_LOADED&&this.loadFragment(F,d,b)}},c.loadFragment=function(D,v,f){this.fragCurrent=D,u.prototype.loadFragment.call(this,D,v,f)},A(x,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),x}(y.default)},"./src/controller/subtitle-track-controller.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/events.ts"),_=R("./src/utils/texttrack-utils.ts"),L=R("./src/controller/base-playlist-controller.ts"),W=R("./src/types/loader.ts");function U(w,A){for(var S=0;S<A.length;S++){var h=A[S];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(w,h.key,h)}}function O(w,A,S){return A&&U(w.prototype,A),S&&U(w,S),w}function M(w,A){w.prototype=Object.create(A.prototype),w.prototype.constructor=w,y(w,A)}function y(w,A){return y=Object.setPrototypeOf||function(h,o){return h.__proto__=o,h},y(w,A)}var C=function(w){M(A,w);function A(h){var o;return o=w.call(this,h,"[subtitle-track-controller]")||this,o.media=null,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.selectDefaultTrack=!0,o.queuedDefaultTrack=-1,o.trackChangeListener=function(){return o.onTextTracksChanged()},o.asyncPollTrackChange=function(){return o.pollTrackChange(0)},o.useTextTrackPolling=!1,o.subtitlePollingInterval=-1,o.subtitleDisplay=!0,o.registerListeners(),o}var S=A.prototype;return S.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,w.prototype.destroy.call(this)},S.registerListeners=function(){var o=this.hls;o.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.on(Q.Events.ERROR,this.onError,this)},S.unregisterListeners=function(){var o=this.hls;o.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.off(Q.Events.ERROR,this.onError,this)},S.onMediaAttached=function(o,s){if(this.media=s.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},S.pollTrackChange=function(o){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,o)},S.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var o=I(this.media.textTracks);o.forEach(function(s){Object(_.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},S.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},S.onManifestParsed=function(o,s){this.tracks=s.subtitleTracks},S.onSubtitleTrackLoaded=function(o,s){var u=s.id,x=s.details,c=this.trackId,p=this.tracksInGroup[c];if(!p){this.warn("Invalid subtitle track id "+u);return}var D=p.details;p.details=s.details,this.log("subtitle track "+u+" loaded ["+x.startSN+"-"+x.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,s,D))},S.onLevelLoading=function(o,s){this.switchLevel(s.level)},S.onLevelSwitching=function(o,s){this.switchLevel(s.level)},S.switchLevel=function(o){var s=this.hls.levels[o];if(!(s!=null&&s.textGroupIds))return;var u=s.textGroupIds[s.urlId];if(this.groupId!==u){var x=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,c=this.tracks.filter(function(v){return!u||v.groupId===u});this.tracksInGroup=c;var p=this.findTrackId(x==null?void 0:x.name)||this.findTrackId();this.groupId=u;var D={subtitleTracks:c};this.log("Updating subtitle tracks, "+c.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(Q.Events.SUBTITLE_TRACKS_UPDATED,D),p!==-1&&this.setSubtitleTrack(p,x)}},S.findTrackId=function(o){for(var s=this.tracksInGroup,u=0;u<s.length;u++){var x=s[u];if((!this.selectDefaultTrack||x.default)&&(!o||o===x.name))return x.id}return-1},S.onError=function(o,s){if(w.prototype.onError.call(this,o,s),s.fatal||!s.context)return;s.context.type===W.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},S.loadPlaylist=function(o){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var u=s.id,x=s.groupId,c=s.url;if(o)try{c=o.addDirectives(c)}catch(p){this.warn("Could not construct new URL with HLS Delivery Directives: "+p)}this.log("Loading subtitle playlist for id "+u),this.hls.trigger(Q.Events.SUBTITLE_TRACK_LOADING,{url:c,id:u,groupId:x,deliveryDirectives:o||null})}},S.toggleTrackModes=function(o){var s=this,u=this.media,x=this.subtitleDisplay,c=this.trackId;if(!u)return;var p=I(u.textTracks),D=p.filter(function(d){return d.groupId===s.groupId});if(o===-1)[].slice.call(p).forEach(function(d){d.mode="disabled"});else{var v=D[c];v&&(v.mode="disabled")}var f=D[o];f&&(f.mode=x?"showing":"hidden")},S.setSubtitleTrack=function(o,s){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 c=x[o];if(this.log("Switching to subtitle track "+o),this.trackId=o,c){var p=c.id,D=c.groupId,v=D===void 0?"":D,f=c.name,d=c.type,l=c.url;this.hls.trigger(Q.Events.SUBTITLE_TRACK_SWITCH,{id:p,groupId:v,name:f,type:d,url:l});var a=this.switchParams(c.url,s==null?void 0:s.details);this.loadPlaylist(a)}else this.hls.trigger(Q.Events.SUBTITLE_TRACK_SWITCH,{id:o})},S.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var o=-1,s=I(this.media.textTracks),u=0;u<s.length;u++)if(s[u].mode==="hidden")o=u;else if(s[u].mode==="showing"){o=u;break}this.subtitleTrack!==o&&(this.subtitleTrack=o)},O(A,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(o,s)}}]),A}(L.default);function I(w){for(var A=[],S=0;S<w.length;S++){var h=w[S];h.kind==="subtitles"&&h.label&&A.push(w[S])}return A}Z.default=C},"./src/controller/timeline-controller.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"TimelineController",function(){return I});var Q=R("./src/polyfills/number.ts"),_=R("./src/events.ts"),L=R("./src/utils/cea-608-parser.ts"),W=R("./src/utils/output-filter.ts"),U=R("./src/utils/webvtt-parser.ts"),O=R("./src/utils/texttrack-utils.ts"),M=R("./src/utils/imsc1-ttml-parser.ts"),y=R("./src/types/loader.ts"),C=R("./src/utils/logger.ts"),I=function(){function h(s){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=S(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var u=new W.default(this,"textTrack1"),x=new W.default(this,"textTrack2"),c=new W.default(this,"textTrack3"),p=new W.default(this,"textTrack4");this.cea608Parser1=new L.default(1,u,x),this.cea608Parser2=new L.default(3,c,p)}s.on(_.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(_.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(_.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(_.Events.FRAG_LOADING,this.onFragLoading,this),s.on(_.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(_.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(_.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(_.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(_.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var o=h.prototype;return o.destroy=function(){var u=this.hls;u.off(_.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(_.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.off(_.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.off(_.Events.FRAG_LOADING,this.onFragLoading,this),u.off(_.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(_.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.off(_.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.off(_.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.off(_.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.off(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},o.addCues=function(u,x,c,p,D){for(var v=!1,f=D.length;f--;){var d=D[f],l=A(d[0],d[1],x,c);if(l>=0&&(d[0]=Math.min(d[0],x),d[1]=Math.max(d[1],c),v=!0,l/(c-x)>.5))return}if(v||D.push([x,c]),this.config.renderTextTracksNatively){var a=this.captionsTracks[u];this.Cues.newCue(a,x,c,p)}else{var g=this.Cues.newCue(null,x,c,p);this.hls.trigger(_.Events.CUES_PARSED,{type:"captions",cues:g,track:u})}},o.onInitPtsFound=function(u,x){var c=this,p=x.frag,D=x.id,v=x.initPTS,f=x.timescale,d=this.unparsedVttFrags;D==="main"&&(this.initPTS[p.cc]=v,this.timescale[p.cc]=f),d.length&&(this.unparsedVttFrags=[],d.forEach(function(l){c.onFragLoaded(_.Events.FRAG_LOADED,l)}))},o.getExistingTrack=function(u){var x=this.media;if(x)for(var c=0;c<x.textTracks.length;c++){var p=x.textTracks[c];if(p[u])return p}return null},o.createCaptionsTrack=function(u){this.config.renderTextTracksNatively?this.createNativeTrack(u):this.createNonNativeTrack(u)},o.createNativeTrack=function(u){if(this.captionsTracks[u])return;var x=this.captionsProperties,c=this.captionsTracks,p=this.media,D=x[u],v=D.label,f=D.languageCode,d=this.getExistingTrack(u);if(d)c[u]=d,Object(O.clearCurrentCues)(c[u]),Object(O.sendAddTrackEvent)(c[u],p);else{var l=this.createTextTrack("captions",v,f);l&&(l[u]=!0,c[u]=l)}},o.createNonNativeTrack=function(u){if(this.nonNativeCaptionsTracks[u])return;var x=this.captionsProperties[u];if(!x)return;var c=x.label,p={_id:u,label:c,kind:"captions",default:x.media?!!x.media.default:!1,closedCaptions:x.media};this.nonNativeCaptionsTracks[u]=p,this.hls.trigger(_.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[p]})},o.createTextTrack=function(u,x,c){var p=this.media;return p?p.addTextTrack(u,x,c):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=S(),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 c=0;c<x.length;c++)Object(O.clearCurrentCues)(x[c])},o.onSubtitleTracksUpdated=function(u,x){var c=this;this.textTracks=[];var p=x.subtitleTracks||[],D=p.some(function(l){return l.textCodec===M.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var v=this.tracks&&p&&this.tracks.length===p.length;if(this.tracks=p||[],this.config.renderTextTracksNatively){var f=this.media?this.media.textTracks:[];this.tracks.forEach(function(l,a){var g;if(a<f.length){for(var m=null,b=0;b<f.length;b++)if(w(f[b],l)){m=f[b];break}m&&(g=m)}g?Object(O.clearCurrentCues)(g):(g=c.createTextTrack("subtitles",l.name,l.lang),g&&(g.mode="disabled")),g&&(g.groupId=l.groupId,c.textTracks.push(g))})}else if(!v&&this.tracks&&this.tracks.length){var d=this.tracks.map(function(l){return{label:l.name,kind:l.type.toLowerCase(),default:l.default,subtitleTrack:l}});this.hls.trigger(_.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:d})}}},o.onManifestLoaded=function(u,x){var c=this;this.config.enableCEA708Captions&&x.captions&&x.captions.forEach(function(p){var D=/(?:CC|SERVICE)([1-4])/.exec(p.instreamId);if(!D)return;var v="textTrack"+D[1],f=c.captionsProperties[v];if(!f)return;f.label=p.name,p.lang&&(f.languageCode=p.lang),f.media=p})},o.onFragLoading=function(u,x){var c=this.cea608Parser1,p=this.cea608Parser2,D=this.lastSn,v=this.lastPartIndex;if(!this.enabled||!(c&&p))return;if(x.frag.type===y.PlaylistLevelType.MAIN){var f,d,l=x.frag.sn,a=(f=x==null||((d=x.part)===null||d===void 0)?void 0:d.index)!=null?f:-1;l===D+1||l===D&&a===v+1||(c.reset(),p.reset()),this.lastSn=l,this.lastPartIndex=a}},o.onFragLoaded=function(u,x){var c=x.frag,p=x.payload,D=this.initPTS,v=this.unparsedVttFrags;if(c.type===y.PlaylistLevelType.SUBTITLE)if(p.byteLength){if(!Object(Q.isFiniteNumber)(D[c.cc])){v.push(x),D.length&&this.hls.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:new Error("Missing initial subtitle PTS")});return}var f=c.decryptdata;if(f==null||f.key==null||f.method!=="AES-128"){var d=this.tracks[c.level],l=this.vttCCs;l[c.cc]||(l[c.cc]={start:c.start,prevCC:this.prevCC,new:!0},this.prevCC=c.cc),d&&d.textCodec===M.IMSC1_CODEC?this._parseIMSC1(c,p):this._parseVTTs(c,p,l)}}else this.hls.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:new Error("Empty subtitle payload")})},o._parseIMSC1=function(u,x){var c=this,p=this.hls;Object(M.parseIMSC1)(x,this.initPTS[u.cc],this.timescale[u.cc],function(D){c._appendCues(D,u.level),p.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},function(D){C.logger.log("Failed to parse IMSC1: "+D),p.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:D})})},o._parseVTTs=function(u,x,c){var p=this,D=this.hls;Object(U.parseWebVTT)(x,this.initPTS[u.cc],this.timescale[u.cc],c,u.cc,u.start,function(v){p._appendCues(v,u.level),D.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},function(v){p._fallbackToIMSC1(u,x),C.logger.log("Failed to parse VTT cue: "+v),D.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:v})})},o._fallbackToIMSC1=function(u,x){var c=this,p=this.tracks[u.level];p.textCodec||Object(M.parseIMSC1)(x,this.initPTS[u.cc],this.timescale[u.cc],function(){p.textCodec=M.IMSC1_CODEC,c._parseIMSC1(u,x)},function(){p.textCodec="wvtt"})},o._appendCues=function(u,x){var c=this.hls;if(this.config.renderTextTracksNatively){var p=this.textTracks[x];if(p.mode==="disabled")return;u.forEach(function(f){return Object(O.addCueToTrack)(p,f)})}else{var D=this.tracks[x],v=D.default?"default":"subtitles"+x;c.trigger(_.Events.CUES_PARSED,{type:"subtitles",cues:u,track:v})}},o.onFragDecrypted=function(u,x){var c=x.frag;if(c.type===y.PlaylistLevelType.SUBTITLE){if(!Object(Q.isFiniteNumber)(this.initPTS[c.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 c=this.cea608Parser1,p=this.cea608Parser2;if(!this.enabled||!(c&&p))return;for(var D=0;D<x.samples.length;D++){var v=x.samples[D].bytes;if(v){var f=this.extractCea608Data(v);c.addData(x.samples[D].pts,f[0]),p.addData(x.samples[D].pts,f[1])}}},o.onBufferFlushing=function(u,x){var c=x.startOffset,p=x.endOffset,D=x.endOffsetSubtitles,v=x.type,f=this.media;if(!f||f.currentTime<p)return;if(!v||v==="video"){var d=this.captionsTracks;Object.keys(d).forEach(function(a){return Object(O.removeCuesInRange)(d[a],c,p)})}if(this.config.renderTextTracksNatively&&(c===0&&D!==void 0)){var l=this.textTracks;Object.keys(l).forEach(function(a){return Object(O.removeCuesInRange)(l[a],c,D)})}},o.extractCea608Data=function(u){for(var x=u[0]&31,c=2,p=[[],[]],D=0;D<x;D++){var v=u[c++],f=127&u[c++],d=127&u[c++],l=(4&v)!==0,a=3&v;if(f===0&&d===0)continue;l&&((a===0||a===1)&&(p[a].push(f),p[a].push(d)))}return p},h}();function w(h,o){return h&&h.label===o.name&&!(h.textTrack1||h.textTrack2)}function A(h,o,s,u){return Math.min(o,u)-Math.max(h,s)}function S(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return Q});var Q=function(){function _(W,U){this.subtle=void 0,this.aesIV=void 0,this.subtle=W,this.aesIV=U}var L=_.prototype;return L.decrypt=function(U,O){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},O,U)},_}()},"./src/crypt/aes-decryptor.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"removePadding",function(){return _}),R.d(Z,"default",function(){return L});var Q=R("./src/utils/typed-array.ts");function _(W){var U=W.byteLength,O=U&&new DataView(W.buffer).getUint8(U-1);return O?Object(Q.sliceUint8)(W,0,U-O):W}var L=function(){function W(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var U=W.prototype;return U.uint8ArrayToUint32Array_=function(M){for(var y=new DataView(M),C=new Uint32Array(4),I=0;I<4;I++)C[I]=y.getUint32(I*4);return C},U.initTable=function(){var M=this.sBox,y=this.invSBox,C=this.subMix,I=C[0],w=C[1],A=C[2],S=C[3],h=this.invSubMix,o=h[0],s=h[1],u=h[2],x=h[3],c=new Uint32Array(256),p=0,D=0,v=0;for(v=0;v<256;v++)v<128?c[v]=v<<1:c[v]=v<<1^283;for(v=0;v<256;v++){var f=D^D<<1^D<<2^D<<3^D<<4;f=f>>>8^f&255^99,M[p]=f,y[f]=p;var d=c[p],l=c[d],a=c[l],g=c[f]*257^f*16843008;I[p]=g<<24|g>>>8,w[p]=g<<16|g>>>16,A[p]=g<<8|g>>>24,S[p]=g,g=a*16843009^l*65537^d*257^p*16843008,o[f]=g<<24|g>>>8,s[f]=g<<16|g>>>16,u[f]=g<<8|g>>>24,x[f]=g,p?(p=d^c[c[c[a^d]]],D^=c[c[D]]):p=D=1}},U.expandKey=function(M){for(var y=this.uint8ArrayToUint32Array_(M),C=!0,I=0;I<y.length&&C;)C=y[I]===this.key[I],I++;if(C)return;this.key=y;var w=this.keySize=y.length;if(w!==4&&w!==6&&w!==8)throw new Error("Invalid aes key size="+w);var A=this.ksRows=(w+6+1)*4,S,h,o=this.keySchedule=new Uint32Array(A),s=this.invKeySchedule=new Uint32Array(A),u=this.sBox,x=this.rcon,c=this.invSubMix,p=c[0],D=c[1],v=c[2],f=c[3],d,l;for(S=0;S<A;S++){if(S<w){d=o[S]=y[S];continue}l=d,S%w===0?(l=l<<8|l>>>24,l=u[l>>>24]<<24|u[l>>>16&255]<<16|u[l>>>8&255]<<8|u[l&255],l^=x[S/w|0]<<24):w>6&&S%w===4&&(l=u[l>>>24]<<24|u[l>>>16&255]<<16|u[l>>>8&255]<<8|u[l&255]),o[S]=d=(o[S-w]^l)>>>0}for(h=0;h<A;h++)S=A-h,h&3?l=o[S]:l=o[S-4],h<4||S<=4?s[h]=l:s[h]=p[u[l>>>24]]^D[u[l>>>16&255]]^v[u[l>>>8&255]]^f[u[l&255]],s[h]=s[h]>>>0},U.networkToHostOrderSwap=function(M){return M<<24|(M&65280)<<8|(M&16711680)>>8|M>>>24},U.decrypt=function(M,y,C){for(var I=this.keySize+6,w=this.invKeySchedule,A=this.invSBox,S=this.invSubMix,h=S[0],o=S[1],s=S[2],u=S[3],x=this.uint8ArrayToUint32Array_(C),c=x[0],p=x[1],D=x[2],v=x[3],f=new Int32Array(M),d=new Int32Array(f.length),l,a,g,m,b,P,H,V,re,z,F,ae,ce,me,be=this.networkToHostOrderSwap;y<f.length;){for(re=be(f[y]),z=be(f[y+1]),F=be(f[y+2]),ae=be(f[y+3]),b=re^w[0],P=ae^w[1],H=F^w[2],V=z^w[3],ce=4,me=1;me<I;me++)l=h[b>>>24]^o[P>>16&255]^s[H>>8&255]^u[V&255]^w[ce],a=h[P>>>24]^o[H>>16&255]^s[V>>8&255]^u[b&255]^w[ce+1],g=h[H>>>24]^o[V>>16&255]^s[b>>8&255]^u[P&255]^w[ce+2],m=h[V>>>24]^o[b>>16&255]^s[P>>8&255]^u[H&255]^w[ce+3],b=l,P=a,H=g,V=m,ce=ce+4;l=A[b>>>24]<<24^A[P>>16&255]<<16^A[H>>8&255]<<8^A[V&255]^w[ce],a=A[P>>>24]<<24^A[H>>16&255]<<16^A[V>>8&255]<<8^A[b&255]^w[ce+1],g=A[H>>>24]<<24^A[V>>16&255]<<16^A[b>>8&255]<<8^A[P&255]^w[ce+2],m=A[V>>>24]<<24^A[b>>16&255]<<16^A[P>>8&255]<<8^A[H&255]^w[ce+3],d[y]=be(l^c),d[y+1]=be(m^p),d[y+2]=be(g^D),d[y+3]=be(a^v),c=re,p=z,D=F,v=ae,y=y+4}return d.buffer},W}()},"./src/crypt/decrypter.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return y});var Q=R("./src/crypt/aes-crypto.ts"),_=R("./src/crypt/fast-aes-key.ts"),L=R("./src/crypt/aes-decryptor.ts"),W=R("./src/utils/logger.ts"),U=R("./src/utils/mp4-tools.ts"),O=R("./src/utils/typed-array.ts"),M=16,y=function(){function C(w,A,S){var h=S===void 0?{}:S,o=h.removePKCS7Padding,s=o===void 0?!0:o;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=w,this.config=A,this.removePKCS7Padding=s,s)try{var u=self.crypto;u&&(this.subtle=u.subtle||u.webkitSubtle)}catch(x){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var I=C.prototype;return I.destroy=function(){this.observer=null},I.isSync=function(){return this.config.enableSoftwareAES},I.flush=function(){var A=this.currentResult;if(!A){this.reset();return}var S=new Uint8Array(A);return this.reset(),this.removePKCS7Padding?Object(L.removePadding)(S):S},I.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},I.decrypt=function(A,S,h,o){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(A),S,h);var s=this.flush();s&&o(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(A),S,h).then(o)},I.softwareDecrypt=function(A,S,h){var o=this.currentIV,s=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&&(h=o);var c=this.softwareDecrypter;c||(c=this.softwareDecrypter=new L.default),c.expandKey(S);var p=s;return this.currentResult=c.decrypt(x.buffer,0,h),this.currentIV=Object(O.sliceUint8)(x,-16).buffer,p||null},I.webCryptoDecrypt=function(A,S,h){var o=this,s=this.subtle;return(this.key!==S||!this.fastAesKey)&&(this.key=S,this.fastAesKey=new _.default(s,S)),this.fastAesKey.expandKey().then(function(u){if(!s)return Promise.reject(new Error("web crypto not initialized"));var x=new Q.default(s,h);return x.decrypt(A.buffer,u)}).catch(function(u){return o.onWebCryptoError(u,A,S,h)})},I.onWebCryptoError=function(A,S,h,o){return W.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",A),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(S,h,o)},I.getValidChunk=function(A){var S=A,h=A.length-A.length%M;return h!==A.length&&(S=Object(O.sliceUint8)(A,0,h),this.remainderData=Object(O.sliceUint8)(A,h)),S},I.logOnce=function(A){if(!this.logEnabled)return;W.logger.log("[decrypter.ts]: "+A),this.logEnabled=!1},C}()},"./src/crypt/fast-aes-key.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return Q});var Q=function(){function _(W,U){this.subtle=void 0,this.key=void 0,this.subtle=W,this.key=U}var L=_.prototype;return L.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},_}()},"./src/demux/aacdemuxer.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/demux/base-audio-demuxer.ts"),_=R("./src/demux/adts.ts"),L=R("./src/utils/logger.ts"),W=R("./src/demux/id3.ts");function U(y,C){y.prototype=Object.create(C.prototype),y.prototype.constructor=y,O(y,C)}function O(y,C){return O=Object.setPrototypeOf||function(w,A){return w.__proto__=A,w},O(y,C)}var M=function(y){U(C,y);function C(w,A){var S;return S=y.call(this)||this,S.observer=void 0,S.config=void 0,S.observer=w,S.config=A,S}var I=C.prototype;return I.resetInitSegment=function(A,S,h){y.prototype.resetInitSegment.call(this,A,S,h),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:A,duration:h,inputTimeScale:9e4,dropped:0}},C.probe=function(A){if(!A)return!1;for(var S=W.getID3Data(A,0)||[],h=S.length,o=A.length;h<o;h++)if(_.probe(A,h))return L.logger.log("ADTS sync word found !"),!0;return!1},I.canParse=function(A,S){return _.canParse(A,S)},I.appendFrame=function(A,S,h){_.initTrackConfig(A,this.observer,S,h,A.manifestCodec);var o=_.appendFrame(A,S,h,this.initPTS,this.frameIndex);if(o&&o.missing===0)return o},C}(Q.default);M.minProbeByteLength=9,Z.default=M},"./src/demux/adts.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"getAudioConfig",function(){return W}),R.d(Z,"isHeaderPattern",function(){return U}),R.d(Z,"getHeaderLength",function(){return O}),R.d(Z,"getFullFrameLength",function(){return M}),R.d(Z,"canGetFrameLength",function(){return y}),R.d(Z,"isHeader",function(){return C}),R.d(Z,"canParse",function(){return I}),R.d(Z,"probe",function(){return w}),R.d(Z,"initTrackConfig",function(){return A}),R.d(Z,"getFrameDuration",function(){return S}),R.d(Z,"parseFrameHeader",function(){return h}),R.d(Z,"appendFrame",function(){return o});var Q=R("./src/utils/logger.ts"),_=R("./src/errors.ts"),L=R("./src/events.ts");function W(s,u,x,c){var p,D,v,f,d=navigator.userAgent.toLowerCase(),l=c,a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];p=((u[x+2]&192)>>>6)+1;var g=(u[x+2]&60)>>>2;if(g>a.length-1){s.trigger(L.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+g});return}return v=(u[x+2]&1)<<2,v|=(u[x+3]&192)>>>6,Q.logger.log("manifest codec:"+c+", ADTS type:"+p+", samplingIndex:"+g),/firefox/i.test(d)?g>=6?(p=5,f=new Array(4),D=g-3):(p=2,f=new Array(2),D=g):d.indexOf("android")!==-1?(p=2,f=new Array(2),D=g):(p=5,f=new Array(4),c&&(c.indexOf("mp4a.40.29")!==-1||c.indexOf("mp4a.40.5")!==-1)||!c&&g>=6?D=g-3:((c&&c.indexOf("mp4a.40.2")!==-1&&(g>=6&&v===1||/vivaldi/i.test(d))||!c&&v===1)&&(p=2,f=new Array(2)),D=g)),f[0]=p<<3,f[0]|=(g&14)>>1,f[1]|=(g&1)<<7,f[1]|=v<<3,p===5&&(f[1]|=(D&14)>>1,f[2]=(D&1)<<7,f[2]|=2<<2,f[3]=0),{config:f,samplerate:a[g],channelCount:v,codec:"mp4a.40."+p,manifestCodec:l}}function U(s,u){return s[u]===255&&(s[u+1]&246)===240}function O(s,u){return s[u+1]&1?7:9}function M(s,u){return(s[u+3]&3)<<11|s[u+4]<<3|(s[u+5]&224)>>>5}function y(s,u){return u+5<s.length}function C(s,u){return u+1<s.length&&U(s,u)}function I(s,u){return y(s,u)&&U(s,u)&&M(s,u)<=s.length-u}function w(s,u){if(C(s,u)){var x=O(s,u);if(u+x>=s.length)return!1;var c=M(s,u);if(c<=x)return!1;var p=u+c;return p===s.length||C(s,p)}return!1}function A(s,u,x,c,p){if(!s.samplerate){var D=W(u,x,c,p);if(!D)return;s.config=D.config,s.samplerate=D.samplerate,s.channelCount=D.channelCount,s.codec=D.codec,s.manifestCodec=D.manifestCodec,Q.logger.log("parsed codec:"+s.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function S(s){return 1024*9e4/s}function h(s,u,x,c,p){var D=O(s,u),v=M(s,u);if(v-=D,v>0){var f=x+c*p;return{headerLength:D,frameLength:v,stamp:f}}}function o(s,u,x,c,p){var D=S(s.samplerate),v=h(u,x,c,p,D);if(v){var f=v.frameLength,d=v.headerLength,l=v.stamp,a=d+f,g=Math.max(0,x+a-u.length),m;g?(m=new Uint8Array(a-d),m.set(u.subarray(x+d,u.length),0)):m=u.subarray(x+d,x+a);var b={unit:m,pts:l};return g||s.samples.push(b),{sample:b,length:a,missing:g}}}},"./src/demux/base-audio-demuxer.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"initPTSFn",function(){return M});var Q=R("./src/polyfills/number.ts"),_=R("./src/demux/id3.ts"),L=R("./src/demux/dummy-demuxed-track.ts"),W=R("./src/utils/mp4-tools.ts"),U=R("./src/utils/typed-array.ts"),O=function(){function y(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var C=y.prototype;return C.resetInitSegment=function(w,A,S){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},C.resetTimeStamp=function(){},C.resetContiguity=function(){},C.canParse=function(w,A){return!1},C.appendFrame=function(w,A,S){},C.demux=function(w,A){this.cachedData&&(w=Object(W.appendUint8Array)(this.cachedData,w),this.cachedData=null);var S=_.getID3Data(w,0),h=S?S.length:0,o,s,u=this._audioTrack,x=this._id3Track,c=S?_.getTimeStamp(S):void 0,p=w.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=M(c,A)),S&&S.length>0&&x.samples.push({pts:this.initPTS,dts:this.initPTS,data:S}),s=this.initPTS;h<p;){if(this.canParse(w,h)){var D=this.appendFrame(u,w,h);D?(this.frameIndex++,s=D.sample.pts,h+=D.length,o=h):h=p}else _.canParse(w,h)?(S=_.getID3Data(w,h),x.samples.push({pts:s,dts:s,data:S}),h+=S.length,o=h):h++;if(h===p&&o!==p){var v=Object(U.sliceUint8)(w,o);this.cachedData?this.cachedData=Object(W.appendUint8Array)(this.cachedData,v):this.cachedData=v}}return{audioTrack:u,avcTrack:Object(L.dummyTrack)(),id3Track:x,textTrack:Object(L.dummyTrack)()}},C.demuxSampleAes=function(w,A,S){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},C.flush=function(w){var A=this.cachedData;return A&&(this.cachedData=null,this.demux(A,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(L.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(L.dummyTrack)()}},C.destroy=function(){},y}(),M=function(C,I){return Object(Q.isFiniteNumber)(C)?C*90:I*9e4};Z.default=O},"./src/demux/chunk-cache.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return Q});var Q=function(){function L(){this.chunks=[],this.dataLength=0}var W=L.prototype;return W.push=function(O){this.chunks.push(O),this.dataLength+=O.length},W.flush=function(){var O=this.chunks,M=this.dataLength,y;if(O.length)O.length===1?y=O[0]:y=_(O,M);else return new Uint8Array(0);return this.reset(),y},W.reset=function(){this.chunks.length=0,this.dataLength=0},L}();function _(L,W){for(var U=new Uint8Array(W),O=0,M=0;M<L.length;M++){var y=L[M];U.set(y,O),O+=y.length}return U}},"./src/demux/dummy-demuxed-track.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"dummyTrack",function(){return Q});function Q(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/utils/logger.ts"),_=function(){function L(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 W=L.prototype;return W.loadWord=function(){var O=this.data,M=this.bytesAvailable,y=O.byteLength-M,C=new Uint8Array(4),I=Math.min(4,M);if(I===0)throw new Error("no bytes available");C.set(O.subarray(y,y+I)),this.word=new DataView(C.buffer).getUint32(0),this.bitsAvailable=I*8,this.bytesAvailable-=I},W.skipBits=function(O){var M;this.bitsAvailable>O?(this.word<<=O,this.bitsAvailable-=O):(O-=this.bitsAvailable,M=O>>3,O-=M>>3,this.bytesAvailable-=M,this.loadWord(),this.word<<=O,this.bitsAvailable-=O)},W.readBits=function(O){var M=Math.min(this.bitsAvailable,O),y=this.word>>>32-M;return O>32&&Q.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=M,this.bitsAvailable>0?this.word<<=M:this.bytesAvailable>0&&this.loadWord(),M=O-M,M>0&&this.bitsAvailable?y<<M|this.readBits(M):y},W.skipLZ=function(){var O;for(O=0;O<this.bitsAvailable;++O)if((this.word&2147483648>>>O)!==0)return this.word<<=O,this.bitsAvailable-=O,O;return this.loadWord(),O+this.skipLZ()},W.skipUEG=function(){this.skipBits(1+this.skipLZ())},W.skipEG=function(){this.skipBits(1+this.skipLZ())},W.readUEG=function(){var O=this.skipLZ();return this.readBits(O+1)-1},W.readEG=function(){var O=this.readUEG();return 1&O?1+O>>>1:-1*(O>>>1)},W.readBoolean=function(){return this.readBits(1)===1},W.readUByte=function(){return this.readBits(8)},W.readUShort=function(){return this.readBits(16)},W.readUInt=function(){return this.readBits(32)},W.skipScalingList=function(O){for(var M=8,y=8,C,I=0;I<O;I++)y!==0&&(C=this.readEG(),y=(M+C+256)%256),M=y===0?M:y},W.readSPS=function(){var O=0,M=0,y=0,C=0,I,w,A,S=this.readUByte.bind(this),h=this.readBits.bind(this),o=this.readUEG.bind(this),s=this.readBoolean.bind(this),u=this.skipBits.bind(this),x=this.skipEG.bind(this),c=this.skipUEG.bind(this),p=this.skipScalingList.bind(this);S();var D=S();if(h(5),u(3),S(),c(),D===100||D===110||D===122||D===244||D===44||D===83||D===86||D===118||D===128){var v=o();if(v===3&&u(1),c(),c(),u(1),s())for(w=v!==3?8:12,A=0;A<w;A++)s()&&(A<6?p(16):p(64))}c();var f=o();if(f===0)o();else if(f===1)for(u(1),x(),x(),I=o(),A=0;A<I;A++)x();c(),u(1);var d=o(),l=o(),a=h(1);a===0&&u(1),u(1),s()&&(O=o(),M=o(),y=o(),C=o());var g=[1,1];if(s()&&s()){var m=S();switch(m){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=[S()<<8|S(),S()<<8|S()];break}}}return{width:Math.ceil((d+1)*16-O*2-M*2),height:(2-a)*(l+1)*16-(a?2:4)*(y+C),pixelRatio:g}},W.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},L}();Z.default=_},"./src/demux/id3.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"isHeader",function(){return Q}),R.d(Z,"isFooter",function(){return _}),R.d(Z,"getID3Data",function(){return L}),R.d(Z,"canParse",function(){return U}),R.d(Z,"getTimeStamp",function(){return O}),R.d(Z,"isTimeStampFrame",function(){return M}),R.d(Z,"getID3Frames",function(){return C}),R.d(Z,"decodeFrame",function(){return I}),R.d(Z,"utf8ArrayToStr",function(){return o}),R.d(Z,"testables",function(){return s});var Q=function(p,D){return D+10<=p.length&&(p[D]===73&&p[D+1]===68&&p[D+2]===51&&(p[D+3]<255&&p[D+4]<255&&(p[D+6]<128&&p[D+7]<128&&p[D+8]<128&&p[D+9]<128)))},_=function(p,D){return D+10<=p.length&&(p[D]===51&&p[D+1]===68&&p[D+2]===73&&(p[D+3]<255&&p[D+4]<255&&(p[D+6]<128&&p[D+7]<128&&p[D+8]<128&&p[D+9]<128)))},L=function(p,D){for(var v=D,f=0;Q(p,D);){f+=10;var d=W(p,D+6);f+=d,_(p,D+10)&&(f+=10),D+=f}return f>0?p.subarray(v,v+f):void 0},W=function(p,D){var v=0;return v=(p[D]&127)<<21,v|=(p[D+1]&127)<<14,v|=(p[D+2]&127)<<7,v|=p[D+3]&127,v},U=function(p,D){return Q(p,D)&&W(p,D+6)+10<=p.length-D},O=function(p){for(var D=C(p),v=0;v<D.length;v++){var f=D[v];if(M(f))return h(f)}return},M=function(p){return p&&p.key==="PRIV"&&p.info==="com.apple.streaming.transportStreamTimestamp"},y=function(p){var D=String.fromCharCode(p[0],p[1],p[2],p[3]),v=W(p,4),f=10;return{type:D,size:v,data:p.subarray(f,f+v)}},C=function(p){for(var D=0,v=[];Q(p,D);){var f=W(p,D+6);D+=10;for(var d=D+f;D+8<d;){var l=y(p.subarray(D)),a=I(l);a&&v.push(a),D+=l.size+10}_(p,D)&&(D+=10)}return v},I=function(p){return p.type==="PRIV"?w(p):p.type[0]==="W"?S(p):A(p)},w=function(p){if(p.size<2)return;var D=o(p.data,!0),v=new Uint8Array(p.data.subarray(D.length+1));return{key:p.type,info:D,data:v.buffer}},A=function(p){if(p.size<2)return;if(p.type==="TXXX"){var D=1,v=o(p.data.subarray(D),!0);D+=v.length+1;var f=o(p.data.subarray(D));return{key:p.type,info:v,data:f}}var d=o(p.data.subarray(1));return{key:p.type,data:d}},S=function(p){if(p.type==="WXXX"){if(p.size<2)return;var D=1,v=o(p.data.subarray(D),!0);D+=v.length+1;var f=o(p.data.subarray(D));return{key:p.type,info:v,data:f}}var d=o(p.data);return{key:p.type,data:d}},h=function(p){if(p.data.byteLength===8){var D=new Uint8Array(p.data),v=D[3]&1,f=(D[4]<<23)+(D[5]<<15)+(D[6]<<7)+D[7];return f/=45,v&&(f+=4772185884e-2),Math.round(f)}return},o=function(p,D){D===void 0&&(D=!1);var v=x();if(v){var f=v.decode(p);if(D){var d=f.indexOf("\0");return d!==-1?f.substring(0,d):f}return f.replace(/\0/g,"")}for(var l=p.length,a,g,m,b="",P=0;P<l;){if(a=p[P++],a===0&&D)return b;if(a===0||a===3)continue;switch(a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(a);break;case 12:case 13:g=p[P++],b+=String.fromCharCode((a&31)<<6|g&63);break;case 14:g=p[P++],m=p[P++],b+=String.fromCharCode((a&15)<<12|(g&63)<<6|(m&63)<<0);break;default:}}return b},s={decodeTextFrame:A},u;function x(){return!u&&typeof self.TextDecoder!="undefined"&&(u=new self.TextDecoder("utf-8")),u}},"./src/demux/mp3demuxer.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/demux/base-audio-demuxer.ts"),_=R("./src/demux/id3.ts"),L=R("./src/utils/logger.ts"),W=R("./src/demux/mpegaudio.ts");function U(y,C){y.prototype=Object.create(C.prototype),y.prototype.constructor=y,O(y,C)}function O(y,C){return O=Object.setPrototypeOf||function(w,A){return w.__proto__=A,w},O(y,C)}var M=function(y){U(C,y);function C(){return y.apply(this,arguments)||this}var I=C.prototype;return I.resetInitSegment=function(A,S,h){y.prototype.resetInitSegment.call(this,A,S,h),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:A,duration:h,inputTimeScale:9e4,dropped:0}},C.probe=function(A){if(!A)return!1;for(var S=_.getID3Data(A,0)||[],h=S.length,o=A.length;h<o;h++)if(W.probe(A,h))return L.logger.log("MPEG Audio sync word found !"),!0;return!1},I.canParse=function(A,S){return W.canParse(A,S)},I.appendFrame=function(A,S,h){return this.initPTS===null?void 0:W.appendFrame(A,S,h,this.initPTS,this.frameIndex)},C}(Q.default);M.minProbeByteLength=4,Z.default=M},"./src/demux/mp4demuxer.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/utils/mp4-tools.ts"),_=R("./src/demux/dummy-demuxed-track.ts"),L=function(){function W(O,M){this.remainderData=null,this.config=void 0,this.config=M}var U=W.prototype;return U.resetTimeStamp=function(){},U.resetInitSegment=function(){},U.resetContiguity=function(){},W.probe=function(M){return Object(Q.findBox)({data:M,start:0,end:Math.min(M.length,16384)},["moof"]).length>0},U.demux=function(M){var y=M,C=Object(_.dummyTrack)();if(this.config.progressive){this.remainderData&&(y=Object(Q.appendUint8Array)(this.remainderData,M));var I=Object(Q.segmentValidRange)(y);this.remainderData=I.remainder,C.samples=I.valid||new Uint8Array}else C.samples=y;return{audioTrack:Object(_.dummyTrack)(),avcTrack:C,id3Track:Object(_.dummyTrack)(),textTrack:Object(_.dummyTrack)()}},U.flush=function(){var M=Object(_.dummyTrack)();return M.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(_.dummyTrack)(),avcTrack:M,id3Track:Object(_.dummyTrack)(),textTrack:Object(_.dummyTrack)()}},U.demuxSampleAes=function(M,y,C){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},U.destroy=function(){},W}();L.minProbeByteLength=1024,Z.default=L},"./src/demux/mpegaudio.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"appendFrame",function(){return O}),R.d(Z,"parseHeader",function(){return M}),R.d(Z,"isHeaderPattern",function(){return y}),R.d(Z,"isHeader",function(){return C}),R.d(Z,"canParse",function(){return I}),R.d(Z,"probe",function(){return w});var Q=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],L=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],W=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],U=[0,1,1,4];function O(A,S,h,o,s){if(h+24>S.length)return;var u=M(S,h);if(u&&h+u.frameLength<=S.length){var x=u.samplesPerFrame*9e4/u.sampleRate,c=o+s*x,p={unit:S.subarray(h,h+u.frameLength),pts:c,dts:c};return A.config=[],A.channelCount=u.channelCount,A.samplerate=u.sampleRate,A.samples.push(p),{sample:p,length:u.frameLength,missing:0}}}function M(A,S){var h=A[S+1]>>3&3,o=A[S+1]>>1&3,s=A[S+2]>>4&15,u=A[S+2]>>2&3;if(h!==1&&s!==0&&s!==15&&u!==3){var x=A[S+2]>>1&1,c=A[S+3]>>6,p=h===3?3-o:o===3?3:4,D=_[p*14+s-1]*1e3,v=h===3?0:h===2?1:2,f=L[v*3+u],d=c===3?1:2,l=W[h][o],a=U[o],g=l*8*a,m=Math.floor(l*D/f+x)*a;if(Q===null){var b=navigator.userAgent||"",P=b.match(/Chrome\/(\d+)/i);Q=P?parseInt(P[1]):0}var H=!!Q&&Q<=87;return H&&o===2&&D>=224e3&&c===0&&(A[S+3]=A[S+3]|128),{sampleRate:f,channelCount:d,frameLength:m,samplesPerFrame:g}}}function y(A,S){return A[S]===255&&(A[S+1]&224)===224&&(A[S+1]&6)!==0}function C(A,S){return S+1<A.length&&y(A,S)}function I(A,S){var h=4;return y(A,S)&&h<=A.length-S}function w(A,S){if(S+1<A.length&&y(A,S)){var h=4,o=M(A,S),s=h;o!=null&&o.frameLength&&(s=o.frameLength);var u=S+s;return u===A.length||C(A,u)}return!1}},"./src/demux/sample-aes.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/crypt/decrypter.ts"),_=R("./src/demux/tsdemuxer.ts"),L=function(){function W(O,M,y){this.keyData=void 0,this.decrypter=void 0,this.keyData=y,this.decrypter=new Q.default(O,M,{removePKCS7Padding:!1})}var U=W.prototype;return U.decryptBuffer=function(M,y){this.decrypter.decrypt(M,this.keyData.key.buffer,this.keyData.iv.buffer,y)},U.decryptAacSample=function(M,y,C,I){var w=M[y].unit,A=w.subarray(16,w.length-w.length%16),S=A.buffer.slice(A.byteOffset,A.byteOffset+A.length),h=this;this.decryptBuffer(S,function(o){var s=new Uint8Array(o);w.set(s,16),I||h.decryptAacSamples(M,y+1,C)})},U.decryptAacSamples=function(M,y,C){for(;;y++){if(y>=M.length){C();return}if(M[y].unit.length<32)continue;var I=this.decrypter.isSync();if(this.decryptAacSample(M,y,C,I),!I)return}},U.getAvcEncryptedData=function(M){for(var y=Math.floor((M.length-48)/160)*16+16,C=new Int8Array(y),I=0,w=32;w<=M.length-16;w+=160,I+=16)C.set(M.subarray(w,w+16),I);return C},U.getAvcDecryptedUnit=function(M,y){for(var C=new Uint8Array(y),I=0,w=32;w<=M.length-16;w+=160,I+=16)M.set(C.subarray(I,I+16),w);return M},U.decryptAvcSample=function(M,y,C,I,w,A){var S=Object(_.discardEPB)(w.data),h=this.getAvcEncryptedData(S),o=this;this.decryptBuffer(h.buffer,function(s){w.data=o.getAvcDecryptedUnit(S,s),A||o.decryptAvcSamples(M,y,C+1,I)})},U.decryptAvcSamples=function(M,y,C,I){if(M instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;y++,C=0){if(y>=M.length){I();return}for(var w=M[y].units;!(C>=w.length);C++){var A=w[C];if(A.data.length<=48||A.type!==1&&A.type!==5)continue;var S=this.decrypter.isSync();if(this.decryptAvcSample(M,y,C,I,A,S),!S)return}}},W}();Z.default=L},"./src/demux/transmuxer-interface.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return w});var Q=R("./node_modules/webworkify-webpack/index.js"),_=R.n(Q),L=R("./src/events.ts"),W=R("./src/demux/transmuxer.ts"),U=R("./src/utils/logger.ts"),O=R("./src/errors.ts"),M=R("./src/utils/mediasource-helper.ts"),y=R("./node_modules/eventemitter3/index.js"),C=R.n(y),I=Object(M.getMediaSource)()||{isTypeSupported:function(){return!1}},w=function(){function A(h,o,s,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=h,this.id=o,this.onTransmuxComplete=s,this.onFlush=u;var c=h.config,p=function(l,a){a=a||{},a.frag=x.frag,a.id=x.id,h.trigger(l,a)};this.observer=new y.EventEmitter,this.observer.on(L.Events.FRAG_DECRYPTED,p),this.observer.on(L.Events.ERROR,p);var D={mp4:I.isTypeSupported("video/mp4"),mpeg:I.isTypeSupported("audio/mpeg"),mp3:I.isTypeSupported('audio/mp4; codecs="mp3"')},v=navigator.vendor;if(c.enableWorker&&typeof Worker!="undefined"){U.logger.log("demuxing in webworker");var f;try{f=this.worker=Q("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),f.addEventListener("message",this.onwmsg),f.onerror=function(d){h.trigger(L.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(d.message+" ("+d.filename+":"+d.lineno+")")})},f.postMessage({cmd:"init",typeSupported:D,vendor:v,id:o,config:JSON.stringify(c)})}catch(d){U.logger.warn("Error in worker:",d),U.logger.error("Error while initializing DemuxerWorker, fallback to inline"),f&&self.URL.revokeObjectURL(f.objectURL),this.transmuxer=new W.default(this.observer,D,c,v,o),this.worker=null}}else this.transmuxer=new W.default(this.observer,D,c,v,o)}var S=A.prototype;return S.destroy=function(){var o=this.worker;if(o)o.removeEventListener("message",this.onwmsg),o.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var u=this.observer;u&&u.removeAllListeners(),this.observer=null},S.push=function(o,s,u,x,c,p,D,v,f,d){var l=this;f.transmuxing.start=self.performance.now();var a=this.transmuxer,g=this.worker,m=p?p.start:c.start,b=c.decryptdata,P=this.frag,H=!(P&&c.cc===P.cc),V=!(P&&f.level===P.level),re=P?f.sn-P.sn:-1,z=this.part?f.part-this.part.index:1,F=!V&&(re===1||re===0&&z===1),ae=self.performance.now();(V||re||c.stats.parsing.start===0)&&(c.stats.parsing.start=ae),p&&(z||!F)&&(p.stats.parsing.start=ae);var ce=new W.TransmuxState(H,F,v,V,m);if(!F||H){U.logger.log("[transmuxer-interface, "+c.type+"]: Starting new transmux session for sn: "+f.sn+" p: "+f.part+" level: "+f.level+" id: "+f.id+`
|
|
discontinuity: `+H+`
|
|
trackSwitch: `+V+`
|
|
contiguous: `+F+`
|
|
accurateTimeOffset: `+v+`
|
|
timeOffset: `+m);var me=new W.TransmuxConfig(u,x,s,D,d);this.configureTransmuxer(me)}if(this.frag=c,this.part=p,g)g.postMessage({cmd:"demux",data:o,decryptdata:b,chunkMeta:f,state:ce},o instanceof ArrayBuffer?[o]:[]);else if(a){var be=a.push(o,b,f,ce);Object(W.isPromise)(be)?be.then(function(Be){l.handleTransmuxComplete(Be)}):this.handleTransmuxComplete(be)}},S.flush=function(o){var s=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 c=u.flush(o);Object(W.isPromise)(c)?c.then(function(p){s.handleFlushResult(p,o)}):this.handleFlushResult(c,o)}},S.handleFlushResult=function(o,s){var u=this;o.forEach(function(x){u.handleTransmuxComplete(x)}),this.onFlush(s)},S.onWorkerMessage=function(o){var s=o.data,u=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,u.trigger(s.event,s.data);break}}},S.configureTransmuxer=function(o){var s=this.worker,u=this.transmuxer;s?s.postMessage({cmd:"configure",config:o}):u&&u.configure(o)},S.handleTransmuxComplete=function(o){o.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(o)},A}()},"./src/demux/transmuxer-worker.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return O});var Q=R("./src/demux/transmuxer.ts"),_=R("./src/events.ts"),L=R("./src/utils/logger.ts"),W=R("./node_modules/eventemitter3/index.js"),U=R.n(W);function O(w){var A=new W.EventEmitter,S=function(o,s){w.postMessage({event:o,data:s})};A.on(_.Events.FRAG_DECRYPTED,S),A.on(_.Events.ERROR,S),w.addEventListener("message",function(h){var o=h.data;switch(o.cmd){case"init":{var s=JSON.parse(o.config);w.transmuxer=new Q.default(A,o.typeSupported,s,o.vendor,o.id),Object(L.enableLogs)(s.debug),S("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(Q.isPromise)(u)?u.then(function(p){M(w,p)}):M(w,u);break}case"flush":{var x=o.chunkMeta,c=w.transmuxer.flush(x);Object(Q.isPromise)(c)?c.then(function(p){C(w,p,x)}):C(w,c,x);break}default:break}})}function M(w,A){if(I(A.remuxResult))return;var S=[],h=A.remuxResult,o=h.audio,s=h.video;o&&y(S,o),s&&y(S,s),w.postMessage({event:"transmuxComplete",data:A},S)}function y(w,A){A.data1&&w.push(A.data1.buffer),A.data2&&w.push(A.data2.buffer)}function C(w,A,S){A.forEach(function(h){M(w,h)}),w.postMessage({event:"flush",data:S})}function I(w){return!w.audio&&!w.video&&!w.text&&!w.id3&&!w.initSegment}},"./src/demux/transmuxer.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return s}),R.d(Z,"isPromise",function(){return c}),R.d(Z,"TransmuxConfig",function(){return p}),R.d(Z,"TransmuxState",function(){return D});var Q=R("./src/events.ts"),_=R("./src/errors.ts"),L=R("./src/crypt/decrypter.ts"),W=R("./src/demux/aacdemuxer.ts"),U=R("./src/demux/mp4demuxer.ts"),O=R("./src/demux/tsdemuxer.ts"),M=R("./src/demux/mp3demuxer.ts"),y=R("./src/remux/mp4-remuxer.ts"),C=R("./src/remux/passthrough-remuxer.ts"),I=R("./src/demux/chunk-cache.ts"),w=R("./src/utils/mp4-tools.ts"),A=R("./src/utils/logger.ts"),S;try{S=self.performance.now.bind(self.performance)}catch(v){A.logger.debug("Unable to use Performance API on this environment"),S=self.Date.now}var h=[{demux:O.default,remux:y.default},{demux:U.default,remux:C.default},{demux:W.default,remux:y.default},{demux:M.default,remux:y.default}],o=1024;h.forEach(function(v){var f=v.demux;o=Math.max(o,f.minProbeByteLength)});var s=function(){function v(d,l,a,g,m){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new I.default,this.observer=d,this.typeSupported=l,this.config=a,this.vendor=g,this.id=m}var f=v.prototype;return f.configure=function(l){this.transmuxConfig=l,this.decrypter&&this.decrypter.reset()},f.push=function(l,a,g,m){var b=this,P=g.transmuxing;P.executeStart=S();var H=new Uint8Array(l),V=this.cache,re=this.config,z=this.currentTransmuxState,F=this.transmuxConfig;m&&(this.currentTransmuxState=m);var ae=u(H,a);if(ae&&ae.method==="AES-128"){var ce=this.getDecrypter();if(re.enableSoftwareAES){var me=ce.softwareDecrypt(H,ae.key.buffer,ae.iv.buffer);if(!me)return P.executeEnd=S(),x(g);H=new Uint8Array(me)}else return this.decryptionPromise=ce.webCryptoDecrypt(H,ae.key.buffer,ae.iv.buffer).then(function(Ee){var De=b.push(Ee,null,g);return b.decryptionPromise=null,De}),this.decryptionPromise}var be=m||z,Be=be.contiguous,Ce=be.discontinuity,Le=be.trackSwitch,Te=be.accurateTimeOffset,we=be.timeOffset,ve=F.audioCodec,j=F.videoCodec,T=F.defaultInitPts,k=F.duration,G=F.initSegmentData;if((Ce||Le)&&this.resetInitSegment(G,ve,j,k),Ce&&this.resetInitialTimestamp(T),Be||this.resetContiguity(),this.needsProbing(H,Ce,Le)){if(V.dataLength){var $=V.flush();H=Object(w.appendUint8Array)($,H)}this.configureTransmuxer(H,F)}var N=this.transmux(H,ae,we,Te,g),ue=this.currentTransmuxState;return ue.contiguous=!0,ue.discontinuity=!1,ue.trackSwitch=!1,P.executeEnd=S(),N},f.flush=function(l){var a=this,g=l.transmuxing;g.executeStart=S();var m=this.decrypter,b=this.cache,P=this.currentTransmuxState,H=this.decryptionPromise;if(H)return H.then(function(){return a.flush(l)});var V=[],re=P.timeOffset;if(m){var z=m.flush();z&&V.push(this.push(z,null,l))}var F=b.dataLength;b.reset();var ae=this.demuxer,ce=this.remuxer;if(!ae||!ce)return F>=o&&this.observer.emit(Q.Events.ERROR,Q.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),g.executeEnd=S(),[x(l)];var me=ae.flush(re);return c(me)?me.then(function(be){return a.flushRemux(V,be,l),V}):(this.flushRemux(V,me,l),V)},f.flushRemux=function(l,a,g){var m=a.audioTrack,b=a.avcTrack,P=a.id3Track,H=a.textTrack,V=this.currentTransmuxState,re=V.accurateTimeOffset,z=V.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(m,b,P,H,z,re,!0,this.id);l.push({remuxResult:F,chunkMeta:g}),g.transmuxing.executeEnd=S()},f.resetInitialTimestamp=function(l){var a=this.demuxer,g=this.remuxer;if(!a||!g)return;a.resetTimeStamp(l),g.resetTimeStamp(l)},f.resetContiguity=function(){var l=this.demuxer,a=this.remuxer;if(!l||!a)return;l.resetContiguity(),a.resetNextTimestamp()},f.resetInitSegment=function(l,a,g,m){var b=this.demuxer,P=this.remuxer;if(!b||!P)return;b.resetInitSegment(a,g,m),P.resetInitSegment(l,a,g)},f.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},f.transmux=function(l,a,g,m,b){var P;return a&&a.method==="SAMPLE-AES"?P=this.transmuxSampleAes(l,a,g,m,b):P=this.transmuxUnencrypted(l,g,m,b),P},f.transmuxUnencrypted=function(l,a,g,m){var b=this.demuxer.demux(l,a,!1,!this.config.progressive),P=b.audioTrack,H=b.avcTrack,V=b.id3Track,re=b.textTrack,z=this.remuxer.remux(P,H,V,re,a,g,!1,this.id);return{remuxResult:z,chunkMeta:m}},f.transmuxSampleAes=function(l,a,g,m,b){var P=this;return this.demuxer.demuxSampleAes(l,a,g).then(function(H){var V=P.remuxer.remux(H.audioTrack,H.avcTrack,H.id3Track,H.textTrack,g,m,!1,P.id);return{remuxResult:V,chunkMeta:b}})},f.configureTransmuxer=function(l,a){for(var g=this.config,m=this.observer,b=this.typeSupported,P=this.vendor,H=a.audioCodec,V=a.defaultInitPts,re=a.duration,z=a.initSegmentData,F=a.videoCodec,ae,ce=0,me=h.length;ce<me;ce++)if(h[ce].demux.probe(l)){ae=h[ce];break}ae||(A.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),ae={demux:U.default,remux:C.default});var be=this.demuxer,Be=this.remuxer,Ce=ae.remux,Le=ae.demux;(!Be||!(Be instanceof Ce))&&(this.remuxer=new Ce(m,g,b,P)),(!be||!(be instanceof Le))&&(this.demuxer=new Le(m,g,b),this.probe=Le.probe),this.resetInitSegment(z,H,F,re),this.resetInitialTimestamp(V)},f.needsProbing=function(l,a,g){return!this.demuxer||!this.remuxer||a||g},f.getDecrypter=function(){var l=this.decrypter;return l||(l=this.decrypter=new L.default(this.observer,this.config)),l},v}();function u(v,f){var d=null;return v.byteLength>0&&f!=null&&f.key!=null&&f.iv!==null&&f.method!=null&&(d=f),d}var x=function(f){return{remuxResult:{},chunkMeta:f}};function c(v){return"then"in v&&v.then instanceof Function}var p=function(f,d,l,a,g){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=f,this.videoCodec=d,this.initSegmentData=l,this.duration=a,this.defaultInitPts=g},D=function(f,d,l,a,g){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=f,this.contiguous=d,this.accurateTimeOffset=l,this.trackSwitch=a,this.timeOffset=g}},"./src/demux/tsdemuxer.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"discardEPB",function(){return x});var Q=R("./src/demux/adts.ts"),_=R("./src/demux/mpegaudio.ts"),L=R("./src/demux/exp-golomb.ts"),W=R("./src/demux/id3.ts"),U=R("./src/demux/sample-aes.ts"),O=R("./src/events.ts"),M=R("./src/utils/mp4-tools.ts"),y=R("./src/utils/logger.ts"),C=R("./src/errors.ts"),I={video:1,audio:2,id3:3,text:4},w=function(){function c(D,v,f){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=v,this.typeSupported=f}c.probe=function(v){var f=c.syncOffset(v);return f<0?!1:(f&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+f+", junk ahead ?"),!0)},c.syncOffset=function(v){for(var f=Math.min(1e3,v.length-3*188),d=0;d<f;){if(v[d]===71&&v[d+188]===71&&v[d+2*188]===71)return d;d++}return-1},c.createTrack=function(v,f){return{container:v==="video"||v==="audio"?"video/mp2t":void 0,type:v,id:I[v],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:v==="audio"?f:void 0}};var p=c.prototype;return p.resetInitSegment=function(v,f,d){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=c.createTrack("video",d),this._audioTrack=c.createTrack("audio",d),this._id3Track=c.createTrack("id3",d),this._txtTrack=c.createTrack("text",d),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=v,this.videoCodec=f,this._duration=d},p.resetTimeStamp=function(){},p.resetContiguity=function(){var v=this._audioTrack,f=this._avcTrack,d=this._id3Track;v&&(v.pesData=null),f&&(f.pesData=null),d&&(d.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},p.demux=function(v,f,d,l){d===void 0&&(d=!1),l===void 0&&(l=!1),d||(this.sampleAes=null);var a,g=this._avcTrack,m=this._audioTrack,b=this._id3Track,P=g.pid,H=g.pesData,V=m.pid,re=b.pid,z=m.pesData,F=b.pesData,ae=!1,ce=this.pmtParsed,me=this._pmtId,be=v.length;if(this.remainderData&&(v=Object(M.appendUint8Array)(this.remainderData,v),be=v.length,this.remainderData=null),be<188&&!l)return this.remainderData=v,{audioTrack:m,avcTrack:g,id3Track:b,textTrack:this._txtTrack};var Be=Math.max(0,c.syncOffset(v));be-=(be+Be)%188,be<v.byteLength&&!l&&(this.remainderData=new Uint8Array(v.buffer,be,v.buffer.byteLength-be));for(var Ce=Be;Ce<be;Ce+=188)if(v[Ce]===71){var Le=!!(v[Ce+1]&64),Te=((v[Ce+1]&31)<<8)+v[Ce+2],we=(v[Ce+3]&48)>>4,ve=void 0;if(we>1){if(ve=Ce+5+v[Ce+4],ve===Ce+188)continue}else ve=Ce+4;switch(Te){case P:Le&&(H&&(a=o(H))&&this.parseAVCPES(a,!1),H={data:[],size:0}),H&&(H.data.push(v.subarray(ve,Ce+188)),H.size+=Ce+188-ve);break;case V:Le&&(z&&(a=o(z))&&(m.isAAC?this.parseAACPES(a):this.parseMPEGPES(a)),z={data:[],size:0}),z&&(z.data.push(v.subarray(ve,Ce+188)),z.size+=Ce+188-ve);break;case re:Le&&(F&&(a=o(F))&&this.parseID3PES(a),F={data:[],size:0}),F&&(F.data.push(v.subarray(ve,Ce+188)),F.size+=Ce+188-ve);break;case 0:Le&&(ve+=v[ve]+1),me=this._pmtId=S(v,ve);break;case me:{Le&&(ve+=v[ve]+1);var j=h(v,ve,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,d);P=j.avc,P>0&&(g.pid=P),V=j.audio,V>0&&(m.pid=V,m.isAAC=j.isAAC),re=j.id3,re>0&&(b.pid=re),ae&&!ce&&(y.logger.log("reparse from beginning"),ae=!1,Ce=Be-188),ce=this.pmtParsed=!0;break}case 17:case 8191:break;default:ae=!0;break}}else this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});g.pesData=H,m.pesData=z,b.pesData=F;var T={audioTrack:m,avcTrack:g,id3Track:b,textTrack:this._txtTrack};return l&&this.extractRemainingSamples(T),T},p.flush=function(){var v=this.remainderData;this.remainderData=null;var f;return v?f=this.demux(v,-1,!1,!0):f={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(f),this.sampleAes?this.decrypt(f,this.sampleAes):f},p.extractRemainingSamples=function(v){var f=v.audioTrack,d=v.avcTrack,l=v.id3Track,a=d.pesData,g=f.pesData,m=l.pesData,b;a&&(b=o(a))?(this.parseAVCPES(b,!0),d.pesData=null):d.pesData=a,g&&(b=o(g))?(f.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),f.pesData=null):(g!=null&&g.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),f.pesData=g),m&&(b=o(m))?(this.parseID3PES(b),l.pesData=null):l.pesData=m},p.demuxSampleAes=function(v,f,d){var l=this.demux(v,d,!0,!this.config.progressive),a=this.sampleAes=new U.default(this.observer,this.config,f);return this.decrypt(l,a)},p.decrypt=function(v,f){return new Promise(function(d){var l=v.audioTrack,a=v.avcTrack;l.samples&&l.isAAC?f.decryptAacSamples(l.samples,0,function(){a.samples?f.decryptAvcSamples(a.samples,0,0,function(){d(v)}):d(v)}):a.samples&&f.decryptAvcSamples(a.samples,0,0,function(){d(v)})})},p.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},p.parseAVCPES=function(v,f){var d=this,l=this._avcTrack,a=this.parseAVCNALu(v.data),g=!1,m=this.avcSample,b,P=!1;v.data=null,m&&a.length&&!l.audFound&&(s(m,l),m=this.avcSample=A(!1,v.pts,v.dts,"")),a.forEach(function(H){switch(H.type){case 1:{b=!0,m||(m=d.avcSample=A(!0,v.pts,v.dts,"")),g&&(m.debug+="NDR "),m.frame=!0;var V=H.data;if(P&&V.length>4){var re=new L.default(V).readSliceType();(re===2||re===4||re===7||re===9)&&(m.key=!0)}break}case 5:b=!0,m||(m=d.avcSample=A(!0,v.pts,v.dts,"")),g&&(m.debug+="IDR "),m.key=!0,m.frame=!0;break;case 6:{b=!0,g&&m&&(m.debug+="SEI ");var z=new L.default(x(H.data));z.readUByte();for(var F=0,ae=0,ce=!1,me=0;!ce&&z.bytesAvailable>1;){F=0;do me=z.readUByte(),F+=me;while(me===255);ae=0;do me=z.readUByte(),ae+=me;while(me===255);if(F===4&&z.bytesAvailable!==0){ce=!0;var be=z.readUByte();if(be===181){var Be=z.readUShort();if(Be===49){var Ce=z.readUInt();if(Ce===1195456820){var Le=z.readUByte();if(Le===3){for(var Te=z.readUByte(),we=z.readUByte(),ve=31&Te,j=[Te,we],T=0;T<ve;T++)j.push(z.readUByte()),j.push(z.readUByte()),j.push(z.readUByte());u(d._txtTrack.samples,{type:3,pts:v.pts,bytes:j})}}}}}else if(F===5&&z.bytesAvailable!==0){if(ce=!0,ae>16){for(var k=[],G=0;G<16;G++)k.push(z.readUByte().toString(16)),(G===3||G===5||G===7||G===9)&&k.push("-");for(var $=ae-16,N=new Uint8Array($),ue=0;ue<$;ue++)N[ue]=z.readUByte();u(d._txtTrack.samples,{pts:v.pts,payloadType:F,uuid:k.join(""),userData:Object(W.utf8ArrayToStr)(N),userDataBytes:N})}}else if(ae<z.bytesAvailable)for(var Ee=0;Ee<ae;Ee++)z.readUByte()}break}case 7:if(b=!0,P=!0,g&&m&&(m.debug+="SPS "),!l.sps){var De=new L.default(H.data),Ne=De.readSPS();l.width=Ne.width,l.height=Ne.height,l.pixelRatio=Ne.pixelRatio,l.sps=[H.data],l.duration=d._duration;for(var Re=H.data.subarray(1,4),Ie="avc1.",Pe=0;Pe<3;Pe++){var Ge=Re[Pe].toString(16);Ge.length<2&&(Ge="0"+Ge),Ie+=Ge}l.codec=Ie}break;case 8:b=!0,g&&m&&(m.debug+="PPS "),l.pps||(l.pps=[H.data]);break;case 9:b=!1,l.audFound=!0,m&&s(m,l),m=d.avcSample=A(!1,v.pts,v.dts,g?"AUD ":"");break;case 12:b=!1;break;default:b=!1,m&&(m.debug+="unknown NAL "+H.type+" ");break}if(m&&b){var Ke=m.units;Ke.push(H)}}),f&&m&&(s(m,l),this.avcSample=null)},p.getLastNalUnit=function(){var v,f=this.avcSample,d;if(!f||f.units.length===0){var l=this._avcTrack.samples;f=l[l.length-1]}if((v=f)!==null&&v!==void 0&&v.units){var a=f.units;d=a[a.length-1]}return d},p.parseAVCNALu=function(v){var f=v.byteLength,d=this._avcTrack,l=d.naluState||0,a=l,g=[],m=0,b,P,H,V=-1,re=0;for(l===-1&&(V=0,re=v[0]&31,l=0,m=1);m<f;){if(b=v[m++],!l){l=b?0:1;continue}if(l===1){l=b?0:2;continue}if(!b)l=3;else if(b===1){if(V>=0){var z={data:v.subarray(V,m-l-1),type:re};g.push(z)}else{var F=this.getLastNalUnit();if(F&&(a&&m<=4-a&&(F.state&&(F.data=F.data.subarray(0,F.data.byteLength-a))),P=m-l-1,P>0)){var ae=new Uint8Array(F.data.byteLength+P);ae.set(F.data,0),ae.set(v.subarray(0,P),F.data.byteLength),F.data=ae,F.state=0}}m<f?(H=v[m]&31,V=m,re=H,l=0):l=-1}else l=0}if(V>=0&&l>=0){var ce={data:v.subarray(V,f),type:re,state:l};g.push(ce)}if(g.length===0){var me=this.getLastNalUnit();if(me){var be=new Uint8Array(me.data.byteLength+v.byteLength);be.set(me.data,0),be.set(v,me.data.byteLength),me.data=be}}return d.naluState=l,g},p.parseAACPES=function(v){var f=0,d=this._audioTrack,l=this.aacOverFlow,a=v.data;if(l){this.aacOverFlow=null;var g=l.sample.unit.byteLength,m=Math.min(l.missing,g),b=g-m;l.sample.unit.set(a.subarray(0,m),b),d.samples.push(l.sample),f=l.missing}var P,H;for(P=f,H=a.length;P<H-1&&!Q.isHeader(a,P);P++);if(P!==f){var V,re;if(P<H-1?(V="AAC PES did not start with ADTS header,offset:"+P,re=!1):(V="no ADTS header found in AAC PES",re=!0),y.logger.warn("parsing error:"+V),this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.FRAG_PARSING_ERROR,fatal:re,reason:V}),re)return}Q.initTrackConfig(d,this.observer,a,P,this.audioCodec);var z;if(v.pts!==void 0)z=v.pts;else if(l){var F=Q.getFrameDuration(d.samplerate);z=l.sample.pts+F}else{y.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var ae=0;P<H;)if(Q.isHeader(a,P)){if(P+5<H){var ce=Q.appendFrame(d,a,P,z,ae);if(ce)if(ce.missing)this.aacOverFlow=ce;else{P+=ce.length,ae++;continue}}break}else P++},p.parseMPEGPES=function(v){var f=v.data,d=f.length,l=0,a=0,g=v.pts;if(g===void 0){y.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;a<d;)if(_.isHeader(f,a)){var m=_.appendFrame(this._audioTrack,f,a,g,l);if(m)a+=m.length,l++;else break}else a++},p.parseID3PES=function(v){if(v.pts===void 0){y.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(v)},c}();w.minProbeByteLength=188;function A(c,p,D,v){return{key:c,frame:!1,pts:p,dts:D,units:[],debug:v,length:0}}function S(c,p){return(c[p+10]&31)<<8|c[p+11]}function h(c,p,D,v){var f={audio:-1,avc:-1,id3:-1,isAAC:!0},d=(c[p+1]&15)<<8|c[p+2],l=p+3+d-4,a=(c[p+10]&15)<<8|c[p+11];for(p+=12+a;p<l;){var g=(c[p+1]&31)<<8|c[p+2];switch(c[p]){case 207:if(!v){y.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:f.audio===-1&&(f.audio=g);break;case 21:f.id3===-1&&(f.id3=g);break;case 219:if(!v){y.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:f.avc===-1&&(f.avc=g);break;case 3:case 4:D?f.audio===-1&&(f.audio=g,f.isAAC=!1):y.logger.log("MPEG audio found, not supported in this browser");break;case 36:y.logger.warn("Unsupported HEVC stream type found");break;default:break}p+=((c[p+3]&15)<<8|c[p+4])+5}return f}function o(c){var p=0,D,v,f,d,l,a=c.data;if(!c||c.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 m=(D[0]<<16)+(D[1]<<8)+D[2];if(m===1){if(v=(D[4]<<8)+D[5],v&&v>c.size-6)return null;var b=D[7];b&192&&(d=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,b&64?(l=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,d-l>60*9e4&&(y.logger.warn(Math.round((d-l)/9e4)+"s delta between PTS and DTS, align them"),d=l)):l=d),f=D[8];var P=f+9;if(c.size<=P)return null;c.size-=P;for(var H=new Uint8Array(c.size),V=0,re=a.length;V<re;V++){D=a[V];var z=D.byteLength;if(P)if(P>z){P-=z;continue}else D=D.subarray(P),z-=P,P=0;H.set(D,p),p+=z}return v&&(v-=f+3),{data:H,pts:d,dts:l,len:v}}return null}function s(c,p){if(c.units.length&&c.frame){if(c.pts===void 0){var D=p.samples,v=D.length;if(v){var f=D[v-1];c.pts=f.pts,c.dts=f.dts}else{p.dropped++;return}}p.samples.push(c)}c.debug.length&&y.logger.log(c.pts+"/"+c.dts+":"+c.debug)}function u(c,p){var D=c.length;if(D>0){if(p.pts>=c[D-1].pts)c.push(p);else for(var v=D-1;v>=0;v--)if(p.pts<c[v].pts){c.splice(v,0,p);break}}else c.push(p)}function x(c){for(var p=c.byteLength,D=[],v=1;v<p-2;)c[v]===0&&c[v+1]===0&&c[v+2]===3?(D.push(v+2),v+=2):v++;if(D.length===0)return c;var f=p-D.length,d=new Uint8Array(f),l=0;for(v=0;v<f;l++,v++)l===D[0]&&(l++,D.shift()),d[v]=c[l];return d}Z.default=w},"./src/errors.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"ErrorTypes",function(){return Q}),R.d(Z,"ErrorDetails",function(){return _});var Q;(function(L){L.NETWORK_ERROR="networkError",L.MEDIA_ERROR="mediaError",L.KEY_SYSTEM_ERROR="keySystemError",L.MUX_ERROR="muxError",L.OTHER_ERROR="otherError"})(Q||(Q={}));var _;(function(L){L.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",L.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",L.KEY_SYSTEM_NO_SESSION="keySystemNoSession",L.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",L.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",L.MANIFEST_LOAD_ERROR="manifestLoadError",L.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",L.MANIFEST_PARSING_ERROR="manifestParsingError",L.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",L.LEVEL_EMPTY_ERROR="levelEmptyError",L.LEVEL_LOAD_ERROR="levelLoadError",L.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",L.LEVEL_SWITCH_ERROR="levelSwitchError",L.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",L.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",L.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",L.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",L.FRAG_LOAD_ERROR="fragLoadError",L.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",L.FRAG_DECRYPT_ERROR="fragDecryptError",L.FRAG_PARSING_ERROR="fragParsingError",L.REMUX_ALLOC_ERROR="remuxAllocError",L.KEY_LOAD_ERROR="keyLoadError",L.KEY_LOAD_TIMEOUT="keyLoadTimeOut",L.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",L.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",L.BUFFER_APPEND_ERROR="bufferAppendError",L.BUFFER_APPENDING_ERROR="bufferAppendingError",L.BUFFER_STALLED_ERROR="bufferStalledError",L.BUFFER_FULL_ERROR="bufferFullError",L.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",L.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",L.INTERNAL_EXCEPTION="internalException",L.INTERNAL_ABORTED="aborted",L.UNKNOWN="unknown"})(_||(_={}))},"./src/events.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"Events",function(){return Q});var Q;(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"})(Q||(Q={}))},"./src/hls.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return c});var Q=R("./node_modules/url-toolkit/src/url-toolkit.js"),_=R.n(Q),L=R("./src/loader/playlist-loader.ts"),W=R("./src/loader/key-loader.ts"),U=R("./src/controller/id3-track-controller.ts"),O=R("./src/controller/latency-controller.ts"),M=R("./src/controller/level-controller.ts"),y=R("./src/controller/fragment-tracker.ts"),C=R("./src/controller/stream-controller.ts"),I=R("./src/is-supported.ts"),w=R("./src/utils/logger.ts"),A=R("./src/config.ts"),S=R("./node_modules/eventemitter3/index.js"),h=R.n(S),o=R("./src/events.ts"),s=R("./src/errors.ts");function u(p,D){for(var v=0;v<D.length;v++){var f=D[v];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(p,f.key,f)}}function x(p,D,v){return D&&u(p.prototype,D),v&&u(p,v),p}var c=function(){p.isSupported=function(){return Object(I.isSupported)()};function p(v){v===void 0&&(v={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new S.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 f=this.config=Object(A.mergeConfig)(p.DefaultConfig,v);this.userConfig=v,Object(w.enableLogs)(f.debug),this._autoLevelCapping=-1,f.progressive&&Object(A.enableStreamingMode)(f);var d=f.abrController,l=f.bufferController,a=f.capLevelController,g=f.fpsController,m=this.abrController=new d(this),b=this.bufferController=new l(this),P=this.capLevelController=new a(this),H=new g(this),V=new L.default(this),re=new W.default(this),z=new U.default(this),F=this.levelController=new M.default(this),ae=new y.FragmentTracker(this),ce=this.streamController=new C.default(this,ae);P.setStreamController(ce),H.setStreamController(ce);var me=[F,ce];this.networkControllers=me;var be=[V,re,m,b,P,H,z,ae];this.audioTrackController=this.createController(f.audioTrackController,null,me),this.createController(f.audioStreamController,ae,me),this.subtitleTrackController=this.createController(f.subtitleTrackController,null,me),this.createController(f.subtitleStreamController,ae,me),this.createController(f.timelineController,null,be),this.emeController=this.createController(f.emeController,null,be),this.cmcdController=this.createController(f.cmcdController,null,be),this.latencyController=this.createController(O.default,null,be),this.coreComponents=be}var D=p.prototype;return D.createController=function(f,d,l){if(f){var a=d?new f(this,d):new f(this);return l&&l.push(a),a}return null},D.on=function(f,d,l){l===void 0&&(l=this),this._emitter.on(f,d,l)},D.once=function(f,d,l){l===void 0&&(l=this),this._emitter.once(f,d,l)},D.removeAllListeners=function(f){this._emitter.removeAllListeners(f)},D.off=function(f,d,l,a){l===void 0&&(l=this),this._emitter.off(f,d,l,a)},D.listeners=function(f){return this._emitter.listeners(f)},D.emit=function(f,d,l){return this._emitter.emit(f,d,l)},D.trigger=function(f,d){if(this.config.debug)return this.emit(f,f,d);try{return this.emit(f,f,d)}catch(l){w.logger.error("An internal error happened while handling event "+f+'. Error message: "'+l.message+'". Here is a stacktrace:',l),this.trigger(o.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:f,error:l})}return!1},D.listenerCount=function(f){return this._emitter.listenerCount(f)},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(f){return f.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(f){return f.destroy()}),this.coreComponents.length=0},D.attachMedia=function(f){w.logger.log("attachMedia"),this._media=f,this.trigger(o.Events.MEDIA_ATTACHING,{media:f})},D.detachMedia=function(){w.logger.log("detachMedia"),this.trigger(o.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(f){this.stopLoad();var d=this.media,l=this.url,a=this.url=Q.buildAbsoluteURL(self.location.href,f,{alwaysNormalize:!0});w.logger.log("loadSource:"+a),d&&l&&l!==a&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(d)),this.trigger(o.Events.MANIFEST_LOADING,{url:f})},D.startLoad=function(f){f===void 0&&(f=-1),w.logger.log("startLoad("+f+")"),this.networkControllers.forEach(function(d){d.startLoad(f)})},D.stopLoad=function(){w.logger.log("stopLoad"),this.networkControllers.forEach(function(f){f.stopLoad()})},D.swapAudioCodec=function(){w.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){w.logger.log("recoverMediaError");var f=this._media;this.detachMedia(),f&&this.attachMedia(f)},D.removeLevel=function(f,d){d===void 0&&(d=0),this.levelController.removeLevel(f,d)},x(p,[{key:"levels",get:function(){var f=this.levelController.levels;return f||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(f){w.logger.log("set currentLevel:"+f),this.loadLevel=f,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(f){w.logger.log("set nextLevel:"+f),this.levelController.manualLevel=f,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(f){w.logger.log("set loadLevel:"+f),this.levelController.manualLevel=f}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(f){this.levelController.nextLoadLevel=f}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(f){w.logger.log("set firstLevel:"+f),this.levelController.firstLevel=f}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(f){w.logger.log("set startLevel:"+f),f!==-1&&(f=Math.max(f,this.minAutoLevel)),this.levelController.startLevel=f}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(f){var d=!!f;d!==this.config.capLevelToPlayerSize&&(d?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=d)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(f){this._autoLevelCapping!==f&&(w.logger.log("set autoLevelCapping:"+f),this._autoLevelCapping=f)}},{key:"bandwidthEstimate",get:function(){var f=this.abrController.bwEstimator;return f?f.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var f=this.levels,d=this.config.minAutoBitrate;if(!f)return 0;for(var l=f.length,a=0;a<l;a++)if(f[a].maxBitrate>d)return a;return 0}},{key:"maxAutoLevel",get:function(){var f=this.levels,d=this.autoLevelCapping,l;return d===-1&&f&&f.length?l=f.length-1:l=d,l}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(f){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,f)}},{key:"audioTracks",get:function(){var f=this.audioTrackController;return f?f.audioTracks:[]}},{key:"audioTrack",get:function(){var f=this.audioTrackController;return f?f.audioTrack:-1},set:function(f){var d=this.audioTrackController;d&&(d.audioTrack=f)}},{key:"subtitleTracks",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTrack:-1},set:function(f){var d=this.subtitleTrackController;d&&(d.subtitleTrack=f)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var f=this.subtitleTrackController;return f?f.subtitleDisplay:!1},set:function(f){var d=this.subtitleTrackController;d&&(d.subtitleDisplay=f)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(f){this.config.lowLatencyMode=f}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return o.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return p.defaultConfig?p.defaultConfig:A.hlsDefaultConfig},set:function(f){p.defaultConfig=f}}]),p}();c.defaultConfig=void 0},"./src/is-supported.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"isSupported",function(){return L}),R.d(Z,"changeTypeSupported",function(){return W});var Q=R("./src/utils/mediasource-helper.ts");function _(){return self.SourceBuffer||self.WebKitSourceBuffer}function L(){var U=Object(Q.getMediaSource)();if(!U)return!1;var O=_(),M=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),y=!O||O.prototype&&typeof O.prototype.appendBuffer=="function"&&typeof O.prototype.remove=="function";return!!M&&!!y}function W(){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(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return w}),R.d(Z,"LoadError",function(){return S});var Q=R("./src/polyfills/number.ts"),_=R("./src/errors.ts");function L(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,y(h,o)}function W(h){var o=typeof Map=="function"?new Map:void 0;return W=function(u){if(u===null||!M(u))return u;if(typeof u!="function")throw new TypeError("Super expression must either be null or a function");if(typeof o!="undefined"){if(o.has(u))return o.get(u);o.set(u,x)}function x(){return U(u,arguments,C(this).constructor)}return x.prototype=Object.create(u.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),y(x,u)},W(h)}function U(h,o,s){return O()?U=Reflect.construct:U=function(x,c,p){var D=[null];D.push.apply(D,c);var v=Function.bind.apply(x,D),f=new v;return p&&y(f,p.prototype),f},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(h){return!1}}function M(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function y(h,o){return y=Object.setPrototypeOf||function(u,x){return u.__proto__=x,u},y(h,o)}function C(h){return C=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},C(h)}var I=Math.pow(2,17),w=function(){function h(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var o=h.prototype;return o.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},o.abort=function(){this.loader&&this.loader.abort()},o.load=function(u,x){var c=this,p=u.url;if(!p)return Promise.reject(new S({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,networkDetails:null},"Fragment does not have a "+(p?"part list":"url")));this.abort();var D=this.config,v=D.fLoader,f=D.loader;return new Promise(function(d,l){c.loader&&c.loader.destroy();var a=c.loader=u.loader=v?new v(D):new f(D),g=A(u),m={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:I};u.stats=a.stats,a.load(g,m,{onSuccess:function(P,H,V,re){c.resetLoader(u,a),d({frag:u,part:null,payload:P.data,networkDetails:re})},onError:function(P,H,V){c.resetLoader(u,a),l(new S({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,response:P,networkDetails:V}))},onAbort:function(P,H,V){c.resetLoader(u,a),l(new S({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,networkDetails:V}))},onTimeout:function(P,H,V){c.resetLoader(u,a),l(new S({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,networkDetails:V}))},onProgress:function(P,H,V,re){x&&x({frag:u,part:null,payload:V,networkDetails:re})}})})},o.loadPart=function(u,x,c){var p=this;this.abort();var D=this.config,v=D.fLoader,f=D.loader;return new Promise(function(d,l){p.loader&&p.loader.destroy();var a=p.loader=u.loader=v?new v(D):new f(D),g=A(u,x),m={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:I};x.stats=a.stats,a.load(g,m,{onSuccess:function(P,H,V,re){p.resetLoader(u,a),p.updateStatsFromPart(u,x);var z={frag:u,part:x,payload:P.data,networkDetails:re};c(z),d(z)},onError:function(P,H,V){p.resetLoader(u,a),l(new S({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,part:x,response:P,networkDetails:V}))},onAbort:function(P,H,V){u.stats.aborted=x.stats.aborted,p.resetLoader(u,a),l(new S({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,part:x,networkDetails:V}))},onTimeout:function(P,H,V){p.resetLoader(u,a),l(new S({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,part:x,networkDetails:V}))}})})},o.updateStatsFromPart=function(u,x){var c=u.stats,p=x.stats,D=p.total;if(c.loaded+=p.loaded,D){var v=Math.round(u.duration/x.duration),f=Math.min(Math.round(c.loaded/D),v),d=v-f,l=d*Math.round(c.loaded/f);c.total=c.loaded+l}else c.total=Math.max(c.loaded,c.total);var a=c.loading,g=p.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()},h}();function A(h,o){o===void 0&&(o=null);var s=o||h,u={frag:h,part:o,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},x=s.byteRangeStartOffset,c=s.byteRangeEndOffset;return Object(Q.isFiniteNumber)(x)&&Object(Q.isFiniteNumber)(c)&&(u.rangeStart=x,u.rangeEnd=c),u}var S=function(h){L(o,h);function o(s){for(var u,x=arguments.length,c=new Array(x>1?x-1:0),p=1;p<x;p++)c[p-1]=arguments[p];return u=h.call.apply(h,[this].concat(c))||this,u.data=void 0,u.data=s,u}return o}(W(Error))},"./src/loader/fragment.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"ElementaryStreamTypes",function(){return w}),R.d(Z,"BaseSegment",function(){return A}),R.d(Z,"Fragment",function(){return S}),R.d(Z,"Part",function(){return h});var Q=R("./src/polyfills/number.ts"),_=R("./node_modules/url-toolkit/src/url-toolkit.js"),L=R.n(_),W=R("./src/utils/logger.ts"),U=R("./src/loader/level-key.ts"),O=R("./src/loader/load-stats.ts");function M(o,s){o.prototype=Object.create(s.prototype),o.prototype.constructor=o,y(o,s)}function y(o,s){return y=Object.setPrototypeOf||function(x,c){return x.__proto__=c,x},y(o,s)}function C(o,s){for(var u=0;u<s.length;u++){var x=s[u];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(o,x.key,x)}}function I(o,s,u){return s&&C(o.prototype,s),u&&C(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 s=o.prototype;return s.setByteRange=function(x,c){var p=x.split("@",2),D=[];p.length===1?D[0]=c?c.byteRangeEndOffset:0:D[0]=parseInt(p[1]),D[1]=parseInt(p[0])+D[0],this._byteRange=D},I(o,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(_.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(x){this._url=x}}]),o}(),S=function(o){M(s,o);function s(x,c){var p;return p=o.call(this,c)||this,p._decryptdata=null,p.rawProgramDateTime=null,p.programDateTime=null,p.tagList=[],p.duration=0,p.sn=0,p.levelkey=void 0,p.type=void 0,p.loader=null,p.level=-1,p.cc=0,p.startPTS=void 0,p.endPTS=void 0,p.appendedPTS=void 0,p.startDTS=void 0,p.endDTS=void 0,p.start=0,p.deltaPTS=void 0,p.maxStartPTS=void 0,p.minEndPTS=void 0,p.stats=new O.LoadStats,p.urlId=0,p.data=void 0,p.bitrateTest=!1,p.title=null,p.initSegment=null,p.type=x,p}var u=s.prototype;return u.createInitializationVector=function(c){for(var p=new Uint8Array(16),D=12;D<16;D++)p[D]=c>>8*(15-D)&255;return p},u.setDecryptDataFromLevelKey=function(c,p){var D=c;return(c==null?void 0:c.method)==="AES-128"&&c.uri&&!c.iv&&(D=U.LevelKey.fromURI(c.uri),D.method=c.method,D.iv=this.createInitializationVector(p),D.keyFormat="identity"),D},u.setElementaryStreamInfo=function(c,p,D,v,f,d){d===void 0&&(d=!1);var l=this.elementaryStreams,a=l[c];if(!a){l[c]={startPTS:p,endPTS:D,startDTS:v,endDTS:f,partial:d};return}a.startPTS=Math.min(a.startPTS,p),a.endPTS=Math.max(a.endPTS,D),a.startDTS=Math.min(a.startDTS,v),a.endDTS=Math.max(a.endDTS,f)},u.clearElementaryStreamInfo=function(){var c=this.elementaryStreams;c[w.AUDIO]=null,c[w.VIDEO]=null,c[w.AUDIOVIDEO]=null},I(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var c=this.sn;typeof c!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&W.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),c=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,c)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(Q.isFiniteNumber)(this.programDateTime))return null;var c=Object(Q.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+c*1e3}},{key:"encrypted",get:function(){var c;return!!((c=this.decryptdata)!==null&&c!==void 0&&c.keyFormat&&this.decryptdata.uri)}}]),s}(A),h=function(o){M(s,o);function s(u,x,c,p,D){var v;v=o.call(this,c)||this,v.fragOffset=0,v.duration=0,v.gap=!1,v.independent=!1,v.relurl=void 0,v.fragment=void 0,v.index=void 0,v.stats=new O.LoadStats,v.duration=u.decimalFloatingPoint("DURATION"),v.gap=u.bool("GAP"),v.independent=u.bool("INDEPENDENT"),v.relurl=u.enumeratedString("URI"),v.fragment=x,v.index=p;var f=u.enumeratedString("BYTERANGE");return f&&v.setByteRange(f,D),D&&(v.fragOffset=D.fragOffset+D.duration),v}return I(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var x=this.elementaryStreams;return!!(x.audio||x.video||x.audiovideo)}}]),s}(A)},"./src/loader/key-loader.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return W});var Q=R("./src/events.ts"),_=R("./src/errors.ts"),L=R("./src/utils/logger.ts"),W=function(){function U(M){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=M,this._registerListeners()}var O=U.prototype;return O._registerListeners=function(){this.hls.on(Q.Events.KEY_LOADING,this.onKeyLoading,this)},O._unregisterListeners=function(){this.hls.off(Q.Events.KEY_LOADING,this.onKeyLoading)},O.destroy=function(){this._unregisterListeners();for(var y in this.loaders){var C=this.loaders[y];C&&C.destroy()}this.loaders={}},O.onKeyLoading=function(y,C){var I=C.frag,w=I.type,A=this.loaders[w];if(!I.decryptdata){L.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var S=I.decryptdata.uri;if(S!==this.decrypturl||this.decryptkey===null){var h=this.hls.config;if(A&&(L.logger.warn("abort previous key loader for type:"+w),A.abort()),!S){L.logger.warn("key uri is falsy");return}var o=h.loader,s=I.loader=this.loaders[w]=new o(h);this.decrypturl=S,this.decryptkey=null;var u={url:S,frag:I,responseType:"arraybuffer"},x={timeout:h.fragLoadingTimeOut,maxRetry:0,retryDelay:h.fragLoadingRetryDelay,maxRetryDelay:h.fragLoadingMaxRetryTimeout,highWaterMark:0},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(u,x,c)}else this.decryptkey&&(I.decryptdata.key=this.decryptkey,this.hls.trigger(Q.Events.KEY_LOADED,{frag:I}))},O.loadsuccess=function(y,C,I){var w=I.frag;if(!w.decryptdata){L.logger.error("after key load, decryptdata unset");return}this.decryptkey=w.decryptdata.key=new Uint8Array(y.data),w.loader=null,delete this.loaders[w.type],this.hls.trigger(Q.Events.KEY_LOADED,{frag:w})},O.loaderror=function(y,C){var I=C.frag,w=I.loader;w&&w.abort(),delete this.loaders[I.type],this.hls.trigger(Q.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:I,response:y})},O.loadtimeout=function(y,C){var I=C.frag,w=I.loader;w&&w.abort(),delete this.loaders[I.type],this.hls.trigger(Q.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:I})},U}()},"./src/loader/level-details.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"LevelDetails",function(){return U});var Q=R("./src/polyfills/number.ts");function _(O,M){for(var y=0;y<M.length;y++){var C=M[y];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(O,C.key,C)}}function L(O,M,y){return M&&_(O.prototype,M),y&&_(O,y),O}var W=10,U=function(){function O(y){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=y}var M=O.prototype;return M.reloaded=function(C){if(!C){this.advanced=!0,this.updated=!0;return}var I=this.lastPartSn-C.lastPartSn,w=this.lastPartIndex-C.lastPartIndex;this.updated=this.endSN!==C.endSN||!!w||!!I,this.advanced=this.endSN>C.endSN||I>0||I===0&&w>0,this.updated||this.advanced?this.misses=Math.floor(C.misses*.6):this.misses=C.misses+1,this.availabilityDelay=C.availabilityDelay},L(O,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(Q.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||W}},{key:"drift",get:function(){var C=this.driftEndTime-this.driftStartTime;if(C>0){var I=this.driftEnd-this.driftStart;return I*1e3/C}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var C;return(C=this.partList)!==null&&C!==void 0&&C.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var C;return(C=this.fragments)!==null&&C!==void 0&&C.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 C;return(C=this.partList)!==null&&C!==void 0&&C.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var C;return(C=this.partList)!==null&&C!==void 0&&C.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),O}()},"./src/loader/level-key.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"LevelKey",function(){return U});var Q=R("./node_modules/url-toolkit/src/url-toolkit.js"),_=R.n(Q);function L(O,M){for(var y=0;y<M.length;y++){var C=M[y];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(O,C.key,C)}}function W(O,M,y){return M&&L(O.prototype,M),y&&L(O,y),O}var U=function(){O.fromURL=function(y,C){return new O(y,C)},O.fromURI=function(y){return new O(y)};function O(M,y){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,y?this._uri=Object(Q.buildAbsoluteURL)(M,y,{alwaysNormalize:!0}):this._uri=M}return W(O,[{key:"uri",get:function(){return this._uri}}]),O}()},"./src/loader/load-stats.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"LoadStats",function(){return Q});var Q=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(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return s});var Q=R("./src/polyfills/number.ts"),_=R("./node_modules/url-toolkit/src/url-toolkit.js"),L=R.n(_),W=R("./src/loader/fragment.ts"),U=R("./src/loader/level-details.ts"),O=R("./src/loader/level-key.ts"),M=R("./src/utils/attr-list.ts"),y=R("./src/utils/logger.ts"),C=R("./src/utils/codecs.ts"),I=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,w=/#EXT-X-MEDIA:(.*)/g,A=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),S=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),h=/\.(mp4|m4s|m4v|m4a)$/i;function o(D){var v,f;return h.test((v=(f=_.parseURL(D))===null||f===void 0?void 0:f.path)!=null?v:"")}var s=function(){function D(){}return D.findGroup=function(f,d){for(var l=0;l<f.length;l++){var a=f[l];if(a.id===d)return a}},D.convertAVC1ToAVCOTI=function(f){var d=f.split(".");if(d.length>2){var l=d.shift()+".";return l+=parseInt(d.shift()).toString(16),l+=("000"+parseInt(d.shift()).toString(16)).substr(-4),l}return f},D.resolve=function(f,d){return _.buildAbsoluteURL(d,f,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(f,d){var l=[],a={},g=!1;I.lastIndex=0;for(var m;(m=I.exec(f))!=null;)if(m[1]){var b=new M.AttrList(m[1]),P={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:D.resolve(m[2],d)},H=b.decimalResolution("RESOLUTION");H&&(P.width=H.width,P.height=H.height),u((b.CODECS||"").split(/[ ,]+/).filter(function(re){return re}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=D.convertAVC1ToAVCOTI(P.videoCodec)),l.push(P)}else if(m[3]){var V=new M.AttrList(m[3]);V["DATA-ID"]&&(g=!0,a[V["DATA-ID"]]=V)}return{levels:l,sessionData:g?a:null}},D.parseMasterPlaylistMedia=function(f,d,l,a){a===void 0&&(a=[]);var g,m=[],b=0;for(w.lastIndex=0;(g=w.exec(f))!==null;){var P=new M.AttrList(g[1]);if(P.TYPE===l){var H={attrs:P,bitrate:0,id:b++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:l,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?D.resolve(P.URI,d):""};if(a.length){var V=D.findGroup(a,H.groupId)||a[0];x(H,V,"audioCodec"),x(H,V,"textCodec")}m.push(H)}}return m},D.parseLevelPlaylist=function(f,d,l,a,g){var m=new U.LevelDetails(d),b=m.fragments,P=null,H=0,V=0,re=0,z=0,F=null,ae=new W.Fragment(a,d),ce,me,be,Be=-1,Ce=!1;for(A.lastIndex=0,m.m3u8=f;(ce=A.exec(f))!==null;){Ce&&(Ce=!1,ae=new W.Fragment(a,d),ae.start=re,ae.sn=H,ae.cc=z,ae.level=l,P&&(ae.initSegment=P,ae.rawProgramDateTime=P.rawProgramDateTime));var Le=ce[1];if(Le){ae.duration=parseFloat(Le);var Te=(" "+ce[2]).slice(1);ae.title=Te||null,ae.tagList.push(Te?["INF",Le,Te]:["INF",Le])}else if(ce[3])Object(Q.isFiniteNumber)(ae.duration)&&(ae.start=re,be&&(ae.levelkey=be),ae.sn=H,ae.level=l,ae.cc=z,ae.urlId=g,b.push(ae),ae.relurl=(" "+ce[3]).slice(1),p(ae,F),F=ae,re+=ae.duration,H++,V=0,Ce=!0);else if(ce[4]){var we=(" "+ce[4]).slice(1);F?ae.setByteRange(we,F):ae.setByteRange(we)}else if(ce[5])ae.rawProgramDateTime=(" "+ce[5]).slice(1),ae.tagList.push(["PROGRAM-DATE-TIME",ae.rawProgramDateTime]),Be===-1&&(Be=b.length);else{if(ce=ce[0].match(S),!ce){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(me=1;me<ce.length&&!(typeof ce[me]!="undefined");me++);var ve=(" "+ce[me]).slice(1),j=(" "+ce[me+1]).slice(1),T=ce[me+2]?(" "+ce[me+2]).slice(1):"";switch(ve){case"PLAYLIST-TYPE":m.type=j.toUpperCase();break;case"MEDIA-SEQUENCE":H=m.startSN=parseInt(j);break;case"SKIP":{var k=new M.AttrList(j),G=k.decimalInteger("SKIPPED-SEGMENTS");if(Object(Q.isFiniteNumber)(G)){m.skippedSegments=G;for(var $=G;$--;)b.unshift(null);H+=G}var N=k.enumeratedString("RECENTLY-REMOVED-DATERANGES");N&&(m.recentlyRemovedDateranges=N.split(" "));break}case"TARGETDURATION":m.targetduration=parseFloat(j);break;case"VERSION":m.version=parseInt(j);break;case"EXTM3U":break;case"ENDLIST":m.live=!1;break;case"#":(j||T)&&ae.tagList.push(T?[j,T]:[j]);break;case"DIS":z++;case"GAP":ae.tagList.push([ve]);break;case"BITRATE":ae.tagList.push([ve,j]);break;case"DISCONTINUITY-SEQ":z=parseInt(j);break;case"KEY":{var ue,Ee=new M.AttrList(j),De=Ee.enumeratedString("METHOD"),Ne=Ee.URI,Re=Ee.hexadecimalInteger("IV"),Ie=Ee.enumeratedString("KEYFORMATVERSIONS"),Pe=Ee.enumeratedString("KEYID"),Ge=(ue=Ee.enumeratedString("KEYFORMAT"))!=null?ue:"identity",Ke=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ke.indexOf(Ge)>-1){y.logger.warn("Keyformat "+Ge+" is not supported from the manifest");continue}else if(Ge!=="identity")continue;De&&(be=O.LevelKey.fromURL(d,Ne),Ne&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(De)>=0&&(be.method=De,be.keyFormat=Ge,Pe&&(be.keyID=Pe),Ie&&(be.keyFormatVersions=Ie),be.iv=Re));break}case"START":{var Ye=new M.AttrList(j),Xe=Ye.decimalFloatingPoint("TIME-OFFSET");Object(Q.isFiniteNumber)(Xe)&&(m.startTimeOffset=Xe);break}case"MAP":{var at=new M.AttrList(j);ae.relurl=at.URI,at.BYTERANGE&&ae.setByteRange(at.BYTERANGE),ae.level=l,ae.sn="initSegment",be&&(ae.levelkey=be),ae.initSegment=null,P=ae,Ce=!0;break}case"SERVER-CONTROL":{var qe=new M.AttrList(j);m.canBlockReload=qe.bool("CAN-BLOCK-RELOAD"),m.canSkipUntil=qe.optionalFloat("CAN-SKIP-UNTIL",0),m.canSkipDateRanges=m.canSkipUntil>0&&qe.bool("CAN-SKIP-DATERANGES"),m.partHoldBack=qe.optionalFloat("PART-HOLD-BACK",0),m.holdBack=qe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var ze=new M.AttrList(j);m.partTarget=ze.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ae=m.partList;Ae||(Ae=m.partList=[]);var Je=V>0?Ae[Ae.length-1]:void 0,Ze=V++,oe=new W.Part(new M.AttrList(j),ae,d,Ze,Je);Ae.push(oe),ae.duration+=oe.duration;break}case"PRELOAD-HINT":{var X=new M.AttrList(j);m.preloadHint=X;break}case"RENDITION-REPORT":{var J=new M.AttrList(j);m.renditionReports=m.renditionReports||[],m.renditionReports.push(J);break}default:y.logger.warn("line parsed but not handled: "+ce);break}}}F&&!F.relurl?(b.pop(),re-=F.duration,m.partList&&(m.fragmentHint=F)):m.partList&&(p(ae,F),ae.cc=z,m.fragmentHint=ae);var ne=b.length,se=b[0],q=b[ne-1];if(re+=m.skippedSegments*m.targetduration,re>0&&ne&&q){m.averagetargetduration=re/ne;var ie=q.sn;m.endSN=ie!=="initSegment"?ie:0,se&&(m.startCC=se.cc,se.initSegment||m.fragments.every(function(le){return le.relurl&&o(le.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),ae=new W.Fragment(a,d),ae.relurl=q.relurl,ae.level=l,ae.sn="initSegment",se.initSegment=ae,m.needSidxRanges=!0))}else m.endSN=0,m.startCC=0;return m.fragmentHint&&(re+=m.fragmentHint.duration),m.totalduration=re,m.endCC=z,Be>0&&c(b,Be),m},D}();function u(D,v){["video","audio","text"].forEach(function(f){var d=D.filter(function(a){return Object(C.isCodecType)(a,f)});if(d.length){var l=d.filter(function(a){return a.lastIndexOf("avc1",0)===0||a.lastIndexOf("mp4a",0)===0});v[f+"Codec"]=l.length>0?l[0]:d[0],D=D.filter(function(a){return d.indexOf(a)===-1})}}),v.unknownCodecs=D}function x(D,v,f){var d=v[f];d&&(D[f]=d)}function c(D,v){for(var f=D[v],d=v;d--;){var l=D[d];if(!l)return;l.programDateTime=f.programDateTime-l.duration*1e3,f=l}}function p(D,v){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):v!=null&&v.programDateTime&&(D.programDateTime=v.endProgramDateTime),Object(Q.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/polyfills/number.ts"),_=R("./src/events.ts"),L=R("./src/errors.ts"),W=R("./src/utils/logger.ts"),U=R("./src/utils/mp4-tools.ts"),O=R("./src/loader/m3u8-parser.ts"),M=R("./src/types/loader.ts"),y=R("./src/utils/attr-list.ts");function C(A){var S=A.type;switch(S){case M.PlaylistContextType.AUDIO_TRACK:return M.PlaylistLevelType.AUDIO;case M.PlaylistContextType.SUBTITLE_TRACK:return M.PlaylistLevelType.SUBTITLE;default:return M.PlaylistLevelType.MAIN}}function I(A,S){var h=A.url;return(h===void 0||h.indexOf("data:")===0)&&(h=S.url),h}var w=function(){function A(h){this.hls=void 0,this.loaders=Object.create(null),this.hls=h,this.registerListeners()}var S=A.prototype;return S.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)},S.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)},S.createInternalLoader=function(o){var s=this.hls.config,u=s.pLoader,x=s.loader,c=u||x,p=new c(s);return o.loader=p,this.loaders[o.type]=p,p},S.getInternalLoader=function(o){return this.loaders[o.type]},S.resetInternalLoader=function(o){this.loaders[o]&&delete this.loaders[o]},S.destroyInternalLoaders=function(){for(var o in this.loaders){var s=this.loaders[o];s&&s.destroy(),this.resetInternalLoader(o)}},S.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},S.onManifestLoading=function(o,s){var u=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:M.PlaylistContextType.MANIFEST,url:u,deliveryDirectives:null})},S.onLevelLoading=function(o,s){var u=s.id,x=s.level,c=s.url,p=s.deliveryDirectives;this.load({id:u,groupId:null,level:x,responseType:"text",type:M.PlaylistContextType.LEVEL,url:c,deliveryDirectives:p})},S.onAudioTrackLoading=function(o,s){var u=s.id,x=s.groupId,c=s.url,p=s.deliveryDirectives;this.load({id:u,groupId:x,level:null,responseType:"text",type:M.PlaylistContextType.AUDIO_TRACK,url:c,deliveryDirectives:p})},S.onSubtitleTrackLoading=function(o,s){var u=s.id,x=s.groupId,c=s.url,p=s.deliveryDirectives;this.load({id:u,groupId:x,level:null,responseType:"text",type:M.PlaylistContextType.SUBTITLE_TRACK,url:c,deliveryDirectives:p})},S.load=function(o){var s,u=this.hls.config,x=this.getInternalLoader(o);if(x){var c=x.context;if(c&&c.url===o.url){W.logger.trace("[playlist-loader]: playlist request ongoing");return}W.logger.log("[playlist-loader]: aborting previous loader for type: "+o.type),x.abort()}var p,D,v,f;switch(o.type){case M.PlaylistContextType.MANIFEST:p=u.manifestLoadingMaxRetry,D=u.manifestLoadingTimeOut,v=u.manifestLoadingRetryDelay,f=u.manifestLoadingMaxRetryTimeout;break;case M.PlaylistContextType.LEVEL:case M.PlaylistContextType.AUDIO_TRACK:case M.PlaylistContextType.SUBTITLE_TRACK:p=0,D=u.levelLoadingTimeOut;break;default:p=u.levelLoadingMaxRetry,D=u.levelLoadingTimeOut,v=u.levelLoadingRetryDelay,f=u.levelLoadingMaxRetryTimeout;break}if(x=this.createInternalLoader(o),(s=o.deliveryDirectives)!==null&&s!==void 0&&s.part){var d;if(o.type===M.PlaylistContextType.LEVEL&&o.level!==null?d=this.hls.levels[o.level].details:o.type===M.PlaylistContextType.AUDIO_TRACK&&o.id!==null?d=this.hls.audioTracks[o.id].details:o.type===M.PlaylistContextType.SUBTITLE_TRACK&&o.id!==null&&(d=this.hls.subtitleTracks[o.id].details),d){var l=d.partTarget,a=d.targetduration;l&&a&&(D=Math.min(Math.max(l*3,a*.8)*1e3,D))}}var g={timeout:D,maxRetry:p,retryDelay:v,maxRetryDelay:f,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};x.load(o,g,m)},S.loadsuccess=function(o,s,u,x){if(x===void 0&&(x=null),u.isSidxRequest){this.handleSidxRequest(o,u),this.handlePlaylistLoaded(o,s,u,x);return}this.resetInternalLoader(u.type);var c=o.data;if(c.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(o,u,"no EXTM3U delimiter",x);return}s.parsing.start=performance.now(),c.indexOf("#EXTINF:")>0||c.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(o,s,u,x):this.handleMasterPlaylist(o,s,u,x)},S.loaderror=function(o,s,u){u===void 0&&(u=null),this.handleNetworkError(s,u,!1,o)},S.loadtimeout=function(o,s,u){u===void 0&&(u=null),this.handleNetworkError(s,u,!0)},S.handleMasterPlaylist=function(o,s,u,x){var c=this.hls,p=o.data,D=I(o,u),v=O.default.parseMasterPlaylist(p,D),f=v.levels,d=v.sessionData;if(!f.length){this.handleManifestParsingError(o,u,"no level found in manifest",x);return}var l=f.map(function(H){return{id:H.attrs.AUDIO,audioCodec:H.audioCodec}}),a=f.map(function(H){return{id:H.attrs.SUBTITLES,textCodec:H.textCodec}}),g=O.default.parseMasterPlaylistMedia(p,D,"AUDIO",l),m=O.default.parseMasterPlaylistMedia(p,D,"SUBTITLES",a),b=O.default.parseMasterPlaylistMedia(p,D,"CLOSED-CAPTIONS");if(g.length){var P=g.some(function(H){return!H.url});!P&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(W.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 y.AttrList({}),bitrate:0,url:""}))}c.trigger(_.Events.MANIFEST_LOADED,{levels:f,audioTracks:g,subtitles:m,captions:b,url:D,stats:s,networkDetails:x,sessionData:d})},S.handleTrackOrLevelPlaylist=function(o,s,u,x){var c=this.hls,p=u.id,D=u.level,v=u.type,f=I(o,u),d=Object(Q.isFiniteNumber)(p)?p:0,l=Object(Q.isFiniteNumber)(D)?D:d,a=C(u),g=O.default.parseLevelPlaylist(o.data,f,l,a,d);if(!g.fragments.length){c.trigger(_.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:f,reason:"no fragments found in level",level:typeof u.level=="number"?u.level:void 0});return}if(v===M.PlaylistContextType.MANIFEST){var m={attrs:new y.AttrList({}),bitrate:0,details:g,name:"",url:f};c.trigger(_.Events.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:f,stats:s,networkDetails:x,sessionData:null})}if(s.parsing.end=performance.now(),g.needSidxRanges){var b,P=(b=g.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:P,isSidxRequest:!0,type:v,level:D,levelDetails:g,id:p,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}u.levelDetails=g,this.handlePlaylistLoaded(o,s,u,x)},S.handleSidxRequest=function(o,s){var u=Object(U.parseSegmentIndex)(new Uint8Array(o.data));if(!u)return;var x=u.references,c=s.levelDetails;x.forEach(function(p,D){var v=p.info,f=c.fragments[D];f.byteRange.length===0&&f.setByteRange(String(1+v.end-v.start)+"@"+String(v.start)),f.initSegment&&f.initSegment.setByteRange(String(u.moovEndOffset)+"@0")})},S.handleManifestParsingError=function(o,s,u,x){this.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===M.PlaylistContextType.MANIFEST,url:o.url,reason:u,response:o,context:s,networkDetails:x})},S.handleNetworkError=function(o,s,u,x){u===void 0&&(u=!1),W.logger.warn("[playlist-loader]: A network "+(u?"timeout":"error")+" occurred while loading "+o.type+" level: "+o.level+" id: "+o.id+' group-id: "'+o.groupId+'"');var c=L.ErrorDetails.UNKNOWN,p=!1,D=this.getInternalLoader(o);switch(o.type){case M.PlaylistContextType.MANIFEST:c=u?L.ErrorDetails.MANIFEST_LOAD_TIMEOUT:L.ErrorDetails.MANIFEST_LOAD_ERROR,p=!0;break;case M.PlaylistContextType.LEVEL:c=u?L.ErrorDetails.LEVEL_LOAD_TIMEOUT:L.ErrorDetails.LEVEL_LOAD_ERROR,p=!1;break;case M.PlaylistContextType.AUDIO_TRACK:c=u?L.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,p=!1;break;case M.PlaylistContextType.SUBTITLE_TRACK:c=u?L.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:L.ErrorDetails.SUBTITLE_LOAD_ERROR,p=!1;break}D&&this.resetInternalLoader(o.type);var v={type:L.ErrorTypes.NETWORK_ERROR,details:c,fatal:p,url:o.url,loader:D,context:o,networkDetails:s};x&&(v.response=x),this.hls.trigger(_.Events.ERROR,v)},S.handlePlaylistLoaded=function(o,s,u,x){var c=u.type,p=u.level,D=u.id,v=u.groupId,f=u.loader,d=u.levelDetails,l=u.deliveryDirectives;if(!(d!=null&&d.targetduration)){this.handleManifestParsingError(o,u,"invalid target duration",x);return}if(!f)return;d.live&&(f.getCacheAge&&(d.ageHeader=f.getCacheAge()||0),(!f.getCacheAge||isNaN(d.ageHeader))&&(d.ageHeader=0));switch(c){case M.PlaylistContextType.MANIFEST:case M.PlaylistContextType.LEVEL:this.hls.trigger(_.Events.LEVEL_LOADED,{details:d,level:p||0,id:D||0,stats:s,networkDetails:x,deliveryDirectives:l});break;case M.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(_.Events.AUDIO_TRACK_LOADED,{details:d,id:D||0,groupId:v||"",stats:s,networkDetails:x,deliveryDirectives:l});break;case M.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(_.Events.SUBTITLE_TRACK_LOADED,{details:d,id:D||0,groupId:v||"",stats:s,networkDetails:x,deliveryDirectives:l});break}},A}();Z.default=w},"./src/polyfills/number.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"isFiniteNumber",function(){return Q}),R.d(Z,"MAX_SAFE_INTEGER",function(){return _});var Q=Number.isFinite||function(L){return typeof L=="number"&&isFinite(L)},_=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=function(){function _(){}return _.getSilentFrame=function(W,U){switch(W){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},_}();Z.default=Q},"./src/remux/mp4-generator.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=Math.pow(2,32)-1,_=function(){function L(){}return L.init=function(){L.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 L.types)L.types.hasOwnProperty(U)&&(L.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]),M=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);L.HDLR_TYPES={video:O,audio:M};var y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),C=new Uint8Array([0,0,0,0,0,0,0,0]);L.STTS=L.STSC=L.STCO=C,L.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),L.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),L.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),L.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var I=new Uint8Array([105,115,111,109]),w=new Uint8Array([97,118,99,49]),A=new Uint8Array([0,0,0,1]);L.FTYP=L.box(L.types.ftyp,I,A,I,w),L.DINF=L.box(L.types.dinf,L.box(L.types.dref,y))},L.box=function(U){for(var O=8,M=arguments.length,y=new Array(M>1?M-1:0),C=1;C<M;C++)y[C-1]=arguments[C];for(var I=y.length,w=I;I--;)O+=y[I].byteLength;var A=new Uint8Array(O);for(A[0]=O>>24&255,A[1]=O>>16&255,A[2]=O>>8&255,A[3]=O&255,A.set(U,4),I=0,O=8;I<w;I++)A.set(y[I],O),O+=y[I].byteLength;return A},L.hdlr=function(U){return L.box(L.types.hdlr,L.HDLR_TYPES[U])},L.mdat=function(U){return L.box(L.types.mdat,U)},L.mdhd=function(U,O){O*=U;var M=Math.floor(O/(Q+1)),y=Math.floor(O%(Q+1));return L.box(L.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,M>>24,M>>16&255,M>>8&255,M&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))},L.mdia=function(U){return L.box(L.types.mdia,L.mdhd(U.timescale,U.duration),L.hdlr(U.type),L.minf(U))},L.mfhd=function(U){return L.box(L.types.mfhd,new Uint8Array([0,0,0,0,U>>24,U>>16&255,U>>8&255,U&255]))},L.minf=function(U){return U.type==="audio"?L.box(L.types.minf,L.box(L.types.smhd,L.SMHD),L.DINF,L.stbl(U)):L.box(L.types.minf,L.box(L.types.vmhd,L.VMHD),L.DINF,L.stbl(U))},L.moof=function(U,O,M){return L.box(L.types.moof,L.mfhd(U),L.traf(M,O))},L.moov=function(U){for(var O=U.length,M=[];O--;)M[O]=L.trak(U[O]);return L.box.apply(null,[L.types.moov,L.mvhd(U[0].timescale,U[0].duration)].concat(M).concat(L.mvex(U)))},L.mvex=function(U){for(var O=U.length,M=[];O--;)M[O]=L.trex(U[O]);return L.box.apply(null,[L.types.mvex].concat(M))},L.mvhd=function(U,O){O*=U;var M=Math.floor(O/(Q+1)),y=Math.floor(O%(Q+1)),C=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,M>>24,M>>16&255,M>>8&255,M&255,y>>24,y>>16&255,y>>8&255,y&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 L.box(L.types.mvhd,C)},L.sdtp=function(U){var O=U.samples||[],M=new Uint8Array(4+O.length),y,C;for(y=0;y<O.length;y++)C=O[y].flags,M[y+4]=C.dependsOn<<4|C.isDependedOn<<2|C.hasRedundancy;return L.box(L.types.sdtp,M)},L.stbl=function(U){return L.box(L.types.stbl,L.stsd(U),L.box(L.types.stts,L.STTS),L.box(L.types.stsc,L.STSC),L.box(L.types.stsz,L.STSZ),L.box(L.types.stco,L.STCO))},L.avc1=function(U){var O=[],M=[],y,C,I;for(y=0;y<U.sps.length;y++)C=U.sps[y],I=C.byteLength,O.push(I>>>8&255),O.push(I&255),O=O.concat(Array.prototype.slice.call(C));for(y=0;y<U.pps.length;y++)C=U.pps[y],I=C.byteLength,M.push(I>>>8&255),M.push(I&255),M=M.concat(Array.prototype.slice.call(C));var w=L.box(L.types.avcC,new Uint8Array([1,O[3],O[4],O[5],252|3,224|U.sps.length].concat(O).concat([U.pps.length]).concat(M))),A=U.width,S=U.height,h=U.pixelRatio[0],o=U.pixelRatio[1];return L.box(L.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,S>>8&255,S&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,L.box(L.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),L.box(L.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,o>>24,o>>16&255,o>>8&255,o&255])))},L.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]))},L.mp4a=function(U){var O=U.samplerate;return L.box(L.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]),L.box(L.types.esds,L.esds(U)))},L.mp3=function(U){var O=U.samplerate;return L.box(L.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]))},L.stsd=function(U){return U.type==="audio"?!U.isAAC&&U.codec==="mp3"?L.box(L.types.stsd,L.STSD,L.mp3(U)):L.box(L.types.stsd,L.STSD,L.mp4a(U)):L.box(L.types.stsd,L.STSD,L.avc1(U))},L.tkhd=function(U){var O=U.id,M=U.duration*U.timescale,y=U.width,C=U.height,I=Math.floor(M/(Q+1)),w=Math.floor(M%(Q+1));return L.box(L.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,O>>24&255,O>>16&255,O>>8&255,O&255,0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255,w>>24,w>>16&255,w>>8&255,w&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,y>>8&255,y&255,0,0,C>>8&255,C&255,0,0]))},L.traf=function(U,O){var M=L.sdtp(U),y=U.id,C=Math.floor(O/(Q+1)),I=Math.floor(O%(Q+1));return L.box(L.types.traf,L.box(L.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),L.box(L.types.tfdt,new Uint8Array([1,0,0,0,C>>24,C>>16&255,C>>8&255,C&255,I>>24,I>>16&255,I>>8&255,I&255])),L.trun(U,M.length+16+20+8+16+8+8),M)},L.trak=function(U){return U.duration=U.duration||4294967295,L.box(L.types.trak,L.tkhd(U),L.mdia(U))},L.trex=function(U){var O=U.id;return L.box(L.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]))},L.trun=function(U,O){var M=U.samples||[],y=M.length,C=12+16*y,I=new Uint8Array(C),w,A,S,h,o,s;for(O+=8+C,I.set([0,0,15,1,y>>>24&255,y>>>16&255,y>>>8&255,y&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255],0),w=0;w<y;w++)A=M[w],S=A.duration,h=A.size,o=A.flags,s=A.cts,I.set([S>>>24&255,S>>>16&255,S>>>8&255,S&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,o.degradPrio&240<<8,o.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*w);return L.box(L.types.trun,I)},L.initSegment=function(U){L.types||L.init();var O=L.moov(U),M=new Uint8Array(L.FTYP.byteLength+O.byteLength);return M.set(L.FTYP),M.set(O,L.FTYP.byteLength),M},L}();_.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,Z.default=_},"./src/remux/mp4-remuxer.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return s}),R.d(Z,"normalizePts",function(){return u});var Q=R("./src/polyfills/number.ts"),_=R("./src/remux/aac-helper.ts"),L=R("./src/remux/mp4-generator.ts"),W=R("./src/events.ts"),U=R("./src/errors.ts"),O=R("./src/utils/logger.ts"),M=R("./src/types/loader.ts"),y=R("./src/utils/timescale-conversion.ts");function C(){return C=Object.assign||function(D){for(var v=1;v<arguments.length;v++){var f=arguments[v];for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(D[d]=f[d])}return D},C.apply(this,arguments)}var I=10*1e3,w=1024,A=1152,S=null,h=null,o=!1,s=function(){function D(f,d,l,a){if(a===void 0&&(a=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=f,this.config=d,this.typeSupported=l,this.ISGenerated=!1,S===null){var g=navigator.userAgent||"",m=g.match(/Chrome\/(\d+)/i);S=m?parseInt(m[1]):0}if(h===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);h=b?parseInt(b[1]):0}o=!!S&&S<75||!!h&&h<600}var v=D.prototype;return v.destroy=function(){},v.resetTimeStamp=function(d){O.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=d},v.resetNextTimestamp=function(){O.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},v.resetInitSegment=function(){O.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},v.getVideoStartPts=function(d){var l=!1,a=d.reduce(function(g,m){var b=m.pts-g;return b<-4294967296?(l=!0,u(g,m.pts)):b>0?g:m.pts},d[0].pts);return l&&O.logger.debug("PTS rollover detected"),a},v.remux=function(d,l,a,g,m,b,P,H){var V,re,z,F,ae,ce,me=m,be=m,Be=d.pid>-1,Ce=l.pid>-1,Le=l.samples.length,Te=d.samples.length>0,we=Le>1,ve=(!Be||Te)&&(!Ce||we)||this.ISGenerated||P;if(ve){this.ISGenerated||(z=this.generateIS(d,l,m));var j=this.isVideoContiguous,T=-1;if(we&&(T=x(l.samples),!j&&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 k=this.getVideoStartPts(l.samples);l.samples=l.samples.slice(T),l.dropped+=T,be+=(l.samples[0].pts-k)/(l.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 G=this.getVideoStartPts(l.samples),$=u(d.samples[0].pts,G)-G,N=$/l.inputTimeScale;me+=Math.max(0,N),be+=Math.max(0,-N)}if(Te){if(d.samplerate||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),z=this.generateIS(d,l,m)),re=this.remuxAudio(d,me,this.isAudioContiguous,b,Ce||we||H===M.PlaylistLevelType.AUDIO?be:void 0),we){var ue=re?re.endPTS-re.startPTS:0;l.inputTimeScale||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),z=this.generateIS(d,l,m)),V=this.remuxVideo(l,be,j,ue)}}else we&&(V=this.remuxVideo(l,be,j,0));V&&(V.firstKeyFrame=T,V.independent=T!==-1)}}return this.ISGenerated&&(a.samples.length&&(ae=this.remuxID3(a,m)),g.samples.length&&(F=this.remuxText(g,m))),{audio:re,video:V,initSegment:z,independent:ce,text:F,id3:ae}},v.generateIS=function(d,l,a){var g=d.samples,m=l.samples,b=this.typeSupported,P={},H=!Object(Q.isFiniteNumber)(this._initPTS),V="audio/mp4",re,z,F;if(H&&(re=z=Infinity),d.config&&g.length&&(d.timescale=d.samplerate,d.isAAC||(b.mpeg?(V="audio/mpeg",d.codec=""):b.mp3&&(d.codec="mp3")),P.audio={id:"audio",container:V,codec:d.codec,initSegment:!d.isAAC&&b.mpeg?new Uint8Array(0):L.default.initSegment([d]),metadata:{channelCount:d.channelCount}},H&&(F=d.inputTimeScale,re=z=g[0].pts-Math.round(F*a))),l.sps&&l.pps&&m.length&&(l.timescale=l.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:l.codec,initSegment:L.default.initSegment([l]),metadata:{width:l.width,height:l.height}},H)){F=l.inputTimeScale;var ae=this.getVideoStartPts(m),ce=Math.round(F*a);z=Math.min(z,u(m[0].dts,ae)-ce),re=Math.min(re,ae-ce)}if(Object.keys(P).length)return this.ISGenerated=!0,H&&(this._initPTS=re,this._initDTS=z),{tracks:P,initPTS:re,timescale:F}},v.remuxVideo=function(d,l,a,g){var m=d.inputTimeScale,b=d.samples,P=[],H=b.length,V=this._initPTS,re=this.nextAvcDts,z=8,F,ae,ce,me=Number.POSITIVE_INFINITY,be=Number.NEGATIVE_INFINITY,Be=0,Ce=!1;if(!a||re===null){var Le=l*m,Te=b[0].pts-u(b[0].dts,b[0].pts);re=Le-Te}for(var we=0;we<H;we++){var ve=b[we];if(ve.pts=u(ve.pts-V,re),ve.dts=u(ve.dts-V,re),ve.dts>ve.pts){var j=9e4*.2;Be=Math.max(Math.min(Be,ve.pts-ve.dts),-1*j)}ve.dts<b[we>0?we-1:we].dts&&(Ce=!0)}Ce&&b.sort(function(vt,st){var nt=vt.dts-st.dts,Tt=vt.pts-st.pts;return nt||Tt}),ae=b[0].dts,ce=b[b.length-1].dts;var T=Math.round((ce-ae)/(H-1));if(Be<0){if(Be<T*-2){O.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(y.toMsFromMpegTsClock)(-T,!0)+" ms");for(var k=Be,G=0;G<H;G++)b[G].dts=k=Math.max(k,b[G].pts-T),b[G].pts=Math.max(k,b[G].pts)}else{O.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(y.toMsFromMpegTsClock)(Be,!0)+" ms to overcome this issue");for(var $=0;$<H;$++)b[$].dts=b[$].dts+Be}ae=b[0].dts}if(a){var N=ae-re,ue=N>T,Ee=N<-1;if(ue||Ee){ue?O.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(N,!0)+" ms ("+N+"dts) hole between fragments detected, filling it"):O.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-N,!0)+" ms ("+N+"dts) overlapping between fragments detected"),ae=re;var De=b[0].pts-N;b[0].dts=ae,b[0].pts=De,O.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(De,!0)+"/"+Object(y.toMsFromMpegTsClock)(ae,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(N,!0)+" ms")}}o&&(ae=Math.max(0,ae));for(var Ne=0,Re=0,Ie=0;Ie<H;Ie++){for(var Pe=b[Ie],Ge=Pe.units,Ke=Ge.length,Ye=0,Xe=0;Xe<Ke;Xe++)Ye+=Ge[Xe].data.length;Re+=Ye,Ne+=Ke,Pe.length=Ye,Pe.dts=Math.max(Pe.dts,ae),Pe.pts=Math.max(Pe.pts,Pe.dts,0),me=Math.min(Pe.pts,me),be=Math.max(Pe.pts,be)}ce=b[H-1].dts;var at=Re+4*Ne+8,qe;try{qe=new Uint8Array(at)}catch(vt){this.observer.emit(W.Events.ERROR,W.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(qe.buffer);ze.setUint32(0,at),qe.set(L.default.types.mdat,4);for(var Ae=0;Ae<H;Ae++){for(var Je=b[Ae],Ze=Je.units,oe=0,X=0,J=Ze.length;X<J;X++){var ne=Ze[X],se=ne.data,q=ne.data.byteLength;ze.setUint32(z,q),z+=4,qe.set(se,z),z+=q,oe+=4+q}if(Ae<H-1)F=b[Ae+1].dts-Je.dts;else{var ie=this.config,le=Je.dts-b[Ae>0?Ae-1:Ae].dts;if(ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var he=Math.floor(ie.maxBufferHole*m),ge=(g?me+g*m:this.nextAudioPts)-Je.pts;ge>he?(F=ge-le,F<0&&(F=le),O.logger.log("[mp4-remuxer]: It is approximately "+ge/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(Je.pts-Je.dts);P.push(new c(Je.key,F,oe,ye))}if(P.length&&S&&S<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=L.default.moof(d.sequenceNumber++,ae,C({},d,{samples:P})),tt="video",it={data1:He,data2:qe,startPTS:me/m,endPTS:(be+F)/m,startDTS:ae/m,endDTS:re/m,type:tt,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:d.dropped};return d.samples=[],d.dropped=0,console.assert(qe.length,"MDAT length must not be zero"),it},v.remuxAudio=function(d,l,a,g,m){var b=d.inputTimeScale,P=d.samplerate?d.samplerate:b,H=b/P,V=d.isAAC?w:A,re=V*H,z=this._initPTS,F=!d.isAAC&&this.typeSupported.mpeg,ae=[],ce=d.samples,me=F?0:8,be=this.nextAudioPts||-1,Be=l*b;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;m===0?be=0:g?be=Math.max(0,Be):be=ce[0].pts}if(d.isAAC)for(var Ce=m!==void 0,Le=this.config.maxAudioFramesDrift,Te=0,we=be;Te<ce.length;Te++){var ve=ce[Te],j=ve.pts,T=j-we,k=Math.abs(1e3*T/b);if(T<=-Le*re&&Ce)Te===0&&(O.logger.warn("Audio frame @ "+(j/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*T/b)+" ms."),this.nextAudioPts=be=we=j);else if(T>=Le*re&&k<I&&Ce){var G=Math.round(T/re);we=j-G*re,we<0&&(G--,we+=re),Te===0&&(this.nextAudioPts=be=we),O.logger.warn("[mp4-remuxer]: Injecting "+G+" audio frame @ "+(we/b).toFixed(3)+"s due to "+Math.round(1e3*T/b)+" ms gap.");for(var $=0;$<G;$++){var N=Math.max(we,0),ue=_.default.getSilentFrame(d.manifestCodec||d.codec,d.channelCount);ue||(O.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ue=ve.unit.subarray()),ce.splice(Te,0,{unit:ue,pts:N}),we+=re,Te++}}ve.pts=we,we+=re}for(var Ee=null,De=null,Ne,Re=0,Ie=ce.length;Ie--;)Re+=ce[Ie].unit.byteLength;for(var Pe=0,Ge=ce.length;Pe<Ge;Pe++){var Ke=ce[Pe],Ye=Ke.unit,Xe=Ke.pts;if(De!==null){var at=ae[Pe-1];at.duration=Math.round((Xe-De)/H)}else if(a&&d.isAAC&&(Xe=be),Ee=Xe,Re>0){Re+=me;try{Ne=new Uint8Array(Re)}catch(se){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Re,reason:"fail allocating audio mdat "+Re});return}if(!F){var qe=new DataView(Ne.buffer);qe.setUint32(0,Re),Ne.set(L.default.types.mdat,4)}}else return;Ne.set(Ye,me);var ze=Ye.byteLength;me+=ze,ae.push(new c(!0,V,ze,0)),De=Xe}var Ae=ae.length;if(!Ae)return;var Je=ae[ae.length-1];this.nextAudioPts=be=De+H*Je.duration;var Ze=F?new Uint8Array(0):L.default.moof(d.sequenceNumber++,Ee/H,C({},d,{samples:ae}));d.samples=[];var oe=Ee/b,X=be/b,J="audio",ne={data1:Ze,data2:Ne,startPTS:oe,endPTS:X,startDTS:oe,endDTS:X,type:J,hasAudio:!0,hasVideo:!1,nb:Ae};return this.isAudioContiguous=!0,console.assert(Ne.length,"MDAT length must not be zero"),ne},v.remuxEmptyAudio=function(d,l,a,g){var m=d.inputTimeScale,b=d.samplerate?d.samplerate:m,P=m/b,H=this.nextAudioPts,V=(H!==null?H:g.startDTS*m)+this._initDTS,re=g.endDTS*m+this._initDTS,z=P*w,F=Math.ceil((re-V)/z),ae=_.default.getSilentFrame(d.manifestCodec||d.codec,d.channelCount);if(O.logger.warn("[mp4-remuxer]: remux empty Audio"),!ae){O.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ce=[],me=0;me<F;me++){var be=V+me*z;ce.push({unit:ae,pts:be,dts:be})}return d.samples=ce,this.remuxAudio(d,l,a,!1)},v.remuxID3=function(d,l){var a=d.samples.length;if(!a)return;for(var g=d.inputTimeScale,m=this._initPTS,b=this._initDTS,P=0;P<a;P++){var H=d.samples[P];H.pts=u(H.pts-m,l*g)/g,H.dts=u(H.dts-b,l*g)/g}var V=d.samples;return d.samples=[],{samples:V}},v.remuxText=function(d,l){var a=d.samples.length;if(!a)return;for(var g=d.inputTimeScale,m=this._initPTS,b=0;b<a;b++){var P=d.samples[b];P.pts=u(P.pts-m,l*g)/g}d.samples.sort(function(V,re){return V.pts-re.pts});var H=d.samples;return d.samples=[],{samples:H}},D}();function u(D,v){var f;if(v===null)return D;for(v<D?f=-8589934592:f=8589934592;Math.abs(D-v)>4294967296;)D+=f;return D}function x(D){for(var v=0;v<D.length;v++)if(D[v].key)return v;return-1}var c=function(v,f,d,l){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=f,this.size=d,this.cts=l,this.flags=new p(v)},p=function(v){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=v?2:1,this.isNonSync=v?0:1}},"./src/remux/passthrough-remuxer.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/polyfills/number.ts"),_=R("./src/utils/mp4-tools.ts"),L=R("./src/loader/fragment.ts"),W=R("./src/utils/logger.ts"),U=function(){function y(){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 C=y.prototype;return C.destroy=function(){},C.resetTimeStamp=function(w){this.initPTS=w,this.lastEndDTS=null},C.resetNextTimestamp=function(){this.lastEndDTS=null},C.resetInitSegment=function(w,A,S){this.audioCodec=A,this.videoCodec=S,this.generateInitSegment(w),this.emitInitSegment=!0},C.generateInitSegment=function(w){var A=this.audioCodec,S=this.videoCodec;if(!w||!w.byteLength){this.initTracks=void 0,this.initData=void 0;return}var h=this.initData=Object(_.parseInitSegment)(w);A||(A=M(h.audio,L.ElementaryStreamTypes.AUDIO)),S||(S=M(h.video,L.ElementaryStreamTypes.VIDEO));var o={};h.audio&&h.video?o.audiovideo={container:"video/mp4",codec:A+","+S,initSegment:w,id:"main"}:h.audio?o.audio={container:"audio/mp4",codec:A,initSegment:w,id:"audio"}:h.video?o.video={container:"video/mp4",codec:S,initSegment:w,id:"main"}:W.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=o},C.remux=function(w,A,S,h,o){var s=this.initPTS,u=this.lastEndDTS,x={audio:void 0,video:void 0,text:h,id3:S,initSegment:void 0};Object(Q.isFiniteNumber)(u)||(u=this.lastEndDTS=o||0);var c=A.samples;if(!c||!c.length)return x;var p={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(c),D=this.initData),!D||!D.length)return W.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),x;this.emitInitSegment&&(p.tracks=this.initTracks,this.emitInitSegment=!1),Object(Q.isFiniteNumber)(s)||(this.initPTS=p.initPTS=s=O(D,c,u));var v=Object(_.getDuration)(c,D),f=u,d=v+f;Object(_.offsetStartDTS)(D,c,s),v>0?this.lastEndDTS=d:(W.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var l=!!D.audio,a=!!D.video,g="";l&&(g+="audio"),a&&(g+="video");var m={data1:c,startPTS:f,startDTS:f,endPTS:d,endDTS:d,type:g,hasAudio:l,hasVideo:a,nb:1,dropped:0};return x.audio=m.type==="audio"?m:void 0,x.video=m.type!=="audio"?m:void 0,x.text=h,x.id3=S,x.initSegment=p,x},y}(),O=function(C,I,w){return Object(_.getStartDTS)(C,I)-w};function M(y,C){var I=y==null?void 0:y.codec;return I&&I.length>4?I:I==="hvc1"?"hvc1.1.c.L120.90":I==="av01"?"av01.0.04M.08":I==="avc1"||C===L.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Z.default=U},"./src/task-loop.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return Q});var Q=function(){function _(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var L=_.prototype;return L.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},L.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},L.onHandlerDestroyed=function(){},L.hasInterval=function(){return!!this._tickInterval},L.hasNextTick=function(){return!!this._tickTimer},L.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},L.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},L.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},L.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},L.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},L.doTick=function(){},_}()},"./src/types/cmcd.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"CMCDVersion",function(){return Q}),R.d(Z,"CMCDObjectType",function(){return _}),R.d(Z,"CMCDStreamingFormat",function(){return L}),R.d(Z,"CMCDStreamType",function(){return W});var Q=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 L;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(L||(L={}));var W;(function(U){U.VOD="v",U.LIVE="l"})(W||(W={}))},"./src/types/level.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"HlsSkip",function(){return L}),R.d(Z,"getSkipValue",function(){return W}),R.d(Z,"HlsUrlParameters",function(){return U}),R.d(Z,"Level",function(){return O});function Q(M,y){for(var C=0;C<y.length;C++){var I=y[C];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(M,I.key,I)}}function _(M,y,C){return y&&Q(M.prototype,y),C&&Q(M,C),M}var L;(function(M){M.No="",M.Yes="YES",M.v2="v2"})(L||(L={}));function W(M,y){var C=M.canSkipUntil,I=M.canSkipDateRanges,w=M.endSN,A=y!==void 0?y-w:0;return C&&A<C?I?L.v2:L.Yes:L.No}var U=function(){function M(C,I,w){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=C,this.part=I,this.skip=w}var y=M.prototype;return y.addDirectives=function(I){var w=new self.URL(I);return this.msn!==void 0&&w.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&w.searchParams.set("_HLS_part",this.part.toString()),this.skip&&w.searchParams.set("_HLS_skip",this.skip),w.toString()},M}(),O=function(){function M(y){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=[y.url],this.attrs=y.attrs,this.bitrate=y.bitrate,y.details&&(this.details=y.details),this.id=y.id||0,this.name=y.name,this.width=y.width||0,this.height=y.height||0,this.audioCodec=y.audioCodec,this.videoCodec=y.videoCodec,this.unknownCodecs=y.unknownCodecs,this.codecSet=[y.videoCodec,y.audioCodec].filter(function(C){return C}).join(",").replace(/\.[^.,]+/g,"")}return _(M,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(C){var I=C%this.url.length;this._urlId!==I&&(this.details=void 0,this._urlId=I)}}]),M}()},"./src/types/loader.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"PlaylistContextType",function(){return Q}),R.d(Z,"PlaylistLevelType",function(){return _});var Q;(function(L){L.MANIFEST="manifest",L.LEVEL="level",L.AUDIO_TRACK="audioTrack",L.SUBTITLE_TRACK="subtitleTrack"})(Q||(Q={}));var _;(function(L){L.MAIN="main",L.AUDIO="audio",L.SUBTITLE="subtitle"})(_||(_={}))},"./src/types/transmuxer.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"ChunkMetadata",function(){return Q});var Q=function(W,U,O,M,y,C){M===void 0&&(M=0),y===void 0&&(y=-1),C===void 0&&(C=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=_(),this.buffering={audio:_(),video:_(),audiovideo:_()},this.level=W,this.sn=U,this.id=O,this.size=M,this.part=y,this.partial=C};function _(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"AttrList",function(){return L});var Q=/^(\d+)x(\d+)$/,_=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,L=function(){function W(O){typeof O=="string"&&(O=W.parseAttrList(O));for(var M in O)O.hasOwnProperty(M)&&(this[M]=O[M])}var U=W.prototype;return U.decimalInteger=function(M){var y=parseInt(this[M],10);return y>Number.MAX_SAFE_INTEGER?Infinity:y},U.hexadecimalInteger=function(M){if(this[M]){var y=(this[M]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var C=new Uint8Array(y.length/2),I=0;I<y.length/2;I++)C[I]=parseInt(y.slice(I*2,I*2+2),16);return C}else return null},U.hexadecimalIntegerAsNumber=function(M){var y=parseInt(this[M],16);return y>Number.MAX_SAFE_INTEGER?Infinity:y},U.decimalFloatingPoint=function(M){return parseFloat(this[M])},U.optionalFloat=function(M,y){var C=this[M];return C?parseFloat(C):y},U.enumeratedString=function(M){return this[M]},U.bool=function(M){return this[M]==="YES"},U.decimalResolution=function(M){var y=Q.exec(this[M]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},W.parseAttrList=function(M){var y,C={},I='"';for(_.lastIndex=0;(y=_.exec(M))!==null;){var w=y[2];w.indexOf(I)===0&&w.lastIndexOf(I)===w.length-1&&(w=w.slice(1,-1)),C[y[1]]=w}return C},W}()},"./src/utils/binary-search.ts":function(fe,Z,R){"use strict";R.r(Z);var Q={search:function(L,W){for(var U=0,O=L.length-1,M=null,y=null;U<=O;){M=(U+O)/2|0,y=L[M];var C=W(y);if(C>0)U=M+1;else if(C<0)O=M-1;else return y}return null}};Z.default=Q},"./src/utils/buffer-helper.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"BufferHelper",function(){return L});var Q=R("./src/utils/logger.ts"),_={length:0,start:function(){return 0},end:function(){return 0}},L=function(){function W(){}return W.isBuffered=function(O,M){try{if(O){for(var y=W.getBuffered(O),C=0;C<y.length;C++)if(M>=y.start(C)&&M<=y.end(C))return!0}}catch(I){}return!1},W.bufferInfo=function(O,M,y){try{if(O){var C=W.getBuffered(O),I=[],w;for(w=0;w<C.length;w++)I.push({start:C.start(w),end:C.end(w)});return this.bufferedInfo(I,M,y)}}catch(A){}return{len:0,start:M,end:M,nextStart:void 0}},W.bufferedInfo=function(O,M,y){M=Math.max(0,M),O.sort(function(p,D){var v=p.start-D.start;return v||D.end-p.end});var C=[];if(y)for(var I=0;I<O.length;I++){var w=C.length;if(w){var A=C[w-1].end;O[I].start-A<y?O[I].end>A&&(C[w-1].end=O[I].end):C.push(O[I])}else C.push(O[I])}else C=O;for(var S=0,h,o=M,s=M,u=0;u<C.length;u++){var x=C[u].start,c=C[u].end;if(M+y>=x&&M<c)o=x,s=c,S=s-M;else if(M+y<x){h=x;break}}return{len:S,start:o||0,end:s||0,nextStart:h}},W.getBuffered=function(O){try{return O.buffered}catch(M){return Q.logger.log("failed to get media.buffered",M),_}},W}()},"./src/utils/cea-608-parser.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"Row",function(){return s}),R.d(Z,"CaptionScreen",function(){return u});var Q=R("./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},L=function(d){var l=d;return _.hasOwnProperty(d)&&(l=_[d]),String.fromCharCode(l)},W=15,U=100,O={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},M={17:2,18:4,21:6,22:8,23:10,19:13,20:15},y={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},C={25:2,26:4,29:6,30:8,31:10,27:13,28:15},I=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],w;(function(f){f[f.ERROR=0]="ERROR",f[f.TEXT=1]="TEXT",f[f.WARNING=2]="WARNING",f[f.INFO=2]="INFO",f[f.DEBUG=3]="DEBUG",f[f.DATA=3]="DATA"})(w||(w={}));var A=function(){function f(){this.time=null,this.verboseLevel=w.ERROR}var d=f.prototype;return d.log=function(a,g){this.verboseLevel>=a&&Q.logger.log(this.time+" ["+a+"] "+g)},f}(),S=function(d){for(var l=[],a=0;a<d.length;a++)l.push(d[a].toString(16));return l},h=function(){function f(l,a,g,m,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=l||"white",this.underline=a||!1,this.italics=g||!1,this.background=m||"black",this.flash=b||!1}var d=f.prototype;return d.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},d.setStyles=function(a){for(var g=["foreground","underline","italics","background","flash"],m=0;m<g.length;m++){var b=g[m];a.hasOwnProperty(b)&&(this[b]=a[b])}},d.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},d.equals=function(a){return this.foreground===a.foreground&&this.underline===a.underline&&this.italics===a.italics&&this.background===a.background&&this.flash===a.flash},d.copy=function(a){this.foreground=a.foreground,this.underline=a.underline,this.italics=a.italics,this.background=a.background,this.flash=a.flash},d.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},f}(),o=function(){function f(l,a,g,m,b,P){this.uchar=void 0,this.penState=void 0,this.uchar=l||" ",this.penState=new h(a,g,m,b,P)}var d=f.prototype;return d.reset=function(){this.uchar=" ",this.penState.reset()},d.setChar=function(a,g){this.uchar=a,this.penState.copy(g)},d.setPenState=function(a){this.penState.copy(a)},d.equals=function(a){return this.uchar===a.uchar&&this.penState.equals(a.penState)},d.copy=function(a){this.uchar=a.uchar,this.penState.copy(a.penState)},d.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},f}(),s=function(){function f(l){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var a=0;a<U;a++)this.chars.push(new o);this.logger=l,this.pos=0,this.currPenState=new h}var d=f.prototype;return d.equals=function(a){for(var g=!0,m=0;m<U;m++)if(!this.chars[m].equals(a.chars[m])){g=!1;break}return g},d.copy=function(a){for(var g=0;g<U;g++)this.chars[g].copy(a.chars[g])},d.isEmpty=function(){for(var a=!0,g=0;g<U;g++)if(!this.chars[g].isEmpty()){a=!1;break}return a},d.setCursor=function(a){this.pos!==a&&(this.pos=a),this.pos<0?(this.logger.log(w.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>U&&(this.logger.log(w.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},d.moveCursor=function(a){var g=this.pos+a;if(a>1)for(var m=this.pos+1;m<g+1;m++)this.chars[m].setPenState(this.currPenState);this.setCursor(g)},d.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},d.insertChar=function(a){a>=144&&this.backSpace();var g=L(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)},d.clearFromPos=function(a){var g;for(g=a;g<U;g++)this.chars[g].reset()},d.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},d.clearToEndOfRow=function(){this.clearFromPos(this.pos)},d.getTextString=function(){for(var a=[],g=!0,m=0;m<U;m++){var b=this.chars[m].uchar;b!==" "&&(g=!1),a.push(b)}return g?"":a.join("")},d.setPenStyles=function(a){this.currPenState.setStyles(a);var g=this.chars[this.pos];g.setPenState(this.currPenState)},f}(),u=function(){function f(l){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var a=0;a<W;a++)this.rows.push(new s(l));this.logger=l,this.currRow=W-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var d=f.prototype;return d.reset=function(){for(var a=0;a<W;a++)this.rows[a].clear();this.currRow=W-1},d.equals=function(a){for(var g=!0,m=0;m<W;m++)if(!this.rows[m].equals(a.rows[m])){g=!1;break}return g},d.copy=function(a){for(var g=0;g<W;g++)this.rows[g].copy(a.rows[g])},d.isEmpty=function(){for(var a=!0,g=0;g<W;g++)if(!this.rows[g].isEmpty()){a=!1;break}return a},d.backSpace=function(){var a=this.rows[this.currRow];a.backSpace()},d.clearToEndOfRow=function(){var a=this.rows[this.currRow];a.clearToEndOfRow()},d.insertChar=function(a){var g=this.rows[this.currRow];g.insertChar(a)},d.setPen=function(a){var g=this.rows[this.currRow];g.setPenStyles(a)},d.moveCursor=function(a){var g=this.rows[this.currRow];g.moveCursor(a)},d.setCursor=function(a){this.logger.log(w.INFO,"setCursor: "+a);var g=this.rows[this.currRow];g.setCursor(a)},d.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 m=0;m<W;m++)this.rows[m].clear();var b=this.currRow+1-this.nrRollUpRows,P=this.lastOutputScreen;if(P){var H=P.rows[b].cueStartTime,V=this.logger.time;if(H&&V!==null&&H<V)for(var re=0;re<this.nrRollUpRows;re++)this.rows[g-this.nrRollUpRows+re+1].copy(P.rows[b+re])}}this.currRow=g;var z=this.rows[this.currRow];if(a.indent!==null){var F=a.indent,ae=Math.max(F-1,0);z.setCursor(a.indent),a.color=z.chars[ae].penState.foreground}var ce={foreground:a.color,underline:a.underline,italics:a.italics,background:"black",flash:!1};this.setPen(ce)},d.setBkgData=function(a){this.logger.log(w.INFO,"bkgData = "+JSON.stringify(a)),this.backSpace(),this.setPen(a),this.insertChar(32)},d.setRollUpRows=function(a){this.nrRollUpRows=a},d.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(w.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(w.TEXT,this.getDisplayText());var a=this.currRow+1-this.nrRollUpRows,g=this.rows.splice(a,1)[0];g.clear(),this.rows.splice(this.currRow,0,g),this.logger.log(w.INFO,"Rolling up")},d.getDisplayText=function(a){a=a||!1;for(var g=[],m="",b=-1,P=0;P<W;P++){var H=this.rows[P].getTextString();H&&(b=P+1,a?g.push("Row "+b+": '"+H+"'"):g.push(H.trim()))}return g.length>0&&(a?m="["+g.join(" | ")+"]":m=g.join(`
|
|
`)),m},d.getTextAndFormat=function(){return this.rows},f}(),x=function(){function f(l,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=l,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[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=g}var d=f.prototype;return d.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},d.getHandler=function(){return this.outputFilter},d.setHandler=function(a){this.outputFilter=a},d.setPAC=function(a){this.writeScreen.setPAC(a)},d.setBkgData=function(a){this.writeScreen.setBkgData(a)},d.setMode=function(a){if(a===this.mode)return;this.mode=a,this.logger.log(w.INFO,"MODE="+a),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=a},d.insertChars=function(a){for(var g=0;g<a.length;g++)this.writeScreen.insertChar(a[g]);var m=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(w.INFO,m+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(w.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},d.ccRCL=function(){this.logger.log(w.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},d.ccBS=function(){if(this.logger.log(w.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},d.ccAOF=function(){},d.ccAON=function(){},d.ccDER=function(){this.logger.log(w.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},d.ccRU=function(a){this.logger.log(w.INFO,"RU("+a+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(a)},d.ccFON=function(){this.logger.log(w.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},d.ccRDC=function(){this.logger.log(w.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},d.ccTR=function(){this.logger.log(w.INFO,"TR"),this.setMode("MODE_TEXT")},d.ccRTD=function(){this.logger.log(w.INFO,"RTD"),this.setMode("MODE_TEXT")},d.ccEDM=function(){this.logger.log(w.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},d.ccCR=function(){this.logger.log(w.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},d.ccENM=function(){this.logger.log(w.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},d.ccEOC=function(){if(this.logger.log(w.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var a=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=a,this.writeScreen=this.nonDisplayedMemory,this.logger.log(w.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},d.ccTO=function(a){this.logger.log(w.INFO,"TO("+a+") - Tab Offset"),this.writeScreen.moveCursor(a)},d.ccMIDROW=function(a){var g={flash:!1};if(g.underline=a%2===1,g.italics=a>=46,g.italics)g.foreground="white";else{var m=Math.floor(a/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];g.foreground=b[m]}this.logger.log(w.INFO,"MIDROW: "+JSON.stringify(g)),this.writeScreen.setPen(g)},d.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))},d.cueSplitAtTime=function(a){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,a,this.displayedMemory),this.cueStartTime=a))},f}(),c=function(){function f(l,a,g){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var m=new A;this.channels=[null,new x(l,a,m),new x(l+1,g,m)],this.cmdHistory=v(),this.logger=m}var d=f.prototype;return d.getHandler=function(a){return this.channels[a].getHandler()},d.setHandler=function(a,g){this.channels[a].setHandler(g)},d.addData=function(a,g){var m,b,P,H=!1;this.logger.time=a;for(var V=0;V<g.length;V+=2){if(b=g[V]&127,P=g[V+1]&127,b===0&&P===0)continue;if(this.logger.log(w.DATA,"["+S([g[V],g[V+1]])+"] -> ("+S([b,P])+")"),m=this.parseCmd(b,P),m||(m=this.parseMidrow(b,P)),m||(m=this.parsePAC(b,P)),m||(m=this.parseBackgroundAttributes(b,P)),!m&&(H=this.parseChars(b,P),H)){var re=this.currentChannel;if(re&&re>0){var z=this.channels[re];z.insertChars(H)}else this.logger.log(w.WARNING,"No channel found yet. TEXT-MODE?")}!m&&!H&&this.logger.log(w.WARNING,"Couldn't parse cleaned data "+S([b,P])+" orig: "+S([g[V],g[V+1]]))}},d.parseCmd=function(a,g){var m=this.cmdHistory,b=(a===20||a===28||a===21||a===29)&&g>=32&&g<=47,P=(a===23||a===31)&&g>=33&&g<=35;if(!(b||P))return!1;if(D(a,g,m))return p(null,null,m),this.logger.log(w.DEBUG,"Repeated command ("+S([a,g])+") is dropped"),!0;var H=a===20||a===21||a===23?1:2,V=this.channels[H];return a===20||a===21||a===28||a===29?g===32?V.ccRCL():g===33?V.ccBS():g===34?V.ccAOF():g===35?V.ccAON():g===36?V.ccDER():g===37?V.ccRU(2):g===38?V.ccRU(3):g===39?V.ccRU(4):g===40?V.ccFON():g===41?V.ccRDC():g===42?V.ccTR():g===43?V.ccRTD():g===44?V.ccEDM():g===45?V.ccCR():g===46?V.ccENM():g===47&&V.ccEOC():V.ccTO(g-32),p(a,g,m),this.currentChannel=H,!0},d.parseMidrow=function(a,g){var m=0;if((a===17||a===25)&&g>=32&&g<=47){if(a===17?m=1:m=2,m!==this.currentChannel)return this.logger.log(w.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[m];return b?(b.ccMIDROW(g),this.logger.log(w.DEBUG,"MIDROW ("+S([a,g])+")"),!0):!1}return!1},d.parsePAC=function(a,g){var m,b=this.cmdHistory,P=(a>=17&&a<=23||a>=25&&a<=31)&&g>=64&&g<=127,H=(a===16||a===24)&&g>=64&&g<=95;if(!(P||H))return!1;if(D(a,g,b))return p(null,null,b),!0;var V=a<=23?1:2;g>=64&&g<=95?m=V===1?O[a]:y[a]:m=V===1?M[a]:C[a];var re=this.channels[V];return re?(re.setPAC(this.interpretPAC(m,g)),p(a,g,b),this.currentChannel=V,!0):!1},d.interpretPAC=function(a,g){var m,b={color:null,italics:!1,indent:null,underline:!1,row:a};return g>95?m=g-96:m=g-64,b.underline=(m&1)===1,m<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(m/2)]:m<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((m-16)/2)*4,b},d.parseChars=function(a,g){var m,b=null,P=null;if(a>=25?(m=2,P=a-8):(m=1,P=a),P>=17&&P<=19){var H;P===17?H=g+80:P===18?H=g+112:H=g+144,this.logger.log(w.INFO,"Special char '"+L(H)+"' in channel "+m),b=[H]}else a>=32&&a<=127&&(b=g===0?[a]:[a,g]);if(b){var V=S(b);this.logger.log(w.DEBUG,"Char codes = "+V.join(",")),p(a,g,this.cmdHistory)}return b},d.parseBackgroundAttributes=function(a,g){var m=(a===16||a===24)&&g>=32&&g<=47,b=(a===23||a===31)&&g>=45&&g<=47;if(!(m||b))return!1;var P,H={};a===16||a===24?(P=Math.floor((g-32)/2),H.background=I[P],g%2===1&&(H.background=H.background+"_semi")):g===45?H.background="transparent":(H.foreground="black",g===47&&(H.underline=!0));var V=a<=23?1:2,re=this.channels[V];return re.setBkgData(H),p(a,g,this.cmdHistory),!0},d.reset=function(){for(var a=0;a<Object.keys(this.channels).length;a++){var g=this.channels[a];g&&g.reset()}this.cmdHistory=v()},d.cueSplitAtTime=function(a){for(var g=0;g<this.channels.length;g++){var m=this.channels[g];m&&m.cueSplitAtTime(a)}},f}();function p(f,d,l){l.a=f,l.b=d}function D(f,d,l){return l.a===f&&l.b===d}function v(){return{a:null,b:null}}Z.default=c},"./src/utils/codecs.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"isCodecType",function(){return _}),R.d(Z,"isCodecSupportedInMp4",function(){return L});var Q={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function _(W,U){var O=Q[U];return!!O&&O[W.slice(0,4)]===!0}function L(W,U){return MediaSource.isTypeSupported((U||"video")+'/mp4;codecs="'+W+'"')}},"./src/utils/cues.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/utils/vttparser.ts"),_=R("./src/utils/webvtt-parser.ts"),L=R("./src/utils/texttrack-utils.ts"),W=/\s/,U={newCue:function(M,y,C,I){for(var w=[],A,S,h,o,s,u=self.VTTCue||self.TextTrackCue,x=0;x<I.rows.length;x++)if(A=I.rows[x],h=!0,o=0,s="",!A.isEmpty()){for(var c=0;c<A.chars.length;c++)W.test(A.chars[c].uchar)&&h?o++:(s+=A.chars[c].uchar,h=!1);A.cueStartTime=y,y===C&&(C+=1e-4),o>=16?o--:o++;var p=Object(Q.fixLineBreaks)(s.trim()),D=Object(_.generateCueId)(y,C,p);(!M||!M.cues||!M.cues.getCueById(D))&&(S=new u(y,C,p),S.id=D,S.line=x+1,S.align="left",S.position=10+Math.min(80,Math.floor(o*8/32)*10),w.push(S))}return M&&w.length&&(w.sort(function(v,f){return v.line==="auto"||f.line==="auto"?0:v.line>8&&f.line>8?f.line-v.line:v.line-f.line}),w.forEach(function(v){return Object(L.addCueToTrack)(M,v)})),w}};Z.default=U},"./src/utils/discontinuities.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"findFirstFragWithCC",function(){return W}),R.d(Z,"shouldAlignOnDiscontinuities",function(){return U}),R.d(Z,"findDiscontinuousReferenceFrag",function(){return O}),R.d(Z,"adjustSlidingStart",function(){return y}),R.d(Z,"alignStream",function(){return C}),R.d(Z,"alignPDT",function(){return w}),R.d(Z,"alignFragmentByPDTDelta",function(){return A}),R.d(Z,"alignMediaPlaylistByPDT",function(){return S});var Q=R("./src/polyfills/number.ts"),_=R("./src/utils/logger.ts"),L=R("./src/controller/level-helper.ts");function W(h,o){for(var s=null,u=0,x=h.length;u<x;u++){var c=h[u];if(c&&c.cc===o){s=c;break}}return s}function U(h,o,s){return!!(o.details&&(s.endCC>s.startCC||h&&h.cc<s.startCC))}function O(h,o){var s=h.fragments,u=o.fragments;if(!u.length||!s.length){_.logger.log("No fragments to align");return}var x=W(s,u[0].cc);if(!x||x&&!x.startPTS){_.logger.log("No frag in previous level to align on");return}return x}function M(h,o){if(h){var s=h.start+o;h.start=h.startPTS=s,h.endPTS=s+h.duration}}function y(h,o){for(var s=o.fragments,u=0,x=s.length;u<x;u++)M(s[u],h);o.fragmentHint&&M(o.fragmentHint,h),o.alignedSliding=!0}function C(h,o,s){if(!o)return;I(h,s,o),!s.alignedSliding&&o.details&&w(s,o.details),!s.alignedSliding&&o.details&&!s.skippedSegments&&Object(L.adjustSliding)(o.details,s)}function I(h,o,s){if(U(h,s,o)){var u=O(s.details,o);u&&Object(Q.isFiniteNumber)(u.start)&&(_.logger.log("Adjusting PTS using last level due to CC increase within current level "+o.url),y(u.start,o))}}function w(h,o){if(!o.fragments.length||!h.hasProgramDateTime||!o.hasProgramDateTime)return;var s=o.fragments[0].programDateTime,u=h.fragments[0].programDateTime,x=(u-s)/1e3+o.fragments[0].start;x&&Object(Q.isFiniteNumber)(x)&&(_.logger.log("Adjusting PTS using programDateTime delta "+(u-s)+"ms, sliding:"+x.toFixed(3)+" "+h.url+" "),y(x,h))}function A(h,o){var s=h.programDateTime;if(!s)return;var u=(s-o)/1e3;h.start=h.startPTS=u,h.endPTS=u+h.duration}function S(h,o){if(!o.fragments.length||!h.hasProgramDateTime||!o.hasProgramDateTime)return;var s=o.fragments[0].programDateTime,u=o.fragments[0].start,x=s-u*1e3;h.fragments.forEach(function(c){A(c,x)}),h.fragmentHint&&A(h.fragmentHint,x),h.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/utils/ewma.ts"),_=function(){function L(U,O,M){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=M,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Q.default(U),this.fast_=new Q.default(O)}var W=L.prototype;return W.update=function(O,M){var y=this.slow_,C=this.fast_;this.slow_.halfLife!==O&&(this.slow_=new Q.default(O,y.getEstimate(),y.getTotalWeight())),this.fast_.halfLife!==M&&(this.fast_=new Q.default(M,C.getEstimate(),C.getTotalWeight()))},W.sample=function(O,M){O=Math.max(O,this.minDelayMs_);var y=8*M,C=O/1e3,I=y/C;this.fast_.sample(C,I),this.slow_.sample(C,I)},W.canEstimate=function(){var O=this.fast_;return O&&O.getTotalWeight()>=this.minWeight_},W.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},W.destroy=function(){},L}();Z.default=_},"./src/utils/ewma.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=function(){function _(W,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=W,this.alpha_=W?Math.exp(Math.log(.5)/W):0,this.estimate_=U,this.totalWeight_=O}var L=_.prototype;return L.sample=function(U,O){var M=Math.pow(this.alpha_,U);this.estimate_=O*(1-M)+M*this.estimate_,this.totalWeight_+=U},L.getTotalWeight=function(){return this.totalWeight_},L.getEstimate=function(){if(this.alpha_){var U=1-Math.pow(this.alpha_,this.totalWeight_);if(U)return this.estimate_/U}return this.estimate_},_}();Z.default=Q},"./src/utils/fetch-loader.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"fetchSupported",function(){return A});var Q=R("./src/polyfills/number.ts"),_=R("./src/loader/load-stats.ts"),L=R("./src/demux/chunk-cache.ts");function W(u,x){u.prototype=Object.create(x.prototype),u.prototype.constructor=u,C(u,x)}function U(u){var x=typeof Map=="function"?new Map:void 0;return U=function(p){if(p===null||!y(p))return p;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(typeof x!="undefined"){if(x.has(p))return x.get(p);x.set(p,D)}function D(){return O(p,arguments,I(this).constructor)}return D.prototype=Object.create(p.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),C(D,p)},U(u)}function O(u,x,c){return M()?O=Reflect.construct:O=function(D,v,f){var d=[null];d.push.apply(d,v);var l=Function.bind.apply(D,d),a=new l;return f&&C(a,f.prototype),a},O.apply(null,arguments)}function M(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(u){return!1}}function y(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function C(u,x){return C=Object.setPrototypeOf||function(p,D){return p.__proto__=D,p},C(u,x)}function I(u){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},I(u)}function w(){return w=Object.assign||function(u){for(var x=1;x<arguments.length;x++){var c=arguments[x];for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&(u[p]=c[p])}return u},w.apply(this,arguments)}function A(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(u){}return!1}var S=function(){function u(c){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=c.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 p=this.response;(!p||!p.ok)&&(this.stats.aborted=!0,this.controller.abort())},x.abort=function(){var p;this.abortInternal(),(p=this.callbacks)!==null&&p!==void 0&&p.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},x.load=function(p,D,v){var f=this,d=this.stats;if(d.loading.start)throw new Error("Loader can only be used once.");d.loading.start=self.performance.now();var l=h(p,this.controller.signal),a=v.onProgress,g=p.responseType==="arraybuffer",m=g?"byteLength":"length";this.context=p,this.config=D,this.callbacks=v,this.request=this.fetchSetup(p,l),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){f.abortInternal(),v.onTimeout(d,p,f.response)},D.timeout),self.fetch(this.request).then(function(b){if(f.response=f.loader=b,!b.ok){var P=b.status,H=b.statusText;throw new s(H||"fetch, bad network response",P,b)}return d.loading.first=Math.max(self.performance.now(),d.loading.start),d.total=parseInt(b.headers.get("Content-Length")||"0"),a&&Object(Q.isFiniteNumber)(D.highWaterMark)?f.loadProgressively(b,d,p,D.highWaterMark,a):g?b.arrayBuffer():b.text()}).then(function(b){var P=f.response;self.clearTimeout(f.requestTimeout),d.loading.end=Math.max(self.performance.now(),d.loading.first),d.loaded=d.total=b[m];var H={url:P.url,data:b};a&&!Object(Q.isFiniteNumber)(D.highWaterMark)&&a(d,p,b,P),v.onSuccess(H,d,p,P)}).catch(function(b){if(self.clearTimeout(f.requestTimeout),d.aborted)return;var P=b.code||0;v.onError({code:P,text:b.message},p,b.details)})},x.getCacheAge=function(){var p=null;if(this.response){var D=this.response.headers.get("age");p=D?parseFloat(D):null}return p},x.loadProgressively=function(p,D,v,f,d){f===void 0&&(f=0);var l=new L.default,a=p.body.getReader(),g=function m(){return a.read().then(function(b){if(b.done)return l.dataLength&&d(D,v,l.flush(),p),Promise.resolve(new ArrayBuffer(0));var P=b.value,H=P.length;return D.loaded+=H,H<f||l.dataLength?(l.push(P),l.dataLength>=f&&d(D,v,l.flush(),p)):d(D,v,P,p),m()}).catch(function(){return Promise.reject()})};return g()},u}();function h(u,x){var c={method:"GET",mode:"cors",credentials:"same-origin",signal:x,headers:new self.Headers(w({},u.headers))};return u.rangeEnd&&c.headers.set("Range","bytes="+u.rangeStart+"-"+String(u.rangeEnd-1)),c}function o(u,x){return new self.Request(u.url,x)}var s=function(u){W(x,u);function x(c,p,D){var v;return v=u.call(this,c)||this,v.code=void 0,v.details=void 0,v.code=p,v.details=D,v}return x}(U(Error));Z.default=S},"./src/utils/imsc1-ttml-parser.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"IMSC1_CODEC",function(){return y}),R.d(Z,"parseIMSC1",function(){return A});var Q=R("./src/utils/mp4-tools.ts"),_=R("./src/utils/vttparser.ts"),L=R("./src/utils/vttcue.ts"),W=R("./src/demux/id3.ts"),U=R("./src/utils/timescale-conversion.ts"),O=R("./src/utils/webvtt-parser.ts");function M(){return M=Object.assign||function(f){for(var d=1;d<arguments.length;d++){var l=arguments[d];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(f[a]=l[a])}return f},M.apply(this,arguments)}var y="stpp.ttml.im1t",C=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,I=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,w={left:"start",center:"center",right:"end",start:"start",end:"end"};function A(f,d,l,a,g){var m=Object(Q.findBox)(new Uint8Array(f),["mdat"]);if(m.length===0){g(new Error("Could not parse IMSC1 mdat"));return}var b=m[0],P=Object(W.utf8ArrayToStr)(new Uint8Array(f,b.start,b.end-b.start)),H=Object(U.toTimescaleFromScale)(d,1,l);try{a(S(P,H))}catch(V){g(V)}}function S(f,d){var l=new DOMParser,a=l.parseFromString(f,"text/xml"),g=a.getElementsByTagName("tt")[0];if(!g)throw new Error("Invalid ttml");var m={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(m).reduce(function(z,F){return z[F]=g.getAttribute("ttp:"+F)||m[F],z},{}),P=g.getAttribute("xml:space")!=="preserve",H=o(h(g,"styling","style")),V=o(h(g,"layout","region")),re=h(g,"body","[begin]");return[].map.call(re,function(z){var F=s(z,P);if(!F||!z.hasAttribute("begin"))return null;var ae=p(z.getAttribute("begin"),b),ce=p(z.getAttribute("dur"),b),me=p(z.getAttribute("end"),b);if(ae===null)throw c(z);if(me===null){if(ce===null)throw c(z);me=ae+ce}var be=new L.default(ae-d,me-d,F);be.id=Object(O.generateCueId)(be.startTime,be.endTime,be.text);var Be=V[z.getAttribute("region")],Ce=H[z.getAttribute("style")];be.position=10,be.size=80;var Le=u(Be,Ce),Te=Le.textAlign;if(Te){var we=w[Te];we&&(be.lineAlign=we),be.align=Te}return M(be,Le),be}).filter(function(z){return z!==null})}function h(f,d,l){var a=f.getElementsByTagName(d)[0];return a?[].slice.call(a.querySelectorAll(l)):[]}function o(f){return f.reduce(function(d,l){var a=l.getAttribute("xml:id");return a&&(d[a]=l),d},{})}function s(f,d){return[].slice.call(f.childNodes).reduce(function(l,a,g){var m;return a.nodeName==="br"&&g?l+`
|
|
`:(m=a.childNodes)!==null&&m!==void 0&&m.length?s(a,d):d?l+a.textContent.trim().replace(/\s+/g," "):l+a.textContent},"")}function u(f,d){var l="http://www.w3.org/ns/ttml#styling",a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return a.reduce(function(g,m){var b=x(d,l,m)||x(f,l,m);return b&&(g[m]=b),g},{})}function x(f,d,l){return f.hasAttributeNS(d,l)?f.getAttributeNS(d,l):null}function c(f){return new Error("Could not parse ttml timestamp "+f)}function p(f,d){if(!f)return null;var l=Object(_.parseTimeStamp)(f);return l===null&&(C.test(f)?l=D(f,d):I.test(f)&&(l=v(f,d))),l}function D(f,d){var l=C.exec(f),a=(l[4]|0)+(l[5]|0)/d.subFrameRate;return(l[1]|0)*3600+(l[2]|0)*60+(l[3]|0)+a/d.frameRate}function v(f,d){var l=I.exec(f),a=Number(l[1]),g=l[2];switch(g){case"h":return a*3600;case"m":return a*60;case"ms":return a*1e3;case"f":return a/d.frameRate;case"t":return a/d.tickRate}return a}},"./src/utils/logger.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"enableLogs",function(){return O}),R.d(Z,"logger",function(){return M});var Q=function(){},_={trace:Q,debug:Q,log:Q,warn:Q,info:Q,error:Q},L=_;function W(y){var C=self.console[y];return C?C.bind(self.console,"["+y+"] >"):Q}function U(y){for(var C=arguments.length,I=new Array(C>1?C-1:0),w=1;w<C;w++)I[w-1]=arguments[w];I.forEach(function(A){L[A]=y[A]?y[A].bind(y):W(A)})}function O(y){if(self.console&&y===!0||typeof y=="object"){U(y,"debug","log","info","warn","error");try{L.log()}catch(C){L=_}}else L=_}var M=L},"./src/utils/mediakeys-helper.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"KeySystems",function(){return Q}),R.d(Z,"requestMediaKeySystemAccess",function(){return _});var Q;(function(L){L.WIDEVINE="com.widevine.alpha",L.PLAYREADY="com.microsoft.playready"})(Q||(Q={}));var _=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"getMediaSource",function(){return Q});function Q(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"bin2str",function(){return U}),R.d(Z,"readUint16",function(){return O}),R.d(Z,"readUint32",function(){return M}),R.d(Z,"writeUint32",function(){return y}),R.d(Z,"findBox",function(){return C}),R.d(Z,"parseSegmentIndex",function(){return I}),R.d(Z,"parseInitSegment",function(){return w}),R.d(Z,"getStartDTS",function(){return A}),R.d(Z,"getDuration",function(){return S}),R.d(Z,"computeRawDurationFromSamples",function(){return h}),R.d(Z,"offsetStartDTS",function(){return o}),R.d(Z,"segmentValidRange",function(){return s}),R.d(Z,"appendUint8Array",function(){return u});var Q=R("./src/utils/typed-array.ts"),_=R("./src/loader/fragment.ts"),L=Math.pow(2,32)-1,W=[].push;function U(x){return String.fromCharCode.apply(null,x)}function O(x,c){"data"in x&&(c+=x.start,x=x.data);var p=x[c]<<8|x[c+1];return p<0?65536+p:p}function M(x,c){"data"in x&&(c+=x.start,x=x.data);var p=x[c]<<24|x[c+1]<<16|x[c+2]<<8|x[c+3];return p<0?4294967296+p:p}function y(x,c,p){"data"in x&&(c+=x.start,x=x.data),x[c]=p>>24,x[c+1]=p>>16&255,x[c+2]=p>>8&255,x[c+3]=p&255}function C(x,c){var p=[];if(!c.length)return p;var D,v,f;"data"in x?(D=x.data,v=x.start,f=x.end):(D=x,v=0,f=D.byteLength);for(var d=v;d<f;){var l=M(D,d),a=U(D.subarray(d+4,d+8)),g=l>1?d+l:f;if(a===c[0])if(c.length===1)p.push({data:D,start:d+8,end:g});else{var m=C({data:D,start:d+8,end:g},c.slice(1));m.length&&W.apply(p,m)}d=g}return p}function I(x){var c=C(x,["moov"]),p=c[0],D=p?p.end:null,v=C(x,["sidx"]);if(!v||!v[0])return null;var f=[],d=v[0],l=d.data[0],a=l===0?8:16,g=M(d,a);a+=4;var m=0,b=0;l===0?a+=8:a+=16,a+=2;var P=d.end+b,H=O(d,a);a+=2;for(var V=0;V<H;V++){var re=a,z=M(d,re);re+=4;var F=z&2147483647,ae=(z&2147483648)>>>31;if(ae===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ce=M(d,re);re+=4,f.push({referenceSize:F,subsegmentDuration:ce,info:{duration:ce/g,start:P,end:P+F-1}}),P+=F,re+=4,a=re}return{earliestPresentationTime:m,timescale:g,version:l,referencesCount:H,references:f,moovEndOffset:D}}function w(x){for(var c=[],p=C(x,["moov","trak"]),D=0;D<p.length;D++){var v=p[D],f=C(v,["tkhd"])[0];if(f){var d=f.data[f.start],l=d===0?12:20,a=M(f,l),g=C(v,["mdia","mdhd"])[0];if(g){d=g.data[g.start],l=d===0?12:20;var m=M(g,l),b=C(v,["mdia","hdlr"])[0];if(b){var P=U(b.data.subarray(b.start+8,b.start+12)),H={soun:_.ElementaryStreamTypes.AUDIO,vide:_.ElementaryStreamTypes.VIDEO}[P];if(H){var V=C(v,["mdia","minf","stbl","stsd"])[0],re=void 0;V&&(re=U(V.data.subarray(V.start+12,V.start+16))),c[a]={timescale:m,type:H},c[H]={timescale:m,id:a,codec:re}}}}}}var z=C(x,["moov","mvex","trex"]);return z.forEach(function(F){var ae=M(F,4),ce=c[ae];ce&&(ce.default={duration:M(F,12),flags:M(F,20)})}),c}function A(x,c){return C(c,["moof","traf"]).reduce(function(p,D){var v=C(D,["tfdt"])[0],f=v.data[v.start],d=C(D,["tfhd"]).reduce(function(l,a){var g=M(a,4),m=x[g];if(m){var b=M(v,4);f===1&&(b*=Math.pow(2,32),b+=M(v,8));var P=m.timescale||9e4,H=b/P;if(isFinite(H)&&(l===null||H<l))return H}return l},null);return d!==null&&isFinite(d)&&(p===null||d<p)?d:p},null)||0}function S(x,c){for(var p=0,D=0,v=0,f=C(x,["moof","traf"]),d=0;d<f.length;d++){var l=f[d],a=C(l,["tfhd"])[0],g=M(a,4),m=c[g];if(!m)continue;var b=m.default,P=M(a,0)|(b==null?void 0:b.flags),H=b==null?void 0:b.duration;P&8&&(P&2?H=M(a,12):H=M(a,8));for(var V=m.timescale||9e4,re=C(l,["trun"]),z=0;z<re.length;z++){if(H){var F=M(re[z],4);p=H*F}else p=h(re[z]);m.type===_.ElementaryStreamTypes.VIDEO?D+=p/V:m.type===_.ElementaryStreamTypes.AUDIO&&(v+=p/V)}}if(D===0&&v===0){var ae=I(x);if(ae!=null&&ae.references)return ae.references.reduce(function(ce,me){return ce+me.info.duration||0},0)}return D||v}function h(x){var c=M(x,0),p=8;c&1&&(p+=4),c&4&&(p+=4);for(var D=0,v=M(x,4),f=0;f<v;f++){if(c&256){var d=M(x,p);D+=d,p+=4}c&512&&(p+=4),c&1024&&(p+=4),c&2048&&(p+=4)}return D}function o(x,c,p){C(c,["moof","traf"]).forEach(function(D){C(D,["tfhd"]).forEach(function(v){var f=M(v,4),d=x[f];if(!d)return;var l=d.timescale||9e4;C(D,["tfdt"]).forEach(function(a){var g=a.data[a.start],m=M(a,4);if(g===0)y(a,4,m-p*l);else{m*=Math.pow(2,32),m+=M(a,8),m-=p*l,m=Math.max(m,0);var b=Math.floor(m/(L+1)),P=Math.floor(m%(L+1));y(a,4,b),y(a,8,P)}})})})}function s(x){var c={valid:null,remainder:null},p=C(x,["moof"]);if(p){if(p.length<2)return c.remainder=x,c}else return c;var D=p[p.length-1];return c.valid=Object(Q.sliceUint8)(x,0,D.start-8),c.remainder=Object(Q.sliceUint8)(x,D.start-8),c}function u(x,c){var p=new Uint8Array(x.length+c.length);return p.set(x),p.set(c,x.length),p}},"./src/utils/output-filter.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"default",function(){return Q});var Q=function(){function _(W,U){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=W,this.trackName=U}var L=_.prototype;return L.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},L.newCue=function(U,O,M){(this.startTime===null||this.startTime>U)&&(this.startTime=U),this.endTime=O,this.screen=M,this.timelineController.createCaptionsTrack(this.trackName)},L.reset=function(){this.cueRanges=[]},_}()},"./src/utils/texttrack-utils.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"sendAddTrackEvent",function(){return _}),R.d(Z,"addCueToTrack",function(){return L}),R.d(Z,"clearCurrentCues",function(){return W}),R.d(Z,"removeCuesInRange",function(){return U}),R.d(Z,"getCuesInRange",function(){return M});var Q=R("./src/utils/logger.ts");function _(y,C){var I;try{I=new Event("addtrack")}catch(w){I=document.createEvent("Event"),I.initEvent("addtrack",!1,!1)}I.track=y,C.dispatchEvent(I)}function L(y,C){var I=y.mode;if(I==="disabled"&&(y.mode="hidden"),y.cues&&!y.cues.getCueById(C.id))try{if(y.addCue(C),!y.cues.getCueById(C.id))throw new Error("addCue is failed for: "+C)}catch(A){Q.logger.debug("[texttrack-utils]: "+A);var w=new self.TextTrackCue(C.startTime,C.endTime,C.text);w.id=C.id,y.addCue(w)}I==="disabled"&&(y.mode=I)}function W(y){var C=y.mode;if(C==="disabled"&&(y.mode="hidden"),y.cues)for(var I=y.cues.length;I--;)y.removeCue(y.cues[I]);C==="disabled"&&(y.mode=C)}function U(y,C,I){var w=y.mode;if(w==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var A=M(y.cues,C,I),S=0;S<A.length;S++)y.removeCue(A[S]);w==="disabled"&&(y.mode=w)}function O(y,C){if(C<y[0].startTime)return 0;var I=y.length-1;if(C>y[I].endTime)return-1;for(var w=0,A=I;w<=A;){var S=Math.floor((A+w)/2);if(C<y[S].startTime)A=S-1;else if(C>y[S].startTime&&w<I)w=S+1;else return S}return y[w].startTime-C<C-y[A].startTime?w:A}function M(y,C,I){var w=[],A=O(y,C);if(A>-1)for(var S=A,h=y.length;S<h;S++){var o=y[S];if(o.startTime>=C&&o.endTime<=I)w.push(o);else if(o.startTime>I)return w}return w}},"./src/utils/time-ranges.ts":function(fe,Z,R){"use strict";R.r(Z);var Q={toString:function(L){for(var W="",U=L.length,O=0;O<U;O++)W+="["+L.start(O).toFixed(3)+","+L.end(O).toFixed(3)+"]";return W}};Z.default=Q},"./src/utils/timescale-conversion.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"toTimescaleFromBase",function(){return _}),R.d(Z,"toTimescaleFromScale",function(){return L}),R.d(Z,"toMsFromMpegTsClock",function(){return W}),R.d(Z,"toMpegTsClockFromTimescale",function(){return U});var Q=9e4;function _(O,M,y,C){y===void 0&&(y=1),C===void 0&&(C=!1);var I=O*M*y;return C?Math.round(I):I}function L(O,M,y,C){return y===void 0&&(y=1),C===void 0&&(C=!1),_(O,M,1/y,C)}function W(O,M){return M===void 0&&(M=!1),_(O,1e3,1/Q,M)}function U(O,M){return M===void 0&&(M=1),_(O,Q,1/M)}},"./src/utils/typed-array.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"sliceUint8",function(){return Q});function Q(_,L,W){return Uint8Array.prototype.slice?_.slice(L,W):new Uint8Array(Array.prototype.slice.call(_,L,W))}},"./src/utils/vttcue.ts":function(fe,Z,R){"use strict";R.r(Z),Z.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var Q=["","lr","rl"],_=["start","middle","end","left","right"];function L(y,C){if(typeof C!="string")return!1;if(!Array.isArray(y))return!1;var I=C.toLowerCase();return~y.indexOf(I)?I:!1}function W(y){return L(Q,y)}function U(y){return L(_,y)}function O(y){for(var C=arguments.length,I=new Array(C>1?C-1:0),w=1;w<C;w++)I[w-1]=arguments[w];for(var A=1;A<arguments.length;A++){var S=arguments[A];for(var h in S)y[h]=S[h]}return y}function M(y,C,I){var w=this,A={enumerable:!0};w.hasBeenReset=!1;var S="",h=!1,o=y,s=C,u=I,x=null,c="",p=!0,D="auto",v="start",f=50,d="middle",l=50,a="middle";Object.defineProperty(w,"id",O({},A,{get:function(){return S},set:function(m){S=""+m}})),Object.defineProperty(w,"pauseOnExit",O({},A,{get:function(){return h},set:function(m){h=!!m}})),Object.defineProperty(w,"startTime",O({},A,{get:function(){return o},set:function(m){if(typeof m!="number")throw new TypeError("Start time must be set to a number.");o=m,this.hasBeenReset=!0}})),Object.defineProperty(w,"endTime",O({},A,{get:function(){return s},set:function(m){if(typeof m!="number")throw new TypeError("End time must be set to a number.");s=m,this.hasBeenReset=!0}})),Object.defineProperty(w,"text",O({},A,{get:function(){return u},set:function(m){u=""+m,this.hasBeenReset=!0}})),Object.defineProperty(w,"region",O({},A,{get:function(){return x},set:function(m){x=m,this.hasBeenReset=!0}})),Object.defineProperty(w,"vertical",O({},A,{get:function(){return c},set:function(m){var b=W(m);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");c=b,this.hasBeenReset=!0}})),Object.defineProperty(w,"snapToLines",O({},A,{get:function(){return p},set:function(m){p=!!m,this.hasBeenReset=!0}})),Object.defineProperty(w,"line",O({},A,{get:function(){return D},set:function(m){if(typeof m!="number"&&m!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");D=m,this.hasBeenReset=!0}})),Object.defineProperty(w,"lineAlign",O({},A,{get:function(){return v},set:function(m){var b=U(m);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");v=b,this.hasBeenReset=!0}})),Object.defineProperty(w,"position",O({},A,{get:function(){return f},set:function(m){if(m<0||m>100)throw new Error("Position must be between 0 and 100.");f=m,this.hasBeenReset=!0}})),Object.defineProperty(w,"positionAlign",O({},A,{get:function(){return d},set:function(m){var b=U(m);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");d=b,this.hasBeenReset=!0}})),Object.defineProperty(w,"size",O({},A,{get:function(){return l},set:function(m){if(m<0||m>100)throw new Error("Size must be between 0 and 100.");l=m,this.hasBeenReset=!0}})),Object.defineProperty(w,"align",O({},A,{get:function(){return a},set:function(m){var b=U(m);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");a=b,this.hasBeenReset=!0}})),w.displayState=void 0}return M.prototype.getCueAsHTML=function(){var y=self.WebVTT;return y.convertCueToDOMTree(self,this.text)},M}()},"./src/utils/vttparser.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"parseTimeStamp",function(){return L}),R.d(Z,"fixLineBreaks",function(){return C}),R.d(Z,"VTTParser",function(){return I});var Q=R("./src/utils/vttcue.ts"),_=function(){function w(){}var A=w.prototype;return A.decode=function(h,o){if(!h)return"";if(typeof h!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(h))},w}();function L(w){function A(h,o,s,u){return(h|0)*3600+(o|0)*60+(s|0)+parseFloat(u||0)}var S=w.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return S?parseFloat(S[2])>59?A(S[2],S[3],0,S[4]):A(S[1],S[2],S[3],S[4]):null}var W=function(){function w(){this.values=Object.create(null)}var A=w.prototype;return A.set=function(h,o){!this.get(h)&&o!==""&&(this.values[h]=o)},A.get=function(h,o,s){return s?this.has(h)?this.values[h]:o[s]:this.has(h)?this.values[h]:o},A.has=function(h){return h in this.values},A.alt=function(h,o,s){for(var u=0;u<s.length;++u)if(o===s[u]){this.set(h,o);break}},A.integer=function(h,o){/^-?\d+$/.test(o)&&this.set(h,parseInt(o,10))},A.percent=function(h,o){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(o)){var s=parseFloat(o);if(s>=0&&s<=100)return this.set(h,s),!0}return!1},w}();function U(w,A,S,h){var o=h?w.split(h):[w];for(var s in o){if(typeof o[s]!="string")continue;var u=o[s].split(S);if(u.length!==2)continue;var x=u[0],c=u[1];A(x,c)}}var O=new Q.default(0,0,""),M=O.align==="middle"?"middle":"center";function y(w,A,S){var h=w;function o(){var x=L(w);if(x===null)throw new Error("Malformed timestamp: "+h);return w=w.replace(/^[^\sa-zA-Z-]+/,""),x}function s(x,c){var p=new W;U(x,function(f,d){var l;switch(f){case"region":for(var a=S.length-1;a>=0;a--)if(S[a].id===d){p.set(f,S[a].region);break}break;case"vertical":p.alt(f,d,["rl","lr"]);break;case"line":l=d.split(","),p.integer(f,l[0]),p.percent(f,l[0])&&p.set("snapToLines",!1),p.alt(f,l[0],["auto"]),l.length===2&&p.alt("lineAlign",l[1],["start",M,"end"]);break;case"position":l=d.split(","),p.percent(f,l[0]),l.length===2&&p.alt("positionAlign",l[1],["start",M,"end","line-left","line-right","auto"]);break;case"size":p.percent(f,d);break;case"align":p.alt(f,d,["start",M,"end","left","right"]);break}},/:/,/\s/),c.region=p.get("region",null),c.vertical=p.get("vertical","");var D=p.get("line","auto");D==="auto"&&O.line===-1&&(D=-1),c.line=D,c.lineAlign=p.get("lineAlign","start"),c.snapToLines=p.get("snapToLines",!0),c.size=p.get("size",100),c.align=p.get("align",M);var v=p.get("position","auto");v==="auto"&&O.position===50&&(v=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=v}function u(){w=w.replace(/^\s+/,"")}if(u(),A.startTime=o(),u(),w.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+h);w=w.substr(3),u(),A.endTime=o(),u(),s(w,A)}function C(w){return w.replace(/<br(?: \/)?>/gi,`
|
|
`)}var I=function(){function w(){this.state="INITIAL",this.buffer="",this.decoder=new _,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var A=w.prototype;return A.parse=function(h){var o=this;h&&(o.buffer+=o.decoder.decode(h,{stream:!0}));function s(){var v=o.buffer,f=0;for(v=C(v);f<v.length&&v[f]!=="\r"&&v[f]!==`
|
|
`;)++f;var d=v.substr(0,f);return v[f]==="\r"&&++f,v[f]===`
|
|
`&&++f,o.buffer=v.substr(f),d}function u(v){U(v,function(f,d){},/:/)}try{var x="";if(o.state==="INITIAL"){if(!/\r\n|\n/.test(o.buffer))return this;x=s();var c=x.match(/^()?WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new Error("Malformed WebVTT signature.");o.state="HEADER"}for(var p=!1;o.buffer;){if(!/\r\n|\n/.test(o.buffer))return this;p?p=!1:x=s();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 Q.default(0,0,""),o.state="CUE",x.indexOf("-->")===-1){o.cue.id=x;continue}case"CUE":if(!o.cue){o.state="BADCUE";continue}try{y(x,o.cue,o.regionList)}catch(v){o.cue=null,o.state="BADCUE";continue}o.state="CUETEXT";continue;case"CUETEXT":{var D=x.indexOf("-->")!==-1;if(!x||D&&(p=!0)){o.oncue&&o.cue&&o.oncue(o.cue),o.cue=null,o.state="ID";continue}if(o.cue===null)continue;o.cue.text&&(o.cue.text+=`
|
|
`),o.cue.text+=x}continue;case"BADCUE":x||(o.state="ID")}}}catch(v){o.state==="CUETEXT"&&o.cue&&o.oncue&&o.oncue(o.cue),o.cue=null,o.state=o.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},A.flush=function(){var h=this;try{if((h.cue||h.state==="HEADER")&&(h.buffer+=`
|
|
|
|
`,h.parse()),h.state==="INITIAL"||h.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(o){h.onparsingerror&&h.onparsingerror(o)}return h.onflush&&h.onflush(),this},w}()},"./src/utils/webvtt-parser.ts":function(fe,Z,R){"use strict";R.r(Z),R.d(Z,"generateCueId",function(){return I}),R.d(Z,"parseWebVTT",function(){return A});var Q=R("./src/polyfills/number.ts"),_=R("./src/utils/vttparser.ts"),L=R("./src/demux/id3.ts"),W=R("./src/utils/timescale-conversion.ts"),U=R("./src/remux/mp4-remuxer.ts"),O=/\r\n|\n\r|\n|\r/g,M=function(h,o,s){return s===void 0&&(s=0),h.substr(s,o.length)===o},y=function(h){var o=parseInt(h.substr(-3)),s=parseInt(h.substr(-6,2)),u=parseInt(h.substr(-9,2)),x=h.length>9?parseInt(h.substr(0,h.indexOf(":"))):0;if(!Object(Q.isFiniteNumber)(o)||!Object(Q.isFiniteNumber)(s)||!Object(Q.isFiniteNumber)(u)||!Object(Q.isFiniteNumber)(x))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+h);return o+=1e3*s,o+=60*1e3*u,o+=60*60*1e3*x,o},C=function(h){for(var o=5381,s=h.length;s;)o=o*33^h.charCodeAt(--s);return(o>>>0).toString()};function I(S,h,o){return C(S.toString())+C(h.toString())+C(o)}var w=function(h,o,s){var u=h[o],x=h[u.prevCC];if(!x||!x.new&&u.new){h.ccOffset=h.presentationOffset=u.start,u.new=!1;return}for(;(c=x)!==null&&c!==void 0&&c.new;){var c;h.ccOffset+=u.start-x.start,u.new=!1,u=x,x=h[u.prevCC]}h.presentationOffset=s};function A(S,h,o,s,u,x,c,p){var D=new _.VTTParser,v=Object(L.utf8ArrayToStr)(new Uint8Array(S)).trim().replace(O,`
|
|
`).split(`
|
|
`),f=[],d=Object(W.toMpegTsClockFromTimescale)(h,o),l="00:00.000",a=0,g=0,m,b=!0,P=!1;D.oncue=function(H){var V=s[u],re=s.ccOffset,z=(a-d)/9e4;if(V!=null&&V.new&&(g!==void 0?re=s.ccOffset=V.start:w(s,u,z)),z&&(re=z-s.presentationOffset),P){var F=H.endTime-H.startTime,ae=Object(U.normalizePts)((H.startTime+re-g)*9e4,x*9e4)/9e4;H.startTime=ae,H.endTime=ae+F}var ce=H.text.trim();H.text=decodeURIComponent(encodeURIComponent(ce)),H.id||(H.id=I(H.startTime,H.endTime,ce)),H.endTime>0&&f.push(H)},D.onparsingerror=function(H){m=H},D.onflush=function(){if(m){p(m);return}c(f)},v.forEach(function(H){if(b)if(M(H,"X-TIMESTAMP-MAP=")){b=!1,P=!0,H.substr(16).split(",").forEach(function(V){M(V,"LOCAL:")?l=V.substr(6):M(V,"MPEGTS:")&&(a=parseInt(V.substr(7)))});try{g=y(l)/1e3}catch(V){P=!1,m=V}return}else H===""&&(b=!1);D.parse(H+`
|
|
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(fe,Z,R){"use strict";R.r(Z);var Q=R("./src/utils/logger.ts"),_=R("./src/loader/load-stats.ts"),L=/^age:\s*[\d.]+\s*$/m,W=function(){function U(M){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=M?M.xhrSetup:null,this.stats=new _.LoadStats,this.retryDelay=0}var O=U.prototype;return O.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},O.abortInternal=function(){var y=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),y&&(y.onreadystatechange=null,y.onprogress=null,y.readyState!==4&&(this.stats.aborted=!0,y.abort()))},O.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},O.load=function(y,C,I){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=y,this.config=C,this.callbacks=I,this.retryDelay=C.retryDelay,this.loadInternal()},O.loadInternal=function(){var y=this.config,C=this.context;if(!y)return;var I=this.loader=new self.XMLHttpRequest,w=this.stats;w.loading.first=0,w.loaded=0;var A=this.xhrSetup;try{if(A)try{A(I,C.url)}catch(o){I.open("GET",C.url,!0),A(I,C.url)}I.readyState||I.open("GET",C.url,!0);var S=this.context.headers;if(S)for(var h in S)I.setRequestHeader(h,S[h])}catch(o){this.callbacks.onError({code:I.status,text:o.message},C,I);return}C.rangeEnd&&I.setRequestHeader("Range","bytes="+C.rangeStart+"-"+(C.rangeEnd-1)),I.onreadystatechange=this.readystatechange.bind(this),I.onprogress=this.loadprogress.bind(this),I.responseType=C.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),I.send()},O.readystatechange=function(){var y=this.context,C=this.loader,I=this.stats;if(!y||!C)return;var w=C.readyState,A=this.config;if(I.aborted)return;if(w>=2)if(self.clearTimeout(this.requestTimeout),I.loading.first===0&&(I.loading.first=Math.max(self.performance.now(),I.loading.start)),w===4){C.onreadystatechange=null,C.onprogress=null;var S=C.status;if(S>=200&&S<300){I.loading.end=Math.max(self.performance.now(),I.loading.first);var h,o;if(y.responseType==="arraybuffer"?(h=C.response,o=h.byteLength):(h=C.responseText,o=h.length),I.loaded=I.total=o,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(I,y,h,C),!this.callbacks)return;var u={url:C.responseURL,data:h};this.callbacks.onSuccess(u,I,y,C)}else I.retry>=A.maxRetry||S>=400&&S<499?(Q.logger.error(S+" while loading "+y.url),this.callbacks.onError({code:S,text:C.statusText},y,C)):(Q.logger.warn(S+" while loading "+y.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,A.maxRetryDelay),I.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),A.timeout)},O.loadtimeout=function(){Q.logger.warn("timeout while loading "+this.context.url);var y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))},O.loadprogress=function(y){var C=this.stats;C.loaded=y.loaded,y.lengthComputable&&(C.total=y.total)},O.getCacheAge=function(){var y=null;if(this.loader&&L.test(this.loader.getAllResponseHeaders())){var C=this.loader.getResponseHeader("age");y=C?parseFloat(C):null}return y},U}();Z.default=W}}).default})},vHTk:function(_e,Oe,ee){_e.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},yslc:function(_e,Oe){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAOHklEQVR4Xu1dCXQURRr+emZyTO6D3BCEgKCInCKeK3IoiyIqlxLyQBRBV8DNhCCrS3Z9Cq66KOoi68ECKocCcutTLhUERM1MEpBLEuQmQMKEnDNd+6onEzKTuXqmJ5l0V/EeL+mp+qu+r77UVP1V9TcHffZbIJgOlhgDMmaAA8lTwVDxJQh5UMY4GTSFM8AJ+PW6cIDsBEEfhfPB4MuUAYvQaTowOwV1NXtB0E6mWBksBTNwTeiUBENud/CmHwBEKZgTBl2GDNgKnQIsyBkCM9kEEI0M8TJICmWgqdCFkT17MngsUignDLYMGXAsdAo0XzcPILkyxMwgKZAB50InhIMhZxUIGalAXhhkmTHgXOgU6PG8UFwxbgdBf5nhZnAUxoBroVMyjryQgMraPSDoqDBuGFwZMeBe6MLi9IWuIHW7QUisjLAzKApiwDOhC25H3T3g8TUICVYQPwyqTBjwXOgUsD4nC4RfIhPsDIaCGBAndEHsujwQMkdB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