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.
440 lines
1.1 MiB
440 lines
1.1 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[184,5,7],{"+NIl":function(ot,ge,J){(function(ne){ne(J("VrN/"))})(function(ne){"use strict";ne.defineMode("stex",function($,k){"use strict";function X(u,a){u.cmdState.push(a)}function N(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function U(u){var a=u.cmdState.pop();a&&a.closeBracket()}function G(u){for(var a=u.cmdState,f=a.length-1;f>=0;f--){var l=a[f];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function W(u,a,f){return function(){this.name=u,this.bracketNo=0,this.style=a,this.styles=f,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var i={};i.importmodule=W("importmodule","tag",["string","builtin"]),i.documentclass=W("documentclass","tag",["","atom"]),i.usepackage=W("usepackage","tag",["atom"]),i.begin=W("begin","tag",["atom"]),i.end=W("end","tag",["atom"]),i.label=W("label","tag",["atom"]),i.ref=W("ref","tag",["atom"]),i.eqref=W("eqref","tag",["atom"]),i.cite=W("cite","tag",["atom"]),i.bibitem=W("bibitem","tag",["atom"]),i.Bibitem=W("Bibitem","tag",["atom"]),i.RBibitem=W("RBibitem","tag",["atom"]),i.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(u,a){u.f=a}function g(u,a){var f;if(u.match(/^\\[a-zA-Z@]+/)){var l=u.current().slice(1);return f=i.hasOwnProperty(l)?i[l]:i.DEFAULT,f=new f,X(a,f),D(a,m),f.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return D(a,function(o,s){return d(o,s,"\\]")}),"keyword";if(u.match("\\("))return D(a,function(o,s){return d(o,s,"\\)")}),"keyword";if(u.match("$$"))return D(a,function(o,s){return d(o,s,"$$")}),"keyword";if(u.match("$"))return D(a,function(o,s){return d(o,s,"$")}),"keyword";var h=u.next();if(h=="%")return u.skipToEnd(),"comment";if(h=="}"||h=="]"){if(f=N(a),f)f.closeBracket(h),D(a,m);else return"error";return"bracket"}else return h=="{"||h=="["?(f=i.DEFAULT,f=new f,X(a,f),"bracket"):/\d/.test(h)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),f=G(a),f.name=="begin"&&(f.argument=u.current()),f.styleIdentifier())}function d(u,a,f){if(u.eatSpace())return null;if(f&&u.match(f))return D(a,g),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=u.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(u.skipToEnd(),"comment"):"error"}function m(u,a){var f=u.peek(),l;return f=="{"||f=="["?(l=N(a),l.openBracket(f),u.eat(f),D(a,g),"bracket"):/[ \t\r]/.test(f)?(u.eat(f),null):(D(a,g),U(a),g(u,a))}return{startState:function(){var u=k.inMathMode?function(a,f){return d(a,f)}:g;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,a){return a.f(u,a)},blankLine:function(u){u.f=g,u.cmdState.length=0},lineComment:"%"}}),ne.defineMIME("text/x-stex","stex"),ne.defineMIME("text/x-latex","stex")})},"+ua5":function(ot,ge,J){},"/cxE":function(ot,ge,J){"use strict";J.d(ge,"f",function(){return k}),J.d(ge,"g",function(){return X}),J.d(ge,"h",function(){return N}),J.d(ge,"e",function(){return G}),J.d(ge,"b",function(){return W}),J.d(ge,"c",function(){return i}),J.d(ge,"d",function(){return D}),J.d(ge,"a",function(){return g});class ne{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(d){setTimeout(()=>{throw d.stack?new Error(d.message+`
|
|
|
|
`+d.stack):d},0)}}emit(d){this.listeners.forEach(m=>{m(d)})}onUnexpectedError(d){this.unexpectedErrorHandler(d),this.emit(d)}onUnexpectedExternalError(d){this.unexpectedErrorHandler(d)}}const $=new ne;function k(d){G(d)||$.onUnexpectedError(d);return}function X(d){G(d)||$.onUnexpectedExternalError(d);return}function N(d){if(d instanceof Error){let{name:m,message:u}=d;const a=d.stacktrace||d.stack;return{$isError:!0,name:m,message:u,stack:a}}return d}const U="Canceled";function G(d){return d instanceof Error&&d.name===U&&d.message===U}function W(){const d=new Error(U);return d.name=d.message,d}function i(d){return d?new Error(`Illegal argument: ${d}`):new Error("Illegal argument")}function D(d){return d?new Error(`Illegal state: ${d}`):new Error("Illegal state")}class g extends Error{constructor(d){super("NotSupported");d&&(this.message=d)}}},"19Vz":function(ot,ge,J){(function(ne){ne(J("VrN/"))})(function(ne){ne.defineOption("placeholder","",function(W,i,D){var g=D&&D!=ne.Init;if(i&&!g)W.on("blur",N),W.on("change",U),W.on("swapDoc",U),ne.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){X(W)}),U(W);else if(!i&&g){W.off("blur",N),W.off("change",U),W.off("swapDoc",U),ne.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),$(W);var d=W.getWrapperElement();d.className=d.className.replace(" CodeMirror-empty","")}i&&!W.hasFocus()&&N(W)});function $(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function k(W){$(W);var i=W.state.placeholder=document.createElement("pre");i.style.cssText="height: 0; overflow: visible",i.style.direction=W.getOption("direction"),i.className="CodeMirror-placeholder CodeMirror-line-like";var D=W.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),i.appendChild(D),W.display.lineSpace.insertBefore(i,W.display.lineSpace.firstChild)}function X(W){setTimeout(function(){var i=!1,D=W.getInputField();D.nodeName=="TEXTAREA"?i=!D.value:W.lineCount()==1&&(i=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),i?k(W):$(W)},20)}function N(W){G(W)&&k(W)}function U(W){var i=W.getWrapperElement(),D=G(W);i.className=i.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?k(W):$(W)}function G(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(ot,ge,J){(function(ne){ne(J("VrN/"))})(function(ne){"use strict";var $={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},k={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ne.defineMode("xml",function(X,N){var U=X.indentUnit,G={},W=N.htmlMode?$:k;for(var i in W)G[i]=W[i];for(var i in N)G[i]=N[i];var D,g;function d(p,T){function v(B){return T.tokenize=B,B(p,T)}var y=p.next();if(y=="<")return p.eat("!")?p.eat("[")?p.match("CDATA[")?v(a("atom","]]>")):null:p.match("--")?v(a("comment","-->")):p.match("DOCTYPE",!0,!0)?(p.eatWhile(/[\w\._\-]/),v(f(1))):null:p.eat("?")?(p.eatWhile(/[\w\._\-]/),T.tokenize=a("meta","?>"),"meta"):(D=p.eat("/")?"closeTag":"openTag",T.tokenize=m,"tag bracket");if(y=="&"){var F;return p.eat("#")?p.eat("x")?F=p.eatWhile(/[a-fA-F\d]/)&&p.eat(";"):F=p.eatWhile(/[\d]/)&&p.eat(";"):F=p.eatWhile(/[\w\.\-:]/)&&p.eat(";"),F?"atom":"error"}else return p.eatWhile(/[^&<]/),null}d.isInText=!0;function m(p,T){var v=p.next();if(v==">"||v=="/"&&p.eat(">"))return T.tokenize=d,D=v==">"?"endTag":"selfcloseTag","tag bracket";if(v=="=")return D="equals",null;if(v=="<"){T.tokenize=d,T.state=s,T.tagName=T.tagStart=null;var y=T.tokenize(p,T);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(v)?(T.tokenize=u(v),T.stringStartCol=p.column(),T.tokenize(p,T)):(p.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(p){var T=function(v,y){for(;!v.eol();)if(v.next()==p){y.tokenize=m;break}return"string"};return T.isInAttribute=!0,T}function a(p,T){return function(v,y){for(;!v.eol();){if(v.match(T)){y.tokenize=d;break}v.next()}return p}}function f(p){return function(T,v){for(var y;(y=T.next())!=null;){if(y=="<")return v.tokenize=f(p+1),v.tokenize(T,v);if(y==">")if(p==1){v.tokenize=d;break}else return v.tokenize=f(p-1),v.tokenize(T,v)}return"meta"}}function l(p,T,v){this.prev=p.context,this.tagName=T,this.indent=p.indented,this.startOfLine=v,(G.doNotIndent.hasOwnProperty(T)||p.context&&p.context.noIndent)&&(this.noIndent=!0)}function h(p){p.context&&(p.context=p.context.prev)}function o(p,T){for(var v;;){if(!p.context)return;if(v=p.context.tagName,!G.contextGrabbers.hasOwnProperty(v)||!G.contextGrabbers[v].hasOwnProperty(T))return;h(p)}}function s(p,T,v){return p=="openTag"?(v.tagStart=T.column(),A):p=="closeTag"?_:s}function A(p,T,v){return p=="word"?(v.tagName=T.current(),g="tag",R):G.allowMissingTagName&&p=="endTag"?(g="tag bracket",R(p,T,v)):(g="error",A)}function _(p,T,v){if(p=="word"){var y=T.current();return v.context&&v.context.tagName!=y&&G.implicitlyClosed.hasOwnProperty(v.context.tagName)&&h(v),v.context&&v.context.tagName==y||G.matchClosing===!1?(g="tag",w):(g="tag error",L)}else return G.allowMissingTagName&&p=="endTag"?(g="tag bracket",w(p,T,v)):(g="error",L)}function w(p,T,v){return p!="endTag"?(g="error",w):(h(v),s)}function L(p,T,v){return g="error",w(p,T,v)}function R(p,T,v){if(p=="word")return g="attribute",C;if(p=="endTag"||p=="selfcloseTag"){var y=v.tagName,F=v.tagStart;return v.tagName=v.tagStart=null,p=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(y)?o(v,y):(o(v,y),v.context=new l(v,y,F==v.indented)),s}return g="error",R}function C(p,T,v){return p=="equals"?S:(G.allowMissing||(g="error"),R(p,T,v))}function S(p,T,v){return p=="string"?x:p=="word"&&G.allowUnquoted?(g="string",R):(g="error",R(p,T,v))}function x(p,T,v){return p=="string"?x:R(p,T,v)}return{startState:function(p){var T={tokenize:d,state:s,indented:p||0,tagName:null,tagStart:null,context:null};return p!=null&&(T.baseIndent=p),T},token:function(p,T){if(!T.tagName&&p.sol()&&(T.indented=p.indentation()),p.eatSpace())return null;D=null;var v=T.tokenize(p,T);return(v||D)&&v!="comment"&&(g=null,T.state=T.state(D||v,p,T),g&&(v=g=="error"?v+" error":g)),v},indent:function(p,T,v){var y=p.context;if(p.tokenize.isInAttribute)return p.tagStart==p.indented?p.stringStartCol+1:p.indented+U;if(y&&y.noIndent)return ne.Pass;if(p.tokenize!=m&&p.tokenize!=d)return v?v.match(/^(\s*)/)[0].length:0;if(p.tagName)return G.multilineTagIndentPastTag!==!1?p.tagStart+p.tagName.length+2:p.tagStart+U*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(T))return 0;var F=T&&/^<(\/)?([\w_:\.-]*)/.exec(T);if(F&&F[1])for(;y;)if(y.tagName==F[2]){y=y.prev;break}else if(G.implicitlyClosed.hasOwnProperty(y.tagName))y=y.prev;else break;else if(F)for(;y;){var B=G.contextGrabbers[y.tagName];if(B&&B.hasOwnProperty(F[2]))y=y.prev;else break}for(;y&&y.prev&&!y.startOfLine;)y=y.prev;return y?y.indent+U:p.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(p){p.state==S&&(p.state=R)},xmlCurrentTag:function(p){return p.tagName?{name:p.tagName,close:p.type=="closeTag"}:null},xmlCurrentContext:function(p){for(var T=[],v=p.context;v;v=v.prev)v.tagName&&T.push(v.tagName);return T.reverse()}}}),ne.defineMIME("text/xml","xml"),ne.defineMIME("application/xml","xml"),ne.mimeModes.hasOwnProperty("text/html")||ne.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(ot,ge,J){"use strict";J.d(ge,"a",function(){return $});class ne{constructor(k){this.element=k,this.next=ne.Undefined,this.prev=ne.Undefined}}ne.Undefined=new ne(void 0);class ${constructor(){this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ne.Undefined}clear(){let k=this._first;for(;k!==ne.Undefined;){const X=k.next;k.prev=ne.Undefined,k.next=ne.Undefined,k=X}this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}unshift(k){return this._insert(k,!1)}push(k){return this._insert(k,!0)}_insert(k,X){const N=new ne(k);if(this._first===ne.Undefined)this._first=N,this._last=N;else if(X){const G=this._last;this._last=N,N.prev=G,G.next=N}else{const G=this._first;this._first=N,N.next=G,G.prev=N}this._size+=1;let U=!1;return()=>{U||(U=!0,this._remove(N))}}shift(){if(this._first===ne.Undefined)return;{const k=this._first.element;return this._remove(this._first),k}}pop(){if(this._last===ne.Undefined)return;{const k=this._last.element;return this._remove(this._last),k}}_remove(k){if(k.prev!==ne.Undefined&&k.next!==ne.Undefined){const X=k.prev;X.next=k.next,k.next.prev=X}else k.prev===ne.Undefined&&k.next===ne.Undefined?(this._first=ne.Undefined,this._last=ne.Undefined):k.next===ne.Undefined?(this._last=this._last.prev,this._last.next=ne.Undefined):k.prev===ne.Undefined&&(this._first=this._first.next,this._first.prev=ne.Undefined);this._size-=1}*[Symbol.iterator](){let k=this._first;for(;k!==ne.Undefined;)yield k.element,k=k.next}}},"3/fG":function(ot,ge,J){"use strict";J.d(ge,"a",function(){return $});function ne(k,X){let N;return X.length===0?N=k:N=k.replace(/\{(\d+)\}/g,function(U,G){const W=G[0];return typeof X[W]!="undefined"?X[W]:U}),N}function $(k,X,...N){return ne(X,N)}},"30zm":function(ot,ge,J){"use strict";var ne=J("jCWc"),$=J("kPKH"),k=J("k1fw"),X=J("tJVT"),N=J("PpiC"),U=J("B9cy"),G=J("Ol7k"),W=J("lUTK"),i=J("BvKs"),D=J("q1tI"),g=J.n(D),d=J("Ty5D"),m=J("55Ip"),u=J("9kvl"),a=J("m3rI"),f=J("kzJb"),l=J.n(f),h=i.a.SubMenu,o=G.a.Sider,s=G.a.Content,A=function(w){var L=w.messages,R=w.globalSetting,C=w.loading,S=w.user,x=w.dispatch,p=Object(N.a)(w,["messages","globalSetting","loading","user","dispatch"]),T=Object(d.i)(),v=S.userInfo,y=Object(d.h)(),F=L.tidingsList,B=L.privateMessage,O=L.unreadInfo,j=Object(D.useState)({per_page:10,page:1}),P=Object(X.a)(j,2),b=P[0],Y=P[1];Object(D.useEffect)(function(){ee()},[T.userId]);var ee=function(){x({type:"messages/unreadMessageInfo",payload:Object(k.a)(Object(k.a)({},b),T)})};return g.a.createElement($.a,{flex:"264px"},g.a.createElement("aside",{className:l.a.userInfo},g.a.createElement("img",{className:"mt40",src:a.a.IMG_SERVER+"/images/"+(v==null?void 0:v.image_url)}),g.a.createElement("p",{className:"font24 mt10"},v==null?void 0:v.username),g.a.createElement("p",{className:"mt20"},v==null?void 0:v.user_identity)),g.a.createElement("ul",{className:l.a.navInfo},g.a.createElement(m.a,{to:"/messages/".concat(v==null?void 0:v.login,"/user_tidings")},g.a.createElement("li",{className:y.pathname.indexOf("user_tidings")>-1&&l.a.actived},"\u6D88\u606F",!!(O!=null&&O.unread_tiding_count)&&g.a.createElement("span",{className:l.a.newTip},O==null?void 0:O.unread_tiding_count))),g.a.createElement(m.a,{to:"/messages/".concat(v==null?void 0:v.login,"/private_messages")},g.a.createElement("li",{className:(y.pathname.indexOf("private_messages")>-1||y.pathname.indexOf("message_detail")>-1)&&l.a.actived},"\u79C1\u4FE1",!!(O!=null&&O.unread_message_count)&&g.a.createElement("span",{className:l.a.newTip},O==null?void 0:O.unread_message_count)))))};ge.a=Object(u.a)(function(_){var w=_.messages,L=_.loading,R=_.user,C=_.globalSetting;return{messages:w,globalSetting:C,user:R,loading:L.effects}})(A)},"55Ip":function(ot,ge,J){"use strict";J.d(ge,"a",function(){return o});var ne=J("Ty5D"),$=J("dI71"),k=J("q1tI"),X=J.n(k),N=J("YS25"),U=J("17x9"),G=J.n(U),W=J("wx14"),i=J("zLVn"),D=J("9R94"),g=function(S){Object($.a)(x,S);function x(){for(var T,v=arguments.length,y=new Array(v),F=0;F<v;F++)y[F]=arguments[F];return T=S.call.apply(S,[this].concat(y))||this,T.history=Object(N.a)(T.props),T}var p=x.prototype;return p.render=function(){return X.a.createElement(ne.c,{history:this.history,children:this.props.children})},x}(X.a.Component),d=function(S){Object($.a)(x,S);function x(){for(var T,v=arguments.length,y=new Array(v),F=0;F<v;F++)y[F]=arguments[F];return T=S.call.apply(S,[this].concat(y))||this,T.history=Object(N.b)(T.props),T}var p=x.prototype;return p.render=function(){return X.a.createElement(ne.c,{history:this.history,children:this.props.children})},x}(X.a.Component),m=function(x,p){return typeof x=="function"?x(p):x},u=function(x,p){return typeof x=="string"?Object(N.c)(x,null,null,p):x},a=function(x){return x},f=X.a.forwardRef;typeof f=="undefined"&&(f=a);function l(S){return!!(S.metaKey||S.altKey||S.ctrlKey||S.shiftKey)}var h=f(function(S,x){var p=S.innerRef,T=S.navigate,v=S.onClick,y=Object(i.a)(S,["innerRef","navigate","onClick"]),F=y.target,B=Object(W.a)({},y,{onClick:function(j){try{v&&v(j)}catch(P){throw j.preventDefault(),P}!j.defaultPrevented&&j.button===0&&(!F||F==="_self")&&!l(j)&&(j.preventDefault(),T())}});return a!==f?B.ref=x||p:B.ref=p,X.a.createElement("a",B)}),o=f(function(S,x){var p=S.component,T=p===void 0?h:p,v=S.replace,y=S.to,F=S.innerRef,B=Object(i.a)(S,["component","replace","to","innerRef"]);return X.a.createElement(ne.e.Consumer,null,function(O){O||Object(D.a)(!1);var j=O.history,P=u(m(y,O.location),O.location),b=P?j.createHref(P):"",Y=Object(W.a)({},B,{href:b,navigate:function(){var ae=m(y,O.location),le=v?j.replace:j.push;le(ae)}});return a!==f?Y.ref=x||F:Y.innerRef=F,X.a.createElement(T,Y)})});if(!1)var s,A;var _=function(x){return x},w=X.a.forwardRef;typeof w=="undefined"&&(w=_);function L(){for(var S=arguments.length,x=new Array(S),p=0;p<S;p++)x[p]=arguments[p];return x.filter(function(T){return T}).join(" ")}var R=w(function(S,x){var p=S["aria-current"],T=p===void 0?"page":p,v=S.activeClassName,y=v===void 0?"active":v,F=S.activeStyle,B=S.className,O=S.exact,j=S.isActive,P=S.location,b=S.sensitive,Y=S.strict,ee=S.style,ae=S.to,le=S.innerRef,Re=Object(i.a)(S,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return X.a.createElement(ne.e.Consumer,null,function(Ee){Ee||Object(D.a)(!1);var Te=P||Ee.location,Ae=u(m(ae,Te),Te),Oe=Ae.pathname,ce=Oe&&Oe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ue=ce?Object(ne.f)(Te.pathname,{path:ce,exact:O,sensitive:b,strict:Y}):null,Pe=!!(j?j(ue,Te):ue),qe=Pe?L(B,y):B,ze=Pe?Object(W.a)({},ee,{},F):ee,et=Object(W.a)({"aria-current":Pe&&T||null,className:qe,style:ze,to:Ae},Re);return _!==w?et.ref=x||le:et.innerRef=le,X.a.createElement(o,et)})});if(!1)var C},"5VLF":function(ot,ge,J){"use strict";var ne,$;function k(X,N,U){var G=function(W,i){return X.js_beautify(W,i)};return G.js=X.js_beautify,G.css=N.css_beautify,G.html=U.html_beautify,G.js_beautify=X.js_beautify,G.css_beautify=N.css_beautify,G.html_beautify=U.html_beautify,G}!(ne=[J("6UM0"),J("TXwP"),J("psGv")],$=function(X,N,U){return k(X,N,U)}.apply(ge,ne),$!==void 0&&(ot.exports=$))},"5Y4S":function(ot,ge,J){"use strict";J.d(ge,"a",function(){return k});var ne=J("MNsG");const $=ne.b.performance&&typeof ne.b.performance.now=="function";class k{constructor(X){this._highResolution=$&&X,this._startTime=this._now(),this._stopTime=-1}static create(X=!0){return new k(X)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ne.b.performance.now():Date.now()}}},"6UM0":function(ot,ge,J){var ne,$;(function(){var k;(function(){"use strict";var N=[function(i,D,g){var d=g(1).Beautifier,m=g(5).Options;function u(a,f){var l=new d(a,f);return l.beautify()}i.exports=u,i.exports.defaultOptions=function(){return new m}},function(i,D,g){var d=g(2).Output,m=g(3).Token,u=g(4),a=g(5).Options,f=g(7).Tokenizer,l=g(7).line_starters,h=g(7).positionable_operators,o=g(7).TOKEN;function s(b,Y){return Y.indexOf(b)!==-1}function A(b){return b.replace(/^\s+/g,"")}function _(b){for(var Y={},ee=0;ee<b.length;ee++)Y[b[ee].replace(/-/g,"_")]=b[ee];return Y}function w(b,Y){return b&&b.type===o.RESERVED&&b.text===Y}function L(b,Y){return b&&b.type===o.RESERVED&&s(b.text,Y)}var R=["case","return","do","if","throw","else","await","break","continue","async"],C=["before-newline","after-newline","preserve-newline"],S=_(C),x=[S.before_newline,S.preserve_newline],p={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function T(b,Y){if(Y.multiline_frame||Y.mode===p.ForInitializer||Y.mode===p.Conditional)return;b.remove_indent(Y.start_line_index)}function v(b){b=b.replace(u.allLineBreaks,`
|
|
`);for(var Y=[],ee=b.indexOf(`
|
|
`);ee!==-1;)Y.push(b.substring(0,ee)),b=b.substring(ee+1),ee=b.indexOf(`
|
|
`);return b.length&&Y.push(b),Y}function y(b){return b===p.ArrayLiteral}function F(b){return s(b,[p.Expression,p.ForInitializer,p.Conditional])}function B(b,Y){for(var ee=0;ee<b.length;ee++){var ae=b[ee].trim();if(ae.charAt(0)!==Y)return!1}return!0}function O(b,Y){for(var ee=0,ae=b.length,le;ee<ae;ee++)if(le=b[ee],le&&le.indexOf(Y)!==0)return!1;return!0}function j(b,Y){Y=Y||{},this._source_text=b||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new a(Y)}j.prototype.create_flags=function(b,Y){var ee=0;b&&(ee=b.indentation_level,!this._output.just_added_newline()&&b.line_indent_level>ee&&(ee=b.line_indent_level));var ae={mode:Y,parent:b,last_token:b?b.last_token:new m(o.START_BLOCK,""),last_word:b?b.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:ee,alignment:0,line_indent_level:b?b.line_indent_level:ee,start_line_index:this._output.get_line_number(),ternary_depth:0};return ae},j.prototype._reset=function(b){var Y=b.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new d(this._options,Y),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(p.BlockStatement);var ee=new f(b,this._options);return this._tokens=ee.tokenize(),b},j.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var b,Y=this._reset(this._source_text),ee=this._options.eol;this._options.eol==="auto"&&(ee=`
|
|
`,Y&&u.lineBreak.test(Y||"")&&(ee=Y.match(u.lineBreak)[0]));for(var ae=this._tokens.next();ae;)this.handle_token(ae),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ae,ae=this._tokens.next();return b=this._output.get_code(ee),b},j.prototype.handle_token=function(b,Y){b.type===o.START_EXPR?this.handle_start_expr(b):b.type===o.END_EXPR?this.handle_end_expr(b):b.type===o.START_BLOCK?this.handle_start_block(b):b.type===o.END_BLOCK?this.handle_end_block(b):b.type===o.WORD?this.handle_word(b):b.type===o.RESERVED?this.handle_word(b):b.type===o.SEMICOLON?this.handle_semicolon(b):b.type===o.STRING?this.handle_string(b):b.type===o.EQUALS?this.handle_equals(b):b.type===o.OPERATOR?this.handle_operator(b):b.type===o.COMMA?this.handle_comma(b):b.type===o.BLOCK_COMMENT?this.handle_block_comment(b,Y):b.type===o.COMMENT?this.handle_comment(b,Y):b.type===o.DOT?this.handle_dot(b):b.type===o.EOF?this.handle_eof(b):b.type===o.UNKNOWN?this.handle_unknown(b,Y):this.handle_unknown(b,Y)},j.prototype.handle_whitespace_and_comments=function(b,Y){var ee=b.newlines,ae=this._options.keep_array_indentation&&y(this._flags.mode);if(b.comments_before)for(var le=b.comments_before.next();le;)this.handle_whitespace_and_comments(le,Y),this.handle_token(le,Y),le=b.comments_before.next();if(ae)for(var Re=0;Re<ee;Re+=1)this.print_newline(Re>0,Y);else if(this._options.max_preserve_newlines&&ee>this._options.max_preserve_newlines&&(ee=this._options.max_preserve_newlines),this._options.preserve_newlines&&ee>1){this.print_newline(!1,Y);for(var Ee=1;Ee<ee;Ee+=1)this.print_newline(!0,Y)}};var P=["async","break","continue","return","throw","yield"];j.prototype.allow_wrap_or_preserved_newline=function(b,Y){if(Y=Y===void 0?!1:Y,this._output.just_added_newline())return;var ee=this._options.preserve_newlines&&b.newlines||Y,ae=s(this._flags.last_token.text,h)||s(b.text,h);if(ae){var le=s(this._flags.last_token.text,h)&&s(this._options.operator_position,x)||s(b.text,h);ee=ee&&le}if(ee)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(L(this._flags.last_token,P))return;this._output.set_wrap_point()}},j.prototype.print_newline=function(b,Y){if(!Y&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==o.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var ee=this._tokens.peek();this._flags.mode===p.Statement&&!(this._flags.if_block&&w(ee,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(b)&&(this._flags.multiline_frame=!0)},j.prototype.print_token_line_indentation=function(b){this._output.just_added_newline()&&(this._options.keep_array_indentation&&b.newlines&&(b.text==="["||y(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(b.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},j.prototype.print_token=function(b){if(this._output.raw){this._output.add_raw_token(b);return}if(this._options.comma_first&&b.previous&&b.previous.type===o.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var Y=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(Y),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(b),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(b),this._output.non_breaking_space=!0,this._output.add_token(b.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},j.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},j.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.set_mode=function(b){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,b),this._flags=this.create_flags(this._previous_flags,b),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},j.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===p.Statement&&T(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.start_of_object_property=function(){return this._flags.parent.mode===p.ObjectLiteral&&this._flags.mode===p.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"]))},j.prototype.start_of_statement=function(b){var Y=!1;return Y=Y||L(this._flags.last_token,["var","let","const"])&&b.type===o.WORD,Y=Y||w(this._flags.last_token,"do"),Y=Y||!(this._flags.parent.mode===p.ObjectLiteral&&this._flags.mode===p.Statement)&&L(this._flags.last_token,P)&&!b.newlines,Y=Y||w(this._flags.last_token,"else")&&!(w(b,"if")&&!b.comments_before),Y=Y||this._flags.last_token.type===o.END_EXPR&&(this._previous_flags.mode===p.ForInitializer||this._previous_flags.mode===p.Conditional),Y=Y||this._flags.last_token.type===o.WORD&&this._flags.mode===p.BlockStatement&&!this._flags.in_case&&!(b.text==="--"||b.text==="++")&&this._last_last_text!=="function"&&b.type!==o.WORD&&b.type!==o.RESERVED,Y=Y||this._flags.mode===p.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"])),Y?(this.set_mode(p.Statement),this.indent(),this.handle_whitespace_and_comments(b,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b,L(b,["do","for","if","while"])),!0):!1},j.prototype.handle_start_expr=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b);var Y=p.Expression;if(b.text==="["){if(this._flags.last_token.type===o.WORD||this._flags.last_token.text===")"){L(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(b),this.set_mode(Y),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}Y=p.ArrayLiteral,y(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),s(this._flags.last_token.type,[o.START_EXPR,o.END_EXPR,o.WORD,o.OPERATOR,o.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===o.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,Y=p.ForInitializer):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,Y=p.Conditional):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&b.whitespace_before===""?this._output.space_before_token=!1:(s(this._flags.last_token.text,l)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b);else if(this._flags.last_token.type===o.WORD){this._output.space_before_token=!1;var ee=this._tokens.peek(-3);if(this._options.space_after_named_function&&ee){var ae=this._tokens.peek(-4);L(ee,["async","function"])||ee.text==="*"&&L(ae,["async","function"])?this._output.space_before_token=!0:this._flags.mode===p.ObjectLiteral?(ee.text==="{"||ee.text===","||ee.text==="*"&&(ae.text==="{"||ae.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(b);(this._flags.last_token.type===o.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===p.ObjectLiteral&&s(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===o.START_BLOCK?this.print_newline():(this._flags.last_token.type===o.END_EXPR||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===o.COMMA)&&this.allow_wrap_or_preserved_newline(b,b.newlines),this.print_token(b),this.set_mode(Y),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},j.prototype.handle_end_expr=function(b){for(;this._flags.mode===p.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(b,b.text==="]"&&y(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===o.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(b),this.restore_mode(),T(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===p.Conditional&&(this._previous_flags.mode=p.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},j.prototype.handle_start_block=function(b){this.handle_whitespace_and_comments(b);var Y=this._tokens.peek(),ee=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===o.END_EXPR?(this.set_mode(p.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(p.BlockStatement):ee&&(s(ee.text,[":",","])&&s(Y.type,[o.STRING,o.WORD,o.RESERVED])||s(Y.text,["get","set","..."])&&s(ee.type,[o.WORD,o.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s(ee.text,[":",","])?this.set_mode(p.BlockStatement):this.set_mode(p.ObjectLiteral):this._flags.last_token.type===o.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(p.BlockStatement):s(this._flags.last_token.type,[o.EQUALS,o.START_EXPR,o.COMMA,o.OPERATOR])||L(this._flags.last_token,["return","throw","import","default"])?this.set_mode(p.ObjectLiteral):this.set_mode(p.BlockStatement),this._flags.last_token&&(L(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ae=!Y.comments_before&&Y.text==="}",le=ae&&this._flags.last_word==="function"&&this._flags.last_token.type===o.END_EXPR;if(this._options.brace_preserve_inline){var Re=0,Ee=null;this._flags.inline_frame=!0;do if(Re+=1,Ee=this._tokens.peek(Re-1),Ee.newlines){this._flags.inline_frame=!1;break}while(Ee.type!==o.EOF&&!(Ee.type===o.END_BLOCK&&Ee.opened===b))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==o.OPERATOR&&(le||this._flags.last_token.type===o.EQUALS||L(this._flags.last_token,R)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(y(this._previous_flags.mode)&&(this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.COMMA)&&((this._flags.last_token.type===o.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(b),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==o.OPERATOR&&this._flags.last_token.type!==o.START_EXPR&&(this._flags.last_token.type===o.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(b),this.indent(),!ae&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},j.prototype.handle_end_block=function(b){for(this.handle_whitespace_and_comments(b);this._flags.mode===p.Statement;)this.restore_mode();var Y=this._flags.last_token.type===o.START_BLOCK;this._flags.inline_frame&&!Y?this._output.space_before_token=!0:this._options.brace_style==="expand"?Y||this.print_newline():Y||(y(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(b)},j.prototype.handle_word=function(b){if(b.type===o.RESERVED){if(s(b.text,["set","get"])&&this._flags.mode!==p.ObjectLiteral)b.type=o.WORD;else if(b.text==="import"&&s(this._tokens.peek().text,["(","."]))b.type=o.WORD;else if(s(b.text,["as","from"])&&!this._flags.import_block)b.type=o.WORD;else if(this._flags.mode===p.ObjectLiteral){var Y=this._tokens.peek();Y.text===":"&&(b.type=o.WORD)}}if(this.start_of_statement(b)?L(this._flags.last_token,["var","let","const"])&&b.type===o.WORD&&(this._flags.declaration_statement=!0):b.newlines&&!F(this._flags.mode)&&(this._flags.last_token.type!==o.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==o.EQUALS&&(this._options.preserve_newlines||!L(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(b),this.print_newline()):this.handle_whitespace_and_comments(b),this._flags.do_block&&!this._flags.do_while)if(w(b,"while")){this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&w(b,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===p.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&L(b,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(b),this._flags.in_case=!0;return}if((this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b)),w(b,"function")){(s(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(s(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===o.OPERATOR))&&(!this._output.just_added_blankline()&&!b.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD?L(this._flags.last_token,["get","set","new","export"])||L(this._flags.last_token,P)?this._output.space_before_token=!0:w(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===o.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(F(this._flags.mode)||y(this._flags.mode))||this.print_newline(),this.print_token(b),this._flags.last_word=b.text;return}var ee="NONE";if(this._flags.last_token.type===o.END_BLOCK?this._previous_flags.inline_frame?ee="SPACE":L(b,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines?ee="NEWLINE":(ee="SPACE",this._output.space_before_token=!0):ee="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&this._flags.mode===p.BlockStatement?ee="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&F(this._flags.mode)?ee="SPACE":this._flags.last_token.type===o.STRING?ee="NEWLINE":this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===p.ObjectLiteral&&s(this._last_last_text,["{",","]))?ee="SPACE":this._flags.last_token.type===o.START_BLOCK?this._flags.inline_frame?ee="SPACE":ee="NEWLINE":this._flags.last_token.type===o.END_EXPR&&(this._output.space_before_token=!0,ee="NEWLINE"),L(b,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?ee="SPACE":ee="NEWLINE"),L(b,["else","catch","finally"]))if((!(this._flags.last_token.type===o.END_BLOCK&&this._previous_flags.mode===p.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ae=this._output.current_line;ae.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else ee==="NEWLINE"?L(this._flags.last_token,R)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&L(b,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==o.END_EXPR?(this._flags.last_token.type!==o.START_EXPR||!L(b,["var","let","const"]))&&this._flags.last_token.text!==":"&&(w(b,"if")&&w(b.previous,"else")?this._output.space_before_token=!0:this.print_newline()):L(b,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&y(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ee==="SPACE"&&(this._output.space_before_token=!0);b.previous&&(b.previous.type===o.WORD||b.previous.type===o.RESERVED)&&(this._output.space_before_token=!0),this.print_token(b),this._flags.last_word=b.text,b.type===o.RESERVED&&(b.text==="do"?this._flags.do_block=!0:b.text==="if"?this._flags.if_block=!0:b.text==="import"?this._flags.import_block=!0:this._flags.import_block&&w(b,"from")&&(this._flags.import_block=!1))},j.prototype.handle_semicolon=function(b){this.start_of_statement(b)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(b);for(var Y=this._tokens.peek();this._flags.mode===p.Statement&&!(this._flags.if_block&&w(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(b)},j.prototype.handle_string=function(b){b.text.startsWith("`")&&b.newlines===0&&b.whitespace_before===""&&(b.previous.text===")"||this._flags.last_token.type===o.WORD)||(this.start_of_statement(b)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(b),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b):b.text.startsWith("`")&&this._flags.last_token.type===o.END_EXPR&&(b.previous.text==="]"||b.previous.text===")")&&b.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(b)},j.prototype.handle_equals=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0},j.prototype.handle_comma=function(b){this.handle_whitespace_and_comments(b,!0),this.print_token(b),this._output.space_before_token=!0,this._flags.declaration_statement?(F(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(b)):this._flags.mode===p.ObjectLiteral||this._flags.mode===p.Statement&&this._flags.parent.mode===p.ObjectLiteral?(this._flags.mode===p.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(b)},j.prototype.handle_operator=function(b){var Y=b.text==="*"&&(L(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[o.START_BLOCK,o.COMMA,o.END_BLOCK,o.SEMICOLON])),ee=s(b.text,["-","+"])&&(s(this._flags.last_token.type,[o.START_BLOCK,o.START_EXPR,o.EQUALS,o.OPERATOR])||s(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(b)){var ae=!Y;this.handle_whitespace_and_comments(b,ae)}if(b.text==="*"&&this._flags.last_token.type===o.DOT){this.print_token(b);return}if(b.text==="::"){this.print_token(b);return}if(this._flags.last_token.type===o.OPERATOR&&s(this._options.operator_position,x)&&this.allow_wrap_or_preserved_newline(b),b.text===":"&&this._flags.in_case){this.print_token(b),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==o.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var le=!0,Re=!0,Ee=!1;if(b.text===":"?this._flags.ternary_depth===0?le=!1:(this._flags.ternary_depth-=1,Ee=!0):b.text==="?"&&(this._flags.ternary_depth+=1),!ee&&!Y&&this._options.preserve_newlines&&s(b.text,h)){var Te=b.text===":",Ae=Te&&Ee,Oe=Te&&!Ee;switch(this._options.operator_position){case S.before_newline:this._output.space_before_token=!Oe,this.print_token(b),(!Te||Ae)&&this.allow_wrap_or_preserved_newline(b),this._output.space_before_token=!0;return;case S.after_newline:this._output.space_before_token=!0,!Te||Ae?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(b):this._output.space_before_token=!1,this.print_token(b),this._output.space_before_token=!0;return;case S.preserve_newline:Oe||this.allow_wrap_or_preserved_newline(b),le=!(this._output.just_added_newline()||Oe),this._output.space_before_token=le,this.print_token(b),this._output.space_before_token=!0;return}}if(Y){this.allow_wrap_or_preserved_newline(b),le=!1;var ce=this._tokens.peek();Re=ce&&s(ce.type,[o.WORD,o.RESERVED])}else if(b.text==="...")this.allow_wrap_or_preserved_newline(b),le=this._flags.last_token.type===o.START_BLOCK,Re=!1;else if(s(b.text,["--","++","!","~"])||ee){if((this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR)&&this.allow_wrap_or_preserved_newline(b),le=!1,Re=!1,b.newlines&&(b.text==="--"||b.text==="++"||b.text==="~")){var ue=L(this._flags.last_token,R)&&b.newlines;ue&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ue,!0)}this._flags.last_token.text===";"&&F(this._flags.mode)&&(le=!0),this._flags.last_token.type===o.RESERVED?le=!0:this._flags.last_token.type===o.END_EXPR?le=!(this._flags.last_token.text==="]"&&(b.text==="--"||b.text==="++")):this._flags.last_token.type===o.OPERATOR&&(le=s(b.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(b.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(Re=!0)),(this._flags.mode===p.BlockStatement&&!this._flags.inline_frame||this._flags.mode===p.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||le,this.print_token(b),this._output.space_before_token=Re},j.prototype.handle_block_comment=function(b,Y){if(this._output.raw){this._output.add_raw_token(b),b.directives&&b.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(b.directives){this.print_newline(!1,Y),this.print_token(b),b.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(b.text)&&!b.newlines){this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0;return}else this.print_block_commment(b,Y)},j.prototype.print_block_commment=function(b,Y){var ee=v(b.text),ae,le=!1,Re=!1,Ee=b.whitespace_before,Te=Ee.length;if(this.print_newline(!1,Y),this.print_token_line_indentation(b),this._output.add_token(ee[0]),this.print_newline(!1,Y),ee.length>1){for(ee=ee.slice(1),le=B(ee,"*"),Re=O(ee,Ee),le&&(this._flags.alignment=1),ae=0;ae<ee.length;ae++)le?(this.print_token_line_indentation(b),this._output.add_token(A(ee[ae]))):Re&&ee[ae]?(this.print_token_line_indentation(b),this._output.add_token(ee[ae].substring(Te))):(this._output.current_line.set_indent(-1),this._output.add_token(ee[ae])),this.print_newline(!1,Y);this._flags.alignment=0}},j.prototype.handle_comment=function(b,Y){b.newlines?this.print_newline(!1,Y):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(b),this.print_newline(!1,Y)},j.prototype.handle_dot=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),L(this._flags.last_token,R)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(b,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(b)},j.prototype.handle_unknown=function(b,Y){this.print_token(b),b.text[b.text.length-1]===`
|
|
`&&this.print_newline(!1,Y)},j.prototype.handle_eof=function(b){for(;this._flags.mode===p.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b)},i.exports.Beautifier=j},function(i){function D(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var m=new D(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},D.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},D.prototype.has_match=function(m){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(m))return!0;return!1},D.prototype.set_indent=function(m,u){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(m){this.__items.push(m);var u=m.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=m.length-u:this.__character_count+=m.length},D.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function g(m,u){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),u=u||"",m.indent_level>0&&(u=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}g.prototype.get_indent_size=function(m,u){var a=this.__base_string_length;return u=u||0,m<0&&(a=0),a+=m*this.__indent_size,a+=u,a},g.prototype.get_indent_string=function(m,u){var a=this.__base_string;return u=u||0,m<0&&(m=0,a=""),u+=m*this.__indent_size,this.__ensure_cache(u),a+=this.__cache[u],a},g.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var m=this.__cache.length,u=0,a="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,a=new Array(u+1).join(this.__indent_string)),m&&(a+=new Array(m+1).join(" ")),this.__cache.push(a)};function d(m,u){this.__indent_cache=new g(m,u),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}d.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},d.prototype.get_line_number=function(){return this.__lines.length},d.prototype.get_indent_string=function(m,u){return this.__indent_cache.get_indent_string(m,u)},d.prototype.get_indent_size=function(m,u){return this.__indent_cache.get_indent_size(m,u)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(m){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(a=a.replace(/[\n]/g,m)),a},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(m,u){return m=m||0,u=u||0,this.next_line.set_indent(m,u),this.__lines.length>1?(this.current_line.set_indent(m,u),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(m){for(var u=0;u<m.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},d.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},d.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},d.prototype.remove_indent=function(m){for(var u=this.__lines.length;m<u;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},d.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},d.prototype.just_added_newline=function(){return this.current_line.is_empty()},d.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},d.prototype.ensure_empty_line_above=function(m,u){for(var a=this.__lines.length-2;a>=0;){var f=this.__lines[a];if(f.is_empty())break;if(f.item(0).indexOf(m)!==0&&f.item(-1)!==u){this.__lines.splice(a+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},i.exports.Output=d},function(i){function D(g,d,m,u){this.type=g,this.text=d,this.comments_before=null,this.newlines=m||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}i.exports.Token=D},function(i,D){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",d="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",u="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",a="(?:\\\\u[0-9a-fA-F]{4}|["+g+m+"])",f="(?:\\\\u[0-9a-fA-F]{4}|["+d+m+u+"])*";D.identifier=new RegExp(a+f,"g"),D.identifierStart=new RegExp(a),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+d+m+u+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|
|
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(i,D,g){var d=g(6).Options,m=["before-newline","after-newline","preserve-newline"];function u(a){d.call(this,a,"js");var f=this.raw_options.brace_style||null;f==="expand-strict"?this.raw_options.brace_style="expand":f==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var h=0;h<l.length;h++)l[h]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[h];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",m),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}u.prototype=new d,i.exports.Options=u},function(i){function D(m,u){this.raw_options=g(m,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}D.prototype._get_array=function(m,u){var a=this.raw_options[m],f=u||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(f=a.concat()):typeof a=="string"&&(f=a.split(/[^a-zA-Z0-9_\/\-]+/)),f},D.prototype._get_boolean=function(m,u){var a=this.raw_options[m],f=a===void 0?!!u:!!a;return f},D.prototype._get_characters=function(m,u){var a=this.raw_options[m],f=u||"";return typeof a=="string"&&(f=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),f},D.prototype._get_number=function(m,u){var a=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var f=parseInt(a,10);return isNaN(f)&&(f=u),f},D.prototype._get_selection=function(m,u,a){var f=this._get_selection_list(m,u,a);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return f[0]},D.prototype._get_selection_list=function(m,u,a){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[u[0]],!this._is_valid_selection(a,u))throw new Error("Invalid Default Value!");var f=this._get_array(m,a);if(!this._is_valid_selection(f,u))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return f},D.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(a){return u.indexOf(a)===-1})};function g(m,u){var a={};m=d(m);var f;for(f in m)f!==u&&(a[f]=m[f]);if(u&&m[u])for(f in m[u])a[f]=m[u][f];return a}function d(m){var u={},a;for(a in m){var f=a.replace(/-/g,"_");u[f]=m[a]}return u}i.exports.Options=D,i.exports.normalizeOpts=d,i.exports.mergeOpts=g},function(i,D,g){var d=g(8).InputScanner,m=g(9).Tokenizer,u=g(9).TOKEN,a=g(13).Directives,f=g(4),l=g(12).Pattern,h=g(14).TemplatablePattern;function o(B,O){return O.indexOf(B)!==-1}var s={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:u.START,RAW:u.RAW,EOF:u.EOF},A=new a(/\/\*/,/\*\//),_=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,w=/[0-9]/,L=/[^\d\.]/,R=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),C=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";C=C.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),C="\\?\\.(?!\\d) "+C,C=C.replace(/ /g,"|");var S=new RegExp(C),x="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),p=x.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),T=new RegExp("^(?:"+p.join("|")+")$"),v,y=function(B,O){m.call(this,B,O),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var j=new l(this._input),P=new h(this._input).read_options(this._options);this.__patterns={template:P,identifier:P.starting_with(f.identifier).matching(f.identifierMatch),number:j.matching(_),punct:j.matching(S),comment:j.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:j.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:j.matching(/<!--/),html_comment_end:j.matching(/-->/),include:j.starting_with(/#include/).until_after(f.lineBreak),shebang:j.starting_with(/#!/).until_after(f.lineBreak),xml:j.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:P.until(/['\\\n\r\u2028\u2029]/),double_quote:P.until(/["\\\n\r\u2028\u2029]/),template_text:P.until(/[`\\$]/),template_expression:P.until(/[`}\\]/)}};y.prototype=new m,y.prototype._is_comment=function(B){return B.type===s.COMMENT||B.type===s.BLOCK_COMMENT||B.type===s.UNKNOWN},y.prototype._is_opening=function(B){return B.type===s.START_BLOCK||B.type===s.START_EXPR},y.prototype._is_closing=function(B,O){return(B.type===s.END_BLOCK||B.type===s.END_EXPR)&&O&&(B.text==="]"&&O.text==="["||B.text===")"&&O.text==="("||B.text==="}"&&O.text==="{")},y.prototype._reset=function(){v=!1},y.prototype._get_next_token=function(B,O){var j=null;this._readWhitespace();var P=this._input.peek();return P===null?this._create_token(s.EOF,""):(j=j||this._read_non_javascript(P),j=j||this._read_string(P),j=j||this._read_word(B),j=j||this._read_singles(P),j=j||this._read_comment(P),j=j||this._read_regexp(P,B),j=j||this._read_xml(P,B),j=j||this._read_punctuation(),j=j||this._create_token(s.UNKNOWN,this._input.next()),j)},y.prototype._read_word=function(B){var O;if(O=this.__patterns.identifier.read(),O!=="")return O=O.replace(f.allLineBreaks,`
|
|
`),!(B.type===s.DOT||B.type===s.RESERVED&&(B.text==="set"||B.text==="get"))&&T.test(O)?(O==="in"||O==="of")&&(B.type===s.WORD||B.type===s.STRING)?this._create_token(s.OPERATOR,O):this._create_token(s.RESERVED,O):this._create_token(s.WORD,O);if(O=this.__patterns.number.read(),O!=="")return this._create_token(s.WORD,O)},y.prototype._read_singles=function(B){var O=null;return B==="("||B==="["?O=this._create_token(s.START_EXPR,B):B===")"||B==="]"?O=this._create_token(s.END_EXPR,B):B==="{"?O=this._create_token(s.START_BLOCK,B):B==="}"?O=this._create_token(s.END_BLOCK,B):B===";"?O=this._create_token(s.SEMICOLON,B):B==="."&&L.test(this._input.peek(1))?O=this._create_token(s.DOT,B):B===","&&(O=this._create_token(s.COMMA,B)),O&&this._input.next(),O},y.prototype._read_punctuation=function(){var B=this.__patterns.punct.read();if(B!=="")return B==="="?this._create_token(s.EQUALS,B):B==="?."?this._create_token(s.DOT,B):this._create_token(s.OPERATOR,B)},y.prototype._read_non_javascript=function(B){var O="";if(B==="#"){if(this._is_first_token()&&(O=this.__patterns.shebang.read(),O))return this._create_token(s.UNKNOWN,O.trim()+`
|
|
`);if(O=this.__patterns.include.read(),O)return this._create_token(s.UNKNOWN,O.trim()+`
|
|
`);B=this._input.next();var j="#";if(this._input.hasNext()&&this._input.testChar(w)){do B=this._input.next(),j+=B;while(this._input.hasNext()&&B!=="#"&&B!=="=");return B==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(j+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(j+="{}",this._input.next(),this._input.next())),this._create_token(s.WORD,j)}this._input.back()}else if(B==="<"&&this._is_first_token()){if(O=this.__patterns.html_comment_start.read(),O){for(;this._input.hasNext()&&!this._input.testChar(f.newline);)O+=this._input.next();return v=!0,this._create_token(s.COMMENT,O)}}else if(v&&B==="-"&&(O=this.__patterns.html_comment_end.read(),O))return v=!1,this._create_token(s.COMMENT,O);return null},y.prototype._read_comment=function(B){var O=null;if(B==="/"){var j="";if(this._input.peek(1)==="*"){j=this.__patterns.block_comment.read();var P=A.get_directives(j);P&&P.ignore==="start"&&(j+=A.readIgnored(this._input)),j=j.replace(f.allLineBreaks,`
|
|
`),O=this._create_token(s.BLOCK_COMMENT,j),O.directives=P}else this._input.peek(1)==="/"&&(j=this.__patterns.comment.read(),O=this._create_token(s.COMMENT,j))}return O},y.prototype._read_string=function(B){if(B==="`"||B==="'"||B==='"'){var O=this._input.next();return this.has_char_escapes=!1,B==="`"?O+=this._read_string_recursive("`",!0,"${"):O+=this._read_string_recursive(B),this.has_char_escapes&&this._options.unescape_strings&&(O=F(O)),this._input.peek()===B&&(O+=this._input.next()),O=O.replace(f.allLineBreaks,`
|
|
`),this._create_token(s.STRING,O)}return null},y.prototype._allow_regexp_or_xml=function(B){return B.type===s.RESERVED&&o(B.text,["return","case","throw","else","do","typeof","yield"])||B.type===s.END_EXPR&&B.text===")"&&B.opened.previous.type===s.RESERVED&&o(B.opened.previous.text,["if","while","for"])||o(B.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},y.prototype._read_regexp=function(B,O){if(B==="/"&&this._allow_regexp_or_xml(O)){for(var j=this._input.next(),P=!1,b=!1;this._input.hasNext()&&(P||b||this._input.peek()!==B)&&!this._input.testChar(f.newline);)j+=this._input.peek(),P?P=!1:(P=this._input.peek()==="\\",this._input.peek()==="["?b=!0:this._input.peek()==="]"&&(b=!1)),this._input.next();return this._input.peek()===B&&(j+=this._input.next(),j+=this._input.read(f.identifier)),this._create_token(s.STRING,j)}return null},y.prototype._read_xml=function(B,O){if(this._options.e4x&&B==="<"&&this._allow_regexp_or_xml(O)){var j="",P=this.__patterns.xml.read_match();if(P){for(var b=P[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),Y=b.indexOf("{")===0,ee=0;P;){var ae=!!P[1],le=P[2],Re=!!P[P.length-1]||le.slice(0,8)==="![CDATA[";if(!Re&&(le===b||Y&&le.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ae?--ee:++ee),j+=P[0],ee<=0)break;P=this.__patterns.xml.read_match()}return P||(j+=this._input.match(/[\s\S]*/g)[0]),j=j.replace(f.allLineBreaks,`
|
|
`),this._create_token(s.STRING,j)}}return null};function F(B){for(var O="",j=0,P=new d(B),b=null;P.hasNext();)if(b=P.match(/([\s]|[^\\]|\\\\)+/g),b&&(O+=b[0]),P.peek()==="\\"){if(P.next(),P.peek()==="x")b=P.match(/x([0-9A-Fa-f]{2})/g);else if(P.peek()==="u")b=P.match(/u([0-9A-Fa-f]{4})/g);else{O+="\\",P.hasNext()&&(O+=P.next());continue}if(!b)return B;if(j=parseInt(b[1],16),j>126&&j<=255&&b[0].indexOf("x")===0)return B;if(j>=0&&j<32){O+="\\"+b[0];continue}else j===34||j===39||j===92?O+="\\"+String.fromCharCode(j):O+=String.fromCharCode(j)}return O}y.prototype._read_string_recursive=function(B,O,j){var P,b;B==="'"?b=this.__patterns.single_quote:B==='"'?b=this.__patterns.double_quote:B==="`"?b=this.__patterns.template_text:B==="}"&&(b=this.__patterns.template_expression);for(var Y=b.read(),ee="";this._input.hasNext();){if(ee=this._input.next(),ee===B||!O&&f.newline.test(ee)){this._input.back();break}else ee==="\\"&&this._input.hasNext()?(P=this._input.peek(),P==="x"||P==="u"?this.has_char_escapes=!0:P==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),ee+=this._input.next()):j&&(j==="${"&&ee==="$"&&this._input.peek()==="{"&&(ee+=this._input.next()),j===ee&&(B==="`"?ee+=this._read_string_recursive("}",O,"`"):ee+=this._read_string_recursive("`",O,"${"),this._input.hasNext()&&(ee+=this._input.next())));ee+=b.read(),Y+=ee}return Y},i.exports.Tokenizer=y,i.exports.TOKEN=s,i.exports.positionable_operators=R.slice(),i.exports.line_starters=x.slice()},function(i){var D=RegExp.prototype.hasOwnProperty("sticky");function g(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},g.prototype.peek=function(d){var m=null;return d=d||0,d+=this.__position,d>=0&&d<this.__input_length&&(m=this.__input.charAt(d)),m},g.prototype.__match=function(d,m){d.lastIndex=m;var u=d.exec(this.__input);return u&&!(D&&d.sticky)&&(u.index!==m&&(u=null)),u},g.prototype.test=function(d,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(d,m):!1},g.prototype.testChar=function(d,m){var u=this.peek(m);return d.lastIndex=0,u!==null&&d.test(u)},g.prototype.match=function(d){var m=this.__match(d,this.__position);return m?this.__position+=m[0].length:m=null,m},g.prototype.read=function(d,m,u){var a="",f;return d&&(f=this.match(d),f&&(a+=f[0])),m&&(f||!d)&&(a+=this.readUntil(m,u)),a},g.prototype.readUntil=function(d,m){var u="",a=this.__position;d.lastIndex=this.__position;var f=d.exec(this.__input);return f?(a=f.index,m&&(a+=f[0].length)):a=this.__input_length,u=this.__input.substring(this.__position,a),this.__position=a,u},g.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},g.prototype.get_regexp=function(d,m){var u=null,a="g";return m&&D&&(a="y"),typeof d=="string"&&d!==""?u=new RegExp(d,a):d&&(u=new RegExp(d.source,a)),u},g.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(d){var m=this.__position,u=this.readUntilAfter(d);return this.__position=m,u},g.prototype.lookBack=function(d){var m=this.__position-1;return m>=d.length&&this.__input.substring(m-d.length,m).toLowerCase()===d},i.exports.InputScanner=g},function(i,D,g){var d=g(8).InputScanner,m=g(3).Token,u=g(10).TokenStream,a=g(11).WhitespacePattern,f={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(h,o){this._input=new d(h),this._options=o||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var h,o=new m(f.START,""),s=null,A=[],_=new u;o.type!==f.EOF;){for(h=this._get_next_token(o,s);this._is_comment(h);)_.add(h),h=this._get_next_token(o,s);_.isEmpty()||(h.comments_before=_,_=new u),h.parent=s,this._is_opening(h)?(A.push(s),s=h):s&&this._is_closing(h,s)&&(h.opened=s,s.closed=h,s=A.pop(),h.parent=s),h.previous=o,o.next=h,this.__tokens.add(h),o=h}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(h,o){this._readWhitespace();var s=this._input.read(/.+/g);return s?this._create_token(f.RAW,s):this._create_token(f.EOF,"")},l.prototype._is_comment=function(h){return!1},l.prototype._is_opening=function(h){return!1},l.prototype._is_closing=function(h,o){return!1},l.prototype._create_token=function(h,o){var s=new m(h,o,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},i.exports.Tokenizer=l,i.exports.TOKEN=f},function(i){function D(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position<this.__tokens_length},D.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},D.prototype.peek=function(g){var d=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(d=this.__tokens[g]),d},D.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},i.exports.TokenStream=D},function(i,D,g){var d=g(12).Pattern;function m(u,a){d.call(this,u,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new d,m.prototype.__set_whitespace_patterns=function(u,a){u+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var a=this.__split(this._newline_regexp,u);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return u},m.prototype.matching=function(u,a){var f=this._create();return f.__set_whitespace_patterns(u,a),f._update(),f},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(u,a){u.lastIndex=0;for(var f=0,l=[],h=u.exec(a);h;)l.push(a.substring(f,h.index)),f=h.index+h[0].length,h=u.exec(a);return f<a.length?l.push(a.substring(f,a.length)):l.push(""),l},i.exports.WhitespacePattern=m},function(i){function D(g,d){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,d&&(this._starting_pattern=this._input.get_regexp(d._starting_pattern,!0),this._match_pattern=this._input.get_regexp(d._match_pattern,!0),this._until_pattern=this._input.get_regexp(d._until_pattern),this._until_after=d._until_after)}D.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(g){var d=this._create();return d._until_after=!0,d._until_pattern=this._input.get_regexp(g),d._update(),d},D.prototype.until=function(g){var d=this._create();return d._until_after=!1,d._until_pattern=this._input.get_regexp(g),d._update(),d},D.prototype.starting_with=function(g){var d=this._create();return d._starting_pattern=this._input.get_regexp(g,!0),d._update(),d},D.prototype.matching=function(g){var d=this._create();return d._match_pattern=this._input.get_regexp(g,!0),d._update(),d},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},i.exports.Pattern=D},function(i){function D(g,d){g=typeof g=="string"?g:g.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+d,"g")}D.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(g);m;)d[m[1]]=m[2],m=this.__directive_pattern.exec(g);return d},D.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=D},function(i,D,g){var d=g(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function u(a,f){d.call(this,a,f),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),f&&(this.__template_pattern=this._input.get_regexp(f.__template_pattern),this._excluded=Object.assign(this._excluded,f._excluded),this._disabled=Object.assign(this._disabled,f._disabled));var l=new d(a);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new d,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(a){var f=this._create();return f._disabled[a]=!0,f._update(),f},u.prototype.read_options=function(a){var f=this._create();for(var l in m)f._disabled[l]=a.templating.indexOf(l)===-1;return f._update(),f},u.prototype.exclude=function(a){var f=this._create();return f._excluded[a]=!0,f._update(),f},u.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var f=this._read_template();f;)this._match_pattern?f+=this._input.read(this._match_pattern):f+=this._input.readUntil(this.__template_pattern),a+=f,f=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},u.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},u.prototype._read_template=function(){var a="",f=this._input.peek();if(f==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(a=a||this.__patterns.erb.read())}else f==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},i.exports.TemplatablePattern=u}],U={};function G(i){var D=U[i];if(D!==void 0)return D.exports;var g=U[i]={exports:{}};return N[i](g,g.exports,G),g.exports}var W=G(0);k=W})();var X=k;!(ne=[],$=function(){return{js_beautify:X}}.apply(ge,ne),$!==void 0&&(ot.exports=$))})()},"746U":function(ot,ge,J){"use strict";J.d(ge,"f",function(){return ne}),J.d(ge,"l",function(){return $}),J.d(ge,"k",function(){return k}),J.d(ge,"j",function(){return X}),J.d(ge,"g",function(){return N}),J.d(ge,"m",function(){return U}),J.d(ge,"h",function(){return G}),J.d(ge,"n",function(){return W}),J.d(ge,"c",function(){return i}),J.d(ge,"a",function(){return D}),J.d(ge,"i",function(){return g}),J.d(ge,"o",function(){return d}),J.d(ge,"e",function(){return a}),J.d(ge,"d",function(){return f}),J.d(ge,"p",function(){return l}),J.d(ge,"b",function(){return h});function ne(o){return Array.isArray(o)}function $(o){return typeof o=="string"}function k(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&!(o instanceof RegExp)&&!(o instanceof Date)}function X(o){return typeof o=="number"&&!isNaN(o)}function N(o){return o===!0||o===!1}function U(o){return typeof o=="undefined"}function G(o){return!W(o)}function W(o){return U(o)||o===null}function i(o,s){if(!o)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function D(o){if(W(o))throw new Error("Assertion Failed: argument is undefined or null");return o}function g(o){return typeof o=="function"}function d(o,s){const A=Math.min(o.length,s.length);for(let _=0;_<A;_++)m(o[_],s[_])}function m(o,s){if($(s)){if(typeof o!==s)throw new Error(`argument does not match constraint: typeof ${s}`)}else if(g(s)){try{if(o instanceof s)return}catch(A){}if(!W(o)&&o.constructor===s)return;if(s.length===1&&s.call(void 0,o)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function u(o){let s=[],A=Object.getPrototypeOf(o);for(;Object.prototype!==A;)s=s.concat(Object.getOwnPropertyNames(A)),A=Object.getPrototypeOf(A);return s}function a(o){const s=[];for(const A of u(o))typeof o[A]=="function"&&s.push(A);return s}function f(o,s){const A=w=>function(){const L=Array.prototype.slice.call(arguments,0);return s(w,L)};let _={};for(const w of o)_[w]=A(w);return _}function l(o){return o===null?void 0:o}function h(o,s="Unreachable"){throw new Error(s)}},"7Cbv":function(ot,ge,J){"use strict";var ne=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),$=new Uint8Array(16);function k(){if(!ne)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne($)}var X=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function N(m){return typeof m=="string"&&X.test(m)}for(var U=N,G=[],W=0;W<256;++W)G.push((W+256).toString(16).substr(1));function i(m){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(G[m[u+0]]+G[m[u+1]]+G[m[u+2]]+G[m[u+3]]+"-"+G[m[u+4]]+G[m[u+5]]+"-"+G[m[u+6]]+G[m[u+7]]+"-"+G[m[u+8]]+G[m[u+9]]+"-"+G[m[u+10]]+G[m[u+11]]+G[m[u+12]]+G[m[u+13]]+G[m[u+14]]+G[m[u+15]]).toLowerCase();if(!U(a))throw TypeError("Stringified UUID is invalid");return a}var D=i;function g(m,u,a){m=m||{};var f=m.random||(m.rng||k)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,u){a=a||0;for(var l=0;l<16;++l)u[a+l]=f[l];return u}return D(f)}var d=ge.a=g},"7ahc":function(ot,ge,J){"use strict";J.d(ge,"a",function(){return A});var ne=J("k1fw"),$=J("0Owb"),k=J("+L6B"),X=J("2/Rp"),N=J("y8nQ"),U=J("Vl3Y"),G=J("tJVT"),W=J("OaEy"),i=J("2fM7"),D=J("q1tI"),g=J.n(D),d=J("VrN/"),m=J.n(d),u=J("p77/"),a=J.n(u),f=J("c5Ni"),l=J.n(f),h=i.a.Option,o={labelCol:{span:4},wrapperCol:{span:20}},s={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"]};ge.b=function(_){var w=_.callback,L=_.onCancel,R=Object(D.useState)("python"),C=Object(G.a)(R,2),S=C[0],x=C[1];function p(v){x(s[v][1])}function T(v){w(v)}return g.a.createElement(U.a,Object($.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:T}),g.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(i.a,{onChange:p},Object.keys(s).map(function(v){return g.a.createElement(h,{key:v,value:v},s[v][0])}))),g.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(A,{mode:S})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(X.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function A(_){var w=_.value,L=_.onChange,R=_.mode,C=_.options,S=C===void 0?{}:C,x=Object(D.useRef)(),p=Object(D.useState)(),T=Object(G.a)(p,2),v=T[0],y=T[1];return Object(D.useEffect)(function(){if(v){function F(B){var O=B.getValue();L&&L(O)}return v.on("change",F),function(){v.off("change",F)}}},[v,L]),Object(D.useEffect)(function(){v&&v.setOption("mode",R)},[v,R]),Object(D.useEffect)(function(){v&&((w!==v.getValue()||w==="")&&setTimeout(function(){v.setValue(w||" ")},300))},[v,w]),Object(D.useEffect)(function(){if(x.current&&!v){var F=m.a.fromTextArea(x.current,Object(ne.a)({mode:R,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},S));y(F)}},[x.current,v]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:x}))}},"8EBN":function(ot,ge,J){(function(ne){ne(J("VrN/"))})(function(ne){"use strict";ne.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var $=0;$<ne.modeInfo.length;$++){var k=ne.modeInfo[$];k.mimes&&(k.mime=k.mimes[0])}ne.findModeByMIME=function(X){X=X.toLowerCase();for(var N=0;N<ne.modeInfo.length;N++){var U=ne.modeInfo[N];if(U.mime==X)return U;if(U.mimes){for(var G=0;G<U.mimes.length;G++)if(U.mimes[G]==X)return U}}if(/\+xml$/.test(X))return ne.findModeByMIME("application/xml");if(/\+json$/.test(X))return ne.findModeByMIME("application/json")},ne.findModeByExtension=function(X){X=X.toLowerCase();for(var N=0;N<ne.modeInfo.length;N++){var U=ne.modeInfo[N];if(U.ext){for(var G=0;G<U.ext.length;G++)if(U.ext[G]==X)return U}}},ne.findModeByFileName=function(X){for(var N=0;N<ne.modeInfo.length;N++){var U=ne.modeInfo[N];if(U.file&&U.file.test(X))return U}var G=X.lastIndexOf("."),W=G>-1&&X.substring(G+1,X.length);if(W)return ne.findModeByExtension(W)},ne.findModeByName=function(X){X=X.toLowerCase();for(var N=0;N<ne.modeInfo.length;N++){var U=ne.modeInfo[N];if(U.name.toLowerCase()==X)return U;if(U.alias){for(var G=0;G<U.alias.length;G++)if(U.alias[G].toLowerCase()==X)return U}}}})},"8HAY":function(ot,ge,J){"use strict";J.d(ge,"a",function(){return N}),J.d(ge,"b",function(){return U}),J.d(ge,"d",function(){return G}),J.d(ge,"e",function(){return W}),J.d(ge,"c",function(){return i});var ne=J("MI8n"),$=J("pmY6"),k=J("3/fG"),X=function(D,g,d,m){function u(a){return a instanceof d?a:new d(function(f){f(a)})}return new(d||(d=Promise))(function(a,f){function l(s){try{o(m.next(s))}catch(A){f(A)}}function h(s){try{o(m.throw(s))}catch(A){f(A)}}function o(s){s.done?a(s.value):u(s.value).then(l,h)}o((m=m.apply(D,g||[])).next())})};class N extends $.a{constructor(D,g="",d="",m=!0,u){super();this._onDidChange=this._register(new ne.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=g,this._cssClass=d,this._enabled=m,this._actionCallback=u}get id(){return this._id}get label(){return this._label}set label(D){this._setLabel(D)}_setLabel(D){this._label!==D&&(this._label=D,this._onDidChange.fire({label:D}))}get tooltip(){return this._tooltip||""}set tooltip(D){this._setTooltip(D)}_setTooltip(D){this._tooltip!==D&&(this._tooltip=D,this._onDidChange.fire({tooltip:D}))}get class(){return this._cssClass}set class(D){this._setClass(D)}_setClass(D){this._cssClass!==D&&(this._cssClass=D,this._onDidChange.fire({class:D}))}get enabled(){return this._enabled}set enabled(D){this._setEnabled(D)}_setEnabled(D){this._enabled!==D&&(this._enabled=D,this._onDidChange.fire({enabled:D}))}get checked(){return this._checked}set checked(D){this._setChecked(D)}_setChecked(D){this._checked!==D&&(this._checked=D,this._onDidChange.fire({checked:D}))}run(D,g){return X(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class U extends $.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ne.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ne.b),this.onDidRun=this._onDidRun.event}run(D,g){return X(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let d;try{yield this.runAction(D,g)}catch(m){d=m}this._onDidRun.fire({action:D,error:d})})}runAction(D,g){return X(this,void 0,void 0,function*(){yield D.run(g)})}}class G extends N{constructor(D){super(G.ID,D,D?"separator text":"separator");this.checked=!1,this.enabled=!1}}G.ID="vs.actions.separator";class W{constructor(D,g,d,m){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=g,this.class=m,this._actions=d}get actions(){return this._actions}dispose(){}run(){return X(this,void 0,void 0,function*(){})}}class i extends N{constructor(){super(i.ID,k.a("submenu.empty","(empty)"),void 0,!1)}}i.ID="vs.actions.empty"},"8hTe":function(ot,ge,J){ot.exports={button:"button___1wy9m"}},"9Bee":function(ot,ge,J){"use strict";var ne=J("DYRE"),$=J("zeV3"),k=J("+L6B"),X=J("2/Rp"),N=J("k1fw"),U=J("9og8"),G=J("tJVT"),W=J("WmNS"),i=J.n(W),D=J("q1tI"),g=J.n(D),d=J("vg9a"),m=J("DlQD"),u=J.n(m),a=J("rUJ1");function f(V,E){var I=V.match(/^(\s+)(?:```)/);if(I===null)return E;var H=I[1];return E.split(`
|
|
`).map(function(q){var z=q.match(/^\s+/);if(z===null)return q;var me=Object(G.a)(z,1),je=me[0];return je.length>=H.length?q.slice(H.length):q}).join(`
|
|
`)}var l=[],h=["<ul>"],o=new u.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){l.length=0,h=["<ul>"]}var _={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function w(V,E,I,H){if(E>=V.length||V[E].level<=I)return E;var q=V[E];H.push("<li><a href='#"+q.anchor+"'>"+q.text+"</a>"),E++;var z=[];return E=w(V,E,q.level,z),z.length>0&&(H.push("<ul>"),z.forEach(function(me){H.push(me)}),H.push("</ul>")),H.push("</li>"),E=w(V,E,I,H),E}function L(){return w(l,0,0,h),h.push("</ul>"),h.join("")}var R={heading:function(E){var I=s.exec(E);if(I)return{type:"heading",raw:I[0],depth:I[1].length,text:I[2]}},fences:function(E){var I=this.rules.block.fences.exec(E);if(I){var H=I[0],q=f(H,I[3]||""),z=I[2]?I[2].trim():I[2];if(["latex","katex","math"].indexOf(z)>=0){var me=x(),je=q;q=me,p[me]={type:"block",expression:je}}return{type:"code",raw:H,lang:z,text:q}}}},C=/(?:\${2})([^\n`]+?)(?:\${2})/gi,S=0,x=function(){return"__special_katext_id_".concat(S++,"__")},p={};function T(){return p}function v(){S=0,p={}}function y(V){return V=V.replace(C,function(E,I){var H=x();return p[H]={type:"inline",expression:I},H}),V}var F=o.listitem;o.listitem=function(V){return F(y(V))};var B=o.paragraph;o.paragraph=function(V){return B(y(V))};var O=o.tablecell;o.tablecell=function(V,E){return O(y(V),E)},o.code=function(V,E,I){var H=(E||"").match(/\S*/)[0];return H?["latex","katex","math"].indexOf(H)>=0?"<p class='editormd-tex'>".concat(V,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(E,'">').concat(I?V:Object(a.escape)(V,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(I?V:Object(a.escape)(V,!0))+"</code></pre>"},o.heading=function(V,E,I){var H=this.options.headerPrefix+I.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:H,level:E,text:V}),"<h"+E+' id="'+H+'">'+V+"</h"+E+">"},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:R,renderer:o});var j=u.a,P=J("SJMd"),b=J("ulZh"),Y=J.n(b),ee=J("m3rI"),ae=J("Oy/b"),le=J("p5ED"),Re=J("ErOA");/*! *****************************************************************************
|
|
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 Ee=function(V,E){return(Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,H){I.__proto__=H}||function(I,H){for(var q in H)Object.prototype.hasOwnProperty.call(H,q)&&(I[q]=H[q])})(V,E)};function Te(V,E){function I(){this.constructor=V}Ee(V,E),V.prototype=E===null?Object.create(E):(I.prototype=E.prototype,new I)}function Ae(V,E,I,H){return new(I||(I=Promise))(function(q,z){function me(gt){try{it(H.next(gt))}catch(We){z(We)}}function je(gt){try{it(H.throw(gt))}catch(We){z(We)}}function it(gt){var We;gt.done?q(gt.value):(We=gt.value,We instanceof I?We:new I(function(Tt){Tt(We)})).then(me,je)}it((H=H.apply(V,E||[])).next())})}function Oe(V,E){var I,H,q,z,me={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return z={next:je(0),throw:je(1),return:je(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function je(it){return function(gt){return function(We){if(I)throw new TypeError("Generator is already executing.");for(;me;)try{if(I=1,H&&(q=2&We[0]?H.return:We[0]?H.throw||((q=H.return)&&q.call(H),0):H.next)&&!(q=q.call(H,We[1])).done)return q;switch(H=0,q&&(We=[2&We[0],q.value]),We[0]){case 0:case 1:q=We;break;case 4:return me.label++,{value:We[1],done:!1};case 5:me.label++,H=We[1],We=[0];continue;case 7:We=me.ops.pop(),me.trys.pop();continue;default:if(!(q=me.trys,(q=q.length>0&&q[q.length-1])||We[0]!==6&&We[0]!==2)){me=0;continue}if(We[0]===3&&(!q||We[1]>q[0]&&We[1]<q[3])){me.label=We[1];break}if(We[0]===6&&me.label<q[1]){me.label=q[1],q=We;break}if(q&&me.label<q[2]){me.label=q[2],me.ops.push(We);break}q[2]&&me.ops.pop(),me.trys.pop();continue}We=E.call(V,me)}catch(Tt){We=[6,Tt],H=0}finally{I=q=0}if(5&We[0])throw We[1];return{value:We[0]?We[1]:void 0,done:!0}}([it,gt])}}}function ce(){for(var V=0,E=0,I=arguments.length;E<I;E++)V+=arguments[E].length;var H=Array(V),q=0;for(E=0;E<I;E++)for(var z=arguments[E],me=0,je=z.length;me<je;me++,q++)H[q]=z[me];return H}var ue=function(){function V(){}return V.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},V.setAttributes=function(E,I){for(var H=0,q=I;H<q.length;H++){var z=q[H],me=z[0],je=z[1];E.setAttribute(me,je)}},V.createRect=function(E,I,H){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",E.toString()),q.setAttribute("height",I.toString()),H&&V.setAttributes(q,H),q},V.createLine=function(E,I,H,q,z){var me=document.createElementNS("http://www.w3.org/2000/svg","line");return me.setAttribute("x1",E.toString()),me.setAttribute("y1",I.toString()),me.setAttribute("x2",H.toString()),me.setAttribute("y2",q.toString()),z&&V.setAttributes(me,z),me},V.createPolygon=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","polygon");return H.setAttribute("points",E),I&&V.setAttributes(H,I),H},V.createCircle=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","circle");return H.setAttribute("cx",(E/2).toString()),H.setAttribute("cy",(E/2).toString()),H.setAttribute("r",E.toString()),I&&V.setAttributes(H,I),H},V.createEllipse=function(E,I,H){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(E/2).toString()),q.setAttribute("cy",(I/2).toString()),q.setAttribute("rx",(E/2).toString()),q.setAttribute("ry",(I/2).toString()),H&&V.setAttributes(q,H),q},V.createGroup=function(E){var I=document.createElementNS("http://www.w3.org/2000/svg","g");return E&&V.setAttributes(I,E),I},V.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},V.createMarker=function(E,I,H,q,z,me,je){var it=document.createElementNS("http://www.w3.org/2000/svg","marker");return V.setAttributes(it,[["id",E],["orient",I],["markerWidth",H.toString()],["markerHeight",q.toString()],["refX",z.toString()],["refY",me.toString()]]),it.appendChild(je),it},V.createText=function(E){var I=document.createElementNS("http://www.w3.org/2000/svg","text");return I.setAttribute("x","0"),I.setAttribute("y","0"),E&&V.setAttributes(I,E),I},V.createTSpan=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","tspan");return H.textContent=E,I&&V.setAttributes(H,I),H},V.createImage=function(E){var I=document.createElementNS("http://www.w3.org/2000/svg","image");return E&&V.setAttributes(I,E),I},V.createPoint=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return H.x=E,H.y=I,H},V.createPath=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","path");return H.setAttribute("d",E),I&&V.setAttributes(H,I),H},V}(),Pe=function(){function V(){}return V.addKey=function(E){V.key=E},Object.defineProperty(V,"isLicensed",{get:function(){return!!V.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(V.key)},enumerable:!1,configurable:!0}),V}(),qe=function(){function V(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return V.prototype.rasterize=function(E,I,H){var q=this;return new Promise(function(z){var me=H!==void 0?H:document.createElement("canvas");E===null&&(q.markersOnly=!0,q.naturalSize=!1);var je=document.createElementNS("http://www.w3.org/2000/svg","svg");je.setAttribute("xmlns","http://www.w3.org/2000/svg"),je.setAttribute("width",I.width.baseVal.valueAsString),je.setAttribute("height",I.height.baseVal.valueAsString),je.setAttribute("viewBox","0 0 "+I.viewBox.baseVal.width.toString()+" "+I.viewBox.baseVal.height.toString()),je.innerHTML=I.innerHTML,q.naturalSize===!0?(je.width.baseVal.value=E.naturalWidth,je.height.baseVal.value=E.naturalHeight):q.width!==void 0&&q.height!==void 0&&(je.width.baseVal.value=q.width,je.height.baseVal.value=q.height),me.width=je.width.baseVal.value,me.height=je.height.baseVal.value;var it=je.outerHTML,gt=me.getContext("2d");q.markersOnly!==!0&>.drawImage(E,0,0,me.width,me.height);var We=window.URL,Tt=new Image(me.width,me.height);Tt.setAttribute("crossOrigin","anonymous");var Gt=new Blob([it],{type:"image/svg+xml"}),qt=We.createObjectURL(Gt);Tt.onload=function(){gt.drawImage(Tt,0,0),We.revokeObjectURL(qt);var Hi=me.toDataURL(q.imageType,q.imageQuality);z(Hi)},Tt.src=qt})},V}(),ze=function(){},et=function(){function V(E){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+E+"_"}return Object.defineProperty(V.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(V.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(V.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),V.prototype.addClass=function(E){return this.styleSheet===void 0&&this.addStyleSheet(),E.name=""+this.classNamePrefix+E.localName,this.classes.push(E),this.styleSheet.sheet.insertRule("."+E.name+" {"+E.style+"}",this.styleSheet.sheet.cssRules.length),E},V.prototype.addRule=function(E){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(E),this.styleSheet.sheet.insertRule(E.selector+" {"+E.style+"}",this.styleSheet.sheet.cssRules.length)},V.prototype.addStyleSheet=function(){var E;this.styleSheet=document.createElement("style"),((E=this.styleSheetRoot)!==null&&E!==void 0?E:document.head).appendChild(this.styleSheet),this.addRule(new nt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new nt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new nt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Ie("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Ie("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},V.prototype.removeStyleSheet=function(){var E;this.styleSheet&&(((E=this.styleSheetRoot)!==null&&E!==void 0?E:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},V}(),nt=function(V,E){this.selector=V,this.style=E},Ie=function(V,E){this.localName=V,this.style=E},Me=function(){function V(E,I,H,q,z){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=E,this.displayMode=I,this.markerItems=H,this.uiStyleSettings=q,this.styles=z,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return V.prototype.show=function(E){var I=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=E,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var H=document.createElement("div");H.className=this.toolbarBlockStyleClass.name,H.style.whiteSpace="nowrap",this.uiContainer.appendChild(H),this.addActionButton(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(z){var me=document.createElement("div");me.className=""+I.toolbarButtonStyleClass.name,me.setAttribute("data-type-name",z.typeName),me.innerHTML=z.icon,me.addEventListener("click",function(){I.markerToolbarButtonClicked(me,z)}),I.buttons.push(me),I.markerButtons.push(me)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var q=document.createElement("div");q.className=this.toolbarBlockStyleClass.name,q.style.whiteSpace="nowrap",q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(q),this.addActionButton(q,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(q,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},V.prototype.addButtonClickListener=function(E){this.buttonClickListeners.push(E)},V.prototype.removeButtonClickListener=function(E){this.buttonClickListeners.indexOf(E)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(E),1)},V.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},V.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var E=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var I=0;I<this.markerButtons.length;I++)I<E||I===E&&this.markerButtons.length-1===E?this.markerButtonBlock.appendChild(this.markerButtons[I]):(I===E&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[I]))}},V.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")},V.prototype.resetButtonStyles=function(){var E=this;this.buttons.forEach(function(I){I.className=I.className.replace(E.uiStyleSettings.toolbarButtonStyleColorsClassName?E.uiStyleSettings.toolbarButtonStyleColorsClassName:E.toolbarButtonStyleColorsClass.name,"").trim(),I.className=I.className.replace(E.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?E.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:E.toolbarActiveButtonStyleColorsClass.name,"").trim(),I.className+=" "+(E.uiStyleSettings.toolbarButtonStyleColorsClassName?E.uiStyleSettings.toolbarButtonStyleColorsClassName:E.toolbarButtonStyleColorsClass.name)})},V.prototype.addActionButton=function(E,I,H){var q=this,z=document.createElement("div");switch(z.className=""+this.toolbarButtonStyleClass.name,z.innerHTML=I,z.setAttribute("data-action",H),z.addEventListener("click",function(){q.actionToolbarButtonClicked(z,H)}),H){case"select":z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":z.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":z.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":z.style.fill=this.uiStyleSettings.closeButtonColor}E.appendChild(z),this.buttons.push(z)},V.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ie("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 Ie("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ie("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ie("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 Ie("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var E=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ie("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*E)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*E)+`px;
|
|
padding: `+E+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ie("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ie("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new nt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new nt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},V.prototype.markerToolbarButtonClicked=function(E,I){this.setActiveButton(E),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(H){return H("marker",I)}),this.markerButtonOverflowBlock.style.display="none"},V.prototype.actionToolbarButtonClicked=function(E,I){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(H){return H("action",I)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},V.prototype.setActiveButton=function(E){this.resetButtonStyles(),E.className=E.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),E.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},V.prototype.setActiveMarkerButton=function(E){var I=this.markerButtons.find(function(H){return H.getAttribute("data-type-name")===E});I&&this.setActiveButton(I)},V.prototype.setCurrentMarker=function(E){var I=this;this.currentMarker=E,this.buttons.filter(function(H){return/delete|notes/.test(H.getAttribute("data-action"))}).forEach(function(H){I.currentMarker===void 0?(H.style.fillOpacity="0.4",H.style.pointerEvents="none"):(H.style.fillOpacity="1",H.style.pointerEvents="all")})},V}(),Ge=function(){function V(E,I,H,q){this.panels=[],this.panelButtons=[],this.markerjsContainer=E,this.displayMode=I,this.uiStyleSettings=H,this.styles=q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return V.prototype.addStyles=function(){var E;this.toolboxStyleClass=this.styles.addClass(new Ie("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 Ie("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var I=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ie("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ie("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ie("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 Ie("toolbox-panel-row_colors",`
|
|
background-color: `+((E=this.uiStyleSettings.toolboxBackgroundColor)!==null&&E!==void 0?E:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ie("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
|
|
padding: `+I+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ie("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ie("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new nt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new nt("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},V.prototype.show=function(E){var I;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=E,this.uiContainer.className=this.toolboxStyleClass.name+" "+((I=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},V.prototype.setPanelButtons=function(E){var I,H,q=this;this.panels=E,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((I=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((H=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(z){var me;z.uiStyleSettings=q.uiStyleSettings;var je=document.createElement("div");je.className=q.toolboxButtonStyleClass.name+" "+((me=q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&me!==void 0?me:q.toolboxButtonStyleColorsClass.name),je.innerHTML=z.icon,je.title=z.title,je.addEventListener("click",function(){q.panelButtonClick(z)}),q.panelButtons.push(je),q.buttonRow.appendChild(je)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},V.prototype.panelButtonClick=function(E){var I=this,H=-1;if(E!==this.activePanel){H=this.panels.indexOf(E),this.panelRow.innerHTML="";var q=E.getUi();q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(q),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=E}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){I.displayMode==="inline"?I.panelRow.style.display="none":I.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(z,me){var je,it;z.className=I.toolboxButtonStyleClass.name+" "+(me===H?""+((je=I.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&je!==void 0?je:I.toolboxActiveButtonStyleColorsClass.name):""+((it=I.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&it!==void 0?it:I.toolboxButtonStyleColorsClass.name))})},V}(),se=function(V,E){this.title=V,this.icon=E},be=function(V){function E(I,H,q,z){var me=V.call(this,I,z||'<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 me.colors=[],me.addTransparent=!1,me.colorBoxes=[],me.colors=H,me.currentColor=q,me.setCurrentColor=me.setCurrentColor.bind(me),me.getColorBox=me.getColorBox.bind(me),me}return Te(E,V),E.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.whiteSpace="nowrap",this.colors.forEach(function(q){var z=I.getColorBox(q);H.appendChild(z),I.colorBoxes.push(z)}),H},E.prototype.getColorBox=function(I){var H=this,q=this.uiStyleSettings.toolbarHeight/4,z=this.uiStyleSettings.toolbarHeight-q,me=document.createElement("div");me.style.display="inline-block",me.style.boxSizing="content-box",me.style.width=z-2+"px",me.style.height=z-2+"px",me.style.padding="1px",me.style.marginRight="2px",me.style.marginBottom="2px",me.style.borderWidth="2px",me.style.borderStyle="solid",me.style.borderRadius=(z+2)/2+"px",me.style.borderColor=I===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",me.addEventListener("click",function(){H.setCurrentColor(I,me)});var je=document.createElement("div");return je.style.display="inline-block",je.style.width=z-2+"px",je.style.height=z-2+"px",je.style.backgroundColor=I,je.style.borderRadius=z/2+"px",I==="transparent"&&(je.style.fill=this.uiStyleSettings.toolboxAccentColor,je.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>`),me.appendChild(je),me},E.prototype.setCurrentColor=function(I,H){var q=this;this.currentColor=I,this.colorBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(I)},E}(se),xe=function(){function V(E,I,H){this._state="new",this._isSelected=!1,this._container=E,this._overlayContainer=I,this.globalSettings=H,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(V.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),V.prototype.ownsTarget=function(E){return!1},Object.defineProperty(V.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),V.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},V.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},V.prototype.pointerDown=function(E,I){},V.prototype.dblClick=function(E,I){},V.prototype.manipulate=function(E){},V.prototype.pointerUp=function(E){this.stateChanged()},V.prototype.dispose=function(){},V.prototype.addMarkerVisualToContainer=function(E){this.container.childNodes.length>0?this.container.insertBefore(E,this.container.childNodes[0]):this.container.appendChild(E)},V.prototype.getState=function(){return{typeName:V.typeName,state:this.state,notes:this.notes}},V.prototype.restoreState=function(E){this._state=E.state,this.notes=E.notes},V.prototype.scale=function(E,I){},V.prototype.colorChanged=function(E){this.onColorChanged&&this.onColorChanged(E),this.stateChanged()},V.prototype.fillColorChanged=function(E){this.onFillColorChanged&&this.onFillColorChanged(E),this.stateChanged()},V.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var E=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),E.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(E)&&this.onStateChanged(this)}},V.typeName="MarkerBase",V}(),Se=function(){function V(){this.findGripByVisual=this.findGripByVisual.bind(this)}return V.prototype.findGripByVisual=function(E){return this.topLeft.ownsTarget(E)?this.topLeft:this.topCenter.ownsTarget(E)?this.topCenter:this.topRight.ownsTarget(E)?this.topRight:this.centerLeft.ownsTarget(E)?this.centerLeft:this.centerRight.ownsTarget(E)?this.centerRight:this.bottomLeft.ownsTarget(E)?this.bottomLeft:this.bottomCenter.ownsTarget(E)?this.bottomCenter:this.bottomRight.ownsTarget(E)?this.bottomRight:void 0},V}(),Be=function(){function V(){this.GRIP_SIZE=10,this.visual=ue.createGroup(),this.visual.appendChild(ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ue.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return V.prototype.ownsTarget=function(E){return E===this.visual||E===this.visual.childNodes[0]||E===this.visual.childNodes[1]},V}(),He=function(){function V(){}return V.toITransformMatrix=function(E){return{a:E.a,b:E.b,c:E.c,d:E.d,e:E.e,f:E.f}},V.toSVGMatrix=function(E,I){return E.a=I.a,E.b=I.b,E.c=I.c,E.d=I.d,E.e=I.e,E.f=I.f,E},V}(),Ye=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.left=0,z.top=0,z.width=0,z.height=0,z.defaultSize={x:50,y:20},z.offsetX=0,z.offsetY=0,z.rotationAngle=0,z.CB_DISTANCE=10,z._suppressMarkerCreateEvent=!1,z.container.transform.baseVal.appendItem(ue.createTransform()),z.setupControlBox(),z}return Te(E,V),Object.defineProperty(E.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"visual",{get:function(){return this._visual},set:function(I){this._visual=I;var H=ue.createTransform();this._visual.transform.baseVal.appendItem(H)},enumerable:!1,configurable:!0}),E.prototype.ownsTarget=function(I){return!!V.prototype.ownsTarget.call(this,I)||!!(this.controlGrips.findGripByVisual(I)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(I))},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.left=I.x,this.top=I.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var q=this.unrotatePoint(I);if(this.manipulationStartX=q.x,this.manipulationStartY=q.y,this.offsetX=q.x-this.left,this.offsetY=q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(H),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H)){this.activeGrip=this.rotatorGrip;var z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=z.x-this.width/2,this.top=z.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var me=this.container.transform.baseVal.getItem(0);me.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(me,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},E.prototype.pointerUp=function(I){var H=this.state;V.prototype.pointerUp.call(this,I),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(I),this._state="select",H==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},E.prototype.moveVisual=function(I){this.visual.style.transform="translate("+I.x+"px, "+I.y+"px)"},E.prototype.manipulate=function(I){var H=this.unrotatePoint(I);this.state==="creating"?this.resize(I):this.state==="move"?(this.left=this.manipulationStartLeft+(H.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(H.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(H):this.state==="rotate"&&this.rotate(I)},E.prototype.resize=function(I){var H=this.manipulationStartLeft,q=this.manipulationStartWidth,z=this.manipulationStartTop,me=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:H=this.manipulationStartLeft+I.x-this.manipulationStartX,q=this.manipulationStartWidth+this.manipulationStartLeft-H;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:q=this.manipulationStartWidth+I.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:z=this.manipulationStartTop+I.y-this.manipulationStartY,me=this.manipulationStartHeight+this.manipulationStartTop-z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:me=this.manipulationStartHeight+I.y-this.manipulationStartY}q>=0?(this.left=H,this.width=q):(this.left=H+q,this.width=-q),me>=0?(this.top=z,this.height=me):(this.top=z+me,this.height=-me),this.setSize()},E.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},E.prototype.rotate=function(I){if(Math.abs(I.x-this.centerX)>.1){var H=Math.sign(I.x-this.centerX);this.rotationAngle=180*Math.atan((I.y-this.centerY)/(I.x-this.centerX))/Math.PI+90*H,this.applyRotation()}},E.prototype.applyRotation=function(){var I=this.container.transform.baseVal.getItem(0);I.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(I,0)},E.prototype.rotatePoint=function(I){if(this.rotationAngle===0)return I;var H=this.container.getCTM(),q=ue.createPoint(I.x,I.y);return{x:(q=q.matrixTransform(H)).x,y:q.y}},E.prototype.unrotatePoint=function(I){if(this.rotationAngle===0)return I;var H=this.container.getCTM();H=H.inverse();var q=ue.createPoint(I.x,I.y);return{x:(q=q.matrixTransform(H)).x,y:q.y}},E.prototype.select=function(){V.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},E.prototype.deselect=function(){V.prototype.deselect.call(this),this.controlBox.style.display="none"},E.prototype.setupControlBox=function(){this.controlBox=ue.createGroup();var I=ue.createTransform();I.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(I),this.container.appendChild(this.controlBox),this.controlRect=ue.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=ue.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 Se,this.addControlGrips(),this.controlBox.style.display="none"},E.prototype.adjustControlBox=function(){var I=this.controlBox.transform.baseVal.getItem(0);I.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(I,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()},E.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()},E.prototype.createGrip=function(){var I=new Be;return I.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(I.visual),I},E.prototype.positionGrips=function(){var I=this.controlGrips.topLeft.GRIP_SIZE,H=-I/2,q=H,z=(this.width+this.CB_DISTANCE)/2-I/2,me=(this.height+this.CB_DISTANCE)/2-I/2,je=this.height+this.CB_DISTANCE-I/2,it=this.width+this.CB_DISTANCE-I/2;this.positionGrip(this.controlGrips.topLeft.visual,H,q),this.positionGrip(this.controlGrips.topCenter.visual,z,q),this.positionGrip(this.controlGrips.topRight.visual,it,q),this.positionGrip(this.controlGrips.centerLeft.visual,H,me),this.positionGrip(this.controlGrips.centerRight.visual,it,me),this.positionGrip(this.controlGrips.bottomLeft.visual,H,je),this.positionGrip(this.controlGrips.bottomCenter.visual,z,je),this.positionGrip(this.controlGrips.bottomRight.visual,it,je),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,z,q-3*this.CB_DISTANCE)},E.prototype.positionGrip=function(I,H,q){var z=I.transform.baseVal.getItem(0);z.setTranslate(H,q),I.transform.baseVal.replaceItem(z,0)},E.prototype.hideControlBox=function(){this.controlBox.style.display="none"},E.prototype.showControlBox=function(){this.controlBox.style.display=""},E.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:He.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:He.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},V.prototype.getState.call(this))},E.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.left=H.left,this.top=H.top,this.width=H.width,this.height=H.height,this.rotationAngle=H.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(He.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,H.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(He.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,H.containerTransformMatrix))},E.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H);var q=this.rotatePoint({x:this.left,y:this.top}),z=this.unrotatePoint({x:q.x*I,y:q.y*H});this.left=z.x,this.top=z.y,this.width=this.width*I,this.height=this.height*H,this.adjustControlBox()},E}(xe),Ve=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.createVisual=z.createVisual.bind(z),z}return Te(E,V),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual)},E.prototype.createVisual=function(){this.visual=ue.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)},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},E.prototype.manipulate=function(I){V.prototype.manipulate.call(this,I)},E.prototype.resize=function(I){V.prototype.resize.call(this,I),this.setSize()},E.prototype.setSize=function(){V.prototype.setSize.call(this),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},E.prototype.pointerUp=function(I){V.prototype.pointerUp.call(this,I),this.setSize()},E.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},E.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},E.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},E.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},E.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},V.prototype.getState.call(this))},E.prototype.restoreState=function(I){var H=I;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},E.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.setSize()},E.title="Rectangle marker",E}(Ye),lt=function(V){function E(I,H,q,z){var me=V.call(this,I,z||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return me.widths=[],me.widthBoxes=[],me.widths=H,me.currentWidth=q,me.setCurrentWidth=me.setCurrentWidth.bind(me),me}return Te(E,V),E.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.widths.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.flexGrow="2",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=q===I.currentWidth?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentWidth(q,z)}),H.appendChild(z);var me=document.createElement("div");me.innerText=q.toString(),me.style.marginRight="5px",z.appendChild(me);var je=document.createElement("div");je.style.minHeight="20px",je.style.flexGrow="2",je.style.display="flex",je.style.alignItems="center";var it=document.createElement("hr");it.style.minWidth="20px",it.style.border="0px",it.style.borderTop=q+"px solid "+I.uiStyleSettings.toolboxColor,it.style.flexGrow="2",je.appendChild(it),z.appendChild(je),I.widthBoxes.push(z)}),H},E.prototype.setCurrentWidth=function(I,H){var q=this;this.currentWidth=I,this.widthBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},E}(se),$e=function(V){function E(I,H,q,z){var me=V.call(this,I,z||'<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 me.styles=[],me.styleBoxes=[],me.styles=H,me.currentStyle=q,me.setCurrentStyle=me.setCurrentStyle.bind(me),me}return Te(E,V),E.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.styles.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/I.styles.length-5+"%",z.style.borderColor=q===I.currentStyle?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentStyle(q,z)}),H.appendChild(z);var me=document.createElement("div");me.style.minHeight="20px",me.style.flexGrow="2",me.style.overflow="hidden";var je=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+I.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(q!==""?'stroke-dasharray="'+q+'"':"")+` />
|
|
</svg>`;me.innerHTML=je,z.appendChild(me),I.styleBoxes.push(z)}),H},E.prototype.setCurrentStyle=function(I,H){var q=this;this.currentStyle=I,this.styleBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},E}(se),Qe=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new be("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new lt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new $e("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Te(E,V),Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=E.typeName,I},E.typeName="FrameMarker",E.title="Frame marker",E.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',E}(Ve),De=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},ct=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.x1=0,z.y1=0,z.x2=0,z.y2=0,z.defaultLength=50,z.manipulationStartX=0,z.manipulationStartY=0,z.manipulationStartX1=0,z.manipulationStartY1=0,z.manipulationStartX2=0,z.manipulationStartY2=0,z.setupControlBox(),z}return Te(E,V),E.prototype.ownsTarget=function(I){return!!V.prototype.ownsTarget.call(this,I)||!(!this.grip1.ownsTarget(I)&&!this.grip2.ownsTarget(I))},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.manipulationStartX=I.x,this.manipulationStartY=I.y,this.state==="new"&&(this.x1=I.x,this.y1=I.y,this.x2=I.x,this.y2=I.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(H)?this.activeGrip=this.grip1:this.grip2.ownsTarget(H)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},E.prototype.pointerUp=function(I){var H=this.state;V.prototype.pointerUp.call(this,I),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(I),this._state="select",H==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},E.prototype.adjustVisual=function(){},E.prototype.manipulate=function(I){this.state==="creating"?this.resize(I):this.state==="move"?(this.x1=this.manipulationStartX1+I.x-this.manipulationStartX,this.y1=this.manipulationStartY1+I.y-this.manipulationStartY,this.x2=this.manipulationStartX2+I.x-this.manipulationStartX,this.y2=this.manipulationStartY2+I.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(I)},E.prototype.resize=function(I){switch(this.activeGrip){case this.grip1:this.x1=I.x,this.y1=I.y;break;case this.grip2:case void 0:this.x2=I.x,this.y2=I.y}this.adjustVisual(),this.adjustControlBox()},E.prototype.select=function(){V.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},E.prototype.deselect=function(){V.prototype.deselect.call(this),this.controlBox.style.display="none"},E.prototype.setupControlBox=function(){this.controlBox=ue.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},E.prototype.adjustControlBox=function(){this.positionGrips()},E.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},E.prototype.createGrip=function(){var I=new Be;return I.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(I.visual),I},E.prototype.positionGrips=function(){var I=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-I/2,this.y1-I/2),this.positionGrip(this.grip2.visual,this.x2-I/2,this.y2-I/2)},E.prototype.positionGrip=function(I,H,q){var z=I.transform.baseVal.getItem(0);z.setTranslate(H,q),I.transform.baseVal.replaceItem(z,0)},E.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},V.prototype.getState.call(this))},E.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.x1=H.x1,this.y1=H.y1,this.x2=H.x2,this.y2=H.y2},E.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.x1=this.x1*I,this.y1=this.y1*H,this.x2=this.x2*I,this.y2=this.y2*H,this.adjustVisual(),this.adjustControlBox()},E}(xe),ut=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new be("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new lt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new $e("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Te(E,V),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorLine&&I!==this.visibleLine)},E.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ue.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)},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},E.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()),ue.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},E.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},E.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},E.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},V.prototype.getState.call(this));return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.createVisual(),this.adjustVisual()},E.typeName="LineMarker",E.title="Line marker",E.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',E}(ct),ke=function(V){function E(I,H,q,z){var me=V.call(this,I,z||'<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 me.fonts=[],me.fontBoxes=[],me.fonts=H,me.currentFont=q,me.setCurrentFont=me.setCurrentFont.bind(me),me}return Te(E,V),E.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.flexGrow="2",this.fonts.forEach(function(q){var z=document.createElement("div");z.style.display="inline-block",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/I.fonts.length-5+"%",z.style.borderColor=q===I.currentFont?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentFont(q,z)}),H.appendChild(z);var me=document.createElement("div");me.style.display="flex",me.style.minHeight="20px",me.style.flexGrow="2",me.style.fontFamily=q,me.style.overflow="hidden";var je=document.createElement("div");je.style.whiteSpace="nowrap",je.style.overflow="hidden",je.style.textOverflow="ellipsis",je.innerHTML="The quick brown fox jumps over the lazy dog",me.appendChild(je),z.appendChild(me),I.fontBoxes.push(z)}),H},E.prototype.setCurrentFont=function(I,H){var q=this;this.currentFont=I,this.fontBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},E}(se),Ne=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.color="transparent",z.padding=5,z.DEFAULT_TEXT="your text here",z.text=z.DEFAULT_TEXT,z.isMoved=!1,z.color=q.defaultColor,z.fontFamily=q.defaultFontFamily,z.defaultSize={x:100,y:30},z.setColor=z.setColor.bind(z),z.setFont=z.setFont.bind(z),z.renderText=z.renderText.bind(z),z.sizeText=z.sizeText.bind(z),z.textEditDivClicked=z.textEditDivClicked.bind(z),z.showTextEditor=z.showTextEditor.bind(z),z.setSize=z.setSize.bind(z),z.positionTextEditor=z.positionTextEditor.bind(z),z.colorPanel=new be("Color",q.defaultColorSet,q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.fontFamilyPanel=new ke("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z}return Te(E,V),E.prototype.ownsTarget=function(I){if(V.prototype.ownsTarget.call(this,I)||I===this.visual||I===this.textElement||I===this.bgRectangle)return!0;var H=!1;return this.textElement.childNodes.forEach(function(q){q===I&&(H=!0)}),H},E.prototype.createVisual=function(){this.visual=ue.createGroup(),this.bgRectangle=ue.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ue.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.isMoved=!1,this.pointerDownPoint=I,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},E.prototype.renderText=function(){var I=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(H){I.textElement.appendChild(ue.createTSpan(H.trim()===""?" ":H.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},E.prototype.getTextScale=function(){var I=this.textElement.getBBox(),H=1;if(I.width>0&&I.height>0){var q=(1*this.width-this.width*this.padding*2/100)/I.width,z=(1*this.height-this.height*this.padding*2/100)/I.height;H=Math.min(q,z)}return H},E.prototype.getTextPosition=function(I){var H=this.textElement.getBBox(),q=0,z=0;return H.width>0&&H.height>0&&(q=(this.width-H.width*I)/2,z=this.height/2-H.height*I/2),{x:q,y:z}},E.prototype.sizeText=function(){var I=this.textElement.getBBox(),H=this.getTextScale(),q=this.getTextPosition(H);q.y-=I.y*H,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+q.x+"px, "+q.y+"px) scale("+H+", "+H+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(q.x,q.y),this.textElement.transform.baseVal.getItem(1).setScale(H,H))},E.prototype.manipulate=function(I){V.prototype.manipulate.call(this,I),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(I.x-this.pointerDownPoint.x)>5||Math.abs(I.y-this.pointerDownPoint.y)>5)},E.prototype.resize=function(I){V.prototype.resize.call(this,I),this.isMoved=!0,this.setSize(),this.sizeText()},E.prototype.setSize=function(){V.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},E.prototype.pointerUp=function(I){var H=this.state;H==="creating"&&(this._suppressMarkerCreateEvent=!0),V.prototype.pointerUp.call(this,I),this.setSize(),(H==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},E.prototype.showTextEditor=function(){var I=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(H){H.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var H=Number.parseFloat(I.textEditor.style.fontSize);I.textEditor.clientWidth>=Number.parseInt(I.textEditor.style.maxWidth)&&H>.9;)H-=.1,I.textEditor.style.fontSize=Math.max(H,.9)+"em"}),this.textEditor.addEventListener("keyup",function(H){H.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(H){if(H.clipboardData){var q=H.clipboardData.getData("text"),z=window.getSelection();if(!z.rangeCount)return!1;z.deleteFromDocument(),z.getRangeAt(0).insertNode(document.createTextNode(q)),H.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){I.textEditDivClicked(I.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},E.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var I=this.getTextScale(),H=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),q=this.textElement.getBBox(),z={x:q.width*I,y:q.height*I};H.x-=z.x/2,H.y-=z.y/2,this.textEditor.style.top=H.y+"px",this.textEditor.style.left=H.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-H.x+"px",this.textEditor.style.fontSize=Math.max(16*I,12)+"px",this.textElement.style.display="none"}},E.prototype.textEditDivClicked=function(I){this.text=I.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},E.prototype.select=function(){V.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},E.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),V.prototype.deselect.call(this)},E.prototype.dblClick=function(I,H){V.prototype.dblClick.call(this,I,H),this.showTextEditor()},E.prototype.setColor=function(I){this.textElement&&ue.setAttributes(this.textElement,[["fill",I]]),this.color=I,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(I)},E.prototype.setFont=function(I){this.textElement&&ue.setAttributes(this.textElement,[["font-family",I]]),this.fontFamily=I,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},E.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},E.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},V.prototype.getState.call(this));return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){var H=I;this.color=H.color,this.fontFamily=H.fontFamily,this.padding=H.padding,this.text=H.text,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},E.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.setSize(),this.sizeText(),this.positionTextEditor()},E.typeName="TextMarker",E.title="Text marker",E.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>',E}(Ye),_e=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.color="transparent",z.lineWidth=3,z.drawing=!1,z.pixelRatio=1,z.color=q.defaultColor,z.lineWidth=q.defaultStrokeWidth,z.pixelRatio=q.freehandPixelRatio,z.setColor=z.setColor.bind(z),z.addCanvas=z.addCanvas.bind(z),z.finishCreation=z.finishCreation.bind(z),z.setLineWidth=z.setLineWidth.bind(z),z.colorPanel=new be("Color",q.defaultColorSet,q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.lineWidthPanel=new lt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.lineWidthPanel.onWidthChanged=z.setLineWidth,z}return Te(E,V),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.drawingImage)},E.prototype.createVisual=function(){this.visual=ue.createGroup(),this.drawingImage=ue.createImage(),this.visual.appendChild(this.drawingImage);var I=ue.createTransform();this.visual.transform.baseVal.appendItem(I),this.addMarkerVisualToContainer(this.visual)},E.prototype.pointerDown=function(I,H){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(I.x,I.y),this.drawing=!0):V.prototype.pointerDown.call(this,I,H)},E.prototype.manipulate=function(I){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(I.x,I.y),this.canvasContext.stroke()):V.prototype.manipulate.call(this,I)},E.prototype.resize=function(I){V.prototype.resize.call(this,I),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},E.prototype.pointerUp=function(I){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):V.prototype.pointerUp.call(this,I)},E.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)},E.prototype.select=function(){this.state==="creating"&&this.finishCreation(),V.prototype.select.call(this)},E.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),V.prototype.deselect.call(this)},E.prototype.finishCreation=function(){for(var I=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),H=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],q=H[0],z=H[1],me=H[2],je=H[3],it=!1,gt=0;gt<this.canvasElement.height;gt++)for(var We=0;We<this.canvasElement.width;We++)I.data[gt*this.canvasElement.width*4+4*We+3]>0&&(it=!0,gt<z&&(z=gt),We<q&&(q=We),gt>je&&(je=gt),We>me&&(me=We));if(it){this.left=q/this.pixelRatio,this.top=z/this.pixelRatio,this.width=(me-q)/this.pixelRatio,this.height=(je-z)/this.pixelRatio;var Tt=document.createElement("canvas");Tt.width=me-q,Tt.height=je-z,Tt.getContext("2d").putImageData(this.canvasContext.getImageData(q,z,me-q,je-z),0,0),this.drawingImgUrl=Tt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},E.prototype.setDrawingImage=function(){ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},E.prototype.setColor=function(I){this.color=I,this.colorChanged(I)},E.prototype.setLineWidth=function(I){this.lineWidth=I},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=Object.assign({drawingImgUrl:this.drawingImgUrl},V.prototype.getState.call(this));return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){this.createVisual(),V.prototype.restoreState.call(this,I),this.drawingImgUrl=I.drawingImgUrl,this.setDrawingImage()},E.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.setDrawingImage()},E.typeName="FreehandMarker",E.title="Freehand marker",E.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>',E}(Ye),fe=function(V){function E(I,H,q){var z=V.call(this,I,q||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return z.typeBoxes=[],z.currentType=H,z.setCurrentType=z.setCurrentType.bind(z),z}return Te(E,V),E.prototype.getUi=function(){var I=this,H=document.createElement("div");H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2";for(var q=function(je){var it="both";switch(je){case 0:it="both";break;case 1:it="start";break;case 2:it="end";break;case 3:it="none"}var gt=document.createElement("div");if(gt.style.display="flex",gt.style.flexGrow="2",gt.style.alignItems="center",gt.style.justifyContent="space-between",gt.style.padding="5px",gt.style.borderWidth="2px",gt.style.borderStyle="solid",gt.style.borderColor=it===z.currentType?z.uiStyleSettings.toolboxAccentColor:"transparent",gt.addEventListener("click",function(){I.setCurrentType(it,gt)}),H.appendChild(gt),it==="both"||it==="start"){var We=document.createElement("div");We.style.display="flex",We.style.alignItems="center",We.style.minHeight="20px",We.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,We.style.marginLeft="5px",gt.appendChild(We)}var Tt=document.createElement("div");Tt.style.display="flex",Tt.style.alignItems="center",Tt.style.minHeight="20px",Tt.style.flexGrow="2";var Gt=document.createElement("hr");if(Gt.style.minWidth="20px",Gt.style.border="0px",Gt.style.borderTop="3px solid "+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee"),Gt.style.flexGrow="2",Tt.appendChild(Gt),gt.appendChild(Tt),it==="both"||it==="end"){var qt=document.createElement("div");qt.style.display="flex",qt.style.alignItems="center",qt.style.minHeight="20px",qt.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="`+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,qt.style.marginRight="5px",gt.appendChild(qt)}z.typeBoxes.push(gt)},z=this,me=0;me<4;me++)q(me);return H},E.prototype.setCurrentType=function(I,H){var q=this;this.currentType=I,this.typeBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},E}(se),ve=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.arrowType="end",z.arrowBaseHeight=10,z.arrowBaseWidth=10,z.getArrowPoints=z.getArrowPoints.bind(z),z.setArrowType=z.setArrowType.bind(z),z.arrowTypePanel=new fe("Arrow type","end"),z.arrowTypePanel.onArrowTypeChanged=z.setArrowType,z}return Te(E,V),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.arrow1&&I!==this.arrow2)},E.prototype.getArrowPoints=function(I,H){var q=this.arrowBaseWidth+2*this.strokeWidth,z=this.arrowBaseHeight+2*this.strokeWidth;return I-q/2+","+(H+z/2)+" "+I+","+(H-z/2)+" "+(I+q/2)+","+(H+z/2)},E.prototype.createTips=function(){this.arrow1=ue.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ue.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow2)},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="creating"&&this.createTips()},E.prototype.adjustVisual=function(){if(V.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",ue.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ue.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var I=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.arrow1.transform.baseVal.getItem(0);H.setRotate(I,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(H,0);var q=this.arrow2.transform.baseVal.getItem(0);q.setRotate(I+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(q,0)}},E.prototype.setArrowType=function(I){this.arrowType=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=Object.assign({arrowType:this.arrowType},V.prototype.getState.call(this));return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.arrowType=H.arrowType,this.createTips(),this.adjustVisual()},E.typeName="ArrowMarker",E.title="Arrow marker",E.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',E}(ut),ie=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.fillColor=q.defaultFillColor,z.strokeWidth=0,z.fillPanel=new be("Color",q.defaultColorSet,q.defaultFillColor),z.fillPanel.onColorChanged=z.setFillColor,z}return Te(E,V),Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=E.typeName,I},E.typeName="CoverMarker",E.title="Cover marker",E.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',E}(Ve),re=function(V){function E(I,H,q,z){var me=V.call(this,I,z||'<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 me.opacities=[],me.opacityBoxes=[],me.opacities=H,me.currentOpacity=q,me.setCurrentOpacity=me.setCurrentOpacity.bind(me),me}return Te(E,V),E.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",H.style.justifyContent="space-between",this.opacities.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="center",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=q===I.currentOpacity?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentOpacity(q,z)}),H.appendChild(z);var me=document.createElement("div");me.innerText=100*q+"%",z.appendChild(me),I.opacityBoxes.push(z)}),H},E.prototype.setCurrentOpacity=function(I,H){var q=this;this.currentOpacity=I,this.opacityBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},E}(se),oe=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.setOpacity=z.setOpacity.bind(z),z.fillColor=q.defaultHighlightColor,z.strokeWidth=0,z.opacity=q.defaultHighlightOpacity,z.fillPanel=new be("Color",q.defaultColorSet,z.fillColor),z.fillPanel.onColorChanged=z.setFillColor,z.opacityPanel=new re("Opacity",q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return Te(E,V),E.prototype.setOpacity=function(I){this.opacity=I,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=E.typeName,I},E.typeName="HighlightMarker",E.title="Highlight marker",E.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>',E}(ie),de='<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>',ye=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.bgColor="transparent",z.tipPosition={x:0,y:0},z.tipBase1Position={x:0,y:0},z.tipBase2Position={x:0,y:0},z.tipMoving=!1,z.color=q.defaultStrokeColor,z.bgColor=q.defaultFillColor,z.fontFamily=q.defaultFontFamily,z.defaultSize={x:100,y:30},z.setBgColor=z.setBgColor.bind(z),z.getTipPoints=z.getTipPoints.bind(z),z.positionTip=z.positionTip.bind(z),z.setTipPoints=z.setTipPoints.bind(z),z.colorPanel=new be("Text color",q.defaultColorSet,z.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>'),z.colorPanel.onColorChanged=z.setColor,z.bgColorPanel=new be("Fill color",q.defaultColorSet,z.bgColor,de),z.bgColorPanel.onColorChanged=z.setBgColor,z.fontFamilyPanel=new ke("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z.tipGrip=new Be,z.tipGrip.visual.transform.baseVal.appendItem(ue.createTransform()),z.controlBox.appendChild(z.tipGrip.visual),z}return Te(E,V),E.prototype.ownsTarget=function(I){return V.prototype.ownsTarget.call(this,I)||this.tipGrip.ownsTarget(I)||this.tip===I},E.prototype.createTip=function(){ue.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ue.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},E.prototype.pointerDown=function(I,H){this.state==="new"&&V.prototype.pointerDown.call(this,I,H),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(H)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):V.prototype.pointerDown.call(this,I,H)},E.prototype.pointerUp=function(I){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,V.prototype.pointerUp.call(this,I);else{var H=this.state==="creating";V.prototype.pointerUp.call(this,I),this.setTipPoints(H),this.positionTip()}},E.prototype.manipulate=function(I){if(this.tipMoving){var H=this.unrotatePoint(I);this.tipPosition={x:H.x-this.manipulationStartLeft,y:H.y-this.manipulationStartTop},this.positionTip()}else V.prototype.manipulate.call(this,I)},E.prototype.setBgColor=function(I){this.bgRectangle&&this.tip&&(ue.setAttributes(this.bgRectangle,[["fill",I]]),ue.setAttributes(this.tip,[["fill",I]])),this.bgColor=I,this.fillColorChanged(I)},E.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},E.prototype.setTipPoints=function(I){I===void 0&&(I=!1);var H=Math.min(this.height/2,15),q=this.height/5;I&&(this.tipPosition={x:H+q/2,y:this.height+20});var z=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?z<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(q=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:H,y:0},this.tipBase2Position={x:H+q,y:0}):(this.tipBase1Position={x:0,y:H},this.tipBase2Position={x:0,y:H+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?z<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(q=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-H-q,y:0},this.tipBase2Position={x:this.width-H,y:0}):(this.tipBase1Position={x:this.width,y:H},this.tipBase2Position={x:this.width,y:H+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?z<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(q=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-H-q,y:this.height},this.tipBase2Position={x:this.width-H,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-H-q},this.tipBase2Position={x:this.width,y:this.height-H}):z<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(q=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:H,y:this.height},this.tipBase2Position={x:H+q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-H},this.tipBase2Position={x:0,y:this.height-H-q})},E.prototype.resize=function(I){V.prototype.resize.call(this,I),this.positionTip()},E.prototype.positionTip=function(){ue.setAttributes(this.tip,[["points",this.getTipPoints()]]);var I=this.tipGrip.visual.transform.baseVal.getItem(0);I.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(I,0)},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),E.prototype.select=function(){this.positionTip(),V.prototype.select.call(this)},E.prototype.getState=function(){var I=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},V.prototype.getState.call(this));return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){var H=I;this.bgColor=H.bgColor,this.tipPosition=H.tipPosition,V.prototype.restoreState.call(this,I),this.createTip(),this.setTipPoints()},E.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.tipPosition={x:this.tipPosition.x*I,y:this.tipPosition.y*H},this.positionTip()},E.typeName="CalloutMarker",E.title="Callout marker",E.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>',E}(Ne),Le=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.fillColor=q.defaultFillColor,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.setOpacity=z.setOpacity.bind(z),z.createVisual=z.createVisual.bind(z),z.strokePanel=new be("Line color",ce(q.defaultColorSet,["transparent"]),q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.fillPanel=new be("Fill color",ce(q.defaultColorSet,["transparent"]),z.fillColor,de),z.fillPanel.onColorChanged=z.setFillColor,z.strokeWidthPanel=new lt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new $e("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z.opacityPanel=new re("Opacity",q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return Te(E,V),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual)},E.prototype.createVisual=function(){this.visual=ue.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)},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},E.prototype.manipulate=function(I){V.prototype.manipulate.call(this,I)},E.prototype.resize=function(I){V.prototype.resize.call(this,I),this.setSize()},E.prototype.setSize=function(){V.prototype.setSize.call(this),ue.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},E.prototype.pointerUp=function(I){V.prototype.pointerUp.call(this,I),this.setSize()},E.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},E.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(I),this.stateChanged()},E.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},E.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},E.prototype.setOpacity=function(I){this.opacity=I,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},V.prototype.getState.call(this));return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){var H=I;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},E.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.setSize()},E.typeName="EllipseMarker",E.title="Ellipse marker",E.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>',E}(Ye),Ue=function(V){function E(I,H,q){return V.call(this,I,H,q)||this}return Te(E,V),Object.defineProperty(E.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.tip1&&I!==this.tip2)},E.prototype.createTips=function(){this.tip1=ue.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(ue.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ue.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(ue.createTransform()),this.visual.appendChild(this.tip2)},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="creating"&&this.createTips()},E.prototype.adjustVisual=function(){if(V.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ue.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()]]),ue.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 I=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.tip1.transform.baseVal.getItem(0);H.setRotate(I,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(H,0);var q=this.tip2.transform.baseVal.getItem(0);q.setRotate(I+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(q,0)}},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I),this.createTips(),this.adjustVisual()},E.typeName="MeasurementMarker",E.title="Measurement marker",E.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>',E}(ut),Je=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.strokePanel.colors=q.defaultColorSet,z.fillColor="transparent",z}return Te(E,V),Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=E.typeName,I},E.typeName="EllipseFrameMarker",E.title="Ellipse frame marker",E.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>',E}(Le),dt=function(){function V(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(V.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),V.prototype.addUndoStep=function(E){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(E)||(this.undoStack.push(E),JSON.stringify(this.lastRedoStep)!==JSON.stringify(E)&&this.redoStack.splice(0,this.redoStack.length))},V.prototype.replaceLastUndoStep=function(E){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=E)},V.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},V.prototype.undo=function(){if(this.undoStack.length>1){var E=this.undoStack.pop();return E!==void 0&&this.redoStack.push(E),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},V.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},V}(),rt=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.curveX=0,z.curveY=0,z.manipulationStartCurveX=0,z.manipulationStartCurveY=0,z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.positionGrips=z.positionGrips.bind(z),z.addControlGrips=z.addControlGrips.bind(z),z.adjustVisual=z.adjustVisual.bind(z),z.setupControlBox=z.setupControlBox.bind(z),z.resize=z.resize.bind(z),z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new be("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new lt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new $e("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Te(E,V),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorCurve&&I!==this.visibleCurve&&!this.curveGrip.ownsTarget(I))},E.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},E.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorCurve=ue.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ue.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)},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=I.x,this.curveY=I.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(H)&&(this.activeGrip=this.curveGrip,this._state="resize")},E.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ue.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},E.prototype.setupControlBox=function(){V.prototype.setupControlBox.call(this),this.curveControlLine1=ue.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ue.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)},E.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,V.prototype.addControlGrips.call(this)},E.prototype.positionGrips=function(){V.prototype.positionGrips.call(this);var I=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-I/2,this.curveY-I/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()))},E.prototype.manipulate=function(I){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+I.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+I.y-this.manipulationStartY),V.prototype.manipulate.call(this,I)},E.prototype.resize=function(I){this.activeGrip===this.curveGrip&&(this.curveX=I.x,this.curveY=I.y),V.prototype.resize.call(this,I),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},E.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},E.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},E.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual()},E.prototype.scale=function(I,H){this.curveX=this.curveX*I,this.curveY=this.curveY*H,V.prototype.scale.call(this,I,H)},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},V.prototype.getState.call(this));return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.curveX=H.curveX,this.curveY=H.curveY,this.createVisual(),this.adjustVisual()},E.typeName="CurveMarker",E.title="Curve marker",E.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>',E}(ct),mt=function(){function V(E,I){I===void 0&&(I=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=E,this.cancelable=I}return Object.defineProperty(V.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),V.prototype.preventDefault=function(){this._defaultPrevented=!0},V}(),yt=function(V){function E(I,H,q){var z=V.call(this,I,!1)||this;return z.dataUrl=H,z.state=q,z}return Te(E,V),E}(mt),tt=function(V){function E(I,H,q){q===void 0&&(q=!1);var z=V.call(this,I,q)||this;return z.marker=H,z}return Te(E,V),E}(mt),Ut=function(){function V(){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 V.prototype.addEventListener=function(E,I){this[E].push(I)},V.prototype.removeEventListener=function(E,I){var H=this[E].indexOf(I);H>-1&&this[E].splice(H,1)},V}(),Ct=function(){function V(E){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new De,this._isOpen=!1,this.undoRedoManager=new dt,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 Ut,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=V.instanceCounter++,this.styles=new et(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=E,this.targetRoot=document.body,this.width=E.clientWidth,this.height=E.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(V.prototype,"ALL_MARKER_TYPES",{get:function(){return[Qe,_e,ve,Ne,Je,Le,oe,ye,Ue,ie,ut,rt]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Qe,_e,ve,Ne,Le,oe,ye]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Qe,_e,ve,Ne,oe]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(E){var I=this;this._availableMarkerTypes.splice(0),E.forEach(function(H){if(typeof H=="string"){var q=I.ALL_MARKER_TYPES.find(function(z){return z.typeName===H});q!==void 0&&I._availableMarkerTypes.push(q)}else I._availableMarkerTypes.push(H)})},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(E){this._zoomLevel=E,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(V.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),V.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Pe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},V.prototype.show=function(){var E=this;this.styles.styleSheetRoot===void 0&&ze.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ze.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(I){return I(new mt(E))})},V.prototype.render=function(){return Ae(this,void 0,void 0,function(){var E;return Oe(this,function(I){switch(I.label){case 0:return this.setCurrentMarker(),(E=new qe).naturalSize=this.renderAtNaturalSize,E.imageType=this.renderImageType,E.imageQuality=this.renderImageQuality,E.markersOnly=this.renderMarkersOnly,E.width=this.renderWidth,E.height=this.renderHeight,[4,E.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return I.sent(),[4,E.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,I.sent()]}})})},V.prototype.close=function(E){var I=this;if(E===void 0&&(E=!1),this.isOpen){var H=!1;E||this.eventListeners.beforeclose.forEach(function(q){var z=new mt(I,!0);q(z),z.defaultPrevented&&(H=!0)}),H||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(q){return q(new mt(I))}),this.detachEvents(),this._isOpen=!1)}},V.prototype.addMarkersToToolbar=function(){for(var E,I=[],H=0;H<arguments.length;H++)I[H]=arguments[H];(E=this._availableMarkerTypes).push.apply(E,I)},V.prototype.addRenderEventListener=function(E){this.addEventListener("render",function(I){E(I.dataUrl,I.state)})},V.prototype.removeRenderEventListener=function(E){},V.prototype.addCloseEventListener=function(E){this.addEventListener("close",function(){E()})},V.prototype.removeCloseEventListener=function(E){},V.prototype.setupResizeObserver=function(){var E=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){E.resize(E.target.clientWidth,E.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return E.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},V.prototype.onPopupTargetResize=function(){var E=1*this.target.clientWidth/this.target.clientHeight,I=this.editorCanvas.clientWidth/E>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*E:this.editorCanvas.clientWidth,H=I<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/E;this.resize(I,H)},V.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},V.prototype.resize=function(E,I){this._isResizing=!0;var H=E/this.imageWidth,q=I/this.imageHeight;this.imageWidth=Math.round(E),this.imageHeight=Math.round(I),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(H,q),this._isResizing=!1},V.prototype.scaleMarkers=function(E,I){var H,q=this;this._currentMarker&&this._currentMarker instanceof Ne?this._currentMarker.scale(E,I):(H=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(z){z!==q._currentMarker&&z.scale(E,I)}),H!==void 0&&this.setCurrentMarker(H)},V.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"},V.prototype.setTopLeft=function(){var E=this.editingTarget.getBoundingClientRect(),I=this.editorCanvas.getBoundingClientRect();this.left=E.left-I.left,this.top=E.top-I.top},V.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)},V.prototype.addDefs=function(){for(var E,I=[],H=0;H<arguments.length;H++)I[H]=arguments[H];this.defs=ue.createDefs(),this.addDefsToImage(),(E=this.defs).append.apply(E,I)},V.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},V.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)},V.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},V.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},V.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)},V.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},V.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)},V.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 E=document.createElement("a");E.href="https://markerjs.com/",E.target="_blank",E.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>',E.title="Powered by marker.js",E.style.display="grid",E.style.alignItems="center",E.style.justifyItems="center",E.style.padding="3px",E.style.width="20px",E.style.height="20px",this.logoUI.appendChild(E),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},V.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")},V.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"},V.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},V.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 E=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=E+"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 Me(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 Ge(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},V.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},V.prototype.removeMarker=function(E){this.markerImage.removeChild(E.container),this.markers.indexOf(E)>-1&&this.markers.splice(this.markers.indexOf(E),1),E.dispose()},V.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())},V.prototype.toolbarButtonClicked=function(E,I){if(E==="marker"&&I!==void 0)this.createNewMarker(I);else if(E==="action")switch(I){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()}},V.prototype.deleteSelectedMarker=function(){var E=this;if(this._currentMarker!==void 0){var I=!1;if(this.eventListeners.markerbeforedelete.forEach(function(q){var z=new tt(E,E._currentMarker,!0);q(z),z.defaultPrevented&&(I=!0)}),!I){var H=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(q){return q(new tt(E,H))})}}},V.prototype.clear=function(){var E=this,I=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(me){var je=new tt(E,void 0,!0);me(je),je.defaultPrevented&&(I=!0)}),!I)){this.setCurrentMarker();for(var H=function(me){var je=q.markers[me];q.setCurrentMarker(q.markers[me]),q._currentMarker.dispose(),q.markerImage.removeChild(q._currentMarker.container),q.markers.splice(q.markers.indexOf(q._currentMarker),1),q.eventListeners.markerdelete.forEach(function(it){return it(new tt(E,je))})},q=this,z=this.markers.length-1;z>=0;z--)H(z);this.addUndoStep()}},Object.defineProperty(V.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),V.prototype.showNotesEditor=function(){var E;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=(E=this._currentMarker.notes)!==null&&E!==void 0?E:"",this.overlayContainer.appendChild(this.notesArea))},V.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)},V.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},V.prototype.addUndoStep=function(){var E=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var I=this.getState(),H=this.undoRedoManager.getLastUndoStep();if(!H||H.width===I.width&&H.height===I.height){var q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(I),q<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(z){return z(new mt(E))})}else this.undoRedoManager.replaceLastUndoStep(I),this.eventListeners.statechange.forEach(function(z){return z(new mt(E))})}},V.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},V.prototype.undoStep=function(){var E=this,I=this.undoRedoManager.undo();I!==void 0&&(this.restoreState(I),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(H){return H(new mt(E))}))},V.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},V.prototype.redoStep=function(){var E=this,I=this.undoRedoManager.redo();I!==void 0&&(this.restoreState(I),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(H){return H(new mt(E))}))},V.prototype.stepZoom=function(){var E=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=E<this.zoomSteps.length-1?this.zoomSteps[E+1]:this.zoomSteps[0]},V.prototype.panTo=function(E){this.contentDiv.scrollBy({left:this.prevPanPoint.x-E.x,top:this.prevPanPoint.y-E.y}),this.prevPanPoint=E},V.prototype.startRenderAndClose=function(){return Ae(this,void 0,void 0,function(){var E,I,H=this;return Oe(this,function(q){switch(q.label){case 0:return[4,this.render()];case 1:return E=q.sent(),I=this.getState(),this.eventListeners.render.forEach(function(z){return z(new yt(H,E,I))}),this.close(!0),[2]}})})},V.prototype.getState=function(E){E===!0&&this.setCurrentMarker();var I={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(H){return I.markers.push(H.getState())}),I},V.prototype.restoreState=function(E){var I=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);E.markers.forEach(function(H){var q=I._availableMarkerTypes.find(function(me){return me.typeName===H.typeName});if(q!==void 0){var z=I.addNewMarker(q);z.restoreState(H),I.markers.push(z)}}),E.width&&E.height&&(E.width!==this.imageWidth||E.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/E.width,this.imageHeight/E.height),this.eventListeners.restorestate.forEach(function(H){return H(new mt(I))})},V.prototype.addNewMarker=function(E){var I=ue.createGroup();return this.markerImage.appendChild(I),new E(I,this.overlayContainer,this.settings)},V.prototype.createNewMarker=function(E){var I,H=this;(I=typeof E=="string"?this._availableMarkerTypes.find(function(q){return q.typeName===E}):E)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(I),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(I.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(q){return q(new tt(H,H._currentMarker))}))},V.prototype.markerCreated=function(E){var I=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(E),this.setCurrentMarker(E),E instanceof _e&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(_e):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(H){return H(new tt(I,I._currentMarker))})},V.prototype.colorChanged=function(E){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=E,this.settings.defaultStrokeColor=E)},V.prototype.fillColorChanged=function(E){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=E)},V.prototype.markerStateChanged=function(E){var I=this;this.eventListeners.markerchange.forEach(function(H){return H(new tt(I,E))})},V.prototype.setCurrentMarker=function(E){var I=this;this._currentMarker!==E&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(H){return H(new tt(I,I._currentMarker))})),this._currentMarker=E,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(H){return H(new tt(I,I._currentMarker))}))},V.prototype.onPointerDown=function(E){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||E.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var I=this.markers.find(function(H){return H.ownsTarget(E.target)});I!==void 0?(this.setCurrentMarker(I),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(E.clientX,E.clientY),E.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:E.clientX,y:E.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(E.clientX,E.clientY))},V.prototype.onDblClick=function(E){if(this._isFocused||this.focus(),this.mode==="select"){var I=this.markers.find(function(H){return H.ownsTarget(E.target)});I!==void 0&&I!==this._currentMarker&&this.setCurrentMarker(I),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(E.clientX,E.clientY),E.target):this.setCurrentMarker()}},V.prototype.onPointerMove=function(E){this.touchPoints!==1&&E.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||E.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(E.clientX,E.clientY)):this.zoomLevel>1&&this.panTo({x:E.clientX,y:E.clientY}))},V.prototype.onPointerUp=function(E){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(E.clientX,E.clientY)),this.isDragging=!1,this.addUndoStep()},V.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},V.prototype.onKeyUp=function(E){this._currentMarker===void 0||this.notesArea!==void 0||E.key!=="Delete"&&E.key!=="Backspace"||this.deleteSelectedMarker()},V.prototype.clientToLocalCoordinates=function(E,I){var H=this.markerImage.getBoundingClientRect();return{x:(E-H.left)/this.zoomLevel,y:(I-H.top)/this.zoomLevel}},V.prototype.onWindowResize=function(){this.positionUI()},V.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var E=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=E+"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()},V.prototype.addLicenseKey=function(E){Pe.addKey(E)},V.prototype.addEventListener=function(E,I){this.eventListeners.addEventListener(E,I)},V.prototype.removeEventListener=function(E,I){this.eventListeners.removeEventListener(E,I)},V.prototype.renderState=function(E){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(E),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(V.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),V.prototype.focus=function(){var E=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(I){return I(new mt(E))}))},V.prototype.blur=function(){var E=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(I){return I(new mt(E))}))},V.instanceCounter=0,V}();/* **********************************
|
|
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 Jt=function(V,E){return(Jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,H){I.__proto__=H}||function(I,H){for(var q in H)Object.prototype.hasOwnProperty.call(H,q)&&(I[q]=H[q])})(V,E)};function ei(V,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");function I(){this.constructor=V}Jt(V,E),V.prototype=E===null?Object.create(E):(I.prototype=E.prototype,new I)}function Dt(V,E,I,H){return new(I||(I=Promise))(function(q,z){function me(gt){try{it(H.next(gt))}catch(We){z(We)}}function je(gt){try{it(H.throw(gt))}catch(We){z(We)}}function it(gt){var We;gt.done?q(gt.value):(We=gt.value,We instanceof I?We:new I(function(Tt){Tt(We)})).then(me,je)}it((H=H.apply(V,E||[])).next())})}function ci(V,E){var I,H,q,z,me={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return z={next:je(0),throw:je(1),return:je(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function je(it){return function(gt){return function(We){if(I)throw new TypeError("Generator is already executing.");for(;me;)try{if(I=1,H&&(q=2&We[0]?H.return:We[0]?H.throw||((q=H.return)&&q.call(H),0):H.next)&&!(q=q.call(H,We[1])).done)return q;switch(H=0,q&&(We=[2&We[0],q.value]),We[0]){case 0:case 1:q=We;break;case 4:return me.label++,{value:We[1],done:!1};case 5:me.label++,H=We[1],We=[0];continue;case 7:We=me.ops.pop(),me.trys.pop();continue;default:if(!(q=me.trys,(q=q.length>0&&q[q.length-1])||We[0]!==6&&We[0]!==2)){me=0;continue}if(We[0]===3&&(!q||We[1]>q[0]&&We[1]<q[3])){me.label=We[1];break}if(We[0]===6&&me.label<q[1]){me.label=q[1],q=We;break}if(q&&me.label<q[2]){me.label=q[2],me.ops.push(We);break}q[2]&&me.ops.pop(),me.trys.pop();continue}We=E.call(V,me)}catch(Tt){We=[6,Tt],H=0}finally{I=q=0}if(5&We[0])throw We[1];return{value:We[0]?We[1]:void 0,done:!0}}([it,gt])}}}var Di=function(){function V(){}return V.addKey=function(E){V.key=E},Object.defineProperty(V,"isLicensed",{get:function(){return!!V.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(V.key)},enumerable:!1,configurable:!0}),V}(),bt=function(){function V(){}return V.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},V.setAttributes=function(E,I){for(var H=0,q=I;H<q.length;H++){var z=q[H],me=z[0],je=z[1];E.setAttribute(me,je)}},V.createRect=function(E,I,H){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",E.toString()),q.setAttribute("height",I.toString()),H&&V.setAttributes(q,H),q},V.createLine=function(E,I,H,q,z){var me=document.createElementNS("http://www.w3.org/2000/svg","line");return me.setAttribute("x1",E.toString()),me.setAttribute("y1",I.toString()),me.setAttribute("x2",H.toString()),me.setAttribute("y2",q.toString()),z&&V.setAttributes(me,z),me},V.createPolygon=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","polygon");return H.setAttribute("points",E),I&&V.setAttributes(H,I),H},V.createCircle=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","circle");return H.setAttribute("cx",(E/2).toString()),H.setAttribute("cy",(E/2).toString()),H.setAttribute("r",E.toString()),I&&V.setAttributes(H,I),H},V.createEllipse=function(E,I,H){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(E/2).toString()),q.setAttribute("cy",(I/2).toString()),q.setAttribute("rx",(E/2).toString()),q.setAttribute("ry",(I/2).toString()),H&&V.setAttributes(q,H),q},V.createGroup=function(E){var I=document.createElementNS("http://www.w3.org/2000/svg","g");return E&&V.setAttributes(I,E),I},V.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},V.createMarker=function(E,I,H,q,z,me,je){var it=document.createElementNS("http://www.w3.org/2000/svg","marker");return V.setAttributes(it,[["id",E],["orient",I],["markerWidth",H.toString()],["markerHeight",q.toString()],["refX",z.toString()],["refY",me.toString()]]),it.appendChild(je),it},V.createText=function(E){var I=document.createElementNS("http://www.w3.org/2000/svg","text");return I.setAttribute("x","0"),I.setAttribute("y","0"),E&&V.setAttributes(I,E),I},V.createTSpan=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","tspan");return H.textContent=E,I&&V.setAttributes(H,I),H},V.createImage=function(E){var I=document.createElementNS("http://www.w3.org/2000/svg","image");return E&&V.setAttributes(I,E),I},V.createPoint=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return H.x=E,H.y=I,H},V.createPath=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","path");return H.setAttribute("d",E),I&&V.setAttributes(H,I),H},V.createElement=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg",E);return I&&V.setAttributes(H,I),H},V.getHollowRectanglePath=function(E,I,H,q,z,me,je,it){return"M"+E+","+I+"V"+(I+q)+"H"+(E+H)+"V"+I+"H"+z+"V"+me+"H"+(z+je)+"V"+(me+it)+"H"+z+"V"+I+"Z"},V}(),fi=function(){function V(E){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+E+"_"}return Object.defineProperty(V.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(V.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(V.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),V.prototype.addClass=function(E){return this.styleSheet===void 0&&this.addStyleSheet(),E.name=""+this.classNamePrefix+E.localName,this.classes.push(E),this.styleSheet.sheet.insertRule("."+E.name+" {"+E.style+"}",this.styleSheet.sheet.cssRules.length),E},V.prototype.addRule=function(E){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(E),this.styleSheet.sheet.insertRule(E.selector+" {"+E.style+"}",this.styleSheet.sheet.cssRules.length)},V.prototype.addStyleSheet=function(){var E;this.styleSheet=document.createElement("style"),((E=this.styleSheetRoot)!==null&&E!==void 0?E:document.head).appendChild(this.styleSheet),this.addRule(new _t("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new _t("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new _t("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new wt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new wt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},V.prototype.removeStyleSheet=function(){var E;this.styleSheet&&(((E=this.styleSheetRoot)!==null&&E!==void 0?E:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},V}(),_t=function(V,E){this.selector=V,this.style=E},wt=function(V,E){this.localName=V,this.style=E},Bt=function(){function V(){this.blocks=[],this.display=""}return V.prototype.addButtonBlock=function(E){E.className=this.blockClassName,E.buttonClassName=this.buttonClassName,E.buttonColorsClassName=this.buttonColorsClassName,E.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(E)},V.prototype.addElementBlock=function(E){E.className===void 0&&(E.className=this.blockClassName),this.blocks.push(E)},V.prototype.getUI=function(){var E=document.createElement("div");return E.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,E.style.display=this.display,this.blocks.forEach(function(I){return E.appendChild(I.getUI())}),E},V}(),Lt=function(){function V(){}return V.prototype.getUI=function(){var E=document.createElement("div");if(E.className=this.className,this.minWidth!==void 0&&(E.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":E.style.justifyContent="flex-start";break;case"center":E.style.justifyContent="center";break;case"end":E.style.justifyContent="flex-end"}return E.style.whiteSpace="nowrap",E},V}(),Mt=function(V){function E(){var I=V!==null&&V.apply(this,arguments)||this;return I.buttons=[],I}return ei(E,V),E.prototype.addButton=function(I){I.className=this.buttonClassName,I.colorsClassName=this.buttonColorsClassName,I.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(I)},E.prototype.getUI=function(){var I=V.prototype.getUI.call(this);return this.buttons.forEach(function(H){return I.appendChild(H.getUI())}),I},E}(Lt),Et=function(){function V(E,I){this._isActive=!1,this._isHidden=!1,this._icon=E,this.title=I,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(V.prototype,"icon",{get:function(){return this._icon},set:function(E){this._icon=E,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isActive",{get:function(){return this._isActive},set:function(E){this._isActive=E,this.adjustClassName()},enumerable:!1,configurable:!0}),V.prototype.getUI=function(){var E=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 E.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},V.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,"")))},V.prototype.hide=function(){this._isHidden=!0},V}(),ht=function(V){function E(){var I=V!==null&&V.apply(this,arguments)||this;return I.elements=[],I}return ei(E,V),E.prototype.addElement=function(I){this.elements.push(I)},E.prototype.getUI=function(){var I=V.prototype.getUI.call(this);return this.elements.forEach(function(H){return I.appendChild(H)}),I},E}(Lt),_i=function(){function V(E,I){this.horizontal=E,this.vertical=I}return Object.defineProperty(V.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),V.prototype.getVerticalLength=function(E){return E/this.ratio},V.prototype.getHorizontalLength=function(E){return E*this.ratio},V}(),Ht=function(){function V(){}return V.getIcon=function(E,I){if(E>0&&I>0){var H=new _i(E,I),q=H.ratio>=1?20:H.getHorizontalLength(20),z=H.ratio<1?20:H.getVerticalLength(20),me=document.createElementNS("http://www.w3.org/2000/svg","svg");me.setAttribute("xmlns","http://www.w3.org/2000/svg"),me.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(me);var je=bt.createDefs();me.appendChild(je);var it=bt.createElement("clipPath",[["id","text-bg-clip"]]);je.appendChild(it);var gt=bt.createPath(bt.getHollowRectanglePath((24-q)/2,(24-z)/2,q,z,(24-q)/2+2,(24-z)/2+2,q-4,z-4));me.appendChild(gt);var We=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);We.appendChild(bt.createTSpan(E+":"+I)),me.appendChild(We);var Tt=We.getBBox();bt.setAttributes(We,[["x",((24-Tt.width)/2).toString()],["y",((24-Tt.height)/2-Tt.y).toString()]]);var Gt=bt.createPath(bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Tt.width))/2,(24-Math.ceil(Tt.height))/2,Math.ceil(Tt.width),Math.ceil(Tt.height)));return it.appendChild(Gt),bt.setAttributes(gt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(me),me.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>'},V}(),zt=function(V){function E(I,H,q){var z=V.call(this,I,H)||this;return z.isDropdownOpen=!1,z.onClick=z.dropdownButtonClicked,z.dropdownButtons=q,z}return ei(E,V),E.prototype.setupDropdown=function(){var I=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(H){H.className=I.className,H.colorsClassName=I.colorsClassName,I.dropdownBlock.appendChild(H.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},E.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},E.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},E.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},E.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},E.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},E}(Et),It=function(){function V(E,I){this.GRIP_SIZE=10,this.color=E,this.fillColor=I,this.visual=bt.createGroup(),this.visual.appendChild(bt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(bt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return V.prototype.ownsTarget=function(E){return E===this.visual||E===this.visual.childNodes[0]||E===this.visual.childNodes[1]},V.prototype.setCenter=function(E,I){this.visual.childNodes.forEach(function(H){return bt.setAttributes(H,[["cx",E.toString()],["cy",I.toString()]])})},V}(),ui=function(){function V(E,I,H,q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=E,this.canvasHeight=I,this.margin=H,this.container=q,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(V.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(E){this._aspectRatio=E,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(E){this._isGridVisible=E,this.gridContainer&&bt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(E){this._zoomFactor=E,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),V.prototype.open=function(){var E=this;this.cropShadeElement=bt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=bt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var I=0;I<this.numberOfGridLines;I++)this.horizontalGridLines.push(bt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(bt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(H){return E.gridContainer.appendChild(H)}),this.verticalGridLines.forEach(function(H){return E.gridContainer.appendChild(H)}),this.cropRectElement=bt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},V.prototype.setCropRectangle=function(E){this.cropRect=E;var I=Object.assign({},this.cropRect);this.zoomFactor!==1&&(I.width=this.cropRect.width*this.zoomFactor,I.height=this.cropRect.height*this.zoomFactor,I.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-I.width/2,I.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-I.height/2),bt.setAttributes(this.cropRectElement,[["x",I.x.toString()],["y",I.y.toString()],["width",I.width.toString()],["height",I.height.toString()]]);var H=I.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(z,me){var je=I.y+H*(me+1);bt.setAttributes(z,[["x1",""+I.x],["y1",""+je],["x2",""+(I.x+I.width)],["y2",""+je]])});var q=I.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(z,me){var je=I.x+q*(me+1);bt.setAttributes(z,[["x1",""+je],["y1",""+I.y],["x2",""+je],["y2",""+(I.y+I.height)]])}),bt.setAttributes(this.cropShadeElement,[["d",bt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,I.x,I.y,I.width,I.height)]]),this.topLeftGrip.setCenter(I.x,I.y),this.topRightGrip.setCenter(I.x+I.width,I.y),this.bottomLeftGrip.setCenter(I.x,I.y+I.height),this.bottomRightGrip.setCenter(I.x+I.width,I.y+I.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},V.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)},V.prototype.clientToLocalCoordinates=function(E,I){var H=this.container.getBoundingClientRect();return{x:E-H.left+this.margin,y:I-H.top+this.margin}},V.prototype.onPointerDown=function(E){this.container.setPointerCapture(E.pointerId),this.previousPoint=this.clientToLocalCoordinates(E.clientX,E.clientY),this.cropRectElement===E.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(E.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(E.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(E.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(E.target)&&(this.activeGrip=this.bottomRightGrip)},V.prototype.onPointerMove=function(E){if(this.isMoving)this.move(this.clientToLocalCoordinates(E.clientX,E.clientY));else if(this.activeGrip){var I=this.clientToLocalCoordinates(E.clientX,E.clientY);this.resize(I)}E.preventDefault()},V.prototype.onPointerUp=function(E){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(E.pointerId)},V.prototype.move=function(E){var I=E.x-this.previousPoint.x,H=E.y-this.previousPoint.y;this.zoomFactor!==1&&(I=-I/this.zoomFactor,H=-H/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+I),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+H),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=E},V.prototype.resize=function(E){var I=Object.assign({},this.cropRect),H=E.x-this.previousPoint.x,q=E.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:I.x+H<this.margin&&(H=this.margin-I.x),I.x+=H,I.width=this.cropRect.x+this.cropRect.width-I.x;break;case this.bottomRightGrip:case this.topRightGrip:I.width+H>this.canvasWidth*this.zoomFactor&&(H=this.canvasWidth*this.zoomFactor-I.width),I.width+=H}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(I.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(H),I.height=this.aspectRatio.getVerticalLength(I.width)):(I.y+=q,I.height=this.cropRect.y+this.cropRect.height-I.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?I.height=this.aspectRatio.getVerticalLength(I.width):I.height+=q}I.width<10&&(I.x=this.cropRect.x,I.width=10),I.height<10&&(I.y=this.cropRect.y,I.height=10),this.previousPoint=E,I.x>=this.margin&&I.y>=this.margin&&I.x-this.margin+I.width<=this.canvasWidth&&I.y-this.margin+I.height<=this.canvasHeight&&(this.cropRect=I,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},V.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var E=this.cropRect.x+this.cropRect.width/2,I=this.cropRect.y+this.cropRect.height/2,H=this.aspectRatio.getHorizontalLength(this.cropRect.height),q=this.aspectRatio.getVerticalLength(this.cropRect.width);H/this.canvasWidth<q/this.canvasHeight?this.cropRect.width=H:this.cropRect.height=q,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=E-this.cropRect.width/2,this.cropRect.y=I-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)}},V.prototype.getRescaledRect=function(E,I,H,q,z,me){var je=H/E,it=q/I;return{x:(z.x-me)*je+me,y:(z.y-me)*it+me,width:z.width*je,height:z.height*it}},V.prototype.scaleCanvas=function(E,I){var H=this.getRescaledRect(this.canvasWidth,this.canvasHeight,E,I,this.cropRect,this.margin);this.canvasWidth=E,this.canvasHeight=I,this.onCropChange&&this.onCropChange(H),this.setCropRectangle(H)},V}(),ki=function(){function V(E){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=E,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(V.prototype,"angle",{get:function(){return this._angle},set:function(E){this._angle=E,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),V.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},V.prototype.onPointerDown=function(E){this.controlContainer.setPointerCapture(E.pointerId),this.isDragging=!0,this.previousPoint={x:E.clientX,y:E.clientY}},V.prototype.onPointerMove=function(E){this.isDragging&&(this.onAngleChange&&this.onAngleChange((E.clientX-this.previousPoint.x)/5),this.previousPoint.x=E.clientX)},V.prototype.onPointerUp=function(E){this.isDragging&&this.onAngleChange&&this.onAngleChange((E.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(E.pointerId)},V.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var E=this.angleLabelText.getBBox();bt.setAttributes(this.angleLabelElement,[["x",((this.width-E.width)/2).toString()],["y",(this.height/2).toString()]])}},V.prototype.positionScaleShape=function(){if(this.scaleShape){var E=this.scaleShape.transform.baseVal.getItem(0);E.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(E,0)}},V.prototype.getVisual=function(){var E=document.createElementNS("http://www.w3.org/2000/svg","svg");E.setAttribute("xmlns","http://www.w3.org/2000/svg"),E.setAttribute("width",this.width+"px"),E.setAttribute("height",this.height+"px"),E.setAttribute("viewBox","0 0 "+this.width+" "+this.height),E.style.flexShrink="0",document.body.appendChild(E);for(var I="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,H=1;H<=this.width/5+10;H++){var q=H%5==0?this.height/3:this.height/6;I+="h4v"+-q+"h1v"+q}I+="v1H0Z",this.scaleShape=bt.createPath(I);var z=bt.createTransform();this.scaleShape.transform.baseVal.appendItem(z),E.appendChild(this.scaleShape),this.angleLabelElement=bt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=bt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var me=bt.createTSpan("");return me.innerHTML="°",this.angleLabelElement.appendChild(me),E.appendChild(this.angleLabelElement),document.body.removeChild(E),E},V}(),Yi=function(){function V(){this.naturalSize=!1,this.imageType="image/png"}return V.prototype.rasterize=function(E,I,H,q,z,me,je){var it=this;return new Promise(function(gt){var We=document.createElement("canvas");We.width=E.width.baseVal.value-2*q,We.height=E.height.baseVal.value-2*q;var Tt=1,Gt=1;it.naturalSize===!0?(Tt=I.naturalWidth/(E.width.baseVal.value-2*q)/me,Gt=I.naturalHeight/(E.height.baseVal.value-2*q)/je,We.width=I.naturalWidth/me,We.height=I.naturalHeight/je):it.width!==void 0&&it.height!==void 0&&(Tt=it.width/H.width,Gt=it.height/H.height,We.width*=Tt,We.height*=Gt);var qt=We.getContext("2d");qt.translate(We.width/2,We.height/2),qt.rotate(z*Math.PI/180),qt.scale(me,je),qt.translate(-We.width/2,-We.height/2),qt.drawImage(I,0,0,We.width,We.height);var Hi=document.createElement("canvas");Hi.width=H.width*Tt,Hi.height=H.height*Gt,Hi.getContext("2d").putImageData(qt.getImageData((H.x-q)*Tt,(H.y-q)*Gt,H.width*Tt,H.height*Gt),0,0),gt(Hi.toDataURL(it.imageType,it.imageQuality))})},V}(),Xe=function(){function V(E){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=V.instanceCounter++,this.styles=new fi(this.instanceNo),this.target=E,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(V.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(E){this._zoomToCropEnabled=E,E?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(E){this._isGridVisible=E,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"gridLines",{get:function(){return this._gridLines},set:function(E){this._gridLines=E,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(E){this._rotationAngle=E,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"aspectRatio",{get:function(){var E;return(E=this._aspectRatio)!==null&&E!==void 0?E:this.aspectRatios[0]},set:function(E){this._aspectRatio=E},enumerable:!1,configurable:!0}),V.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},V.prototype.show=function(){this.showUI(),this.open()},V.prototype.close=function(E){E===void 0&&(E=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),E||this.closeEventListeners.forEach(function(I){return I()}),this._isOpen=!1)},V.prototype.addRenderEventListener=function(E){this.renderEventListeners.push(E)},V.prototype.removeRenderEventListener=function(E){this.renderEventListeners.indexOf(E)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(E),1)},V.prototype.addCloseEventListener=function(E){this.closeEventListeners.push(E)},V.prototype.removeCloseEventListener=function(E){this.closeEventListeners.indexOf(E)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(E),1)},V.prototype.setupResizeObserver=function(){var E=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){E.resize(E.target.clientWidth,E.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))},V.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var E=1*this.target.clientWidth/this.target.clientHeight,I=this.contentDiv.clientWidth/E>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*E:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,H=I+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/E;this.resize(I,H)}},V.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},V.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",bt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},V.prototype.resize=function(E,I){this.imageWidth=Math.round(E),this.imageHeight=Math.round(I),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()},V.prototype.setEditingTarget=function(){var E=document.createElement("canvas");E.width=this.target.naturalWidth,E.height=this.target.naturalHeight,E.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var I=E.toDataURL();bt.setAttributes(this.editingTarget,[["href",I]]),this.setEditingTargetSize()},V.prototype.setTopLeft=function(){var E=this.target.getBoundingClientRect(),I=this.editorCanvas.getBoundingClientRect();this.left=E.left-I.left-this.CANVAS_MARGIN,this.top=E.top-I.top-this.CANVAS_MARGIN},V.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=bt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=bt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=bt.createGroup(),this.editingTargetRotationScaleContainer=bt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var E=bt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(E);var I=bt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(I),this.editingTargetContainer=bt.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)},V.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},V.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=bt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new ui(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()},V.prototype.zoomToCrop=function(){if(this.cropRect){var E=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,I=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=E+"px "+I+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-E+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-I+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},V.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)},V.prototype.cropRectChanged=function(E){this.cropRect=E,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},V.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},V.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"},V.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},V.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 E=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,I=this.target.offsetTop>E+this.CANVAS_MARGIN?this.target.offsetTop-(E+this.CANVAS_MARGIN):0;this.coverDiv.style.top=I+"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},V.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},V.prototype.addTopToolbar=function(){var E=this;this.topToolbar=new Bt,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 I=new Mt;I.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(I);var H=[];this.aspectRatios.forEach(function(Gt){var qt=new Et(Ht.getIcon(Gt.horizontal,Gt.vertical),Gt.horizontal===0&&Gt.vertical===0?"FREE":Gt.horizontal+":"+Gt.vertical);qt.onClick=function(){return E.ratioButtonClicked(Gt)},H.push(qt)}),this.aspectRatioButton=new zt(Ht.getIcon(0,0),"Aspect ratio",H),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,I.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var q=new Et('<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");q.isActive=this.isGridVisible,q.onClick=function(){E.isGridVisible=!E.isGridVisible,q.isActive=E.isGridVisible},I.addButton(q);var z=new Et('<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(z.isActive=this.zoomToCropEnabled,z.onClick=function(){E.zoomToCropEnabled=!E.zoomToCropEnabled,z.isActive=E.zoomToCropEnabled},I.addButton(z),!Di.isLicensed){var me=new ht;this.topToolbar.addElementBlock(me);var je=document.createElement("div");je.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var it=document.createElement("a");it.style.color="currentColor",it.href="https://markerjs.com/products/cropro",it.target="_blank",it.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>',je.appendChild(it),me.addElement(je)}var gt=new Mt;gt.minWidth=3*this.toolbarHeight+"px",gt.contentAlign="end",this.topToolbar.addButtonBlock(gt);var We=new Et('<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");We.onClick=this.startRenderAndClose,gt.addButton(We),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(We.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Tt=new Et('<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");Tt.onClick=this.close,gt.addButton(Tt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Tt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},V.prototype.addBottomToolbar=function(){var E=this;this.bottomToolbar=new Bt,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 I=new Mt;I.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(I);var H=new Et('<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");H.onClick=this.rotateLeftButtonClicked,I.addButton(H);var q=new Et('<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");q.onClick=this.rotateRightButtonClicked,I.addButton(q);var z=new ht;z.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(z),this.straightener=new ki("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(gt){E.rotateBy(gt),E.straightener.angle=E.rotationAngle},z.addElement(this.straightener.getUI());var me=new Mt;me.minWidth=2*this.toolbarHeight+"px",me.contentAlign="end",this.bottomToolbar.addButtonBlock(me);var je=new Et('<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");je.onClick=this.flipHorizontallyButtonClicked,me.addButton(je);var it=new Et('<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");it.onClick=this.flipVerticallyButtonClicked,me.addButton(it)},V.prototype.ratioButtonClicked=function(E){this.aspectRatio=E,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},V.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Ht.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},V.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new _i(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},V.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},V.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},V.prototype.restoreState=function(E){if(E){var I=this.cropLayer.getRescaledRect(E.width,E.height,this.imageWidth,this.imageHeight,E.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(I),this.cropRectChanged(I),this.flippedHorizontally=E.flippedHorizontally,this.flippedVertically=E.flippedVertically,this.applyFlip(),this.rotationAngle=E.rotationAngle,this.applyRotation()}},V.prototype.clientToLocalCoordinates=function(E,I){var H=this.cropImage.getBoundingClientRect();return{x:E-H.left,y:I-H.top}},V.prototype.onWindowResize=function(){this.positionUI()},V.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var E=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=E+"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()},V.prototype.rotateLeftButtonClicked=function(){var E=this.rotationAngle-90;this.rotationAngle%90!=0&&(E+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(E)},V.prototype.rotateRightButtonClicked=function(){var E=this.rotationAngle+90;this.rotationAngle%90!=0&&(E-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(E)},V.prototype.rotateTo=function(E){E=(E=E>180?E-360:E)<=-180?E+360:E,this.rotationAngle=E,this.applyRotation()},V.prototype.rotateBy=function(E){this.rotateTo((this.rotationAngle+E)%360)},V.prototype.applyRotation=function(){var E=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var I=this.editingTargetRotationContainer.transform.baseVal.getItem(0);I.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(I,0);var H=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/H.width,this.imageHeight/H.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=E},V.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},V.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},V.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},V.prototype.startRenderAndClose=function(){return Dt(this,void 0,void 0,function(){var E,I;return ci(this,function(H){switch(H.label){case 0:return[4,this.render()];case 1:return E=H.sent(),I=this.getState(),this.renderEventListeners.forEach(function(q){return q(E,I)}),this.close(!0),[2]}})})},V.prototype.render=function(){return Dt(this,void 0,void 0,function(){var E;return ci(this,function(I){switch(I.label){case 0:return(E=new Yi).naturalSize=this.renderAtNaturalSize,E.imageType=this.renderImageType,E.imageQuality=this.renderImageQuality,E.width=this.renderWidth,E.height=this.renderHeight,this.unzoomFromCrop(),bt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,E.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 I.sent(),[4,E.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,I.sent()]}})})},V.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new wt("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 wt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new wt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var E=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new wt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*E)+`px;
|
|
height: `+(this.toolbarHeight-2*E)+`px;
|
|
padding: `+E+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new wt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new wt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new _t("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new _t("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new wt("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 wt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new wt("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 wt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*E)+`px;
|
|
padding: `+E+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new wt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},V.instanceCounter=0,V}(),Ot=J("8hTe"),mn=J.n(Ot),gn=/<pre[^>]*>/g;function vn(V){var E=document.createElement("div");return E.innerHTML=V,E.childNodes.length===0?"":E.childNodes[0].nodeValue}var yn=ge.a=function(V){var E=V.value,I=E===void 0?"":E,H=V.edit,q=H===void 0?!1:H,z=V.className,me=V.showTextOnly,je=V.showLines,it=V.replaces,gt=V.zoomImg,We=V.hasMask,Tt=V.style,Gt=Tt===void 0?{}:Tt,qt=V.stylesPrev,Hi=qt===void 0?{}:qt,wi=String(I),Si=Object(D.useRef)(),Qi=Object(D.useRef)(),Dn=Object(D.useState)(""),pi=Object(G.a)(Dn,2),zi=pi[0],un=pi[1],hn=Object(D.useState)("office"),Wi=Object(G.a)(hn,2),kn=Wi[0],bn=Wi[1],zn=function(){var Kt=new Xe(Qi.current);Kt.displayMode="popup",Kt.addRenderEventListener(function(){var Ei=Object(U.a)(i.a.mark(function Nt(si){var Yt;return i.a.wrap(function(mi){for(;;)switch(mi.prev=mi.next){case 0:return Si.current.style.display="none",mi.next=3,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:si}});case 3:Yt=mi.sent,Yt!=null&&Yt.id&&it(Qi.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Yt==null?void 0:Yt.id,"?type=").concat(Yt.content_type));case 5:case"end":return mi.stop()}},Nt)}));return function(Nt){return Ei.apply(this,arguments)}}()),Kt.show()},Vn=function(){var Kt=new Ct(Qi.current);Kt.settings.displayMode="popup",Kt.addEventListener("render",function(){var Ei=Object(U.a)(i.a.mark(function Nt(si){var Yt;return i.a.wrap(function(mi){for(;;)switch(mi.prev=mi.next){case 0:if(Si.current.style.display="none",!Qi.current){mi.next=6;break}return mi.next=4,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:si.dataUrl}});case 4:Yt=mi.sent,Yt!=null&&Yt.id&&it(Qi.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Yt==null?void 0:Yt.id,"?type=").concat(Yt.content_type));case 6:case"end":return mi.stop()}},Nt)}));return function(Nt){return Ei.apply(this,arguments)}}()),Kt.show(),window.markerArea=Kt},Zi=Object(D.useMemo)(function(){Si.current&&(Si.current.style.zIndex=-1);try{var ri=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Kt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ei=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;wi=wi.replace(ri,"("+ee.a.API_SERVER+"/api/attachments/").replace(Kt,'"'+ee.a.API_SERVER+"/api/attachments/").replace(Ei,'"'+ee.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(rn){}var Nt=j(wi),si=T();if(wi.match(/\[TOC\]/)&&(Nt=Nt.replace("<p>[TOC]</p>",L()),A()),Nt=Nt.replace(/(__special_katext_id_\d+__)/g,function(rn,mi){var Ri=si[mi],Xn=Ri.type,xn=Ri.expression;return Object(ae.renderToString)(vn(xn)||"",{displayMode:Xn==="block",throwOnError:!1,output:"html"})}),Nt=Nt.replace(/▁/g,"\u2581\u2581\u2581"),v(),me){var Yt=document.createElement("div");return Yt.innerHTML=Nt,Yt.innerText}return setTimeout(function(){return dr()},500),Nt},[wi]),$i=Object(D.useRef)();_.WebkitLineClamp=je,je&&(Gt=Object(N.a)(Object(N.a)({},Gt),_));function _n(ri){var Kt=ri.target;if(Kt.tagName.toUpperCase()==="IMG"){if(gt){var Ei=Kt.getAttribute("src");un(Ei),bn("image")}}else if(Kt.tagName.toUpperCase()==="A"){var Nt=Kt.getAttribute("href");if(Nt.indexOf("office")>-1)ri.preventDefault(),un(Nt),bn("office");else if(Nt.indexOf("application/pdf")>-1)ri.preventDefault(),un(Nt),bn("pdf");else if(Nt.indexOf("text/html")>-1)ri.preventDefault(),un(Nt),bn("html");else if(Nt.startsWith("#")){ri.preventDefault();var si=document.getElementById(Nt.replace("#",""));si&&si.scrollIntoView(!0)}}}var dr=function(){var Kt,Ei=(Kt=$i.current)===null||Kt===void 0?void 0:Kt.querySelectorAll("video");Ei==null||Ei.forEach(function(Nt){if(Nt.oncontextmenu=function(){return!1},Nt.src.indexOf(".m3u8")>-1&&!Nt.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var si=new Y.a;si.loadSource(Nt.src),si.attachMedia(Nt)}}})};Object(D.useEffect)(function(){if($i.current&&Zi&&(Zi.match(gn)&&window.PR.prettyPrint()),$i.current)return $i.current.addEventListener("click",_n),function(){$i.current.removeEventListener("click",_n),v(),A()}},[Zi,$i.current,_n]);var En=function(Kt){if(!q)return;Kt.target.nodeName==="IMG"?(Si.current.style.zIndex=1,Si.current.style.display="flex",Si.current.style.width=Kt.target.clientWidth+"px",Si.current.style.height=Kt.target.clientHeight+"px",Si.current.style.top=Kt.target.offsetTop+"px",Si.current.style.left=Kt.target.offsetLeft+"px",Qi.current.src=Kt.target.getAttribute("src")):Si.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:$i,style:Object(N.a)({},Gt),className:"".concat(z||""," markdown-body ").concat(mn.a.mdBody),onMouseOver:En,dangerouslySetInnerHTML:{__html:Zi}}),g.a.createElement("div",{ref:Si,className:mn.a.button},g.a.createElement($.a,null,g.a.createElement(X.a,{onClick:function(){return zn()}},"\u88C1\u526A"),g.a.createElement(X.a,{onClick:function(){return Vn()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:Qi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(le.a,{close:!0,data:zi,type:zi!=null&&zi.length?kn:"",style:Object(N.a)({},Hi),onClose:function(){return un("")}}))}},"9VGf":function(ot,ge,J){"use strict";J.d(ge,"a",function(){return k});var ne=J("q1tI"),$=J.n(ne);function k(X,N){var U=Object(ne.useRef)();Object(ne.useEffect)(function(){U.current=X}),Object(ne.useEffect)(function(){function G(){U.current()}if(N!==null){var W=setInterval(G,N);return function(){return clearInterval(W)}}},[N])}},BU3w:function(ot,ge,J){"use strict";J.d(ge,"a",function(){return U});var ne=J("MNnm"),$="rc-util-key";function k(G){if(G.attachTo)return G.attachTo;var W=document.querySelector("head");return W||document.body}function X(G){var W,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ne.a)())return null;var D=document.createElement("style");if((W=i.csp)===null||W===void 0?void 0:W.nonce){var g;D.nonce=(g=i.csp)===null||g===void 0?void 0:g.nonce}D.innerHTML=G;var d=k(i),m=d.firstChild;return i.prepend&&d.prepend?d.prepend(D):i.prepend&&m?d.insertBefore(D,m):d.appendChild(D),D}var N=new Map;function U(G,W){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=k(i);if(!N.has(D)){var g=X("",i),d=g.parentNode;N.set(D,d),d.removeChild(g)}var m=Array.from(N.get(D).children).find(function(h){return h.tagName==="STYLE"&&h[$]===W});if(m){var u,a;if(((u=i.csp)===null||u===void 0?void 0:u.nonce)&&m.nonce!==((a=i.csp)===null||a===void 0?void 0:a.nonce)){var f;m.nonce=(f=i.csp)===null||f===void 0?void 0:f.nonce}return m.innerHTML!==G&&(m.innerHTML=G),m}var l=X(G,i);return l[$]=W,l}},Bd2K:function(ot,ge,J){(function(ne){ne(J("VrN/"),J("osHv"))})(function(ne){ne.defineOption("autoCloseTags",!1,function(i,D,g){if(g!=ne.Init&&g&&i.removeKeyMap("autoCloseTags"),!D)return;var d={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(d["'/'"]=function(m){return U(m)}),(typeof D!="object"||D.whenOpening!==!1)&&(d["'>'"]=function(m){return X(m)}),i.addKeyMap(d)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],k=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function X(i){if(i.getOption("disableInput"))return ne.Pass;for(var D=i.listSelections(),g=[],d=i.getOption("autoCloseTags"),m=0;m<D.length;m++){if(!D[m].empty())return ne.Pass;var u=D[m].head,a=i.getTokenAt(u),f=ne.innerMode(i.getMode(),a.state),l=f.state,h=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(l),o=h&&h.name;if(!o)return ne.Pass;var s=f.mode.configuration=="html",A=typeof d=="object"&&d.dontCloseTags||s&&$,_=typeof d=="object"&&d.indentTags||s&&k;a.end>u.ch&&(o=o.slice(0,o.length-a.end+u.ch));var w=o.toLowerCase();if(!o||a.type=="string"&&(a.end!=u.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||a.string.length==1)||a.type=="tag"&&h.close||a.string.indexOf("/")==u.ch-a.start-1||A&&G(A,w)>-1||W(i,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(l)||[],o,u,!0))return ne.Pass;var L=typeof d=="object"&&d.emptyTags;if(L&&G(L,o)>-1){g[m]={text:"/>",newPos:ne.Pos(u.line,u.ch+2)};continue}var R=_&&G(_,w)>-1;g[m]={indent:R,text:">"+(R?`
|
|
|
|
`:"")+"</"+o+">",newPos:R?ne.Pos(u.line+1,0):ne.Pos(u.line,u.ch+1)}}for(var C=typeof d=="object"&&d.dontIndentOnAutoClose,m=D.length-1;m>=0;m--){var S=g[m];i.replaceRange(S.text,D[m].head,D[m].anchor,"+insert");var x=i.listSelections().slice(0);x[m]={head:S.newPos,anchor:S.newPos},i.setSelections(x),!C&&S.indent&&(i.indentLine(S.newPos.line,null,!0),i.indentLine(S.newPos.line+1,null,!0))}}function N(i,D){for(var g=i.listSelections(),d=[],m=D?"/":"</",u=i.getOption("autoCloseTags"),a=typeof u=="object"&&u.dontIndentOnSlash,f=0;f<g.length;f++){if(!g[f].empty())return ne.Pass;var l=g[f].head,h=i.getTokenAt(l),o=ne.innerMode(i.getMode(),h.state),s=o.state;if(D&&(h.type=="string"||h.string.charAt(0)!="<"||h.start!=l.ch-1))return ne.Pass;var A,_=o.mode.name!="xml"&&i.getMode().name=="htmlmixed";if(_&&o.mode.name=="javascript")A=m+"script";else if(_&&o.mode.name=="css")A=m+"style";else{var w=o.mode.xmlCurrentContext&&o.mode.xmlCurrentContext(s);if(!w||w.length&&W(i,w,w[w.length-1],l))return ne.Pass;A=m+w[w.length-1]}i.getLine(l.line).charAt(h.end)!=">"&&(A+=">"),d[f]=A}if(i.replaceSelections(d),g=i.listSelections(),!a)for(var f=0;f<g.length;f++)(f==g.length-1||g[f].head.line<g[f+1].head.line)&&i.indentLine(g[f].head.line)}function U(i){return i.getOption("disableInput")?ne.Pass:N(i,!0)}ne.commands.closeTag=function(i){return N(i)};function G(i,D){if(i.indexOf)return i.indexOf(D);for(var g=0,d=i.length;g<d;++g)if(i[g]==D)return g;return-1}function W(i,D,g,d,m){if(!ne.scanForClosingTag)return!1;var u=Math.min(i.lastLine()+1,d.line+500),a=ne.scanForClosingTag(i,d,null,u);if(!a||a.tag!=g)return!1;for(var f=m?1:0,l=D.length-1;l>=0&&D[l]==g;l--)++f;d=a.to;for(var l=1;l<f;l++){var h=ne.scanForClosingTag(i,d,null,u);if(!h||h.tag!=g)return!1;d=h.to}return!0}})},BjJ7:function(ot,ge,J){"use strict";J.d(ge,"d",function(){return $}),J.d(ge,"c",function(){return k}),J.d(ge,"e",function(){return X}),J.d(ge,"b",function(){return N}),J.d(ge,"a",function(){return G});var ne=J("m3rI");function $(W){var i=!0;if(W.length>0){for(var D=0;D<W.length;D++)if(W[D].compile_success==0||!W[D].compile_success){i=!1;break}}else i=!1;return i}function k(W){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],g=0;g<W.length;g++){var d=W[g],m=i?"".concat(i,"/").concat(d.name):"".concat(d.name);D.push({title:d.name,isLeaf:!(d.type==="tree"),key:m})}return D}function X(W,i,D){for(var g=0;g<W.length;g++){var d=W[g];if(d.key===i){d.children=D;break}d.children&&X(d.children,i,D)}return W}function N(W,i,D){var g;return function(){var d=this,m=arguments,u=function(){g=null,D||W.apply(d,m)},a=D&&!g;clearTimeout(g),g=setTimeout(u,i),a&&W.apply(d,m)}}var U=!0,G=ne.a.API_SERVER},"C+DQ":function(ot,ge,J){},"C/vA":function(ot,ge,J){"use strict";J.d(ge,"a",function(){return ne});function ne($){const k=this;let X=!1,N;return function(){return X||(X=!0,N=$.apply(k,arguments)),N}}},"Cg/j":function(ot,ge,J){"use strict";J.d(ge,"b",function(){return ne}),J.d(ge,"a",function(){return $}),J.d(ge,"c",function(){return X}),J.d(ge,"d",function(){return N});var ne;(function(U){U.serviceIds=new Map,U.DI_TARGET="$di$target",U.DI_DEPENDENCIES="$di$dependencies";function G(W){return W[U.DI_DEPENDENCIES]||[]}U.getServiceDependencies=G})(ne||(ne={}));const $=X("instantiationService");function k(U,G,W,i){G[ne.DI_TARGET]===G?G[ne.DI_DEPENDENCIES].push({id:U,index:W,optional:i}):(G[ne.DI_DEPENDENCIES]=[{id:U,index:W,optional:i}],G[ne.DI_TARGET]=G)}function X(U){if(ne.serviceIds.has(U))return ne.serviceIds.get(U);const G=function(W,i,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");k(G,W,D,!1)};return G.toString=()=>U,ne.serviceIds.set(U,G),G}function N(U){return function(G,W,i){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");k(U,G,i,!0)}}},DlQD:function(ot,ge,J){(function(ne,$){ot.exports=$()})(this,function(){"use strict";function ne(_e,fe){for(var ve=0;ve<fe.length;ve++){var ie=fe[ve];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(_e,ie.key,ie)}}function $(_e,fe,ve){return fe&&ne(_e.prototype,fe),ve&&ne(_e,ve),_e}function k(_e,fe){if(!_e)return;if(typeof _e=="string")return X(_e,fe);var ve=Object.prototype.toString.call(_e).slice(8,-1);if(ve==="Object"&&_e.constructor&&(ve=_e.constructor.name),ve==="Map"||ve==="Set")return Array.from(_e);if(ve==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ve))return X(_e,fe)}function X(_e,fe){(fe==null||fe>_e.length)&&(fe=_e.length);for(var ve=0,ie=new Array(fe);ve<fe;ve++)ie[ve]=_e[ve];return ie}function N(_e,fe){var ve;if(typeof Symbol=="undefined"||_e[Symbol.iterator]==null){if(Array.isArray(_e)||(ve=k(_e))||fe&&_e&&typeof _e.length=="number"){ve&&(_e=ve);var ie=0;return function(){return ie>=_e.length?{done:!0}:{done:!1,value:_e[ie++]}}}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 ve=_e[Symbol.iterator](),ve.next.bind(ve)}function U(_e,fe){return fe={exports:{}},_e(fe,fe.exports),fe.exports}var G=U(function(_e){function fe(){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 ve(ie){_e.exports.defaults=ie}_e.exports={defaults:fe(),getDefaults:fe,changeDefaults:ve}}),W=G.defaults,i=G.getDefaults,D=G.changeDefaults,g=/[&<>"']/,d=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,a={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(fe){return a[fe]};function l(_e,fe){if(fe){if(g.test(_e))return _e.replace(d,f)}else if(m.test(_e))return _e.replace(u,f);return _e}var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function o(_e){return _e.replace(h,function(fe,ve){return ve=ve.toLowerCase(),ve==="colon"?":":ve.charAt(0)==="#"?ve.charAt(1)==="x"?String.fromCharCode(parseInt(ve.substring(2),16)):String.fromCharCode(+ve.substring(1)):""})}var s=/(^|[^\[])\^/g;function A(_e,fe){_e=_e.source||_e,fe=fe||"";var ve={replace:function(re,oe){return oe=oe.source||oe,oe=oe.replace(s,"$1"),_e=_e.replace(re,oe),ve},getRegex:function(){return new RegExp(_e,fe)}};return ve}var _=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(_e,fe,ve){if(_e){var ie;try{ie=decodeURIComponent(o(ve)).replace(_,"").toLowerCase()}catch(re){return null}if(ie.indexOf("javascript:")===0||ie.indexOf("vbscript:")===0||ie.indexOf("data:")===0)return null}fe&&!w.test(ve)&&(ve=p(fe,ve));try{ve=encodeURI(ve).replace(/%25/g,"%")}catch(re){return null}return ve}var R={},C=/^[^:]+:\/*[^/]*$/,S=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function p(_e,fe){R[" "+_e]||(C.test(_e)?R[" "+_e]=_e+"/":R[" "+_e]=F(_e,"/",!0)),_e=R[" "+_e];var ve=_e.indexOf(":")===-1;return fe.substring(0,2)==="//"?ve?fe:_e.replace(S,"$1")+fe:fe.charAt(0)==="/"?ve?fe:_e.replace(x,"$1")+fe:_e+fe}var T={exec:function(){}};function v(_e){for(var fe=1,ve,ie;fe<arguments.length;fe++){ve=arguments[fe];for(ie in ve)Object.prototype.hasOwnProperty.call(ve,ie)&&(_e[ie]=ve[ie])}return _e}function y(_e,fe){var ve=_e.replace(/\|/g,function(oe,de,ye){for(var Le=!1,Ue=de;--Ue>=0&&ye[Ue]==="\\";)Le=!Le;return Le?"|":" |"}),ie=ve.split(/ \|/),re=0;if(ie.length>fe)ie.splice(fe);else for(;ie.length<fe;)ie.push("");for(;re<ie.length;re++)ie[re]=ie[re].trim().replace(/\\\|/g,"|");return ie}function F(_e,fe,ve){var ie=_e.length;if(ie===0)return"";for(var re=0;re<ie;){var oe=_e.charAt(ie-re-1);if(oe===fe&&!ve)re++;else if(oe!==fe&&ve)re++;else break}return _e.substr(0,ie-re)}function B(_e,fe){if(_e.indexOf(fe[1])===-1)return-1;for(var ve=_e.length,ie=0,re=0;re<ve;re++)if(_e[re]==="\\")re++;else if(_e[re]===fe[0])ie++;else if(_e[re]===fe[1]&&(ie--,ie<0))return re;return-1}function O(_e){_e&&_e.sanitize&&!_e.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 j={escape:l,unescape:o,edit:A,cleanUrl:L,resolveUrl:p,noopTest:T,merge:v,splitCells:y,rtrim:F,findClosingBracket:B,checkSanitizeDeprecation:O},P=G.defaults,b=j.rtrim,Y=j.splitCells,ee=j.escape,ae=j.findClosingBracket;function le(_e,fe,ve){var ie=fe.href,re=fe.title?ee(fe.title):null,oe=_e[1].replace(/\\([\[\]])/g,"$1");return _e[0].charAt(0)!=="!"?{type:"link",raw:ve,href:ie,title:re,text:oe}:{type:"image",raw:ve,href:ie,title:re,text:ee(oe)}}function Re(_e,fe){var ve=_e.match(/^(\s+)(?:```)/);if(ve===null)return fe;var ie=ve[1];return fe.split(`
|
|
`).map(function(re){var oe=re.match(/^\s+/);if(oe===null)return re;var de=oe[0];return de.length>=ie.length?re.slice(ie.length):re}).join(`
|
|
`)}var Ee=function(){function _e(ve){this.options=ve||P}var fe=_e.prototype;return fe.space=function(ie){var re=this.rules.block.newline.exec(ie);if(re)return re[0].length>1?{type:"space",raw:re[0]}:{raw:`
|
|
`}},fe.code=function(ie,re){var oe=this.rules.block.code.exec(ie);if(oe){var de=re[re.length-1];if(de&&de.type==="paragraph")return{raw:oe[0],text:oe[0].trimRight()};var ye=oe[0].replace(/^ {4}/gm,"");return{type:"code",raw:oe[0],codeBlockStyle:"indented",text:this.options.pedantic?ye:b(ye,`
|
|
`)}}},fe.fences=function(ie){var re=this.rules.block.fences.exec(ie);if(re){var oe=re[0],de=Re(oe,re[3]||"");return{type:"code",raw:oe,lang:re[2]?re[2].trim():re[2],text:de}}},fe.heading=function(ie){var re=this.rules.block.heading.exec(ie);if(re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},fe.nptable=function(ie){var re=this.rules.block.nptable.exec(ie);if(re){var oe={type:"table",header:Y(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
|
|
`):[],raw:re[0]};if(oe.header.length===oe.align.length){var de=oe.align.length,ye;for(ye=0;ye<de;ye++)/^ *-+: *$/.test(oe.align[ye])?oe.align[ye]="right":/^ *:-+: *$/.test(oe.align[ye])?oe.align[ye]="center":/^ *:-+ *$/.test(oe.align[ye])?oe.align[ye]="left":oe.align[ye]=null;for(de=oe.cells.length,ye=0;ye<de;ye++)oe.cells[ye]=Y(oe.cells[ye],oe.header.length);return oe}}},fe.hr=function(ie){var re=this.rules.block.hr.exec(ie);if(re)return{type:"hr",raw:re[0]}},fe.blockquote=function(ie){var re=this.rules.block.blockquote.exec(ie);if(re){var oe=re[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:re[0],text:oe}}},fe.list=function(ie){var re=this.rules.block.list.exec(ie);if(re){for(var oe=re[0],de=re[2],ye=de.length>1,Le=de[de.length-1]===")",Ue={type:"list",raw:oe,ordered:ye,start:ye?+de.slice(0,-1):"",loose:!1,items:[]},Je=re[0].match(this.rules.block.item),dt=!1,rt,mt,yt,tt,Ut,Ct,Jt,ei=Je.length,Dt=0;Dt<ei;Dt++)rt=Je[Dt],oe=rt,mt=rt.length,rt=rt.replace(/^ *([*+-]|\d+[.)]) */,""),~rt.indexOf(`
|
|
`)&&(mt-=rt.length,rt=this.options.pedantic?rt.replace(/^ {1,4}/gm,""):rt.replace(new RegExp("^ {1,"+mt+"}","gm"),"")),Dt!==ei-1&&(yt=this.rules.block.bullet.exec(Je[Dt+1])[0],(ye?yt.length===1||!Le&&yt[yt.length-1]===")":yt.length>1||this.options.smartLists&&yt!==de)&&(tt=Je.slice(Dt+1).join(`
|
|
`),Ue.raw=Ue.raw.substring(0,Ue.raw.length-tt.length),Dt=ei-1)),Ut=dt||/\n\n(?!\s*$)/.test(rt),Dt!==ei-1&&(dt=rt.charAt(rt.length-1)===`
|
|
`,Ut||(Ut=dt)),Ut&&(Ue.loose=!0),Ct=/^\[[ xX]\] /.test(rt),Jt=void 0,Ct&&(Jt=rt[1]!==" ",rt=rt.replace(/^\[[ xX]\] +/,"")),Ue.items.push({type:"list_item",raw:oe,task:Ct,checked:Jt,loose:Ut,text:rt});return Ue}},fe.html=function(ie){var re=this.rules.block.html.exec(ie);if(re)return{type:this.options.sanitize?"paragraph":"html",raw:re[0],pre:!this.options.sanitizer&&(re[1]==="pre"||re[1]==="script"||re[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):ee(re[0]):re[0]}},fe.def=function(ie){var re=this.rules.block.def.exec(ie);if(re){re[3]&&(re[3]=re[3].substring(1,re[3].length-1));var oe=re[1].toLowerCase().replace(/\s+/g," ");return{tag:oe,raw:re[0],href:re[2],title:re[3]}}},fe.table=function(ie){var re=this.rules.block.table.exec(ie);if(re){var oe={type:"table",header:Y(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
|
|
`):[]};if(oe.header.length===oe.align.length){oe.raw=re[0];var de=oe.align.length,ye;for(ye=0;ye<de;ye++)/^ *-+: *$/.test(oe.align[ye])?oe.align[ye]="right":/^ *:-+: *$/.test(oe.align[ye])?oe.align[ye]="center":/^ *:-+ *$/.test(oe.align[ye])?oe.align[ye]="left":oe.align[ye]=null;for(de=oe.cells.length,ye=0;ye<de;ye++)oe.cells[ye]=Y(oe.cells[ye].replace(/^ *\| *| *\| *$/g,""),oe.header.length);return oe}}},fe.lheading=function(ie){var re=this.rules.block.lheading.exec(ie);if(re)return{type:"heading",raw:re[0],depth:re[2].charAt(0)==="="?1:2,text:re[1]}},fe.paragraph=function(ie){var re=this.rules.block.paragraph.exec(ie);if(re)return{type:"paragraph",raw:re[0],text:re[1].charAt(re[1].length-1)===`
|
|
`?re[1].slice(0,-1):re[1]}},fe.text=function(ie,re){var oe=this.rules.block.text.exec(ie);if(oe){var de=re[re.length-1];return de&&de.type==="text"?{raw:oe[0],text:oe[0]}:{type:"text",raw:oe[0],text:oe[0]}}},fe.escape=function(ie){var re=this.rules.inline.escape.exec(ie);if(re)return{type:"escape",raw:re[0],text:ee(re[1])}},fe.tag=function(ie,re,oe){var de=this.rules.inline.tag.exec(ie);if(de)return!re&&/^<a /i.test(de[0])?re=!0:re&&/^<\/a>/i.test(de[0])&&(re=!1),!oe&&/^<(pre|code|kbd|script)(\s|>)/i.test(de[0])?oe=!0:oe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(de[0])&&(oe=!1),{type:this.options.sanitize?"text":"html",raw:de[0],inLink:re,inRawBlock:oe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):ee(de[0]):de[0]}},fe.link=function(ie){var re=this.rules.inline.link.exec(ie);if(re){var oe=ae(re[2],"()");if(oe>-1){var de=re[0].indexOf("!")===0?5:4,ye=de+re[1].length+oe;re[2]=re[2].substring(0,oe),re[0]=re[0].substring(0,ye).trim(),re[3]=""}var Le=re[2],Ue="";if(this.options.pedantic){var Je=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Le);Je?(Le=Je[1],Ue=Je[3]):Ue=""}else Ue=re[3]?re[3].slice(1,-1):"";Le=Le.trim().replace(/^<([\s\S]*)>$/,"$1");var dt=le(re,{href:Le&&Le.replace(this.rules.inline._escapes,"$1"),title:Ue&&Ue.replace(this.rules.inline._escapes,"$1")},re[0]);return dt}},fe.reflink=function(ie,re){var oe;if((oe=this.rules.inline.reflink.exec(ie))||(oe=this.rules.inline.nolink.exec(ie))){var de=(oe[2]||oe[1]).replace(/\s+/g," ");if(de=re[de.toLowerCase()],!de||!de.href){var ye=oe[0].charAt(0);return{type:"text",raw:ye,text:ye}}var Le=le(oe,de,oe[0]);return Le}},fe.strong=function(ie,re,oe){oe===void 0&&(oe="");var de=this.rules.inline.strong.start.exec(ie);if(de&&(!de[1]||de[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){re=re.slice(-1*ie.length);var ye=de[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ye.lastIndex=0;for(var Le;(de=ye.exec(re))!=null;)if(Le=this.rules.inline.strong.middle.exec(re.slice(0,de.index+3)),Le)return{type:"strong",raw:ie.slice(0,Le[0].length),text:ie.slice(2,Le[0].length-2)}}},fe.em=function(ie,re,oe){oe===void 0&&(oe="");var de=this.rules.inline.em.start.exec(ie);if(de&&(!de[1]||de[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){re=re.slice(-1*ie.length);var ye=de[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ye.lastIndex=0;for(var Le;(de=ye.exec(re))!=null;)if(Le=this.rules.inline.em.middle.exec(re.slice(0,de.index+2)),Le)return{type:"em",raw:ie.slice(0,Le[0].length),text:ie.slice(1,Le[0].length-1)}}},fe.codespan=function(ie){var re=this.rules.inline.code.exec(ie);if(re){var oe=re[2].replace(/\n/g," "),de=/[^ ]/.test(oe),ye=oe.startsWith(" ")&&oe.endsWith(" ");return de&&ye&&(oe=oe.substring(1,oe.length-1)),oe=ee(oe,!0),{type:"codespan",raw:re[0],text:oe}}},fe.br=function(ie){var re=this.rules.inline.br.exec(ie);if(re)return{type:"br",raw:re[0]}},fe.del=function(ie){var re=this.rules.inline.del.exec(ie);if(re)return{type:"del",raw:re[0],text:re[1]}},fe.autolink=function(ie,re){var oe=this.rules.inline.autolink.exec(ie);if(oe){var de,ye;return oe[2]==="@"?(de=ee(this.options.mangle?re(oe[1]):oe[1]),ye="mailto:"+de):(de=ee(oe[1]),ye=de),{type:"link",raw:oe[0],text:de,href:ye,tokens:[{type:"text",raw:de,text:de}]}}},fe.url=function(ie,re){var oe;if(oe=this.rules.inline.url.exec(ie)){var de,ye;if(oe[2]==="@")de=ee(this.options.mangle?re(oe[0]):oe[0]),ye="mailto:"+de;else{var Le;do Le=oe[0],oe[0]=this.rules.inline._backpedal.exec(oe[0])[0];while(Le!==oe[0]);de=ee(oe[0]),oe[1]==="www."?ye="http://"+de:ye=de}return{type:"link",raw:oe[0],text:de,href:ye,tokens:[{type:"text",raw:de,text:de}]}}},fe.inlineText=function(ie,re,oe){var de=this.rules.inline.text.exec(ie);if(de){var ye;return re?ye=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):ee(de[0]):de[0]:ye=ee(this.options.smartypants?oe(de[0]):de[0]),{type:"text",raw:de[0],text:ye}}},_e}(),Te=j.noopTest,Ae=j.edit,Oe=j.merge,ce={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:Te,table:Te,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ce._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ce.def=Ae(ce.def).replace("label",ce._label).replace("title",ce._title).getRegex(),ce.bullet=/(?:[*+-]|\d{1,9}[.)])/,ce.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ce.item=Ae(ce.item,"gm").replace(/bull/g,ce.bullet).getRegex(),ce.list=Ae(ce.list).replace(/bull/g,ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ce.def.source+")").getRegex(),ce._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",ce._comment=/<!--(?!-?>)[\s\S]*?-->/,ce.html=Ae(ce.html,"i").replace("comment",ce._comment).replace("tag",ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ce.paragraph=Ae(ce._paragraph).replace("hr",ce.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",ce._tag).getRegex(),ce.blockquote=Ae(ce.blockquote).replace("paragraph",ce.paragraph).getRegex(),ce.normal=Oe({},ce),ce.gfm=Oe({},ce.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*|$)"}),ce.gfm.nptable=Ae(ce.gfm.nptable).replace("hr",ce.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",ce._tag).getRegex(),ce.gfm.table=Ae(ce.gfm.table).replace("hr",ce.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",ce._tag).getRegex(),ce.pedantic=Oe({},ce.normal,{html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ce._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:Te,paragraph:Ae(ce.normal._paragraph).replace("hr",ce.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Te,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:Te,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ue._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ue.punctuation=Ae(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=Ae(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=Ae(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=Ae(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=Ae(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=Ae(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=Ae(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=Ae(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=Ae(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=Ae(ue._blockSkip,"g").getRegex(),ue.overlapSkip=Ae(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ue.autolink=Ae(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=Ae(ue.tag).replace("comment",ce._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=Ae(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=Ae(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=Ae(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=Oe({},ue),ue.pedantic=Oe({},ue.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ae(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=Oe({},ue.normal,{escape:Ae(ue.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ue.gfm.url=Ae(ue.gfm.url,"i").replace("email",ue.gfm._extended_email).getRegex(),ue.breaks=Oe({},ue.gfm,{br:Ae(ue.br).replace("{2,}","*").getRegex(),text:Ae(ue.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Pe={block:ce,inline:ue},qe=G.defaults,ze=Pe.block,et=Pe.inline;function nt(_e){return _e.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 Ie(_e){var fe="",ve,ie,re=_e.length;for(ve=0;ve<re;ve++)ie=_e.charCodeAt(ve),Math.random()>.5&&(ie="x"+ie.toString(16)),fe+="&#"+ie+";";return fe}var Me=function(){function _e(ve){this.tokens=[],this.tokens.links=Object.create(null),this.options=ve||qe,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ie={block:ze.normal,inline:et.normal};this.options.pedantic?(ie.block=ze.pedantic,ie.inline=et.pedantic):this.options.gfm&&(ie.block=ze.gfm,this.options.breaks?ie.inline=et.breaks:ie.inline=et.gfm),this.tokenizer.rules=ie}_e.lex=function(ie,re){var oe=new _e(re);return oe.lex(ie)};var fe=_e.prototype;return fe.lex=function(ie){return ie=ie.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(ie,this.tokens,!0),this.inline(this.tokens),this.tokens},fe.blockTokens=function(ie,re,oe){re===void 0&&(re=[]),oe===void 0&&(oe=!0),ie=ie.replace(/^ +$/gm,"");for(var de,ye,Le,Ue;ie;){if(de=this.tokenizer.space(ie)){ie=ie.substring(de.raw.length),de.type&&re.push(de);continue}if(de=this.tokenizer.code(ie,re)){ie=ie.substring(de.raw.length),de.type?re.push(de):(Ue=re[re.length-1],Ue.raw+=`
|
|
`+de.raw,Ue.text+=`
|
|
`+de.text);continue}if(de=this.tokenizer.fences(ie)){ie=ie.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.heading(ie)){ie=ie.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.nptable(ie)){ie=ie.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.hr(ie)){ie=ie.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.blockquote(ie)){ie=ie.substring(de.raw.length),de.tokens=this.blockTokens(de.text,[],oe),re.push(de);continue}if(de=this.tokenizer.list(ie)){for(ie=ie.substring(de.raw.length),Le=de.items.length,ye=0;ye<Le;ye++)de.items[ye].tokens=this.blockTokens(de.items[ye].text,[],!1);re.push(de);continue}if(de=this.tokenizer.html(ie)){ie=ie.substring(de.raw.length),re.push(de);continue}if(oe&&(de=this.tokenizer.def(ie))){ie=ie.substring(de.raw.length),this.tokens.links[de.tag]||(this.tokens.links[de.tag]={href:de.href,title:de.title});continue}if(de=this.tokenizer.table(ie)){ie=ie.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.lheading(ie)){ie=ie.substring(de.raw.length),re.push(de);continue}if(oe&&(de=this.tokenizer.paragraph(ie))){ie=ie.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.text(ie,re)){ie=ie.substring(de.raw.length),de.type?re.push(de):(Ue=re[re.length-1],Ue.raw+=`
|
|
`+de.raw,Ue.text+=`
|
|
`+de.text);continue}if(ie){var Je="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(Je);break}else throw new Error(Je)}}return re},fe.inline=function(ie){var re,oe,de,ye,Le,Ue,Je=ie.length;for(re=0;re<Je;re++){Ue=ie[re];switch(Ue.type){case"paragraph":case"text":case"heading":{Ue.tokens=[],this.inlineTokens(Ue.text,Ue.tokens);break}case"table":{for(Ue.tokens={header:[],cells:[]},ye=Ue.header.length,oe=0;oe<ye;oe++)Ue.tokens.header[oe]=[],this.inlineTokens(Ue.header[oe],Ue.tokens.header[oe]);for(ye=Ue.cells.length,oe=0;oe<ye;oe++)for(Le=Ue.cells[oe],Ue.tokens.cells[oe]=[],de=0;de<Le.length;de++)Ue.tokens.cells[oe][de]=[],this.inlineTokens(Le[de],Ue.tokens.cells[oe][de]);break}case"blockquote":{this.inline(Ue.tokens);break}case"list":{for(ye=Ue.items.length,oe=0;oe<ye;oe++)this.inline(Ue.items[oe].tokens);break}}}return ie},fe.inlineTokens=function(ie,re,oe,de,ye){re===void 0&&(re=[]),oe===void 0&&(oe=!1),de===void 0&&(de=!1),ye===void 0&&(ye="");var Le,Ue=ie,Je;if(this.tokens.links){var dt=Object.keys(this.tokens.links);if(dt.length>0)for(;(Je=this.tokenizer.rules.inline.reflinkSearch.exec(Ue))!=null;)dt.includes(Je[0].slice(Je[0].lastIndexOf("[")+1,-1))&&(Ue=Ue.slice(0,Je.index)+"["+"a".repeat(Je[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Je=this.tokenizer.rules.inline.blockSkip.exec(Ue))!=null;)Ue=Ue.slice(0,Je.index)+"["+"a".repeat(Je[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ie;){if(Le=this.tokenizer.escape(ie)){ie=ie.substring(Le.raw.length),re.push(Le);continue}if(Le=this.tokenizer.tag(ie,oe,de)){ie=ie.substring(Le.raw.length),oe=Le.inLink,de=Le.inRawBlock,re.push(Le);continue}if(Le=this.tokenizer.link(ie)){ie=ie.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,de)),re.push(Le);continue}if(Le=this.tokenizer.reflink(ie,this.tokens.links)){ie=ie.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,de)),re.push(Le);continue}if(Le=this.tokenizer.strong(ie,Ue,ye)){ie=ie.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,de),re.push(Le);continue}if(Le=this.tokenizer.em(ie,Ue,ye)){ie=ie.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,de),re.push(Le);continue}if(Le=this.tokenizer.codespan(ie)){ie=ie.substring(Le.raw.length),re.push(Le);continue}if(Le=this.tokenizer.br(ie)){ie=ie.substring(Le.raw.length),re.push(Le);continue}if(Le=this.tokenizer.del(ie)){ie=ie.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,de),re.push(Le);continue}if(Le=this.tokenizer.autolink(ie,Ie)){ie=ie.substring(Le.raw.length),re.push(Le);continue}if(!oe&&(Le=this.tokenizer.url(ie,Ie))){ie=ie.substring(Le.raw.length),re.push(Le);continue}if(Le=this.tokenizer.inlineText(ie,de,nt)){ie=ie.substring(Le.raw.length),ye=Le.raw.slice(-1),re.push(Le);continue}if(ie){var rt="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(rt);break}else throw new Error(rt)}}return re},$(_e,null,[{key:"rules",get:function(){return{block:ze,inline:et}}}]),_e}(),Ge=G.defaults,se=j.cleanUrl,be=j.escape,xe=function(){function _e(ve){this.options=ve||Ge}var fe=_e.prototype;return fe.code=function(ie,re,oe){var de=(re||"").match(/\S*/)[0];if(this.options.highlight){var ye=this.options.highlight(ie,de);ye!=null&&ye!==ie&&(oe=!0,ie=ye)}return de?'<pre><code class="'+this.options.langPrefix+be(de,!0)+'">'+(oe?ie:be(ie,!0))+`</code></pre>
|
|
`:"<pre><code>"+(oe?ie:be(ie,!0))+`</code></pre>
|
|
`},fe.blockquote=function(ie){return`<blockquote>
|
|
`+ie+`</blockquote>
|
|
`},fe.html=function(ie){return ie},fe.heading=function(ie,re,oe,de){return this.options.headerIds?"<h"+re+' id="'+this.options.headerPrefix+de.slug(oe)+'">'+ie+"</h"+re+`>
|
|
`:"<h"+re+">"+ie+"</h"+re+`>
|
|
`},fe.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},fe.list=function(ie,re,oe){var de=re?"ol":"ul",ye=re&&oe!==1?' start="'+oe+'"':"";return"<"+de+ye+`>
|
|
`+ie+"</"+de+`>
|
|
`},fe.listitem=function(ie){return"<li>"+ie+`</li>
|
|
`},fe.checkbox=function(ie){return"<input "+(ie?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},fe.paragraph=function(ie){return"<p>"+ie+`</p>
|
|
`},fe.table=function(ie,re){return re&&(re="<tbody>"+re+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ie+`</thead>
|
|
`+re+`</table>
|
|
`},fe.tablerow=function(ie){return`<tr>
|
|
`+ie+`</tr>
|
|
`},fe.tablecell=function(ie,re){var oe=re.header?"th":"td",de=re.align?"<"+oe+' align="'+re.align+'">':"<"+oe+">";return de+ie+"</"+oe+`>
|
|
`},fe.strong=function(ie){return"<strong>"+ie+"</strong>"},fe.em=function(ie){return"<em>"+ie+"</em>"},fe.codespan=function(ie){return"<code>"+ie+"</code>"},fe.br=function(){return this.options.xhtml?"<br/>":"<br>"},fe.del=function(ie){return"<del>"+ie+"</del>"},fe.link=function(ie,re,oe){if(ie=se(this.options.sanitize,this.options.baseUrl,ie),ie===null)return oe;var de='<a href="'+be(ie)+'"';return re&&(de+=' title="'+re+'"'),de+=">"+oe+"</a>",de},fe.image=function(ie,re,oe){if(ie=se(this.options.sanitize,this.options.baseUrl,ie),ie===null)return oe;var de='<img src="'+ie+'" alt="'+oe+'"';return re&&(de+=' title="'+re+'"'),de+=this.options.xhtml?"/>":">",de},fe.text=function(ie){return ie},_e}(),Se=function(){function _e(){}var fe=_e.prototype;return fe.strong=function(ie){return ie},fe.em=function(ie){return ie},fe.codespan=function(ie){return ie},fe.del=function(ie){return ie},fe.html=function(ie){return ie},fe.text=function(ie){return ie},fe.link=function(ie,re,oe){return""+oe},fe.image=function(ie,re,oe){return""+oe},fe.br=function(){return""},_e}(),Be=function(){function _e(){this.seen={}}var fe=_e.prototype;return fe.slug=function(ie){var re=ie.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(re)){var oe=re;do this.seen[oe]++,re=oe+"-"+this.seen[oe];while(this.seen.hasOwnProperty(re))}return this.seen[re]=0,re},_e}(),He=G.defaults,Ye=j.unescape,Ve=function(){function _e(ve){this.options=ve||He,this.options.renderer=this.options.renderer||new xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Se,this.slugger=new Be}_e.parse=function(ie,re){var oe=new _e(re);return oe.parse(ie)};var fe=_e.prototype;return fe.parse=function(ie,re){re===void 0&&(re=!0);var oe="",de,ye,Le,Ue,Je,dt,rt,mt,yt,tt,Ut,Ct,Jt,ei,Dt,ci,Di,bt,fi=ie.length;for(de=0;de<fi;de++){tt=ie[de];switch(tt.type){case"space":continue;case"hr":{oe+=this.renderer.hr();continue}case"heading":{oe+=this.renderer.heading(this.parseInline(tt.tokens),tt.depth,Ye(this.parseInline(tt.tokens,this.textRenderer)),this.slugger);continue}case"code":{oe+=this.renderer.code(tt.text,tt.lang,tt.escaped);continue}case"table":{for(mt="",rt="",Ue=tt.header.length,ye=0;ye<Ue;ye++)rt+=this.renderer.tablecell(this.parseInline(tt.tokens.header[ye]),{header:!0,align:tt.align[ye]});for(mt+=this.renderer.tablerow(rt),yt="",Ue=tt.cells.length,ye=0;ye<Ue;ye++){for(dt=tt.tokens.cells[ye],rt="",Je=dt.length,Le=0;Le<Je;Le++)rt+=this.renderer.tablecell(this.parseInline(dt[Le]),{header:!1,align:tt.align[Le]});yt+=this.renderer.tablerow(rt)}oe+=this.renderer.table(mt,yt);continue}case"blockquote":{yt=this.parse(tt.tokens),oe+=this.renderer.blockquote(yt);continue}case"list":{for(Ut=tt.ordered,Ct=tt.start,Jt=tt.loose,Ue=tt.items.length,yt="",ye=0;ye<Ue;ye++)Dt=tt.items[ye],ci=Dt.checked,Di=Dt.task,ei="",Dt.task&&(bt=this.renderer.checkbox(ci),Jt?Dt.tokens.length>0&&Dt.tokens[0].type==="text"?(Dt.tokens[0].text=bt+" "+Dt.tokens[0].text,Dt.tokens[0].tokens&&Dt.tokens[0].tokens.length>0&&Dt.tokens[0].tokens[0].type==="text"&&(Dt.tokens[0].tokens[0].text=bt+" "+Dt.tokens[0].tokens[0].text)):Dt.tokens.unshift({type:"text",text:bt}):ei+=bt),ei+=this.parse(Dt.tokens,Jt),yt+=this.renderer.listitem(ei,Di,ci);oe+=this.renderer.list(yt,Ut,Ct);continue}case"html":{oe+=this.renderer.html(tt.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline(tt.tokens));continue}case"text":{for(yt=tt.tokens?this.parseInline(tt.tokens):tt.text;de+1<fi&&ie[de+1].type==="text";)tt=ie[++de],yt+=`
|
|
`+(tt.tokens?this.parseInline(tt.tokens):tt.text);oe+=re?this.renderer.paragraph(yt):yt;continue}default:{var _t='Token with "'+tt.type+'" type was not found.';if(this.options.silent){console.error(_t);return}else throw new Error(_t)}}}return oe},fe.parseInline=function(ie,re){re=re||this.renderer;var oe="",de,ye,Le=ie.length;for(de=0;de<Le;de++){ye=ie[de];switch(ye.type){case"escape":{oe+=re.text(ye.text);break}case"html":{oe+=re.html(ye.text);break}case"link":{oe+=re.link(ye.href,ye.title,this.parseInline(ye.tokens,re));break}case"image":{oe+=re.image(ye.href,ye.title,ye.text);break}case"strong":{oe+=re.strong(this.parseInline(ye.tokens,re));break}case"em":{oe+=re.em(this.parseInline(ye.tokens,re));break}case"codespan":{oe+=re.codespan(ye.text);break}case"br":{oe+=re.br();break}case"del":{oe+=re.del(this.parseInline(ye.tokens,re));break}case"text":{oe+=re.text(ye.text);break}default:{var Ue='Token with "'+ye.type+'" type was not found.';if(this.options.silent){console.error(Ue);return}else throw new Error(Ue)}}}return oe},_e}(),lt=j.merge,$e=j.checkSanitizeDeprecation,Qe=j.escape,De=G.getDefaults,ct=G.changeDefaults,ut=G.defaults;function ke(_e,fe,ve){if(typeof _e=="undefined"||_e===null)throw new Error("marked(): input parameter is undefined or null");if(typeof _e!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(_e)+", string expected");if(typeof fe=="function"&&(ve=fe,fe=null),fe=lt({},ke.defaults,fe||{}),$e(fe),ve){var ie=fe.highlight,re;try{re=Me.lex(_e,fe)}catch(Le){return ve(Le)}var oe=function(Ue){var Je;if(!Ue)try{Je=Ve.parse(re,fe)}catch(dt){Ue=dt}return fe.highlight=ie,Ue?ve(Ue):ve(null,Je)};if(!ie||ie.length<3)return oe();if(delete fe.highlight,!re.length)return oe();var de=0;ke.walkTokens(re,function(Le){Le.type==="code"&&(de++,setTimeout(function(){ie(Le.text,Le.lang,function(Ue,Je){if(Ue)return oe(Ue);Je!=null&&Je!==Le.text&&(Le.text=Je,Le.escaped=!0),de--,de===0&&oe()})},0))}),de===0&&oe();return}try{var ye=Me.lex(_e,fe);return fe.walkTokens&&ke.walkTokens(ye,fe.walkTokens),Ve.parse(ye,fe)}catch(Le){if(Le.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,fe.silent)return"<p>An error occurred:</p><pre>"+Qe(Le.message+"",!0)+"</pre>";throw Le}}ke.options=ke.setOptions=function(_e){return lt(ke.defaults,_e),ct(ke.defaults),ke},ke.getDefaults=De,ke.defaults=ut,ke.use=function(_e){var fe=lt({},_e);if(_e.renderer&&function(){var ie=ke.defaults.renderer||new xe,re=function(ye){var Le=ie[ye];ie[ye]=function(){for(var Ue=arguments.length,Je=new Array(Ue),dt=0;dt<Ue;dt++)Je[dt]=arguments[dt];var rt=_e.renderer[ye].apply(ie,Je);return rt===!1&&(rt=Le.apply(ie,Je)),rt}};for(var oe in _e.renderer)re(oe);fe.renderer=ie}(),_e.tokenizer&&function(){var ie=ke.defaults.tokenizer||new Ee,re=function(ye){var Le=ie[ye];ie[ye]=function(){for(var Ue=arguments.length,Je=new Array(Ue),dt=0;dt<Ue;dt++)Je[dt]=arguments[dt];var rt=_e.tokenizer[ye].apply(ie,Je);return rt===!1&&(rt=Le.apply(ie,Je)),rt}};for(var oe in _e.tokenizer)re(oe);fe.tokenizer=ie}(),_e.walkTokens){var ve=ke.defaults.walkTokens;fe.walkTokens=function(ie){_e.walkTokens(ie),ve&&ve(ie)}}ke.setOptions(fe)},ke.walkTokens=function(_e,fe){for(var ve=N(_e),ie;!(ie=ve()).done;){var re=ie.value;fe(re);switch(re.type){case"table":{for(var oe=N(re.tokens.header),de;!(de=oe()).done;){var ye=de.value;ke.walkTokens(ye,fe)}for(var Le=N(re.tokens.cells),Ue;!(Ue=Le()).done;)for(var Je=Ue.value,dt=N(Je),rt;!(rt=dt()).done;){var mt=rt.value;ke.walkTokens(mt,fe)}break}case"list":{ke.walkTokens(re.items,fe);break}default:re.tokens&&ke.walkTokens(re.tokens,fe)}}},ke.Parser=Ve,ke.parser=Ve.parse,ke.Renderer=xe,ke.TextRenderer=Se,ke.Lexer=Me,ke.lexer=Me.lex,ke.Tokenizer=Ee,ke.Slugger=Be,ke.parse=ke;var Ne=ke;return Ne})},ELLl:function(ot,ge,J){(function(ne){ne(J("VrN/"))})(function(ne){var $={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},k=ne.Pos;ne.defineOption("autoCloseBrackets",!1,function(a,f,l){l&&l!=ne.Init&&(a.removeKeyMap(N),a.state.closeBrackets=null),f&&(U(X(f,"pairs")),a.state.closeBrackets=f,a.addKeyMap(N))});function X(a,f){return f=="pairs"&&typeof a=="string"?a:typeof a=="object"&&a[f]!=null?a[f]:$[f]}var N={Backspace:i,Enter:D};function U(a){for(var f=0;f<a.length;f++){var l=a.charAt(f),h="'"+l+"'";N[h]||(N[h]=G(l))}}U($.pairs+"`");function G(a){return function(f){return d(f,a)}}function W(a){var f=a.state.closeBrackets;if(!f||f.override)return f;var l=a.getModeAt(a.getCursor());return l.closeBrackets||f}function i(a){var f=W(a);if(!f||a.getOption("disableInput"))return ne.Pass;for(var l=X(f,"pairs"),h=a.listSelections(),o=0;o<h.length;o++){if(!h[o].empty())return ne.Pass;var s=m(a,h[o].head);if(!s||l.indexOf(s)%2!=0)return ne.Pass}for(var o=h.length-1;o>=0;o--){var A=h[o].head;a.replaceRange("",k(A.line,A.ch-1),k(A.line,A.ch+1),"+delete")}}function D(a){var f=W(a),l=f&&X(f,"explode");if(!l||a.getOption("disableInput"))return ne.Pass;for(var h=a.listSelections(),o=0;o<h.length;o++){if(!h[o].empty())return ne.Pass;var s=m(a,h[o].head);if(!s||l.indexOf(s)%2!=0)return ne.Pass}a.operation(function(){var A=a.lineSeparator()||`
|
|
`;a.replaceSelection(A+A,null),a.execCommand("goCharLeft"),h=a.listSelections();for(var _=0;_<h.length;_++){var w=h[_].head.line;a.indentLine(w,null,!0),a.indentLine(w+1,null,!0)}})}function g(a){var f=ne.cmpPos(a.anchor,a.head)>0;return{anchor:new k(a.anchor.line,a.anchor.ch+(f?-1:1)),head:new k(a.head.line,a.head.ch+(f?1:-1))}}function d(a,f){var l=W(a);if(!l||a.getOption("disableInput"))return ne.Pass;var h=X(l,"pairs"),o=h.indexOf(f);if(o==-1)return ne.Pass;for(var s=X(l,"closeBefore"),A=X(l,"triples"),_=h.charAt(o+1)==f,w=a.listSelections(),L=o%2==0,R,C=0;C<w.length;C++){var S=w[C],x=S.head,p,T=a.getRange(x,k(x.line,x.ch+1));if(L&&!S.empty())p="surround";else if((_||!L)&&T==f)_&&u(a,x)?p="both":A.indexOf(f)>=0&&a.getRange(x,k(x.line,x.ch+3))==f+f+f?p="skipThree":p="skip";else if(_&&x.ch>1&&A.indexOf(f)>=0&&a.getRange(k(x.line,x.ch-2),x)==f+f){if(x.ch>2&&/\bstring/.test(a.getTokenTypeAt(k(x.line,x.ch-2))))return ne.Pass;p="addFour"}else if(_){var v=x.ch==0?" ":a.getRange(k(x.line,x.ch-1),x);if(!ne.isWordChar(T)&&v!=f&&!ne.isWordChar(v))p="both";else return ne.Pass}else if(L&&(T.length===0||/\s/.test(T)||s.indexOf(T)>-1))p="both";else return ne.Pass;if(!R)R=p;else if(R!=p)return ne.Pass}var y=o%2?h.charAt(o-1):f,F=o%2?f:h.charAt(o+1);a.operation(function(){if(R=="skip")a.execCommand("goCharRight");else if(R=="skipThree")for(var B=0;B<3;B++)a.execCommand("goCharRight");else if(R=="surround"){for(var O=a.getSelections(),B=0;B<O.length;B++)O[B]=y+O[B]+F;a.replaceSelections(O,"around"),O=a.listSelections().slice();for(var B=0;B<O.length;B++)O[B]=g(O[B]);a.setSelections(O)}else R=="both"?(a.replaceSelection(y+F,null),a.triggerElectric(y+F),a.execCommand("goCharLeft")):R=="addFour"&&(a.replaceSelection(y+y+y+y,"before"),a.execCommand("goCharRight"))})}function m(a,f){var l=a.getRange(k(f.line,f.ch-1),k(f.line,f.ch+1));return l.length==2?l:null}function u(a,f){var l=a.getTokenAt(k(f.line,f.ch+1));return/\bstring/.test(l.type)&&l.start==f.ch&&(f.ch==0||!/\bstring/.test(a.getTokenTypeAt(f)))}})},FWmy:function(ot,ge,J){"use strict";J.d(ge,"a",function(){return ne});function ne($,k){if(!$)throw new Error(k?`Assertion failed (${k})`:"Assertion Failed")}},HmJG:function(ot,ge,J){},JYp7:function(ot,ge,J){"use strict";J.d(ge,"a",function(){return ne});var ne;(function($){function k(s){return s&&typeof s=="object"&&typeof s[Symbol.iterator]=="function"}$.is=k;const X=Object.freeze([]);function N(){return X}$.empty=N;function*U(s){yield s}$.single=U;function G(s){return s||X}$.from=G;function W(s){return!s||s[Symbol.iterator]().next().done===!0}$.isEmpty=W;function i(s){return s[Symbol.iterator]().next().value}$.first=i;function D(s,A){for(const _ of s)if(A(_))return!0;return!1}$.some=D;function g(s,A){for(const _ of s)if(A(_))return _;return}$.find=g;function*d(s,A){for(const _ of s)A(_)&&(yield _)}$.filter=d;function*m(s,A){let _=0;for(const w of s)yield A(w,_++)}$.map=m;function*u(...s){for(const A of s)for(const _ of A)yield _}$.concat=u;function*a(s){for(const A of s)for(const _ of A)yield _}$.concatNested=a;function f(s,A,_){let w=_;for(const L of s)w=A(w,L);return w}$.reduce=f;function*l(s,A,_=s.length){for(A<0&&(A+=s.length),_<0?_+=s.length:_>s.length&&(_=s.length);A<_;A++)yield s[A]}$.slice=l;function h(s,A=Number.POSITIVE_INFINITY){const _=[];if(A===0)return[_,s];const w=s[Symbol.iterator]();for(let L=0;L<A;L++){const R=w.next();if(R.done)return[_,$.empty()];_.push(R.value)}return[_,{[Symbol.iterator](){return w}}]}$.consume=h;function o(s,A,_=(w,L)=>w===L){const w=s[Symbol.iterator](),L=A[Symbol.iterator]();for(;;){const R=w.next(),C=L.next();if(R.done!==C.done)return!1;if(R.done)return!0;if(!_(R.value,C.value))return!1}}$.equals=o})(ne||(ne={}))},LSTS:function(ot,ge,J){"use strict";Object.defineProperty(ge,"__esModule",{value:!0});var ne=function(){function d(m,u){for(var a=0;a<u.length;a++){var f=u[a];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}return function(m,u,a){return u&&d(m.prototype,u),a&&d(m,a),m}}(),$=J("q1tI"),k=U($),X=J("17x9"),N=U(X);function U(d){return d&&d.__esModule?d:{default:d}}function G(d,m){var u={};for(var a in d){if(m.indexOf(a)>=0)continue;if(!Object.prototype.hasOwnProperty.call(d,a))continue;u[a]=d[a]}return u}function W(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}function i(d,m){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:d}function D(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(d,m):d.__proto__=m)}var g=function(d){D(m,d);function m(u){W(this,m);var a=i(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,u));return a.scrollListener=a.scrollListener.bind(a),a.eventListenerOptions=a.eventListenerOptions.bind(a),a.mousewheelListener=a.mousewheelListener.bind(a),a}return ne(m,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var a=this.getParentElement(this.scrollComponent);a.scrollTop=a.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var a=!1,f={get passive(){a=!0}};try{document.addEventListener("test",null,f),document.removeEventListener("test",null,f)}catch(l){}return a}},{key:"eventListenerOptions",value:function(){var a=this.props.useCapture;return this.isPassiveSupported()&&(a={useCapture:this.props.useCapture,passive:!0}),a}},{key:"setDefaultLoader",value:function(a){this.defaultLoader=a}},{key:"detachMousewheelListener",value:function(){var a=window;this.props.useWindow===!1&&(a=this.scrollComponent.parentNode),a.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var a=window;this.props.useWindow===!1&&(a=this.getParentElement(this.scrollComponent)),a.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),a.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(a){var f=this.props.getScrollParent&&this.props.getScrollParent();return f!=null?f:a&&a.parentNode}},{key:"filterProps",value:function(a){return a}},{key:"attachScrollListener",value:function(){var a=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!a)return;var f=window;this.props.useWindow===!1&&(f=a),f.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),f.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),f.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(a){a.deltaY===1&&!this.isPassiveSupported()&&a.preventDefault()}},{key:"scrollListener",value:function(){var a=this.scrollComponent,f=window,l=this.getParentElement(a),h=void 0;if(this.props.useWindow){var o=document.documentElement||document.body.parentNode||document.body,s=f.pageYOffset!==void 0?f.pageYOffset:o.scrollTop;this.props.isReverse?h=s:h=this.calculateOffset(a,s)}else this.props.isReverse?h=l.scrollTop:h=a.scrollHeight-l.scrollTop-l.clientHeight;h<Number(this.props.threshold)&&a&&a.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=l.scrollHeight,this.beforeScrollTop=l.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(a,f){return a?this.calculateTopPosition(a)+(a.offsetHeight-f-window.innerHeight):0}},{key:"calculateTopPosition",value:function(a){return a?a.offsetTop+this.calculateTopPosition(a.offsetParent):0}},{key:"render",value:function(){var a=this,f=this.filterProps(this.props),l=f.children,h=f.element,o=f.hasMore,s=f.initialLoad,A=f.isReverse,_=f.loader,w=f.loadMore,L=f.pageStart,R=f.ref,C=f.threshold,S=f.useCapture,x=f.useWindow,p=f.getScrollParent,T=G(f,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);T.ref=function(y){a.scrollComponent=y,R&&R(y)};var v=[l];return o&&(_?A?v.unshift(_):v.push(_):this.defaultLoader&&(A?v.unshift(this.defaultLoader):v.push(this.defaultLoader))),k.default.createElement(h,T,v)}}]),m}($.Component);g.propTypes={children:N.default.node.isRequired,element:N.default.node,hasMore:N.default.bool,initialLoad:N.default.bool,isReverse:N.default.bool,loader:N.default.node,loadMore:N.default.func.isRequired,pageStart:N.default.number,ref:N.default.func,getScrollParent:N.default.func,threshold:N.default.number,useCapture:N.default.bool,useWindow:N.default.bool},g.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},ge.default=g,ot.exports=ge.default},LdHM:function(ot,ge,J){"use strict";J.d(ge,"b",function(){return s}),J.d(ge,"a",function(){return _});var ne=J("1OyB"),$=J("vuIU"),k=J("Ji7U"),X=J("LK+K"),N=J("q1tI"),U=J("rePB"),G=J("Ff2n"),W=J("ODXe"),i=J("4IlW"),D=J("bX4T"),g=J("YrtM"),d=J("TSYQ"),m=J.n(d),u=J("+nKL"),a=J("8OUc"),f=function(Y,ee){var ae=Y.prefixCls,le=Y.id,Re=Y.flattenOptions,Ee=Y.childrenAsData,Te=Y.values,Ae=Y.searchValue,Oe=Y.multiple,ce=Y.defaultActiveFirstOption,ue=Y.height,Pe=Y.itemHeight,qe=Y.notFoundContent,ze=Y.open,et=Y.menuItemSelectedIcon,nt=Y.virtual,Ie=Y.onSelect,Me=Y.onToggleOpen,Ge=Y.onActiveValue,se=Y.onScroll,be=Y.onMouseEnter,xe="".concat(ae,"-item"),Se=Object(g.a)(function(){return Re},[ze,Re],function(Ne,_e){return _e[0]&&Ne[1]!==_e[1]}),Be=N.useRef(null),He=function(_e){_e.preventDefault()},Ye=function(_e){Be.current&&Be.current.scrollTo({index:_e})},Ve=function(_e){for(var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ve=Se.length,ie=0;ie<ve;ie+=1){var re=(_e+ie*fe+ve)%ve,oe=Se[re],de=oe.group,ye=oe.data;if(!de&&!ye.disabled)return re}return-1},lt=N.useState(function(){return Ve(0)}),$e=Object(W.a)(lt,2),Qe=$e[0],De=$e[1],ct=function(_e){De(_e);var fe=Se[_e];if(!fe){Ge(null,-1);return}Ge(fe.data.value,_e)};N.useEffect(function(){ct(ce!==!1?Ve(0):-1)},[Se.length,Ae]),N.useEffect(function(){var Ne=setTimeout(function(){if(!Oe&&ze&&Te.size===1){var _e=Array.from(Te)[0],fe=Se.findIndex(function(ve){var ie=ve.data;return ie.value===_e});ct(fe),Ye(fe)}});return function(){return clearTimeout(Ne)}},[ze]);var ut=function(_e){_e!==void 0&&Ie(_e,{selected:!Te.has(_e)}),Oe||Me(!1)};if(N.useImperativeHandle(ee,function(){return{onKeyDown:function(_e){var fe=_e.which;switch(fe){case i.a.UP:case i.a.DOWN:{var ve=0;if(fe===i.a.UP?ve=-1:fe===i.a.DOWN&&(ve=1),ve!==0){var ie=Ve(Qe+ve,ve);Ye(ie),ct(ie)}break}case i.a.ENTER:{var re=Se[Qe];re&&!re.data.disabled?ut(re.data.value):ut(void 0),ze&&_e.preventDefault();break}case i.a.ESC:Me(!1)}},onKeyUp:function(){},scrollTo:function(_e){Ye(_e)}}}),Se.length===0)return N.createElement("div",{role:"listbox",id:"".concat(le,"_list"),className:"".concat(xe,"-empty"),onMouseDown:He},qe);function ke(Ne){var _e=Se[Ne];if(!_e)return null;var fe=_e.data||{},ve=fe.value,ie=fe.label,re=fe.children,oe=Object(D.a)(fe,!0),de=Ee?re:ie;return _e?N.createElement("div",Object.assign({"aria-label":typeof de=="string"?de:null},oe,{key:Ne,role:"option",id:"".concat(le,"_list_").concat(Ne),"aria-selected":Te.has(ve)}),ve):null}return N.createElement(N.Fragment,null,N.createElement("div",{role:"listbox",id:"".concat(le,"_list"),style:{height:0,width:0,overflow:"hidden"}},ke(Qe-1),ke(Qe),ke(Qe+1)),N.createElement(u.a,{itemKey:"key",ref:Be,data:Se,height:ue,itemHeight:Pe,fullHeight:!1,onMouseDown:He,onScroll:se,virtual:nt,onMouseEnter:be},function(Ne,_e){var fe,ve=Ne.group,ie=Ne.groupOption,re=Ne.data,oe=re.label,de=re.key;if(ve)return N.createElement("div",{className:m()(xe,"".concat(xe,"-group"))},oe!==void 0?oe:de);var ye=re.disabled,Le=re.value,Ue=re.title,Je=re.children,dt=re.style,rt=re.className,mt=Object(G.a)(re,["disabled","value","title","children","style","className"]),yt=Te.has(Le),tt="".concat(xe,"-option"),Ut=m()(xe,tt,rt,(fe={},Object(U.a)(fe,"".concat(tt,"-grouped"),ie),Object(U.a)(fe,"".concat(tt,"-active"),Qe===_e&&!ye),Object(U.a)(fe,"".concat(tt,"-disabled"),ye),Object(U.a)(fe,"".concat(tt,"-selected"),yt),fe)),Ct=Ee?Je:oe,Jt=!et||typeof et=="function"||yt;return N.createElement("div",Object.assign({},mt,{"aria-selected":yt,className:Ut,title:Ue,onMouseMove:function(){if(Qe===_e||ye)return;ct(_e)},onClick:function(){ye||ut(Le)},style:dt}),N.createElement("div",{className:"".concat(tt,"-content")},Ct||Le),N.isValidElement(et)||yt,Jt&&N.createElement(a.a,{className:"".concat(xe,"-option-state"),customizeIcon:et,customizeIconProps:{isSelected:yt}},yt?"\u2713":null))}))},l=N.forwardRef(f);l.displayName="OptionList";var h=l,o=function(){return null};o.isSelectOption=!0;var s=o,A=function(){return null};A.isSelectOptGroup=!0;var _=A,w=J("VTBJ"),L=J("Zm9Q");function R(b){var Y=b.key,ee=b.props,ae=ee.children,le=ee.value,Re=Object(G.a)(ee,["children","value"]);return Object(w.a)({key:Y,value:le!==void 0?le:Y,children:ae},Re)}function C(b){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(b).map(function(ee,ae){if(!N.isValidElement(ee)||!ee.type)return null;var le=ee.type.isSelectOptGroup,Re=ee.key,Ee=ee.props,Te=Ee.children,Ae=Object(G.a)(Ee,["children"]);return Y||!le?R(ee):Object(w.a)(Object(w.a)({key:"__RC_SELECT_GRP__".concat(Re===null?ae:Re,"__"),label:Re},Ae),{},{options:C(Te)})}).filter(function(ee){return ee})}var S=J("2Qr1"),x=J("qNPg"),p=J("U8pU"),T=J("Kwbf"),v=J("WKfj");function y(b){var Y=b.mode,ee=b.options,ae=b.children,le=b.backfill,Re=b.allowClear,Ee=b.placeholder,Te=b.getInputElement,Ae=b.showSearch,Oe=b.onSearch,ce=b.defaultOpen,ue=b.autoFocus,Pe=b.labelInValue,qe=b.value,ze=b.inputValue,et=b.optionLabelProp,nt=Y==="multiple"||Y==="tags",Ie=Ae!==void 0?Ae:nt||Y==="combobox",Me=ee||C(ae);if(Object(T.a)(Y!=="tags"||Me.every(function(xe){return!xe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var Ge=Me.some(function(xe){return xe.options?xe.options.some(function(Se){return typeof("value"in Se?Se.value:Se.key)=="number"}):typeof("value"in xe?xe.value:xe.key)=="number"});Object(T.a)(!Ge,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(T.a)(Y!=="combobox"||!et,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(T.a)(Y==="combobox"||!le,"`backfill` only works with `combobox` mode."),Object(T.a)(Y==="combobox"||!Te,"`getInputElement` only work with `combobox` mode."),Object(T.b)(Y!=="combobox"||!Te||!Re||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Oe&&!Ie&&Y!=="combobox"&&Y!=="tags"&&Object(T.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(T.b)(!ce||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),qe!=null){var se=Object(v.d)(qe);Object(T.a)(!Pe||se.every(function(xe){return Object(p.a)(xe)==="object"&&("key"in xe||"value"in xe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(T.a)(!nt||Array.isArray(qe),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var be=null;Object(L.a)(ae).some(function(xe){if(!N.isValidElement(xe)||!xe.type)return!1;var Se=xe.type;if(Se.isSelectOption)return!1;if(Se.isSelectOptGroup){var Be=Object(L.a)(xe.props.children).every(function(He){return!N.isValidElement(He)||!xe.type||He.type.isSelectOption?!0:(be=He.type,!1)});return!Be}return be=Se,!0}),be&&Object(T.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(be.displayName||be.name||be,"`.")),Object(T.a)(ze===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var F=y,B=Object(x.a)({prefixCls:"rc-select",components:{optionList:h},convertChildrenToData:C,flattenOptions:S.d,getLabeledValue:S.e,filterOptions:S.b,isValueDisabled:S.g,findValueOption:S.c,warningProps:F,fillOptionsWithMissingValue:S.a}),O=function(b){Object(k.a)(ee,b);var Y=Object(X.a)(ee);function ee(){var ae;return Object(ne.a)(this,ee),ae=Y.apply(this,arguments),ae.selectRef=N.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object($.a)(ee,[{key:"render",value:function(){return N.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),ee}(N.Component);O.Option=s,O.OptGroup=_;var j=O,P=ge.c=j},M8RZ:function(ot,ge,J){"use strict";J.d(ge,"a",function(){return i});var ne=J("fWQN"),$=J("mtLc"),k=J("yKVA"),X=J("879j"),N=J("q1tI"),U=J.n(N),G=J("i8i4"),W=J.n(G),i=function(D){Object(k.a)(d,D);var g=Object(X.a)(d);function d(m){var u;Object(ne.a)(this,d),u=g.call(this,m);var a=window.document;return u.node=a.createElement("div"),a.body.appendChild(u.node),u}return Object($.a)(d,[{key:"render",value:function(){var u=this.props.children;return Object(G.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),d}(U.a.Component)},MI8n:function(ot,ge,J){"use strict";J.d(ge,"c",function(){return N}),J.d(ge,"b",function(){return i}),J.d(ge,"e",function(){return D}),J.d(ge,"a",function(){return g}),J.d(ge,"d",function(){return d}),J.d(ge,"f",function(){return m});var ne=J("/cxE"),$=J("pmY6"),k=J("24hK"),X=J("5Y4S"),N;(function(u){u.None=()=>$.a.None;function a(y){return(F,B=null,O)=>{let j=!1,P;return P=y(b=>j?void 0:(P?P.dispose():j=!0,F.call(B,b)),null,O),j&&P.dispose(),P}}u.once=a;function f(y,F){return _((B,O=null,j)=>y(P=>B.call(O,F(P)),null,j))}u.map=f;function l(y,F){return _((B,O=null,j)=>y(P=>{F(P),B.call(O,P)},null,j))}u.forEach=l;function h(y,F){return _((B,O=null,j)=>y(P=>F(P)&&B.call(O,P),null,j))}u.filter=h;function o(y){return y}u.signal=o;function s(...y){return(F,B=null,O)=>Object($.e)(...y.map(j=>j(P=>F.call(B,P),null,O)))}u.any=s;function A(y,F,B){let O=B;return f(y,j=>(O=F(O,j),O))}u.reduce=A;function _(y){let F;const B=new i({onFirstListenerAdd(){F=y(B.fire,B)},onLastListenerRemove(){F.dispose()}});return B.event}function w(y,F,B=100,O=!1,j){let P,b,Y,ee=0;const ae=new i({leakWarningThreshold:j,onFirstListenerAdd(){P=y(le=>{ee++,b=F(b,le),O&&!Y&&(ae.fire(b),b=void 0),clearTimeout(Y),Y=setTimeout(()=>{const Re=b;b=void 0,Y=void 0,(!O||ee>1)&&ae.fire(Re),ee=0},B)})},onLastListenerRemove(){P.dispose()}});return ae.event}u.debounce=w;function L(y,F=(B,O)=>B===O){let B=!0,O;return h(y,j=>{const P=B||!F(j,O);return B=!1,O=j,P})}u.latch=L;function R(y,F){return[u.filter(y,F),u.filter(y,B=>!F(B))]}u.split=R;function C(y,F=!1,B=[]){let O=B.slice(),j=y(Y=>{O?O.push(Y):b.fire(Y)});const P=()=>{O&&O.forEach(Y=>b.fire(Y)),O=null},b=new i({onFirstListenerAdd(){j||(j=y(Y=>b.fire(Y)))},onFirstListenerDidAdd(){O&&(F?setTimeout(P):P())},onLastListenerRemove(){j&&j.dispose(),j=null}});return b.event}u.buffer=C;class S{constructor(y){this.event=y}map(y){return new S(f(this.event,y))}forEach(y){return new S(l(this.event,y))}filter(y){return new S(h(this.event,y))}reduce(y,F){return new S(A(this.event,y,F))}latch(){return new S(L(this.event))}debounce(y,F=100,B=!1,O){return new S(w(this.event,y,F,B,O))}on(y,F,B){return this.event(y,F,B)}once(y,F,B){return a(this.event)(y,F,B)}}function x(y){return new S(y)}u.chain=x;function p(y,F,B=O=>O){const O=(...Y)=>b.fire(B(...Y)),j=()=>y.on(F,O),P=()=>y.removeListener(F,O),b=new i({onFirstListenerAdd:j,onLastListenerRemove:P});return b.event}u.fromNodeEventEmitter=p;function T(y,F,B=O=>O){const O=(...Y)=>b.fire(B(...Y)),j=()=>y.addEventListener(F,O),P=()=>y.removeEventListener(F,O),b=new i({onFirstListenerAdd:j,onLastListenerRemove:P});return b.event}u.fromDOMEventEmitter=T;function v(y){return new Promise(F=>a(y)(F))}u.toPromise=v})(N||(N={}));class U{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${U._idPool++}`}start(u){this._stopWatch=new X.a(!0),this._listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this._elapsedOverall+=u,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${u.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}U._idPool=0;let G=-1;class W{constructor(u,a=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=a,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let a=G;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||u<a)return;this._stacks||(this._stacks=new Map);const f=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),l=this._stacks.get(f)||0;if(this._stacks.set(f,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let h,o=0;for(const[s,A]of this._stacks)(!h||o<A)&&(h=s,o=A);console.warn(`[${this.name}] potential listener LEAK detected, having ${u} listeners already. MOST frequent listener (${o}):`),console.warn(h)}return()=>{const h=this._stacks.get(f)||0;this._stacks.set(f,h-1)}}}class i{constructor(u){var a;this._disposed=!1,this._options=u,this._leakageMon=G>0?new W(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((a=this._options)===null||a===void 0?void 0:a._profName)?new U(this._options._profName):void 0}get event(){return this._event||(this._event=(u,a,f)=>{var l;this._listeners||(this._listeners=new k.a);const h=this._listeners.isEmpty();h&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const o=this._listeners.push(a?[u,a]:u);h&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,a);const s=(l=this._leakageMon)===null||l===void 0?void 0:l.check(this._listeners.size),A=Object($.i)(()=>{if(s&&s(),!this._disposed&&(o(),this._options&&this._options.onLastListenerRemove)){const _=this._listeners&&!this._listeners.isEmpty();_||this._options.onLastListenerRemove(this)}});return f instanceof $.b?f.add(A):Array.isArray(f)&&f.push(A),A}),this._event}fire(u){var a,f;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new k.a);for(let l of this._listeners)this._deliveryQueue.push([l,u]);for((a=this._perfMon)===null||a===void 0||a.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[l,h]=this._deliveryQueue.shift();try{typeof l=="function"?l.call(void 0,h):l[0].call(l[1],h)}catch(o){Object(ne.f)(o)}}(f=this._perfMon)===null||f===void 0||f.stop()}}dispose(){var u,a,f,l,h;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(a=this._deliveryQueue)===null||a===void 0||a.clear(),(l=(f=this._options)===null||f===void 0?void 0:f.onLastListenerRemove)===null||l===void 0||l.call(f),(h=this._leakageMon)===null||h===void 0||h.dispose())}}class D extends i{constructor(u){super(u);this._isPaused=0,this._eventQueue=new k.a,this._mergeFn=u==null?void 0:u.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._listeners&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}class g extends D{constructor(u){var a;super(u);this._delay=(a=u.delay)!==null&&a!==void 0?a:100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}class d{constructor(){this.buffers=[]}wrapEvent(u){return(a,f,l)=>u(h=>{const o=this.buffers[this.buffers.length-1];o?o.push(()=>a.call(f,h)):a.call(f,h)},void 0,l)}bufferEvents(u){const a=[];this.buffers.push(a);const f=u();return this.buffers.pop(),a.forEach(l=>l()),f}}class m{constructor(){this.listening=!1,this.inputEvent=N.None,this.inputEventListener=$.a.None,this.emitter=new i({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(ot,ge,J){"use strict";(function(ne,$){J.d(ge,"b",function(){return f}),J.d(ge,"i",function(){return s}),J.d(ge,"f",function(){return A}),J.d(ge,"d",function(){return _}),J.d(ge,"g",function(){return w}),J.d(ge,"h",function(){return L}),J.d(ge,"c",function(){return R}),J.d(ge,"k",function(){return C}),J.d(ge,"j",function(){return S}),J.d(ge,"a",function(){return x}),J.d(ge,"e",function(){return v});var k;const X="en";let N=!1,U=!1,G=!1,W=!1,i=!1,D=!1,g=!1,d,m=X,u,a;const f=typeof self=="object"?self:typeof ne=="object"?ne:{};let l;typeof f.vscode!="undefined"&&typeof f.vscode.process!="undefined"?l=f.vscode.process:typeof $!="undefined"&&(l=$);const h=typeof((k=l==null?void 0:l.versions)===null||k===void 0?void 0:k.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!h)a=navigator.userAgent,N=a.indexOf("Windows")>=0,U=a.indexOf("Macintosh")>=0,g=(a.indexOf("Macintosh")>=0||a.indexOf("iPad")>=0||a.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=a.indexOf("Linux")>=0,D=!0,d=navigator.language,m=d;else if(typeof l=="object"){N=l.platform==="win32",U=l.platform==="darwin",G=l.platform==="linux",W=G&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,d=X,m=X;const y=l.env.VSCODE_NLS_CONFIG;if(y)try{const F=JSON.parse(y),B=F.availableLanguages["*"];d=F.locale,m=B||X,u=F._translationsConfigFile}catch(F){}i=!0}else console.error("Unable to resolve platform.");let o=0;U?o=1:N?o=3:G&&(o=2);const s=N,A=U,_=G,w=i,L=D,R=g,C=a,S=function(){if(f.setImmediate)return f.setImmediate.bind(f);if(typeof f.postMessage=="function"&&!f.importScripts){let B=[];f.addEventListener("message",j=>{if(j.data&&j.data.vscodeSetImmediateId)for(let P=0,b=B.length;P<b;P++){const Y=B[P];if(Y.id===j.data.vscodeSetImmediateId){B.splice(P,1),Y.callback();return}}});let O=0;return j=>{const P=++O;B.push({id:P,callback:j}),f.postMessage({vscodeSetImmediateId:P},"*")}}if(typeof(l==null?void 0:l.nextTick)=="function")return l.nextTick.bind(l);const F=Promise.resolve();return B=>F.then(B)}(),x=U||g?2:N?1:3;let p=!0,T=!1;function v(){if(!T){T=!0;const y=new Uint8Array(2);y[0]=1,y[1]=2;const F=new Uint16Array(y.buffer);p=F[0]===(2<<8)+1}return p}}).call(this,J("IyRk"),J("Q2Ig"))},N0LK:function(ot,ge,J){"use strict";J.d(ge,"C",function(){return ne}),J.d(ge,"v",function(){return k}),J.d(ge,"s",function(){return X}),J.d(ge,"t",function(){return N}),J.d(ge,"U",function(){return U}),J.d(ge,"J",function(){return G}),J.d(ge,"O",function(){return W}),J.d(ge,"p",function(){return i}),J.d(ge,"T",function(){return D}),J.d(ge,"q",function(){return g}),J.d(ge,"N",function(){return d}),J.d(ge,"M",function(){return m}),J.d(ge,"Q",function(){return u}),J.d(ge,"u",function(){return a}),J.d(ge,"x",function(){return f}),J.d(ge,"I",function(){return l}),J.d(ge,"f",function(){return h}),J.d(ge,"h",function(){return o}),J.d(ge,"g",function(){return s}),J.d(ge,"i",function(){return A}),J.d(ge,"G",function(){return _}),J.d(ge,"H",function(){return w}),J.d(ge,"r",function(){return L}),J.d(ge,"R",function(){return R}),J.d(ge,"d",function(){return C}),J.d(ge,"e",function(){return S}),J.d(ge,"E",function(){return x}),J.d(ge,"F",function(){return p}),J.d(ge,"j",function(){return T}),J.d(ge,"z",function(){return v}),J.d(ge,"K",function(){return F}),J.d(ge,"L",function(){return B}),J.d(ge,"m",function(){return j}),J.d(ge,"k",function(){return b}),J.d(ge,"A",function(){return ee}),J.d(ge,"a",function(){return ae}),J.d(ge,"n",function(){return le}),J.d(ge,"l",function(){return Re}),J.d(ge,"D",function(){return Ee}),J.d(ge,"B",function(){return Te}),J.d(ge,"b",function(){return Ae}),J.d(ge,"S",function(){return Oe}),J.d(ge,"o",function(){return ce}),J.d(ge,"P",function(){return ue}),J.d(ge,"w",function(){return Pe}),J.d(ge,"c",function(){return qe}),J.d(ge,"y",function(){return nt});function ne(se){return!se||typeof se!="string"?!0:se.trim().length===0}const $=/{(\d+)}/g;function k(se,...be){return be.length===0?se:se.replace($,function(xe,Se){const Be=parseInt(Se,10);return isNaN(Be)||Be<0||Be>=be.length?xe:be[Be]})}function X(se){return se.replace(/[<>&]/g,function(be){switch(be){case"<":return"<";case">":return">";case"&":return"&";default:return be}})}function N(se){return se.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function U(se,be=" "){const xe=G(se,be);return W(xe,be)}function G(se,be){if(!se||!be)return se;const xe=be.length;if(xe===0||se.length===0)return se;let Se=0;for(;se.indexOf(be,Se)===Se;)Se=Se+xe;return se.substring(Se)}function W(se,be){if(!se||!be)return se;const xe=be.length,Se=se.length;if(xe===0||Se===0)return se;let Be=Se,He=-1;for(;!(He=se.lastIndexOf(be,Be-1),He===-1||He+xe!==Be);){if(He===0)return"";Be=He}return se.substring(0,Be)}function i(se){return se.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(se){return se.replace(/\*/g,"")}function g(se,be,xe={}){if(!se)throw new Error("Cannot create regex from empty string");be||(se=N(se)),xe.wholeWord&&(/\B/.test(se.charAt(0))||(se="\\b"+se),/\B/.test(se.charAt(se.length-1))||(se=se+"\\b"));let Se="";return xe.global&&(Se+="g"),xe.matchCase||(Se+="i"),xe.multiline&&(Se+="m"),xe.unicode&&(Se+="u"),new RegExp(se,Se)}function d(se){if(se.source==="^"||se.source==="^$"||se.source==="$"||se.source==="^\\s*$")return!1;const be=se.exec("");return!!(be&&se.lastIndex===0)}function m(se){return(se.global?"g":"")+(se.ignoreCase?"i":"")+(se.multiline?"m":"")+(se.unicode?"u":"")}function u(se){return se.split(/\r\n|\r|\n/)}function a(se){for(let be=0,xe=se.length;be<xe;be++){const Se=se.charCodeAt(be);if(Se!==32&&Se!==9)return be}return-1}function f(se,be=0,xe=se.length){for(let Se=be;Se<xe;Se++){const Be=se.charCodeAt(Se);if(Be!==32&&Be!==9)return se.substring(be,Se)}return se.substring(be,xe)}function l(se,be=se.length-1){for(let xe=be;xe>=0;xe--){const Se=se.charCodeAt(xe);if(Se!==32&&Se!==9)return xe}return-1}function h(se,be){return se<be?-1:se>be?1:0}function o(se,be,xe=0,Se=se.length,Be=0,He=be.length){for(;xe<Se&&Be<He;xe++,Be++){let lt=se.charCodeAt(xe),$e=be.charCodeAt(Be);if(lt<$e)return-1;if(lt>$e)return 1}const Ye=Se-xe,Ve=He-Be;return Ye<Ve?-1:Ye>Ve?1:0}function s(se,be){return A(se,be,0,se.length,0,be.length)}function A(se,be,xe=0,Se=se.length,Be=0,He=be.length){for(;xe<Se&&Be<He;xe++,Be++){let lt=se.charCodeAt(xe),$e=be.charCodeAt(Be);if(lt===$e)continue;if(lt>=128||$e>=128)return o(se.toLowerCase(),be.toLowerCase(),xe,Se,Be,He);_(lt)&&(lt-=32),_($e)&&($e-=32);const Qe=lt-$e;if(Qe===0)continue;return Qe}const Ye=Se-xe,Ve=He-Be;return Ye<Ve?-1:Ye>Ve?1:0}function _(se){return se>=97&&se<=122}function w(se){return se>=65&&se<=90}function L(se,be){return se.length===be.length&&A(se,be)===0}function R(se,be){const xe=be.length;return be.length>se.length?!1:A(se,be,0,xe)===0}function C(se,be){let xe,Se=Math.min(se.length,be.length);for(xe=0;xe<Se;xe++)if(se.charCodeAt(xe)!==be.charCodeAt(xe))return xe;return Se}function S(se,be){let xe,Se=Math.min(se.length,be.length);const Be=se.length-1,He=be.length-1;for(xe=0;xe<Se;xe++)if(se.charCodeAt(Be-xe)!==be.charCodeAt(He-xe))return xe;return Se}function x(se){return 55296<=se&&se<=56319}function p(se){return 56320<=se&&se<=57343}function T(se,be){return(se-55296<<10)+(be-56320)+65536}function v(se,be,xe){const Se=se.charCodeAt(xe);if(x(Se)&&xe+1<be){const Be=se.charCodeAt(xe+1);if(p(Be))return T(Se,Be)}return Se}function y(se,be){const xe=se.charCodeAt(be-1);if(p(xe)&&be>1){const Se=se.charCodeAt(be-2);if(x(Se))return T(Se,xe)}return xe}function F(se,be){const xe=ze.getInstance(),Se=be,Be=se.length,He=v(se,Be,be);be+=He>=65536?2:1;let Ye=xe.getGraphemeBreakType(He);for(;be<Be;){const Ve=v(se,Be,be),lt=xe.getGraphemeBreakType(Ve);if(qe(Ye,lt))break;be+=Ve>=65536?2:1,Ye=lt}return be-Se}function B(se,be){const xe=ze.getInstance(),Se=be,Be=y(se,be);be-=Be>=65536?2:1;let He=xe.getGraphemeBreakType(Be);for(;be>0;){const Ye=y(se,be),Ve=xe.getGraphemeBreakType(Ye);if(qe(Ve,He))break;be-=Ye>=65536?2:1,He=Ve}return Se-be}const O=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function j(se){return O.test(se)}const P=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function b(se){return P.test(se)}const Y=/^[\t\n\r\x20-\x7E]*$/;function ee(se){return Y.test(se)}const ae=/[\u2028\u2029]/;function le(se){return ae.test(se)}function Re(se){for(let be=0,xe=se.length;be<xe;be++)if(Ee(se.charCodeAt(be)))return!0;return!1}function Ee(se){return se=+se,se>=11904&&se<=55215||se>=63744&&se<=64255||se>=65281&&se<=65374}function Te(se){return se>=127462&&se<=127487||se===8986||se===8987||se===9200||se===9203||se>=9728&&se<=10175||se===11088||se===11093||se>=127744&&se<=128591||se>=128640&&se<=128764||se>=128992&&se<=129003||se>=129280&&se<=129535||se>=129648&&se<=129750}const Ae=String.fromCharCode(65279);function Oe(se){return!!(se&&se.length>0&&se.charCodeAt(0)===65279)}function ce(se,be=!1){return se?(be&&(se=se.replace(/\\./g,"")),se.toLowerCase()!==se):!1}function ue(se){const be=90-65+1;return se=se%(2*be),se<be?String.fromCharCode(97+se):String.fromCharCode(65+se-be)}function Pe(se){const be=ze.getInstance();return be.getGraphemeBreakType(se)}function qe(se,be){return se===0?be!==5&&be!==7:se===2&&be===3?!1:se===4||se===2||se===3||(be===4||be===2||be===3)?!0:se===8&&(be===8||be===9||be===11||be===12)||((se===11||se===9)&&(be===9||be===10)||((se===12||se===10)&&be===10||(be===5||be===13||(be===7||(se===1||se===13&&be===14)))))?!1:!(se===6&&be===6)}class ze{constructor(){this._data=et()}static getInstance(){return ze._INSTANCE||(ze._INSTANCE=new ze),ze._INSTANCE}getGraphemeBreakType(se){if(se<32)return se===10?3:se===13?2:4;if(se<127)return 0;const be=this._data,xe=be.length/3;let Se=1;for(;Se<=xe;)if(se<be[3*Se])Se=2*Se;else if(se>be[3*Se+1])Se=2*Se+1;else return be[3*Se+2];return 0}}ze._INSTANCE=null;function et(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function nt(se,be){if(se===0)return 0;const xe=Ie(se,be);if(xe!==void 0)return xe;const Se=y(be,se);return se-=Me(Se),se}function Ie(se,be){let xe=y(be,se);for(se-=Me(xe);Ge(xe)||xe===65039||xe===8419;){if(se===0)return;xe=y(be,se),se-=Me(xe)}if(!Te(xe))return;if(se>=0){const Se=y(be,se);Se===8205&&(se-=Me(Se))}return se}function Me(se){return se>=65536?2:1}function Ge(se){return 127995<=se&&se<=127999}},Ot1p:function(ot,ge,J){"use strict";var ne=J("2qtc"),$=J("kLXV"),k=J("rAM+"),X=J("miYZ"),N=J("tsqr"),U=J("9og8"),G=J("tJVT"),W=J("jrin"),i=J("WmNS"),D=J.n(i),g=J("q1tI"),d=J.n(g),m=J("VrN/"),u=J.n(m),a=J("bdgK"),f=J("p77/"),l=J("Bd2K"),h=J("ELLl"),o=J("19Vz"),s=J("lZu9"),A=J("+NIl"),_=J("kSUc"),w=J("9Bee"),L=function(ye){var Le=ye.value,Ue=Le===void 0?"":Le,Je=ye.className,dt=ye.showTextOnly,rt=ye.showLines,mt=ye.style,yt=mt===void 0?{}:mt,tt=Object(g.useMemo)(function(){return""},[Ue]);return d.a.createElement(d.a.Fragment,null,d.a.createElement("div",{dangerouslySetInnerHTML:{__html:tt}}))},R=J("0Owb"),C=J("dejd"),S=J("C+DQ"),x=J("1vsH"),p=J("m3rI"),T=[{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 v(ye){var Le=ye.onActionCallback,Ue=ye.title,Je=ye.icon,dt=ye.actionName,rt=ye.className,mt=rt===void 0?"":rt,yt=ye.children;function tt(){Le(dt)}return d.a.createElement("a",{title:Ue,className:mt,onClick:tt},d.a.createElement("i",{className:"md-iconfont ".concat(Je)}),yt)}var y=function(ye){var Le=ye.watch,Ue=ye.showNullButton,Je=ye.onActionCallback,dt=ye.fullScreen,rt=ye.insertTemp,mt=ye.hidetoolBar,yt=ye.uuid,tt=ye.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.F)("_educoder_session"),"&key=").concat(yt,"&api=").concat(encodeURIComponent(p.a.PROXY_SERVER)));var Ut=[].concat(T,[{title:"".concat(Le?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Le?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return d.a.createElement("ul",{className:"markdown-toolbar-container"},!mt&&Ut.map(function(Ct,Jt){return d.a.createElement("li",{key:Jt},Ct.actionName?d.a.createElement(v,Object(R.a)({},Ct,{onActionCallback:Je})):d.a.createElement("span",{className:"v-line"}))}),Ue?d.a.createElement("li",null,d.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Je},d.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,rt&&d.a.createElement("li",null,d.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(rt),onActionCallback:Je},d.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),d.a.createElement("li",{className:"btn-full-screen"},d.a.createElement(v,{icon:"".concat(dt?"icon-shrink":"icon-enlarge"),title:dt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Je})))},F=J("M8RZ"),B=J("+L6B"),O=J("2/Rp"),j=J("y8nQ"),P=J("Vl3Y"),b=J("5NDa"),Y=J("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},ae=function(ye){var Le=ye.callback,Ue=ye.onCancel;function Je(dt){Le(dt)}return d.a.createElement(P.a,Object(R.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Je}),d.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},d.a.createElement(Y.a,null)),d.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},d.a.createElement(Y.a,null)),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(O.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(O.a,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))},le=J("7ahc"),Re=J("HmJG"),Ee=J("BjJ7"),Te=P.a.useForm,Ae={width:280,marginRight:10},Oe={labelCol:{span:5},wrapperCol:{span:19}},ce=function(ye){var Le=ye.callback,Ue=ye.onCancel,Je=Te(),dt=Object(G.a)(Je,1),rt=dt[0];function mt(Ut){Le(Ut)}function yt(Ut,Ct){if(Ut.status===-1){N.b.error(Ut.message);return}rt.setFieldsValue({src:"/api/attachments/".concat(Ut.id),type:Ct.type})}function tt(Ut){var Ct=Ut.target.files[0];Pe(Ct,yt)}return d.a.createElement(P.a,Object(R.a)({form:rt},Oe,{className:"upload-image-panel",onFinish:mt}),d.a.createElement(P.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},d.a.createElement("div",{className:"flex-container"},d.a.createElement(P.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},d.a.createElement(Y.a,{style:Ae})),d.a.createElement(ue,{onFileChange:tt}))),d.a.createElement(P.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},d.a.createElement(Y.a,{style:{width:264}})),d.a.createElement(P.a.Item,{style:{textAlign:"right"}},d.a.createElement(O.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(O.a,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))};function ue(ye){var Le=ye.onFileChange;return d.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",d.a.createElement("input",{type:"file",onChange:Le}))}function Pe(ye,Le){if(!ye)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ue=new FormData;Ue.append("editormd-image-file",ye),Ue.append("file_param_name","editormd-image-file"),Ue.append("byxhr","true");var Je=new window.XMLHttpRequest;Je.withCredentials=!0,Je.addEventListener("load",function(dt){Le(JSON.parse(dt.target.responseText),ye)},!1),Je.addEventListener("error",function(dt){console.error(dt)},!1),Je.open("POST","".concat(Ee.a,"/api/attachments.json")),Je.send(Ue)}var qe=J("giR+"),ze=J("fyUT"),et=J("7Kak"),nt=J("9yH6"),Ie=nt.a.Group,Me={margin:"0 8px"},Ge=function(ye){var Le=ye.callback,Ue=ye.onCancel;function Je(dt){Le(dt)}return d.a.createElement(P.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Je},d.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},d.a.createElement("span",{style:Me},"\u5355\u5143\u683C\u6570\uFF1A"),d.a.createElement("span",{style:Me},"\u884C\u6570"),d.a.createElement(P.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},d.a.createElement(ze.a,null)),d.a.createElement("span",{style:Me},"\u5217\u6570"),d.a.createElement(P.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},d.a.createElement(ze.a,null))),d.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},d.a.createElement("span",{style:Me},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),d.a.createElement(P.a.Item,{name:"align"},d.a.createElement(Ie,null,d.a.createElement(nt.a,{value:"default"},d.a.createElement("i",{className:"fa fa-align-justify"})),d.a.createElement(nt.a,{value:"left"},d.a.createElement("i",{className:"fa fa-align-left"})),d.a.createElement(nt.a,{value:"center"},d.a.createElement("i",{className:"fa fa-align-center"})),d.a.createElement(nt.a,{value:"right"},d.a.createElement("i",{className:"fa fa-align-right"}))))),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(O.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(O.a,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))},se=J("ErOA"),be=J("7Cbv"),xe="link",Se="upload-image",Be="code-block",He="add-table",Ye="------------",Ve={default:Ye,left:":".concat(Ye),center:":".concat(Ye,":"),right:"".concat(Ye,":")},lt=J("9VGf"),$e,Qe;function De(){}var ct=0,ut=1e4,ke="\u2581",Ne=`
|
|
**\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 _e(ye){return/^\d+$/.test(ye)?"".concat(ye,"px"):ye}var fe=navigator.platform.toUpperCase().indexOf("MAC")>=0,ve=fe?"Cmd":"Ctrl",ie=["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"],re=($e={},Object(W.a)($e,ve+"-B","bold"),Object(W.a)($e,ve+"-I","italic"),$e),oe=(Qe={},Object(W.a)(Qe,xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(Qe,Be,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(Qe,Se,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(Qe,He,"\u6DFB\u52A0\u8868\u683C"),Qe),de=ge.a=function(ye){var Le=ye.defaultValue,Ue=Le===void 0?"":Le,Je=ye.onChange,dt=ye.width,rt=dt===void 0?"100%":dt,mt=ye.height,yt=mt===void 0?400:mt,tt=ye.miniToolbar,Ut=tt===void 0?!1:tt,Ct=ye.isFocus,Jt=Ct===void 0?!1:Ct,ei=ye.watch,Dt=ye.insertTemp,ci=ye.mode,Di=ci===void 0?"markdown":ci,bt=ye.id,fi=bt===void 0?"markdown-editor-id":bt,_t=ye.showResizeBar,wt=_t===void 0?!1:_t,Bt=ye.noStorage,Lt=Bt===void 0?!1:Bt,Mt=ye.showNullButton,Et=Mt===void 0?!1:Mt,ht=ye.hidetoolBar,_i=ht===void 0?!1:ht,Ht=ye.fullScreen,zt=Ht===void 0?!1:Ht,It=ye.onBlur,ui=ye.onCMBeforeChange,ki=ye.onFullScreen,Yi=ye.className,Xe=Yi===void 0?"":Yi,Ot=ye.disablePaste,mn=Ot===void 0?!1:Ot,gn=ye.placeholder,vn=gn===void 0?"":gn,yn=ye.values,V=yn===void 0?"":yn,E=Object(g.useState)(null),I=Object(G.a)(E,2),H=I[0],q=I[1],z=Object(g.useState)(Ue),me=Object(G.a)(z,2),je=me[0],it=me[1],gt=Object(g.useState)(ei),We=Object(G.a)(gt,2),Tt=We[0],Gt=We[1],qt=Object(g.useState)(zt),Hi=Object(G.a)(qt,2),wi=Hi[0],Si=Hi[1],Qi=Object(g.useState)(""),Dn=Object(G.a)(Qi,2),pi=Dn[0],zi=Dn[1],un=Object(g.useState)(0),hn=Object(G.a)(un,2),Wi=hn[0],kn=hn[1],bn=Object(g.useState)(yt),zn=Object(G.a)(bn,2),Vn=zn[0],Zi=zn[1],$i=Object(g.useState)(!1),_n=Object(G.a)($i,2),dr=_n[0],En=_n[1],ri=Object(g.useRef)(Object(be.a)()),Kt=Object(g.useRef)(!1),Ei=Object(g.useRef)(),Nt=Object(g.useRef)(),si=Object(g.useRef)(),Yt=Object(g.useRef)(),rn=Object(g.useRef)(),mi=function(){var vt=Object(U.a)(D.a.mark(function Rt(){var St,Pt;return D.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,Object(se.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ri.current}});case 2:Pt=Qt.sent,Pt!=null&&(St=Pt.attachments)!==null&&St!==void 0&&St.length&&(console.log("cm:",H,Nt),Pt.attachments.map(function(jt){jt.content_type.indexOf("image")>-1?H.replaceSelection(".concat(jt.content_type,")")):jt.content_type.indexOf("video")>-1?H.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):jt.content_type.indexOf("pdf")>-1?H.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(jt.content_type,'&disposition=inline" target="_blank">').concat(jt.name,"</a>")):H.replaceSelection("[".concat(jt.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(jt.content_type,")"))}));case 4:case"end":return Qt.stop()}},Rt)}));return function(){return vt.apply(this,arguments)}}();Object(g.useEffect)(function(){it(V),H==null||H.setValue(V)},[V]),Object(g.useEffect)(function(){ki==null||ki(wi)},[wi]),Object(g.useEffect)(function(){if(Nt.current){var vt=u.a.fromTextArea(Nt.current,{mode:Di,lineNumbers:!Ut,lineWrapping:!0,value:Ue,autoCloseTags:!0,autoCloseBrackets:!0});Jt&&vt.focus();function Rt(St,Pt){if(mn){Pt.preventDefault();return}var Wt=Pt.clipboardData;if(Wt){var Qt=Wt.types.toString(),jt=Wt.items;if(Qt==="Files"||Wt.types.indexOf("Files")>-1){if(Pt.preventDefault(),Di=="stex")return;try{var hi,Mi=jt[1];((hi=jt[0])===null||hi===void 0?void 0:hi.kind)==="file"&&(Mi=jt[0]);var Ft=Mi.getAsFile(),dn=Ft.name.split(".").pop();Pe(Ft,function(Vt){if(Vt.id){var Pi,Ci,Ji;(Ft==null||((Pi=Ft.type)===null||Pi===void 0)?void 0:Pi.indexOf("image"))>-1?vt.replaceSelection(".concat(Vt.content_type,")")):(Ft==null||((Ci=Ft.type)===null||Ci===void 0)?void 0:Ci.indexOf("video"))>-1?vt.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,'"></video>')):(Ft==null||((Ji=Ft.type)===null||Ji===void 0)?void 0:Ji.indexOf("pdf"))>-1?vt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Ft.type,'&disposition=inline" target="_blank">').concat(Ft.name,"</a>")):ie.includes(dn)?vt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,'?type=office&disposition=inline" target="_blank">').concat(Ft.name,"</a>")):vt.replaceSelection("[".concat(Ft.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}else(Vt==null?void 0:Vt.status)===401&&(document.location.href="/user/login")})}catch(Vt){N.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return vt.on("paste",Rt),vt.on("dragleave",function(St,Pt){si.current.classList.remove("mouse-hover-md")}),vt.on("dragover",function(St,Pt){si.current.classList.add("mouse-hover-md")}),vt.on("drop",function(St,Pt){si.current.classList.add("mouse-hover-md");var Wt;if(Wt=Pt.dataTransfer.files,Wt.length>0){Pt.preventDefault(),Pt.stopPropagation();for(var Qt=function(Mi){var Ft=Wt[Mi],dn=Ft.name.split(".").pop();Pe(Ft,function(Vt){if(Vt.id){var Pi,Ci,Ji;(Ft==null||((Pi=Ft.type)===null||Pi===void 0)?void 0:Pi.indexOf("image"))>-1?vt.replaceSelection(".concat(Vt.content_type,")")):(Ft==null||((Ci=Ft.type)===null||Ci===void 0)?void 0:Ci.indexOf("video"))>-1?vt.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,'"></video>')):(Ft==null||((Ji=Ft.type)===null||Ji===void 0)?void 0:Ji.indexOf("pdf"))>-1?vt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Ft.type,'&disposition=inline" target="_blank">').concat(Ft.name,"</a>")):ie.includes(dn)?vt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,'?type=office&disposition=inline" target="_blank">').concat(Ft.name,"</a>")):vt.replaceSelection("[".concat(Ft.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}else(Vt==null?void 0:Vt.status)===401&&(document.location.href="/user/login")})},jt=0;jt<Wt.length;jt++)Qt(jt)}}),q(vt),function(){vt.off("paste",Rt)}}},[]);var Ri=Object(g.useCallback)(function(){if(si.current)try{}catch(vt){console.log(vt,"---- to set md editor body height")}},[Vn,si,wi]);Object(g.useEffect)(function(){function vt(){var St=new a.default(function(Pt){var Wt=Object(k.a)(Pt),Qt;try{for(Wt.s();!(Qt=Wt.n()).done;){var jt=Qt.value;(jt.target.offsetHeight>0||jt.target.offsetWidth>0)&&(Ri(),H.setSize("100%","100%"),H.refresh())}}catch(hi){Wt.e(hi)}finally{Wt.f()}});return St.observe(Nt.current.parentElement),St}if(H){var Rt=vt();return function(){Rt.unobserve(Nt.current.parentElement)}}},[H,Ri]),Object(g.useEffect)(function(){if(H){for(var vt=[],Rt=function(){var jt=Pt[St];Wt=Object(G.a)(jt,2);var hi=Wt[0],Mi=Wt[1],Ft=Object(W.a)({},hi,function(){Xn(Mi)});vt.push(Ft),H.addKeyMap(Ft)},St=0,Pt=Object.entries(re);St<Pt.length;St++){var Wt;Rt()}return Ei.current=setInterval(function(){Kt.current&&mi()},4e3),function(){clearInterval(Ei.current);var Qt=Object(k.a)(vt),jt;try{for(Qt.s();!(jt=Qt.n()).done;){var hi=jt.value;H.removeKeyMap(hi)}}catch(Mi){Qt.e(Mi)}finally{Qt.f()}}}},[H]),Object(g.useEffect)(function(){zt!==wi&&Si(zt)},[zt]),Object(lt.a)(function(){if(!Lt&&Wi>0){var vt=new Date().getTime(),Rt=window.sessionStorage.getItem(fi);vt>=Wi+ut&&(!Rt||Rt!==je)&&(window.sessionStorage.setItem(fi,je),En(!0))}},ut),Object(g.useEffect)(function(){Gt(ei)},[H,ei]),Object(g.useEffect)(function(){H&&(Jt&&H.focus())},[H,Jt]),Object(g.useEffect)(function(){if(Tt&&H){var vt=H.getScrollerElement();function Rt(St){var Pt=St.target;if(rn.current){var Wt=Pt.scrollTop/Pt.scrollHeight;rn.current.scrollTop=rn.current.scrollHeight*Wt}}return vt.addEventListener("scroll",Rt),function(){vt.removeEventListener("scroll",Rt)}}},[H,Tt]),Object(g.useEffect)(function(){if(H&&ui){function vt(Rt,St){ui(Rt,St)}return H.on("beforeChange",vt),function(){H.off("beforeChange",vt)}}},[H,ui]),Object(g.useEffect)(function(){if(H&&It){function vt(){It(H.getValue())}return H.on("blur",vt),function(){H.off("blur",vt)}}},[H,It]),Object(g.useEffect)(function(){if(H){function vt(Rt){var St=Rt.getValue();it(St),kn(new Date().getTime()),Rt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Je&&Je(St)}return H.on("change",vt),function(){H.off("change",vt)}}},[H,Je]),Object(g.useEffect)(function(){H&&(Ue==null?(H.setValue(""),it("")):Ue!==H.getValue()&&(H.setValue(Ue),it(Ue),H.setCursor(H.lineCount(),0)))},[H,Ue]);var Xn=Object(g.useCallback)(function(vt){var Rt=H.getCursor(),St=H.getSelection(),Pt=St.split(`
|
|
`);switch(vt){case"bold":return H.replaceSelection("**"+St+"**"),St===""&&H.setCursor(Rt.line,Rt.ch+2),H.focus();case"italic":return H.replaceSelection("*"+St+"*"),St===""&&H.setCursor(Rt.line,Rt.ch+1),H.focus();case"code":return H.replaceSelection("`"+St+"`"),St===""&&H.setCursor(Rt.line,Rt.ch+1),H.focus();case"inline-latex":return H.replaceSelection("`$$"+St+"$$`"),St===""&&H.setCursor(Rt.line,Rt.ch+3),H.focus();case"latex":return H.replaceSelection("```latex\n"+St+"\n```"),H.setCursor(Rt.line+1,St.length+1),H.focus();case"line-break":return H.replaceSelection(`<br/>
|
|
`),H.focus();case"list-ul":return St===""?H.replaceSelection("- "+St):H.replaceSelection(Pt.map(function(Wt){return Wt===""?"":"- ".concat(Wt)}).join(`
|
|
`)),H.focus();case"list-ol":return St===""?H.replaceSelection("1. "+St):H.replaceSelection(Pt.map(function(Wt,Qt){return Wt===""?"":"".concat(Qt+1,". ").concat(Wt)}).join(`
|
|
`)),H.focus();case"add-null-ch":return St===""&&H.setCursor(Rt.line,Rt.ch+1),H.replaceSelection(ke),H.focus();case"inster-template-1":return St===""&&H.setCursor(Rt.line,Rt.ch),H.replaceSelection(Ne),H.focus();case"eraser":return H.setValue(""),H.focus();case"trigger-watch":return Gt(!Tt),H.focus();case"trigger-full-screen":return Si(!wi),H.focus();case xe:zi(xe);return;case Be:zi(Be);return;case Se:zi(Se);return;case He:zi(He);return;default:throw new Error}},[H,Tt,wi]),xn=Object(g.useCallback)(function(vt){zi("");switch(pi){case xe:var Rt=vt.title,St=vt.link;return H.replaceSelection("[".concat(Rt,"](").concat(St,")")),H.focus();case Be:var Pt=vt.language,Wt=vt.content;return H.replaceSelection(["```"+Pt,Wt,"```"].join(`
|
|
`)),H.focus();case Se:var Qt=vt.src,jt=vt.alt;return jt?H.replaceSelection(".concat(Qt,' "').concat(jt,'" )')):H.replaceSelection("")),H.focus();case He:for(var hi=vt.row,Mi=vt.col,Ft=vt.align,dn=`
|
|
`,Vt=0;Vt<hi;Vt++){for(var Pi=[],Ci=[],Ji=0;Ji<Mi;Ji++)Vt===1&&Ci.push(Ve[Ft]),Pi.push(" ");Vt===1&&(dn+="| ".concat(Ci.join(" | "),` |
|
|
`)),dn+="| ".concat(Pi.join(Mi===1?"":" | "),` |
|
|
`)}return H.replaceSelection(dn+`
|
|
`),H.focus();default:throw new Error}},[H,pi]),cr=Object(g.useMemo)(function(){switch(pi){case xe:return d.a.createElement(ae,{callback:xn,onCancel:Tn});case Be:return d.a.createElement(le.b,{callback:xn,onCancel:Tn});case Se:return d.a.createElement(ce,{callback:xn,onCancel:Tn});case He:return d.a.createElement(Ge,{callback:xn,onCancel:Tn});default:return null}},[pi]);function Tn(){zi("")}Object(g.useEffect)(function(){if(Yt.current){var vt=Yt.current,Rt=!1,St=0;function Pt(jt){Rt=!0,St=jt.pageY}function Wt(){Rt=!1}function Qt(jt){if(Rt){var hi=jt.pageY-St;hi<0&&(hi=0),hi>300&&(hi=300);var Mi=yt+hi+"px";Zi(Mi)}}return vt.addEventListener("mousedown",Pt),document.addEventListener("mousemove",Qt),document.addEventListener("mouseup",Wt),function(){vt.removeEventListener("mousedown",Pt),document.removeEventListener("mousemove",Qt),document.removeEventListener("mouseup",Wt)}}},[H,Yt]),Object(g.useEffect)(function(){Zi(yt)},[yt]);var an=_e(rt),fr=_e(Vn),qi={width:an,height:fr},pr=Object(g.useMemo)(function(){if(Wi){var vt=new Date(Wi),Rt=vt.getHours(),St=vt.getMinutes(),Pt=vt.getSeconds();return Rt=Rt<10?"0"+Rt:Rt,St=St<10?"0"+St:St,Pt=Pt<10?"0"+Pt:Pt,"".concat(Rt,":").concat(St,":").concat(Pt)}return 0},[Wi]);function jr(){window.sessionStorage.removeItem(fi),En(!1),kn(0)}function Mn(){En(!1),kn(0),H.setValue(window.sessionStorage.getItem(fi))}function ua(vt,Rt){var St=H.getValue();St=St.replace(vt,Rt),it(St),H==null||H.setValue(St)}return d.a.createElement(g.Fragment,null,d.a.createElement("div",{className:"markdown-editor-wrapper",ref:si},d.a.createElement("div",{className:"markdown-editor-container ".concat(Xe," ").concat(Tt?"on-preview":""," ").concat(Ut?"mini":""," ").concat(wi?"full-screen":""),style:qi},d.a.createElement(y,{insertTemp:Dt,watch:Tt,fullScreen:wi,showNullButton:Et,onActionCallback:Xn,hidetoolBar:_i,uuid:ri.current,setOpenPhones:function(){Kt.current=!0}}),d.a.createElement("div",{className:"markdown-editor-body"},d.a.createElement("div",{className:"codemirror-container"},d.a.createElement("textarea",{ref:Nt,placeholder:vn})),Tt?d.a.createElement("div",{ref:rn,className:"preview-container"},Di==="stex"&&d.a.createElement(L,{value:je}),Di!=="stex"&&d.a.createElement(w.a,{edit:!0,value:je,replaces:ua})):null))),wt?d.a.createElement("a",{ref:Yt,className:"editor-resize"}):null,d.a.createElement(F.a,null,oe[pi]?d.a.createElement($.a,{centered:!0,title:oe[pi],visible:!0,onCancel:Tn,footer:null,className:"markdown-popup-form"},cr):null))}},RotF:function(ot,ge,J){ot.exports=J("LSTS")},SJMd:function(ot,ge){/**
|
|
* @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 J,ne,$,k=!1,X,N;window.PR_SHOULD_USE_CONTINUATION=!0;var U,G;(function(){var W=window,i=["break,continue,do,else,for,if,return,while"],D=[i,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],d=[g,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],m=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[g,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],a="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",f=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",h=[i,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],o=[i,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],s=[i,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[d,u,m,f,l,h,o,s],_=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,w="str",L="kwd",R="com",C="typ",S="lit",x="pun",p="pln",T="tag",v="dec",y="src",F="atn",B="atv",O="nocode",j="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function P(Ie){for(var Me=0,Ge=!1,se=!1,be=0,xe=Ie.length;be<xe;++be){var Se=Ie[be];if(Se.ignoreCase)se=!0;else if(/[a-z]/i.test(Se.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ge=!0,se=!1;break}}var Be={b:8,t:9,n:10,v:11,f:12,r:13};function He(Qe){var De=Qe.charCodeAt(0);if(De!==92)return De;var ct=Qe.charAt(1);return De=Be[ct],De||("0"<=ct&&ct<="7"?parseInt(Qe.substring(1),8):ct==="u"||ct==="x"?parseInt(Qe.substring(2),16):Qe.charCodeAt(1))}function Ye(Qe){if(Qe<32)return(Qe<16?"\\x0":"\\x")+Qe.toString(16);var De=String.fromCharCode(Qe);return De==="\\"||De==="-"||De==="]"||De==="^"?"\\"+De:De}function Ve(Qe){var De=Qe.substring(1,Qe.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")),ct=[],ut=De[0]==="^",ke=["["];ut&&ke.push("^");for(var Ne=ut?1:0,_e=De.length;Ne<_e;++Ne){var fe=De[Ne];if(/\\[bdsw]/i.test(fe))ke.push(fe);else{var ve=He(fe),ie;Ne+2<_e&&De[Ne+1]==="-"?(ie=He(De[Ne+2]),Ne+=2):ie=ve,ct.push([ve,ie]),ie<65||ve>122||(ie<65||ve>90||ct.push([Math.max(65,ve)|32,Math.min(ie,90)|32]),ie<97||ve>122||ct.push([Math.max(97,ve)&~32,Math.min(ie,122)&~32]))}}ct.sort(function(ye,Le){return ye[0]-Le[0]||Le[1]-ye[1]});for(var re=[],oe=[],Ne=0;Ne<ct.length;++Ne){var de=ct[Ne];de[0]<=oe[1]+1?oe[1]=Math.max(oe[1],de[1]):re.push(oe=de)}for(var Ne=0;Ne<re.length;++Ne){var de=re[Ne];ke.push(Ye(de[0])),de[1]>de[0]&&(de[1]+1>de[0]&&ke.push("-"),ke.push(Ye(de[1])))}return ke.push("]"),ke.join("")}function lt(Qe){for(var De=Qe.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")),ct=De.length,ut=[],ke=0,Ne=0;ke<ct;++ke){var _e=De[ke];if(_e==="(")++Ne;else if(_e.charAt(0)==="\\"){var fe=+_e.substring(1);fe&&(fe<=Ne?ut[fe]=-1:De[ke]=Ye(fe))}}for(var ke=1;ke<ut.length;++ke)ut[ke]===-1&&(ut[ke]=++Me);for(var ke=0,Ne=0;ke<ct;++ke){var _e=De[ke];if(_e==="(")++Ne,ut[Ne]||(De[ke]="(?:");else if(_e.charAt(0)==="\\"){var fe=+_e.substring(1);fe&&fe<=Ne&&(De[ke]="\\"+ut[fe])}}for(var ke=0;ke<ct;++ke)De[ke]==="^"&&De[ke+1]!=="^"&&(De[ke]="");if(Qe.ignoreCase&&Ge)for(var ke=0;ke<ct;++ke){var _e=De[ke],ve=_e.charAt(0);_e.length>=2&&ve==="["?De[ke]=Ve(_e):ve!=="\\"&&(De[ke]=_e.replace(/[a-zA-Z]/g,function(oe){var de=oe.charCodeAt(0);return"["+String.fromCharCode(de&~32,de|32)+"]"}))}return De.join("")}for(var $e=[],be=0,xe=Ie.length;be<xe;++be){var Se=Ie[be];if(Se.global||Se.multiline)throw new Error(""+Se);$e.push("(?:"+lt(Se)+")")}return new RegExp($e.join("|"),se?"gi":"g")}function b(Ie,Me){var Ge=/(?:^|\s)nocode(?:\s|$)/,se=[],be=0,xe=[],Se=0;function Be(He){var Ye=He.nodeType;if(Ye==1){if(Ge.test(He.className))return;for(var Ve=He.firstChild;Ve;Ve=Ve.nextSibling)Be(Ve);var lt=He.nodeName.toLowerCase();(lt==="br"||lt==="li")&&(se[Se]=`
|
|
`,xe[Se<<1]=be++,xe[Se++<<1|1]=He)}else if(Ye==3||Ye==4){var $e=He.nodeValue;$e.length&&(Me?$e=$e.replace(/\r\n?/g,`
|
|
`):$e=$e.replace(/[ \t\r\n]+/g," "),se[Se]=$e,xe[Se<<1]=be,be+=$e.length,xe[Se++<<1|1]=He)}}return Be(Ie),{sourceCode:se.join("").replace(/\n$/,""),spans:xe}}function Y(Ie,Me,Ge,se,be){if(!Ge)return;var xe={sourceNode:Ie,pre:1,langExtension:null,numberLines:null,sourceCode:Ge,spans:null,basePos:Me,decorations:null};se(xe),be.push.apply(be,xe.decorations)}var ee=/\S/;function ae(Ie){for(var Me=void 0,Ge=Ie.firstChild;Ge;Ge=Ge.nextSibling){var se=Ge.nodeType;Me=se===1?Me?Ie:Ge:se===3&&ee.test(Ge.nodeValue)?Ie:Me}return Me===Ie?void 0:Me}function le(Ie,Me){var Ge={},se;(function(){for(var Se=Ie.concat(Me),Be=[],He={},Ye=0,Ve=Se.length;Ye<Ve;++Ye){var lt=Se[Ye],$e=lt[3];if($e)for(var Qe=$e.length;--Qe>=0;)Ge[$e.charAt(Qe)]=lt;var De=lt[1],ct=""+De;He.hasOwnProperty(ct)||(Be.push(De),He[ct]=null)}Be.push(/[\0-\uffff]/),se=P(Be)})();var be=Me.length,xe=function(Se){for(var Be=Se.sourceCode,He=Se.basePos,Ye=Se.sourceNode,Ve=[He,p],lt=0,$e=Be.match(se)||[],Qe={},De=0,ct=$e.length;De<ct;++De){var ut=$e[De],ke=Qe[ut],Ne=void 0,_e;if(typeof ke=="string")_e=!1;else{var fe=Ge[ut.charAt(0)];if(fe)Ne=ut.match(fe[1]),ke=fe[0];else{for(var ve=0;ve<be;++ve)if(fe=Me[ve],Ne=ut.match(fe[1]),Ne){ke=fe[0];break}Ne||(ke=p)}_e=ke.length>=5&&ke.substring(0,5)==="lang-",_e&&!(Ne&&typeof Ne[1]=="string")&&(_e=!1,ke=y),_e||(Qe[ut]=ke)}var ie=lt;if(lt+=ut.length,!_e)Ve.push(He+ie,ke);else{var re=Ne[1],oe=ut.indexOf(re),de=oe+re.length;Ne[2]&&(de=ut.length-Ne[2].length,oe=de-re.length);var ye=ke.substring(5);Y(Ye,He+ie,ut.substring(0,oe),xe,Ve),Y(Ye,He+ie+oe,re,ue(ye,re),Ve),Y(Ye,He+ie+de,ut.substring(de),xe,Ve)}}Se.decorations=Ve};return xe}function Re(Ie){var Me=[],Ge=[];Ie.tripleQuotedStrings?Me.push([w,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ie.multiLineStrings?Me.push([w,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Me.push([w,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ie.verbatimStrings&&Ge.push([w,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var se=Ie.hashComments;se&&(Ie.cStyleComments?(se>1?Me.push([R,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Me.push([R,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ge.push([w,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Me.push([R,/^#[^\r\n]*/,null,"#"])),Ie.cStyleComments&&(Ge.push([R,/^\/\/[^\r\n]*/,null]),Ge.push([R,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var be=Ie.regexLiterals;if(be){var xe=be>1?"":`
|
|
\r`,Se=xe?".":"[\\S\\s]",Be="/(?=[^/*"+xe+"])(?:[^/\\x5B\\x5C"+xe+"]|\\x5C"+Se+"|\\x5B(?:[^\\x5C\\x5D"+xe+"]|\\x5C"+Se+")*(?:\\x5D|$))+/";Ge.push(["lang-regex",RegExp("^"+j+"("+Be+")")])}var He=Ie.types;He&&Ge.push([C,He]);var Ye=(""+Ie.keywords).replace(/^ | $/g,"");Ye.length&&Ge.push([L,new RegExp("^(?:"+Ye.replace(/[\s,]+/g,"|")+")\\b"),null]),Me.push([p,/^\s+/,null,` \r
|
|
\xA0`]);var Ve="^.[^\\s\\w.$@'\"`/\\\\]*";return Ie.regexLiterals&&(Ve+="(?!s*/)"),Ge.push([S,/^@[a-z_$][a-z_$@0-9]*/i,null],[C,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[p,/^[a-z_$][a-z_$@0-9]*/i,null],[S,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[p,/^\\[\s\S]?/,null],[x,new RegExp(Ve),null]),le(Me,Ge)}var Ee=Re({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Te(Ie,Me,Ge){for(var se=/(?:^|\s)nocode(?:\s|$)/,be=/\r\n?|\n/,xe=Ie.ownerDocument,Se=xe.createElement("li");Ie.firstChild;)Se.appendChild(Ie.firstChild);var Be=[Se];function He(De){var ct=De.nodeType;if(ct==1&&!se.test(De.className))if(De.nodeName==="br")Ye(De),De.parentNode&&De.parentNode.removeChild(De);else for(var ut=De.firstChild;ut;ut=ut.nextSibling)He(ut);else if((ct==3||ct==4)&&Ge){var ke=De.nodeValue,Ne=ke.match(be);if(Ne){var _e=ke.substring(0,Ne.index);De.nodeValue=_e;var fe=ke.substring(Ne.index+Ne[0].length);if(fe){var ve=De.parentNode;ve.insertBefore(xe.createTextNode(fe),De.nextSibling)}Ye(De),_e||De.parentNode.removeChild(De)}}}function Ye(De){for(;!De.nextSibling;)if(De=De.parentNode,!De)return;function ct(Ne,_e){var fe=_e?Ne.cloneNode(!1):Ne,ve=Ne.parentNode;if(ve){var ie=ct(ve,1),re=Ne.nextSibling;ie.appendChild(fe);for(var oe=re;oe;oe=re)re=oe.nextSibling,ie.appendChild(oe)}return fe}for(var ut=ct(De.nextSibling,0),ke;(ke=ut.parentNode)&&ke.nodeType===1;)ut=ke;Be.push(ut)}for(var Ve=0;Ve<Be.length;++Ve)He(Be[Ve]);Me===(Me|0)&&Be[0].setAttribute("value",Me);var lt=xe.createElement("ol");lt.className="linenums";for(var $e=Math.max(0,Me-1|0)||0,Ve=0,Qe=Be.length;Ve<Qe;++Ve)Se=Be[Ve],Se.className="L"+(Ve+$e)%10,Se.firstChild||Se.appendChild(xe.createTextNode("\xA0")),lt.appendChild(Se);Ie.appendChild(lt)}function Ae(Ie){var Me=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Me=Me&&+Me[1]<=8;var Ge=/\n/g,se=Ie.sourceCode,be=se.length,xe=0,Se=Ie.spans,Be=Se.length,He=0,Ye=Ie.decorations,Ve=Ye.length,lt=0;Ye[Ve]=be;var $e,Qe;for(Qe=$e=0;Qe<Ve;)Ye[Qe]!==Ye[Qe+2]?(Ye[$e++]=Ye[Qe++],Ye[$e++]=Ye[Qe++]):Qe+=2;for(Ve=$e,Qe=$e=0;Qe<Ve;){for(var De=Ye[Qe],ct=Ye[Qe+1],ut=Qe+2;ut+2<=Ve&&Ye[ut+1]===ct;)ut+=2;Ye[$e++]=De,Ye[$e++]=ct,Qe=ut}Ve=Ye.length=$e;var ke=Ie.sourceNode,Ne="";ke&&(Ne=ke.style.display,ke.style.display="none");try{for(var _e=null;He<Be;){var fe=Se[He],ve=Se[He+2]||be,ie=Ye[lt+2]||be,ut=Math.min(ve,ie),re=Se[He+1],oe;if(re.nodeType!==1&&(oe=se.substring(xe,ut))){Me&&(oe=oe.replace(Ge,"\r")),re.nodeValue=oe;var de=re.ownerDocument,ye=de.createElement("span");ye.className=Ye[lt+1];var Le=re.parentNode;Le.replaceChild(ye,re),ye.appendChild(re),xe<ve&&(Se[He+1]=re=de.createTextNode(se.substring(ut,ve)),Le.insertBefore(re,ye.nextSibling))}xe=ut,xe>=ve&&(He+=2),xe>=ie&&(lt+=2)}}finally{ke&&(ke.style.display=Ne)}}var Oe={};function ce(Ie,Me){for(var Ge=Me.length;--Ge>=0;){var se=Me[Ge];Oe.hasOwnProperty(se)?W.console&&console.warn("cannot override language handler %s",se):Oe[se]=Ie}}function ue(Ie,Me){return Ie&&Oe.hasOwnProperty(Ie)||(Ie=/^\s*</.test(Me)?"default-markup":"default-code"),Oe[Ie]}ce(Ee,["default-code"]),ce(le([],[[p,/^[^<?]+/],[v,/^<!\w[^>]*(?:>|$)/],[R,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["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"]),ce(le([[p,/^[\s]+/,null,` \r
|
|
`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[T,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[F,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[x,/^[=<>\/]+/],["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"]),ce(le([],[[B,/^[\s\S]+/]]),["uq.val"]),ce(Re({keywords:d,hashComments:!0,cStyleComments:!0,types:_}),["c","cc","cpp","cxx","cyc","m"]),ce(Re({keywords:"null,true,false"}),["json"]),ce(Re({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:_}),["cs"]),ce(Re({keywords:m,cStyleComments:!0}),["java"]),ce(Re({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ce(Re({keywords:h,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ce(Re({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ce(Re({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ce(Re({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ce(Re({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ce(le([],[[w,/^[\s\S]+/]]),["regex"]);function Pe(Ie){var Me=Ie.langExtension;try{var Ge=b(Ie.sourceNode,Ie.pre),se=Ge.sourceCode;Ie.sourceCode=se,Ie.spans=Ge.spans,Ie.basePos=0,ue(Me,se)(Ie),Ae(Ie)}catch(be){W.console&&console.log(be&&be.stack||be)}}function qe(Ie,Me,Ge){var se=Ge||!1,be=Me||null,xe=document.createElement("div");xe.innerHTML="<pre>"+Ie+"</pre>",xe=xe.firstChild,se&&Te(xe,se,!0);var Se={langExtension:be,numberLines:se,sourceNode:xe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Pe(Se),xe.innerHTML}function ze(Ie,Me){var Ge=Me||document.body,se=Ge.ownerDocument||document;function be(fe){return Ge.getElementsByTagName(fe)}for(var xe=[be("pre"),be("code"),be("xmp")],Se=[],Be=0;Be<xe.length;++Be)for(var He=0,Ye=xe[Be].length;He<Ye;++He)Se.push(xe[Be][He]);xe=null;var Ve=Date;Ve.now||(Ve={now:function(){return+new Date}});var lt=0,$e=/\blang(?:uage)?-([\w.]+)(?!\S)/,Qe=/\bprettyprint\b/,De=/\bprettyprinted\b/,ct=/pre|xmp/i,ut=/^code$/i,ke=/^(?:pre|code|xmp)$/i,Ne={};function _e(){for(var fe=W.PR_SHOULD_USE_CONTINUATION?Ve.now()+250:Infinity;lt<Se.length&&Ve.now()<fe;lt++){for(var ve=Se[lt],ie=Ne,re=ve;re=re.previousSibling;){var oe=re.nodeType,de=(oe===7||oe===8)&&re.nodeValue;if(de?!/^\??prettify\b/.test(de):oe!==3||/\S/.test(re.nodeValue))break;if(de){ie={},de.replace(/\b(\w+)=([\w:.%+-]+)/g,function(ei,Dt,ci){ie[Dt]=ci});break}}var ye=ve.className;if((ie!==Ne||Qe.test(ye))&&!De.test(ye)){for(var Le=!1,Ue=ve.parentNode;Ue;Ue=Ue.parentNode){var Je=Ue.tagName;if(ke.test(Je)&&Ue.className&&Qe.test(Ue.className)){Le=!0;break}}if(!Le){ve.className+=" prettyprinted";var dt=ie.lang;if(!dt){dt=ye.match($e);var rt;!dt&&(rt=ae(ve))&&ut.test(rt.tagName)&&(dt=rt.className.match($e)),dt&&(dt=dt[1])}var mt;if(ct.test(ve.tagName))mt=1;else{var yt=ve.currentStyle,tt=se.defaultView,Ut=yt?yt.whiteSpace:tt&&tt.getComputedStyle?tt.getComputedStyle(ve,null).getPropertyValue("white-space"):0;mt=Ut&&Ut.substring(0,3)==="pre"}var Ct=ie.linenums;(Ct=Ct==="true"||+Ct)||(Ct=ye.match(/\blinenums\b(?::(\d+))?/),Ct=Ct?Ct[1]&&Ct[1].length?+Ct[1]:!0:!1),Ct&&Te(ve,Ct,mt);var Jt={langExtension:dt,sourceNode:ve,numberLines:Ct,pre:mt,sourceCode:null,basePos:null,spans:null,decorations:null};Pe(Jt)}}}lt<Se.length?W.setTimeout(_e,250):typeof Ie=="function"&&Ie()}_e()}var et=W.PR={createSimpleLexer:le,registerLangHandler:ce,sourceDecorator:Re,PR_ATTRIB_NAME:F,PR_ATTRIB_VALUE:B,PR_COMMENT:R,PR_DECLARATION:v,PR_KEYWORD:L,PR_LITERAL:S,PR_NOCODE:O,PR_PLAIN:p,PR_PUNCTUATION:x,PR_SOURCE:y,PR_STRING:w,PR_TAG:T,PR_TYPE:C,prettyPrintOne:k?W.prettyPrintOne=qe:U=qe,prettyPrint:G=k?W.prettyPrint=ze:G=ze},nt=W.define;typeof nt=="function"&&nt.amd&&nt("google-code-prettify",[],function(){return et})})()},SbmS:function(ot,ge,J){ot.exports={flex_box_center:"flex_box_center___HG_ui",flex_space_between:"flex_space_between___i7dgQ",flex_box_vertical_center:"flex_box_vertical_center___25J9O",flex_box_center_end:"flex_box_center_end___Q7-xc",flex_box_column:"flex_box_column___2Q6GJ",userInfo:"userInfo___2ECUY",navInfo:"navInfo___3H3dt",actived:"actived___ilDpa",topBar:"topBar___2O4NK",tabs:"tabs___yp4Rb",active:"active___3Xgtk",list:"list___U4GMG",tags:"tags___2IWIk",searchWrp:"searchWrp___1-W5t",listMessage:"listMessage___1M4jE",deleteMsg:"deleteMsg___1HDtB",listRightMessage:"listRightMessage___1rCRK",content:"content___KsZrb",msg:"msg___35IM3",msgDate:"msgDate___ovoCe"}},T8No:function(ot,ge,J){"use strict";J.d(ge,"a",function(){return G}),J.d(ge,"e",function(){return W}),J.d(ge,"c",function(){return x}),J.d(ge,"b",function(){return p}),J.d(ge,"d",function(){return T}),J.d(ge,"f",function(){return F});var ne=J("MNsG"),$=J("N0LK"),k=J("Cg/j");let X=ne.k||"";const N=new Map;N.set("false",!1),N.set("true",!0),N.set("isMac",ne.f),N.set("isLinux",ne.d),N.set("isWindows",ne.i),N.set("isWeb",ne.h),N.set("isMacNative",ne.f&&!ne.h),N.set("isEdge",X.indexOf("Edg/")>=0),N.set("isFirefox",X.indexOf("Firefox")>=0),N.set("isChrome",X.indexOf("Chrome")>=0),N.set("isSafari",X.indexOf("Safari")>=0);const U=Object.prototype.hasOwnProperty;class G{static has(O){return d.create(O)}static equals(O,j){return m.create(O,j)}static regex(O,j){return w.create(O,j)}static not(O){return l.create(O)}static and(...O){return C.create(O,null)}static or(...O){return S.create(O,null,!0)}static deserialize(O,j=!1){return O?this._deserializeOrExpression(O,j):void 0}static _deserializeOrExpression(O,j){let P=O.split("||");return S.create(P.map(b=>this._deserializeAndExpression(b,j)),null,!0)}static _deserializeAndExpression(O,j){let P=O.split("&&");return C.create(P.map(b=>this._deserializeOne(b,j)),null)}static _deserializeOne(O,j){if(O=O.trim(),O.indexOf("!=")>=0){let P=O.split("!=");return f.create(P[0].trim(),this._deserializeValue(P[1],j))}if(O.indexOf("==")>=0){let P=O.split("==");return m.create(P[0].trim(),this._deserializeValue(P[1],j))}if(O.indexOf("=~")>=0){let P=O.split("=~");return w.create(P[0].trim(),this._deserializeRegexValue(P[1],j))}if(O.indexOf(" in ")>=0){let P=O.split(" in ");return u.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(O)){const P=O.split(">=");return s.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(O)){const P=O.split(">");return o.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(O)){const P=O.split("<=");return _.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(O)){const P=O.split("<");return A.create(P[0].trim(),P[1].trim())}return/^\!\s*/.test(O)?l.create(O.substr(1).trim()):d.create(O)}static _deserializeValue(O,j){if(O=O.trim(),O==="true")return!0;if(O==="false")return!1;let P=/^'([^']*)'$/.exec(O);return P?P[1].trim():O}static _deserializeRegexValue(O,j){if(Object($.C)(O)){if(j)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let P=O.indexOf("/"),b=O.lastIndexOf("/");if(P===b||P<0){if(j)throw new Error(`bad regexp-value '${O}', missing /-enclosure`);return console.warn(`bad regexp-value '${O}', missing /-enclosure`),null}let Y=O.slice(P+1,b),ee=O[b+1]==="i"?"i":"";try{return new RegExp(Y,ee)}catch(ae){if(j)throw new Error(`bad regexp-value '${O}', parse error: ${ae}`);return console.warn(`bad regexp-value '${O}', parse error: ${ae}`),null}}}function W(O,j){const P=O?O.substituteConstants():void 0,b=j?j.substituteConstants():void 0;return!P&&!b?!0:!P||!b?!1:P.equals(b)}function i(O,j){return O.cmp(j)}class D{constructor(){this.type=0}cmp(O){return this.type-O.type}equals(O){return O.type===this.type}substituteConstants(){return this}evaluate(O){return!1}serialize(){return"false"}keys(){return[]}negate(){return g.INSTANCE}}D.INSTANCE=new D;class g{constructor(){this.type=1}cmp(O){return this.type-O.type}equals(O){return O.type===this.type}substituteConstants(){return this}evaluate(O){return!0}serialize(){return"true"}keys(){return[]}negate(){return D.INSTANCE}}g.INSTANCE=new g;class d{constructor(O,j){this.key=O,this.negated=j,this.type=2}static create(O,j=null){const P=N.get(O);return typeof P=="boolean"?P?g.INSTANCE:D.INSTANCE:new d(O,j)}cmp(O){return O.type!==this.type?this.type-O.type:v(this.key,O.key)}equals(O){return O.type===this.type?this.key===O.key:!1}substituteConstants(){const O=N.get(this.key);return typeof O=="boolean"?O?g.INSTANCE:D.INSTANCE:this}evaluate(O){return!!O.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this)),this.negated}}class m{constructor(O,j,P){this.key=O,this.value=j,this.negated=P,this.type=4}static create(O,j,P=null){if(typeof j=="boolean")return j?d.create(O,P):l.create(O,P);const b=N.get(O);if(typeof b=="boolean"){const Y=b?"true":"false";return j===Y?g.INSTANCE:D.INSTANCE}return new m(O,j,P)}cmp(O){return O.type!==this.type?this.type-O.type:y(this.key,this.value,O.key,O.value)}equals(O){return O.type===this.type?this.key===O.key&&this.value===O.value:!1}substituteConstants(){const O=N.get(this.key);if(typeof O=="boolean"){const j=O?"true":"false";return this.value===j?g.INSTANCE:D.INSTANCE}return this}evaluate(O){return O.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this.value,this)),this.negated}}class u{constructor(O,j){this.key=O,this.valueKey=j,this.type=10,this.negated=null}static create(O,j){return new u(O,j)}cmp(O){return O.type!==this.type?this.type-O.type:y(this.key,this.valueKey,O.key,O.valueKey)}equals(O){return O.type===this.type?this.key===O.key&&this.valueKey===O.valueKey:!1}substituteConstants(){return this}evaluate(O){const j=O.getValue(this.valueKey),P=O.getValue(this.key);return Array.isArray(j)?j.indexOf(P)>=0:typeof P=="string"&&typeof j=="object"&&j!==null?U.call(j,P):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=a.create(this)),this.negated}}class a{constructor(O){this._actual=O,this.type=11}static create(O){return new a(O)}cmp(O){return O.type!==this.type?this.type-O.type:this._actual.cmp(O._actual)}equals(O){return O.type===this.type?this._actual.equals(O._actual):!1}substituteConstants(){return this}evaluate(O){return!this._actual.evaluate(O)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class f{constructor(O,j,P){this.key=O,this.value=j,this.negated=P,this.type=5}static create(O,j,P=null){if(typeof j=="boolean")return j?l.create(O,P):d.create(O,P);const b=N.get(O);if(typeof b=="boolean"){const Y=b?"true":"false";return j===Y?D.INSTANCE:g.INSTANCE}return new f(O,j,P)}cmp(O){return O.type!==this.type?this.type-O.type:y(this.key,this.value,O.key,O.value)}equals(O){return O.type===this.type?this.key===O.key&&this.value===O.value:!1}substituteConstants(){const O=N.get(this.key);if(typeof O=="boolean"){const j=O?"true":"false";return this.value===j?D.INSTANCE:g.INSTANCE}return this}evaluate(O){return O.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class l{constructor(O,j){this.key=O,this.negated=j,this.type=3}static create(O,j=null){const P=N.get(O);return typeof P=="boolean"?P?D.INSTANCE:g.INSTANCE:new l(O,j)}cmp(O){return O.type!==this.type?this.type-O.type:v(this.key,O.key)}equals(O){return O.type===this.type?this.key===O.key:!1}substituteConstants(){const O=N.get(this.key);return typeof O=="boolean"?O?D.INSTANCE:g.INSTANCE:this}evaluate(O){return!O.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this)),this.negated}}function h(O,j){if(typeof O=="string"){const P=parseFloat(O);isNaN(P)||(O=P)}return typeof O=="string"||typeof O=="number"?j(O):D.INSTANCE}class o{constructor(O,j,P){this.key=O,this.value=j,this.negated=P,this.type=12}static create(O,j,P=null){return h(j,b=>new o(O,b,P))}cmp(O){return O.type!==this.type?this.type-O.type:y(this.key,this.value,O.key,O.value)}equals(O){return O.type===this.type?this.key===O.key&&this.value===O.value:!1}substituteConstants(){return this}evaluate(O){return typeof this.value=="string"?!1:parseFloat(O.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_.create(this.key,this.value,this)),this.negated}}class s{constructor(O,j,P){this.key=O,this.value=j,this.negated=P,this.type=13}static create(O,j,P=null){return h(j,b=>new s(O,b,P))}cmp(O){return O.type!==this.type?this.type-O.type:y(this.key,this.value,O.key,O.value)}equals(O){return O.type===this.type?this.key===O.key&&this.value===O.value:!1}substituteConstants(){return this}evaluate(O){return typeof this.value=="string"?!1:parseFloat(O.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this.key,this.value,this)),this.negated}}class A{constructor(O,j,P){this.key=O,this.value=j,this.negated=P,this.type=14}static create(O,j,P=null){return h(j,b=>new A(O,b,P))}cmp(O){return O.type!==this.type?this.type-O.type:y(this.key,this.value,O.key,O.value)}equals(O){return O.type===this.type?this.key===O.key&&this.value===O.value:!1}substituteConstants(){return this}evaluate(O){return typeof this.value=="string"?!1:parseFloat(O.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class _{constructor(O,j,P){this.key=O,this.value=j,this.negated=P,this.type=15}static create(O,j,P=null){return h(j,b=>new _(O,b,P))}cmp(O){return O.type!==this.type?this.type-O.type:y(this.key,this.value,O.key,O.value)}equals(O){return O.type===this.type?this.key===O.key&&this.value===O.value:!1}substituteConstants(){return this}evaluate(O){return typeof this.value=="string"?!1:parseFloat(O.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class w{constructor(O,j){this.key=O,this.regexp=j,this.type=7,this.negated=null}static create(O,j){return new w(O,j)}cmp(O){if(O.type!==this.type)return this.type-O.type;if(this.key<O.key)return-1;if(this.key>O.key)return 1;const j=this.regexp?this.regexp.source:"",P=O.regexp?O.regexp.source:"";return j<P?-1:j>P?1:0}equals(O){if(O.type===this.type){const j=this.regexp?this.regexp.source:"",P=O.regexp?O.regexp.source:"";return this.key===O.key&&j===P}return!1}substituteConstants(){return this}evaluate(O){let j=O.getValue(this.key);return this.regexp?this.regexp.test(j):!1}serialize(){const O=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${O}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this)),this.negated}}class L{constructor(O){this._actual=O,this.type=8}static create(O){return new L(O)}cmp(O){return O.type!==this.type?this.type-O.type:this._actual.cmp(O._actual)}equals(O){return O.type===this.type?this._actual.equals(O._actual):!1}substituteConstants(){return this}evaluate(O){return!this._actual.evaluate(O)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function R(O){let j=null;for(let P=0,b=O.length;P<b;P++){const Y=O[P].substituteConstants();if(O[P]!==Y&&j===null){j=[];for(let ee=0;ee<P;ee++)j[ee]=O[ee]}j!==null&&(j[P]=Y)}return j===null?O:j}class C{constructor(O,j){this.expr=O,this.negated=j,this.type=6}static create(O,j){return C._normalizeArr(O,j)}cmp(O){if(O.type!==this.type)return this.type-O.type;if(this.expr.length<O.expr.length)return-1;if(this.expr.length>O.expr.length)return 1;for(let j=0,P=this.expr.length;j<P;j++){const b=i(this.expr[j],O.expr[j]);if(b!==0)return b}return 0}equals(O){if(O.type===this.type){if(this.expr.length!==O.expr.length)return!1;for(let j=0,P=this.expr.length;j<P;j++)if(!this.expr[j].equals(O.expr[j]))return!1;return!0}return!1}substituteConstants(){const O=R(this.expr);return O===this.expr?this:C.create(O,this.negated)}evaluate(O){for(let j=0,P=this.expr.length;j<P;j++)if(!this.expr[j].evaluate(O))return!1;return!0}static _normalizeArr(O,j){const P=[];let b=!1;for(const Y of O){if(!Y)continue;if(Y.type===1){b=!0;continue}if(Y.type===0)return D.INSTANCE;if(Y.type===6){P.push(...Y.expr);continue}P.push(Y)}if(P.length===0&&b)return g.INSTANCE;if(P.length===0)return;if(P.length===1)return P[0];P.sort(i);for(let Y=1;Y<P.length;Y++)P[Y-1].equals(P[Y])&&(P.splice(Y,1),Y--);if(P.length===1)return P[0];for(;P.length>1;){const Y=P[P.length-1];if(Y.type!==9)break;P.pop();const ee=P.pop(),ae=P.length===0,le=S.create(Y.expr.map(Re=>C.create([Re,ee],null)),null,ae);le&&(P.push(le),P.sort(i))}return P.length===1?P[0]:new C(P,j)}serialize(){return this.expr.map(O=>O.serialize()).join(" && ")}keys(){const O=[];for(let j of this.expr)O.push(...j.keys());return O}negate(){if(!this.negated){const O=[];for(let j of this.expr)O.push(j.negate());this.negated=S.create(O,this,!0)}return this.negated}}class S{constructor(O,j){this.expr=O,this.negated=j,this.type=9}static create(O,j,P){return S._normalizeArr(O,j,P)}cmp(O){if(O.type!==this.type)return this.type-O.type;if(this.expr.length<O.expr.length)return-1;if(this.expr.length>O.expr.length)return 1;for(let j=0,P=this.expr.length;j<P;j++){const b=i(this.expr[j],O.expr[j]);if(b!==0)return b}return 0}equals(O){if(O.type===this.type){if(this.expr.length!==O.expr.length)return!1;for(let j=0,P=this.expr.length;j<P;j++)if(!this.expr[j].equals(O.expr[j]))return!1;return!0}return!1}substituteConstants(){const O=R(this.expr);return O===this.expr?this:S.create(O,this.negated,!1)}evaluate(O){for(let j=0,P=this.expr.length;j<P;j++)if(this.expr[j].evaluate(O))return!0;return!1}static _normalizeArr(O,j,P){let b=[],Y=!1;if(O){for(let ee=0,ae=O.length;ee<ae;ee++){const le=O[ee];if(!le)continue;if(le.type===0){Y=!0;continue}if(le.type===1)return g.INSTANCE;if(le.type===9){b=b.concat(le.expr);continue}b.push(le)}if(b.length===0&&Y)return D.INSTANCE;b.sort(i)}if(b.length===0)return;if(b.length===1)return b[0];for(let ee=1;ee<b.length;ee++)b[ee-1].equals(b[ee])&&(b.splice(ee,1),ee--);if(b.length===1)return b[0];if(P){for(let ee=0;ee<b.length;ee++)for(let ae=ee+1;ae<b.length;ae++)F(b[ee],b[ae])&&(b.splice(ae,1),ae--);if(b.length===1)return b[0]}return new S(b,j)}serialize(){return this.expr.map(O=>O.serialize()).join(" || ")}keys(){const O=[];for(let j of this.expr)O.push(...j.keys());return O}negate(){if(!this.negated){let O=[];for(let j of this.expr)O.push(j.negate());for(;O.length>1;){const j=O.shift(),P=O.shift(),b=[];for(const ee of B(j))for(const ae of B(P))b.push(C.create([ee,ae],null));const Y=O.length===0;O.unshift(S.create(b,null,Y))}this.negated=O[0]}return this.negated}}class x extends d{constructor(O,j,P){super(O,null);this._defaultValue=j,typeof P=="object"?x._info.push(Object.assign(Object.assign({},P),{key:O})):P!==!0&&x._info.push({key:O,description:P,type:j!=null?typeof j:void 0})}static all(){return x._info.values()}bindTo(O){return O.createKey(this.key,this._defaultValue)}getValue(O){return O.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(O){return m.create(this.key,O)}}x._info=[];const p=Object(k.c)("contextKeyService"),T="setContext";function v(O,j){return O<j?-1:O>j?1:0}function y(O,j,P,b){return O<P?-1:O>P?1:j<b?-1:j>b?1:0}function F(O,j){if(j.type===6&&O.type!==9&&O.type!==6){for(const Y of j.expr)if(O.equals(Y))return!0}const P=O.negate(),b=B(P).concat(B(j));b.sort(i);for(let Y=0;Y<b.length;Y++){const ee=b[Y],ae=ee.negate();for(let le=Y+1;le<b.length;le++){const Re=b[le];if(ae.equals(Re))return!0}}return!1}function B(O){return O.type===9?O.expr:[O]}},TXwP:function(ot,ge,J){var ne,$;(function(){var k;(function(){"use strict";var N=[,,function(i){function D(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var m=new D(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},D.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},D.prototype.has_match=function(m){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(m))return!0;return!1},D.prototype.set_indent=function(m,u){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(m){this.__items.push(m);var u=m.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=m.length-u:this.__character_count+=m.length},D.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function g(m,u){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),u=u||"",m.indent_level>0&&(u=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}g.prototype.get_indent_size=function(m,u){var a=this.__base_string_length;return u=u||0,m<0&&(a=0),a+=m*this.__indent_size,a+=u,a},g.prototype.get_indent_string=function(m,u){var a=this.__base_string;return u=u||0,m<0&&(m=0,a=""),u+=m*this.__indent_size,this.__ensure_cache(u),a+=this.__cache[u],a},g.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var m=this.__cache.length,u=0,a="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,a=new Array(u+1).join(this.__indent_string)),m&&(a+=new Array(m+1).join(" ")),this.__cache.push(a)};function d(m,u){this.__indent_cache=new g(m,u),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}d.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},d.prototype.get_line_number=function(){return this.__lines.length},d.prototype.get_indent_string=function(m,u){return this.__indent_cache.get_indent_string(m,u)},d.prototype.get_indent_size=function(m,u){return this.__indent_cache.get_indent_size(m,u)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(m){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(a=a.replace(/[\n]/g,m)),a},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(m,u){return m=m||0,u=u||0,this.next_line.set_indent(m,u),this.__lines.length>1?(this.current_line.set_indent(m,u),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(m){for(var u=0;u<m.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},d.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},d.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},d.prototype.remove_indent=function(m){for(var u=this.__lines.length;m<u;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},d.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},d.prototype.just_added_newline=function(){return this.current_line.is_empty()},d.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},d.prototype.ensure_empty_line_above=function(m,u){for(var a=this.__lines.length-2;a>=0;){var f=this.__lines[a];if(f.is_empty())break;if(f.item(0).indexOf(m)!==0&&f.item(-1)!==u){this.__lines.splice(a+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},i.exports.Output=d},,,,function(i){function D(m,u){this.raw_options=g(m,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}D.prototype._get_array=function(m,u){var a=this.raw_options[m],f=u||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(f=a.concat()):typeof a=="string"&&(f=a.split(/[^a-zA-Z0-9_\/\-]+/)),f},D.prototype._get_boolean=function(m,u){var a=this.raw_options[m],f=a===void 0?!!u:!!a;return f},D.prototype._get_characters=function(m,u){var a=this.raw_options[m],f=u||"";return typeof a=="string"&&(f=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),f},D.prototype._get_number=function(m,u){var a=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var f=parseInt(a,10);return isNaN(f)&&(f=u),f},D.prototype._get_selection=function(m,u,a){var f=this._get_selection_list(m,u,a);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return f[0]},D.prototype._get_selection_list=function(m,u,a){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[u[0]],!this._is_valid_selection(a,u))throw new Error("Invalid Default Value!");var f=this._get_array(m,a);if(!this._is_valid_selection(f,u))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return f},D.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(a){return u.indexOf(a)===-1})};function g(m,u){var a={};m=d(m);var f;for(f in m)f!==u&&(a[f]=m[f]);if(u&&m[u])for(f in m[u])a[f]=m[u][f];return a}function d(m){var u={},a;for(a in m){var f=a.replace(/-/g,"_");u[f]=m[a]}return u}i.exports.Options=D,i.exports.normalizeOpts=d,i.exports.mergeOpts=g},,function(i){var D=RegExp.prototype.hasOwnProperty("sticky");function g(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},g.prototype.peek=function(d){var m=null;return d=d||0,d+=this.__position,d>=0&&d<this.__input_length&&(m=this.__input.charAt(d)),m},g.prototype.__match=function(d,m){d.lastIndex=m;var u=d.exec(this.__input);return u&&!(D&&d.sticky)&&(u.index!==m&&(u=null)),u},g.prototype.test=function(d,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(d,m):!1},g.prototype.testChar=function(d,m){var u=this.peek(m);return d.lastIndex=0,u!==null&&d.test(u)},g.prototype.match=function(d){var m=this.__match(d,this.__position);return m?this.__position+=m[0].length:m=null,m},g.prototype.read=function(d,m,u){var a="",f;return d&&(f=this.match(d),f&&(a+=f[0])),m&&(f||!d)&&(a+=this.readUntil(m,u)),a},g.prototype.readUntil=function(d,m){var u="",a=this.__position;d.lastIndex=this.__position;var f=d.exec(this.__input);return f?(a=f.index,m&&(a+=f[0].length)):a=this.__input_length,u=this.__input.substring(this.__position,a),this.__position=a,u},g.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},g.prototype.get_regexp=function(d,m){var u=null,a="g";return m&&D&&(a="y"),typeof d=="string"&&d!==""?u=new RegExp(d,a):d&&(u=new RegExp(d.source,a)),u},g.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(d){var m=this.__position,u=this.readUntilAfter(d);return this.__position=m,u},g.prototype.lookBack=function(d){var m=this.__position-1;return m>=d.length&&this.__input.substring(m-d.length,m).toLowerCase()===d},i.exports.InputScanner=g},,,,,function(i){function D(g,d){g=typeof g=="string"?g:g.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+d,"g")}D.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(g);m;)d[m[1]]=m[2],m=this.__directive_pattern.exec(g);return d},D.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=D},,function(i,D,g){var d=g(16).Beautifier,m=g(17).Options;function u(a,f){var l=new d(a,f);return l.beautify()}i.exports=u,i.exports.defaultOptions=function(){return new m}},function(i,D,g){var d=g(17).Options,m=g(2).Output,u=g(8).InputScanner,a=g(13).Directives,f=new a(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,h=/\r\n|[\r\n]/g,o=/\s/,s=/(?:\s|\n)+/g,A=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,_=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function w(L,R){this._source_text=L||"",this._options=new d(R),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}w.prototype.eatString=function(L){var R="";for(this._ch=this._input.next();this._ch;){if(R+=this._ch,this._ch==="\\")R+=this._input.next();else if(L.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return R},w.prototype.eatWhitespace=function(L){for(var R=o.test(this._input.peek()),C=0;o.test(this._input.peek());)this._ch=this._input.next(),L&&this._ch===`
|
|
`&&((C===0||C<this._options.max_preserve_newlines)&&(C++,this._output.add_new_line(!0)));return R},w.prototype.foundNestedPseudoClass=function(){for(var L=0,R=1,C=this._input.peek(R);C;){if(C==="{")return!0;if(C==="(")L+=1;else if(C===")"){if(L===0)return!1;L-=1}else if(C===";"||C==="}")return!1;R++,C=this._input.peek(R)}return!1},w.prototype.print_string=function(L){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(L)},w.prototype.preserveSingleSpace=function(L){L&&(this._output.space_before_token=!0)},w.prototype.indent=function(){this._indentLevel++},w.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var L=this._source_text,R=this._options.eol;R==="auto"&&(R=`
|
|
`,L&&l.test(L||"")&&(R=L.match(l)[0])),L=L.replace(h,`
|
|
`);var C=L.match(/^[\t ]*/)[0];this._output=new m(this._options,C),this._input=new u(L),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var S=0,x=!1,p=!1,T=!1,v=!1,y=!1,F=!1,B=this._ch,O=!1,j,P,b;j=this._input.read(s),P=j!=="",b=B,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),B=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var Y=this._input.read(A),ee=f.get_directives(Y);ee&&ee.ignore==="start"&&(Y+=f.readIgnored(this._input)),this.print_string(Y),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(_)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(P),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ae=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ae.match(/[ :]$/)&&(ae=this.eatString(": ").replace(/\s$/,""),this.print_string(ae),this._output.space_before_token=!0),ae=ae.replace(/\s$/,""),ae==="extend"?v=!0:ae==="import"&&(y=!0),ae in this.NESTED_AT_RULE?(this._nestedLevel+=1,ae in this.CONDITIONAL_GROUP_RULE&&(T=!0)):!x&&S===0&&ae.indexOf(":")!==-1&&(p=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(P),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")p&&(p=!1,this.outdent()),T?(T=!1,x=this._indentLevel>=this._nestedLevel):x=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&x&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(b==="("?this._output.space_before_token=!1:b!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),b==="{"&&this._output.trim(!0),y=!1,v=!1,p&&(this.outdent(),p=!1),this.print_string(this._ch),x=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var le=0;le<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;le++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[le])){O=!0;break}(x||T)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!v&&S===0?(this.print_string(":"),p||(p=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Re=b==='"'||b==="'";this.preserveSingleSpace(Re||P),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")O=!1,S===0?(p&&(this.outdent(),p=!1),v=!1,y=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),S++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),S&&(S--,this.outdent()));else{var Ee=!1;this._input.lookBack("with")&&(Ee=!0),this.preserveSingleSpace(P||Ee),this.print_string(this._ch),p&&b==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),F=!0):(this.eatWhitespace(),S++,this.indent())}else if(this._ch===")")S&&(S--,this.outdent()),F&&this._input.peek()===";"&&this._options.selector_separator_newline&&(F=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!p||F)&&S===0&&!y&&!v?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!p&&S===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&o.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(P),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),o.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Te=b==='"'||b==="'";this.preserveSingleSpace(Te||P),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&O&&this._output.add_new_line()}var Ae=this._output.get_code(R);return Ae},i.exports.Beautifier=w},function(i,D,g){var d=g(6).Options;function m(u){d.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var a=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||a;var f=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<f.length;l++)f[l]!=="expand"?this.brace_style="collapse":this.brace_style=f[l]}m.prototype=new d,i.exports.Options=m}],U={};function G(i){var D=U[i];if(D!==void 0)return D.exports;var g=U[i]={exports:{}};return N[i](g,g.exports,G),g.exports}var W=G(15);k=W})();var X=k;!(ne=[],$=function(){return{css_beautify:X}}.apply(ge,ne),$!==void 0&&(ot.exports=$))})()},UZu5:function(ot,ge,J){},Vhoy:function(ot,ge,J){"use strict";J.d(ge,"d",function(){return X}),J.d(ge,"e",function(){return N}),J.d(ge,"c",function(){return U}),J.d(ge,"b",function(){return G}),J.d(ge,"a",function(){return W});var ne=J("MI8n");class ${constructor(){this._icons=new Map,this._onDidRegister=new ne.b}add(i){const D=this._icons.get(i.id);D?i.description?D.description=i.description:console.error(`Duplicate registration of codicon ${i.id}`):(this._icons.set(i.id,i),this._onDidRegister.fire(i))}get(i){return this._icons.get(i)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const k=new $,X=k;function N(i,D){return new G(i,D)}function U(i){return i?i.replace(/\$\((.*?)\)/g,(D,g)=>` ${g} `).trim():""}class G{constructor(i,D,g){this.id=i,this.definition=D,this.description=g,k.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var W;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9\\-]+",i.iconModifierExpression="~[A-Za-z]+";const D=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function g(u){if(u instanceof G)return["codicon","codicon-"+u.id];const a=D.exec(u.id);if(!a)return g(G.error);let[,f,l]=a;const h=["codicon","codicon-"+f];return l&&h.push("codicon-modifier-"+l.substr(1)),h}i.asClassNameArray=g;function d(u){return g(u).join(" ")}i.asClassName=d;function m(u){return"."+g(u).join(".")}i.asCSSSelector=m})(W||(W={})),function(i){i.add=new i("add",{fontCharacter:"\\ea60"}),i.plus=new i("plus",i.add.definition),i.gistNew=new i("gist-new",i.add.definition),i.repoCreate=new i("repo-create",i.add.definition),i.lightbulb=new i("lightbulb",{fontCharacter:"\\ea61"}),i.lightBulb=new i("light-bulb",{fontCharacter:"\\ea61"}),i.repo=new i("repo",{fontCharacter:"\\ea62"}),i.repoDelete=new i("repo-delete",{fontCharacter:"\\ea62"}),i.gistFork=new i("gist-fork",{fontCharacter:"\\ea63"}),i.repoForked=new i("repo-forked",{fontCharacter:"\\ea63"}),i.gitPullRequest=new i("git-pull-request",{fontCharacter:"\\ea64"}),i.gitPullRequestAbandoned=new i("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),i.recordKeys=new i("record-keys",{fontCharacter:"\\ea65"}),i.keyboard=new i("keyboard",{fontCharacter:"\\ea65"}),i.tag=new i("tag",{fontCharacter:"\\ea66"}),i.tagAdd=new i("tag-add",{fontCharacter:"\\ea66"}),i.tagRemove=new i("tag-remove",{fontCharacter:"\\ea66"}),i.person=new i("person",{fontCharacter:"\\ea67"}),i.personFollow=new i("person-follow",{fontCharacter:"\\ea67"}),i.personOutline=new i("person-outline",{fontCharacter:"\\ea67"}),i.personFilled=new i("person-filled",{fontCharacter:"\\ea67"}),i.gitBranch=new i("git-branch",{fontCharacter:"\\ea68"}),i.gitBranchCreate=new i("git-branch-create",{fontCharacter:"\\ea68"}),i.gitBranchDelete=new i("git-branch-delete",{fontCharacter:"\\ea68"}),i.sourceControl=new i("source-control",{fontCharacter:"\\ea68"}),i.mirror=new i("mirror",{fontCharacter:"\\ea69"}),i.mirrorPublic=new i("mirror-public",{fontCharacter:"\\ea69"}),i.star=new i("star",{fontCharacter:"\\ea6a"}),i.starAdd=new i("star-add",{fontCharacter:"\\ea6a"}),i.starDelete=new i("star-delete",{fontCharacter:"\\ea6a"}),i.starEmpty=new i("star-empty",{fontCharacter:"\\ea6a"}),i.comment=new i("comment",{fontCharacter:"\\ea6b"}),i.commentAdd=new i("comment-add",{fontCharacter:"\\ea6b"}),i.alert=new i("alert",{fontCharacter:"\\ea6c"}),i.warning=new i("warning",{fontCharacter:"\\ea6c"}),i.search=new i("search",{fontCharacter:"\\ea6d"}),i.searchSave=new i("search-save",{fontCharacter:"\\ea6d"}),i.logOut=new i("log-out",{fontCharacter:"\\ea6e"}),i.signOut=new i("sign-out",{fontCharacter:"\\ea6e"}),i.logIn=new i("log-in",{fontCharacter:"\\ea6f"}),i.signIn=new i("sign-in",{fontCharacter:"\\ea6f"}),i.eye=new i("eye",{fontCharacter:"\\ea70"}),i.eyeUnwatch=new i("eye-unwatch",{fontCharacter:"\\ea70"}),i.eyeWatch=new i("eye-watch",{fontCharacter:"\\ea70"}),i.circleFilled=new i("circle-filled",{fontCharacter:"\\ea71"}),i.primitiveDot=new i("primitive-dot",{fontCharacter:"\\ea71"}),i.closeDirty=new i("close-dirty",{fontCharacter:"\\ea71"}),i.debugBreakpoint=new i("debug-breakpoint",{fontCharacter:"\\ea71"}),i.debugBreakpointDisabled=new i("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),i.debugHint=new i("debug-hint",{fontCharacter:"\\ea71"}),i.primitiveSquare=new i("primitive-square",{fontCharacter:"\\ea72"}),i.edit=new i("edit",{fontCharacter:"\\ea73"}),i.pencil=new i("pencil",{fontCharacter:"\\ea73"}),i.info=new i("info",{fontCharacter:"\\ea74"}),i.issueOpened=new i("issue-opened",{fontCharacter:"\\ea74"}),i.gistPrivate=new i("gist-private",{fontCharacter:"\\ea75"}),i.gitForkPrivate=new i("git-fork-private",{fontCharacter:"\\ea75"}),i.lock=new i("lock",{fontCharacter:"\\ea75"}),i.mirrorPrivate=new i("mirror-private",{fontCharacter:"\\ea75"}),i.close=new i("close",{fontCharacter:"\\ea76"}),i.removeClose=new i("remove-close",{fontCharacter:"\\ea76"}),i.x=new i("x",{fontCharacter:"\\ea76"}),i.repoSync=new i("repo-sync",{fontCharacter:"\\ea77"}),i.sync=new i("sync",{fontCharacter:"\\ea77"}),i.clone=new i("clone",{fontCharacter:"\\ea78"}),i.desktopDownload=new i("desktop-download",{fontCharacter:"\\ea78"}),i.beaker=new i("beaker",{fontCharacter:"\\ea79"}),i.microscope=new i("microscope",{fontCharacter:"\\ea79"}),i.vm=new i("vm",{fontCharacter:"\\ea7a"}),i.deviceDesktop=new i("device-desktop",{fontCharacter:"\\ea7a"}),i.file=new i("file",{fontCharacter:"\\ea7b"}),i.fileText=new i("file-text",{fontCharacter:"\\ea7b"}),i.more=new i("more",{fontCharacter:"\\ea7c"}),i.ellipsis=new i("ellipsis",{fontCharacter:"\\ea7c"}),i.kebabHorizontal=new i("kebab-horizontal",{fontCharacter:"\\ea7c"}),i.mailReply=new i("mail-reply",{fontCharacter:"\\ea7d"}),i.reply=new i("reply",{fontCharacter:"\\ea7d"}),i.organization=new i("organization",{fontCharacter:"\\ea7e"}),i.organizationFilled=new i("organization-filled",{fontCharacter:"\\ea7e"}),i.organizationOutline=new i("organization-outline",{fontCharacter:"\\ea7e"}),i.newFile=new i("new-file",{fontCharacter:"\\ea7f"}),i.fileAdd=new i("file-add",{fontCharacter:"\\ea7f"}),i.newFolder=new i("new-folder",{fontCharacter:"\\ea80"}),i.fileDirectoryCreate=new i("file-directory-create",{fontCharacter:"\\ea80"}),i.trash=new i("trash",{fontCharacter:"\\ea81"}),i.trashcan=new i("trashcan",{fontCharacter:"\\ea81"}),i.history=new i("history",{fontCharacter:"\\ea82"}),i.clock=new i("clock",{fontCharacter:"\\ea82"}),i.folder=new i("folder",{fontCharacter:"\\ea83"}),i.fileDirectory=new i("file-directory",{fontCharacter:"\\ea83"}),i.symbolFolder=new i("symbol-folder",{fontCharacter:"\\ea83"}),i.logoGithub=new i("logo-github",{fontCharacter:"\\ea84"}),i.markGithub=new i("mark-github",{fontCharacter:"\\ea84"}),i.github=new i("github",{fontCharacter:"\\ea84"}),i.terminal=new i("terminal",{fontCharacter:"\\ea85"}),i.console=new i("console",{fontCharacter:"\\ea85"}),i.repl=new i("repl",{fontCharacter:"\\ea85"}),i.zap=new i("zap",{fontCharacter:"\\ea86"}),i.symbolEvent=new i("symbol-event",{fontCharacter:"\\ea86"}),i.error=new i("error",{fontCharacter:"\\ea87"}),i.stop=new i("stop",{fontCharacter:"\\ea87"}),i.variable=new i("variable",{fontCharacter:"\\ea88"}),i.symbolVariable=new i("symbol-variable",{fontCharacter:"\\ea88"}),i.array=new i("array",{fontCharacter:"\\ea8a"}),i.symbolArray=new i("symbol-array",{fontCharacter:"\\ea8a"}),i.symbolModule=new i("symbol-module",{fontCharacter:"\\ea8b"}),i.symbolPackage=new i("symbol-package",{fontCharacter:"\\ea8b"}),i.symbolNamespace=new i("symbol-namespace",{fontCharacter:"\\ea8b"}),i.symbolObject=new i("symbol-object",{fontCharacter:"\\ea8b"}),i.symbolMethod=new i("symbol-method",{fontCharacter:"\\ea8c"}),i.symbolFunction=new i("symbol-function",{fontCharacter:"\\ea8c"}),i.symbolConstructor=new i("symbol-constructor",{fontCharacter:"\\ea8c"}),i.symbolBoolean=new i("symbol-boolean",{fontCharacter:"\\ea8f"}),i.symbolNull=new i("symbol-null",{fontCharacter:"\\ea8f"}),i.symbolNumeric=new i("symbol-numeric",{fontCharacter:"\\ea90"}),i.symbolNumber=new i("symbol-number",{fontCharacter:"\\ea90"}),i.symbolStructure=new i("symbol-structure",{fontCharacter:"\\ea91"}),i.symbolStruct=new i("symbol-struct",{fontCharacter:"\\ea91"}),i.symbolParameter=new i("symbol-parameter",{fontCharacter:"\\ea92"}),i.symbolTypeParameter=new i("symbol-type-parameter",{fontCharacter:"\\ea92"}),i.symbolKey=new i("symbol-key",{fontCharacter:"\\ea93"}),i.symbolText=new i("symbol-text",{fontCharacter:"\\ea93"}),i.symbolReference=new i("symbol-reference",{fontCharacter:"\\ea94"}),i.goToFile=new i("go-to-file",{fontCharacter:"\\ea94"}),i.symbolEnum=new i("symbol-enum",{fontCharacter:"\\ea95"}),i.symbolValue=new i("symbol-value",{fontCharacter:"\\ea95"}),i.symbolRuler=new i("symbol-ruler",{fontCharacter:"\\ea96"}),i.symbolUnit=new i("symbol-unit",{fontCharacter:"\\ea96"}),i.activateBreakpoints=new i("activate-breakpoints",{fontCharacter:"\\ea97"}),i.archive=new i("archive",{fontCharacter:"\\ea98"}),i.arrowBoth=new i("arrow-both",{fontCharacter:"\\ea99"}),i.arrowDown=new i("arrow-down",{fontCharacter:"\\ea9a"}),i.arrowLeft=new i("arrow-left",{fontCharacter:"\\ea9b"}),i.arrowRight=new i("arrow-right",{fontCharacter:"\\ea9c"}),i.arrowSmallDown=new i("arrow-small-down",{fontCharacter:"\\ea9d"}),i.arrowSmallLeft=new i("arrow-small-left",{fontCharacter:"\\ea9e"}),i.arrowSmallRight=new i("arrow-small-right",{fontCharacter:"\\ea9f"}),i.arrowSmallUp=new i("arrow-small-up",{fontCharacter:"\\eaa0"}),i.arrowUp=new i("arrow-up",{fontCharacter:"\\eaa1"}),i.bell=new i("bell",{fontCharacter:"\\eaa2"}),i.bold=new i("bold",{fontCharacter:"\\eaa3"}),i.book=new i("book",{fontCharacter:"\\eaa4"}),i.bookmark=new i("bookmark",{fontCharacter:"\\eaa5"}),i.debugBreakpointConditionalUnverified=new i("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),i.debugBreakpointConditional=new i("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),i.debugBreakpointConditionalDisabled=new i("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),i.debugBreakpointDataUnverified=new i("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),i.debugBreakpointData=new i("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),i.debugBreakpointDataDisabled=new i("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),i.debugBreakpointLogUnverified=new i("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),i.debugBreakpointLog=new i("debug-breakpoint-log",{fontCharacter:"\\eaab"}),i.debugBreakpointLogDisabled=new i("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),i.briefcase=new i("briefcase",{fontCharacter:"\\eaac"}),i.broadcast=new i("broadcast",{fontCharacter:"\\eaad"}),i.browser=new i("browser",{fontCharacter:"\\eaae"}),i.bug=new i("bug",{fontCharacter:"\\eaaf"}),i.calendar=new i("calendar",{fontCharacter:"\\eab0"}),i.caseSensitive=new i("case-sensitive",{fontCharacter:"\\eab1"}),i.check=new i("check",{fontCharacter:"\\eab2"}),i.checklist=new i("checklist",{fontCharacter:"\\eab3"}),i.chevronDown=new i("chevron-down",{fontCharacter:"\\eab4"}),i.dropDownButton=new i("drop-down-button",i.chevronDown.definition),i.chevronLeft=new i("chevron-left",{fontCharacter:"\\eab5"}),i.chevronRight=new i("chevron-right",{fontCharacter:"\\eab6"}),i.chevronUp=new i("chevron-up",{fontCharacter:"\\eab7"}),i.chromeClose=new i("chrome-close",{fontCharacter:"\\eab8"}),i.chromeMaximize=new i("chrome-maximize",{fontCharacter:"\\eab9"}),i.chromeMinimize=new i("chrome-minimize",{fontCharacter:"\\eaba"}),i.chromeRestore=new i("chrome-restore",{fontCharacter:"\\eabb"}),i.circleOutline=new i("circle-outline",{fontCharacter:"\\eabc"}),i.debugBreakpointUnverified=new i("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),i.circleSlash=new i("circle-slash",{fontCharacter:"\\eabd"}),i.circuitBoard=new i("circuit-board",{fontCharacter:"\\eabe"}),i.clearAll=new i("clear-all",{fontCharacter:"\\eabf"}),i.clippy=new i("clippy",{fontCharacter:"\\eac0"}),i.closeAll=new i("close-all",{fontCharacter:"\\eac1"}),i.cloudDownload=new i("cloud-download",{fontCharacter:"\\eac2"}),i.cloudUpload=new i("cloud-upload",{fontCharacter:"\\eac3"}),i.code=new i("code",{fontCharacter:"\\eac4"}),i.collapseAll=new i("collapse-all",{fontCharacter:"\\eac5"}),i.colorMode=new i("color-mode",{fontCharacter:"\\eac6"}),i.commentDiscussion=new i("comment-discussion",{fontCharacter:"\\eac7"}),i.compareChanges=new i("compare-changes",{fontCharacter:"\\eafd"}),i.creditCard=new i("credit-card",{fontCharacter:"\\eac9"}),i.dash=new i("dash",{fontCharacter:"\\eacc"}),i.dashboard=new i("dashboard",{fontCharacter:"\\eacd"}),i.database=new i("database",{fontCharacter:"\\eace"}),i.debugContinue=new i("debug-continue",{fontCharacter:"\\eacf"}),i.debugDisconnect=new i("debug-disconnect",{fontCharacter:"\\ead0"}),i.debugPause=new i("debug-pause",{fontCharacter:"\\ead1"}),i.debugRestart=new i("debug-restart",{fontCharacter:"\\ead2"}),i.debugStart=new i("debug-start",{fontCharacter:"\\ead3"}),i.debugStepInto=new i("debug-step-into",{fontCharacter:"\\ead4"}),i.debugStepOut=new i("debug-step-out",{fontCharacter:"\\ead5"}),i.debugStepOver=new i("debug-step-over",{fontCharacter:"\\ead6"}),i.debugStop=new i("debug-stop",{fontCharacter:"\\ead7"}),i.debug=new i("debug",{fontCharacter:"\\ead8"}),i.deviceCameraVideo=new i("device-camera-video",{fontCharacter:"\\ead9"}),i.deviceCamera=new i("device-camera",{fontCharacter:"\\eada"}),i.deviceMobile=new i("device-mobile",{fontCharacter:"\\eadb"}),i.diffAdded=new i("diff-added",{fontCharacter:"\\eadc"}),i.diffIgnored=new i("diff-ignored",{fontCharacter:"\\eadd"}),i.diffModified=new i("diff-modified",{fontCharacter:"\\eade"}),i.diffRemoved=new i("diff-removed",{fontCharacter:"\\eadf"}),i.diffRenamed=new i("diff-renamed",{fontCharacter:"\\eae0"}),i.diff=new i("diff",{fontCharacter:"\\eae1"}),i.discard=new i("discard",{fontCharacter:"\\eae2"}),i.editorLayout=new i("editor-layout",{fontCharacter:"\\eae3"}),i.emptyWindow=new i("empty-window",{fontCharacter:"\\eae4"}),i.exclude=new i("exclude",{fontCharacter:"\\eae5"}),i.extensions=new i("extensions",{fontCharacter:"\\eae6"}),i.eyeClosed=new i("eye-closed",{fontCharacter:"\\eae7"}),i.fileBinary=new i("file-binary",{fontCharacter:"\\eae8"}),i.fileCode=new i("file-code",{fontCharacter:"\\eae9"}),i.fileMedia=new i("file-media",{fontCharacter:"\\eaea"}),i.filePdf=new i("file-pdf",{fontCharacter:"\\eaeb"}),i.fileSubmodule=new i("file-submodule",{fontCharacter:"\\eaec"}),i.fileSymlinkDirectory=new i("file-symlink-directory",{fontCharacter:"\\eaed"}),i.fileSymlinkFile=new i("file-symlink-file",{fontCharacter:"\\eaee"}),i.fileZip=new i("file-zip",{fontCharacter:"\\eaef"}),i.files=new i("files",{fontCharacter:"\\eaf0"}),i.filter=new i("filter",{fontCharacter:"\\eaf1"}),i.flame=new i("flame",{fontCharacter:"\\eaf2"}),i.foldDown=new i("fold-down",{fontCharacter:"\\eaf3"}),i.foldUp=new i("fold-up",{fontCharacter:"\\eaf4"}),i.fold=new i("fold",{fontCharacter:"\\eaf5"}),i.folderActive=new i("folder-active",{fontCharacter:"\\eaf6"}),i.folderOpened=new i("folder-opened",{fontCharacter:"\\eaf7"}),i.gear=new i("gear",{fontCharacter:"\\eaf8"}),i.gift=new i("gift",{fontCharacter:"\\eaf9"}),i.gistSecret=new i("gist-secret",{fontCharacter:"\\eafa"}),i.gist=new i("gist",{fontCharacter:"\\eafb"}),i.gitCommit=new i("git-commit",{fontCharacter:"\\eafc"}),i.gitCompare=new i("git-compare",{fontCharacter:"\\eafd"}),i.gitMerge=new i("git-merge",{fontCharacter:"\\eafe"}),i.githubAction=new i("github-action",{fontCharacter:"\\eaff"}),i.githubAlt=new i("github-alt",{fontCharacter:"\\eb00"}),i.globe=new i("globe",{fontCharacter:"\\eb01"}),i.grabber=new i("grabber",{fontCharacter:"\\eb02"}),i.graph=new i("graph",{fontCharacter:"\\eb03"}),i.gripper=new i("gripper",{fontCharacter:"\\eb04"}),i.heart=new i("heart",{fontCharacter:"\\eb05"}),i.home=new i("home",{fontCharacter:"\\eb06"}),i.horizontalRule=new i("horizontal-rule",{fontCharacter:"\\eb07"}),i.hubot=new i("hubot",{fontCharacter:"\\eb08"}),i.inbox=new i("inbox",{fontCharacter:"\\eb09"}),i.issueClosed=new i("issue-closed",{fontCharacter:"\\eba4"}),i.issueReopened=new i("issue-reopened",{fontCharacter:"\\eb0b"}),i.issues=new i("issues",{fontCharacter:"\\eb0c"}),i.italic=new i("italic",{fontCharacter:"\\eb0d"}),i.jersey=new i("jersey",{fontCharacter:"\\eb0e"}),i.json=new i("json",{fontCharacter:"\\eb0f"}),i.kebabVertical=new i("kebab-vertical",{fontCharacter:"\\eb10"}),i.key=new i("key",{fontCharacter:"\\eb11"}),i.law=new i("law",{fontCharacter:"\\eb12"}),i.lightbulbAutofix=new i("lightbulb-autofix",{fontCharacter:"\\eb13"}),i.linkExternal=new i("link-external",{fontCharacter:"\\eb14"}),i.link=new i("link",{fontCharacter:"\\eb15"}),i.listOrdered=new i("list-ordered",{fontCharacter:"\\eb16"}),i.listUnordered=new i("list-unordered",{fontCharacter:"\\eb17"}),i.liveShare=new i("live-share",{fontCharacter:"\\eb18"}),i.loading=new i("loading",{fontCharacter:"\\eb19"}),i.location=new i("location",{fontCharacter:"\\eb1a"}),i.mailRead=new i("mail-read",{fontCharacter:"\\eb1b"}),i.mail=new i("mail",{fontCharacter:"\\eb1c"}),i.markdown=new i("markdown",{fontCharacter:"\\eb1d"}),i.megaphone=new i("megaphone",{fontCharacter:"\\eb1e"}),i.mention=new i("mention",{fontCharacter:"\\eb1f"}),i.milestone=new i("milestone",{fontCharacter:"\\eb20"}),i.mortarBoard=new i("mortar-board",{fontCharacter:"\\eb21"}),i.move=new i("move",{fontCharacter:"\\eb22"}),i.multipleWindows=new i("multiple-windows",{fontCharacter:"\\eb23"}),i.mute=new i("mute",{fontCharacter:"\\eb24"}),i.noNewline=new i("no-newline",{fontCharacter:"\\eb25"}),i.note=new i("note",{fontCharacter:"\\eb26"}),i.octoface=new i("octoface",{fontCharacter:"\\eb27"}),i.openPreview=new i("open-preview",{fontCharacter:"\\eb28"}),i.package_=new i("package",{fontCharacter:"\\eb29"}),i.paintcan=new i("paintcan",{fontCharacter:"\\eb2a"}),i.pin=new i("pin",{fontCharacter:"\\eb2b"}),i.play=new i("play",{fontCharacter:"\\eb2c"}),i.run=new i("run",{fontCharacter:"\\eb2c"}),i.plug=new i("plug",{fontCharacter:"\\eb2d"}),i.preserveCase=new i("preserve-case",{fontCharacter:"\\eb2e"}),i.preview=new i("preview",{fontCharacter:"\\eb2f"}),i.project=new i("project",{fontCharacter:"\\eb30"}),i.pulse=new i("pulse",{fontCharacter:"\\eb31"}),i.question=new i("question",{fontCharacter:"\\eb32"}),i.quote=new i("quote",{fontCharacter:"\\eb33"}),i.radioTower=new i("radio-tower",{fontCharacter:"\\eb34"}),i.reactions=new i("reactions",{fontCharacter:"\\eb35"}),i.references=new i("references",{fontCharacter:"\\eb36"}),i.refresh=new i("refresh",{fontCharacter:"\\eb37"}),i.regex=new i("regex",{fontCharacter:"\\eb38"}),i.remoteExplorer=new i("remote-explorer",{fontCharacter:"\\eb39"}),i.remote=new i("remote",{fontCharacter:"\\eb3a"}),i.remove=new i("remove",{fontCharacter:"\\eb3b"}),i.replaceAll=new i("replace-all",{fontCharacter:"\\eb3c"}),i.replace=new i("replace",{fontCharacter:"\\eb3d"}),i.repoClone=new i("repo-clone",{fontCharacter:"\\eb3e"}),i.repoForcePush=new i("repo-force-push",{fontCharacter:"\\eb3f"}),i.repoPull=new i("repo-pull",{fontCharacter:"\\eb40"}),i.repoPush=new i("repo-push",{fontCharacter:"\\eb41"}),i.report=new i("report",{fontCharacter:"\\eb42"}),i.requestChanges=new i("request-changes",{fontCharacter:"\\eb43"}),i.rocket=new i("rocket",{fontCharacter:"\\eb44"}),i.rootFolderOpened=new i("root-folder-opened",{fontCharacter:"\\eb45"}),i.rootFolder=new i("root-folder",{fontCharacter:"\\eb46"}),i.rss=new i("rss",{fontCharacter:"\\eb47"}),i.ruby=new i("ruby",{fontCharacter:"\\eb48"}),i.saveAll=new i("save-all",{fontCharacter:"\\eb49"}),i.saveAs=new i("save-as",{fontCharacter:"\\eb4a"}),i.save=new i("save",{fontCharacter:"\\eb4b"}),i.screenFull=new i("screen-full",{fontCharacter:"\\eb4c"}),i.screenNormal=new i("screen-normal",{fontCharacter:"\\eb4d"}),i.searchStop=new i("search-stop",{fontCharacter:"\\eb4e"}),i.server=new i("server",{fontCharacter:"\\eb50"}),i.settingsGear=new i("settings-gear",{fontCharacter:"\\eb51"}),i.settings=new i("settings",{fontCharacter:"\\eb52"}),i.shield=new i("shield",{fontCharacter:"\\eb53"}),i.smiley=new i("smiley",{fontCharacter:"\\eb54"}),i.sortPrecedence=new i("sort-precedence",{fontCharacter:"\\eb55"}),i.splitHorizontal=new i("split-horizontal",{fontCharacter:"\\eb56"}),i.splitVertical=new i("split-vertical",{fontCharacter:"\\eb57"}),i.squirrel=new i("squirrel",{fontCharacter:"\\eb58"}),i.starFull=new i("star-full",{fontCharacter:"\\eb59"}),i.starHalf=new i("star-half",{fontCharacter:"\\eb5a"}),i.symbolClass=new i("symbol-class",{fontCharacter:"\\eb5b"}),i.symbolColor=new i("symbol-color",{fontCharacter:"\\eb5c"}),i.symbolConstant=new i("symbol-constant",{fontCharacter:"\\eb5d"}),i.symbolEnumMember=new i("symbol-enum-member",{fontCharacter:"\\eb5e"}),i.symbolField=new i("symbol-field",{fontCharacter:"\\eb5f"}),i.symbolFile=new i("symbol-file",{fontCharacter:"\\eb60"}),i.symbolInterface=new i("symbol-interface",{fontCharacter:"\\eb61"}),i.symbolKeyword=new i("symbol-keyword",{fontCharacter:"\\eb62"}),i.symbolMisc=new i("symbol-misc",{fontCharacter:"\\eb63"}),i.symbolOperator=new i("symbol-operator",{fontCharacter:"\\eb64"}),i.symbolProperty=new i("symbol-property",{fontCharacter:"\\eb65"}),i.wrench=new i("wrench",{fontCharacter:"\\eb65"}),i.wrenchSubaction=new i("wrench-subaction",{fontCharacter:"\\eb65"}),i.symbolSnippet=new i("symbol-snippet",{fontCharacter:"\\eb66"}),i.tasklist=new i("tasklist",{fontCharacter:"\\eb67"}),i.telescope=new i("telescope",{fontCharacter:"\\eb68"}),i.textSize=new i("text-size",{fontCharacter:"\\eb69"}),i.threeBars=new i("three-bars",{fontCharacter:"\\eb6a"}),i.thumbsdown=new i("thumbsdown",{fontCharacter:"\\eb6b"}),i.thumbsup=new i("thumbsup",{fontCharacter:"\\eb6c"}),i.tools=new i("tools",{fontCharacter:"\\eb6d"}),i.triangleDown=new i("triangle-down",{fontCharacter:"\\eb6e"}),i.triangleLeft=new i("triangle-left",{fontCharacter:"\\eb6f"}),i.triangleRight=new i("triangle-right",{fontCharacter:"\\eb70"}),i.triangleUp=new i("triangle-up",{fontCharacter:"\\eb71"}),i.twitter=new i("twitter",{fontCharacter:"\\eb72"}),i.unfold=new i("unfold",{fontCharacter:"\\eb73"}),i.unlock=new i("unlock",{fontCharacter:"\\eb74"}),i.unmute=new i("unmute",{fontCharacter:"\\eb75"}),i.unverified=new i("unverified",{fontCharacter:"\\eb76"}),i.verified=new i("verified",{fontCharacter:"\\eb77"}),i.versions=new i("versions",{fontCharacter:"\\eb78"}),i.vmActive=new i("vm-active",{fontCharacter:"\\eb79"}),i.vmOutline=new i("vm-outline",{fontCharacter:"\\eb7a"}),i.vmRunning=new i("vm-running",{fontCharacter:"\\eb7b"}),i.watch=new i("watch",{fontCharacter:"\\eb7c"}),i.whitespace=new i("whitespace",{fontCharacter:"\\eb7d"}),i.wholeWord=new i("whole-word",{fontCharacter:"\\eb7e"}),i.window=new i("window",{fontCharacter:"\\eb7f"}),i.wordWrap=new i("word-wrap",{fontCharacter:"\\eb80"}),i.zoomIn=new i("zoom-in",{fontCharacter:"\\eb81"}),i.zoomOut=new i("zoom-out",{fontCharacter:"\\eb82"}),i.listFilter=new i("list-filter",{fontCharacter:"\\eb83"}),i.listFlat=new i("list-flat",{fontCharacter:"\\eb84"}),i.listSelection=new i("list-selection",{fontCharacter:"\\eb85"}),i.selection=new i("selection",{fontCharacter:"\\eb85"}),i.listTree=new i("list-tree",{fontCharacter:"\\eb86"}),i.debugBreakpointFunctionUnverified=new i("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),i.debugBreakpointFunction=new i("debug-breakpoint-function",{fontCharacter:"\\eb88"}),i.debugBreakpointFunctionDisabled=new i("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),i.debugStackframeActive=new i("debug-stackframe-active",{fontCharacter:"\\eb89"}),i.debugStackframeDot=new i("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),i.debugStackframe=new i("debug-stackframe",{fontCharacter:"\\eb8b"}),i.debugStackframeFocused=new i("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),i.debugBreakpointUnsupported=new i("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),i.symbolString=new i("symbol-string",{fontCharacter:"\\eb8d"}),i.debugReverseContinue=new i("debug-reverse-continue",{fontCharacter:"\\eb8e"}),i.debugStepBack=new i("debug-step-back",{fontCharacter:"\\eb8f"}),i.debugRestartFrame=new i("debug-restart-frame",{fontCharacter:"\\eb90"}),i.callIncoming=new i("call-incoming",{fontCharacter:"\\eb92"}),i.callOutgoing=new i("call-outgoing",{fontCharacter:"\\eb93"}),i.menu=new i("menu",{fontCharacter:"\\eb94"}),i.expandAll=new i("expand-all",{fontCharacter:"\\eb95"}),i.feedback=new i("feedback",{fontCharacter:"\\eb96"}),i.groupByRefType=new i("group-by-ref-type",{fontCharacter:"\\eb97"}),i.ungroupByRefType=new i("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),i.account=new i("account",{fontCharacter:"\\eb99"}),i.bellDot=new i("bell-dot",{fontCharacter:"\\eb9a"}),i.debugConsole=new i("debug-console",{fontCharacter:"\\eb9b"}),i.library=new i("library",{fontCharacter:"\\eb9c"}),i.output=new i("output",{fontCharacter:"\\eb9d"}),i.runAll=new i("run-all",{fontCharacter:"\\eb9e"}),i.syncIgnored=new i("sync-ignored",{fontCharacter:"\\eb9f"}),i.pinned=new i("pinned",{fontCharacter:"\\eba0"}),i.githubInverted=new i("github-inverted",{fontCharacter:"\\eba1"}),i.debugAlt=new i("debug-alt",{fontCharacter:"\\eb91"}),i.serverProcess=new i("server-process",{fontCharacter:"\\eba2"}),i.serverEnvironment=new i("server-environment",{fontCharacter:"\\eba3"}),i.pass=new i("pass",{fontCharacter:"\\eba4"}),i.stopCircle=new i("stop-circle",{fontCharacter:"\\eba5"}),i.playCircle=new i("play-circle",{fontCharacter:"\\eba6"}),i.record=new i("record",{fontCharacter:"\\eba7"}),i.debugAltSmall=new i("debug-alt-small",{fontCharacter:"\\eba8"}),i.vmConnect=new i("vm-connect",{fontCharacter:"\\eba9"}),i.cloud=new i("cloud",{fontCharacter:"\\ebaa"}),i.merge=new i("merge",{fontCharacter:"\\ebab"}),i.exportIcon=new i("export",{fontCharacter:"\\ebac"}),i.graphLeft=new i("graph-left",{fontCharacter:"\\ebad"}),i.magnet=new i("magnet",{fontCharacter:"\\ebae"}),i.notebook=new i("notebook",{fontCharacter:"\\ebaf"}),i.redo=new i("redo",{fontCharacter:"\\ebb0"}),i.checkAll=new i("check-all",{fontCharacter:"\\ebb1"}),i.pinnedDirty=new i("pinned-dirty",{fontCharacter:"\\ebb2"}),i.passFilled=new i("pass-filled",{fontCharacter:"\\ebb3"}),i.circleLargeFilled=new i("circle-large-filled",{fontCharacter:"\\ebb4"}),i.circleLargeOutline=new i("circle-large-outline",{fontCharacter:"\\ebb5"}),i.combine=new i("combine",{fontCharacter:"\\ebb6"}),i.gather=new i("gather",{fontCharacter:"\\ebb6"}),i.table=new i("table",{fontCharacter:"\\ebb7"}),i.variableGroup=new i("variable-group",{fontCharacter:"\\ebb8"}),i.typeHierarchy=new i("type-hierarchy",{fontCharacter:"\\ebb9"}),i.typeHierarchySub=new i("type-hierarchy-sub",{fontCharacter:"\\ebba"}),i.typeHierarchySuper=new i("type-hierarchy-super",{fontCharacter:"\\ebbb"}),i.gitPullRequestCreate=new i("git-pull-request-create",{fontCharacter:"\\ebbc"}),i.runAbove=new i("run-above",{fontCharacter:"\\ebbd"}),i.runBelow=new i("run-below",{fontCharacter:"\\ebbe"}),i.notebookTemplate=new i("notebook-template",{fontCharacter:"\\ebbf"}),i.debugRerun=new i("debug-rerun",{fontCharacter:"\\ebc0"}),i.workspaceTrusted=new i("workspace-trusted",{fontCharacter:"\\ebc1"}),i.workspaceUntrusted=new i("workspace-untrusted",{fontCharacter:"\\ebc2"}),i.workspaceUnspecified=new i("workspace-unspecified",{fontCharacter:"\\ebc3"}),i.terminalCmd=new i("terminal-cmd",{fontCharacter:"\\ebc4"}),i.terminalDebian=new i("terminal-debian",{fontCharacter:"\\ebc5"}),i.terminalLinux=new i("terminal-linux",{fontCharacter:"\\ebc6"}),i.terminalPowershell=new i("terminal-powershell",{fontCharacter:"\\ebc7"}),i.terminalTmux=new i("terminal-tmux",{fontCharacter:"\\ebc8"}),i.terminalUbuntu=new i("terminal-ubuntu",{fontCharacter:"\\ebc9"}),i.terminalBash=new i("terminal-bash",{fontCharacter:"\\ebca"}),i.arrowSwap=new i("arrow-swap",{fontCharacter:"\\ebcb"}),i.copy=new i("copy",{fontCharacter:"\\ebcc"}),i.personAdd=new i("person-add",{fontCharacter:"\\ebcd"}),i.filterFilled=new i("filter-filled",{fontCharacter:"\\ebce"}),i.wand=new i("wand",{fontCharacter:"\\ebcf"}),i.debugLineByLine=new i("debug-line-by-line",{fontCharacter:"\\ebd0"}),i.inspect=new i("inspect",{fontCharacter:"\\ebd1"}),i.layers=new i("layers",{fontCharacter:"\\ebd2"}),i.layersDot=new i("layers-dot",{fontCharacter:"\\ebd3"}),i.layersActive=new i("layers-active",{fontCharacter:"\\ebd4"}),i.compass=new i("compass",{fontCharacter:"\\ebd5"}),i.compassDot=new i("compass-dot",{fontCharacter:"\\ebd6"}),i.compassActive=new i("compass-active",{fontCharacter:"\\ebd7"}),i.azure=new i("azure",{fontCharacter:"\\ebd8"}),i.issueDraft=new i("issue-draft",{fontCharacter:"\\ebd9"}),i.gitPullRequestClosed=new i("git-pull-request-closed",{fontCharacter:"\\ebda"}),i.gitPullRequestDraft=new i("git-pull-request-draft",{fontCharacter:"\\ebdb"}),i.debugAll=new i("debug-all",{fontCharacter:"\\ebdc"}),i.debugCoverage=new i("debug-coverage",{fontCharacter:"\\ebdd"}),i.runErrors=new i("run-errors",{fontCharacter:"\\ebde"}),i.folderLibrary=new i("folder-library",{fontCharacter:"\\ebdf"}),i.debugContinueSmall=new i("debug-continue-small",{fontCharacter:"\\ebe0"}),i.beakerStop=new i("beaker-stop",{fontCharacter:"\\ebe1"}),i.graphLine=new i("graph-line",{fontCharacter:"\\ebe2"}),i.graphScatter=new i("graph-scatter",{fontCharacter:"\\ebe3"}),i.pieChart=new i("pie-chart",{fontCharacter:"\\ebe4"}),i.bracket=new i("bracket",i.json.definition),i.bracketDot=new i("bracket-dot",{fontCharacter:"\\ebe5"}),i.bracketError=new i("bracket-error",{fontCharacter:"\\ebe6"}),i.lockSmall=new i("lock-small",{fontCharacter:"\\ebe7"}),i.azureDevops=new i("azure-devops",{fontCharacter:"\\ebe8"}),i.verifiedFilled=new i("verified-filled",{fontCharacter:"\\ebe9"})}(G||(G={}))},"VrN/":function(ot,ge,J){(function(ne,$){ot.exports=$()})(this,function(){"use strict";var ne=navigator.userAgent,$=navigator.platform,k=/gecko\/\d/i.test(ne),X=/MSIE \d/.test(ne),N=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ne),U=/Edge\/(\d+)/.exec(ne),G=X||N||U,W=G&&(X?document.documentMode||6:+(U||N)[1]),i=!U&&/WebKit\//.test(ne),D=i&&/Qt\/\d+\.\d+/.test(ne),g=!U&&/Chrome\//.test(ne),d=/Opera\//.test(ne),m=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ne),a=/PhantomJS/.test(ne),f=!U&&/AppleWebKit/.test(ne)&&/Mobile\/\w+/.test(ne),l=/Android/.test(ne),h=f||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ne),o=f||/Mac/.test($),s=/\bCrOS\b/.test(ne),A=/win/i.test($),_=d&&ne.match(/Version\/(\d*\.\d*)/);_&&(_=Number(_[1])),_&&_>=15&&(d=!1,i=!0);var w=o&&(D||d&&(_==null||_<12.11)),L=k||G&&W>=9;function R(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var C=function(e,t){var r=e.className,n=R(t).exec(r);if(n){var c=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(c?n[1]+c:"")}};function S(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function x(e,t){return S(e).appendChild(t)}function p(e,t,r,n){var c=document.createElement(e);if(r&&(c.className=r),n&&(c.style.cssText=n),typeof t=="string")c.appendChild(document.createTextNode(t));else if(t)for(var M=0;M<t.length;++M)c.appendChild(t[M]);return c}function T(e,t,r,n){var c=p(e,t,r,n);return c.setAttribute("role","presentation"),c}var v;document.createRange?v=function(e,t,r,n){var c=document.createRange();return c.setEnd(n||e,r),c.setStart(e,t),c}:v=function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(c){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};function y(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function F(){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 B(e,t){var r=e.className;R(t).test(r)||(e.className+=(r?" ":"")+t)}function O(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!R(r[n]).test(t)&&(t+=" "+r[n]);return t}var j=function(e){e.select()};f?j=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:G&&(j=function(e){try{e.select()}catch(t){}});function P(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function b(e,t,r){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(r!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function Y(e,t,r,n,c){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var M=n||0,K=c||0;;){var Q=e.indexOf(" ",M);if(Q<0||Q>=t)return K+(t-M);K+=Q-M,K+=r-K%r,M=Q+1}}var ee=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};ee.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ee.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function ae(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var le=50,Re={toString:function(){return"CodeMirror.Pass"}},Ee={scroll:!1},Te={origin:"*mouse"},Ae={origin:"+move"};function Oe(e,t,r){for(var n=0,c=0;;){var M=e.indexOf(" ",n);M==-1&&(M=e.length);var K=M-n;if(M==e.length||c+K>=t)return n+Math.min(K,t-c);if(c+=M-n,c+=r-c%r,n=M+1,c>=t)return n}}var ce=[""];function ue(e){for(;ce.length<=e;)ce.push(Pe(ce)+" ");return ce[e]}function Pe(e){return e[e.length-1]}function qe(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function ze(e,t,r){for(var n=0,c=r(t);n<e.length&&r(e[n])<=c;)n++;e.splice(n,0,t)}function et(){}function nt(e,t){var r;return Object.create?r=Object.create(e):(et.prototype=e,r=new et),t&&b(t,r),r}var Ie=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Me(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ie.test(e))}function Ge(e,t){return t?t.source.indexOf("\\w")>-1&&Me(e)?!0:t.test(e):Me(e)}function se(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var be=/[\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 xe(e){return e.charCodeAt(0)>=768&&be.test(e)}function Se(e,t,r){for(;(r<0?t>0:t<e.length)&&xe(e.charAt(t));)t+=r;return t}function Be(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var c=(t+r)/2,M=n<0?Math.ceil(c):Math.floor(c);if(M==t)return e(M)?t:r;e(M)?r=M:t=M+n}}function He(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var c=!1,M=0;M<e.length;++M){var K=e[M];(K.from<r&&K.to>t||t==r&&K.to==t)&&(n(Math.max(K.from,t),Math.min(K.to,r),K.level==1?"rtl":"ltr",M),c=!0)}c||n(t,r,"ltr")}var Ye=null;function Ve(e,t,r){var n;Ye=null;for(var c=0;c<e.length;++c){var M=e[c];if(M.from<t&&M.to>t)return c;M.to==t&&(M.from!=M.to&&r=="before"?n=c:Ye=c),M.from==t&&(M.from!=M.to&&r!="before"?n=c:Ye=c)}return n!=null?n:Ye}var lt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(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 n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,c=/[stwN]/,M=/[LRr]/,K=/[Lb1n]/,Q=/[1n]/;function Z(te,he,pe){this.level=te,this.from=he,this.to=pe}return function(te,he){var pe=he=="ltr"?"L":"R";if(te.length==0||he=="ltr"&&!n.test(te))return!1;for(var Ce=te.length,we=[],Fe=0;Fe<Ce;++Fe)we.push(r(te.charCodeAt(Fe)));for(var Ke=0,Ze=pe;Ke<Ce;++Ke){var at=we[Ke];at=="m"?we[Ke]=Ze:Ze=at}for(var ft=0,st=pe;ft<Ce;++ft){var pt=we[ft];pt=="1"&&st=="r"?we[ft]="n":M.test(pt)&&(st=pt,pt=="r"&&(we[ft]="R"))}for(var At=1,xt=we[0];At<Ce-1;++At){var kt=we[At];kt=="+"&&xt=="1"&&we[At+1]=="1"?we[At]="1":kt==","&&xt==we[At+1]&&(xt=="1"||xt=="n")&&(we[At]=xt),xt=kt}for(var Zt=0;Zt<Ce;++Zt){var yi=we[Zt];if(yi==",")we[Zt]="N";else if(yi=="%"){var ii=void 0;for(ii=Zt+1;ii<Ce&&we[ii]=="%";++ii);for(var Ki=Zt&&we[Zt-1]=="!"||ii<Ce&&we[ii]=="1"?"1":"N",Ui=Zt;Ui<ii;++Ui)we[Ui]=Ki;Zt=ii-1}}for(var oi=0,Bi=pe;oi<Ce;++oi){var Ti=we[oi];Bi=="L"&&Ti=="1"?we[oi]="L":M.test(Ti)&&(Bi=Ti)}for(var di=0;di<Ce;++di)if(c.test(we[di])){var li=void 0;for(li=di+1;li<Ce&&c.test(we[li]);++li);for(var ni=(di?we[di-1]:pe)=="L",ji=(li<Ce?we[li]:pe)=="L",ur=ni==ji?ni?"L":"R":pe,In=di;In<li;++In)we[In]=ur;di=li-1}for(var Oi=[],ln,bi=0;bi<Ce;)if(K.test(we[bi])){var Va=bi;for(++bi;bi<Ce&&K.test(we[bi]);++bi);Oi.push(new Z(0,Va,bi))}else{var pn=bi,Gn=Oi.length,Kn=he=="rtl"?1:0;for(++bi;bi<Ce&&we[bi]!="L";++bi);for(var Ii=pn;Ii<bi;)if(Q.test(we[Ii])){pn<Ii&&(Oi.splice(Gn,0,new Z(1,pn,Ii)),Gn+=Kn);var hr=Ii;for(++Ii;Ii<bi&&Q.test(we[Ii]);++Ii);Oi.splice(Gn,0,new Z(2,hr,Ii)),Gn+=Kn,pn=Ii}else++Ii;pn<bi&&Oi.splice(Gn,0,new Z(1,pn,bi))}return he=="ltr"&&(Oi[0].level==1&&(ln=te.match(/^\s+/))&&(Oi[0].from=ln[0].length,Oi.unshift(new Z(0,0,ln[0].length))),Pe(Oi).level==1&&(ln=te.match(/\s+$/))&&(Pe(Oi).to-=ln[0].length,Oi.push(new Z(0,Ce-ln[0].length,Ce)))),he=="rtl"?Oi.reverse():Oi}}();function $e(e,t){var r=e.order;return r==null&&(r=e.order=lt(e.text,t)),r}var Qe=[],De=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Qe).concat(r)}};function ct(e,t){return e._handlers&&e._handlers[t]||Qe}function ut(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,c=n&&n[t];if(c){var M=ae(c,r);M>-1&&(n[t]=c.slice(0,M).concat(c.slice(M+1)))}}}function ke(e,t){var r=ct(e,t);if(!r.length)return;for(var n=Array.prototype.slice.call(arguments,2),c=0;c<r.length;++c)r[c].apply(null,n)}function Ne(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ke(e,r||t.type,e,t),oe(t)||t.codemirrorIgnore}function _e(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)ae(r,t[n])==-1&&r.push(t[n])}function fe(e,t){return ct(e,t).length>0}function ve(e){e.prototype.on=function(t,r){De(this,t,r)},e.prototype.off=function(t,r){ut(this,t,r)}}function ie(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function re(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function oe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function de(e){ie(e),re(e)}function ye(e){return e.target||e.srcElement}function Le(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),o&&e.ctrlKey&&t==1&&(t=3),t}var Ue=function(){if(G&&W<9)return!1;var e=p("div");return"draggable"in e||"dragDrop"in e}(),Je;function dt(e){if(Je==null){var t=p("span","\u200B");x(e,p("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Je=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&W<8))}var r=Je?p("span","\u200B"):p("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var rt;function mt(e){if(rt!=null)return rt;var t=x(e,document.createTextNode("A\u062EA")),r=v(t,0,1).getBoundingClientRect(),n=v(t,1,2).getBoundingClientRect();return S(e),!r||r.left==r.right?!1:rt=n.right-r.right<3}var yt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var c=e.indexOf(`
|
|
`,t);c==-1&&(c=e.length);var M=e.slice(t,e.charAt(c-1)=="\r"?c-1:c),K=M.indexOf("\r");K!=-1?(r.push(M.slice(0,K)),t+=K+1):(r.push(M),t=c+1)}return r}:function(e){return e.split(/\r\n?|\n/)},tt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ut=function(){var e=p("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Ct=null;function Jt(e){if(Ct!=null)return Ct;var t=x(e,p("span","x")),r=t.getBoundingClientRect(),n=v(t,0,1).getBoundingClientRect();return Ct=Math.abs(r.left-n.left)>1}var ei={},Dt={};function ci(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ei[e]=t}function Di(e,t){Dt[e]=t}function bt(e){if(typeof e=="string"&&Dt.hasOwnProperty(e))e=Dt[e];else if(e&&typeof e.name=="string"&&Dt.hasOwnProperty(e.name)){var t=Dt[e.name];typeof t=="string"&&(t={name:t}),e=nt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return bt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return bt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function fi(e,t){t=bt(t);var r=ei[t.name];if(!r)return fi(e,"text/plain");var n=r(e,t);if(_t.hasOwnProperty(t.name)){var c=_t[t.name];for(var M in c){if(!c.hasOwnProperty(M))continue;n.hasOwnProperty(M)&&(n["_"+M]=n[M]),n[M]=c[M]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var K in t.modeProps)n[K]=t.modeProps[K];return n}var _t={};function wt(e,t){var r=_t.hasOwnProperty(e)?_t[e]:_t[e]={};b(t,r)}function Bt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var c=t[n];c instanceof Array&&(c=c.concat([])),r[n]=c}return r}function Lt(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Mt(e,t,r){return e.startState?e.startState(t,r):!0}var Et=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Et.prototype.eol=function(){return this.pos>=this.string.length},Et.prototype.sol=function(){return this.pos==this.lineStart},Et.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Et.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Et.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},Et.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Et.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Et.prototype.skipToEnd=function(){this.pos=this.string.length},Et.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Et.prototype.backUp=function(e){this.pos-=e},Et.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Y(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Et.prototype.indentation=function(){return Y(this.string,null,this.tabSize)-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Et.prototype.match=function(e,t,r){if(typeof e=="string"){var n=function(K){return r?K.toLowerCase():K},c=this.string.substr(this.pos,e.length);if(n(c)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var M=this.string.slice(this.pos).match(e);return M&&M.index>0?null:(M&&t!==!1&&(this.pos+=M[0].length),M)}},Et.prototype.current=function(){return this.string.slice(this.start,this.pos)},Et.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Et.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Et.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ht(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var c=r.children[n],M=c.chunkSize();if(t<M){r=c;break}t-=M}return r.lines[t]}function _i(e,t,r){var n=[],c=t.line;return e.iter(t.line,r.line+1,function(M){var K=M.text;c==r.line&&(K=K.slice(0,r.ch)),c==t.line&&(K=K.slice(t.ch)),n.push(K),++c}),n}function Ht(e,t,r){var n=[];return e.iter(t,r,function(c){n.push(c.text)}),n}function zt(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function It(e){if(e.parent==null)return null;for(var t=e.parent,r=ae(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var c=0;!(n.children[c]==t);++c)r+=n.children[c].chunkSize();return r+t.first}function ui(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var c=e.children[n],M=c.height;if(t<M){e=c;continue e}t-=M,r+=c.chunkSize()}return r}while(!e.lines);for(var K=0;K<e.lines.length;++K){var Q=e.lines[K],Z=Q.height;if(t<Z)break;t-=Z}return r+K}function ki(e,t){return t>=e.first&&t<e.first+e.size}function Yi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Xe(e,t,r){if(r===void 0&&(r=null),!(this instanceof Xe))return new Xe(e,t,r);this.line=e,this.ch=t,this.sticky=r}function Ot(e,t){return e.line-t.line||e.ch-t.ch}function mn(e,t){return e.sticky==t.sticky&&Ot(e,t)==0}function gn(e){return Xe(e.line,e.ch)}function vn(e,t){return Ot(e,t)<0?t:e}function yn(e,t){return Ot(e,t)<0?e:t}function V(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function E(e,t){if(t.line<e.first)return Xe(e.first,0);var r=e.first+e.size-1;return t.line>r?Xe(r,ht(e,r).text.length):I(t,ht(e,t.line).text.length)}function I(e,t){var r=e.ch;return r==null||r>t?Xe(e.line,t):r<0?Xe(e.line,0):e}function H(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=E(e,t[n]);return r}var q=function(e,t){this.state=e,this.lookAhead=t},z=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};z.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},z.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}},z.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},z.fromSaved=function(e,t,r){return t instanceof q?new z(e,Bt(e.mode,t.state),r,t.lookAhead):new z(e,Bt(e.mode,t),r)},z.prototype.save=function(e){var t=e!==!1?Bt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new q(t,this.maxLookAhead):t};function me(e,t,r,n){var c=[e.state.modeGen],M={};wi(e,t.text,e.doc.mode,r,function(te,he){return c.push(te,he)},M,n);for(var K=r.state,Q=function(te){r.baseTokens=c;var he=e.state.overlays[te],pe=1,Ce=0;r.state=!0,wi(e,t.text,he.mode,r,function(we,Fe){for(var Ke=pe;Ce<we;){var Ze=c[pe];Ze>we&&c.splice(pe,1,we,c[pe+1],Ze),pe+=2,Ce=Math.min(we,Ze)}if(!Fe)return;if(he.opaque)c.splice(Ke,pe-Ke,we,"overlay "+Fe),pe=Ke+2;else for(;Ke<pe;Ke+=2){var at=c[Ke+1];c[Ke+1]=(at?at+" ":"")+"overlay "+Fe}},M),r.state=K,r.baseTokens=null,r.baseTokenPos=1},Z=0;Z<e.state.overlays.length;++Z)Q(Z);return{styles:c,classes:M.bgClass||M.textClass?M:null}}function je(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=it(e,It(t)),c=t.text.length>e.options.maxHighlightLength&&Bt(e.doc.mode,n.state),M=me(e,t,n);c&&(n.state=c),t.stateAfter=n.save(!c),t.styles=M.styles,M.classes?t.styleClasses=M.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function it(e,t,r){var n=e.doc,c=e.display;if(!n.mode.startState)return new z(n,!0,t);var M=Si(e,t,r),K=M>n.first&&ht(n,M-1).stateAfter,Q=K?z.fromSaved(n,K,M):new z(n,Mt(n.mode),M);return n.iter(M,t,function(Z){gt(e,Z.text,Q);var te=Q.line;Z.stateAfter=te==t-1||te%5==0||te>=c.viewFrom&&te<c.viewTo?Q.save():null,Q.nextLine()}),r&&(n.modeFrontier=Q.line),Q}function gt(e,t,r,n){var c=e.doc.mode,M=new Et(t,e.options.tabSize,r);for(M.start=M.pos=n||0,t==""&&We(c,r.state);!M.eol();)Tt(c,M,r.state),M.start=M.pos}function We(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=Lt(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function Tt(e,t,r,n){for(var c=0;c<10;c++){n&&(n[0]=Lt(e,r).mode);var M=e.token(t,r);if(t.pos>t.start)return M}throw new Error("Mode "+e.name+" failed to advance stream.")}var Gt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function qt(e,t,r,n){var c=e.doc,M=c.mode,K;t=E(c,t);var Q=ht(c,t.line),Z=it(e,t.line,r),te=new Et(Q.text,e.options.tabSize,Z),he;for(n&&(he=[]);(n||te.pos<t.ch)&&!te.eol();)te.start=te.pos,K=Tt(M,te,Z.state),n&&he.push(new Gt(te,K,Bt(c.mode,Z.state)));return n?he:new Gt(te,K,Z.state)}function Hi(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";t[n]==null?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function wi(e,t,r,n,c,M,K){var Q=r.flattenSpans;Q==null&&(Q=e.options.flattenSpans);var Z=0,te=null,he=new Et(t,e.options.tabSize,n),pe,Ce=e.options.addModeClass&&[null];for(t==""&&Hi(We(r,n.state),M);!he.eol();){if(he.pos>e.options.maxHighlightLength?(Q=!1,K&>(e,t,n,he.pos),he.pos=t.length,pe=null):pe=Hi(Tt(r,he,n.state,Ce),M),Ce){var we=Ce[0].name;we&&(pe="m-"+(pe?we+" "+pe:we))}if(!Q||te!=pe){for(;Z<he.start;)Z=Math.min(he.start,Z+5e3),c(Z,te);te=pe}he.start=he.pos}for(;Z<he.pos;){var Fe=Math.min(he.pos,Z+5e3);c(Fe,te),Z=Fe}}function Si(e,t,r){for(var n,c,M=e.doc,K=r?-1:t-(e.doc.mode.innerMode?1e3:100),Q=t;Q>K;--Q){if(Q<=M.first)return M.first;var Z=ht(M,Q-1),te=Z.stateAfter;if(te&&(!r||Q+(te instanceof q?te.lookAhead:0)<=M.modeFrontier))return Q;var he=Y(Z.text,null,e.options.tabSize);(c==null||n>he)&&(c=Q-1,n=he)}return c}function Qi(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var r=e.first,n=t-1;n>r;n--){var c=ht(e,n).stateAfter;if(c&&(!(c instanceof q)||n+c.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var Dn=!1,pi=!1;function zi(){Dn=!0}function un(){pi=!0}function hn(e,t,r){this.marker=e,this.from=t,this.to=r}function Wi(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function kn(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function bn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function zn(e,t,r){var n;if(e)for(var c=0;c<e.length;++c){var M=e[c],K=M.marker,Q=M.from==null||(K.inclusiveLeft?M.from<=t:M.from<t);if(Q||M.from==t&&K.type=="bookmark"&&(!r||!M.marker.insertLeft)){var Z=M.to==null||(K.inclusiveRight?M.to>=t:M.to>t);(n||(n=[])).push(new hn(K,M.from,Z?null:M.to))}}return n}function Vn(e,t,r){var n;if(e)for(var c=0;c<e.length;++c){var M=e[c],K=M.marker,Q=M.to==null||(K.inclusiveRight?M.to>=t:M.to>t);if(Q||M.from==t&&K.type=="bookmark"&&(!r||M.marker.insertLeft)){var Z=M.from==null||(K.inclusiveLeft?M.from<=t:M.from<t);(n||(n=[])).push(new hn(K,Z?null:M.from-t,M.to==null?null:M.to-t))}}return n}function Zi(e,t){if(t.full)return null;var r=ki(e,t.from.line)&&ht(e,t.from.line).markedSpans,n=ki(e,t.to.line)&&ht(e,t.to.line).markedSpans;if(!r&&!n)return null;var c=t.from.ch,M=t.to.ch,K=Ot(t.from,t.to)==0,Q=zn(r,c,K),Z=Vn(n,M,K),te=t.text.length==1,he=Pe(t.text).length+(te?c:0);if(Q)for(var pe=0;pe<Q.length;++pe){var Ce=Q[pe];if(Ce.to==null){var we=Wi(Z,Ce.marker);we?te&&(Ce.to=we.to==null?null:we.to+he):Ce.to=c}}if(Z)for(var Fe=0;Fe<Z.length;++Fe){var Ke=Z[Fe];if(Ke.to!=null&&(Ke.to+=he),Ke.from==null){var Ze=Wi(Q,Ke.marker);Ze||(Ke.from=he,te&&(Q||(Q=[])).push(Ke))}else Ke.from+=he,te&&(Q||(Q=[])).push(Ke)}Q&&(Q=$i(Q)),Z&&Z!=Q&&(Z=$i(Z));var at=[Q];if(!te){var ft=t.text.length-2,st;if(ft>0&&Q)for(var pt=0;pt<Q.length;++pt)Q[pt].to==null&&(st||(st=[])).push(new hn(Q[pt].marker,null,null));for(var At=0;At<ft;++At)at.push(st);at.push(Z)}return at}function $i(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function _n(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(we){if(we.markedSpans)for(var Fe=0;Fe<we.markedSpans.length;++Fe){var Ke=we.markedSpans[Fe].marker;Ke.readOnly&&(!n||ae(n,Ke)==-1)&&(n||(n=[])).push(Ke)}}),!n)return null;for(var c=[{from:t,to:r}],M=0;M<n.length;++M)for(var K=n[M],Q=K.find(0),Z=0;Z<c.length;++Z){var te=c[Z];if(Ot(te.to,Q.from)<0||Ot(te.from,Q.to)>0)continue;var he=[Z,1],pe=Ot(te.from,Q.from),Ce=Ot(te.to,Q.to);(pe<0||!K.inclusiveLeft&&!pe)&&he.push({from:te.from,to:Q.from}),(Ce>0||!K.inclusiveRight&&!Ce)&&he.push({from:Q.to,to:te.to}),c.splice.apply(c,he),Z+=he.length-3}return c}function dr(e){var t=e.markedSpans;if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}function En(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function ri(e){return e.inclusiveLeft?-1:0}function Kt(e){return e.inclusiveRight?1:0}function Ei(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var n=e.find(),c=t.find(),M=Ot(n.from,c.from)||ri(e)-ri(t);if(M)return-M;var K=Ot(n.to,c.to)||Kt(e)-Kt(t);return K||t.id-e.id}function Nt(e,t){var r=pi&&e.markedSpans,n;if(r)for(var c=void 0,M=0;M<r.length;++M)c=r[M],c.marker.collapsed&&(t?c.from:c.to)==null&&(!n||Ei(n,c.marker)<0)&&(n=c.marker);return n}function si(e){return Nt(e,!0)}function Yt(e){return Nt(e,!1)}function rn(e,t){var r=pi&&e.markedSpans,n;if(r)for(var c=0;c<r.length;++c){var M=r[c];M.marker.collapsed&&(M.from==null||M.from<t)&&(M.to==null||M.to>t)&&(!n||Ei(n,M.marker)<0)&&(n=M.marker)}return n}function mi(e,t,r,n,c){var M=ht(e,t),K=pi&&M.markedSpans;if(K)for(var Q=0;Q<K.length;++Q){var Z=K[Q];if(!Z.marker.collapsed)continue;var te=Z.marker.find(0),he=Ot(te.from,r)||ri(Z.marker)-ri(c),pe=Ot(te.to,n)||Kt(Z.marker)-Kt(c);if(he>=0&&pe<=0||he<=0&&pe>=0)continue;if(he<=0&&(Z.marker.inclusiveRight&&c.inclusiveLeft?Ot(te.to,r)>=0:Ot(te.to,r)>0)||he>=0&&(Z.marker.inclusiveRight&&c.inclusiveLeft?Ot(te.from,n)<=0:Ot(te.from,n)<0))return!0}}function Ri(e){for(var t;t=si(e);)e=t.find(-1,!0).line;return e}function Xn(e){for(var t;t=Yt(e);)e=t.find(1,!0).line;return e}function xn(e){for(var t,r;t=Yt(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function cr(e,t){var r=ht(e,t),n=Ri(r);return r==n?t:It(n)}function Tn(e,t){if(t>e.lastLine())return t;var r=ht(e,t),n;if(!an(e,r))return t;for(;n=Yt(r);)r=n.find(1,!0).line;return It(r)+1}function an(e,t){var r=pi&&t.markedSpans;if(r)for(var n=void 0,c=0;c<r.length;++c){if(n=r[c],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&fr(e,t,n))return!0}}function fr(e,t,r){if(r.to==null){var n=r.marker.find(1,!0);return fr(e,n.line,Wi(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var c=void 0,M=0;M<t.markedSpans.length;++M)if(c=t.markedSpans[M],c.marker.collapsed&&!c.marker.widgetNode&&c.from==r.to&&(c.to==null||c.to!=r.from)&&(c.marker.inclusiveLeft||r.marker.inclusiveRight)&&fr(e,t,c))return!0}function qi(e){e=Ri(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var c=r.lines[n];if(c==e)break;t+=c.height}for(var M=r.parent;M;r=M,M=r.parent)for(var K=0;K<M.children.length;++K){var Q=M.children[K];if(Q==r)break;t+=Q.height}return t}function pr(e){if(e.height==0)return 0;for(var t=e.text.length,r,n=e;r=si(n);){var c=r.find(0,!0);n=c.from.line,t+=c.from.ch-c.to.ch}for(n=e;r=Yt(n);){var M=r.find(0,!0);t-=n.text.length-M.from.ch,n=M.to.line,t+=n.text.length-M.to.ch}return t}function jr(e){var t=e.display,r=e.doc;t.maxLine=ht(r,r.first),t.maxLineLength=pr(t.maxLine),t.maxLineChanged=!0,r.iter(function(n){var c=pr(n);c>t.maxLineLength&&(t.maxLineLength=c,t.maxLine=n)})}var Mn=function(e,t,r){this.text=e,En(this,t),this.height=r?r(this):1};Mn.prototype.lineNo=function(){return It(this)},ve(Mn);function ua(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),dr(e),En(e,r);var c=n?n(e):1;c!=e.height&&zt(e,c)}function vt(e){e.parent=null,dr(e)}var Rt={},St={};function Pt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?St:Rt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Wt(e,t){var r=T("span",null,null,i?"padding-right: .1px":null),n={pre:T("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var c=0;c<=(t.rest?t.rest.length:0);c++){var M=c?t.rest[c-1]:t.line,K=void 0;n.pos=0,n.addToken=jt,mt(e.display.measure)&&(K=$e(M,e.doc.direction))&&(n.addToken=Mi(n.addToken,K)),n.map=[];var Q=t!=e.display.externalMeasured&&It(M);dn(M,n,je(e,M,Q)),M.styleClasses&&(M.styleClasses.bgClass&&(n.bgClass=O(M.styleClasses.bgClass,n.bgClass||"")),M.styleClasses.textClass&&(n.textClass=O(M.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(dt(e.display.measure))),c==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(i){var Z=n.content.lastChild;(/\bcm-tab\b/.test(Z.className)||Z.querySelector&&Z.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return ke(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=O(n.pre.className,n.textClass||"")),n}function Qt(e){var t=p("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function jt(e,t,r,n,c,M,K){if(!t)return;var Q=e.splitSpaces?hi(t,e.trailingSpace):t,Z=e.cm.state.specialChars,te=!1,he;if(!Z.test(t))e.col+=t.length,he=document.createTextNode(Q),e.map.push(e.pos,e.pos+t.length,he),G&&W<9&&(te=!0),e.pos+=t.length;else{he=document.createDocumentFragment();for(var pe=0;;){Z.lastIndex=pe;var Ce=Z.exec(t),we=Ce?Ce.index-pe:t.length-pe;if(we){var Fe=document.createTextNode(Q.slice(pe,pe+we));G&&W<9?he.appendChild(p("span",[Fe])):he.appendChild(Fe),e.map.push(e.pos,e.pos+we,Fe),e.col+=we,e.pos+=we}if(!Ce)break;pe+=we+1;var Ke=void 0;if(Ce[0]==" "){var Ze=e.cm.options.tabSize,at=Ze-e.col%Ze;Ke=he.appendChild(p("span",ue(at),"cm-tab")),Ke.setAttribute("role","presentation"),Ke.setAttribute("cm-text"," "),e.col+=at}else Ce[0]=="\r"||Ce[0]==`
|
|
`?(Ke=he.appendChild(p("span",Ce[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ke.setAttribute("cm-text",Ce[0]),e.col+=1):(Ke=e.cm.options.specialCharPlaceholder(Ce[0]),Ke.setAttribute("cm-text",Ce[0]),G&&W<9?he.appendChild(p("span",[Ke])):he.appendChild(Ke),e.col+=1);e.map.push(e.pos,e.pos+1,Ke),e.pos++}}if(e.trailingSpace=Q.charCodeAt(t.length-1)==32,r||n||c||te||M||K){var ft=r||"";n&&(ft+=n),c&&(ft+=c);var st=p("span",[he],ft,M);if(K)for(var pt in K)K.hasOwnProperty(pt)&&pt!="style"&&pt!="class"&&st.setAttribute(pt,K[pt]);return e.content.appendChild(st)}e.content.appendChild(he)}function hi(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",c=0;c<e.length;c++){var M=e.charAt(c);M==" "&&r&&(c==e.length-1||e.charCodeAt(c+1)==32)&&(M="\xA0"),n+=M,r=M==" "}return n}function Mi(e,t){return function(r,n,c,M,K,Q,Z){c=c?c+" cm-force-border":"cm-force-border";for(var te=r.pos,he=te+n.length;;){for(var pe=void 0,Ce=0;Ce<t.length&&!(pe=t[Ce],pe.to>te&&pe.from<=te);Ce++);if(pe.to>=he)return e(r,n,c,M,K,Q,Z);e(r,n.slice(0,pe.to-te),c,M,null,Q,Z),M=null,n=n.slice(pe.to-te),te=pe.to}}}function Ft(e,t,r,n){var c=!n&&r.widgetNode;c&&e.map.push(e.pos,e.pos+t,c),!n&&e.cm.display.input.needsContentAttribute&&(c||(c=e.content.appendChild(document.createElement("span"))),c.setAttribute("cm-marker",r.id)),c&&(e.cm.display.input.setUneditable(c),e.content.appendChild(c)),e.pos+=t,e.trailingSpace=!1}function dn(e,t,r){var n=e.markedSpans,c=e.text,M=0;if(!n){for(var K=1;K<r.length;K+=2)t.addToken(t,c.slice(M,M=r[K]),Pt(r[K+1],t.cm.options));return}for(var Q=c.length,Z=0,te=1,he="",pe,Ce,we=0,Fe,Ke,Ze,at,ft;;){if(we==Z){Fe=Ke=Ze=Ce="",ft=null,at=null,we=Infinity;for(var st=[],pt=void 0,At=0;At<n.length;++At){var xt=n[At],kt=xt.marker;if(kt.type=="bookmark"&&xt.from==Z&&kt.widgetNode)st.push(kt);else if(xt.from<=Z&&(xt.to==null||xt.to>Z||kt.collapsed&&xt.to==Z&&xt.from==Z)){if(xt.to!=null&&xt.to!=Z&&we>xt.to&&(we=xt.to,Ke=""),kt.className&&(Fe+=" "+kt.className),kt.css&&(Ce=(Ce?Ce+";":"")+kt.css),kt.startStyle&&xt.from==Z&&(Ze+=" "+kt.startStyle),kt.endStyle&&xt.to==we&&(pt||(pt=[])).push(kt.endStyle,xt.to),kt.title&&((ft||(ft={})).title=kt.title),kt.attributes)for(var Zt in kt.attributes)(ft||(ft={}))[Zt]=kt.attributes[Zt];kt.collapsed&&(!at||Ei(at.marker,kt)<0)&&(at=xt)}else xt.from>Z&&we>xt.from&&(we=xt.from)}if(pt)for(var yi=0;yi<pt.length;yi+=2)pt[yi+1]==we&&(Ke+=" "+pt[yi]);if(!at||at.from==Z)for(var ii=0;ii<st.length;++ii)Ft(t,0,st[ii]);if(at&&(at.from||0)==Z){if(Ft(t,(at.to==null?Q+1:at.to)-Z,at.marker,at.from==null),at.to==null)return;at.to==Z&&(at=!1)}}if(Z>=Q)break;for(var Ki=Math.min(Q,we);;){if(he){var Ui=Z+he.length;if(!at){var oi=Ui>Ki?he.slice(0,Ki-Z):he;t.addToken(t,oi,pe?pe+Fe:Fe,Ze,Z+oi.length==we?Ke:"",Ce,ft)}if(Ui>=Ki){he=he.slice(Ki-Z),Z=Ki;break}Z=Ui,Ze=""}he=c.slice(M,M=r[te++]),pe=Pt(r[te++],t.cm.options)}}}function Vt(e,t,r){this.line=t,this.rest=xn(t),this.size=this.rest?It(Pe(this.rest))-r+1:1,this.node=this.text=null,this.hidden=an(e,t)}function Pi(e,t,r){for(var n=[],c,M=t;M<r;M=c){var K=new Vt(e.doc,ht(e.doc,M),M);c=M+K.size,n.push(K)}return n}var Ci=null;function Ji(e){Ci?Ci.ops.push(e):e.ownsGroup=Ci={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var c=e.ops[n];if(c.cursorActivityHandlers)for(;c.cursorActivityCalled<c.cursorActivityHandlers.length;)c.cursorActivityHandlers[c.cursorActivityCalled++].call(null,c.cm)}}while(r<t.length)}function Io(e,t){var r=e.ownsGroup;if(!r)return;try{Lo(r)}finally{Ci=null,t(r)}}var mr=null;function xi(e,t){var r=ct(e,t);if(!r.length)return;var n=Array.prototype.slice.call(arguments,2),c;Ci?c=Ci.delayedCallbacks:mr?c=mr:(c=mr=[],setTimeout(Do,0));for(var M=function(Q){c.push(function(){return r[Q].apply(null,n)})},K=0;K<r.length;++K)M(K)}function Do(){var e=mr;mr=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,r,n){for(var c=0;c<t.changes.length;c++){var M=t.changes[c];M=="text"?Mo(e,t):M=="gutter"?Ja(e,t,r,n):M=="class"?ha(e,t):M=="widget"&&Po(e,t,n)}t.changes=null}function gr(e){return e.node==e.text&&(e.node=p("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),G&&W<8&&(e.node.style.zIndex=2)),e.node}function ko(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=gr(t);t.background=n.insertBefore(p("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Wt(e,t)}function Mo(e,t){var r=t.text.className,n=$a(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,ha(e,t)):r&&(t.text.className=r)}function ha(e,t){ko(e,t),t.line.wrapClass?gr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Ja(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var c=gr(t);t.gutterBackground=p("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),c.insertBefore(t.gutterBackground,t.text)}var M=t.line.gutterMarkers;if(e.options.lineNumbers||M){var K=gr(t),Q=t.gutter=p("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Q),K.insertBefore(Q,t.text),t.line.gutterClass&&(Q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!M||!M["CodeMirror-linenumbers"])&&(t.lineNumber=Q.appendChild(p("div",Yi(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),M)for(var Z=0;Z<e.display.gutterSpecs.length;++Z){var te=e.display.gutterSpecs[Z].className,he=M.hasOwnProperty(te)&&M[te];he&&Q.appendChild(p("div",[he],"CodeMirror-gutter-elt","left: "+n.gutterLeft[te]+"px; width: "+n.gutterWidth[te]+"px"))}}}function Po(e,t,r){t.alignable&&(t.alignable=null);for(var n=R("CodeMirror-linewidget"),c=t.node.firstChild,M=void 0;c;c=M)M=c.nextSibling,n.test(c.className)&&t.node.removeChild(c);Qa(e,t,r)}function No(e,t,r,n){var c=$a(e,t);return t.text=t.node=c.pre,c.bgClass&&(t.bgClass=c.bgClass),c.textClass&&(t.textClass=c.textClass),ha(e,t),Ja(e,t,r,n),Qa(e,t,n),t.node}function Qa(e,t,r){if(Za(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Za(e,t.rest[n],t,r,!1)}function Za(e,t,r,n,c){if(!t.widgets)return;for(var M=gr(r),K=0,Q=t.widgets;K<Q.length;++K){var Z=Q[K],te=p("div",[Z.node],"CodeMirror-linewidget"+(Z.className?" "+Z.className:""));Z.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Fo(Z,te,r,n),e.display.input.setUneditable(te),c&&Z.above?M.insertBefore(te,r.gutter||r.text):M.appendChild(te),xi(Z,"redraw")}}function Fo(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var c=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(c-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=c+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function vr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!y(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),x(t.display.measure,p("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function cn(e,t){for(var r=ye(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function Hr(e){return e.lineSpace.offsetTop}function da(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=x(e.measure,p("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function sn(e){return le-e.display.nativeBarWidth}function Pn(e){return e.display.scroller.clientWidth-sn(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-sn(e)-e.display.barHeight}function Uo(e,t,r){var n=e.options.lineWrapping,c=n&&Pn(e);if(!t.measure.heights||n&&t.measure.width!=c){var M=t.measure.heights=[];if(n){t.measure.width=c;for(var K=t.text.firstChild.getClientRects(),Q=0;Q<K.length-1;Q++){var Z=K[Q],te=K[Q+1];Math.abs(Z.bottom-te.bottom)>2&&M.push((Z.bottom+te.top)/2-r.top)}}M.push(r.bottom-r.top)}}function es(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var c=0;c<e.rest.length;c++)if(It(e.rest[c])>r)return{map:e.measure.maps[c],cache:e.measure.caches[c],before:!0}}function Bo(e,t){t=Ri(t);var r=It(t),n=e.display.externalMeasured=new Vt(e.doc,t,r);n.lineN=r;var c=n.built=Wt(e,n);return n.text=c.pre,x(e.display.lineMeasure,c.pre),n}function ts(e,t,r,n){return on(e,Yn(e,t),r,n)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Un(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function Yn(e,t){var r=It(t),n=fa(e,r);n&&!n.text?n=null:n&&n.changes&&(Ya(e,n,r,ba(e)),e.curOp.forceUpdate=!0),n||(n=Bo(e,t));var c=es(n,t,r);return{line:t,view:n,rect:null,map:c.map,cache:c.cache,before:c.before,hasHeights:!1}}function on(e,t,r,n,c){t.before&&(r=-1);var M=r+(n||""),K;return t.cache.hasOwnProperty(M)?K=t.cache[M]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Uo(e,t.view,t.rect),t.hasHeights=!0),K=Ho(e,t,r,n),K.bogus||(t.cache[M]=K)),{left:K.left,right:K.right,top:c?K.rtop:K.top,bottom:c?K.rbottom:K.bottom}}var is={left:0,right:0,top:0,bottom:0};function ns(e,t,r){for(var n,c,M,K,Q,Z,te=0;te<e.length;te+=3)if(Q=e[te],Z=e[te+1],t<Q?(c=0,M=1,K="left"):t<Z?(c=t-Q,M=c+1):(te==e.length-3||t==Z&&e[te+3]>t)&&(M=Z-Q,c=M-1,t>=Z&&(K="right")),c!=null){if(n=e[te+2],Q==Z&&r==(n.insertLeft?"left":"right")&&(K=r),r=="left"&&c==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)n=e[(te-=3)+2],K="left";if(r=="right"&&c==Z-Q)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)n=e[(te+=3)+2],K="right";break}return{node:n,start:c,end:M,collapse:K,coverStart:Q,coverEnd:Z}}function jo(e,t){var r=is;if(t=="left")for(var n=0;n<e.length&&!((r=e[n]).left!=r.right);n++);else for(var c=e.length-1;c>=0&&!((r=e[c]).left!=r.right);c--);return r}function Ho(e,t,r,n){var c=ns(t.map,r,n),M=c.node,K=c.start,Q=c.end,Z=c.collapse,te;if(M.nodeType==3){for(var he=0;he<4;he++){for(;K&&xe(t.line.text.charAt(c.coverStart+K));)--K;for(;c.coverStart+Q<c.coverEnd&&xe(t.line.text.charAt(c.coverStart+Q));)++Q;if(G&&W<9&&K==0&&Q==c.coverEnd-c.coverStart?te=M.parentNode.getBoundingClientRect():te=jo(v(M,K,Q).getClientRects(),n),te.left||te.right||K==0)break;Q=K,K=K-1,Z="right"}G&&W<11&&(te=Wo(e.display.measure,te))}else{K>0&&(Z=n="right");var pe;e.options.lineWrapping&&(pe=M.getClientRects()).length>1?te=pe[n=="right"?pe.length-1:0]:te=M.getBoundingClientRect()}if(G&&W<9&&!K&&(!te||!te.left&&!te.right)){var Ce=M.parentNode.getClientRects()[0];Ce?te={left:Ce.left,right:Ce.left+Jn(e.display),top:Ce.top,bottom:Ce.bottom}:te=is}for(var we=te.top-t.rect.top,Fe=te.bottom-t.rect.top,Ke=(we+Fe)/2,Ze=t.view.measure.heights,at=0;at<Ze.length-1&&!(Ke<Ze[at]);at++);var ft=at?Ze[at-1]:0,st=Ze[at],pt={left:(Z=="right"?te.right:te.left)-t.rect.left,right:(Z=="left"?te.left:te.right)-t.rect.left,top:ft,bottom:st};return!te.left&&!te.right&&(pt.bogus=!0),e.options.singleCursorHeightPerLine||(pt.rtop=we,pt.rbottom=Fe),pt}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Jt(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function rs(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function as(e){e.display.externalMeasure=null,S(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)rs(e.display.view[t])}function yr(e){as(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ss(){return g&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return g&&l?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=vr(e.widgets[r]));return t}function Wr(e,t,r,n,c){if(!c){var M=pa(t);r.top+=M,r.bottom+=M}if(n=="line")return r;n||(n="local");var K=qi(t);if(n=="local"?K+=Hr(e.display):K-=e.display.viewOffset,n=="page"||n=="window"){var Q=e.display.lineSpace.getBoundingClientRect();K+=Q.top+(n=="window"?0:os());var Z=Q.left+(n=="window"?0:ss());r.left+=Z,r.right+=Z}return r.top+=K,r.bottom+=K,r}function ls(e,t,r){if(r=="div")return t;var n=t.left,c=t.top;if(r=="page")n-=ss(),c-=os();else if(r=="local"||!r){var M=e.display.sizer.getBoundingClientRect();n+=M.left,c+=M.top}var K=e.display.lineSpace.getBoundingClientRect();return{left:n-K.left,top:c-K.top}}function ma(e,t,r,n,c){return n||(n=ht(e.doc,t.line)),Wr(e,n,ts(e,n,t.ch,c),r)}function en(e,t,r,n,c,M){n=n||ht(e.doc,t.line),c||(c=Yn(e,n));function K(Fe,Ke){var Ze=on(e,c,Fe,Ke?"right":"left",M);return Ke?Ze.left=Ze.right:Ze.right=Ze.left,Wr(e,n,Ze,r)}var Q=$e(n,e.doc.direction),Z=t.ch,te=t.sticky;if(Z>=n.text.length?(Z=n.text.length,te="before"):Z<=0&&(Z=0,te="after"),!Q)return K(te=="before"?Z-1:Z,te=="before");function he(Fe,Ke,Ze){var at=Q[Ke],ft=at.level==1;return K(Ze?Fe-1:Fe,ft!=Ze)}var pe=Ve(Q,Z,te),Ce=Ye,we=he(Z,pe,te=="before");return Ce!=null&&(we.other=he(Z,Ce,te!="before")),we}function us(e,t){var r=0;t=E(e.doc,t),e.options.lineWrapping||(r=Jn(e.display)*t.ch);var n=ht(e.doc,t.line),c=qi(n)+Hr(e.display);return{left:r,right:r,top:c,bottom:c+n.height}}function ga(e,t,r,n,c){var M=Xe(e,t,r);return M.xRel=c,n&&(M.outside=n),M}function va(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return ga(n.first,0,null,-1,-1);var c=ui(n,r),M=n.first+n.size-1;if(c>M)return ga(n.first+n.size-1,ht(n,M).text.length,null,1,1);t<0&&(t=0);for(var K=ht(n,c);;){var Q=Go(e,K,c,t,r),Z=rn(K,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!Z)return Q;var te=Z.find(1);if(te.line==c)return te;K=ht(n,c=te.line)}}function hs(e,t,r,n){n-=pa(t);var c=t.text.length,M=Be(function(K){return on(e,r,K-1).bottom<=n},c,0);return c=Be(function(K){return on(e,r,K).top>n},M,c),{begin:M,end:c}}function ds(e,t,r,n){r||(r=Yn(e,t));var c=Wr(e,t,on(e,r,n),"line").top;return hs(e,t,r,c)}function ya(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function Go(e,t,r,n,c){c-=qi(t);var M=Yn(e,t),K=pa(t),Q=0,Z=t.text.length,te=!0,he=$e(t,e.doc.direction);if(he){var pe=(e.options.lineWrapping?zo:Ko)(e,t,r,M,he,n,c);te=pe.level!=1,Q=te?pe.from:pe.to-1,Z=te?pe.to:pe.from-1}var Ce=null,we=null,Fe=Be(function(At){var xt=on(e,M,At);return xt.top+=K,xt.bottom+=K,ya(xt,n,c,!1)?(xt.top<=c&&xt.left<=n&&(Ce=At,we=xt),!0):!1},Q,Z),Ke,Ze,at=!1;if(we){var ft=n-we.left<we.right-n,st=ft==te;Fe=Ce+(st?0:1),Ze=st?"after":"before",Ke=ft?we.left:we.right}else{!te&&(Fe==Z||Fe==Q)&&Fe++,Ze=Fe==0?"after":Fe==t.text.length?"before":on(e,M,Fe-(te?1:0)).bottom+K<=c==te?"after":"before";var pt=en(e,Xe(r,Fe,Ze),"line",t,M);Ke=pt.left,at=c<pt.top?-1:c>=pt.bottom?1:0}return Fe=Se(t.text,Fe,1),ga(r,Fe,Ze,at,n-Ke)}function Ko(e,t,r,n,c,M,K){var Q=Be(function(pe){var Ce=c[pe],we=Ce.level!=1;return ya(en(e,Xe(r,we?Ce.to:Ce.from,we?"before":"after"),"line",t,n),M,K,!0)},0,c.length-1),Z=c[Q];if(Q>0){var te=Z.level!=1,he=en(e,Xe(r,te?Z.from:Z.to,te?"after":"before"),"line",t,n);ya(he,M,K,!0)&&he.top>K&&(Z=c[Q-1])}return Z}function zo(e,t,r,n,c,M,K){var Q=hs(e,t,n,K),Z=Q.begin,te=Q.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var he=null,pe=null,Ce=0;Ce<c.length;Ce++){var we=c[Ce];if(we.from>=te||we.to<=Z)continue;var Fe=we.level!=1,Ke=on(e,n,Fe?Math.min(te,we.to)-1:Math.max(Z,we.from)).right,Ze=Ke<M?M-Ke+1e9:Ke-M;(!he||pe>Ze)&&(he=we,pe=Ze)}return he||(he=c[c.length-1]),he.from<Z&&(he={from:Z,to:he.to,level:he.level}),he.to>te&&(he={from:he.from,to:te,level:he.level}),he}var Nn;function $n(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Nn==null){Nn=p("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Nn.appendChild(document.createTextNode("x")),Nn.appendChild(p("br"));Nn.appendChild(document.createTextNode("x"))}x(e.measure,Nn);var r=Nn.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),S(e.measure),r||1}function Jn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=p("span","xxxxxxxxxx"),r=p("pre",[t],"CodeMirror-line-like");x(e.measure,r);var n=t.getBoundingClientRect(),c=(n.right-n.left)/10;return c>2&&(e.cachedCharWidth=c),c||10}function ba(e){for(var t=e.display,r={},n={},c=t.gutters.clientLeft,M=t.gutters.firstChild,K=0;M;M=M.nextSibling,++K){var Q=e.display.gutterSpecs[K].className;r[Q]=M.offsetLeft+M.clientLeft+c,n[Q]=M.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function cs(e){var t=$n(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Jn(e.display)-3);return function(c){if(an(e.doc,c))return 0;var M=0;if(c.widgets)for(var K=0;K<c.widgets.length;K++)c.widgets[K].height&&(M+=c.widgets[K].height);return r?M+(Math.ceil(c.text.length/n)||1)*t:M+t}}function Ea(e){var t=e.doc,r=cs(e);t.iter(function(n){var c=r(n);c!=n.height&&zt(n,c)})}function Fn(e,t,r,n){var c=e.display;if(!r&&ye(t).getAttribute("cm-not-content")=="true")return null;var M,K,Q=c.lineSpace.getBoundingClientRect();try{M=t.clientX-Q.left,K=t.clientY-Q.top}catch(pe){return null}var Z=va(e,M,K),te;if(n&&Z.xRel>0&&(te=ht(e.doc,Z.line).text).length==Z.ch){var he=Y(te,te.length,e.options.tabSize)-te.length;Z=Xe(Z.line,Math.max(0,Math.round((M-qa(e.display).left)/Jn(e.display))-he))}return Z}function Un(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function Ni(e,t,r,n){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),n||(n=0);var c=e.display;if(n&&r<c.viewTo&&(c.updateLineNumbers==null||c.updateLineNumbers>t)&&(c.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=c.viewTo)pi&&cr(e.doc,t)<c.viewTo&&Sn(e);else if(r<=c.viewFrom)pi&&Tn(e.doc,r+n)>c.viewFrom?Sn(e):(c.viewFrom+=n,c.viewTo+=n);else if(t<=c.viewFrom&&r>=c.viewTo)Sn(e);else if(t<=c.viewFrom){var M=Gr(e,r,r+n,1);M?(c.view=c.view.slice(M.index),c.viewFrom=M.lineN,c.viewTo+=n):Sn(e)}else if(r>=c.viewTo){var K=Gr(e,t,t,-1);K?(c.view=c.view.slice(0,K.index),c.viewTo=K.lineN):Sn(e)}else{var Q=Gr(e,t,t,-1),Z=Gr(e,r,r+n,1);Q&&Z?(c.view=c.view.slice(0,Q.index).concat(Pi(e,Q.lineN,Z.lineN)).concat(c.view.slice(Z.index)),c.viewTo+=n):Sn(e)}var te=c.externalMeasured;te&&(r<te.lineN?te.lineN+=n:t<te.lineN+te.size&&(c.externalMeasured=null))}function wn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,c=e.display.externalMeasured;if(c&&t>=c.lineN&&t<c.lineN+c.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var M=n.view[Un(e,t)];if(M.node==null)return;var K=M.changes||(M.changes=[]);ae(K,r)==-1&&K.push(r)}function Sn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gr(e,t,r,n){var c=Un(e,t),M,K=e.display.view;if(!pi||r==e.doc.first+e.doc.size)return{index:c,lineN:r};for(var Q=e.display.viewFrom,Z=0;Z<c;Z++)Q+=K[Z].size;if(Q!=t){if(n>0){if(c==K.length-1)return null;M=Q+K[c].size-t,c++}else M=Q-t;t+=M,r+=M}for(;cr(e.doc,r)!=r;){if(c==(n<0?0:K.length-1))return null;r+=n*K[c-(n<0?1:0)].size,c+=n}return{index:c,lineN:r}}function Vo(e,t,r){var n=e.display,c=n.view;c.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=Pi(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Pi(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Un(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Pi(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,Un(e,r)))),n.viewTo=r}function fs(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var c=t[n];!c.hidden&&(!c.node||c.changes)&&++r}return r}function br(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var r=e.doc,n={},c=n.cursors=document.createDocumentFragment(),M=n.selection=document.createDocumentFragment(),K=0;K<r.sel.ranges.length;K++){if(!t&&K==r.sel.primIndex)continue;var Q=r.sel.ranges[K];if(Q.from().line>=e.display.viewTo||Q.to().line<e.display.viewFrom)continue;var Z=Q.empty();(Z||e.options.showCursorWhenSelecting)&&ms(e,Q.head,c),Z||Xo(e,Q,M)}return n}function ms(e,t,r){var n=en(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),c=r.appendChild(p("div","\xA0","CodeMirror-cursor"));if(c.style.left=n.left+"px",c.style.top=n.top+"px",c.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var M=r.appendChild(p("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));M.style.display="",M.style.left=n.other.left+"px",M.style.top=n.other.top+"px",M.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Kr(e,t){return e.top-t.top||e.left-t.left}function Xo(e,t,r){var n=e.display,c=e.doc,M=document.createDocumentFragment(),K=qa(e.display),Q=K.left,Z=Math.max(n.sizerWidth,Pn(e)-n.sizer.offsetLeft)-K.right,te=c.direction=="ltr";function he(st,pt,At,xt){pt<0&&(pt=0),pt=Math.round(pt),xt=Math.round(xt),M.appendChild(p("div",null,"CodeMirror-selected","position: absolute; left: "+st+`px;
|
|
top: `+pt+"px; width: "+(At==null?Z-st:At)+`px;
|
|
height: `+(xt-pt)+"px"))}function pe(st,pt,At){var xt=ht(c,st),kt=xt.text.length,Zt,yi;function ii(oi,Bi){return ma(e,Xe(st,oi),"div",xt,Bi)}function Ki(oi,Bi,Ti){var di=ds(e,xt,null,oi),li=Bi=="ltr"==(Ti=="after")?"left":"right",ni=Ti=="after"?di.begin:di.end-(/\s/.test(xt.text.charAt(di.end-1))?2:1);return ii(ni,li)[li]}var Ui=$e(xt,c.direction);return He(Ui,pt||0,At==null?kt:At,function(oi,Bi,Ti,di){var li=Ti=="ltr",ni=ii(oi,li?"left":"right"),ji=ii(Bi-1,li?"right":"left"),ur=pt==null&&oi==0,In=At==null&&Bi==kt,Oi=di==0,ln=!Ui||di==Ui.length-1;if(ji.top-ni.top<=3){var bi=(te?ur:In)&&Oi,Va=(te?In:ur)&&ln,pn=bi?Q:(li?ni:ji).left,Gn=Va?Z:(li?ji:ni).right;he(pn,ni.top,Gn-pn,ni.bottom)}else{var Kn,Ii,hr,Xa;li?(Kn=te&&ur&&Oi?Q:ni.left,Ii=te?Z:Ki(oi,Ti,"before"),hr=te?Q:Ki(Bi,Ti,"after"),Xa=te&&In&&ln?Z:ji.right):(Kn=te?Ki(oi,Ti,"before"):Q,Ii=!te&&ur&&Oi?Z:ni.right,hr=!te&&In&&ln?Q:ji.left,Xa=te?Ki(Bi,Ti,"after"):Z),he(Kn,ni.top,Ii-Kn,ni.bottom),ni.bottom<ji.top&&he(Q,ni.bottom,null,ji.top),he(hr,ji.top,Xa-hr,ji.bottom)}(!Zt||Kr(ni,Zt)<0)&&(Zt=ni),Kr(ji,Zt)<0&&(Zt=ji),(!yi||Kr(ni,yi)<0)&&(yi=ni),Kr(ji,yi)<0&&(yi=ji)}),{start:Zt,end:yi}}var Ce=t.from(),we=t.to();if(Ce.line==we.line)pe(Ce.line,Ce.ch,we.ch);else{var Fe=ht(c,Ce.line),Ke=ht(c,we.line),Ze=Ri(Fe)==Ri(Ke),at=pe(Ce.line,Ce.ch,Ze?Fe.text.length+1:null).end,ft=pe(we.line,Ze?0:null,we.ch).start;Ze&&(at.top<ft.top-2?(he(at.right,at.top,null,at.bottom),he(Q,ft.top,ft.left,ft.bottom)):he(at.right,at.top,ft.left-at.right,at.bottom)),at.bottom<ft.top&&he(Q,at.bottom,null,ft.top)}r.appendChild(M)}function xa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Qn(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),Ta(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Qn(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ke(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),i&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function Qn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ke(e,"blur",e,t),e.state.focused=!1,C(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zr(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var c=t.view[n],M=e.options.lineWrapping,K=void 0,Q=0;if(c.hidden)continue;if(G&&W<8){var Z=c.node.offsetTop+c.node.offsetHeight;K=Z-r,r=Z}else{var te=c.node.getBoundingClientRect();K=te.bottom-te.top,!M&&c.text.firstChild&&(Q=c.text.firstChild.getBoundingClientRect().right-te.left-1)}var he=c.line.height-K;if((he>.005||he<-.005)&&(zt(c.line,K),ys(c.line),c.rest))for(var pe=0;pe<c.rest.length;pe++)ys(c.rest[pe]);if(Q>e.display.sizerWidth){var Ce=Math.ceil(Q/Jn(e.display));Ce>e.display.maxLineLength&&(e.display.maxLineLength=Ce,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function Vr(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Hr(e));var c=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,M=ui(t,n),K=ui(t,c);if(r&&r.ensure){var Q=r.ensure.from.line,Z=r.ensure.to.line;Q<M?(M=Q,K=ui(t,qi(ht(t,Q))+e.wrapper.clientHeight)):Math.min(Z,t.lastLine())>=K&&(M=ui(t,qi(ht(t,Z))-e.wrapper.clientHeight),K=Z)}return{from:M,to:Math.max(K,M+1)}}function Yo(e,t){if(Ne(e,"scrollCursorIntoView"))return;var r=e.display,n=r.sizer.getBoundingClientRect(),c=null;if(t.top+n.top<0?c=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(c=!1),c!=null&&!a){var M=p("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-r.viewOffset-Hr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+sn(e)+r.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(M),M.scrollIntoView(c),e.display.lineSpace.removeChild(M)}}function $o(e,t,r,n){n==null&&(n=0);var c;!e.options.lineWrapping&&t==r&&(t=t.ch?Xe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?Xe(t.line,t.ch+1,"before"):t);for(var M=0;M<5;M++){var K=!1,Q=en(e,t),Z=!r||r==t?Q:en(e,r);c={left:Math.min(Q.left,Z.left),top:Math.min(Q.top,Z.top)-n,right:Math.max(Q.left,Z.left),bottom:Math.max(Q.bottom,Z.bottom)+n};var te=wa(e,c),he=e.doc.scrollTop,pe=e.doc.scrollLeft;if(te.scrollTop!=null&&(Er(e,te.scrollTop),Math.abs(e.doc.scrollTop-he)>1&&(K=!0)),te.scrollLeft!=null&&(Bn(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-pe)>1&&(K=!0)),!K)break}return c}function Jo(e,t){var r=wa(e,t);r.scrollTop!=null&&Er(e,r.scrollTop),r.scrollLeft!=null&&Bn(e,r.scrollLeft)}function wa(e,t){var r=e.display,n=$n(e.display);t.top<0&&(t.top=0);var c=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,M=ca(e),K={};t.bottom-t.top>M&&(t.bottom=t.top+M);var Q=e.doc.height+da(r),Z=t.top<n,te=t.bottom>Q-n;if(t.top<c)K.scrollTop=Z?0:t.top;else if(t.bottom>c+M){var he=Math.min(t.top,(te?Q:t.bottom)-M);he!=c&&(K.scrollTop=he)}var pe=e.options.fixedGutter?0:r.gutters.offsetWidth,Ce=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-pe,we=Pn(e)-r.gutters.offsetWidth,Fe=t.right-t.left>we;return Fe&&(t.right=t.left+we),t.left<10?K.scrollLeft=0:t.left<Ce?K.scrollLeft=Math.max(0,t.left+pe-(Fe?0:10)):t.right>we+Ce-3&&(K.scrollLeft=t.right+(Fe?0:10)-we),K}function Sa(e,t){if(t==null)return;Xr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Zn(e){Xr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _r(e,t,r){(t!=null||r!=null)&&Xr(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Qo(e,t){Xr(e),e.curOp.scrollToPos=t}function Xr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=us(e,t.from),n=us(e,t.to);bs(e,r,n,t.margin)}}function bs(e,t,r,n){var c=wa(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});_r(e,c.scrollLeft,c.scrollTop)}function Er(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;k||Aa(e,{top:t}),_s(e,t,!0),k&&Aa(e),wr(e,100)}function _s(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Bn(e,t,r,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function xr(e){var t=e.display,r=t.gutters.offsetWidth,n=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?r:0,docHeight:n,scrollHeight:n+sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var jn=function(e,t,r){this.cm=r;var n=this.vert=p("div",[p("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),c=this.horiz=p("div",[p("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=c.tabIndex=-1,e(n),e(c),De(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),De(c,"scroll",function(){c.clientWidth&&t(c.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&W<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};jn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var c=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+c)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var M=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+M)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},jn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},jn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},jn.prototype.zeroWidthHack=function(){var e=o&&!u?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ee,this.disableVert=new ee},jn.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var c=e.getBoundingClientRect(),M=r=="vert"?document.elementFromPoint(c.right-1,(c.top+c.bottom)/2):document.elementFromPoint((c.right+c.left)/2,c.bottom-1);M!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},jn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Tr=function(){};Tr.prototype.update=function(){return{bottom:0,right:0}},Tr.prototype.setScrollLeft=function(){},Tr.prototype.setScrollTop=function(){},Tr.prototype.clear=function(){};function qn(e,t){t||(t=xr(e));var r=e.display.barWidth,n=e.display.barHeight;Es(e,t);for(var c=0;c<4&&r!=e.display.barWidth||n!=e.display.barHeight;c++)r!=e.display.barWidth&&e.options.lineWrapping&&zr(e),Es(e,xr(e)),r=e.display.barWidth,n=e.display.barHeight}function Es(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var xs={native:jn,null:Tr};function Ts(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&C(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xs[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),De(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?Bn(e,t):Er(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function Hn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Zo},Ji(e.curOp)}function Wn(e){var t=e.curOp;t&&Io(t,function(r){for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;qo(r)})}function qo(e){for(var t=e.ops,r=0;r<t.length;r++)el(t[r]);for(var n=0;n<t.length;n++)tl(t[n]);for(var c=0;c<t.length;c++)il(t[c]);for(var M=0;M<t.length;M++)nl(t[M]);for(var K=0;K<t.length;K++)rl(t[K])}function el(e){var t=e.cm,r=t.display;sl(t),e.updateMaxLine&&jr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function il(e){var t=e.cm,r=t.display;e.updatedDisplay&&zr(t),e.barMeasure=xr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Pn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Bn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==F();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qn(t,e.barMeasure),e.updatedDisplay&&Ra(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&gs(e.cm)}function rl(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&ws(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&_s(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Bn(t,e.scrollLeft,!0,!0),e.scrollToPos){var c=$o(t,E(n,e.scrollToPos.from),E(n,e.scrollToPos.to),e.scrollToPos.margin);Yo(t,c)}var M=e.maybeHiddenMarkers,K=e.maybeUnhiddenMarkers;if(M)for(var Q=0;Q<M.length;++Q)M[Q].lines.length||ke(M[Q],"hide");if(K)for(var Z=0;Z<K.length;++Z)K[Z].lines.length&&ke(K[Z],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ke(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Gi(e,t){if(e.curOp)return t();Hn(e);try{return t()}finally{Wn(e)}}function gi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Hn(e);try{return t.apply(e,arguments)}finally{Wn(e)}}}function Li(e){return function(){if(this.curOp)return e.apply(this,arguments);Hn(this);try{return e.apply(this,arguments)}finally{Wn(this)}}}function vi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Hn(t);try{return e.apply(this,arguments)}finally{Wn(t)}}}function wr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,P(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,n=it(e,t.highlightFrontier),c=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(M){if(n.line>=e.display.viewFrom){var K=M.styles,Q=M.text.length>e.options.maxHighlightLength?Bt(t.mode,n.state):null,Z=me(e,M,n,!0);Q&&(n.state=Q),M.styles=Z.styles;var te=M.styleClasses,he=Z.classes;he?M.styleClasses=he:te&&(M.styleClasses=null);for(var pe=!K||K.length!=M.styles.length||te!=he&&(!te||!he||te.bgClass!=he.bgClass||te.textClass!=he.textClass),Ce=0;!pe&&Ce<K.length;++Ce)pe=K[Ce]!=M.styles[Ce];pe&&c.push(n.line),M.stateAfter=n.save(),n.nextLine()}else M.text.length<=e.options.maxHighlightLength&>(e,M.text,n),M.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return wr(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),c.length&&Gi(e,function(){for(var M=0;M<c.length;M++)wn(e,c[M],"text")})}var Yr=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Vr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Pn(e),this.force=r,this.dims=ba(e),this.events=[]};Yr.prototype.signal=function(e,t){fe(e,t)&&this.events.push(arguments)},Yr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ke.apply(null,this.events[e])};function sl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=sn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=sn(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=F();if(!t||!y(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&y(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function ll(e){if(!e||!e.activeElt||e.activeElt==F())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&y(document.body,e.anchorNode)&&y(document.body,e.focusNode)){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return Sn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&fs(e)==0)return!1;Cs(e)&&(Sn(e),t.dims=ba(e));var c=n.first+n.size,M=Math.max(t.visible.from-e.options.viewportMargin,n.first),K=Math.min(c,t.visible.to+e.options.viewportMargin);r.viewFrom<M&&M-r.viewFrom<20&&(M=Math.max(n.first,r.viewFrom)),r.viewTo>K&&r.viewTo-K<20&&(K=Math.min(c,r.viewTo)),pi&&(M=cr(e.doc,M),K=Tn(e.doc,K));var Q=M!=r.viewFrom||K!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Vo(e,M,K),r.viewOffset=qi(ht(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var Z=fs(e);if(!Q&&Z==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var te=ol(e);return Z>4&&(r.lineDiv.style.display="none"),ul(e,r.updateLineNumbers,t.dims),Z>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ll(te),S(r.cursorDiv),S(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,Q&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,wr(e,400)),r.updateLineNumbers=null,!0}function ws(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Pn(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+da(e.display)-ca(e),r.top)}),t.visible=Vr(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Vr(e.display,e.doc,r));if(!Ca(e,t))break;zr(e);var c=xr(e);br(e),qn(e,c),Ra(e,c),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 Aa(e,t){var r=new Yr(e,t);if(Ca(e,r)){zr(e),ws(e,r);var n=xr(e);br(e),qn(e,n),Ra(e,n),r.finish()}}function ul(e,t,r){var n=e.display,c=e.options.lineNumbers,M=n.lineDiv,K=M.firstChild;function Q(Fe){var Ke=Fe.nextSibling;return i&&o&&e.display.currentWheelTarget==Fe?Fe.style.display="none":Fe.parentNode.removeChild(Fe),Ke}for(var Z=n.view,te=n.viewFrom,he=0;he<Z.length;he++){var pe=Z[he];if(!pe.hidden)if(!pe.node||pe.node.parentNode!=M){var Ce=No(e,pe,te,r);M.insertBefore(Ce,K)}else{for(;K!=pe.node;)K=Q(K);var we=c&&t!=null&&t<=te&&pe.lineNumber;pe.changes&&(ae(pe.changes,"gutter")>-1&&(we=!1),Ya(e,pe,te,r)),we&&(S(pe.lineNumber),pe.lineNumber.appendChild(document.createTextNode(Yi(e.options,te)))),K=pe.node.nextSibling}te+=pe.size}for(;K;)K=Q(K)}function Oa(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+sn(e)+"px"}function Ss(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,c=t.gutters.offsetWidth,M=n+"px",K=0;K<r.length;K++)if(!r[K].hidden){e.options.fixedGutter&&(r[K].gutter&&(r[K].gutter.style.left=M),r[K].gutterBackground&&(r[K].gutterBackground.style.left=M));var Q=r[K].alignable;if(Q)for(var Z=0;Z<Q.length;Z++)Q[Z].style.left=M}e.options.fixedGutter&&(t.gutters.style.left=n+c+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Yi(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var c=n.measure.appendChild(p("div",[p("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),M=c.firstChild.offsetWidth,K=c.offsetWidth-M;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(M,n.lineGutter.offsetWidth-K)+1,n.lineNumWidth=n.lineNumInnerWidth+K,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Oa(e.display),!0}return!1}function La(e,t){for(var r=[],n=!1,c=0;c<e.length;c++){var M=e[c],K=null;if(typeof M!="string"&&(K=M.style,M=M.className),M=="CodeMirror-linenumbers")if(t)n=!0;else continue;r.push({className:M,style:K})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function As(e){var t=e.gutters,r=e.gutterSpecs;S(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var c=r[n],M=c.className,K=c.style,Q=t.appendChild(p("div",null,"CodeMirror-gutter "+M));K&&(Q.style.cssText=K),M=="CodeMirror-linenumbers"&&(e.lineGutter=Q,Q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",Oa(e)}function Sr(e){As(e.display),Ni(e),Ss(e)}function hl(e,t,r,n){var c=this;this.input=r,c.scrollbarFiller=p("div",null,"CodeMirror-scrollbar-filler"),c.scrollbarFiller.setAttribute("cm-not-content","true"),c.gutterFiller=p("div",null,"CodeMirror-gutter-filler"),c.gutterFiller.setAttribute("cm-not-content","true"),c.lineDiv=T("div",null,"CodeMirror-code"),c.selectionDiv=p("div",null,null,"position: relative; z-index: 1"),c.cursorDiv=p("div",null,"CodeMirror-cursors"),c.measure=p("div",null,"CodeMirror-measure"),c.lineMeasure=p("div",null,"CodeMirror-measure"),c.lineSpace=T("div",[c.measure,c.lineMeasure,c.selectionDiv,c.cursorDiv,c.lineDiv],null,"position: relative; outline: none");var M=T("div",[c.lineSpace],"CodeMirror-lines");c.mover=p("div",[M],null,"position: relative"),c.sizer=p("div",[c.mover],"CodeMirror-sizer"),c.sizerWidth=null,c.heightForcer=p("div",null,null,"position: absolute; height: "+le+"px; width: 1px;"),c.gutters=p("div",null,"CodeMirror-gutters"),c.lineGutter=null,c.scroller=p("div",[c.sizer,c.heightForcer,c.gutters],"CodeMirror-scroll"),c.scroller.setAttribute("tabIndex","-1"),c.wrapper=p("div",[c.scrollbarFiller,c.gutterFiller,c.scroller],"CodeMirror"),G&&W<8&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight=0),!i&&!(k&&h)&&(c.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(c.wrapper):e(c.wrapper)),c.viewFrom=c.viewTo=t.first,c.reportedViewFrom=c.reportedViewTo=t.first,c.view=[],c.renderedView=null,c.externalMeasured=null,c.viewOffset=0,c.lastWrapHeight=c.lastWrapWidth=0,c.updateLineNumbers=null,c.nativeBarWidth=c.barHeight=c.barWidth=0,c.scrollbarsClipped=!1,c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null,c.alignWidgets=!1,c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=null,c.maxLine=null,c.maxLineLength=0,c.maxLineChanged=!1,c.wheelDX=c.wheelDY=c.wheelStartX=c.wheelStartY=null,c.shift=!1,c.selForContextMenu=null,c.activeTouch=null,c.gutterSpecs=La(n.gutters,n.lineNumbers),As(c),r.init(c)}var $r=0,Vi=null;G?Vi=-.53:k?Vi=15:g?Vi=-.7:m&&(Vi=-1/3);function Os(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function dl(e){var t=Os(e);return t.x*=Vi,t.y*=Vi,t}function Rs(e,t){var r=Os(t),n=r.x,c=r.y,M=e.display,K=M.scroller,Q=K.scrollWidth>K.clientWidth,Z=K.scrollHeight>K.clientHeight;if(!(n&&Q||c&&Z))return;if(c&&o&&i){e:for(var te=t.target,he=M.view;te!=K;te=te.parentNode)for(var pe=0;pe<he.length;pe++)if(he[pe].node==te){e.display.currentWheelTarget=te;break e}}if(n&&!k&&!d&&Vi!=null){c&&Z&&Er(e,Math.max(0,K.scrollTop+c*Vi)),Bn(e,Math.max(0,K.scrollLeft+n*Vi)),(!c||c&&Z)&&ie(t),M.wheelStartX=null;return}if(c&&Vi!=null){var Ce=c*Vi,we=e.doc.scrollTop,Fe=we+M.wrapper.clientHeight;Ce<0?we=Math.max(0,we+Ce-50):Fe=Math.min(e.doc.height,Fe+Ce+50),Aa(e,{top:we,bottom:Fe})}$r<20&&(M.wheelStartX==null?(M.wheelStartX=K.scrollLeft,M.wheelStartY=K.scrollTop,M.wheelDX=n,M.wheelDY=c,setTimeout(function(){if(M.wheelStartX==null)return;var Ke=K.scrollLeft-M.wheelStartX,Ze=K.scrollTop-M.wheelStartY,at=Ze&&M.wheelDY&&Ze/M.wheelDY||Ke&&M.wheelDX&&Ke/M.wheelDX;if(M.wheelStartX=M.wheelStartY=null,!at)return;Vi=(Vi*$r+at)/($r+1),++$r},200)):(M.wheelDX+=n,M.wheelDY+=c))}var Xi=function(e,t){this.ranges=e,this.primIndex=t};Xi.prototype.primary=function(){return this.ranges[this.primIndex]},Xi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!mn(r.anchor,n.anchor)||!mn(r.head,n.head))return!1}return!0},Xi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Xt(gn(this.ranges[t].anchor),gn(this.ranges[t].head));return new Xi(e,this.primIndex)},Xi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Xi.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(Ot(t,n.from())>=0&&Ot(e,n.to())<=0)return r}return-1};var Xt=function(e,t){this.anchor=e,this.head=t};Xt.prototype.from=function(){return yn(this.anchor,this.head)},Xt.prototype.to=function(){return vn(this.anchor,this.head)},Xt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function tn(e,t,r){var n=e&&e.options.selectionsMayTouch,c=t[r];t.sort(function(Ce,we){return Ot(Ce.from(),we.from())}),r=ae(t,c);for(var M=1;M<t.length;M++){var K=t[M],Q=t[M-1],Z=Ot(Q.to(),K.from());if(n&&!K.empty()?Z>0:Z>=0){var te=yn(Q.from(),K.from()),he=vn(Q.to(),K.to()),pe=Q.empty()?K.from()==K.head:Q.from()==Q.head;M<=r&&--r,t.splice(--M,2,new Xt(pe?he:te,pe?te:he))}}return new Xi(t,r)}function Cn(e,t){return new Xi([new Xt(e,t||e)],0)}function An(e){return e.text?Xe(e.from.line+e.text.length-1,Pe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(Ot(e,t.from)<0)return e;if(Ot(e,t.to)<=0)return An(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=An(t).ch-t.to.ch),Xe(r,n)}function Ia(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var c=e.sel.ranges[n];r.push(new Xt(Ls(c.anchor,t),Ls(c.head,t)))}return tn(e.cm,r,e.sel.primIndex)}function Is(e,t,r){return e.line==t.line?Xe(r.line,e.ch-t.ch+r.ch):Xe(r.line+(e.line-t.line),e.ch)}function cl(e,t,r){for(var n=[],c=Xe(e.first,0),M=c,K=0;K<t.length;K++){var Q=t[K],Z=Is(Q.from,c,M),te=Is(An(Q),c,M);if(c=Q.to,M=te,r=="around"){var he=e.sel.ranges[K],pe=Ot(he.head,he.anchor)<0;n[K]=new Xt(pe?te:Z,pe?Z:te)}else n[K]=new Xt(Z,Z)}return new Xi(n,e.sel.primIndex)}function Da(e){e.doc.mode=fi(e.options,e.doc.modeOption),Cr(e)}function Cr(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,wr(e,100),e.state.modeGen++,e.curOp&&Ni(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&Pe(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,r,n){function c(ft){return r?r[ft]:null}function M(ft,st,pt){ua(ft,st,pt,n),xi(ft,"change",ft,t)}function K(ft,st){for(var pt=[],At=ft;At<st;++At)pt.push(new Mn(te[At],c(At),n));return pt}var Q=t.from,Z=t.to,te=t.text,he=ht(e,Q.line),pe=ht(e,Z.line),Ce=Pe(te),we=c(te.length-1),Fe=Z.line-Q.line;if(t.full)e.insert(0,K(0,te.length)),e.remove(te.length,e.size-te.length);else if(Ds(e,t)){var Ke=K(0,te.length-1);M(pe,pe.text,we),Fe&&e.remove(Q.line,Fe),Ke.length&&e.insert(Q.line,Ke)}else if(he==pe)if(te.length==1)M(he,he.text.slice(0,Q.ch)+Ce+he.text.slice(Z.ch),we);else{var Ze=K(1,te.length-1);Ze.push(new Mn(Ce+he.text.slice(Z.ch),we,n)),M(he,he.text.slice(0,Q.ch)+te[0],c(0)),e.insert(Q.line+1,Ze)}else if(te.length==1)M(he,he.text.slice(0,Q.ch)+te[0]+pe.text.slice(Z.ch),c(0)),e.remove(Q.line+1,Fe);else{M(he,he.text.slice(0,Q.ch)+te[0],c(0)),M(pe,Ce+pe.text.slice(Z.ch),we);var at=K(1,te.length-1);Fe>1&&e.remove(Q.line+1,Fe-1),e.insert(Q.line+1,at)}xi(e,"change",e,t)}function On(e,t,r){function n(c,M,K){if(c.linked)for(var Q=0;Q<c.linked.length;++Q){var Z=c.linked[Q];if(Z.doc==M)continue;var te=K&&Z.sharedHist;if(r&&!te)continue;t(Z.doc,te),n(Z.doc,c,te)}}n(e,null,!0)}function ks(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ea(e),Da(e),Ms(e),e.options.lineWrapping||jr(e),e.options.mode=t.modeOption,Ni(e)}function Ms(e){(e.doc.direction=="rtl"?B:C)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Gi(e,function(){Ms(e),Ni(e)})}function Jr(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 Ma(e,t){var r={from:gn(t.from),to:An(t),text:_i(e,t.from,t.to)};return Fs(e,r,t.from.line,t.to.line+1),On(e,function(n){return Fs(n,r,t.from.line,t.to.line+1)},!0),r}function Ps(e){for(;e.length;){var t=Pe(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ps(e.done),Pe(e.done);if(e.done.length&&!Pe(e.done).ranges)return Pe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Pe(e.done)}function Ns(e,t,r,n){var c=e.history;c.undone.length=0;var M=+new Date,K,Q;if((c.lastOp==n||c.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&c.lastModTime>M-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(K=pl(c,c.lastOp==n)))Q=Pe(K.changes),Ot(t.from,t.to)==0&&Ot(t.from,Q.to)==0?Q.to=An(t):K.changes.push(Ma(e,t));else{var Z=Pe(c.done);for((!Z||!Z.ranges)&&Qr(e.sel,c.done),K={changes:[Ma(e,t)],generation:c.generation},c.done.push(K);c.done.length>c.undoDepth;)c.done.shift(),c.done[0].ranges||c.done.shift()}c.done.push(r),c.generation=++c.maxGeneration,c.lastModTime=c.lastSelTime=M,c.lastOp=c.lastSelOp=n,c.lastOrigin=c.lastSelOrigin=t.origin,Q||ke(e,"historyAdded")}function ml(e,t,r,n){var c=t.charAt(0);return c=="*"||c=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,r,n){var c=e.history,M=n&&n.origin;r==c.lastSelOp||M&&c.lastSelOrigin==M&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==M||ml(e,M,Pe(c.done),t))?c.done[c.done.length-1]=t:Qr(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=M,c.lastSelOp=r,n&&n.clearRedo!==!1&&Ps(c.undone)}function Qr(e,t){var r=Pe(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Fs(e,t,r,n){var c=t["spans_"+e.id],M=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(K){K.markedSpans&&((c||(c=t["spans_"+e.id]={}))[M]=K.markedSpans),++M})}function vl(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function yl(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],c=0;c<t.text.length;++c)n.push(vl(r[c]));return n}function Us(e,t){var r=yl(e,t),n=Zi(e,t);if(!r)return n;if(!n)return r;for(var c=0;c<r.length;++c){var M=r[c],K=n[c];if(M&&K){e:for(var Q=0;Q<K.length;++Q){for(var Z=K[Q],te=0;te<M.length;++te)if(M[te].marker==Z.marker)continue e;M.push(Z)}}else K&&(r[c]=K)}return r}function er(e,t,r){for(var n=[],c=0;c<e.length;++c){var M=e[c];if(M.ranges){n.push(r?Xi.prototype.deepCopy.call(M):M);continue}var K=M.changes,Q=[];n.push({changes:Q});for(var Z=0;Z<K.length;++Z){var te=K[Z],he=void 0;if(Q.push({from:te.from,to:te.to,text:te.text}),t)for(var pe in te)(he=pe.match(/^spans_(\d+)$/))&&(ae(t,Number(he[1]))>-1&&(Pe(Q)[pe]=te[pe],delete te[pe]))}}return n}function Pa(e,t,r,n){if(n){var c=e.anchor;if(r){var M=Ot(t,c)<0;M!=Ot(r,c)<0?(c=t,t=r):M!=Ot(t,r)<0&&(t=r)}return new Xt(c,t)}else return new Xt(r||t,t)}function Zr(e,t,r,n,c){c==null&&(c=e.cm&&(e.cm.display.shift||e.extend)),Ai(e,new Xi([Pa(e.sel.primary(),t,r,c)],0),n)}function Bs(e,t,r){for(var n=[],c=e.cm&&(e.cm.display.shift||e.extend),M=0;M<e.sel.ranges.length;M++)n[M]=Pa(e.sel.ranges[M],t[M],null,c);var K=tn(e.cm,n,e.sel.primIndex);Ai(e,K,r)}function Na(e,t,r,n){var c=e.sel.ranges.slice(0);c[t]=r,Ai(e,tn(e.cm,c,e.sel.primIndex),n)}function js(e,t,r,n){Ai(e,Cn(t,r),n)}function bl(e,t,r){var n={ranges:t.ranges,update:function(c){this.ranges=[];for(var M=0;M<c.length;M++)this.ranges[M]=new Xt(E(e,c[M].anchor),E(e,c[M].head))},origin:r&&r.origin};return ke(e,"beforeSelectionChange",e,n),e.cm&&ke(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?tn(e.cm,n.ranges,n.ranges.length-1):t}function Hs(e,t,r){var n=e.history.done,c=Pe(n);c&&c.ranges?(n[n.length-1]=t,qr(e,t,r)):Ai(e,t,r)}function Ai(e,t,r){qr(e,t,r),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function qr(e,t,r){(fe(e,"beforeSelectionChange")||e.cm&&fe(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,r));var n=r&&r.bias||(Ot(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,Ks(e,t,n,!0)),!(r&&r.scroll===!1)&&e.cm&&Zn(e.cm)}function Ws(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,_e(e.cm)),xi(e,"cursorActivity",e)}function Gs(e){Ws(e,Ks(e,e.sel,null,!1))}function Ks(e,t,r,n){for(var c,M=0;M<t.ranges.length;M++){var K=t.ranges[M],Q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[M],Z=ea(e,K.anchor,Q&&Q.anchor,r,n),te=ea(e,K.head,Q&&Q.head,r,n);(c||Z!=K.anchor||te!=K.head)&&(c||(c=t.ranges.slice(0,M)),c[M]=new Xt(Z,te))}return c?tn(e.cm,c,t.primIndex):t}function tr(e,t,r,n,c){var M=ht(e,t.line);if(M.markedSpans)for(var K=0;K<M.markedSpans.length;++K){var Q=M.markedSpans[K],Z=Q.marker,te="selectLeft"in Z?!Z.selectLeft:Z.inclusiveLeft,he="selectRight"in Z?!Z.selectRight:Z.inclusiveRight;if((Q.from==null||(te?Q.from<=t.ch:Q.from<t.ch))&&(Q.to==null||(he?Q.to>=t.ch:Q.to>t.ch))){if(c&&(ke(Z,"beforeCursorEnter"),Z.explicitlyCleared))if(M.markedSpans){--K;continue}else break;if(!Z.atomic)continue;if(r){var pe=Z.find(n<0?1:-1),Ce=void 0;if((n<0?he:te)&&(pe=zs(e,pe,-n,pe&&pe.line==t.line?M:null)),pe&&pe.line==t.line&&(Ce=Ot(pe,r))&&(n<0?Ce<0:Ce>0))return tr(e,pe,t,n,c)}var we=Z.find(n<0?-1:1);return(n<0?te:he)&&(we=zs(e,we,n,we.line==t.line?M:null)),we?tr(e,we,t,n,c):null}}return t}function ea(e,t,r,n,c){var M=n||1,K=tr(e,t,r,M,c)||!c&&tr(e,t,r,M,!0)||tr(e,t,r,-M,c)||!c&&tr(e,t,r,-M,!0);return K||(e.cantEdit=!0,Xe(e.first,0))}function zs(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?E(e,Xe(t.line-1)):null:r>0&&t.ch==(n||ht(e,t.line)).text.length?t.line<e.first+e.size-1?Xe(t.line+1,0):null:new Xe(t.line,t.ch+r)}function Vs(e){e.setSelection(Xe(e.firstLine(),0),Xe(e.lastLine()),Ee)}function Xs(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(c,M,K,Q){c&&(n.from=E(e,c)),M&&(n.to=E(e,M)),K&&(n.text=K),Q!==void 0&&(n.origin=Q)}),ke(e,"beforeChange",e,n),e.cm&&ke(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function ir(e,t,r){if(e.cm){if(!e.cm.curOp)return gi(e.cm,ir)(e,t,r);if(e.cm.state.suppressEdits)return}if((fe(e,"beforeChange")||e.cm&&fe(e.cm,"beforeChange"))&&(t=Xs(e,t,!0),!t))return;var n=Dn&&!r&&_n(e,t.from,t.to);if(n)for(var c=n.length-1;c>=0;--c)Ys(e,{from:n[c].from,to:n[c].to,text:c?[""]:t.text,origin:t.origin});else Ys(e,t)}function Ys(e,t){if(t.text.length==1&&t.text[0]==""&&Ot(t.from,t.to)==0)return;var r=Ia(e,t);Ns(e,t,r,e.cm?e.cm.curOp.id:NaN),Ar(e,t,r,Zi(e,t));var n=[];On(e,function(c,M){!M&&ae(n,c.history)==-1&&(Zs(c.history,t),n.push(c.history)),Ar(c,t,null,Zi(c,t))})}function ta(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!r)return;for(var c=e.history,M,K=e.sel,Q=t=="undo"?c.done:c.undone,Z=t=="undo"?c.undone:c.done,te=0;te<Q.length&&!(M=Q[te],r?M.ranges&&!M.equals(e.sel):!M.ranges);te++);if(te==Q.length)return;for(c.lastOrigin=c.lastSelOrigin=null;;)if(M=Q.pop(),M.ranges){if(Qr(M,Z),r&&!M.equals(e.sel)){Ai(e,M,{clearRedo:!1});return}K=M}else if(n){Q.push(M);return}else break;var he=[];Qr(K,Z),Z.push({changes:he,generation:c.generation}),c.generation=M.generation||++c.maxGeneration;for(var pe=fe(e,"beforeChange")||e.cm&&fe(e.cm,"beforeChange"),Ce=function(Ke){var Ze=M.changes[Ke];if(Ze.origin=t,pe&&!Xs(e,Ze,!1))return Q.length=0,{};he.push(Ma(e,Ze));var at=Ke?Ia(e,Ze):Pe(Q);Ar(e,Ze,at,Us(e,Ze)),!Ke&&e.cm&&e.cm.scrollIntoView({from:Ze.from,to:An(Ze)});var ft=[];On(e,function(st,pt){!pt&&ae(ft,st.history)==-1&&(Zs(st.history,Ze),ft.push(st.history)),Ar(st,Ze,null,Us(st,Ze))})},we=M.changes.length-1;we>=0;--we){var Fe=Ce(we);if(Fe)return Fe.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Xi(qe(e.sel.ranges,function(c){return new Xt(Xe(c.anchor.line+t,c.anchor.ch),Xe(c.head.line+t,c.head.ch))}),e.sel.primIndex),e.cm){Ni(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)wn(e.cm,n,"gutter")}}function Ar(e,t,r,n){if(e.cm&&!e.cm.curOp)return gi(e.cm,Ar)(e,t,r,n);if(t.to.line<e.first){$s(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var c=t.text.length-1-(e.first-t.from.line);$s(e,c),t={from:Xe(e.first,0),to:Xe(t.to.line+c,t.to.ch),text:[Pe(t.text)],origin:t.origin}}var M=e.lastLine();t.to.line>M&&(t={from:t.from,to:Xe(M,ht(e,M).text.length),text:[t.text[0]],origin:t.origin}),t.removed=_i(e,t.from,t.to),r||(r=Ia(e,t)),e.cm?_l(e.cm,t,n):ka(e,t,n),qr(e,r,Ee),e.cantEdit&&ea(e,Xe(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,r){var n=e.doc,c=e.display,M=t.from,K=t.to,Q=!1,Z=M.line;e.options.lineWrapping||(Z=It(Ri(ht(n,M.line))),n.iter(Z,K.line+1,function(we){if(we==c.maxLine)return Q=!0,!0})),n.sel.contains(t.from,t.to)>-1&&_e(e),ka(n,t,r,cs(e)),e.options.lineWrapping||(n.iter(Z,M.line+t.text.length,function(we){var Fe=pr(we);Fe>c.maxLineLength&&(c.maxLine=we,c.maxLineLength=Fe,c.maxLineChanged=!0,Q=!1)}),Q&&(e.curOp.updateMaxLine=!0)),Qi(n,M.line),wr(e,400);var te=t.text.length-(K.line-M.line)-1;t.full?Ni(e):M.line==K.line&&t.text.length==1&&!Ds(e.doc,t)?wn(e,M.line,"text"):Ni(e,M.line,K.line+1,te);var he=fe(e,"changes"),pe=fe(e,"change");if(pe||he){var Ce={from:M,to:K,text:t.text,removed:t.removed,origin:t.origin};pe&&xi(e,"change",e,Ce),he&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ce)}e.display.selForContextMenu=null}function nr(e,t,r,n,c){var M;n||(n=r),Ot(n,r)<0&&(M=[n,r],r=M[0],n=M[1]),typeof t=="string"&&(t=e.splitLines(t)),ir(e,{from:r,to:n,text:t,origin:c})}function Js(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Qs(e,t,r,n){for(var c=0;c<e.length;++c){var M=e[c],K=!0;if(M.ranges){M.copied||(M=e[c]=M.deepCopy(),M.copied=!0);for(var Q=0;Q<M.ranges.length;Q++)Js(M.ranges[Q].anchor,t,r,n),Js(M.ranges[Q].head,t,r,n);continue}for(var Z=0;Z<M.changes.length;++Z){var te=M.changes[Z];if(r<te.from.line)te.from=Xe(te.from.line+n,te.from.ch),te.to=Xe(te.to.line+n,te.to.ch);else if(t<=te.to.line){K=!1;break}}K||(e.splice(0,c+1),c=0)}}function Zs(e,t){var r=t.from.line,n=t.to.line,c=t.text.length-(n-r)-1;Qs(e.done,r,n,c),Qs(e.undone,r,n,c)}function Or(e,t,r,n){var c=t,M=t;return typeof t=="number"?M=ht(e,V(e,t)):c=It(t),c==null?null:(n(M,c)&&e.cm&&wn(e.cm,c,r),M)}function Rr(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}Rr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var c=this.lines[r];this.height-=c.height,vt(c),xi(c,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}};function Lr(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var c=e[n];t+=c.chunkSize(),r+=c.height,c.parent=this}this.size=t,this.height=r,this.parent=null}Lr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],c=n.chunkSize();if(e<c){var M=Math.min(t,c-e),K=n.height;if(n.removeInner(e,M),this.height-=K-n.height,c==M&&(this.children.splice(r--,1),n.parent=null),(t-=M)==0)break;e=0}else e-=c}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Rr))){var Q=[];this.collapse(Q),this.children=[new Rr(Q)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var c=this.children[n],M=c.chunkSize();if(e<=M){if(c.insertInner(e,t,r),c.lines&&c.lines.length>50){for(var K=c.lines.length%25+25,Q=K;Q<c.lines.length;){var Z=new Rr(c.lines.slice(Q,Q+=25));c.height-=Z.height,this.children.splice(++n,0,Z),Z.parent=this}c.lines=c.lines.slice(0,K),this.maybeSpill()}break}e-=M}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Lr(t);if(e.parent){e.size-=r.size,e.height-=r.height;var c=ae(e.parent.children,e);e.parent.children.splice(c+1,0,r)}else{var n=new Lr(e.children);n.parent=e,e.children=[n,r],e=n}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var c=this.children[n],M=c.chunkSize();if(e<M){var K=Math.min(t,M-e);if(c.iterN(e,K,r))return!0;if((t-=K)==0)break;e=0}else e-=M}}};var Ir=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};Ir.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=It(r);if(n==null||!t)return;for(var c=0;c<t.length;++c)t[c]==this&&t.splice(c--,1);t.length||(r.widgets=null);var M=vr(this);zt(r,Math.max(0,r.height-M)),e&&(Gi(e,function(){qs(e,r,-M),wn(e,n,"widget")}),xi(e,"lineWidgetCleared",e,this,n))},Ir.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var c=vr(this)-t;if(!c)return;an(this.doc,n)||zt(n,n.height+c),r&&Gi(r,function(){r.curOp.forceUpdate=!0,qs(r,n,c),xi(r,"lineWidgetChanged",r,e,It(n))})},ve(Ir);function qs(e,t,r){qi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,r)}function El(e,t,r,n){var c=new Ir(e,r,n),M=e.cm;return M&&c.noHScroll&&(M.display.alignWidgets=!0),Or(e,t,"widget",function(K){var Q=K.widgets||(K.widgets=[]);if(c.insertAt==null?Q.push(c):Q.splice(Math.min(Q.length-1,Math.max(0,c.insertAt)),0,c),c.line=K,M&&!an(e,K)){var Z=qi(K)<e.scrollTop;zt(K,K.height+vr(c)),Z&&Sa(M,c.height),M.curOp.forceUpdate=!0}return!0}),M&&xi(M,"lineWidgetAdded",M,c,typeof t=="number"?t:It(t)),c}var eo=0,Rn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};Rn.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hn(e),fe(this,"clear")){var r=this.find();r&&xi(this,"clear",r.from,r.to)}for(var n=null,c=null,M=0;M<this.lines.length;++M){var K=this.lines[M],Q=Wi(K.markedSpans,this);e&&!this.collapsed?wn(e,It(K),"text"):e&&(Q.to!=null&&(c=It(K)),Q.from!=null&&(n=It(K))),K.markedSpans=kn(K.markedSpans,Q),Q.from==null&&this.collapsed&&!an(this.doc,K)&&e&&zt(K,$n(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var Z=0;Z<this.lines.length;++Z){var te=Ri(this.lines[Z]),he=pr(te);he>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=he,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Ni(e,n,c+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&xi(e,"markerCleared",e,this,n,c),t&&Wn(e),this.parent&&this.parent.clear()},Rn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,c=0;c<this.lines.length;++c){var M=this.lines[c],K=Wi(M.markedSpans,this);if(K.from!=null&&(r=Xe(t?M:It(M),K.from),e==-1))return r;if(K.to!=null&&(n=Xe(t?M:It(M),K.to),e==1))return n}return r&&{from:r,to:n}},Rn.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;if(!t||!n)return;Gi(n,function(){var c=t.line,M=It(t.line),K=fa(n,M);if(K&&(rs(K),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!an(r.doc,c)&&r.height!=null){var Q=r.height;r.height=null;var Z=vr(r)-Q;Z&&zt(c,c.height+Z)}xi(n,"markerChanged",n,e)})},Rn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ae(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Rn.prototype.detachLine=function(e){if(this.lines.splice(ae(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ve(Rn);function rr(e,t,r,n,c){if(n&&n.shared)return xl(e,t,r,n,c);if(e.cm&&!e.cm.curOp)return gi(e.cm,rr)(e,t,r,n,c);var M=new Rn(e,c),K=Ot(t,r);if(n&&b(n,M,!1),K>0||K==0&&M.clearWhenEmpty!==!1)return M;if(M.replacedWith&&(M.collapsed=!0,M.widgetNode=T("span",[M.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||M.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(M.widgetNode.insertLeft=!0)),M.collapsed){if(mi(e,t.line,t,r,M)||t.line!=r.line&&mi(e,r.line,t,r,M))throw new Error("Inserting collapsed marker partially overlapping an existing one");un()}M.addToHistory&&Ns(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var Q=t.line,Z=e.cm,te;if(e.iter(Q,r.line+1,function(pe){Z&&M.collapsed&&!Z.options.lineWrapping&&Ri(pe)==Z.display.maxLine&&(te=!0),M.collapsed&&Q!=t.line&&zt(pe,0),bn(pe,new hn(M,Q==t.line?t.ch:null,Q==r.line?r.ch:null)),++Q}),M.collapsed&&e.iter(t.line,r.line+1,function(pe){an(e,pe)&&zt(pe,0)}),M.clearOnEnter&&De(M,"beforeCursorEnter",function(){return M.clear()}),M.readOnly&&(zi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),M.collapsed&&(M.id=++eo,M.atomic=!0),Z){if(te&&(Z.curOp.updateMaxLine=!0),M.collapsed)Ni(Z,t.line,r.line+1);else if(M.className||M.startStyle||M.endStyle||M.css||M.attributes||M.title)for(var he=t.line;he<=r.line;he++)wn(Z,he,"text");M.atomic&&Gs(Z.doc),xi(Z,"markerAdded",Z,M)}return M}var Dr=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};Dr.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();xi(this,"clear")},Dr.prototype.find=function(e,t){return this.primary.find(e,t)},ve(Dr);function xl(e,t,r,n,c){n=b(n),n.shared=!1;var M=[rr(e,t,r,n,c)],K=M[0],Q=n.widgetNode;return On(e,function(Z){Q&&(n.widgetNode=Q.cloneNode(!0)),M.push(rr(Z,E(Z,t),E(Z,r),n,c));for(var te=0;te<Z.linked.length;++te)if(Z.linked[te].isParent)return;K=Pe(M)}),new Dr(M,K)}function to(e){return e.findMarks(Xe(e.first,0),e.clipPos(Xe(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var r=0;r<t.length;r++){var n=t[r],c=n.find(),M=e.clipPos(c.from),K=e.clipPos(c.to);if(Ot(M,K)){var Q=rr(e,M,K,n.primary,n.primary.type);n.markers.push(Q),Q.parent=n}}}function wl(e){for(var t=function(n){var c=e[n],M=[c.primary.doc];On(c.primary.doc,function(Z){return M.push(Z)});for(var K=0;K<c.markers.length;K++){var Q=c.markers[K];ae(M,Q.doc)==-1&&(Q.parent=null,c.markers.splice(K--,1))}},r=0;r<e.length;r++)t(r)}var Sl=0,Fi=function(e,t,r,n,c){if(!(this instanceof Fi))return new Fi(e,t,r,n,c);r==null&&(r=0),Lr.call(this,[new Rr([new Mn("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var M=Xe(r,0);this.sel=Cn(M),this.history=new Jr(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=c=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ka(this,{from:M,to:M,text:e}),Ai(this,Cn(M),Ee)};Fi.prototype=nt(Lr.prototype,{constructor:Fi,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ht(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:vi(function(e){var t=Xe(this.first,0),r=this.first+this.size-1;ir(this,{from:t,to:Xe(r,ht(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&_r(this.cm,0,0),Ai(this,Cn(t),Ee)}),replaceRange:function(e,t,r,n){t=E(this,t),r=r?E(this,r):t,nr(this,e,t,r,n)},getRange:function(e,t,r){var n=_i(this,E(this,e),E(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(ki(this,e))return ht(this,e)},getLineNumber:function(e){return It(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ht(this,e)),Ri(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return E(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:vi(function(e,t,r){js(this,E(this,typeof e=="number"?Xe(e,t||0):e),null,r)}),setSelection:vi(function(e,t,r){js(this,E(this,e),E(this,t||e),r)}),extendSelection:vi(function(e,t,r){Zr(this,E(this,e),t&&E(this,t),r)}),extendSelections:vi(function(e,t){Bs(this,H(this,e),t)}),extendSelectionsBy:vi(function(e,t){var r=qe(this.sel.ranges,e);Bs(this,H(this,r),t)}),setSelections:vi(function(e,t,r){if(!e.length)return;for(var n=[],c=0;c<e.length;c++)n[c]=new Xt(E(this,e[c].anchor),E(this,e[c].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ai(this,tn(this.cm,n,t),r)}),addSelection:vi(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Xt(E(this,e),E(this,t||e))),Ai(this,tn(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,n=0;n<t.length;n++){var c=_i(this,t[n].from(),t[n].to());r=r?r.concat(c):c}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var c=_i(this,r[n].from(),r[n].to());e!==!1&&(c=c.join(e||this.lineSeparator())),t[n]=c}return t},replaceSelection:function(e,t,r){for(var n=[],c=0;c<this.sel.ranges.length;c++)n[c]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:vi(function(e,t,r){for(var n=[],c=this.sel,M=0;M<c.ranges.length;M++){var K=c.ranges[M];n[M]={from:K.from(),to:K.to(),text:this.splitLines(e[M]),origin:r}}for(var Q=t&&t!="end"&&cl(this,n,t),Z=n.length-1;Z>=0;Z--)ir(this,n[Z]);Q?Hs(this,Q):this.cm&&Zn(this.cm)}),undo:vi(function(){ta(this,"undo")}),redo:vi(function(){ta(this,"redo")}),undoSelection:vi(function(){ta(this,"undo",!0)}),redoSelection:vi(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var c=0;c<e.undone.length;c++)e.undone[c].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Jr(this.history.maxGeneration),On(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:er(this.history.done),undone:er(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=er(e.done.slice(0),null,!0),t.undone=er(e.undone.slice(0),null,!0)},setGutterMarker:vi(function(e,t,r){return Or(this,e,"gutter",function(n){var c=n.gutterMarkers||(n.gutterMarkers={});return c[t]=r,!r&&se(c)&&(n.gutterMarkers=null),!0})}),clearGutter:vi(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Or(t,r,"gutter",function(){return r.gutterMarkers[e]=null,se(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!ki(this,e))return null;if(t=e,e=ht(this,e),!e)return null}else if(t=It(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:vi(function(e,t,r){return Or(this,e,t=="gutter"?"gutter":"class",function(n){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[c])n[c]=r;else{if(R(r).test(n[c]))return!1;n[c]+=" "+r}return!0})}),removeLineClass:vi(function(e,t,r){return Or(this,e,t=="gutter"?"gutter":"class",function(n){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",M=n[c];if(M)if(r==null)n[c]=null;else{var K=M.match(R(r));if(!K)return!1;var Q=K.index+K[0].length;n[c]=M.slice(0,K.index)+(!K.index||Q==M.length?"":" ")+M.slice(Q)||null}else return!1;return!0})}),addLineWidget:vi(function(e,t,r){return El(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return rr(this,E(this,e),E(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=E(this,e),rr(this,e,e,r,"bookmark")},findMarksAt:function(e){e=E(this,e);var t=[],r=ht(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var c=r[n];(c.from==null||c.from<=e.ch)&&(c.to==null||c.to>=e.ch)&&t.push(c.marker.parent||c.marker)}return t},findMarks:function(e,t,r){e=E(this,e),t=E(this,t);var n=[],c=e.line;return this.iter(e.line,t.line+1,function(M){var K=M.markedSpans;if(K)for(var Q=0;Q<K.length;Q++){var Z=K[Q];!(Z.to!=null&&c==e.line&&e.ch>=Z.to||Z.from==null&&c!=e.line||Z.from!=null&&c==t.line&&Z.from>=t.ch)&&(!r||r(Z.marker))&&n.push(Z.marker.parent||Z.marker)}++c}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)r[n].from!=null&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(c){var M=c.text.length+n;if(M>e)return t=e,!0;e-=M,++r}),E(this,Xe(r,t))},indexFromPos:function(e){e=E(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+r}),t},copy:function(e){var t=new Fi(Ht(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var n=new Fi(Ht(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(n,to(this)),n},unlinkDoc:function(e){if(e instanceof ti&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(to(this));break}if(e.history==this.history){var n=[e.id];On(e,function(c){return n.push(c.id)},!0),e.history=new Jr(null),e.history.done=er(this.history.done,n),e.history.undone=er(this.history.undone,n)}},iterLinkedDocs:function(e){On(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):yt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:vi(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)})}),Fi.prototype.eachLine=Fi.prototype.iter;var io=0;function Cl(e){var t=this;if(no(t),Ne(t,e)||cn(t.display,e))return;ie(e),G&&(io=+new Date);var r=Fn(t,e,!0),n=e.dataTransfer.files;if(!r||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var c=n.length,M=Array(c),K=0,Q=function(){++K==c&&gi(t,function(){r=E(t.doc,r);var we={from:r,to:r,text:t.doc.splitLines(M.filter(function(Fe){return Fe!=null}).join(t.doc.lineSeparator())),origin:"paste"};ir(t.doc,we),Hs(t.doc,Cn(E(t.doc,r),E(t.doc,An(we))))})()},Z=function(we,Fe){if(t.options.allowDropFileTypes&&ae(t.options.allowDropFileTypes,we.type)==-1){Q();return}var Ke=new FileReader;Ke.onerror=function(){return Q()},Ke.onload=function(){var Ze=Ke.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ze)){Q();return}M[Fe]=Ze,Q()},Ke.readAsText(we)},te=0;te<n.length;te++)Z(n[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var he=e.dataTransfer.getData("Text");if(he){var pe;if(t.state.draggingText&&!t.state.draggingText.copy&&(pe=t.listSelections()),qr(t.doc,Cn(r,r)),pe)for(var Ce=0;Ce<pe.length;++Ce)nr(t.doc,"",pe[Ce].anchor,pe[Ce].head,"drag");t.replaceSelection(he,"around","paste"),t.display.input.focus()}}catch(we){}}}function Al(e,t){if(G&&(!e.state.draggingText||+new Date-io<100)){de(t);return}if(Ne(e,t)||cn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!m){var r=p("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),d&&r.parentNode.removeChild(r)}}function Ol(e,t){var r=Fn(e,t);if(!r)return;var n=document.createDocumentFragment();ms(e,r,n),e.display.dragCursor||(e.display.dragCursor=p("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),x(e.display.dragCursor,n)}function no(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ro(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var c=t[n].CodeMirror;c&&r.push(c)}r.length&&r[0].operation(function(){for(var M=0;M<r.length;M++)e(r[M])})}var ao=!1;function Rl(){if(ao)return;Ll(),ao=!0}function Ll(){var e;De(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ro(Il)},100))}),De(window,"blur",function(){return ro(Qn)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ln={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"},kr=0;kr<10;kr++)Ln[kr+48]=Ln[kr+96]=String(kr);for(var ia=65;ia<=90;ia++)Ln[ia]=String.fromCharCode(ia);for(var Mr=1;Mr<=12;Mr++)Ln[Mr+111]=Ln[Mr+63235]="F"+Mr;var fn={};fn.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"},fn.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"},fn.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"},fn.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"]},fn.default=o?fn.macDefault:fn.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,c,M,K=0;K<t.length-1;K++){var Q=t[K];if(/^(cmd|meta|m)$/i.test(Q))M=!0;else if(/^a(lt)?$/i.test(Q))r=!0;else if(/^(c|ctrl|control)$/i.test(Q))n=!0;else if(/^s(hift)?$/i.test(Q))c=!0;else throw new Error("Unrecognized modifier name: "+Q)}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),M&&(e="Cmd-"+e),c&&(e="Shift-"+e),e}function kl(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(n=="..."){delete e[r];continue}for(var c=qe(r.split(" "),Dl),M=0;M<c.length;M++){var K=void 0,Q=void 0;M==c.length-1?(Q=c.join(" "),K=n):(Q=c.slice(0,M+1).join(" "),K="...");var Z=t[Q];if(!Z)t[Q]=K;else if(Z!=K)throw new Error("Inconsistent bindings for "+Q)}delete e[r]}for(var te in t)e[te]=t[te];return e}function ar(e,t,r,n){t=na(t);var c=t.call?t.call(e,n):t[e];if(c===!1)return"nothing";if(c==="...")return"multi";if(c!=null&&r(c))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ar(e,t.fallthrough,r,n);for(var M=0;M<t.fallthrough.length;M++){var K=ar(e,t.fallthrough[M],r,n);if(K)return K}}}function so(e){var t=typeof e=="string"?e:Ln[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,r){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(w?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(w?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(d&&e.keyCode==34&&e.char)return!1;var r=Ln[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),oo(r,e,t))}function na(e){return typeof e=="string"?fn[e]:e}function sr(e,t){for(var r=e.doc.sel.ranges,n=[],c=0;c<r.length;c++){for(var M=t(r[c]);n.length&&Ot(M.from,Pe(n).to)<=0;){var K=n.pop();if(Ot(K.from,M.from)<0){M.from=K.from;break}}n.push(M)}Gi(e,function(){for(var Q=n.length-1;Q>=0;Q--)nr(e.doc,"",n[Q].from,n[Q].to,"+delete");Zn(e)})}function Fa(e,t,r){var n=Se(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Ua(e,t,r){var n=Fa(e,t.ch,r);return n==null?null:new Xe(t.line,n,r<0?"after":"before")}function Ba(e,t,r,n,c){if(e){t.doc.direction=="rtl"&&(c=-c);var M=$e(r,t.doc.direction);if(M){var K=c<0?Pe(M):M[0],Q=c<0==(K.level==1),Z=Q?"after":"before",te;if(K.level>0||t.doc.direction=="rtl"){var he=Yn(t,r);te=c<0?r.text.length-1:0;var pe=on(t,he,te).top;te=Be(function(Ce){return on(t,he,Ce).top==pe},c<0==(K.level==1)?K.from:K.to-1,te),Z=="before"&&(te=Fa(r,te,1))}else te=c<0?K.to:K.from;return new Xe(n,te,Z)}}return new Xe(n,c<0?r.text.length:0,c<0?"before":"after")}function Ml(e,t,r,n){var c=$e(t,e.doc.direction);if(!c)return Ua(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var M=Ve(c,r.ch,r.sticky),K=c[M];if(e.doc.direction=="ltr"&&K.level%2==0&&(n>0?K.to>r.ch:K.from<r.ch))return Ua(t,r,n);var Q=function(at,ft){return Fa(t,at instanceof Xe?at.ch:at,ft)},Z,te=function(at){return e.options.lineWrapping?(Z=Z||Yn(e,t),ds(e,t,Z,at)):{begin:0,end:t.text.length}},he=te(r.sticky=="before"?Q(r,-1):r.ch);if(e.doc.direction=="rtl"||K.level==1){var pe=K.level==1==n<0,Ce=Q(r,pe?1:-1);if(Ce!=null&&(pe?Ce<=K.to&&Ce<=he.end:Ce>=K.from&&Ce>=he.begin)){var we=pe?"before":"after";return new Xe(r.line,Ce,we)}}var Fe=function(at,ft,st){for(var pt=function(Zt,yi){return yi?new Xe(r.line,Q(Zt,1),"before"):new Xe(r.line,Zt,"after")};at>=0&&at<c.length;at+=ft){var At=c[at],xt=ft>0==(At.level!=1),kt=xt?st.begin:Q(st.end,-1);if(At.from<=kt&&kt<At.to)return pt(kt,xt);if(kt=xt?At.from:Q(At.to,-1),st.begin<=kt&&kt<st.end)return pt(kt,xt)}},Ke=Fe(M+n,n,he);if(Ke)return Ke;var Ze=n>0?he.end:Q(he.begin,-1);return Ze!=null&&!(n>0&&Ze==t.text.length)&&(Ke=Fe(n>0?0:c.length-1,n,te(Ze)),Ke)?Ke:null}var Pr={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ee)},killLine:function(e){return sr(e,function(t){if(t.empty()){var r=ht(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:Xe(t.head.line+1,0)}:{from:t.head,to:Xe(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return sr(e,function(t){return{from:Xe(t.from().line,0),to:E(e.doc,Xe(t.to().line+1,0))}})},delLineLeft:function(e){return sr(e,function(t){return{from:Xe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return sr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return sr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Xe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Xe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return uo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ho(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Ae)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Ae)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?ho(e,t.head):n},Ae)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,c=0;c<r.length;c++){var M=r[c].from(),K=Y(e.getLine(M.line),M.ch,n);t.push(ue(n-K%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Gi(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var c=t[n].head,M=ht(e.doc,c.line).text;if(M){if(c.ch==M.length&&(c=new Xe(c.line,c.ch-1)),c.ch>0)c=new Xe(c.line,c.ch+1),e.replaceRange(M.charAt(c.ch-1)+M.charAt(c.ch-2),Xe(c.line,c.ch-2),c,"+transpose");else if(c.line>e.doc.first){var K=ht(e.doc,c.line-1).text;K&&(c=new Xe(c.line,1),e.replaceRange(M.charAt(0)+e.doc.lineSeparator()+K.charAt(K.length-1),Xe(c.line-1,K.length-1),c,"+transpose"))}}r.push(new Xt(c,c))}e.setSelections(r)})},newlineAndIndent:function(e){return Gi(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Zn(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var r=ht(e.doc,t),n=Ri(r);return n!=r&&(t=It(n)),Ba(!0,e,n,t,1)}function Pl(e,t){var r=ht(e.doc,t),n=Xn(r);return n!=r&&(t=It(n)),Ba(!0,e,r,t,-1)}function ho(e,t){var r=uo(e,t.line),n=ht(e.doc,r.line),c=$e(n,e.doc.direction);if(!c||c[0].level==0){var M=Math.max(r.ch,n.text.search(/\S/)),K=t.line==r.line&&t.ch<=M&&t.ch;return Xe(r.line,K?0:M,r.sticky)}return r}function ra(e,t,r){if(typeof t=="string"&&(t=Pr[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,c=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),c=t(e)!=Re}finally{e.display.shift=n,e.state.suppressEdits=!1}return c}function Nl(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var c=ar(t,e.state.keyMaps[n],r,e);if(c)return c}return e.options.extraKeys&&ar(t,e.options.extraKeys,r,e)||ar(t,e.options.keyMap,r,e)}var Fl=new ee;function Nr(e,t,r,n){var c=e.state.keySeq;if(c){if(so(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==c&&(e.state.keySeq=null,e.display.input.reset())}),co(e,c+" "+t,r,n))return!0}return co(e,t,r,n)}function co(e,t,r,n){var c=Nl(e,t,n);return c=="multi"&&(e.state.keySeq=t),c=="handled"&&xi(e,"keyHandled",e,t,r),(c=="handled"||c=="multi")&&(ie(r),xa(e)),!!c}function fo(e,t){var r=lo(t,!0);return r?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+r,t,function(n){return ra(e,n,!0)})||Nr(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ra(e,n)}):Nr(e,r,t,function(n){return ra(e,n)}):!1}function Ul(e,t,r){return Nr(e,"'"+r+"'",t,function(n){return ra(e,n,!0)})}var ja=null;function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=F(),Ne(t,e))return;G&&W<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=fo(t,e);d&&(ja=n?r:null,!n&&r==88&&!Ut&&(o?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),k&&!o&&!n&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;B(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(C(t,"CodeMirror-crosshair"),ut(document,"keyup",r),ut(document,"mouseover",r))}De(document,"keyup",r),De(document,"mouseover",r)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ne(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(cn(t.display,e)||Ne(t,e)||e.ctrlKey&&!e.altKey||o&&e.metaKey)return;var r=e.keyCode,n=e.charCode;if(d&&r==ja){ja=null,ie(e);return}if(d&&(!e.which||e.which<10)&&fo(t,e))return;var c=String.fromCharCode(n==null?r:n);if(c=="\b")return;if(Ul(t,e,c))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,r){this.time=e,this.pos=t,this.button=r};Ha.prototype.compare=function(e,t,r){return this.time+jl>e&&Ot(t,this.pos)==0&&r==this.button};var Fr,Ur;function Hl(e,t){var r=+new Date;return Ur&&Ur.compare(r,e,t)?(Fr=Ur=null,"triple"):Fr&&Fr.compare(r,e,t)?(Ur=new Ha(r,e,t),Fr=null,"double"):(Fr=new Ha(r,e,t),Ur=null,"single")}function vo(e){var t=this,r=t.display;if(Ne(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,cn(r,e)){i||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(Wa(t,e))return;var n=Fn(t,e),c=Le(e),M=n?Hl(n,c):"single";if(window.focus(),c==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,c,n,M,e))return;c==1?n?Kl(t,n,M,e):ye(e)==r.scroller&&ie(e):c==2?(n&&Zr(t.doc,n),setTimeout(function(){return r.input.focus()},20)):c==3&&(L?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,r,n,c){var M="Click";return n=="double"?M="Double"+M:n=="triple"&&(M="Triple"+M),M=(t==1?"Left":t==2?"Middle":"Right")+M,Nr(e,oo(M,c),c,function(K){if(typeof K=="string"&&(K=Pr[K]),!K)return!1;var Q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Q=K(e,r)!=Re}finally{e.state.suppressEdits=!1}return Q})}function Gl(e,t,r){var n=e.getOption("configureMouse"),c=n?n(e,t,r):{};if(c.unit==null){var M=s?r.shiftKey&&r.metaKey:r.altKey;c.unit=M?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(c.extend==null||e.doc.extend)&&(c.extend=e.doc.extend||r.shiftKey),c.addNew==null&&(c.addNew=o?r.metaKey:r.ctrlKey),c.moveOnDrag==null&&(c.moveOnDrag=!(o?r.altKey:r.ctrlKey)),c}function Kl(e,t,r,n){G?setTimeout(P(gs,e),0):e.curOp.focus=F();var c=Gl(e,r,n),M=e.doc.sel,K;e.options.dragDrop&&Ue&&!e.isReadOnly()&&r=="single"&&(K=M.contains(t))>-1&&(Ot((K=M.ranges[K]).from(),t)<0||t.xRel>0)&&(Ot(K.to(),t)>0||t.xRel<0)?zl(e,n,t,c):Vl(e,n,t,c)}function zl(e,t,r,n){var c=e.display,M=!1,K=gi(e,function(te){i&&(c.scroller.draggable=!1),e.state.draggingText=!1,ut(c.wrapper.ownerDocument,"mouseup",K),ut(c.wrapper.ownerDocument,"mousemove",Q),ut(c.scroller,"dragstart",Z),ut(c.scroller,"drop",K),M||(ie(te),n.addNew||Zr(e.doc,r,null,null,n.extend),i&&!m||G&&W==9?setTimeout(function(){c.wrapper.ownerDocument.body.focus({preventScroll:!0}),c.input.focus()},20):c.input.focus())}),Q=function(te){M=M||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},Z=function(){return M=!0};i&&(c.scroller.draggable=!0),e.state.draggingText=K,K.copy=!n.moveOnDrag,c.scroller.dragDrop&&c.scroller.dragDrop(),De(c.wrapper.ownerDocument,"mouseup",K),De(c.wrapper.ownerDocument,"mousemove",Q),De(c.scroller,"dragstart",Z),De(c.scroller,"drop",K),vs(e),setTimeout(function(){return c.input.focus()},20)}function yo(e,t,r){if(r=="char")return new Xt(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new Xt(Xe(t.line,0),E(e.doc,Xe(t.line+1,0)));var n=r(e,t);return new Xt(n.from,n.to)}function Vl(e,t,r,n){var c=e.display,M=e.doc;ie(t);var K,Q,Z=M.sel,te=Z.ranges;if(n.addNew&&!n.extend?(Q=M.sel.contains(r),Q>-1?K=te[Q]:K=new Xt(r,r)):(K=M.sel.primary(),Q=M.sel.primIndex),n.unit=="rectangle")n.addNew||(K=new Xt(r,r)),r=Fn(e,t,!0,!0),Q=-1;else{var he=yo(e,r,n.unit);n.extend?K=Pa(K,he.anchor,he.head,n.extend):K=he}n.addNew?Q==-1?(Q=te.length,Ai(M,tn(e,te.concat([K]),Q),{scroll:!1,origin:"*mouse"})):te.length>1&&te[Q].empty()&&n.unit=="char"&&!n.extend?(Ai(M,tn(e,te.slice(0,Q).concat(te.slice(Q+1)),0),{scroll:!1,origin:"*mouse"}),Z=M.sel):Na(M,Q,K,Te):(Q=0,Ai(M,new Xi([K],0),Te),Z=M.sel);var pe=r;function Ce(st){if(Ot(pe,st)==0)return;if(pe=st,n.unit=="rectangle"){for(var pt=[],At=e.options.tabSize,xt=Y(ht(M,r.line).text,r.ch,At),kt=Y(ht(M,st.line).text,st.ch,At),Zt=Math.min(xt,kt),yi=Math.max(xt,kt),ii=Math.min(r.line,st.line),Ki=Math.min(e.lastLine(),Math.max(r.line,st.line));ii<=Ki;ii++){var Ui=ht(M,ii).text,oi=Oe(Ui,Zt,At);Zt==yi?pt.push(new Xt(Xe(ii,oi),Xe(ii,oi))):Ui.length>oi&&pt.push(new Xt(Xe(ii,oi),Xe(ii,Oe(Ui,yi,At))))}pt.length||pt.push(new Xt(r,r)),Ai(M,tn(e,Z.ranges.slice(0,Q).concat(pt),Q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(st)}else{var Bi=K,Ti=yo(e,st,n.unit),di=Bi.anchor,li;Ot(Ti.anchor,di)>0?(li=Ti.head,di=yn(Bi.from(),Ti.anchor)):(li=Ti.anchor,di=vn(Bi.to(),Ti.head));var ni=Z.ranges.slice(0);ni[Q]=Xl(e,new Xt(E(M,di),li)),Ai(M,tn(e,ni,Q),Te)}}var we=c.wrapper.getBoundingClientRect(),Fe=0;function Ke(st){var pt=++Fe,At=Fn(e,st,!0,n.unit=="rectangle");if(!At)return;if(Ot(At,pe)!=0){e.curOp.focus=F(),Ce(At);var xt=Vr(c,M);(At.line>=xt.to||At.line<xt.from)&&setTimeout(gi(e,function(){Fe==pt&&Ke(st)}),150)}else{var kt=st.clientY<we.top?-20:st.clientY>we.bottom?20:0;kt&&setTimeout(gi(e,function(){if(Fe!=pt)return;c.scroller.scrollTop+=kt,Ke(st)}),50)}}function Ze(st){e.state.selectingText=!1,Fe=Infinity,st&&(ie(st),c.input.focus()),ut(c.wrapper.ownerDocument,"mousemove",at),ut(c.wrapper.ownerDocument,"mouseup",ft),M.history.lastSelOrigin=null}var at=gi(e,function(st){st.buttons===0||!Le(st)?Ze(st):Ke(st)}),ft=gi(e,Ze);e.state.selectingText=ft,De(c.wrapper.ownerDocument,"mousemove",at),De(c.wrapper.ownerDocument,"mouseup",ft)}function Xl(e,t){var r=t.anchor,n=t.head,c=ht(e.doc,r.line);if(Ot(r,n)==0&&r.sticky==n.sticky)return t;var M=$e(c);if(!M)return t;var K=Ve(M,r.ch,r.sticky),Q=M[K];if(Q.from!=r.ch&&Q.to!=r.ch)return t;var Z=K+(Q.from==r.ch==(Q.level!=1)?0:1);if(Z==0||Z==M.length)return t;var te;if(n.line!=r.line)te=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var he=Ve(M,n.ch,n.sticky),pe=he-K||(n.ch-r.ch)*(Q.level==1?-1:1);he==Z-1||he==Z?te=pe<0:te=pe>0}var Ce=M[Z+(te?-1:0)],we=te==(Ce.level==1),Fe=we?Ce.from:Ce.to,Ke=we?"after":"before";return r.ch==Fe&&r.sticky==Ke?t:new Xt(new Xe(r.line,Fe,Ke),n)}function bo(e,t,r,n){var c,M;if(t.touches)c=t.touches[0].clientX,M=t.touches[0].clientY;else try{c=t.clientX,M=t.clientY}catch(Ce){return!1}if(c>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ie(t);var K=e.display,Q=K.lineDiv.getBoundingClientRect();if(M>Q.bottom||!fe(e,r))return oe(t);M-=Q.top-K.viewOffset;for(var Z=0;Z<e.display.gutterSpecs.length;++Z){var te=K.gutters.childNodes[Z];if(te&&te.getBoundingClientRect().right>=c){var he=ui(e.doc,M),pe=e.display.gutterSpecs[Z];return ke(e,r,e,he,pe.className,t),oe(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(cn(e.display,t)||Yl(e,t))return;if(Ne(e,t,"contextmenu"))return;L||e.display.input.onContextMenu(t)}function Yl(e,t){return fe(e,"gutterContextMenu")?bo(e,t,"gutterContextMenu",!1):!1}function Eo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),yr(e)}var or={toString:function(){return"CodeMirror.Init"}},xo={},aa={};function $l(e){var t=e.optionHandlers;function r(n,c,M,K){e.defaults[n]=c,M&&(t[n]=K?function(Q,Z,te){te!=or&&M(Q,Z,te)}:M)}e.defineOption=r,e.Init=or,r("value","",function(n,c){return n.setValue(c)},!0),r("mode",null,function(n,c){n.doc.modeOption=c,Da(n)},!0),r("indentUnit",2,Da,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){Cr(n),yr(n),Ni(n)},!0),r("lineSeparator",null,function(n,c){if(n.doc.lineSep=c,!c)return;var M=[],K=n.doc.first;n.doc.iter(function(Z){for(var te=0;;){var he=Z.text.indexOf(c,te);if(he==-1)break;te=he+c.length,M.push(Xe(K,he))}K++});for(var Q=M.length-1;Q>=0;Q--)nr(n.doc,c,M[Q],Xe(M[Q].line,M[Q].ch+c.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,c,M){n.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),M!=or&&n.refresh()}),r("specialCharPlaceholder",Qt,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",h?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,c){return n.getInputField().spellcheck=c},!0),r("autocorrect",!1,function(n,c){return n.getInputField().autocorrect=c},!0),r("autocapitalize",!1,function(n,c){return n.getInputField().autocapitalize=c},!0),r("rtlMoveVisually",!A),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){Eo(n),Sr(n)},!0),r("keyMap","default",function(n,c,M){var K=na(c),Q=M!=or&&na(M);Q&&Q.detach&&Q.detach(n,K),K.attach&&K.attach(n,Q||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Ql,!0),r("gutters",[],function(n,c){n.display.gutterSpecs=La(c,n.options.lineNumbers),Sr(n)},!0),r("fixedGutter",!0,function(n,c){n.display.gutters.style.left=c?_a(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return qn(n)},!0),r("scrollbarStyle","native",function(n){Ts(n),qn(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,c){n.display.gutterSpecs=La(n.options.gutters,c),Sr(n)},!0),r("firstLineNumber",1,Sr,!0),r("lineNumberFormatter",function(n){return n},Sr,!0),r("showCursorWhenSelecting",!1,br,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,c){c=="nocursor"&&(Qn(n),n.display.input.blur()),n.display.input.readOnlyChanged(c)}),r("screenReaderLabel",null,function(n,c){c=c===""?null:c,n.display.input.screenReaderLabelChanged(c)}),r("disableInput",!1,function(n,c){c||n.display.input.reset()},!0),r("dragDrop",!0,Jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,br,!0),r("singleCursorHeightPerLine",!0,br,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Cr,!0),r("addModeClass",!1,Cr,!0),r("pollInterval",100),r("undoDepth",200,function(n,c){return n.doc.history.undoDepth=c}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,Cr,!0),r("moveInputWithCursor",!0,function(n,c){c||n.display.input.resetPosition()}),r("tabindex",null,function(n,c){return n.display.input.getField().tabIndex=c||""}),r("autofocus",null),r("direction","ltr",function(n,c){return n.doc.setDirection(c)},!0),r("phrases",null)}function Jl(e,t,r){var n=r&&r!=or;if(!t!=!n){var c=e.display.dragFunctions,M=t?De:ut;M(e.display.scroller,"dragstart",c.start),M(e.display.scroller,"dragenter",c.enter),M(e.display.scroller,"dragover",c.over),M(e.display.scroller,"dragleave",c.leave),M(e.display.scroller,"drop",c.drop)}}function Ql(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(C(e.display.wrapper,"CodeMirror-wrap"),jr(e)),Ea(e),Ni(e),yr(e),setTimeout(function(){return qn(e)},100)}function ti(e,t){var r=this;if(!(this instanceof ti))return new ti(e,t);this.options=t=t?b(t):{},b(xo,t,!1);var n=t.value;typeof n=="string"?n=new Fi(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var c=new ti.inputStyles[t.inputStyle](this),M=this.display=new hl(e,n,c,t);M.wrapper.CodeMirror=this,Eo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ts(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ee,keySeq:null,specialChars:null},t.autofocus&&!h&&M.input.focus(),G&&W<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Zl(this),Rl(),Hn(this),this.curOp.forceUpdate=!0,ks(this,n),t.autofocus&&!h||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&Ta(r)},20):Qn(this);for(var K in aa)aa.hasOwnProperty(K)&&aa[K](this,t[K],or);Cs(this),t.finishInit&&t.finishInit(this);for(var Q=0;Q<Ga.length;++Q)Ga[Q](this);Wn(this),i&&t.lineWrapping&&getComputedStyle(M.lineDiv).textRendering=="optimizelegibility"&&(M.lineDiv.style.textRendering="auto")}ti.defaults=xo,ti.optionHandlers=aa;function Zl(e){var t=e.display;De(t.scroller,"mousedown",gi(e,vo)),G&&W<11?De(t.scroller,"dblclick",gi(e,function(Z){if(Ne(e,Z))return;var te=Fn(e,Z);if(!te||Wa(e,Z)||cn(e.display,Z))return;ie(Z);var he=e.findWordAt(te);Zr(e.doc,he.anchor,he.head)})):De(t.scroller,"dblclick",function(Z){return Ne(e,Z)||ie(Z)}),De(t.scroller,"contextmenu",function(Z){return _o(e,Z)}),De(t.input.getField(),"contextmenu",function(Z){t.scroller.contains(Z.target)||_o(e,Z)});var r,n={end:0};function c(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function M(Z){if(Z.touches.length!=1)return!1;var te=Z.touches[0];return te.radiusX<=1&&te.radiusY<=1}function K(Z,te){if(te.left==null)return!0;var he=te.left-Z.left,pe=te.top-Z.top;return he*he+pe*pe>20*20}De(t.scroller,"touchstart",function(Z){if(!Ne(e,Z)&&!M(Z)&&!Wa(e,Z)){t.input.ensurePolled(),clearTimeout(r);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-n.end<=300?n:null},Z.touches.length==1&&(t.activeTouch.left=Z.touches[0].pageX,t.activeTouch.top=Z.touches[0].pageY)}}),De(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),De(t.scroller,"touchend",function(Z){var te=t.activeTouch;if(te&&!cn(t,Z)&&te.left!=null&&!te.moved&&new Date-te.start<300){var he=e.coordsChar(t.activeTouch,"page"),pe;!te.prev||K(te,te.prev)?pe=new Xt(he,he):!te.prev.prev||K(te,te.prev.prev)?pe=e.findWordAt(he):pe=new Xt(Xe(he.line,0),E(e.doc,Xe(he.line+1,0))),e.setSelection(pe.anchor,pe.head),e.focus(),ie(Z)}c()}),De(t.scroller,"touchcancel",c),De(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Er(e,t.scroller.scrollTop),Bn(e,t.scroller.scrollLeft,!0),ke(e,"scroll",e))}),De(t.scroller,"mousewheel",function(Z){return Rs(e,Z)}),De(t.scroller,"DOMMouseScroll",function(Z){return Rs(e,Z)}),De(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Z){Ne(e,Z)||de(Z)},over:function(Z){Ne(e,Z)||(Ol(e,Z),de(Z))},start:function(Z){return Al(e,Z)},drop:gi(e,Cl),leave:function(Z){Ne(e,Z)||no(e)}};var Q=t.input.getField();De(Q,"keyup",function(Z){return mo.call(e,Z)}),De(Q,"keydown",gi(e,po)),De(Q,"keypress",gi(e,go)),De(Q,"focus",function(Z){return Ta(e,Z)}),De(Q,"blur",function(Z){return Qn(e,Z)})}var Ga=[];ti.defineInitHook=function(e){return Ga.push(e)};function Br(e,t,r,n){var c=e.doc,M;r==null&&(r="add"),r=="smart"&&(c.mode.indent?M=it(e,t).state:r="prev");var K=e.options.tabSize,Q=ht(c,t),Z=Y(Q.text,null,K);Q.stateAfter&&(Q.stateAfter=null);var te=Q.text.match(/^\s*/)[0],he;if(!n&&!/\S/.test(Q.text))he=0,r="not";else if(r=="smart"&&(he=c.mode.indent(M,Q.text.slice(te.length),Q.text),he==Re||he>150)){if(!n)return;r="prev"}r=="prev"?t>c.first?he=Y(ht(c,t-1).text,null,K):he=0:r=="add"?he=Z+e.options.indentUnit:r=="subtract"?he=Z-e.options.indentUnit:typeof r=="number"&&(he=Z+r),he=Math.max(0,he);var pe="",Ce=0;if(e.options.indentWithTabs)for(var we=Math.floor(he/K);we;--we)Ce+=K,pe+=" ";if(Ce<he&&(pe+=ue(he-Ce)),pe!=te)return nr(c,pe,Xe(t,0),Xe(t,te.length),"+input"),Q.stateAfter=null,!0;for(var Fe=0;Fe<c.sel.ranges.length;Fe++){var Ke=c.sel.ranges[Fe];if(Ke.head.line==t&&Ke.head.ch<te.length){var Ze=Xe(t,te.length);Na(c,Fe,new Xt(Ze,Ze));break}}}var nn=null;function sa(e){nn=e}function Ka(e,t,r,n,c){var M=e.doc;e.display.shift=!1,n||(n=M.sel);var K=+new Date-200,Q=c=="paste"||e.state.pasteIncoming>K,Z=yt(t),te=null;if(Q&&n.ranges.length>1)if(nn&&nn.text.join(`
|
|
`)==t){if(n.ranges.length%nn.text.length==0){te=[];for(var he=0;he<nn.text.length;he++)te.push(M.splitLines(nn.text[he]))}}else Z.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(te=qe(Z,function(at){return[at]}));for(var pe=e.curOp.updateInput,Ce=n.ranges.length-1;Ce>=0;Ce--){var we=n.ranges[Ce],Fe=we.from(),Ke=we.to();we.empty()&&(r&&r>0?Fe=Xe(Fe.line,Fe.ch-r):e.state.overwrite&&!Q?Ke=Xe(Ke.line,Math.min(ht(M,Ke.line).text.length,Ke.ch+Pe(Z).length)):Q&&nn&&nn.lineWise&&nn.text.join(`
|
|
`)==Z.join(`
|
|
`)&&(Fe=Ke=Xe(Fe.line,0)));var Ze={from:Fe,to:Ke,text:te?te[Ce%te.length]:Z,origin:c||(Q?"paste":e.state.cutIncoming>K?"cut":"+input")};ir(e.doc,Ze),xi(e,"inputRead",e,Ze)}t&&!Q&&wo(e,t),Zn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=pe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Gi(t,function(){return Ka(t,r,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var c=r.ranges[n];if(c.head.ch>100||n&&r.ranges[n-1].head.line==c.head.line)continue;var M=e.getModeAt(c.head),K=!1;if(M.electricChars){for(var Q=0;Q<M.electricChars.length;Q++)if(t.indexOf(M.electricChars.charAt(Q))>-1){K=Br(e,c.head.line,"smart");break}}else M.electricInput&&(M.electricInput.test(ht(e.doc,c.head.line).text.slice(0,c.head.ch))&&(K=Br(e,c.head.line,"smart")));K&&xi(e,"electricInput",e,c.head.line)}}function So(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var c=e.doc.sel.ranges[n].head.line,M={anchor:Xe(c,0),head:Xe(c+1,0)};r.push(M),t.push(e.getRange(M.anchor,M.head))}return{text:t,ranges:r}}function Co(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ao(){var e=p("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=p("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return i?e.style.width="1000px":e.setAttribute("wrap","off"),f&&(e.style.border="1px solid black"),Co(e),t}function ql(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,c){var M=this.options,K=M[n];if(M[n]==c&&n!="mode")return;M[n]=c,t.hasOwnProperty(n)&&gi(this,t[n])(this,c,K),ke(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,c){this.state.keyMaps[c?"push":"unshift"](na(n))},removeKeyMap:function(n){for(var c=this.state.keyMaps,M=0;M<c.length;++M)if(c[M]==n||c[M].name==n)return c.splice(M,1),!0},addOverlay:Li(function(n,c){var M=n.token?n:e.getMode(this.options,n);if(M.startState)throw new Error("Overlays may not be stateful.");ze(this.state.overlays,{mode:M,modeSpec:n,opaque:c&&c.opaque,priority:c&&c.priority||0},function(K){return K.priority}),this.state.modeGen++,Ni(this)}),removeOverlay:Li(function(n){for(var c=this.state.overlays,M=0;M<c.length;++M){var K=c[M].modeSpec;if(K==n||typeof n=="string"&&K.name==n){c.splice(M,1),this.state.modeGen++,Ni(this);return}}}),indentLine:Li(function(n,c,M){typeof c!="string"&&typeof c!="number"&&(c==null?c=this.options.smartIndent?"smart":"prev":c=c?"add":"subtract"),ki(this.doc,n)&&Br(this,n,c,M)}),indentSelection:Li(function(n){for(var c=this.doc.sel.ranges,M=-1,K=0;K<c.length;K++){var Q=c[K];if(Q.empty())Q.head.line>M&&(Br(this,Q.head.line,n,!0),M=Q.head.line,K==this.doc.sel.primIndex&&Zn(this));else{var Z=Q.from(),te=Q.to(),he=Math.max(M,Z.line);M=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var pe=he;pe<M;++pe)Br(this,pe,n);var Ce=this.doc.sel.ranges;Z.ch==0&&c.length==Ce.length&&Ce[K].from().ch>0&&Na(this.doc,K,new Xt(Z,Ce[K].to()),Ee)}}}),getTokenAt:function(n,c){return qt(this,n,c)},getLineTokens:function(n,c){return qt(this,Xe(n),c,!0)},getTokenTypeAt:function(n){n=E(this.doc,n);var c=je(this,ht(this.doc,n.line)),M=0,K=(c.length-1)/2,Q=n.ch,Z;if(Q==0)Z=c[2];else for(;;){var te=M+K>>1;if((te?c[te*2-1]:0)>=Q)K=te;else if(c[te*2+1]<Q)M=te+1;else{Z=c[te*2+2];break}}var he=Z?Z.indexOf("overlay "):-1;return he<0?Z:he==0?null:Z.slice(0,he-1)},getModeAt:function(n){var c=this.doc.mode;return c.innerMode?e.innerMode(c,this.getTokenAt(n).state).mode:c},getHelper:function(n,c){return this.getHelpers(n,c)[0]},getHelpers:function(n,c){var M=[];if(!r.hasOwnProperty(c))return M;var K=r[c],Q=this.getModeAt(n);if(typeof Q[c]=="string")K[Q[c]]&&M.push(K[Q[c]]);else if(Q[c])for(var Z=0;Z<Q[c].length;Z++){var te=K[Q[c][Z]];te&&M.push(te)}else Q.helperType&&K[Q.helperType]?M.push(K[Q.helperType]):K[Q.name]&&M.push(K[Q.name]);for(var he=0;he<K._global.length;he++){var pe=K._global[he];pe.pred(Q,this)&&ae(M,pe.val)==-1&&M.push(pe.val)}return M},getStateAfter:function(n,c){var M=this.doc;return n=V(M,n==null?M.first+M.size-1:n),it(this,n+1,c).state},cursorCoords:function(n,c){var M,K=this.doc.sel.primary();return n==null?M=K.head:typeof n=="object"?M=E(this.doc,n):M=n?K.from():K.to(),en(this,M,c||"page")},charCoords:function(n,c){return ma(this,E(this.doc,n),c||"page")},coordsChar:function(n,c){return n=ls(this,n,c||"page"),va(this,n.left,n.top)},lineAtHeight:function(n,c){return n=ls(this,{top:n,left:0},c||"page").top,ui(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,c,M){var K=!1,Q;if(typeof n=="number"){var Z=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>Z&&(n=Z,K=!0),Q=ht(this.doc,n)}else Q=n;return Wr(this,Q,{top:0,left:0},c||"page",M||K).top+(K?this.doc.height-qi(Q):0)},defaultTextHeight:function(){return $n(this.display)},defaultCharWidth:function(){return Jn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,c,M,K,Q){var Z=this.display;n=en(this,E(this.doc,n));var te=n.bottom,he=n.left;if(c.style.position="absolute",c.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(c),Z.sizer.appendChild(c),K=="over")te=n.top;else if(K=="above"||K=="near"){var pe=Math.max(Z.wrapper.clientHeight,this.doc.height),Ce=Math.max(Z.sizer.clientWidth,Z.lineSpace.clientWidth);(K=="above"||n.bottom+c.offsetHeight>pe)&&n.top>c.offsetHeight?te=n.top-c.offsetHeight:n.bottom+c.offsetHeight<=pe&&(te=n.bottom),he+c.offsetWidth>Ce&&(he=Ce-c.offsetWidth)}c.style.top=te+"px",c.style.left=c.style.right="",Q=="right"?(he=Z.sizer.clientWidth-c.offsetWidth,c.style.right="0px"):(Q=="left"?he=0:Q=="middle"&&(he=(Z.sizer.clientWidth-c.offsetWidth)/2),c.style.left=he+"px"),M&&Jo(this,{left:he,top:te,right:he+c.offsetWidth,bottom:te+c.offsetHeight})},triggerOnKeyDown:Li(po),triggerOnKeyPress:Li(go),triggerOnKeyUp:mo,triggerOnMouseDown:Li(vo),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:Li(function(n){wo(this,n)}),findPosH:function(n,c,M,K){var Q=1;c<0&&(Q=-1,c=-c);for(var Z=E(this.doc,n),te=0;te<c&&!(Z=za(this.doc,Z,Q,M,K),Z.hitSide);++te);return Z},moveH:Li(function(n,c){var M=this;this.extendSelectionsBy(function(K){return M.display.shift||M.doc.extend||K.empty()?za(M.doc,K.head,n,c,M.options.rtlMoveVisually):n<0?K.from():K.to()},Ae)}),deleteH:Li(function(n,c){var M=this.doc.sel,K=this.doc;M.somethingSelected()?K.replaceSelection("",null,"+delete"):sr(this,function(Q){var Z=za(K,Q.head,n,c,!1);return n<0?{from:Z,to:Q.head}:{from:Q.head,to:Z}})}),findPosV:function(n,c,M,K){var Q=1,Z=K;c<0&&(Q=-1,c=-c);for(var te=E(this.doc,n),he=0;he<c;++he){var pe=en(this,te,"div");if(Z==null?Z=pe.left:pe.left=Z,te=Oo(this,pe,Q,M),te.hitSide)break}return te},moveV:Li(function(n,c){var M=this,K=this.doc,Q=[],Z=!this.display.shift&&!K.extend&&K.sel.somethingSelected();if(K.extendSelectionsBy(function(he){if(Z)return n<0?he.from():he.to();var pe=en(M,he.head,"div");he.goalColumn!=null&&(pe.left=he.goalColumn),Q.push(pe.left);var Ce=Oo(M,pe,n,c);return c=="page"&&he==K.sel.primary()&&Sa(M,ma(M,Ce,"div").top-pe.top),Ce},Ae),Q.length)for(var te=0;te<K.sel.ranges.length;te++)K.sel.ranges[te].goalColumn=Q[te]}),findWordAt:function(n){var c=this.doc,M=ht(c,n.line).text,K=n.ch,Q=n.ch;if(M){var Z=this.getHelper(n,"wordChars");(n.sticky=="before"||Q==M.length)&&K?--K:++Q;for(var te=M.charAt(K),he=Ge(te,Z)?function(pe){return Ge(pe,Z)}:/\s/.test(te)?function(pe){return/\s/.test(pe)}:function(pe){return!/\s/.test(pe)&&!Ge(pe)};K>0&&he(M.charAt(K-1));)--K;for(;Q<M.length&&he(M.charAt(Q));)++Q}return new Xt(Xe(n.line,K),Xe(n.line,Q))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):C(this.display.cursorDiv,"CodeMirror-overwrite"),ke(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==F()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Li(function(n,c){_r(this,n,c)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-sn(this)-this.display.barHeight,width:n.scrollWidth-sn(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:Pn(this)}},scrollIntoView:Li(function(n,c){n==null?(n={from:this.doc.sel.primary().head,to:null},c==null&&(c=this.options.cursorScrollMargin)):typeof n=="number"?n={from:Xe(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=c||0,n.from.line!=null?Qo(this,n):bs(this,n.from,n.to,n.margin)}),setSize:Li(function(n,c){var M=this,K=function(Z){return typeof Z=="number"||/^\d+$/.test(String(Z))?Z+"px":Z};n!=null&&(this.display.wrapper.style.width=K(n)),c!=null&&(this.display.wrapper.style.height=K(c)),this.options.lineWrapping&&as(this);var Q=this.display.viewFrom;this.doc.iter(Q,this.display.viewTo,function(Z){if(Z.widgets){for(var te=0;te<Z.widgets.length;te++)if(Z.widgets[te].noHScroll){wn(M,Q,"widget");break}}++Q}),this.curOp.forceUpdate=!0,ke(this,"refresh",this)}),operation:function(n){return Gi(this,n)},startOperation:function(){return Hn(this)},endOperation:function(){return Wn(this)},refresh:Li(function(){var n=this.display.cachedTextHeight;Ni(this),this.curOp.forceUpdate=!0,yr(this),_r(this,this.doc.scrollLeft,this.doc.scrollTop),Oa(this.display),(n==null||Math.abs(n-$n(this.display))>.5||this.options.lineWrapping)&&Ea(this),ke(this,"refresh",this)}),swapDoc:Li(function(n){var c=this.doc;return c.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,n),yr(this),this.display.input.reset(),_r(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,xi(this,"swapDoc",this,c),c}),phrase:function(n){var c=this.options.phrases;return c&&Object.prototype.hasOwnProperty.call(c,n)?c[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ve(e),e.registerHelper=function(n,c,M){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][c]=M},e.registerGlobalHelper=function(n,c,M,K){e.registerHelper(n,c,K),r[n]._global.push({pred:M,val:K})}}function za(e,t,r,n,c){var M=t,K=r,Q=ht(e,t.line),Z=c&&e.direction=="rtl"?-r:r;function te(){var ft=t.line+Z;return ft<e.first||ft>=e.first+e.size?!1:(t=new Xe(ft,t.ch,t.sticky),Q=ht(e,ft))}function he(ft){var st;if(n=="codepoint"){var pt=Q.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(pt)?st=null:st=new Xe(t.line,Math.max(0,Math.min(Q.text.length,t.ch+r*(pt>=55296&&pt<56320?2:1))),-r)}else c?st=Ml(e.cm,Q,t,r):st=Ua(Q,t,r);if(st==null)if(!ft&&te())t=Ba(c,e.cm,Q,t.line,Z);else return!1;else t=st;return!0}if(n=="char"||n=="codepoint")he();else if(n=="column")he(!0);else if(n=="word"||n=="group")for(var pe=null,Ce=n=="group",we=e.cm&&e.cm.getHelper(t,"wordChars"),Fe=!0;!(r<0&&!he(!Fe));Fe=!1){var Ke=Q.text.charAt(t.ch)||`
|
|
`,Ze=Ge(Ke,we)?"w":Ce&&Ke==`
|
|
`?"n":!Ce||/\s/.test(Ke)?null:"p";if(Ce&&!Fe&&!Ze&&(Ze="s"),pe&&pe!=Ze){r<0&&(r=1,he(),t.sticky="after");break}if(Ze&&(pe=Ze),r>0&&!he(!Fe))break}var at=ea(e,t,M,K,!0);return mn(M,at)&&(at.hitSide=!0),at}function Oo(e,t,r,n){var c=e.doc,M=t.left,K;if(n=="page"){var Q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Z=Math.max(Q-.5*$n(e.display),3);K=(r>0?t.bottom:t.top)+r*Z}else n=="line"&&(K=r>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,M,K),!te.outside);){if(r<0?K<=0:K>=c.height){te.hitSide=!0;break}K+=r*5}return te}var $t=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};$t.prototype.init=function(e){var t=this,r=this,n=r.cm,c=r.div=e.lineDiv;Co(c,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function M(Q){for(var Z=Q.target;Z;Z=Z.parentNode){if(Z==c)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Z.className))break}return!1}De(c,"paste",function(Q){if(!M(Q)||Ne(n,Q)||To(Q,n))return;W<=11&&setTimeout(gi(n,function(){return t.updateFromDOM()}),20)}),De(c,"compositionstart",function(Q){t.composing={data:Q.data,done:!1}}),De(c,"compositionupdate",function(Q){t.composing||(t.composing={data:Q.data,done:!1})}),De(c,"compositionend",function(Q){t.composing&&(Q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),De(c,"touchstart",function(){return r.forceCompositionEnd()}),De(c,"input",function(){t.composing||t.readFromDOMSoon()});function K(Q){if(!M(Q)||Ne(n,Q))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()}),Q.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var Z=So(n);sa({lineWise:!0,text:Z.text}),Q.type=="cut"&&n.operation(function(){n.setSelections(Z.ranges,0,Ee),n.replaceSelection("",null,"cut")})}else return;if(Q.clipboardData){Q.clipboardData.clearData();var te=nn.text.join(`
|
|
`);if(Q.clipboardData.setData("Text",te),Q.clipboardData.getData("Text")==te){Q.preventDefault();return}}var he=Ao(),pe=he.firstChild;n.display.lineSpace.insertBefore(he,n.display.lineSpace.firstChild),pe.value=nn.text.join(`
|
|
`);var Ce=document.activeElement;j(pe),setTimeout(function(){n.display.lineSpace.removeChild(he),Ce.focus(),Ce==c&&r.showPrimarySelection()},50)}De(c,"copy",K),De(c,"cut",K)},$t.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},$t.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},$t.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},$t.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},$t.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),c=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||c.line<t.display.viewFrom){e.removeAllRanges();return}var M=oa(t,e.anchorNode,e.anchorOffset),K=oa(t,e.focusNode,e.focusOffset);if(M&&!M.bad&&K&&!K.bad&&Ot(yn(M,K),n)==0&&Ot(vn(M,K),c)==0)return;var Q=t.display.view,Z=n.line>=t.display.viewFrom&&Ro(t,n)||{node:Q[0].measure.map[2],offset:0},te=c.line<t.display.viewTo&&Ro(t,c);if(!te){var he=Q[Q.length-1].measure,pe=he.maps?he.maps[he.maps.length-1]:he.map;te={node:pe[pe.length-1],offset:pe[pe.length-2]-pe[pe.length-3]}}if(!Z||!te){e.removeAllRanges();return}var Ce=e.rangeCount&&e.getRangeAt(0),we;try{we=v(Z.node,Z.offset,te.offset,te.node)}catch(Fe){}we&&(!k&&t.state.focused?(e.collapse(Z.node,Z.offset),we.collapsed||(e.removeAllRanges(),e.addRange(we))):(e.removeAllRanges(),e.addRange(we)),Ce&&e.anchorNode==null?e.addRange(Ce):k&&this.startGracePeriod()),this.rememberSelection()},$t.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)},$t.prototype.showMultipleSelections=function(e){x(this.cm.display.cursorDiv,e.cursors),x(this.cm.display.selectionDiv,e.selection)},$t.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},$t.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return y(this.div,t)},$t.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},$t.prototype.blur=function(){this.div.blur()},$t.prototype.getField=function(){return this.div},$t.prototype.supportsTouch=function(){return!0},$t.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Gi(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)},$t.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},$t.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(l&&g&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var r=oa(t,e.anchorNode,e.anchorOffset),n=oa(t,e.focusNode,e.focusOffset);r&&n&&Gi(t,function(){Ai(t.doc,Cn(r,n),Ee),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},$t.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),c=r.to();if(n.ch==0&&n.line>e.firstLine()&&(n=Xe(n.line-1,ht(e.doc,n.line-1).length)),c.ch==ht(e.doc,c.line).text.length&&c.line<e.lastLine()&&(c=Xe(c.line+1,0)),n.line<t.viewFrom||c.line>t.viewTo-1)return!1;var M,K,Q;n.line==t.viewFrom||(M=Un(e,n.line))==0?(K=It(t.view[0].line),Q=t.view[0].node):(K=It(t.view[M].line),Q=t.view[M-1].node.nextSibling);var Z=Un(e,c.line),te,he;if(Z==t.view.length-1?(te=t.viewTo-1,he=t.lineDiv.lastChild):(te=It(t.view[Z+1].line)-1,he=t.view[Z+1].node.previousSibling),!Q)return!1;for(var pe=e.doc.splitLines(tu(e,Q,he,K,te)),Ce=_i(e.doc,Xe(K,0),Xe(te,ht(e.doc,te).text.length));pe.length>1&&Ce.length>1;)if(Pe(pe)==Pe(Ce))pe.pop(),Ce.pop(),te--;else if(pe[0]==Ce[0])pe.shift(),Ce.shift(),K++;else break;for(var we=0,Fe=0,Ke=pe[0],Ze=Ce[0],at=Math.min(Ke.length,Ze.length);we<at&&Ke.charCodeAt(we)==Ze.charCodeAt(we);)++we;for(var ft=Pe(pe),st=Pe(Ce),pt=Math.min(ft.length-(pe.length==1?we:0),st.length-(Ce.length==1?we:0));Fe<pt&&ft.charCodeAt(ft.length-Fe-1)==st.charCodeAt(st.length-Fe-1);)++Fe;if(pe.length==1&&Ce.length==1&&K==n.line)for(;we&&we>n.ch&&ft.charCodeAt(ft.length-Fe-1)==st.charCodeAt(st.length-Fe-1);)we--,Fe++;pe[pe.length-1]=ft.slice(0,ft.length-Fe).replace(/^\u200b+/,""),pe[0]=pe[0].slice(we).replace(/\u200b+$/,"");var At=Xe(K,we),xt=Xe(te,Ce.length?Pe(Ce).length-Fe:0);if(pe.length>1||pe[0]||Ot(At,xt))return nr(e.doc,pe,At,xt,"+input"),!0},$t.prototype.ensurePolled=function(){this.forceCompositionEnd()},$t.prototype.reset=function(){this.forceCompositionEnd()},$t.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},$t.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)},$t.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Gi(this.cm,function(){return Ni(e.cm)})},$t.prototype.setUneditable=function(e){e.contentEditable="false"},$t.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||gi(this.cm,Ka)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},$t.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},$t.prototype.onContextMenu=function(){},$t.prototype.resetPosition=function(){},$t.prototype.needsContentAttribute=!0;function Ro(e,t){var r=fa(e,t.line);if(!r||r.hidden)return null;var n=ht(e.doc,t.line),c=es(r,n,t.line),M=$e(n,e.doc.direction),K="left";if(M){var Q=Ve(M,t.ch);K=Q%2?"right":"left"}var Z=ns(c.map,t.ch,K);return Z.offset=Z.collapse=="right"?Z.end:Z.start,Z}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function lr(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,n,c){var M="",K=!1,Q=e.doc.lineSeparator(),Z=!1;function te(we){return function(Fe){return Fe.id==we}}function he(){K&&(M+=Q,Z&&(M+=Q),K=Z=!1)}function pe(we){we&&(he(),M+=we)}function Ce(we){if(we.nodeType==1){var Fe=we.getAttribute("cm-text");if(Fe){pe(Fe);return}var Ke=we.getAttribute("cm-marker"),Ze;if(Ke){var at=e.findMarks(Xe(n,0),Xe(c+1,0),te(+Ke));at.length&&(Ze=at[0].find(0))&&pe(_i(e.doc,Ze.from,Ze.to).join(Q));return}if(we.getAttribute("contenteditable")=="false")return;var ft=/^(pre|div|p|li|table|br)$/i.test(we.nodeName);if(!/^br$/i.test(we.nodeName)&&we.textContent.length==0)return;ft&&he();for(var st=0;st<we.childNodes.length;st++)Ce(we.childNodes[st]);/^(pre|p)$/i.test(we.nodeName)&&(Z=!0),ft&&(K=!0)}else we.nodeType==3&&pe(we.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ce(t),t==r);)t=t.nextSibling,Z=!1;return M}function oa(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return lr(e.clipPos(Xe(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var c=0;c<e.display.view.length;c++){var M=e.display.view[c];if(M.node==n)return iu(M,t,r)}}function iu(e,t,r){var n=e.text.firstChild,c=!1;if(!t||!y(n,t))return lr(Xe(It(e.line),0),!0);if(t==n&&(c=!0,t=n.childNodes[r],r=0,!t)){var M=e.rest?Pe(e.rest):e.line;return lr(Xe(It(M),M.text.length),c)}var K=t.nodeType==3?t:null,Q=t;for(!K&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(K=t.firstChild,r&&(r=K.nodeValue.length));Q.parentNode!=n;)Q=Q.parentNode;var Z=e.measure,te=Z.maps;function he(Ze,at,ft){for(var st=-1;st<(te?te.length:0);st++)for(var pt=st<0?Z.map:te[st],At=0;At<pt.length;At+=3){var xt=pt[At+2];if(xt==Ze||xt==at){var kt=It(st<0?e.line:e.rest[st]),Zt=pt[At]+ft;return(ft<0||xt!=Ze)&&(Zt=pt[At+(ft?1:0)]),Xe(kt,Zt)}}}var pe=he(K,Q,r);if(pe)return lr(pe,c);for(var Ce=Q.nextSibling,we=K?K.nodeValue.length-r:0;Ce;Ce=Ce.nextSibling){if(pe=he(Ce,Ce.firstChild,0),pe)return lr(Xe(pe.line,pe.ch-we),c);we+=Ce.textContent.length}for(var Fe=Q.previousSibling,Ke=r;Fe;Fe=Fe.previousSibling){if(pe=he(Fe,Fe.firstChild,-1),pe)return lr(Xe(pe.line,pe.ch+Ke),c);Ke+=Fe.textContent.length}}var ai=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ee,this.hasSelection=!1,this.composing=null};ai.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var c=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),f&&(c.style.width="0px"),De(c,"input",function(){G&&W>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),De(c,"paste",function(K){if(Ne(n,K)||To(K,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function M(K){if(Ne(n,K))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var Q=So(n);sa({lineWise:!0,text:Q.text}),K.type=="cut"?n.setSelections(Q.ranges,null,Ee):(r.prevInput="",c.value=Q.text.join(`
|
|
`),j(c))}else return;K.type=="cut"&&(n.state.cutIncoming=+new Date)}De(c,"cut",M),De(c,"copy",M),De(e.scroller,"paste",function(K){if(cn(e,K)||Ne(n,K))return;if(!c.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var Q=new Event("paste");Q.clipboardData=K.clipboardData,c.dispatchEvent(Q)}),De(e.lineSpace,"selectstart",function(K){cn(e,K)||ie(K)}),De(c,"compositionstart",function(){var K=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:K,range:n.markText(K,n.getCursor("to"),{className:"CodeMirror-composing"})}}),De(c,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},ai.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},ai.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ai.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=ps(e);if(e.options.moveInputWithCursor){var c=en(e,r.sel.primary().head,"div"),M=t.wrapper.getBoundingClientRect(),K=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,c.top+K.top-M.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,c.left+K.left-M.left))}return n},ai.prototype.showSelection=function(e){var t=this.cm,r=t.display;x(r.cursorDiv,e.cursors),x(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ai.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&j(this.textarea),G&&W>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",G&&W>=9&&(this.hasSelection=null))},ai.prototype.getField=function(){return this.textarea},ai.prototype.supportsTouch=function(){return!1},ai.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!h||F()!=this.textarea))try{this.textarea.focus()}catch(e){}},ai.prototype.blur=function(){this.textarea.blur()},ai.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ai.prototype.receivedFocus=function(){this.slowPoll()},ai.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()})},ai.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},ai.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||tt(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var c=r.value;if(c==n&&!t.somethingSelected())return!1;if(G&&W>=9&&this.hasSelection===c||o&&/[\uf700-\uf7ff]/.test(c))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var M=c.charCodeAt(0);if(M==8203&&!n&&(n="\u200B"),M==8666)return this.reset(),this.cm.execCommand("undo")}for(var K=0,Q=Math.min(n.length,c.length);K<Q&&n.charCodeAt(K)==c.charCodeAt(K);)++K;return Gi(t,function(){Ka(t,c.slice(K),n.length-K,null,e.composing?"*compose":null),c.length>1e3||c.indexOf(`
|
|
`)>-1?r.value=e.prevInput="":e.prevInput=c,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ai.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ai.prototype.onKeyPress=function(){G&&W>=9&&(this.hasSelection=null),this.fastPoll()},ai.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,c=t.textarea;t.contextMenuPending&&t.contextMenuPending();var M=Fn(r,e),K=n.scroller.scrollTop;if(!M||d)return;var Q=r.options.resetSelectionOnContextMenu;Q&&r.doc.sel.contains(M)==-1&&gi(r,Ai)(r.doc,Cn(M),Ee);var Z=c.style.cssText,te=t.wrapper.style.cssText,he=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",c.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-he.top-5)+"px; left: "+(e.clientX-he.left-5)+`px;
|
|
z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var pe;i&&(pe=window.scrollY),n.input.focus(),i&&window.scrollTo(null,pe),n.input.reset(),r.somethingSelected()||(c.value=t.prevInput=" "),t.contextMenuPending=we,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function Ce(){if(c.selectionStart!=null){var Ke=r.somethingSelected(),Ze="\u200B"+(Ke?c.value:"");c.value="\u21DA",c.value=Ze,t.prevInput=Ke?"":"\u200B",c.selectionStart=1,c.selectionEnd=Ze.length,n.selForContextMenu=r.doc.sel}}function we(){if(t.contextMenuPending!=we)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,c.style.cssText=Z,G&&W<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=K),c.selectionStart!=null){(!G||G&&W<9)&&Ce();var Ke=0,Ze=function(){n.selForContextMenu==r.doc.sel&&c.selectionStart==0&&c.selectionEnd>0&&t.prevInput=="\u200B"?gi(r,Vs)(r):Ke++<10?n.detectingSelectAll=setTimeout(Ze,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Ze,200)}}if(G&&W>=9&&Ce(),L){de(e);var Fe=function(){ut(window,"mouseup",Fe),setTimeout(we,20)};De(window,"mouseup",Fe)}else setTimeout(we,50)},ai.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ai.prototype.setUneditable=function(){},ai.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?b(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=F();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=Q.getValue()}var c;if(e.form&&(De(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var M=e.form;c=M.submit;try{var K=M.submit=function(){n(),M.submit=c,M.submit(),M.submit=K}}catch(Z){}}t.finishInit=function(Z){Z.save=n,Z.getTextArea=function(){return e},Z.toTextArea=function(){Z.toTextArea=isNaN,n(),e.parentNode.removeChild(Z.getWrapperElement()),e.style.display="",e.form&&(ut(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=c))}},e.style.display="none";var Q=ti(function(Z){return e.parentNode.insertBefore(Z,e.nextSibling)},t);return Q}function ru(e){e.off=ut,e.on=De,e.wheelEventPixels=dl,e.Doc=Fi,e.splitLines=yt,e.countColumn=Y,e.findColumn=Oe,e.isWordChar=Me,e.Pass=Re,e.signal=ke,e.Line=Mn,e.changeEnd=An,e.scrollbarModel=xs,e.Pos=Xe,e.cmpPos=Ot,e.modes=ei,e.mimeModes=Dt,e.resolveMode=bt,e.getMode=fi,e.modeExtensions=_t,e.extendMode=wt,e.copyState=Bt,e.startState=Mt,e.innerMode=Lt,e.commands=Pr,e.keyMap=fn,e.keyName=lo,e.isModifierKey=so,e.lookupKey=ar,e.normalizeKeyMap=kl,e.StringStream=Et,e.SharedTextMarker=Dr,e.TextMarker=Rn,e.LineWidget=Ir,e.e_preventDefault=ie,e.e_stopPropagation=re,e.e_stop=de,e.addClass=B,e.contains=y,e.rmClass=C,e.keyNames=Ln}$l(ti),ql(ti);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Fi.prototype)Fi.prototype.hasOwnProperty(la)&&ae(au,la)<0&&(ti.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Fi.prototype[la]));return ve(Fi),ti.inputStyles={textarea:ai,contenteditable:$t},ti.defineMode=function(e){!ti.defaults.mode&&e!="null"&&(ti.defaults.mode=e),ci.apply(this,arguments)},ti.defineMIME=Di,ti.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ti.defineMIME("text/plain","null"),ti.defineExtension=function(e,t){ti.prototype[e]=t},ti.defineDocExtension=function(e,t){Fi.prototype[e]=t},ti.fromTextArea=nu,ru(ti),ti.version="5.58.2",ti})},Y1PL:function(ot,ge,J){"use strict";J.r(ge),J.d(ge,"ResizableTextArea",function(){return ae});var ne=J("wx14"),$=J("1OyB"),k=J("vuIU"),X=J("Ji7U"),N=J("LK+K"),U=J("q1tI"),G=J("VTBJ"),W=J("rePB"),i=J("Zm9Q"),D=J("Kwbf"),g=J("c+Xe"),d=J("m+aA"),m=J("bdgK"),u=new Map;function a(Ee){Ee.forEach(function(Te){var Ae,Oe=Te.target;(Ae=u.get(Oe))===null||Ae===void 0||Ae.forEach(function(ce){return ce(Oe)})})}var f=new m.default(a),l=null,h=null;function o(Ee,Te){u.has(Ee)||(u.set(Ee,new Set),f.observe(Ee)),u.get(Ee).add(Te)}function s(Ee,Te){u.has(Ee)&&(u.get(Ee).delete(Te),u.get(Ee).size||(f.unobserve(Ee),u.delete(Ee)))}var A=function(Ee){Object(X.a)(Ae,Ee);var Te=Object(N.a)(Ae);function Ae(){return Object($.a)(this,Ae),Te.apply(this,arguments)}return Object(k.a)(Ae,[{key:"render",value:function(){return this.props.children}}]),Ae}(U.Component),_=U.createContext(null);function w(Ee){var Te=Ee.children,Ae=Ee.onBatchResize,Oe=U.useRef(0),ce=U.useRef([]),ue=U.useContext(_),Pe=U.useCallback(function(qe,ze,et){Oe.current+=1;var nt=Oe.current;ce.current.push({size:qe,element:ze,data:et}),Promise.resolve().then(function(){nt===Oe.current&&(Ae==null||Ae(ce.current),ce.current=[])}),ue==null||ue(qe,ze,et)},[Ae,ue]);return U.createElement(_.Provider,{value:Pe},Te)}function L(Ee){var Te=Ee.children,Ae=Ee.disabled,Oe=U.useRef(null),ce=U.useRef(null),ue=U.useContext(_),Pe=U.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),qe=U.isValidElement(Te)&&Object(g.c)(Te),ze=qe?Te.ref:null,et=U.useMemo(function(){return Object(g.a)(ze,Oe)},[ze,Oe]),nt=U.useRef(Ee);nt.current=Ee;var Ie=U.useCallback(function(Me){var Ge=nt.current,se=Ge.onResize,be=Ge.data,xe=Me.getBoundingClientRect(),Se=xe.width,Be=xe.height,He=Me.offsetWidth,Ye=Me.offsetHeight,Ve=Math.floor(Se),lt=Math.floor(Be);if(Pe.current.width!==Ve||Pe.current.height!==lt||Pe.current.offsetWidth!==He||Pe.current.offsetHeight!==Ye){var $e={width:Ve,height:lt,offsetWidth:He,offsetHeight:Ye};Pe.current=$e;var Qe=He===Math.round(Se)?Se:He,De=Ye===Math.round(Be)?Be:Ye,ct=Object(G.a)(Object(G.a)({},$e),{},{offsetWidth:Qe,offsetHeight:De});ue==null||ue(ct,Me,be),se&&Promise.resolve().then(function(){se(ct,Me)})}},[]);return U.useEffect(function(){var Me=Object(d.a)(Oe.current)||Object(d.a)(ce.current);return Me&&!Ae&&o(Me,Ie),function(){return s(Me,Ie)}},[Oe.current,Ae]),U.createElement(A,{ref:ce},qe?U.cloneElement(Te,{ref:et}):Te)}var R="rc-observer-key";function C(Ee){var Te=Ee.children,Ae=Object(i.a)(Te);return Ae.map(function(Oe,ce){var ue=(Oe==null?void 0:Oe.key)||"".concat(R,"-").concat(ce);return U.createElement(L,Object(ne.a)({},Ee,{key:ue}),Oe)})}C.Collection=w;var S=C,x=J("bT9E"),p=J("TSYQ"),T=J.n(p),v=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,y=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],F={},B;function O(Ee){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=Ee.getAttribute("id")||Ee.getAttribute("data-reactid")||Ee.getAttribute("name");if(Te&&F[Ae])return F[Ae];var Oe=window.getComputedStyle(Ee),ce=Oe.getPropertyValue("box-sizing")||Oe.getPropertyValue("-moz-box-sizing")||Oe.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(Oe.getPropertyValue("padding-bottom"))+parseFloat(Oe.getPropertyValue("padding-top")),Pe=parseFloat(Oe.getPropertyValue("border-bottom-width"))+parseFloat(Oe.getPropertyValue("border-top-width")),qe=y.map(function(et){return"".concat(et,":").concat(Oe.getPropertyValue(et))}).join(";"),ze={sizingStyle:qe,paddingSize:ue,borderSize:Pe,boxSizing:ce};return Te&&Ae&&(F[Ae]=ze),ze}function j(Ee){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Oe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),Ee.getAttribute("wrap")?B.setAttribute("wrap",Ee.getAttribute("wrap")):B.removeAttribute("wrap");var ce=O(Ee,Te),ue=ce.paddingSize,Pe=ce.borderSize,qe=ce.boxSizing,ze=ce.sizingStyle;B.setAttribute("style","".concat(ze,";").concat(v)),B.value=Ee.value||Ee.placeholder||"";var et=Number.MIN_SAFE_INTEGER,nt=Number.MAX_SAFE_INTEGER,Ie=B.scrollHeight,Me;if(qe==="border-box"?Ie+=Pe:qe==="content-box"&&(Ie-=ue),Ae!==null||Oe!==null){B.value=" ";var Ge=B.scrollHeight-ue;Ae!==null&&(et=Ge*Ae,qe==="border-box"&&(et=et+ue+Pe),Ie=Math.max(et,Ie)),Oe!==null&&(nt=Ge*Oe,qe==="border-box"&&(nt=nt+ue+Pe),Me=Ie>nt?"":"hidden",Ie=Math.min(nt,Ie))}return{height:Ie,minHeight:et,maxHeight:nt,overflowY:Me,resize:"none"}}var P=J("Gytx"),b=J.n(P),Y;(function(Ee){Ee[Ee.NONE=0]="NONE",Ee[Ee.RESIZING=1]="RESIZING",Ee[Ee.RESIZED=2]="RESIZED"})(Y||(Y={}));var ee=function(Ee){Object(X.a)(Ae,Ee);var Te=Object(N.a)(Ae);function Ae(Oe){var ce;return Object($.a)(this,Ae),ce=Te.call(this,Oe),ce.nextFrameActionId=void 0,ce.resizeFrameId=void 0,ce.textArea=void 0,ce.saveTextArea=function(ue){ce.textArea=ue},ce.handleResize=function(ue){var Pe=ce.state.resizeStatus,qe=ce.props,ze=qe.autoSize,et=qe.onResize;if(Pe!==Y.NONE)return;typeof et=="function"&&et(ue),ze&&ce.resizeOnNextFrame()},ce.resizeOnNextFrame=function(){cancelAnimationFrame(ce.nextFrameActionId),ce.nextFrameActionId=requestAnimationFrame(ce.resizeTextarea)},ce.resizeTextarea=function(){var ue=ce.props.autoSize;if(!ue||!ce.textArea)return;var Pe=ue.minRows,qe=ue.maxRows,ze=j(ce.textArea,!1,Pe,qe);ce.setState({textareaStyles:ze,resizeStatus:Y.RESIZING},function(){cancelAnimationFrame(ce.resizeFrameId),ce.resizeFrameId=requestAnimationFrame(function(){ce.setState({resizeStatus:Y.RESIZED},function(){ce.resizeFrameId=requestAnimationFrame(function(){ce.setState({resizeStatus:Y.NONE}),ce.fixFirefoxAutoScroll()})})})})},ce.renderTextArea=function(){var ue=ce.props,Pe=ue.prefixCls,qe=Pe===void 0?"rc-textarea":Pe,ze=ue.autoSize,et=ue.onResize,nt=ue.className,Ie=ue.disabled,Me=ce.state,Ge=Me.textareaStyles,se=Me.resizeStatus,be=Object(x.a)(ce.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),xe=T()(qe,nt,Object(W.a)({},"".concat(qe,"-disabled"),Ie));"value"in be&&(be.value=be.value||"");var Se=Object(G.a)(Object(G.a)(Object(G.a)({},ce.props.style),Ge),se===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return U.createElement(S,{onResize:ce.handleResize,disabled:!(ze||et)},U.createElement("textarea",Object(ne.a)({},be,{className:xe,style:Se,ref:ce.saveTextArea})))},ce.state={textareaStyles:{},resizeStatus:Y.NONE},ce}return Object(k.a)(Ae,[{key:"componentDidUpdate",value:function(ce){(ce.value!==this.props.value||!b()(ce.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 ce=this.textArea.selectionStart,ue=this.textArea.selectionEnd;this.textArea.setSelectionRange(ce,ue)}}catch(Pe){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ae}(U.Component),ae=ee,le=function(Ee){Object(X.a)(Ae,Ee);var Te=Object(N.a)(Ae);function Ae(Oe){var ce;Object($.a)(this,Ae),ce=Te.call(this,Oe),ce.resizableTextArea=void 0,ce.focus=function(){ce.resizableTextArea.textArea.focus()},ce.saveTextArea=function(Pe){ce.resizableTextArea=Pe},ce.handleChange=function(Pe){var qe=ce.props.onChange;ce.setValue(Pe.target.value,function(){ce.resizableTextArea.resizeTextarea()}),qe&&qe(Pe)},ce.handleKeyDown=function(Pe){var qe=ce.props,ze=qe.onPressEnter,et=qe.onKeyDown;Pe.keyCode===13&&ze&&ze(Pe),et&&et(Pe)};var ue=typeof Oe.value=="undefined"||Oe.value===null?Oe.defaultValue:Oe.value;return ce.state={value:ue},ce}return Object(k.a)(Ae,[{key:"setValue",value:function(ce,ue){"value"in this.props||this.setState({value:ce},ue)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return U.createElement(ae,Object(ne.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ce){return"value"in ce?{value:ce.value}:null}}]),Ae}(U.Component),Re=ge.default=le},ZW9T:function(ot,ge,J){"use strict";J.d(ge,"a",function(){return P});var ne=J("k1fw"),$=J("oBTY"),k=J("miYZ"),X=J("tsqr"),N=J("rAM+"),U=J("tJVT"),G=J("PpiC"),W=J("q1tI"),i=J.n(W),D=J("bdgK"),g=J("9og8"),d=J("WmNS"),m=J.n(d),u={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},a={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},f={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},l={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},h=J("5VLF"),o=J.n(h),s={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},A=function(Y,ee){return ee.map(function(ae){return{label:ae,kind:Y.languages.CompletionItemKind.Keyword,insertText:ae}})},_=function(Y){return Object.keys(s.tables).map(function(ee){return{label:ee,kind:Y.languages.CompletionItemKind.Variable,insertText:ee}})},w=function(Y,ee){var ae=s.tables[Y];return ae?ae.map(function(le){return{label:le,kind:ee.languages.CompletionItemKind.Field,insertText:le}}):[]};function L(b,Y,ee,ae,le){var Re=Y.getWordUntilPosition(ee),Ee={startLineNumber:ee.lineNumber,endLineNumber:ee.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Te=ae.map(function(Ae){return{label:Ae,kind:b.languages.CompletionItemKind.Keyword,insertText:Ae,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}});return le.map(function(Ae){Te.push(Object(ne.a)(Object(ne.a)({},Ae),{},{range:Ee}))}),Te}var R=function(b){s.languages.map(function(le){return b.languages.registerDocumentFormattingEditProvider(le,{provideDocumentFormattingEdits:function(Ee,Te,Ae){return Object(g.a)(m.a.mark(function Oe(){var ce;return m.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return ce=o()(Ee.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),Pe.abrupt("return",[{range:Ee.getFullModelRange(),text:ce}]);case 2:case"end":return Pe.stop()}},Oe)}))()}}),le});var Y=f.quickKey.map(function(le){return{label:le.label,kind:b.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ee=l.quickKey.map(function(le){return{label:le.label,kind:b.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ae=a.quickKey.map(function(le){return{label:le.label,kind:b.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}});b.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Re,Ee){var Te=Re.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Oe=Re.getLineContent(Ee.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object($.a)(f.keywords.map(function(ce){return{label:ce,kind:b.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object($.a)(f.quickKey.map(function(ce){return{label:ce.label,kind:b.languages.CompletionItemKind.Function,documentation:ce.content,insertText:Oe.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}}),b.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Re,Ee){var Te=Re.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn};return{suggestions:Object($.a)(u.keywords.map(function(Oe){return{label:Oe,kind:b.languages.CompletionItemKind.Function,documentation:Oe,insertText:Oe,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}}))}}}),b.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Re,Ee){var Te=Re.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Oe=Re.getLineContent(Ee.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object($.a)(a.keywords.map(function(ce){return{label:ce,kind:b.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object($.a)(a.quickKey.map(function(ce){return{label:ce.label,kind:b.languages.CompletionItemKind.Function,documentation:ce.content,insertText:Oe.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}}),b.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Re,Ee){var Te=Re.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Oe=Re.getLineContent(Ee.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object($.a)(l.keywords.map(function(ce){return{label:ce,kind:b.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object($.a)(l.quickKey.map(function(ce){return{label:ce.label,kind:b.languages.CompletionItemKind.Function,documentation:ce.content,insertText:Oe.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}})},C="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",S=J("fjLI"),x=J("LvDl"),p=J("+ua5");function T(b){return/^\d+$/.test(b)?"".concat(b,"px"):b}function v(){}var y=!1,F={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function B(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Y=b;if(Array.isArray(b)){for(var ee=0;ee<b.length;ee++){var ae=F[b[ee]];if(ae)return ae}return Y[0]}return F[Y]||Y}var O=null,j=ge.b=function(b){var Y=b.width,ee=Y===void 0?"100%":Y,ae=b.height,le=ae===void 0?"100%":ae,Re=b.value,Ee=b.language,Te=Ee===void 0?"javascript":Ee,Ae=b.style,Oe=Ae===void 0?{}:Ae,ce=b.options,ue=ce===void 0?{}:ce,Pe=b.overrideServices,qe=Pe===void 0?{}:Pe,ze=b.theme,et=ze===void 0?"vs-dark":ze,nt=b.onEditBlur,Ie=b.onSave,Me=b.autoHeight,Ge=Me===void 0?!1:Me,se=b.forbidCopy,be=se===void 0?!1:se,xe=b.onChange,Se=xe===void 0?v:xe,Be=b.editorDidMount,He=Be===void 0?v:Be,Ye=b.onFocus,Ve=Ye===void 0?v:Ye,lt=b.filename,$e=lt===void 0?"educoder.txt":lt,Qe=b.errorLine,De=b.errorContent,ct=De===void 0?"":De,ut=Object(G.a)(b,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ke=Object(W.useRef)(),Ne=Object(W.useRef)({}),_e=Object(W.useRef)(),fe=Object(W.useRef)(),ve=Object(W.useRef)(!1),ie=Object(W.useRef)(),re=Object(W.useState)(!1),oe=Object(U.a)(re,2),de=oe[0],ye=oe[1];function Le(){var _t;return ke.current&&(_t=new D.default(function(wt){var Bt=Object(N.a)(wt),Lt;try{for(Bt.s();!(Lt=Bt.n()).done;){var Mt=Lt.value;(Mt.target.offsetHeight>0||Mt.target.offsetWidth>0)&&Ne.current.instance.layout()}}catch(Et){Bt.e(Et)}finally{Bt.f()}}),_t.observe(ke.current)),_t}function Ue(){X.b.warn(decodeURIComponent(C))}var Je=function(){var wt=Ne.current.instance;if(Re!=null&&wt&&de){var Bt=wt.getModel();Bt&&Re!==Bt.getValue()&&(y=!0,Bt.setValue(Re),wt.layout(),y=!1)}};Object(W.useEffect)(function(){fe.current&&clearTimeout(fe.current),fe.current=setTimeout(function(){Je()},500)},[Re,de,Ne.current]),Object(W.useEffect)(function(){if(Qe&&Ne.current&&Ne.current.instance){var _t=Ne.current.instance;_t.changeViewZones(function(Bt){var Lt=document.createElement("div");Lt.style.padding="10px 20px",Lt.style.width="calc(100% - 20px)",Lt.className="my-error-line-wrp",Lt.innerHTML=ct,Bt.addZone({afterLineNumber:Qe||11,heightInLines:3,domNode:Lt})});var wt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};_t.addOverlayWidget(wt),_t.revealPositionInCenter({lineNumber:20,column:1})}},[Qe,Ne.current,de]);function dt(){var _t=Ne.current.instance;if(_t){var wt=_t.getSelection(),Bt=Ne.current.pastePos||{},Lt=new O.Range(Bt.startLineNumber||wt.endLineNumber,Bt.startColumn||wt.endColumn,Bt.endLineNumber||wt.endLineNumber,Bt.endColumn||wt.endColumn);setTimeout(function(){_t.executeEdits("",[{range:Lt,text:""}])},300)}}function rt(_t){(window.navigator.platform.match("Mac")?_t.metaKey:_t.ctrlKey)&&_t.keyCode==83&&(_t.preventDefault(),Ie())}var mt=function(){if(Ge&&Ne.current.instance){var wt=Ne.current.instance.getContentHeight();bt(wt<le?le:wt)}else bt(le)};function yt(_t){var wt=document.createEvent("MouseEvents");wt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),_t.dispatchEvent(wt)}function tt(_t,wt){var Bt=window.URL||window.webkitURL||window,Lt=new Blob([wt]),Mt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Mt.href=Bt.createObjectURL(Lt),Mt.download=_t,yt(Mt)}Object(W.useEffect)(function(){mt()},[mt]),Object(W.useEffect)(function(){ke.current&&!de&&Promise.all([J.e(16),J.e(28)]).then(J.t.bind(null,"M/lh",7)).then(function(_t){try{O=_t,Ne.current.instance=O.editor.create(ke.current,{value:Re,language:B(Te),theme:et,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},qe);var wt=Ne.current.instance,Bt=S.d._menuItems,Lt=Object($.a)(Bt).find(function(Ht){return Ht[0]._debugName=="EditorContext"}),Mt=Lt[1],Et=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],ht=function(zt,It){var ui=zt._first;do{var ki,Yi,Xe=It.includes((ki=ui.element)===null||ki===void 0||((Yi=ki.command)===null||Yi===void 0)?void 0:Yi.id);Xe&&zt._remove(ui)}while(ui=ui.next)};if(He(wt,O),setTimeout(function(){mt(),Ne.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){tt($e||"educoder.txt",wt.getValue())}}),wt.getDomNode().addEventListener("input",function(){_e.current.autoFormat&&wt.getAction("editor.action.formatDocument").run()})},500),Ne.current.subscription=wt.onDidChangeModelContent(function(Ht){ve.current?clearTimeout(ie.current):(mt(),Se(wt.getValue(),Ht)),ie.current=setTimeout(function(){ve.current=!1},500)}),window.Monaco||R(O,B(Te)),be&&(ht(Mt,Et),ke.current.classList.add("noCopyPaste"),wt.onKeyDown(function(Ht){var zt=Ht.keyCode,It=Ht.ctrlKey,ui=Ht.metaKey;(zt===33||zt===52)&&(ui||It)&&(Ue(),Ht.preventDefault())})),window.Monaco=O,nt&&wt.onDidBlurEditorWidget(function(){nt(wt.getValue())}),Ve&&wt.onDidFocusEditorText(function(){Ve(wt.getValue())}),be){wt.addCommand(O.KeyMod.CtrlCmd|O.KeyCode.KEY_V,function(){return Ue(),null}),wt.onDidPaste(function(Ht){Ne.current.pastePos=Ht});try{window.addEventListener("paste",dt)}catch(Ht){}}var _i=Le();return ye(!0),function(){var Ht=Ne.current.instance;Ht.dispose();var zt=Ht.getModel();zt&&zt.dispose(),Ne.current.subscription&&Ne.current.subscription.dispose(),be&&window.removeEventListener("paste",dt),_i.unobserve(ke.current)}}catch(Ht){}})},[]),Object(W.useEffect)(function(){var _t=Ne.current.instance;if(_t&&de)return document.addEventListener("keydown",rt,!1),function(){document.removeEventListener("keydown",rt)}},[Ie,de]),Object(W.useEffect)(function(){var _t=Ne.current.instance;if(_t&&de){var wt=B(Te);O.editor.setModelLanguage(_t.getModel(),wt),console.log("language:",Te,_t.getModel(),wt)}},[Te,de]),Object(W.useEffect)(function(){var _t=Ne.current.instance;_t&&de&&O.editor.setTheme(et)},[et,de]),Object(W.useEffect)(function(){var _t=Ne.current.instance;_e.current=ue,_t&&de&&(_t.updateOptions(Object(ne.a)({},ue)),setTimeout(function(){_t.getModel().updateOptions(Object(ne.a)({},ue))},200))},[JSON.stringify(ue),de]),Object(W.useEffect)(function(){var _t=Ne.current.instance;_t&&de&&_t.layout()},[ee,le,de]);var Ut=Object(W.useState)(T(ee)),Ct=Object(U.a)(Ut,2),Jt=Ct[0],ei=Ct[1],Dt=Object(W.useState)(T(le)),ci=Object(U.a)(Dt,2),Di=ci[0],bt=ci[1],fi=Object(ne.a)(Object(ne.a)({},Oe),{},{width:Jt,height:Di});return i.a.createElement("div",{className:"my-monaco-editor",ref:ke,style:fi})};function P(b){var Y=b.width,ee=Y===void 0?"100%":Y,ae=b.height,le=ae===void 0?"100%":ae,Re=b.original,Ee=b.modified,Te=b.language,Ae=b.options,Oe=Ae===void 0?{}:Ae,ce=Object(W.useRef)(),ue=Object(W.useState)(null),Pe=Object(U.a)(ue,2),qe=Pe[0],ze=Pe[1];function et(Ge){var se;return ce.current&&(se=new D.default(function(be){var xe=Object(N.a)(be),Se;try{for(xe.s();!(Se=xe.n()).done;){var Be=Se.value;(Be.target.offsetHeight>0||Be.target.offsetWidth>0)&&Ge.layout()}}catch(He){xe.e(He)}finally{xe.f()}}),se.observe(ce.current)),se}Object(W.useEffect)(function(){ce.current&&Promise.all([J.e(16),J.e(28)]).then(J.t.bind(null,"M/lh",7)).then(function(Ge){O=Ge;var se=O.editor.createDiffEditor(ce.current,Object(ne.a)(Object(ne.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Oe),{},{wordWrap:!0}));ze(se);var be=et(se);return function(){se.dispose();var xe=se.getModel();xe&&xe.dispose(),be.unobserve(ce.current)}})},[]),Object(W.useEffect)(function(){qe&&qe.setModel({original:O.editor.createModel(Re,Te),modified:O.editor.createModel(Ee,Te)})},[Re,Ee,Te,qe]);var nt=T(ee),Ie=T(le),Me={width:nt,height:Ie};return i.a.createElement("div",{className:"my-diff-editor",ref:ce,style:Me})}},ZpRC:function(ot,ge,J){"use strict";function ne(g){return typeof g=="object"&&g!=null&&g.nodeType===1}function $(g,d){return(!d||g!=="hidden")&&g!=="visible"&&g!=="clip"}function k(g,d){if(g.clientHeight<g.scrollHeight||g.clientWidth<g.scrollWidth){var m=getComputedStyle(g,null);return $(m.overflowY,d)||$(m.overflowX,d)||function(u){var a=function(f){if(!f.ownerDocument||!f.ownerDocument.defaultView)return null;try{return f.ownerDocument.defaultView.frameElement}catch(l){return null}}(u);return!!a&&(a.clientHeight<u.scrollHeight||a.clientWidth<u.scrollWidth)}(g)}return!1}function X(g,d,m,u,a,f,l,h){return f<g&&l>d||f>g&&l<d?0:f<=g&&h<=m||l>=d&&h>=m?f-g-u:l>d&&h<m||f<g&&h>m?l-d+a:0}var N=function(g,d){var m=window,u=d.scrollMode,a=d.block,f=d.inline,l=d.boundary,h=d.skipOverflowHiddenElements,o=typeof l=="function"?l:function(Ge){return Ge!==l};if(!ne(g))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,A=[],_=g;ne(_)&&o(_);){if((_=_.parentElement)===s){A.push(_);break}_!=null&&_===document.body&&k(_)&&!k(document.documentElement)||_!=null&&k(_,h)&&A.push(_)}for(var w=m.visualViewport?m.visualViewport.width:innerWidth,L=m.visualViewport?m.visualViewport.height:innerHeight,R=window.scrollX||pageXOffset,C=window.scrollY||pageYOffset,S=g.getBoundingClientRect(),x=S.height,p=S.width,T=S.top,v=S.right,y=S.bottom,F=S.left,B=a==="start"||a==="nearest"?T:a==="end"?y:T+x/2,O=f==="center"?F+p/2:f==="end"?v:F,j=[],P=0;P<A.length;P++){var b=A[P],Y=b.getBoundingClientRect(),ee=Y.height,ae=Y.width,le=Y.top,Re=Y.right,Ee=Y.bottom,Te=Y.left;if(u==="if-needed"&&T>=0&&F>=0&&y<=L&&v<=w&&T>=le&&y<=Ee&&F>=Te&&v<=Re)return j;var Ae=getComputedStyle(b),Oe=parseInt(Ae.borderLeftWidth,10),ce=parseInt(Ae.borderTopWidth,10),ue=parseInt(Ae.borderRightWidth,10),Pe=parseInt(Ae.borderBottomWidth,10),qe=0,ze=0,et="offsetWidth"in b?b.offsetWidth-b.clientWidth-Oe-ue:0,nt="offsetHeight"in b?b.offsetHeight-b.clientHeight-ce-Pe:0;if(s===b)qe=a==="start"?B:a==="end"?B-L:a==="nearest"?X(C,C+L,L,ce,Pe,C+B,C+B+x,x):B-L/2,ze=f==="start"?O:f==="center"?O-w/2:f==="end"?O-w:X(R,R+w,w,Oe,ue,R+O,R+O+p,p),qe=Math.max(0,qe+C),ze=Math.max(0,ze+R);else{qe=a==="start"?B-le-ce:a==="end"?B-Ee+Pe+nt:a==="nearest"?X(le,Ee,ee,ce,Pe+nt,B,B+x,x):B-(le+ee/2)+nt/2,ze=f==="start"?O-Te-Oe:f==="center"?O-(Te+ae/2)+et/2:f==="end"?O-Re+ue+et:X(Te,Re,ae,Oe,ue+et,O,O+p,p);var Ie=b.scrollLeft,Me=b.scrollTop;B+=Me-(qe=Math.max(0,Math.min(Me+qe,b.scrollHeight-ee+nt))),O+=Ie-(ze=Math.max(0,Math.min(Ie+ze,b.scrollWidth-ae+et)))}j.push({el:b,top:qe,left:ze})}return j};function U(g){return g===Object(g)&&Object.keys(g).length!==0}function G(g,d){d===void 0&&(d="auto");var m="scrollBehavior"in document.body.style;g.forEach(function(u){var a=u.el,f=u.top,l=u.left;a.scroll&&m?a.scroll({top:f,left:l,behavior:d}):(a.scrollTop=f,a.scrollLeft=l)})}function W(g){return g===!1?{block:"end",inline:"nearest"}:U(g)?g:{block:"start",inline:"nearest"}}function i(g,d){var m=!g.ownerDocument.documentElement.contains(g);if(U(d)&&typeof d.behavior=="function")return d.behavior(m?[]:N(g,d));if(m)return;var u=W(d);return G(N(g,u),u.behavior)}var D=ge.a=i},bT9E:function(ot,ge,J){"use strict";J.d(ge,"a",function(){return $});var ne=J("VTBJ");function $(k,X){var N=Object(ne.a)({},k);return Array.isArray(X)&&X.forEach(function(U){delete N[U]}),N}},c5Ni:function(ot,ge,J){},dejd:function(ot,ge,J){},dmUQ:function(ot,ge,J){"use strict";var ne=J("Ff2n"),$=J("rePB"),k=J("1OyB"),X=J("vuIU"),N=J("Ji7U"),U=J("md7G"),G=J("foSv"),W=J("q1tI"),i=J.n(W),D=J("TSYQ"),g=J.n(D),d=J("4IlW");function m(x,p){var T=Object.keys(x);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(x);p&&(v=v.filter(function(y){return Object.getOwnPropertyDescriptor(x,y).enumerable})),T.push.apply(T,v)}return T}function u(x){for(var p=1;p<arguments.length;p++){var T=arguments[p]!=null?arguments[p]:{};p%2?m(Object(T),!0).forEach(function(v){Object($.a)(x,v,T[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(T)):m(Object(T)).forEach(function(v){Object.defineProperty(x,v,Object.getOwnPropertyDescriptor(T,v))})}return x}function a(x){var p=f();return function(){var v=Object(G.a)(x),y;if(p){var F=Object(G.a)(this).constructor;y=Reflect.construct(v,arguments,F)}else y=v.apply(this,arguments);return Object(U.a)(this,y)}}function f(){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(x){return!1}}function l(){}function h(x){x.preventDefault()}var o=function(p){return p.replace(/[^\w.-]+/g,"")},s=200,A=600,_=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,w=function(p){return p!=null},L=function(p,T){return T===p||typeof T=="number"&&typeof p=="number"&&isNaN(T)&&isNaN(p)},R=function(x){Object(N.a)(T,x);var p=a(T);function T(v){var y;Object(k.a)(this,T),y=p.call(this,v),y.onKeyDown=function(O){var j=y.props,P=j.onKeyDown,b=j.onPressEnter;if(O.keyCode===d.a.UP){var Y=y.getRatio(O);y.up(O,Y,null),y.stop()}else if(O.keyCode===d.a.DOWN){var ee=y.getRatio(O);y.down(O,ee,null),y.stop()}else O.keyCode===d.a.ENTER&&b&&b(O);if(y.recordCursorPosition(),y.lastKeyCode=O.keyCode,P){for(var ae=arguments.length,le=new Array(ae>1?ae-1:0),Re=1;Re<ae;Re++)le[Re-1]=arguments[Re];P.apply(void 0,[O].concat(le))}},y.onKeyUp=function(O){var j=y.props.onKeyUp;if(y.stop(),y.recordCursorPosition(),j){for(var P=arguments.length,b=new Array(P>1?P-1:0),Y=1;Y<P;Y++)b[Y-1]=arguments[Y];j.apply(void 0,[O].concat(b))}},y.onChange=function(O){var j=y.props.onChange;y.state.focused&&(y.inputting=!0),y.rawInput=y.props.parser(y.getValueFromEvent(O)),y.setState({inputValue:y.rawInput}),j(y.toNumber(y.rawInput))},y.onMouseUp=function(){var O=y.props.onMouseUp;y.recordCursorPosition(),O&&O.apply(void 0,arguments)},y.onFocus=function(){var O;y.setState({focused:!0}),(O=y.props).onFocus.apply(O,arguments)},y.onBlur=function(){var O=y.props.onBlur;y.inputting=!1,y.setState({focused:!1});var j=y.getCurrentValidValue(y.state.inputValue),P=y.setValue(j,l);if(O){var b=y.input.value,Y=y.getInputDisplayValue({focus:!1,value:P});y.input.value=Y&&Number(Y),O.apply(void 0,arguments),y.input.value=b}},y.getRatio=function(O){var j=1;return O.metaKey||O.ctrlKey?j=.1:O.shiftKey&&(j=10),j},y.getFullNum=function(O){return isNaN(O)?O:/e/i.test(String(O))?Number(O).toFixed(18).replace(/\.?0+$/,""):O},y.getPrecision=function(O){if(w(y.props.precision))return y.props.precision;var j=String(O);if(j.indexOf("e-")>=0)return parseInt(j.slice(j.indexOf("e-")+2),10);var P=0;return j.indexOf(".")>=0&&(P=j.length-j.indexOf(".")-1),P},y.getInputDisplayValue=function(O){var j=O||y.state,P=j.focused,b=j.inputValue,Y=j.value,ee;P?ee=b:ee=y.toPrecisionAsStep(Y),ee==null&&(ee="");var ae=y.formatWrapper(ee);return w(y.props.decimalSeparator)&&(ae=ae.toString().replace(".",y.props.decimalSeparator)),ae},y.recordCursorPosition=function(){try{y.cursorStart=y.input.selectionStart,y.cursorEnd=y.input.selectionEnd,y.currentValue=y.input.value,y.cursorBefore=y.input.value.substring(0,y.cursorStart),y.cursorAfter=y.input.value.substring(y.cursorEnd)}catch(O){}},y.restoreByAfter=function(O){if(O===void 0)return!1;var j=y.input.value,P=j.lastIndexOf(O);if(P===-1)return!1;var b=y.cursorBefore.length;return y.lastKeyCode===d.a.DELETE&&y.cursorBefore.charAt(b-1)===O[0]?(y.fixCaret(b,b),!0):P+O.length===j.length?(y.fixCaret(P,P),!0):!1},y.partRestoreByAfter=function(O){return O===void 0?!1:Array.prototype.some.call(O,function(j,P){var b=O.substring(P);return y.restoreByAfter(b)})},y.isNotCompleteNumber=function(O){return isNaN(O)||O===""||O===null||O&&O.toString().indexOf(".")===O.toString().length-1},y.stop=function(){y.autoStepTimer&&clearTimeout(y.autoStepTimer)},y.down=function(O,j,P){y.pressingUpOrDown=!0,y.step("down",O,j,P)},y.up=function(O,j,P){y.pressingUpOrDown=!0,y.step("up",O,j,P)},y.saveInput=function(O){y.input=O};var F=v.value;F===void 0&&(F=v.defaultValue),y.state={focused:v.autoFocus};var B=y.getValidValue(y.toNumber(F));return y.state=u(u({},y.state),{},{inputValue:y.toPrecisionAsStep(B),value:B}),y}return Object(X.a)(T,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(y){var F=this.props,B=F.value,O=F.onChange,j=F.max,P=F.min,b=this.state.focused;if(y){if(!L(y.value,B)||!L(y.max,j)||!L(y.min,P)){var Y=b?B:this.getValidValue(B),ee;this.pressingUpOrDown?ee=Y:this.inputting?ee=this.rawInput:ee=this.toPrecisionAsStep(Y),this.setState({value:Y,inputValue:ee})}var ae="value"in this.props?B:this.state.value;"max"in this.props&&y.max!==j&&typeof ae=="number"&&ae>j&&O&&O(j),"min"in this.props&&y.min!==P&&typeof ae=="number"&&ae<P&&O&&O(P)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var le=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===d.a.BACKSPACE?le=this.cursorStart-1:this.lastKeyCode===d.a.DELETE&&(le=this.cursorStart):le=this.input.value.length,this.fixCaret(le,le)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case d.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case d.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Re){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(y){var F=y;return F===""?F="":this.isNotCompleteNumber(parseFloat(F))?F=this.state.value:F=this.getValidValue(F),this.toNumber(F)}},{key:"getValueFromEvent",value:function(y){var F=y.target.value.trim().replace(/。/g,".");return w(this.props.decimalSeparator)&&(F=F.replace(this.props.decimalSeparator,".")),F}},{key:"getValidValue",value:function(y){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,O=parseFloat(y);return isNaN(O)?y:(O<F&&(O=F),O>B&&(O=B),O)}},{key:"setValue",value:function(y,F){var B=this.props.precision,O=this.isNotCompleteNumber(parseFloat(y))?null:parseFloat(y),j=this.state.value,P=j===void 0?null:j,b=this.state.inputValue,Y=b===void 0?null:b,ee=typeof O=="number"?O.toFixed(B):"".concat(O),ae=O!==P||ee!=="".concat(Y);return"value"in this.props?(Y=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Y},F)):this.setState({value:O,inputValue:this.toPrecisionAsStep(y)},F),ae&&this.props.onChange(O),O}},{key:"getMaxPrecision",value:function(y){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,O=B.precision,j=B.step;if(w(O))return O;var P=this.getPrecision(F),b=this.getPrecision(j),Y=this.getPrecision(y);return y?Math.max(Y,P+b):P+b}},{key:"getPrecisionFactor",value:function(y){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(y,F);return Math.pow(10,B)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(y){return this.props.formatter?this.props.formatter(y):y}},{key:"toPrecisionAsStep",value:function(y){if(this.isNotCompleteNumber(y)||y==="")return y;var F=Math.abs(this.getMaxPrecision(y));return isNaN(F)?y.toString():Number(y).toFixed(F)}},{key:"toNumber",value:function(y){var F=this.props.precision,B=this.state.focused,O=y&&y.length>16&&B;return this.isNotCompleteNumber(y)||O?y:w(F)?Math.round(y*Math.pow(10,F))/Math.pow(10,F):Number(y)}},{key:"upStep",value:function(y,F){var B=this.props.step,O=this.getPrecisionFactor(y,F),j=Math.abs(this.getMaxPrecision(y,F)),P=((O*y+O*B*F)/O).toFixed(j);return this.toNumber(P)}},{key:"downStep",value:function(y,F){var B=this.props.step,O=this.getPrecisionFactor(y,F),j=Math.abs(this.getMaxPrecision(y,F)),P=((O*y-O*B*F)/O).toFixed(j);return this.toNumber(P)}},{key:"step",value:function(y,F){var B=this,O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=arguments.length>3?arguments[3]:void 0;this.stop(),F&&(F.persist(),F.preventDefault());var P=this.props;if(P.disabled)return;var b=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(b))return;var Y=this["".concat(y,"Step")](b,O),ee=Y>P.max||Y<P.min;if(Y>P.max?Y=P.max:Y<P.min&&(Y=P.min),this.setValue(Y,null),this.setState({focused:!0},function(){B.pressingUpOrDown=!1}),ee)return;this.autoStepTimer=setTimeout(function(){B[y](F,O,!0)},j?s:A)}},{key:"fixCaret",value:function(y,F){if(y===void 0||F===void 0||!this.input||!this.input.value)return;try{var B=this.input.selectionStart,O=this.input.selectionEnd;(y!==B||F!==O)&&this.input.setSelectionRange(y,F)}catch(j){}}},{key:"render",value:function(){var y,F=this.props,B=F.prefixCls,O=F.disabled,j=F.readOnly,P=F.useTouch,b=F.autoComplete,Y=F.upHandler,ee=F.downHandler,ae=F.className,le=F.max,Re=F.min,Ee=F.style,Te=F.title,Ae=F.onMouseEnter,Oe=F.onMouseLeave,ce=F.onMouseOver,ue=F.onMouseOut,Pe=F.required,qe=F.onClick,ze=F.tabIndex,et=F.type,nt=F.placeholder,Ie=F.id,Me=F.inputMode,Ge=F.pattern,se=F.step,be=F.maxLength,xe=F.autoFocus,Se=F.name,Be=F.onPaste,He=F.onInput,Ye=Object(ne.a)(F,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Ve=this.state,lt=Ve.value,$e=Ve.focused,Qe=g()(B,(y={},Object($.a)(y,ae,!!ae),Object($.a)(y,"".concat(B,"-disabled"),O),Object($.a)(y,"".concat(B,"-focused"),$e),y)),De={};Object.keys(Ye).forEach(function(de){(de.substr(0,5)==="data-"||de.substr(0,5)==="aria-"||de==="role")&&(De[de]=Ye[de])});var ct=!j&&!O,ut=this.getInputDisplayValue(null),ke=(lt||lt===0)&&(isNaN(lt)||Number(lt)>=le),Ne=(lt||lt===0)&&(isNaN(lt)||Number(lt)<=Re),_e=ke||O||j,fe=Ne||O||j,ve=g()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object($.a)({},"".concat(B,"-handler-up-disabled"),_e)),ie=g()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object($.a)({},"".concat(B,"-handler-down-disabled"),fe)),re=P?{onTouchStart:_e?l:this.up,onTouchEnd:this.stop}:{onMouseDown:_e?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},oe=P?{onTouchStart:fe?l:this.down,onTouchEnd:this.stop}:{onMouseDown:fe?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return i.a.createElement("div",{className:Qe,style:Ee,title:Te,onMouseEnter:Ae,onMouseLeave:Oe,onMouseOver:ce,onMouseOut:ue,onFocus:function(){return null},onBlur:function(){return null}},i.a.createElement("div",{className:"".concat(B,"-handler-wrap")},i.a.createElement("span",Object.assign({unselectable:"on"},re,{role:"button","aria-label":"Increase Value","aria-disabled":_e,className:ve}),Y||i.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:h})),i.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Decrease Value","aria-disabled":fe,className:ie}),ee||i.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:h}))),i.a.createElement("div",{className:"".concat(B,"-input-wrap")},i.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Re,"aria-valuemax":le,"aria-valuenow":lt,required:Pe,type:et,placeholder:nt,onPaste:Be,onClick:qe,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:ze,autoComplete:b,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ct?this.onKeyDown:l,onKeyUp:ct?this.onKeyUp:l,autoFocus:xe,maxLength:be,readOnly:j,disabled:O,max:le,min:Re,step:se,name:Se,title:Te,id:Ie,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ut),pattern:Ge,inputMode:Me,onInput:He},De))))}}]),T}(i.a.Component);R.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:_,min:-_,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:o,required:!1,autoComplete:"off"};var C=R,S=ge.a=C},fB9n:function(ot,ge,J){"use strict";J.r(ge);var ne=J("14J3"),$=J("BMrR"),k=J("jCWc"),X=J("kPKH"),N=J("k1fw"),U=J("9og8"),G=J("tJVT"),W=J("PpiC"),i=J("WmNS"),D=J.n(i),g=J("q1tI"),d=J.n(g),m=J("55Ip"),u=J("9kvl"),a=J("T2oS"),f=J("W9HT"),l=J("oBTY"),h=J("B9cy"),o=J("Ol7k"),s=J("lUTK"),A=J("BvKs"),_=J("Ty5D"),w=J("wd/R"),L=J.n(w),R=J("RotF"),C=J.n(R),S=J("m3rI"),x=J("9Bee"),p=J("SbmS"),T=J.n(p),v=A.a.SubMenu,y=o.a.Sider,F=o.a.Content,B=function(Me){var Ge=Me.messages,se=Me.globalSetting,be=Me.loading,xe=Me.user,Se=Me.dispatch,Be=Object(W.a)(Me,["messages","globalSetting","loading","user","dispatch"]),He=Object(_.i)(),Ye=Object(_.h)(),Ve=xe.userInfo,lt=Object(g.useState)(!1),$e=Object(G.a)(lt,2),Qe=$e[0],De=$e[1],ct=Object(g.useState)({per_page:20,page:1}),ut=Object(G.a)(ct,2),ke=ut[0],Ne=ut[1],_e=Object(g.useState)({per_page:20,page:1}),fe=Object(G.a)(_e,2),ve=fe[0],ie=fe[1],re=Object(g.useState)([]),oe=Object(G.a)(re,2),de=oe[0],ye=oe[1];Object(g.useEffect)(function(){ke.page=1,Ue()},[He.userId]);var Le=function(dt){var rt,mt;u.d.push("/messages/".concat(xe==null||((rt=xe.userInfo)===null||rt===void 0)?void 0:rt.login,"/message_detail?target_ids=").concat(dt==null||((mt=dt.target)===null||mt===void 0)?void 0:mt.id))},Ue=function(){var Je=Object(U.a)(D.a.mark(function dt(){var rt,mt;return D.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:return De(!1),tt.next=3,Se({type:"messages/getPrivateMessages",payload:Object(N.a)(Object(N.a)({},He),ve)});case 3:rt=tt.sent,rt!=null&&rt.private_messages&&(ye([].concat(Object(l.a)(de),Object(l.a)(rt.private_messages))),((mt=rt.private_messages)===null||mt===void 0?void 0:mt.length)===20&&De(!0));case 5:case"end":return tt.stop()}},dt)}));return function(){return Je.apply(this,arguments)}}();return d.a.createElement("aside",{className:T.a.listRightMessage},d.a.createElement(C.a,{loadMore:function(){ve.page++,Ue()},hasMore:Qe,useWindow:!1},d.a.createElement(f.a,{spinning:be["messages/getPrivateMessages"]},d.a.createElement("div",{className:"minH500"},de==null?void 0:de.map(function(Je,dt){var rt,mt;return d.a.createElement("aside",{key:dt},d.a.createElement($.a,{onClick:function(){return Le(Je)}},d.a.createElement(X.a,{flex:"58px"},d.a.createElement("img",{src:S.a.IMG_SERVER+"/images/"+(Je==null||((rt=Je.target)===null||rt===void 0)?void 0:rt.image_url),alt:""})),d.a.createElement(X.a,{flex:"1"},d.a.createElement($.a,null,d.a.createElement(X.a,{span:24},d.a.createElement($.a,null,d.a.createElement(X.a,{flex:"1"},d.a.createElement("span",{className:T.a.userName},Je==null||((mt=Je.target)===null||mt===void 0)?void 0:mt.name)),d.a.createElement(X.a,null,d.a.createElement("span",{className:"ml15 c-grey-c"},L()(Je.send_time).fromNow())))),d.a.createElement(X.a,{span:24},d.a.createElement("div",{className:["mt15",T.a.content].join(" ")},d.a.createElement(x.a,{value:Je.content||""})))))))})))))},O=Object(u.a)(function(Ie){var Me=Ie.messages,Ge=Ie.loading,se=Ie.user,be=Ie.globalSetting;return{messages:Me,globalSetting:be,user:se,loading:Ge.effects}})(B),j=J("+L6B"),P=J("2/Rp"),b=J("miYZ"),Y=J("tsqr"),ee=J("y8nQ"),ae=J("Vl3Y"),le=J("kaH+"),Re=J("1vsH"),Ee=J("5WQS"),Te=J("Ot1p"),Ae=J("dhSg"),Oe=A.a.SubMenu,ce=o.a.Sider,ue=o.a.Content,Pe=function(Me){var Ge=Me.messages,se=Me.globalSetting,be=Me.loading,xe=Me.user,Se=Me.dispatch,Be=Object(W.a)(Me,["messages","globalSetting","loading","user","dispatch"]),He=Object(_.i)(),Ye=Object(_.h)(),Ve=Ye.query,lt=Object(g.useState)({per_page:20,page:1}),$e=Object(G.a)(lt,2),Qe=$e[0],De=$e[1],ct=Object(g.useState)([]),ut=Object(G.a)(ct,2),ke=ut[0],Ne=ut[1],_e=Object(g.useState)(!1),fe=Object(G.a)(_e,2),ve=fe[0],ie=fe[1],re=Object(g.useState)(!1),oe=Object(G.a)(re,2),de=oe[0],ye=oe[1],Le=Object(g.useState)(""),Ue=Object(G.a)(Le,2),Je=Ue[0],dt=Ue[1],rt=Object(g.useRef)(),mt=ae.a.useForm(),yt=Object(G.a)(mt,1),tt=yt[0],Ut=Object(g.useState)([]),Ct=Object(G.a)(Ut,2),Jt=Ct[0],ei=Ct[1],Dt=Object(g.useState)(!0),ci=Object(G.a)(Dt,2),Di=ci[0],bt=ci[1];Object(g.useEffect)(function(){Qe.page=1,fi()},[Ve.target_ids]);var fi=function(){var Lt=Object(U.a)(D.a.mark(function Mt(){var Et,ht;return D.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return ie(!1),Ht.next=3,Se({type:"messages/getPrivateMessageDetails",payload:Object(N.a)(Object(N.a)({},He),{},{target_id:Ve==null?void 0:Ve.target_ids},Qe)});case 3:Et=Ht.sent,Et!=null&&Et.messages&&(Jt=Et==null?void 0:Et.messages,((ht=Jt)===null||ht===void 0?void 0:ht.length)===20&&setTimeout(function(){ie(!0),bt(!1)},500),Qe.page===1?Ne(Object(l.a)(Et==null?void 0:Et.messages.reverse())):Ne([].concat(Object(l.a)(ke),Object(l.a)(Et==null?void 0:Et.messages.reverse()))));case 5:case"end":return Ht.stop()}},Mt)}));return function(){return Lt.apply(this,arguments)}}();Object(g.useEffect)(function(){console.log("newData.length:",Qe,Jt.length,Jt),Qe.page===1&&Di&&(rt.current.scrollTop=rt.current.scrollHeight)},[ke]),Object(g.useEffect)(function(){rt.current.onclick=function(Lt){Lt.target.nodeName==="IMG"&&Lt.target.alt!==""&&Ae.a.publish("preview-image",Lt.target.src)}},[]);var _t=function(){var Lt=Object(U.a)(D.a.mark(function Mt(Et,ht){var _i;return D.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.next=2,Object(Ee.a)(Object(N.a)(Object(N.a)({},He),{},{id:Et.id}));case 2:_i=zt.sent,_i.status===0&&(ke.splice(ht,1),Ne(Object(l.a)(ke)));case 4:case"end":return zt.stop()}},Mt)}));return function(Et,ht){return Lt.apply(this,arguments)}}(),wt=function(){var Lt=Object(U.a)(D.a.mark(function Mt(){return D.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:if(!(Je==="")){ht.next=3;break}return Y.b.error("\u8BF7\u8F93\u5165\u60A8\u7684\u56DE\u590D"),ht.abrupt("return",!1);case 3:return dt(""),ye(!0),ht.next=7,Object(Ee.g)(Object(N.a)(Object(N.a)({},He),{},{content:Je,target_id:Ve==null?void 0:Ve.target_ids}));case 7:ye(!1),Qe.page=1,tt.resetFields(),fi();case 11:case"end":return ht.stop()}},Mt)}));return function(){return Lt.apply(this,arguments)}}(),Bt=Object(g.useMemo)(function(){var Lt=xe||{},Mt=Lt.userInfo;return(Mt==null?void 0:Mt.is_teacher)&&(Mt==null?void 0:Mt.professional_certification)},[xe]);return d.a.createElement("section",null,d.a.createElement("aside",{className:T.a.listMessage,ref:rt},d.a.createElement(C.a,{isReverse:!0,loadMore:function(){Qe.page++,fi()},hasMore:ve,useWindow:!1},!ve&&d.a.createElement("div",{className:"tc mt20 animated fadeIn"},d.a.createElement("span",{className:T.a.msgDate},"\u6CA1\u6709\u4FE1\u606F\u4E86\uFF5E\uFF5E")),d.a.createElement(f.a,{spinning:be["messages/getPrivateMessageDetails"]},d.a.createElement("aside",{className:"minH500"},ke==null?void 0:ke.map(function(Lt,Mt){var Et;return d.a.createElement("aside",{key:Mt},d.a.createElement($.a,{justify:"center"},d.a.createElement(X.a,{flex:"1",className:"tc"},d.a.createElement("span",{className:T.a.msgDate},L()(Lt.send_time).format("YYYY-MM-DD")))),d.a.createElement($.a,{onClick:function(){return Object(Re.J)(Lt)}},d.a.createElement(X.a,{flex:"58px"},d.a.createElement("img",{src:S.a.IMG_SERVER+"/images/"+(Lt==null||((Et=Lt.sender)===null||Et===void 0)?void 0:Et.image_url),alt:""})),d.a.createElement(X.a,null,d.a.createElement("div",{className:T.a.msg},d.a.createElement(x.a,{value:Lt.content||""}),d.a.createElement("span",{onClick:function(){return _t(Lt,Mt)},className:["current",T.a.deleteMsg].join(" ")},"\u5220\u9664"))),d.a.createElement(X.a,null,d.a.createElement("span",{className:"c-grey-c ml10"},L()(Lt.send_time).format("HH:mm")))))}))))),d.a.createElement("aside",{className:"pl30 pr30 mb30 mt30"},Bt?d.a.createElement(ae.a,{form:tt},d.a.createElement(ae.a.Item,{name:"content"},d.a.createElement(Te.a,{placeholder:"\u8BF7\u8F93\u5165\u4F60\u7684\u56DE\u590D",height:150,onChange:function(Mt){return dt(Mt)}})),d.a.createElement($.a,null,d.a.createElement(X.a,{flex:"1"},d.a.createElement("span",{className:"c-red font14"},"\u5728\u95EE\u9898\u53CD\u9988\u65F6\uFF0C\u8BF7\u540C\u65F6\u53D1\u9001\u95EE\u9898\u53D1\u751F\u9875\u7684\u7F51\u5740\u94FE\u63A5\uFF0C\u4EE5\u4FBF\u6211\u4EEC\u9AD8\u6548\u7684\u4E3A\u60A8\u670D\u52A1")),d.a.createElement(X.a,null,d.a.createElement(P.a,{loading:de,type:"primary",onClick:function(){return wt()}},"\u56DE\u590D")))):d.a.createElement("p",{className:"c-red font14",style:{textAlign:"center"}},"\u4EC5\u804C\u4E1A\u8BA4\u8BC1\u7684\u6559\u5E08\u53EF\u4EE5\u4F7F\u7528\u79C1\u4FE1\u529F\u80FD")),d.a.createElement(le.a,null))},qe=Object(u.a)(function(Ie){var Me=Ie.messages,Ge=Ie.loading,se=Ie.user,be=Ie.globalSetting;return{messages:Me,globalSetting:be,user:se,loading:Ge.effects}})(Pe),ze=J("30zm"),et=function(Me){var Ge,se=Me.messages,be=Me.globalSetting,xe=Me.loading,Se=Me.user,Be=Me.dispatch,He=Object(W.a)(Me,["messages","globalSetting","loading","user","dispatch"]),Ye=He.match.params,Ve=He.location.query,lt=Se.userInfo,$e=se.tidingsList,Qe=se.privateMessageDetails,De=Object(g.useState)({per_page:20,page:1}),ct=Object(G.a)(De,2),ut=ct[0],ke=ct[1],Ne=Object(g.useState)({per_page:20,page:1}),_e=Object(G.a)(Ne,2),fe=_e[0],ve=_e[1],ie=Object(g.useState)([]),re=Object(G.a)(ie,2),oe=re[0],de=re[1],ye=Object(g.useState)([]),Le=Object(G.a)(ye,2),Ue=Le[0],Je=Le[1];Object(g.useEffect)(function(){ut.page=1},[Ye.userId]);var dt=function(){var mt=Object(U.a)(D.a.mark(function yt(){var tt;return D.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return Ct.next=2,Be({type:"messages/getPrivateMessageDetails",payload:Object(N.a)(Object(N.a)({},Ye),{},{target_id:Ve==null?void 0:Ve.target_ids})});case 2:tt=Ct.sent,tt!=null&&tt.messages&&de(tt.messages);case 4:case"end":return Ct.stop()}},yt)}));return function(){return mt.apply(this,arguments)}}(),rt=function(){var mt=Object(U.a)(D.a.mark(function yt(){var tt;return D.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return Ct.next=2,Be({type:"messages/getPrivateMessages",payload:Object(N.a)(Object(N.a)({},Ye),fe)});case 2:tt=Ct.sent,tt!=null&&tt.private_messages&&Je(tt.private_messages);case 4:case"end":return Ct.stop()}},yt)}));return function(){return mt.apply(this,arguments)}}();return d.a.createElement("section",{className:T.a.bg},d.a.createElement("section",{className:"edu-container mt20"},d.a.createElement($.a,{gutter:[20,20]},d.a.createElement(ze.a,null),d.a.createElement(X.a,{flex:"1"},d.a.createElement("aside",{className:"bg-white"},d.a.createElement("aside",{className:["font16",T.a.topBar].join(" ")},d.a.createElement($.a,null,d.a.createElement(X.a,{flex:"30px",className:"tc"},d.a.createElement(m.a,{to:"/messages/".concat(Ye.userId,"/private_messages"),className:"iconfont icon-zuojiantou c-black pl10"})),d.a.createElement(X.a,{flex:"1",className:"tc"},Qe==null||((Ge=Qe.target)===null||Ge===void 0)?void 0:Ge.name,"\u4E0E\u4F60\u7684\u79C1\u4FE1"),d.a.createElement(X.a,{flex:"290px",className:"tl"},d.a.createElement("span",{className:"pl30"},"\u79C1\u4FE1\u5217\u8868")))),d.a.createElement($.a,null,d.a.createElement(X.a,{flex:"1"},d.a.createElement(qe,null)),d.a.createElement(X.a,{flex:"290px"},d.a.createElement(O,null))))))))},nt=ge.default=Object(u.a)(function(Ie){var Me=Ie.messages,Ge=Ie.loading,se=Ie.user,be=Ie.globalSetting;return{messages:Me,globalSetting:be,user:se,loading:Ge.effects}})(et)},fjLI:function(ot,ge,J){"use strict";J.d(ge,"f",function(){return m}),J.d(ge,"b",function(){return u}),J.d(ge,"a",function(){return a}),J.d(ge,"d",function(){return f}),J.d(ge,"e",function(){return l}),J.d(ge,"c",function(){return h});var ne=J("8HAY"),$=J("Vhoy"),k=J("MI8n"),X=J("JYp7"),N=J("pmY6"),U=J("24hK"),G=J("nnTU"),W=J("T8No"),i=J("Cg/j"),D=J("t9D7"),g=function(o,s,A,_){var w=arguments.length,L=w<3?s:_===null?_=Object.getOwnPropertyDescriptor(s,A):_,R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(o,s,A,_);else for(var C=o.length-1;C>=0;C--)(R=o[C])&&(L=(w<3?R(L):w>3?R(s,A,L):R(s,A))||L);return w>3&&L&&Object.defineProperty(s,A,L),L},d=function(o,s){return function(A,_){s(A,_,o)}};function m(o){return o.command!==void 0}class u{constructor(o){this.id=u._idPool++,this._debugName=o}}u._idPool=0,u.CommandPalette=new u("CommandPalette"),u.EditorContext=new u("EditorContext"),u.SimpleEditorContext=new u("SimpleEditorContext"),u.EditorContextCopy=new u("EditorContextCopy"),u.EditorContextPeek=new u("EditorContextPeek"),u.MenubarEditMenu=new u("MenubarEditMenu"),u.MenubarCopy=new u("MenubarCopy"),u.MenubarGoMenu=new u("MenubarGoMenu"),u.MenubarSelectionMenu=new u("MenubarSelectionMenu"),u.InlineCompletionsActions=new u("InlineCompletionsActions");const a=Object(i.c)("menuService"),f=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new k.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:o=>o===u.CommandPalette}}addCommand(o){return this.addCommands(X.a.single(o))}addCommands(o){for(const s of o)this._commands.set(s.id,s);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(N.i)(()=>{let s=!1;for(const A of o)s=this._commands.delete(A.id)||s;s&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(o){return this._commands.get(o)}getCommands(){const o=new Map;return this._commands.forEach((s,A)=>o.set(A,s)),o}appendMenuItem(o,s){return this.appendMenuItems(X.a.single({id:o,item:s}))}appendMenuItems(o){const s=new Set,A=new U.a;for(const{id:_,item:w}of o){let L=this._menuItems.get(_);L||(L=new U.a,this._menuItems.set(_,L)),A.push(L.push(w)),s.add(_)}return this._onDidChangeMenu.fire(s),Object(N.i)(()=>{if(A.size>0){for(let _ of A)_();this._onDidChangeMenu.fire(s),A.clear()}})}getMenuItems(o){let s;return this._menuItems.has(o)?s=[...this._menuItems.get(o)]:s=[],o===u.CommandPalette&&this._appendImplicitItems(s),s}_appendImplicitItems(o){const s=new Set;for(const A of o)m(A)&&(s.add(A.command.id),A.alt&&s.add(A.alt.id));this._commands.forEach((A,_)=>{s.has(_)||o.push({command:A})})}};class l extends ne.e{constructor(o,s,A,_){super(`submenuitem.${o.submenu.id}`,typeof o.title=="string"?o.title:o.title.value,[],"submenu");this.item=o,this._menuService=s,this._contextKeyService=A,this._options=_}get actions(){const o=[],s=this._menuService.createMenu(this.item.submenu,this._contextKeyService),A=s.getActions(this._options);s.dispose();for(const[,_]of A)_.length>0&&(o.push(..._),o.push(new ne.d));return o.length&&o.pop(),o}}let h=class o{constructor(s,A,_,w,L){var R,C;if(this._commandService=L,this.id=s.id,this.label=(_==null?void 0:_.renderShortTitle)&&s.shortTitle?typeof s.shortTitle=="string"?s.shortTitle:s.shortTitle.value:typeof s.title=="string"?s.title:s.title.value,this.tooltip=(C=typeof s.tooltip=="string"?s.tooltip:(R=s.tooltip)===null||R===void 0?void 0:R.value)!==null&&C!==void 0?C:"",this.enabled=!s.precondition||w.contextMatchesRules(s.precondition),this.checked=void 0,s.toggled){const S=s.toggled.condition?s.toggled:{condition:s.toggled};this.checked=w.contextMatchesRules(S.condition),this.checked&&S.tooltip&&(this.tooltip=typeof S.tooltip=="string"?S.tooltip:S.tooltip.value),S.title&&(this.label=typeof S.title=="string"?S.title:S.title.value)}this.item=s,this.alt=A?new o(A,void 0,_,w,L):void 0,this._options=_,D.d.isThemeIcon(s.icon)&&(this.class=$.a.asClassName(s.icon))}dispose(){}run(...s){var A,_;let w=[];return((A=this._options)===null||A===void 0?void 0:A.arg)&&(w=[...w,this._options.arg]),((_=this._options)===null||_===void 0?void 0:_.shouldForwardArgs)&&(w=[...w,...s]),this._commandService.executeCommand(this.id,...w)}};h=g([d(3,W.b),d(4,G.b)],h)},ic2d:function(ot,ge,J){"use strict";J.d(ge,"a",function(){return X});var ne=J("FWmy"),$=J("746U");class k{constructor(){this.data=new Map}add(N,U){ne.a($.l(N)),ne.a($.k(U)),ne.a(!this.data.has(N),"There is already an extension with this id"),this.data.set(N,U)}as(N){return this.data.get(N)||null}}const X=new k},kSUc:function(ot,ge,J){},"kaH+":function(ot,ge,J){"use strict";var ne=J("+L6B"),$=J("2/Rp"),k=J("tJVT"),X=J("q1tI"),N=J.n(X),U=J("UZu5"),G=J.n(U),W=J("dhSg"),i=J("rLCj"),D=J("dF/Y"),g=J("4i/N");ge.a=function(){var d=Object(X.useState)(""),m=Object(k.a)(d,2),u=m[0],a=m[1],f=Object(X.useState)(0),l=Object(k.a)(f,2),h=l[0],o=l[1],s=Object(X.useRef)("");Object(X.useEffect)(function(){var S=W.a.subscribe("preview-image",function(x){a(x),document.body.style.overflow="hidden"});return S},[]),Object(X.useEffect)(function(){return document.addEventListener("keydown",A),function(){document.removeEventListener("keydown",A)}},[]),Object(X.useEffect)(function(){s.current=u},[u]);function A(S){S.keyCode==27&&s.current&&_()}function _(){document.body.style.overflow="auto",a("")}function w(){o(h+90)}var L=Object(X.useRef)(),R=Object(X.useRef)(),C=function(x){(x.nativeEvent.target===L.current||x.nativeEvent.target===R.current)&&_()};return N.a.createElement(X.Fragment,null,u?N.a.createElement("div",{className:"image-preview-container",ref:L,onClick:C},N.a.createElement("div",{className:"button-group"},N.a.createElement($.a,{onClick:w},"\u65CB\u8F6C",N.a.createElement(i.a,null)),N.a.createElement($.a,{href:u},"\u4E0B\u8F7D",N.a.createElement(D.a,null)),N.a.createElement($.a,{onClick:_},"\u5173\u95ED",N.a.createElement(g.a,null))),N.a.createElement("div",{className:"preview-wrp-group",ref:R},N.a.createElement("img",{className:"image-preview",src:u,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(h,"deg)")}}))):null)}},kzJb:function(ot,ge,J){ot.exports={flex_box_center:"flex_box_center___2qtoc",flex_space_between:"flex_space_between___NF1Yf",flex_box_vertical_center:"flex_box_vertical_center___2qH_j",flex_box_center_end:"flex_box_center_end___22P0N",flex_box_column:"flex_box_column___1IKP8",userInfo:"userInfo___2Dupy",navInfo:"navInfo___3fEvD",actived:"actived___3F322",newTip:"newTip___1Ta-b"}},lZu9:function(ot,ge,J){(function(ne){ne(J("VrN/"),J("1eCo"),J("8EBN"))})(function(ne){"use strict";ne.defineMode("markdown",function($,k){var X=ne.getMode($,"text/html"),N=X.name=="null";function U(P){if(ne.findModeByName){var b=ne.findModeByName(P);b&&(P=b.mime||b.mimes[0])}var Y=ne.getMode($,P);return Y.name=="null"?null:Y}k.highlightFormatting===void 0&&(k.highlightFormatting=!1),k.maxBlockquoteDepth===void 0&&(k.maxBlockquoteDepth=0),k.taskLists===void 0&&(k.taskLists=!1),k.strikethrough===void 0&&(k.strikethrough=!1),k.emoji===void 0&&(k.emoji=!1),k.fencedCodeBlockHighlighting===void 0&&(k.fencedCodeBlockHighlighting=!0),k.fencedCodeBlockDefaultMode===void 0&&(k.fencedCodeBlockDefaultMode="text/plain"),k.xml===void 0&&(k.xml=!0),k.tokenTypeOverrides===void 0&&(k.tokenTypeOverrides={});var G={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 W in G)G.hasOwnProperty(W)&&k.tokenTypeOverrides[W]&&(G[W]=k.tokenTypeOverrides[W]);var i=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,d=k.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,a=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,h=" ";function o(P,b,Y){return b.f=b.inline=Y,Y(P,b)}function s(P,b,Y){return b.f=b.block=Y,Y(P,b)}function A(P){return!P||!/\S/.test(P.string)}function _(P){if(P.linkTitle=!1,P.linkHref=!1,P.linkText=!1,P.em=!1,P.strong=!1,P.strikethrough=!1,P.quote=0,P.indentedCode=!1,P.f==L){var b=N;if(!b){var Y=ne.innerMode(X,P.htmlState);b=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}b&&(P.f=x,P.block=w,P.htmlState=null)}return P.trailingSpace=0,P.trailingSpaceNewLine=!1,P.prevLine=P.thisLine,P.thisLine={stream:null},null}function w(P,b){var Y=P.column()===b.indentation,ee=A(b.prevLine.stream),ae=b.indentedCode,le=b.prevLine.hr,Re=b.list!==!1,Ee=(b.listStack[b.listStack.length-1]||0)+3;b.indentedCode=!1;var Te=b.indentation;if(b.indentationDiff===null&&(b.indentationDiff=b.indentation,Re)){for(b.list=null;Te<b.listStack[b.listStack.length-1];)b.listStack.pop(),b.listStack.length?b.indentation=b.listStack[b.listStack.length-1]:b.list=!1;b.list!==!1&&(b.indentationDiff=Te-b.listStack[b.listStack.length-1])}var Ae=!ee&&!le&&!b.prevLine.header&&(!Re||!ae)&&!b.prevLine.fencedCodeEnd,Oe=(b.list===!1||le||ee)&&b.indentation<=Ee&&P.match(i),ce=null;if(b.indentationDiff>=4&&(ae||b.prevLine.fencedCodeEnd||b.prevLine.header||ee))return P.skipToEnd(),b.indentedCode=!0,G.code;if(P.eatSpace())return null;if(Y&&b.indentation<=Ee&&(ce=P.match(d))&&ce[1].length<=6)return b.quote=0,b.header=ce[1].length,b.thisLine.header=!0,k.highlightFormatting&&(b.formatting="header"),b.f=b.inline,C(b);if(b.indentation<=Ee&&P.eat(">"))return b.quote=Y?1:b.quote+1,k.highlightFormatting&&(b.formatting="quote"),P.eatSpace(),C(b);if(!Oe&&!b.setext&&Y&&b.indentation<=Ee&&(ce=P.match(D))){var ue=ce[1]?"ol":"ul";return b.indentation=Te+P.current().length,b.list=!0,b.quote=0,b.listStack.push(b.indentation),b.em=!1,b.strong=!1,b.code=!1,b.strikethrough=!1,k.taskLists&&P.match(g,!1)&&(b.taskList=!0),b.f=b.inline,k.highlightFormatting&&(b.formatting=["list","list-"+ue]),C(b)}else{if(Y&&b.indentation<=Ee&&(ce=P.match(a,!0)))return b.quote=0,b.fencedEndRE=new RegExp(ce[1]+"+ *$"),b.localMode=k.fencedCodeBlockHighlighting&&U(ce[2]||k.fencedCodeBlockDefaultMode),b.localMode&&(b.localState=ne.startState(b.localMode)),b.f=b.block=R,k.highlightFormatting&&(b.formatting="code-block"),b.code=-1,C(b);if(b.setext||(!Ae||!Re)&&!b.quote&&b.list===!1&&!b.code&&!Oe&&!f.test(P.string)&&(ce=P.lookAhead(1))&&(ce=ce.match(m)))return b.setext?(b.header=b.setext,b.setext=0,P.skipToEnd(),k.highlightFormatting&&(b.formatting="header")):(b.header=ce[0].charAt(0)=="="?1:2,b.setext=b.header),b.thisLine.header=!0,b.f=b.inline,C(b);if(Oe)return P.skipToEnd(),b.hr=!0,b.thisLine.hr=!0,G.hr;if(P.peek()==="[")return o(P,b,F)}return o(P,b,b.inline)}function L(P,b){var Y=X.token(P,b.htmlState);if(!N){var ee=ne.innerMode(X,b.htmlState);(ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText||b.md_inside&&P.current().indexOf(">")>-1)&&(b.f=x,b.block=w,b.htmlState=null)}return Y}function R(P,b){var Y=b.listStack[b.listStack.length-1]||0,ee=b.indentation<Y,ae=Y+3;if(b.fencedEndRE&&b.indentation<=ae&&(ee||P.match(b.fencedEndRE))){k.highlightFormatting&&(b.formatting="code-block");var le;return ee||(le=C(b)),b.localMode=b.localState=null,b.block=w,b.f=x,b.fencedEndRE=null,b.code=0,b.thisLine.fencedCodeEnd=!0,ee?s(P,b,b.block):le}else return b.localMode?b.localMode.token(P,b.localState):(P.skipToEnd(),G.code)}function C(P){var b=[];if(P.formatting){b.push(G.formatting),typeof P.formatting=="string"&&(P.formatting=[P.formatting]);for(var Y=0;Y<P.formatting.length;Y++)b.push(G.formatting+"-"+P.formatting[Y]),P.formatting[Y]==="header"&&b.push(G.formatting+"-"+P.formatting[Y]+"-"+P.header),P.formatting[Y]==="quote"&&(!k.maxBlockquoteDepth||k.maxBlockquoteDepth>=P.quote?b.push(G.formatting+"-"+P.formatting[Y]+"-"+P.quote):b.push("error"))}if(P.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(P.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(P.linkHref?b.push(G.linkHref,"url"):(P.strong&&b.push(G.strong),P.em&&b.push(G.em),P.strikethrough&&b.push(G.strikethrough),P.emoji&&b.push(G.emoji),P.linkText&&b.push(G.linkText),P.code&&b.push(G.code),P.image&&b.push(G.image),P.imageAltText&&b.push(G.imageAltText,"link"),P.imageMarker&&b.push(G.imageMarker)),P.header&&b.push(G.header,G.header+"-"+P.header),P.quote&&(b.push(G.quote),!k.maxBlockquoteDepth||k.maxBlockquoteDepth>=P.quote?b.push(G.quote+"-"+P.quote):b.push(G.quote+"-"+k.maxBlockquoteDepth)),P.list!==!1){var ee=(P.listStack.length-1)%3;ee?ee===1?b.push(G.list2):b.push(G.list3):b.push(G.list1)}return P.trailingSpaceNewLine?b.push("trailing-space-new-line"):P.trailingSpace&&b.push("trailing-space-"+(P.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function S(P,b){return P.match(u,!0)?C(b):void 0}function x(P,b){var Y=b.text(P,b);if(typeof Y!="undefined")return Y;if(b.list)return b.list=null,C(b);if(b.taskList){var ee=P.match(g,!0)[1]===" ";return ee?b.taskOpen=!0:b.taskClosed=!0,k.highlightFormatting&&(b.formatting="task"),b.taskList=!1,C(b)}if(b.taskOpen=!1,b.taskClosed=!1,b.header&&P.match(/^#+$/,!0))return k.highlightFormatting&&(b.formatting="header"),C(b);var ae=P.next();if(b.linkTitle){b.linkTitle=!1;var le=ae;ae==="("&&(le=")"),le=(le+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Re="^\\s*(?:[^"+le+"\\\\]+|\\\\\\\\|\\\\.)"+le;if(P.match(new RegExp(Re),!0))return G.linkHref}if(ae==="`"){var Ee=b.formatting;k.highlightFormatting&&(b.formatting="code"),P.eatWhile("`");var Te=P.current().length;if(b.code==0&&(!b.quote||Te==1))return b.code=Te,C(b);if(Te==b.code){var Ae=C(b);return b.code=0,Ae}else return b.formatting=Ee,C(b)}else if(b.code)return C(b);if(ae==="\\"&&(P.next(),k.highlightFormatting)){var Oe=C(b),ce=G.formatting+"-escape";return Oe?Oe+" "+ce:ce}if(ae==="!"&&P.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.imageMarker=!0,b.image=!0,k.highlightFormatting&&(b.formatting="image"),C(b);if(ae==="["&&b.imageMarker&&P.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return b.imageMarker=!1,b.imageAltText=!0,k.highlightFormatting&&(b.formatting="image"),C(b);if(ae==="]"&&b.imageAltText){k.highlightFormatting&&(b.formatting="image");var Oe=C(b);return b.imageAltText=!1,b.image=!1,b.inline=b.f=T,Oe}if(ae==="["&&!b.image)return b.linkText&&P.match(/^.*?\]/)||(b.linkText=!0,k.highlightFormatting&&(b.formatting="link")),C(b);if(ae==="]"&&b.linkText){k.highlightFormatting&&(b.formatting="link");var Oe=C(b);return b.linkText=!1,b.inline=b.f=P.match(/\(.*?\)| ?\[.*?\]/,!1)?T:x,Oe}if(ae==="<"&&P.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=p,k.highlightFormatting&&(b.formatting="link");var Oe=C(b);return Oe?Oe+=" ":Oe="",Oe+G.linkInline}if(ae==="<"&&P.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=p,k.highlightFormatting&&(b.formatting="link");var Oe=C(b);return Oe?Oe+=" ":Oe="",Oe+G.linkEmail}if(k.xml&&ae==="<"&&P.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ue=P.string.indexOf(">",P.pos);if(ue!=-1){var Pe=P.string.substring(P.start,ue);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Pe)&&(b.md_inside=!0)}return P.backUp(1),b.htmlState=ne.startState(X),s(P,b,L)}if(k.xml&&ae==="<"&&P.match(/^\/\w*?>/))return b.md_inside=!1,"tag";if(ae==="*"||ae==="_"){for(var qe=1,ze=P.pos==1?" ":P.string.charAt(P.pos-2);qe<3&&P.eat(ae);)qe++;var et=P.peek()||" ",nt=!/\s/.test(et)&&(!l.test(et)||/\s/.test(ze)||l.test(ze)),Ie=!/\s/.test(ze)&&(!l.test(ze)||/\s/.test(et)||l.test(et)),Me=null,Ge=null;if(qe%2&&(!b.em&&nt&&(ae==="*"||!Ie||l.test(ze))?Me=!0:b.em==ae&&Ie&&(ae==="*"||!nt||l.test(et))&&(Me=!1)),qe>1&&(!b.strong&&nt&&(ae==="*"||!Ie||l.test(ze))?Ge=!0:b.strong==ae&&Ie&&(ae==="*"||!nt||l.test(et))&&(Ge=!1)),Ge!=null||Me!=null){k.highlightFormatting&&(b.formatting=Me==null?"strong":Ge==null?"em":"strong em"),Me===!0&&(b.em=ae),Ge===!0&&(b.strong=ae);var Ae=C(b);return Me===!1&&(b.em=!1),Ge===!1&&(b.strong=!1),Ae}}else if(ae===" "&&(P.eat("*")||P.eat("_"))){if(P.peek()===" ")return C(b);P.backUp(1)}if(k.strikethrough){if(ae==="~"&&P.eatWhile(ae)){if(b.strikethrough){k.highlightFormatting&&(b.formatting="strikethrough");var Ae=C(b);return b.strikethrough=!1,Ae}else if(P.match(/^[^\s]/,!1))return b.strikethrough=!0,k.highlightFormatting&&(b.formatting="strikethrough"),C(b)}else if(ae===" "&&P.match(/^~~/,!0)){if(P.peek()===" ")return C(b);P.backUp(2)}}if(k.emoji&&ae===":"&&P.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){b.emoji=!0,k.highlightFormatting&&(b.formatting="emoji");var se=C(b);return b.emoji=!1,se}return ae===" "&&(P.match(/^ +$/,!1)?b.trailingSpace++:b.trailingSpace&&(b.trailingSpaceNewLine=!0)),C(b)}function p(P,b){var Y=P.next();if(Y===">"){b.f=b.inline=x,k.highlightFormatting&&(b.formatting="link");var ee=C(b);return ee?ee+=" ":ee="",ee+G.linkInline}return P.match(/^[^>]+/,!0),G.linkInline}function T(P,b){if(P.eatSpace())return null;var Y=P.next();return Y==="("||Y==="["?(b.f=b.inline=y(Y==="("?")":"]"),k.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,C(b)):"error"}var v={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function y(P){return function(b,Y){var ee=b.next();if(ee===P){Y.f=Y.inline=x,k.highlightFormatting&&(Y.formatting="link-string");var ae=C(Y);return Y.linkHref=!1,ae}return b.match(v[P]),Y.linkHref=!0,C(Y)}}function F(P,b){return P.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=B,P.next(),k.highlightFormatting&&(b.formatting="link"),b.linkText=!0,C(b)):o(P,b,x)}function B(P,b){if(P.match(/^\]:/,!0)){b.f=b.inline=O,k.highlightFormatting&&(b.formatting="link");var Y=C(b);return b.linkText=!1,Y}return P.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function O(P,b){return P.eatSpace()?null:(P.match(/^[^\s]+/,!0),P.peek()===void 0?b.linkTitle=!0:P.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),b.f=b.inline=x,G.linkHref+" url")}var j={startState:function(){return{f:w,prevLine:{stream:null},thisLine:{stream:null},block:w,htmlState:null,indentation:0,inline:x,text:S,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(P){return{f:P.f,prevLine:P.prevLine,thisLine:P.thisLine,block:P.block,htmlState:P.htmlState&&ne.copyState(X,P.htmlState),indentation:P.indentation,localMode:P.localMode,localState:P.localMode?ne.copyState(P.localMode,P.localState):null,inline:P.inline,text:P.text,formatting:!1,linkText:P.linkText,linkTitle:P.linkTitle,linkHref:P.linkHref,code:P.code,em:P.em,strong:P.strong,strikethrough:P.strikethrough,emoji:P.emoji,header:P.header,setext:P.setext,hr:P.hr,taskList:P.taskList,list:P.list,listStack:P.listStack.slice(0),quote:P.quote,indentedCode:P.indentedCode,trailingSpace:P.trailingSpace,trailingSpaceNewLine:P.trailingSpaceNewLine,md_inside:P.md_inside,fencedEndRE:P.fencedEndRE}},token:function(P,b){if(b.formatting=!1,P!=b.thisLine.stream){if(b.header=0,b.hr=!1,P.match(/^\s*$/,!0))return _(b),null;if(b.prevLine=b.thisLine,b.thisLine={stream:P},b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,!b.localState&&(b.f=b.block,b.f!=L)){var Y=P.match(/^\s*/,!0)[0].replace(/\t/g,h).length;if(b.indentation=Y,b.indentationDiff=null,Y>0)return null}}return b.f(P,b)},innerMode:function(P){return P.block==L?{state:P.htmlState,mode:X}:P.localState?{state:P.localState,mode:P.localMode}:{state:P,mode:j}},indent:function(P,b,Y){return P.block==L&&X.indent?X.indent(P.htmlState,b,Y):P.localState&&P.localMode.indent?P.localMode.indent(P.localState,b,Y):ne.Pass},blankLine:_,getType:C,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return j},"xml"),ne.defineMIME("text/markdown","markdown"),ne.defineMIME("text/x-markdown","markdown")})},nEHx:function(ot,ge,J){"use strict";J.d(ge,"a",function(){return ne});var ne;(function($){$.DARK="dark",$.LIGHT="light",$.HIGH_CONTRAST="hc"})(ne||(ne={}))},nnTU:function(ot,ge,J){"use strict";J.d(ge,"b",function(){return G}),J.d(ge,"a",function(){return W});var ne=J("MI8n"),$=J("JYp7"),k=J("pmY6"),X=J("24hK"),N=J("746U"),U=J("Cg/j");const G=Object(U.c)("commandService"),W=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ne.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,D){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!D)throw new Error("invalid command");return this.registerCommand({id:i,handler:D})}if(i.description){const a=[];for(let l of i.description.args)a.push(l.constraint);const f=i.handler;i.handler=function(l,...h){return Object(N.o)(h,a),f(l,...h)}}const{id:g}=i;let d=this._commands.get(g);d||(d=new X.a,this._commands.set(g,d));let m=d.unshift(i),u=Object(k.i)(()=>{m();const a=this._commands.get(g);(a==null?void 0:a.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),u}registerCommandAlias(i,D){return W.registerCommand(i,(g,...d)=>g.get(G).executeCommand(D,...d))}getCommand(i){const D=this._commands.get(i);return!D||D.isEmpty()?void 0:$.a.first(D)}getCommands(){const i=new Map;for(const D of this._commands.keys()){const g=this.getCommand(D);g&&i.set(D,g)}return i}};W.registerCommand("noop",()=>{})},osHv:function(ot,ge,J){(function(ne){ne(J("VrN/"))})(function(ne){"use strict";var $=ne.Pos;function k(l,h){return l.line-h.line||l.ch-h.ch}var X="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",N=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",U=new RegExp("<(/?)(["+X+"]["+N+"]*)","g");function G(l,h,o,s){this.line=h,this.ch=o,this.cm=l,this.text=l.getLine(h),this.min=s?Math.max(s.from,l.firstLine()):l.firstLine(),this.max=s?Math.min(s.to-1,l.lastLine()):l.lastLine()}function W(l,h){var o=l.cm.getTokenTypeAt($(l.line,h));return o&&/\btag\b/.test(o)}function i(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function D(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function g(l){for(;;){var h=l.text.indexOf(">",l.ch);if(h==-1){if(i(l))continue;return}if(!W(l,h+1)){l.ch=h+1;continue}var o=l.text.lastIndexOf("/",h),s=o>-1&&!/\S/.test(l.text.slice(o+1,h));return l.ch=h+1,s?"selfClose":"regular"}}function d(l){for(;;){var h=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(h==-1){if(D(l))continue;return}if(!W(l,h+1)){l.ch=h;continue}U.lastIndex=h,l.ch=h;var o=U.exec(l.text);if(o&&o.index==h)return o}}function m(l){for(;;){U.lastIndex=l.ch;var h=U.exec(l.text);if(!h){if(i(l))continue;return}if(!W(l,h.index+1)){l.ch=h.index+1;continue}return l.ch=h.index+h[0].length,h}}function u(l){for(;;){var h=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(h==-1){if(D(l))continue;return}if(!W(l,h+1)){l.ch=h;continue}var o=l.text.lastIndexOf("/",h),s=o>-1&&!/\S/.test(l.text.slice(o+1,h));return l.ch=h+1,s?"selfClose":"regular"}}function a(l,h){for(var o=[];;){var s=m(l),A,_=l.line,w=l.ch-(s?s[0].length:0);if(!s||!(A=g(l)))return;if(A=="selfClose")continue;if(s[1]){for(var L=o.length-1;L>=0;--L)if(o[L]==s[2]){o.length=L;break}if(L<0&&(!h||h==s[2]))return{tag:s[2],from:$(_,w),to:$(l.line,l.ch)}}else o.push(s[2])}}function f(l,h){for(var o=[];;){var s=u(l);if(!s)return;if(s=="selfClose"){d(l);continue}var A=l.line,_=l.ch,w=d(l);if(!w)return;if(w[1])o.push(w[2]);else{for(var L=o.length-1;L>=0;--L)if(o[L]==w[2]){o.length=L;break}if(L<0&&(!h||h==w[2]))return{tag:w[2],from:$(l.line,l.ch),to:$(A,_)}}}}ne.registerHelper("fold","xml",function(l,h){for(var o=new G(l,h.line,0);;){var s=m(o);if(!s||o.line!=h.line)return;var A=g(o);if(!A)return;if(!s[1]&&A!="selfClose"){var _=$(o.line,o.ch),w=a(o,s[2]);return w&&k(w.from,_)>0?{from:_,to:w.from}:null}}}),ne.findMatchingTag=function(l,h,o){var s=new G(l,h.line,h.ch,o);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var A=g(s),_=A&&$(s.line,s.ch),w=A&&d(s);if(!A||!w||k(s,h)>0)return;var L={from:$(s.line,s.ch),to:_,tag:w[2]};return A=="selfClose"?{open:L,close:null,at:"open"}:w[1]?{open:f(s,w[2]),close:L,at:"close"}:(s=new G(l,_.line,_.ch,o),{open:L,close:a(s,w[2]),at:"open"})},ne.findEnclosingTag=function(l,h,o,s){for(var A=new G(l,h.line,h.ch,o);;){var _=f(A,s);if(!_)break;var w=new G(l,h.line,h.ch,o),L=a(w,_.tag);if(L)return{open:_,close:L}}},ne.scanForClosingTag=function(l,h,o,s){var A=new G(l,h.line,h.ch,s?{from:0,to:s}:null);return a(A,o)}})},p5ED:function(ot,ge,J){"use strict";var ne=J("+L6B"),$=J("2/Rp"),k=J("5Dmo"),X=J("3S7+"),N=J("k1fw"),U=J("9og8"),G=J("tJVT"),W=J("WmNS"),i=J.n(W),D=J("q1tI"),g=J.n(D),d=J("vHTk"),m=J.n(d),u=J("yEEn"),a=J("ZW9T"),f=J("1vsH"),l=J("V0Rq"),h=J("m3rI");ge.a=function(o){var s,A,_,w,L,R,C,S=o.editOffice,x=S===void 0?"view":S,p=o.data,T=o.theme,v=o.type,y=o.filename,F=o.monacoEditor,B=o.className,O=o.style,j=o.close,P=o.onClose,b=o.hasMask,Y=o.disabledDownload,ee=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ae=Object(G.a)(ee,2),le=ae[0],Re=ae[1],Ee=Object(D.useState)(""),Te=Object(G.a)(Ee,2),Ae=Te[0],Oe=Te[1],ce=Object(D.useState)(),ue=Object(G.a)(ce,2),Pe=ue[0],qe=ue[1],ze=window.ENV==="build"?"/react/build":"",et=h.a.PROXY_SERVER||location.origin,nt,Ie=1024*1024,Me=10*Ie,Ge=Object(D.useRef)();(s=p)!==null&&s!==void 0&&s.startsWith("/api")&&v!=="txt"&&(p=h.a.API_SERVER+p),v==="office"&&(nt=Object(f.T)(p).filesize,nt>Me&&(v="other")),y&&F&&(F.filename=y),Object(D.useEffect)(function(){var Se,Be,He=(Se=document.cookie)===null||Se===void 0||((Be=Se.replace(/\s/g,""))===null||Be===void 0)?void 0:Be.split(";");He==null||He.map(function(Ye){var Ve=Ye.split("=");Ve[0]==="_educoder_session"&&Oe(Ve[1])})},[]),Object(D.useEffect)(function(){v==="office"&&se()},[v,p]);var se=function(){var Se=Object(U.a)(i.a.mark(function Be(){var He,Ye,Ve;return i.a.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:return console.log("data:",p),He=p,p.startsWith("http")||(He=location.origin+He),Ye=new URL(He).pathname.split("/").pop(),$e.next=6,Object(l.W)({attachment_id:Ye});case 6:Ve=$e.sent,qe(Ve);case 8:case"end":return $e.stop()}},Be)}));return function(){return Se.apply(this,arguments)}}(),be=function(){if(p.startsWith("http")||p.startsWith("blob:")){xe();return}Object(f.z)(y||"educoder",p,y)},xe=function(){Object(f.x)(y||"educoder",decodeURIComponent(p))};return g.a.createElement("div",{style:Object(N.a)({},O||{}),className:"".concat(b&&m.a.bgBlack," ").concat(v?m.a.wrp:"hide")},j&&g.a.createElement("div",{className:m.a.close,ref:Ge},!Y&&g.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ge.current}},g.a.createElement("span",{onClick:xe},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ge.current}},g.a.createElement("span",{className:"",onClick:P},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(m.a[B]," ").concat(B," ").concat(m.a.monaco," ").concat(v==="txt"?"show":"hide")},v==="txt"&&g.a.createElement(a.b,F)),v==="audio"&&g.a.createElement("audio",{src:"".concat(((A=p)===null||A===void 0?void 0:A.indexOf("http://"))>-1||((_=p)===null||_===void 0?void 0:_.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(p),autoPlay:!0}),v==="video"&&g.a.createElement(g.a.Fragment,null,((w=p)===null||w===void 0?void 0:w.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(p),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(p),autoPlay:!0})),v==="office"&&Pe&&g.a.createElement("iframe",{src:"".concat(ze,"/office.html?key=").concat(Pe.key,"&url=").concat(et+Pe.url,"&callbackUrl=").concat(et+Pe.callbackUrl,"&fileType=").concat(Pe.fileType,"&title=").concat(Pe.title,"&model=").concat(x,"&officeServer=").concat(h.a.OFFICE_SERVER,"&disabledDownload=").concat(!!Y)}),v==="html"&&g.a.createElement("iframe",{src:p+"&disposition=inline"}),v==="pdf"&&g.a.createElement("iframe",{src:"".concat(ze,"/js/pdfview/index.html?url=").concat(p,"&disabledDownload=").concat(!!Y)}),v==="image"&&g.a.createElement("img",{src:"".concat(((L=p)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((R=p)===null||R===void 0?void 0:R.indexOf("https://"))>-1||(C=p)!==null&&C!==void 0&&C.startsWith("/api")?"":"data:image/png;base64,").concat(p)}),v==="other"&&g.a.createElement("div",null,g.a.createElement($.a,{type:"primary",size:"large",onClick:be},g.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),v==="download"&&g.a.createElement($.a,{type:"primary",size:"large",onClick:be},g.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ot,ge,J){},pmY6:function(ot,ge,J){"use strict";J.d(ge,"h",function(){return D}),J.d(ge,"g",function(){return d}),J.d(ge,"f",function(){return m}),J.d(ge,"e",function(){return u}),J.d(ge,"i",function(){return a}),J.d(ge,"b",function(){return f}),J.d(ge,"a",function(){return l}),J.d(ge,"d",function(){return h}),J.d(ge,"c",function(){return o});var ne=J("C/vA"),$=J("JYp7");const k=!1;let X=null;function N(s){X=s}if(k){const s="__is_disposable_tracked__";N(new class{trackDisposable(A){const _=new Error("Potentially leaked disposable").stack;setTimeout(()=>{A[s]||console.log(_)},3e3)}setParent(A,_){if(A&&A!==l.None)try{A[s]=!0}catch(w){}}markAsDisposed(A){if(A&&A!==l.None)try{A[s]=!0}catch(_){}}markAsSingleton(A){}})}function U(s){return X==null||X.trackDisposable(s),s}function G(s){X==null||X.markAsDisposed(s)}function W(s,A){X==null||X.setParent(s,A)}function i(s,A){if(!X)return;for(const _ of s)X.setParent(_,A)}function D(s){return X==null||X.markAsSingleton(s),s}class g extends Error{constructor(s){super(`Encountered errors while disposing of store. Errors: [${s.join(", ")}]`);this.errors=s}}function d(s){return typeof s.dispose=="function"&&s.dispose.length===0}function m(s){if($.a.is(s)){let A=[];for(const _ of s)if(_)try{_.dispose()}catch(w){A.push(w)}if(A.length===1)throw A[0];if(A.length>1)throw new g(A);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function u(...s){const A=a(()=>m(s));return i(s,A),A}function a(s){const A=U({dispose:Object(ne.a)(()=>{G(A),s()})});return A}class f{constructor(){this._toDispose=new Set,this._isDisposed=!1,U(this)}dispose(){if(this._isDisposed)return;G(this),this._isDisposed=!0,this.clear()}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(s){if(!s)return s;if(s===this)throw new Error("Cannot register a disposable on itself!");return W(s,this),this._isDisposed?f.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(s),s}}f.DISABLE_DISPOSED_WARNING=!1;class l{constructor(){this._store=new f,U(this),W(this._store,this)}dispose(){G(this),this._store.dispose()}_register(s){if(s===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(s)}}l.None=Object.freeze({dispose(){}});class h{constructor(){this._isDisposed=!1,U(this)}get value(){return this._isDisposed?void 0:this._value}set value(s){var A;if(this._isDisposed||s===this._value)return;(A=this._value)===null||A===void 0||A.dispose(),s&&W(s,this),this._value=s}clear(){this.value=void 0}dispose(){var s;this._isDisposed=!0,G(this),(s=this._value)===null||s===void 0||s.dispose(),this._value=void 0}clearAndLeak(){const s=this._value;return this._value=void 0,s&&W(s,null),s}}class o{constructor(s){this.object=s}dispose(){}}},psGv:function(ot,ge,J){var ne,$;(function(){var k;(function(){"use strict";var G=[,,function(g){function d(a){this.__parent=a,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}d.prototype.clone_empty=function(){var a=new d(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},d.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},d.prototype.has_match=function(a){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(a))return!0;return!1},d.prototype.set_indent=function(a,f){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},d.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},d.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},d.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var a=this.__parent.current_line;return a.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),a.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),a.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,a.__items[0]===" "&&(a.__items.splice(0,1),a.__character_count-=1),!0}return!1},d.prototype.is_empty=function(){return this.__items.length===0},d.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},d.prototype.push=function(a){this.__items.push(a);var f=a.lastIndexOf(`
|
|
`);f!==-1?this.__character_count=a.length-f:this.__character_count+=a.length},d.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},d.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},d.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},d.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},d.prototype.toString=function(){var a="";return this.is_empty()?this.__parent.indent_empty_lines&&(a=this.__parent.get_indent_string(this.__indent_count)):(a=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),a+=this.__items.join("")),a};function m(a,f){this.__cache=[""],this.__indent_size=a.indent_size,this.__indent_string=a.indent_char,a.indent_with_tabs||(this.__indent_string=new Array(a.indent_size+1).join(a.indent_char)),f=f||"",a.indent_level>0&&(f=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}m.prototype.get_indent_size=function(a,f){var l=this.__base_string_length;return f=f||0,a<0&&(l=0),l+=a*this.__indent_size,l+=f,l},m.prototype.get_indent_string=function(a,f){var l=this.__base_string;return f=f||0,a<0&&(a=0,l=""),f+=a*this.__indent_size,this.__ensure_cache(f),l+=this.__cache[f],l},m.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var a=this.__cache.length,f=0,l="";this.__indent_size&&a>=this.__indent_size&&(f=Math.floor(a/this.__indent_size),a-=f*this.__indent_size,l=new Array(f+1).join(this.__indent_string)),a&&(l+=new Array(a+1).join(" ")),this.__cache.push(l)};function u(a,f){this.__indent_cache=new m(a,f),this.raw=!1,this._end_with_newline=a.end_with_newline,this.indent_size=a.indent_size,this.wrap_line_length=a.wrap_line_length,this.indent_empty_lines=a.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new d(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(a,f){return this.__indent_cache.get_indent_string(a,f)},u.prototype.get_indent_size=function(a,f){return this.__indent_cache.get_indent_size(a,f)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(a){return this.is_empty()||!a&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(a){this.trim(!0);var f=this.current_line.pop();f&&(f[f.length-1]===`
|
|
`&&(f=f.replace(/\n+$/g,"")),this.current_line.push(f)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
|
|
`);return a!==`
|
|
`&&(l=l.replace(/[\n]/g,a)),l},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(a,f){return a=a||0,f=f||0,this.next_line.set_indent(a,f),this.__lines.length>1?(this.current_line.set_indent(a,f),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(a){for(var f=0;f<a.newlines;f++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(a.whitespace_before),this.current_line.push(a.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(a){this.__add_space_before_token(),this.current_line.push(a),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},u.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},u.prototype.remove_indent=function(a){for(var f=this.__lines.length;a<f;)this.__lines[a]._remove_indent(),a++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(a){for(a=a===void 0?!1:a,this.current_line.trim();a&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(a,f){for(var l=this.__lines.length-2;l>=0;){var h=this.__lines[l];if(h.is_empty())break;if(h.item(0).indexOf(a)!==0&&h.item(-1)!==f){this.__lines.splice(l+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},g.exports.Output=u},function(g){function d(m,u,a,f){this.type=m,this.text=u,this.comments_before=null,this.newlines=a||0,this.whitespace_before=f||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=d},,,function(g){function d(a,f){this.raw_options=m(a,f),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}d.prototype._get_array=function(a,f){var l=this.raw_options[a],h=f||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(h=l.concat()):typeof l=="string"&&(h=l.split(/[^a-zA-Z0-9_\/\-]+/)),h},d.prototype._get_boolean=function(a,f){var l=this.raw_options[a],h=l===void 0?!!f:!!l;return h},d.prototype._get_characters=function(a,f){var l=this.raw_options[a],h=f||"";return typeof l=="string"&&(h=l.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},d.prototype._get_number=function(a,f){var l=this.raw_options[a];f=parseInt(f,10),isNaN(f)&&(f=0);var h=parseInt(l,10);return isNaN(h)&&(h=f),h},d.prototype._get_selection=function(a,f,l){var h=this._get_selection_list(a,f,l);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[a]+"'");return h[0]},d.prototype._get_selection_list=function(a,f,l){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[f[0]],!this._is_valid_selection(l,f))throw new Error("Invalid Default Value!");var h=this._get_array(a,l);if(!this._is_valid_selection(h,f))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[a]+"'");return h},d.prototype._is_valid_selection=function(a,f){return a.length&&f.length&&!a.some(function(l){return f.indexOf(l)===-1})};function m(a,f){var l={};a=u(a);var h;for(h in a)h!==f&&(l[h]=a[h]);if(f&&a[f])for(h in a[f])l[h]=a[f][h];return l}function u(a){var f={},l;for(l in a){var h=l.replace(/-/g,"_");f[h]=a[l]}return f}g.exports.Options=d,g.exports.normalizeOpts=u,g.exports.mergeOpts=m},,function(g){var d=RegExp.prototype.hasOwnProperty("sticky");function m(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},m.prototype.peek=function(u){var a=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(a=this.__input.charAt(u)),a},m.prototype.__match=function(u,a){u.lastIndex=a;var f=u.exec(this.__input);return f&&!(d&&u.sticky)&&(f.index!==a&&(f=null)),f},m.prototype.test=function(u,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(u,a):!1},m.prototype.testChar=function(u,a){var f=this.peek(a);return u.lastIndex=0,f!==null&&u.test(f)},m.prototype.match=function(u){var a=this.__match(u,this.__position);return a?this.__position+=a[0].length:a=null,a},m.prototype.read=function(u,a,f){var l="",h;return u&&(h=this.match(u),h&&(l+=h[0])),a&&(h||!u)&&(l+=this.readUntil(a,f)),l},m.prototype.readUntil=function(u,a){var f="",l=this.__position;u.lastIndex=this.__position;var h=u.exec(this.__input);return h?(l=h.index,a&&(l+=h[0].length)):l=this.__input_length,f=this.__input.substring(this.__position,l),this.__position=l,f},m.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},m.prototype.get_regexp=function(u,a){var f=null,l="g";return a&&d&&(l="y"),typeof u=="string"&&u!==""?f=new RegExp(u,l):u&&(f=new RegExp(u.source,l)),f},m.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(u){var a=this.__position,f=this.readUntilAfter(u);return this.__position=a,f},m.prototype.lookBack=function(u){var a=this.__position-1;return a>=u.length&&this.__input.substring(a-u.length,a).toLowerCase()===u},g.exports.InputScanner=m},function(g,d,m){var u=m(8).InputScanner,a=m(3).Token,f=m(10).TokenStream,l=m(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(s,A){this._input=new u(s),this._options=A||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new f,this._reset();for(var s,A=new a(h.START,""),_=null,w=[],L=new f;A.type!==h.EOF;){for(s=this._get_next_token(A,_);this._is_comment(s);)L.add(s),s=this._get_next_token(A,_);L.isEmpty()||(s.comments_before=L,L=new f),s.parent=_,this._is_opening(s)?(w.push(_),_=s):_&&this._is_closing(s,_)&&(s.opened=_,_.closed=s,_=w.pop(),s.parent=_),s.previous=A,A.next=s,this.__tokens.add(s),A=s}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(s,A){this._readWhitespace();var _=this._input.read(/.+/g);return _?this._create_token(h.RAW,_):this._create_token(h.EOF,"")},o.prototype._is_comment=function(s){return!1},o.prototype._is_opening=function(s){return!1},o.prototype._is_closing=function(s,A){return!1},o.prototype._create_token=function(s,A){var _=new a(s,A,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return _},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=o,g.exports.TOKEN=h},function(g){function d(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}d.prototype.restart=function(){this.__position=0},d.prototype.isEmpty=function(){return this.__tokens_length===0},d.prototype.hasNext=function(){return this.__position<this.__tokens_length},d.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},d.prototype.peek=function(m){var u=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(u=this.__tokens[m]),u},d.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},g.exports.TokenStream=d},function(g,d,m){var u=m(12).Pattern;function a(f,l){u.call(this,f,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}a.prototype=new u,a.prototype.__set_whitespace_patterns=function(f,l){f+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+f+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},a.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var f=this._input.read(this._match_pattern);if(f===" ")this.whitespace_before_token=" ";else if(f){var l=this.__split(this._newline_regexp,f);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return f},a.prototype.matching=function(f,l){var h=this._create();return h.__set_whitespace_patterns(f,l),h._update(),h},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(f,l){f.lastIndex=0;for(var h=0,o=[],s=f.exec(l);s;)o.push(l.substring(h,s.index)),h=s.index+s[0].length,s=f.exec(l);return h<l.length?o.push(l.substring(h,l.length)):o.push(""),o},g.exports.WhitespacePattern=a},function(g){function d(m,u){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,u&&(this._starting_pattern=this._input.get_regexp(u._starting_pattern,!0),this._match_pattern=this._input.get_regexp(u._match_pattern,!0),this._until_pattern=this._input.get_regexp(u._until_pattern),this._until_after=u._until_after)}d.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},d.prototype.read_match=function(){return this._input.match(this._match_pattern)},d.prototype.until_after=function(m){var u=this._create();return u._until_after=!0,u._until_pattern=this._input.get_regexp(m),u._update(),u},d.prototype.until=function(m){var u=this._create();return u._until_after=!1,u._until_pattern=this._input.get_regexp(m),u._update(),u},d.prototype.starting_with=function(m){var u=this._create();return u._starting_pattern=this._input.get_regexp(m,!0),u._update(),u},d.prototype.matching=function(m){var u=this._create();return u._match_pattern=this._input.get_regexp(m,!0),u._update(),u},d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){},g.exports.Pattern=d},function(g){function d(m,u){m=typeof m=="string"?m:m.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+u,"g")}d.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(m);a;)u[a[1]]=a[2],a=this.__directive_pattern.exec(m);return u},d.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=d},function(g,d,m){var u=m(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function f(l,h){u.call(this,l,h),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),h&&(this.__template_pattern=this._input.get_regexp(h.__template_pattern),this._excluded=Object.assign(this._excluded,h._excluded),this._disabled=Object.assign(this._disabled,h._disabled));var o=new u(l);this.__patterns={handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:o.starting_with(/{{{/).until_after(/}}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),php:o.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}f.prototype=new u,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(l){var h=this._create();return h._disabled[l]=!0,h._update(),h},f.prototype.read_options=function(l){var h=this._create();for(var o in a)h._disabled[o]=l.templating.indexOf(o)===-1;return h._update(),h},f.prototype.exclude=function(l){var h=this._create();return h._excluded[l]=!0,h._update(),h},f.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var h=this._read_template();h;)this._match_pattern?h+=this._input.read(this._match_pattern):h+=this._input.readUntil(this.__template_pattern),l+=h,h=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},f.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},f.prototype._read_template=function(){var l="",h=this._input.peek();if(h==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(l=l||this.__patterns.erb.read())}else h==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},g.exports.TemplatablePattern=f},,,,function(g,d,m){var u=m(19).Beautifier,a=m(20).Options;function f(l,h,o,s){var A=new u(l,h,o,s);return A.beautify()}g.exports=f,g.exports.defaultOptions=function(){return new a}},function(g,d,m){var u=m(20).Options,a=m(2).Output,f=m(21).Tokenizer,l=m(21).TOKEN,h=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,s=function(T,v){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=T.max_preserve_newlines,this.preserve_newlines=T.preserve_newlines,this._output=new a(T,v)};s.prototype.current_line_has_match=function(T){return this._output.current_line.has_match(T)},s.prototype.set_space_before_token=function(T,v){this._output.space_before_token=T,this._output.non_breaking_space=v},s.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},s.prototype.add_raw_token=function(T){this._output.add_raw_token(T)},s.prototype.print_preserved_newlines=function(T){var v=0;T.type!==l.TEXT&&T.previous.type!==l.TEXT&&(v=T.newlines?1:0),this.preserve_newlines&&(v=T.newlines<this.max_preserve_newlines+1?T.newlines:this.max_preserve_newlines+1);for(var y=0;y<v;y++)this.print_newline(y>0);return v!==0},s.prototype.traverse_whitespace=function(T){return T.whitespace_before||T.newlines?(this.print_preserved_newlines(T)||(this._output.space_before_token=!0),!0):!1},s.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},s.prototype.print_newline=function(T){this._output.add_new_line(T)},s.prototype.print_token=function(T){T.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(T.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(T){return T=this.indent_level+(T||0),T<1?"":this._output.get_indent_string(T)};var A=function(T){for(var v=null,y=T.next;y.type!==l.EOF&&T.closed!==y;){if(y.type===l.ATTRIBUTE&&y.text==="type"){y.next&&y.next.type===l.EQUALS&&y.next.next&&y.next.next.type===l.VALUE&&(v=y.next.next.text);break}y=y.next}return v},_=function(T,v){var y=null,F=null;return v.closed?(T==="script"?y="text/javascript":T==="style"&&(y="text/css"),y=A(v)||y,y.search("text/css")>-1?F="css":y.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?F="javascript":y.search(/(text|application|dojo)\/(x-)?(html)/)>-1?F="html":y.search(/test\/null/)>-1&&(F="null"),F):null};function w(T,v){return v.indexOf(T)!==-1}function L(T,v,y){this.parent=T||null,this.tag=v?v.tag_name:"",this.indent_level=y||0,this.parser_token=v||null}function R(T){this._printer=T,this._current_frame=null}R.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},R.prototype.record_tag=function(T){var v=new L(this._current_frame,T,this._printer.indent_level);this._current_frame=v},R.prototype._try_pop_frame=function(T){var v=null;return T&&(v=T.parser_token,this._printer.indent_level=T.indent_level,this._current_frame=T.parent),v},R.prototype._get_frame=function(T,v){for(var y=this._current_frame;y&&!(T.indexOf(y.tag)!==-1);){if(v&&v.indexOf(y.tag)!==-1){y=null;break}y=y.parent}return y},R.prototype.try_pop=function(T,v){var y=this._get_frame([T],v);return this._try_pop_frame(y)},R.prototype.indent_to_tag=function(T){var v=this._get_frame(T);v&&(this._printer.indent_level=v.indent_level)};function C(T,v,y,F){this._source_text=T||"",v=v||{},this._js_beautify=y,this._css_beautify=F,this._tag_stack=null;var B=new u(v,"html");this._options=B,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var T=this._source_text,v=this._options.eol;this._options.eol==="auto"&&(v=`
|
|
`,T&&h.test(T)&&(v=T.match(h)[0])),T=T.replace(o,`
|
|
`);var y=T.match(/^[\t ]*/)[0],F={text:"",type:""},B=new S,O=new s(this._options,y),j=new f(T,this._options).tokenize();this._tag_stack=new R(O);for(var P=null,b=j.next();b.type!==l.EOF;)b.type===l.TAG_OPEN||b.type===l.COMMENT?(P=this._handle_tag_open(O,b,B,F),B=P):b.type===l.ATTRIBUTE||b.type===l.EQUALS||b.type===l.VALUE||b.type===l.TEXT&&!B.tag_complete?P=this._handle_inside_tag(O,b,B,j):b.type===l.TAG_CLOSE?P=this._handle_tag_close(O,b,B):b.type===l.TEXT?P=this._handle_text(O,b,B):O.add_raw_token(b),F=P,b=j.next();var Y=O._output.get_code(v);return Y},C.prototype._handle_tag_close=function(T,v,y){var F={text:v.text,type:v.type};return T.alignment_size=0,y.tag_complete=!0,T.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),y.is_unformatted?T.add_raw_token(v):(y.tag_start_char==="<"&&(T.set_space_before_token(v.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&y.has_wrapped_attrs&&T.print_newline(!1)),T.print_token(v)),y.indent_content&&!(y.is_unformatted||y.is_content_unformatted)&&(T.indent(),y.indent_content=!1),!y.is_inline_element&&!(y.is_unformatted||y.is_content_unformatted)&&T.set_wrap_point(),F},C.prototype._handle_inside_tag=function(T,v,y,F){var B=y.has_wrapped_attrs,O={text:v.text,type:v.type};if(T.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),y.is_unformatted)T.add_raw_token(v);else if(y.tag_start_char==="{"&&v.type===l.TEXT)T.print_preserved_newlines(v)?(v.newlines=0,T.add_raw_token(v)):T.print_token(v);else{if(v.type===l.ATTRIBUTE?(T.set_space_before_token(!0),y.attr_count+=1):(v.type===l.EQUALS||v.type===l.VALUE&&v.previous.type===l.EQUALS)&&T.set_space_before_token(!1),v.type===l.ATTRIBUTE&&y.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(T.traverse_whitespace(v),B=B||v.newlines!==0),this._is_wrap_attributes_force)){var j=y.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&y.attr_count===1){var P=!0,b=0,Y;do{if(Y=F.peek(b),Y.type===l.ATTRIBUTE){P=!1;break}b+=1}while(b<4&&Y.type!==l.EOF&&Y.type!==l.TAG_CLOSE);j=!P}j&&(T.print_newline(!1),B=!0)}T.print_token(v),B=B||T.previous_token_wrapped(),y.has_wrapped_attrs=B}return O},C.prototype._handle_text=function(T,v,y){var F={text:v.text,type:"TK_CONTENT"};return y.custom_beautifier_name?this._print_custom_beatifier_text(T,v,y):y.is_unformatted||y.is_content_unformatted?T.add_raw_token(v):(T.traverse_whitespace(v),T.print_token(v)),F},C.prototype._print_custom_beatifier_text=function(T,v,y){var F=this;if(v.text!==""){var B=v.text,O,j=1,P="",b="";y.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?O=this._js_beautify:y.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?O=this._css_beautify:y.custom_beautifier_name==="html"&&(O=function(Ee,Te){var Ae=new C(Ee,Te,F._js_beautify,F._css_beautify);return Ae.beautify()}),this._options.indent_scripts==="keep"?j=0:this._options.indent_scripts==="separate"&&(j=-T.indent_level);var Y=T.get_full_indent(j);if(B=B.replace(/\n[ \t]*$/,""),y.custom_beautifier_name!=="html"&&B[0]==="<"&&B.match(/^(<!--|<!\[CDATA\[)/)){var ee=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(B);if(!ee){T.add_raw_token(v);return}P=Y+ee[1]+`
|
|
`,B=ee[4],ee[5]&&(b=Y+ee[5]),B=B.replace(/\n[ \t]*$/,""),(ee[2]||ee[3].indexOf(`
|
|
`)!==-1)&&(ee=ee[3].match(/[ \t]+$/),ee&&(v.whitespace_before=ee[0]))}if(B)if(O){var ae=function(){this.eol=`
|
|
`};ae.prototype=this._options.raw_options;var le=new ae;B=O(Y+B,le)}else{var Re=v.whitespace_before;Re&&(B=B.replace(new RegExp(`
|
|
(`+Re+")?","g"),`
|
|
`)),B=Y+B.replace(/\n/g,`
|
|
`+Y)}P&&(B?B=P+B+`
|
|
`+b:B=P+b),T.print_newline(!1),B&&(v.text=B,v.whitespace_before="",v.newlines=0,T.add_raw_token(v),T.print_newline(!0))}},C.prototype._handle_tag_open=function(T,v,y,F){var B=this._get_tag_open_token(v);return(y.is_unformatted||y.is_content_unformatted)&&!y.is_empty_element&&v.type===l.TAG_OPEN&&v.text.indexOf("</")===0?(T.add_raw_token(v),B.start_tag_token=this._tag_stack.try_pop(B.tag_name)):(T.traverse_whitespace(v),this._set_tag_position(T,v,B,y,F),B.is_inline_element||T.set_wrap_point(),T.print_token(v)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(B.alignment_size=v.text.length+1),!B.tag_complete&&!B.is_unformatted&&(T.alignment_size=B.alignment_size),B};var S=function(T,v){if(this.parent=T||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!v)this.tag_complete=!0;else{var y;this.tag_start_char=v.text[0],this.text=v.text,this.tag_start_char==="<"?(y=v.text.match(/^<([^\s>]*)/),this.tag_check=y?y[1]:""):(y=v.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=y?y[1]:"",(v.text.startsWith("{{#>")||v.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&v.next!==null?this.tag_check=v.next.text.split(" ")[0]:this.tag_check=v.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),v.type===l.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||v.closed&&v.closed.text==="/>";var F=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(F=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(F)))}};C.prototype._get_tag_open_token=function(T){var v=new S(this._tag_stack.get_parser_token(),T);return v.alignment_size=this._options.wrap_attributes_indent_size,v.is_end_tag=v.is_end_tag||w(v.tag_check,this._options.void_elements),v.is_empty_element=v.tag_complete||v.is_start_tag&&v.is_end_tag,v.is_unformatted=!v.tag_complete&&w(v.tag_check,this._options.unformatted),v.is_content_unformatted=!v.is_empty_element&&w(v.tag_check,this._options.content_unformatted),v.is_inline_element=w(v.tag_name,this._options.inline)||v.tag_name.includes("-")||v.tag_start_char==="{",v},C.prototype._set_tag_position=function(T,v,y,F,B){if(y.is_empty_element||(y.is_end_tag?y.start_tag_token=this._tag_stack.try_pop(y.tag_name):(this._do_optional_end_element(y)&&(y.is_inline_element||T.print_newline(!1)),this._tag_stack.record_tag(y),(y.tag_name==="script"||y.tag_name==="style")&&!(y.is_unformatted||y.is_content_unformatted)&&(y.custom_beautifier_name=_(y.tag_check,v)))),w(y.tag_check,this._options.extra_liners)&&(T.print_newline(!1),T._output.just_added_blankline()||T.print_newline(!0)),y.is_empty_element){if(y.tag_start_char==="{"&&y.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),y.indent_content=!0;var O=T.current_line_has_match(/{{#if/);O||T.print_newline(!1)}y.tag_name==="!--"&&B.type===l.TAG_CLOSE&&F.is_end_tag&&y.text.indexOf(`
|
|
`)===-1||(y.is_inline_element||y.is_unformatted||T.print_newline(!1),this._calcluate_parent_multiline(T,y))}else if(y.is_end_tag){var j=!1;j=y.start_tag_token&&y.start_tag_token.multiline_content,j=j||!y.is_inline_element&&!(F.is_inline_element||F.is_unformatted)&&!(B.type===l.TAG_CLOSE&&y.start_tag_token===F)&&B.type!=="TK_CONTENT",(y.is_content_unformatted||y.is_unformatted)&&(j=!1),j&&T.print_newline(!1)}else y.indent_content=!y.custom_beautifier_name,y.tag_start_char==="<"&&(y.tag_name==="html"?y.indent_content=this._options.indent_inner_html:y.tag_name==="head"?y.indent_content=this._options.indent_head_inner_html:y.tag_name==="body"&&(y.indent_content=this._options.indent_body_inner_html)),!(y.is_inline_element||y.is_unformatted)&&(B.type!=="TK_CONTENT"||y.is_content_unformatted)&&T.print_newline(!1),this._calcluate_parent_multiline(T,y)},C.prototype._calcluate_parent_multiline=function(T,v){v.parent&&T._output.just_added_newline()&&!((v.is_inline_element||v.is_unformatted)&&v.parent.is_inline_element)&&(v.parent.multiline_content=!0)};var x=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],p=["a","audio","del","ins","map","noscript","video"];C.prototype._do_optional_end_element=function(T){var v=null;if(T.is_empty_element||!T.is_start_tag||!T.parent)return;if(T.tag_name==="body")v=v||this._tag_stack.try_pop("head");else if(T.tag_name==="li")v=v||this._tag_stack.try_pop("li",["ol","ul"]);else if(T.tag_name==="dd"||T.tag_name==="dt")v=v||this._tag_stack.try_pop("dt",["dl"]),v=v||this._tag_stack.try_pop("dd",["dl"]);else if(T.parent.tag_name==="p"&&x.indexOf(T.tag_name)!==-1){var y=T.parent.parent;(!y||p.indexOf(y.tag_name)===-1)&&(v=v||this._tag_stack.try_pop("p"))}else T.tag_name==="rp"||T.tag_name==="rt"?(v=v||this._tag_stack.try_pop("rt",["ruby","rtc"]),v=v||this._tag_stack.try_pop("rp",["ruby","rtc"])):T.tag_name==="optgroup"?v=v||this._tag_stack.try_pop("optgroup",["select"]):T.tag_name==="option"?v=v||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):T.tag_name==="colgroup"?v=v||this._tag_stack.try_pop("caption",["table"]):T.tag_name==="thead"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"])):T.tag_name==="tbody"||T.tag_name==="tfoot"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("thead",["table"]),v=v||this._tag_stack.try_pop("tbody",["table"])):T.tag_name==="tr"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(T.tag_name==="th"||T.tag_name==="td")&&(v=v||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),v=v||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return T.parent=this._tag_stack.get_parser_token(),v},g.exports.Beautifier=C},function(g,d,m){var u=m(6).Options;function a(f){u.call(this,f,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}a.prototype=new u,g.exports.Options=a},function(g,d,m){var u=m(9).Tokenizer,a=m(9).TOKEN,f=m(13).Directives,l=m(14).TemplatablePattern,h=m(12).Pattern,o={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:a.START,RAW:a.RAW,EOF:a.EOF},s=new f(/<\!--/,/-->/),A=function(_,w){u.call(this,_,w),this._current_tag_name="";var L=new l(this._input).read_options(this._options),R=new h(this._input);if(this.__patterns={word:L.until(/[\n\r\t <]/),single_quote:L.until_after(/'/),double_quote:L.until_after(/"/),attribute:L.until(/[\n\r\t =>]|\/>/),element_name:L.until(/[\n\r\t >\/]/),handlebars_comment:R.starting_with(/{{!--/).until_after(/--}}/),handlebars:R.starting_with(/{{/).until_after(/}}/),handlebars_open:R.until(/[\n\r\t }]/),handlebars_raw_close:R.until(/}}/),comment:R.starting_with(/<!--/).until_after(/-->/),cdata:R.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:R.starting_with(/<!\[/).until_after(/]>/),processing:R.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var C=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=R.matching(C).until_after(C)}};A.prototype=new u,A.prototype._is_comment=function(_){return!1},A.prototype._is_opening=function(_){return _.type===o.TAG_OPEN},A.prototype._is_closing=function(_,w){return _.type===o.TAG_CLOSE&&w&&((_.text===">"||_.text==="/>")&&w.text[0]==="<"||_.text==="}}"&&w.text[0]==="{"&&w.text[1]==="{")},A.prototype._reset=function(){this._current_tag_name=""},A.prototype._get_next_token=function(_,w){var L=null;this._readWhitespace();var R=this._input.peek();return R===null?this._create_token(o.EOF,""):(L=L||this._read_open_handlebars(R,w),L=L||this._read_attribute(R,_,w),L=L||this._read_close(R,w),L=L||this._read_raw_content(R,_,w),L=L||this._read_content_word(R),L=L||this._read_comment_or_cdata(R),L=L||this._read_processing(R),L=L||this._read_open(R,w),L=L||this._create_token(o.UNKNOWN,this._input.next()),L)},A.prototype._read_comment_or_cdata=function(_){var w=null,L=null,R=null;if(_==="<"){var C=this._input.peek(1);C==="!"&&(L=this.__patterns.comment.read(),L?(R=s.get_directives(L),R&&R.ignore==="start"&&(L+=s.readIgnored(this._input))):L=this.__patterns.cdata.read()),L&&(w=this._create_token(o.COMMENT,L),w.directives=R)}return w},A.prototype._read_processing=function(_){var w=null,L=null,R=null;if(_==="<"){var C=this._input.peek(1);(C==="!"||C==="?")&&(L=this.__patterns.conditional_comment.read(),L=L||this.__patterns.processing.read()),L&&(w=this._create_token(o.COMMENT,L),w.directives=R)}return w},A.prototype._read_open=function(_,w){var L=null,R=null;return w||_==="<"&&(L=this._input.next(),this._input.peek()==="/"&&(L+=this._input.next()),L+=this.__patterns.element_name.read(),R=this._create_token(o.TAG_OPEN,L)),R},A.prototype._read_open_handlebars=function(_,w){var L=null,R=null;return w||this._options.indent_handlebars&&_==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(L=this.__patterns.handlebars_comment.read(),L=L||this.__patterns.handlebars.read(),R=this._create_token(o.COMMENT,L)):(L=this.__patterns.handlebars_open.read(),R=this._create_token(o.TAG_OPEN,L))),R},A.prototype._read_close=function(_,w){var L=null,R=null;return w&&(w.text[0]==="<"&&(_===">"||_==="/"&&this._input.peek(1)===">")?(L=this._input.next(),_==="/"&&(L+=this._input.next()),R=this._create_token(o.TAG_CLOSE,L)):w.text[0]==="{"&&_==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),R=this._create_token(o.TAG_CLOSE,"}}"))),R},A.prototype._read_attribute=function(_,w,L){var R=null,C="";if(L&&L.text[0]==="<")if(_==="=")R=this._create_token(o.EQUALS,this._input.next());else if(_==='"'||_==="'"){var S=this._input.next();_==='"'?S+=this.__patterns.double_quote.read():S+=this.__patterns.single_quote.read(),R=this._create_token(o.VALUE,S)}else C=this.__patterns.attribute.read(),C&&(w.type===o.EQUALS?R=this._create_token(o.VALUE,C):R=this._create_token(o.ATTRIBUTE,C));return R},A.prototype._is_content_unformatted=function(_){return this._options.void_elements.indexOf(_)===-1&&(this._options.content_unformatted.indexOf(_)!==-1||this._options.unformatted.indexOf(_)!==-1)},A.prototype._read_raw_content=function(_,w,L){var R="";if(L&&L.text[0]==="{")R=this.__patterns.handlebars_raw_close.read();else if(w.type===o.TAG_CLOSE&&w.opened.text[0]==="<"&&w.text[0]!=="/"){var C=w.opened.text.substr(1).toLowerCase();if(C==="script"||C==="style"){var S=this._read_comment_or_cdata(_);if(S)return S.type=o.TEXT,S;R=this._input.readUntil(new RegExp("</"+C+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(C)&&(R=this._input.readUntil(new RegExp("</"+C+"[\\n\\r\\t ]*?>","ig")))}return R?this._create_token(o.TEXT,R):null},A.prototype._read_content_word=function(_){var w="";if(this._options.unformatted_content_delimiter&&(_===this._options.unformatted_content_delimiter[0]&&(w=this.__patterns.unformatted_content_delimiter.read())),w||(w=this.__patterns.word.read()),w)return this._create_token(o.TEXT,w)},g.exports.Tokenizer=A,g.exports.TOKEN=o}],W={};function i(g){var d=W[g];if(d!==void 0)return d.exports;var m=W[g]={exports:{}};return G[g](m,m.exports,i),m.exports}var D=i(18);k=D})();var X=k;if(!0)!(ne=[J,J("6UM0"),J("TXwP")],$=function(G){var W=J("6UM0"),i=J("TXwP");return{html_beautify:function(D,g){return X(D,g,W.js_beautify,i.css_beautify)}}}.apply(ge,ne),$!==void 0&&(ot.exports=$));else var N,U})()},"rAM+":function(ot,ge,J){"use strict";J.d(ge,"a",function(){return $});var ne=J("Qw5x");function $(k,X){var N;if(typeof Symbol=="undefined"||k[Symbol.iterator]==null){if(Array.isArray(k)||(N=Object(ne.a)(k))||X&&k&&typeof k.length=="number"){N&&(k=N);var U=0,G=function(){};return{s:G,n:function(){return U>=k.length?{done:!0}:{done:!1,value:k[U++]}},e:function(d){throw d},f:G}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var W=!0,i=!1,D;return{s:function(){N=k[Symbol.iterator]()},n:function(){var d=N.next();return W=d.done,d},e:function(d){i=!0,D=d},f:function(){try{!W&&N.return!=null&&N.return()}finally{if(i)throw D}}}}},rUJ1:function(ot,ge){const J=/[&<>"']/,ne=/[&<>"']/g,$=/[<>"']|&(?!#?\w+;)/,k=/[<>"']|&(?!#?\w+;)/g,X={"&":"&","<":"<",">":">",'"':""","'":"'"},N=R=>X[R];function U(R,C){if(C){if(J.test(R))return R.replace(ne,N)}else if($.test(R))return R.replace(k,N);return R}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(R){return R.replace(G,(C,S)=>(S=S.toLowerCase(),S==="colon"?":":S.charAt(0)==="#"?S.charAt(1)==="x"?String.fromCharCode(parseInt(S.substring(2),16)):String.fromCharCode(+S.substring(1)):""))}const i=/(^|[^\[])\^/g;function D(R,C){R=R.source||R,C=C||"";const S={replace:(x,p)=>(p=p.source||p,p=p.replace(i,"$1"),R=R.replace(x,p),S),getRegex:()=>new RegExp(R,C)};return S}const g=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(R,C,S){if(R){let x;try{x=decodeURIComponent(W(S)).replace(g,"").toLowerCase()}catch(p){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}C&&!d.test(S)&&(S=h(C,S));try{S=encodeURI(S).replace(/%25/g,"%")}catch(x){return null}return S}const u={},a=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(R,C){u[" "+R]||(a.test(R)?u[" "+R]=R+"/":u[" "+R]=_(R,"/",!0)),R=u[" "+R];const S=R.indexOf(":")===-1;return C.substring(0,2)==="//"?S?C:R.replace(f,"$1")+C:C.charAt(0)==="/"?S?C:R.replace(l,"$1")+C:R+C}const o={exec:function(){}};function s(R){let C=1,S,x;for(;C<arguments.length;C++){S=arguments[C];for(x in S)Object.prototype.hasOwnProperty.call(S,x)&&(R[x]=S[x])}return R}function A(R,C){const S=R.replace(/\|/g,(T,v,y)=>{let F=!1,B=v;for(;--B>=0&&y[B]==="\\";)F=!F;return F?"|":" |"}),x=S.split(/ \|/);let p=0;if(x.length>C)x.splice(C);else for(;x.length<C;)x.push("");for(;p<x.length;p++)x[p]=x[p].trim().replace(/\\\|/g,"|");return x}function _(R,C,S){const x=R.length;if(x===0)return"";let p=0;for(;p<x;){const T=R.charAt(x-p-1);if(T===C&&!S)p++;else if(T!==C&&S)p++;else break}return R.substr(0,x-p)}function w(R,C){if(R.indexOf(C[1])===-1)return-1;const S=R.length;let x=0,p=0;for(;p<S;p++)if(R[p]==="\\")p++;else if(R[p]===C[0])x++;else if(R[p]===C[1]&&(x--,x<0))return p;return-1}function L(R){R&&R.sanitize&&!R.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}ot.exports={escape:U,unescape:W,edit:D,cleanUrl:m,resolveUrl:h,noopTest:o,merge:s,splitCells:A,rtrim:_,findClosingBracket:w,checkSanitizeDeprecation:L}},t9D7:function(ot,ge,J){"use strict";J.d(ge,"b",function(){return G}),J.d(ge,"g",function(){return i}),J.d(ge,"d",function(){return D}),J.d(ge,"e",function(){return g}),J.d(ge,"a",function(){return d}),J.d(ge,"f",function(){return a}),J.d(ge,"c",function(){return f});var ne=J("Vhoy"),$=J("MI8n"),k=J("pmY6"),X=J("Cg/j"),N=J("ic2d"),U=J("nEHx");const G=Object(X.c)("themeService");var W;(function(l){function h(o){return o&&typeof o=="object"&&typeof o.id=="string"}l.isThemeColor=h})(W||(W={}));function i(l){return{id:l}}var D;(function(l){function h(L){return L&&typeof L=="object"&&typeof L.id=="string"&&(typeof L.color=="undefined"||W.isThemeColor(L.color))}l.isThemeIcon=h;const o=new RegExp(`^\\$\\((${ne.a.iconNameExpression}(?:${ne.a.iconModifierExpression})?)\\)$`);function s(L){const R=o.exec(L);if(!R)return;let[,C]=R;return{id:C}}l.fromString=s;function A(L,R){let C=L.id;const S=C.lastIndexOf("~");return S!==-1&&(C=C.substring(0,S)),R&&(C=`${C}~${R}`),{id:C}}l.modify=A;function _(L,R){var C,S;return L.id===R.id&&((C=L.color)===null||C===void 0?void 0:C.id)===((S=R.color)===null||S===void 0?void 0:S.id)}l.isEqual=_;function w(L,R){return{id:L.id,color:R?i(R):void 0}}l.asThemeIcon=w,l.asClassNameArray=ne.a.asClassNameArray,l.asClassName=ne.a.asClassName,l.asCSSSelector=ne.a.asCSSSelector})(D||(D={}));function g(l){switch(l){case U.a.DARK:return"vs-dark";case U.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const d={ThemingContribution:"base.contributions.theming"};class m{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new $.b}onColorThemeChange(l){return this.themingParticipants.push(l),this.onThemingParticipantAddedEmitter.fire(l),Object(k.i)(()=>{const h=this.themingParticipants.indexOf(l);this.themingParticipants.splice(h,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new m;N.a.add(d.ThemingContribution,u);function a(l){return u.onColorThemeChange(l)}class f extends k.a{constructor(l){super();this.themeService=l,this.theme=l.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(h=>this.onThemeChange(h)))}onThemeChange(l){this.theme=l,this.updateStyles()}updateStyles(){}}},ulZh:function(ot,ge,J){typeof window!="undefined"&&function($,k){ot.exports=k()}(this,function(){return function(ne){var $={};function k(X){if($[X])return $[X].exports;var N=$[X]={i:X,l:!1,exports:{}};return ne[X].call(N.exports,N,N.exports,k),N.l=!0,N.exports}return k.m=ne,k.c=$,k.d=function(X,N,U){k.o(X,N)||Object.defineProperty(X,N,{enumerable:!0,get:U})},k.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},k.t=function(X,N){if(N&1&&(X=k(X)),N&8)return X;if(N&4&&typeof X=="object"&&X&&X.__esModule)return X;var U=Object.create(null);if(k.r(U),Object.defineProperty(U,"default",{enumerable:!0,value:X}),N&2&&typeof X!="string")for(var G in X)k.d(U,G,function(W){return X[W]}.bind(null,G));return U},k.n=function(X){var N=X&&X.__esModule?function(){return X.default}:function(){return X};return k.d(N,"a",N),N},k.o=function(X,N){return Object.prototype.hasOwnProperty.call(X,N)},k.p="/dist/",k(k.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ne,$,k){"use strict";var X=Object.prototype.hasOwnProperty,N="~";function U(){}Object.create&&(U.prototype=Object.create(null),new U().__proto__||(N=!1));function G(g,d,m){this.fn=g,this.context=d,this.once=m||!1}function W(g,d,m,u,a){if(typeof m!="function")throw new TypeError("The listener must be a function");var f=new G(m,u||g,a),l=N?N+d:d;return g._events[l]?g._events[l].fn?g._events[l]=[g._events[l],f]:g._events[l].push(f):(g._events[l]=f,g._eventsCount++),g}function i(g,d){--g._eventsCount===0?g._events=new U:delete g._events[d]}function D(){this._events=new U,this._eventsCount=0}D.prototype.eventNames=function(){var d=[],m,u;if(this._eventsCount===0)return d;for(u in m=this._events)X.call(m,u)&&d.push(N?u.slice(1):u);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(m)):d},D.prototype.listeners=function(d){var m=N?N+d:d,u=this._events[m];if(!u)return[];if(u.fn)return[u.fn];for(var a=0,f=u.length,l=new Array(f);a<f;a++)l[a]=u[a].fn;return l},D.prototype.listenerCount=function(d){var m=N?N+d:d,u=this._events[m];return u?u.fn?1:u.length:0},D.prototype.emit=function(d,m,u,a,f,l){var h=N?N+d:d;if(!this._events[h])return!1;var o=this._events[h],s=arguments.length,A,_;if(o.fn){o.once&&this.removeListener(d,o.fn,void 0,!0);switch(s){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,m),!0;case 3:return o.fn.call(o.context,m,u),!0;case 4:return o.fn.call(o.context,m,u,a),!0;case 5:return o.fn.call(o.context,m,u,a,f),!0;case 6:return o.fn.call(o.context,m,u,a,f,l),!0}for(_=1,A=new Array(s-1);_<s;_++)A[_-1]=arguments[_];o.fn.apply(o.context,A)}else{var w=o.length,L;for(_=0;_<w;_++){o[_].once&&this.removeListener(d,o[_].fn,void 0,!0);switch(s){case 1:o[_].fn.call(o[_].context);break;case 2:o[_].fn.call(o[_].context,m);break;case 3:o[_].fn.call(o[_].context,m,u);break;case 4:o[_].fn.call(o[_].context,m,u,a);break;default:if(!A)for(L=1,A=new Array(s-1);L<s;L++)A[L-1]=arguments[L];o[_].fn.apply(o[_].context,A)}}}return!0},D.prototype.on=function(d,m,u){return W(this,d,m,u,!1)},D.prototype.once=function(d,m,u){return W(this,d,m,u,!0)},D.prototype.removeListener=function(d,m,u,a){var f=N?N+d:d;if(!this._events[f])return this;if(!m)return i(this,f),this;var l=this._events[f];if(l.fn)l.fn===m&&(!a||l.once)&&(!u||l.context===u)&&i(this,f);else{for(var h=0,o=[],s=l.length;h<s;h++)(l[h].fn!==m||a&&!l[h].once||u&&l[h].context!==u)&&o.push(l[h]);o.length?this._events[f]=o.length===1?o[0]:o:i(this,f)}return this},D.prototype.removeAllListeners=function(d){var m;return d?(m=N?N+d:d,this._events[m]&&i(this,m)):(this._events=new U,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=N,D.EventEmitter=D,ne.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(ne,$,k){(function(X){var N=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,U=/^([^\/?#]*)([^]*)$/,G=/(?:\/|^)\.(?=\/)/g,W=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,i={buildAbsoluteURL:function(D,g,d){if(d=d||{},D=D.trim(),g=g.trim(),!g){if(!d.alwaysNormalize)return D;var m=i.parseURL(D);if(!m)throw new Error("Error trying to parse base URL.");return m.path=i.normalizePath(m.path),i.buildURLFromParts(m)}var u=i.parseURL(g);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return d.alwaysNormalize?(u.path=i.normalizePath(u.path),i.buildURLFromParts(u)):g;var a=i.parseURL(D);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var f=U.exec(a.path);a.netLoc=f[1],a.path=f[2]}a.netLoc&&!a.path&&(a.path="/");var l={scheme:a.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(l.netLoc=a.netLoc,u.path[0]!=="/"))if(!u.path)l.path=a.path,u.params||(l.params=a.params,u.query||(l.query=a.query));else{var h=a.path,o=h.substring(0,h.lastIndexOf("/")+1)+u.path;l.path=i.normalizePath(o)}return l.path===null&&(l.path=d.alwaysNormalize?i.normalizePath(u.path):u.path),i.buildURLFromParts(l)},parseURL:function(D){var g=N.exec(D);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace(G,"");D.length!==(D=D.replace(W,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};ne.exports=i})(this)},"./node_modules/webworkify-webpack/index.js":function(ne,$,k){function X(d){var m={};function u(f){if(m[f])return m[f].exports;var l=m[f]={i:f,l:!1,exports:{}};return d[f].call(l.exports,l,l.exports,u),l.l=!0,l.exports}u.m=d,u.c=m,u.i=function(f){return f},u.d=function(f,l,h){u.o(f,l)||Object.defineProperty(f,l,{configurable:!1,enumerable:!0,get:h})},u.r=function(f){Object.defineProperty(f,"__esModule",{value:!0})},u.n=function(f){var l=f&&f.__esModule?function(){return f.default}:function(){return f};return u.d(l,"a",l),l},u.o=function(f,l){return Object.prototype.hasOwnProperty.call(f,l)},u.p="/",u.oe=function(f){throw console.error(f),f};var a=u(u.s=ENTRY_MODULE);return a.default||a}var N="[\\.|\\-|\\+|\\w|/|@]+",U="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+N+").*?\\)";function G(d){return(d+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function W(d){return!isNaN(1*d)}function i(d,m,u){var a={};a[u]=[];var f=m.toString(),l=f.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return a;for(var h=l[1],o=new RegExp("(\\\\n|\\W)"+G(h)+U,"g"),s;s=o.exec(f);){if(s[3]==="dll-reference")continue;a[u].push(s[3])}for(o=new RegExp("\\("+G(h)+'\\("(dll-reference\\s('+N+'))"\\)\\)'+U,"g");s=o.exec(f);)d[s[2]]||(a[u].push(s[1]),d[s[2]]=k(s[1]).m),a[s[2]]=a[s[2]]||[],a[s[2]].push(s[4]);for(var A=Object.keys(a),_=0;_<A.length;_++)for(var w=0;w<a[A[_]].length;w++)W(a[A[_]][w])&&(a[A[_]][w]=1*a[A[_]][w]);return a}function D(d){var m=Object.keys(d);return m.reduce(function(u,a){return u||d[a].length>0},!1)}function g(d,m){for(var u={main:[m]},a={main:[]},f={main:{}};D(u);)for(var l=Object.keys(u),h=0;h<l.length;h++){var o=l[h],s=u[o],A=s.pop();if(f[o]=f[o]||{},f[o][A]||!d[o][A])continue;f[o][A]=!0,a[o]=a[o]||[],a[o].push(A);for(var _=i(d,d[o][A],o),w=Object.keys(_),L=0;L<w.length;L++)u[w[L]]=u[w[L]]||[],u[w[L]]=u[w[L]].concat(_[w[L]])}return a}ne.exports=function(d,m){m=m||{};var u={main:k.m},a=m.all?{main:Object.keys(u.main)}:g(u,d),f="";Object.keys(a).filter(function(A){return A!=="main"}).forEach(function(A){for(var _=0;a[A][_];)_++;a[A].push(_),u[A][_]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",f=f+"var "+A+" = ("+X.toString().replace("ENTRY_MODULE",JSON.stringify(_))+")({"+a[A].map(function(w){return""+JSON.stringify(w)+": "+u[A][w].toString()}).join(",")+`});
|
|
`}),f=f+"new (("+X.toString().replace("ENTRY_MODULE",JSON.stringify(d))+")({"+a.main.map(function(A){return""+JSON.stringify(A)+": "+u.main[A].toString()}).join(",")+"}))(self);";var l=new window.Blob([f],{type:"text/javascript"});if(m.bare)return l;var h=window.URL||window.webkitURL||window.mozURL||window.msURL,o=h.createObjectURL(l),s=new window.Worker(o);return s.objectURL=o,s}},"./src/config.ts":function(ne,$,k){"use strict";k.r($),k.d($,"hlsDefaultConfig",function(){return L}),k.d($,"mergeConfig",function(){return C}),k.d($,"enableStreamingMode",function(){return S});var X=k("./src/controller/abr-controller.ts"),N=k("./src/controller/audio-stream-controller.ts"),U=k("./src/controller/audio-track-controller.ts"),G=k("./src/controller/subtitle-stream-controller.ts"),W=k("./src/controller/subtitle-track-controller.ts"),i=k("./src/controller/buffer-controller.ts"),D=k("./src/controller/timeline-controller.ts"),g=k("./src/controller/cap-level-controller.ts"),d=k("./src/controller/fps-controller.ts"),m=k("./src/controller/eme-controller.ts"),u=k("./src/controller/cmcd-controller.ts"),a=k("./src/utils/xhr-loader.ts"),f=k("./src/utils/fetch-loader.ts"),l=k("./src/utils/cues.ts"),h=k("./src/utils/mediakeys-helper.ts"),o=k("./src/utils/logger.ts");function s(){return s=Object.assign||function(x){for(var p=1;p<arguments.length;p++){var T=arguments[p];for(var v in T)Object.prototype.hasOwnProperty.call(T,v)&&(x[v]=T[v])}return x},s.apply(this,arguments)}function A(x,p){var T=Object.keys(x);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(x);p&&(v=v.filter(function(y){return Object.getOwnPropertyDescriptor(x,y).enumerable})),T.push.apply(T,v)}return T}function _(x){for(var p=1;p<arguments.length;p++){var T=arguments[p]!=null?arguments[p]:{};p%2?A(Object(T),!0).forEach(function(v){w(x,v,T[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(T)):A(Object(T)).forEach(function(v){Object.defineProperty(x,v,Object.getOwnPropertyDescriptor(T,v))})}return x}function w(x,p,T){return p in x?Object.defineProperty(x,p,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[p]=T,x}var L=_(_({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:X.default,bufferController:i.default,capLevelController:g.default,fpsController:d.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:h.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},R()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:W.default,timelineController:D.TimelineController,audioStreamController:N.default,audioTrackController:U.default,emeController:m.default,cmcdController:u.default});function R(){return{cueHandler:l.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function C(x,p){if((p.liveSyncDurationCount||p.liveMaxLatencyDurationCount)&&(p.liveSyncDuration||p.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(p.liveMaxLatencyDurationCount!==void 0&&(p.liveSyncDurationCount===void 0||p.liveMaxLatencyDurationCount<=p.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(p.liveMaxLatencyDuration!==void 0&&(p.liveSyncDuration===void 0||p.liveMaxLatencyDuration<=p.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return s({},x,p)}function S(x){var p=x.loader;if(p!==f.default&&p!==a.default)o.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),x.progressive=!1;else{var T=Object(f.fetchSupported)();T&&(x.loader=f.default,x.progressive=!0,x.enableSoftwareAES=!0,o.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/polyfills/number.ts"),N=k("./src/utils/ewma-bandwidth-estimator.ts"),U=k("./src/events.ts"),G=k("./src/utils/buffer-helper.ts"),W=k("./src/errors.ts"),i=k("./src/types/loader.ts"),D=k("./src/utils/logger.ts");function g(u,a){for(var f=0;f<a.length;f++){var l=a[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(u,l.key,l)}}function d(u,a,f){return a&&g(u.prototype,a),f&&g(u,f),u}var m=function(){function u(f){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=f;var l=f.config;this.bwEstimator=new N.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var a=u.prototype;return a.registerListeners=function(){var l=this.hls;l.on(U.Events.FRAG_LOADING,this.onFragLoading,this),l.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(U.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var l=this.hls;l.off(U.Events.FRAG_LOADING,this.onFragLoading,this),l.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(U.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(l,h){var o=h.frag;if(o.type===i.PlaylistLevelType.MAIN&&!this.timer){var s;this.fragCurrent=o,this.partCurrent=(s=h.part)!=null?s:null,this.timer=self.setInterval(this.onCheck,100)}},a.onLevelLoaded=function(l,h){var o=this.hls.config;h.details.live?this.bwEstimator.update(o.abrEwmaSlowLive,o.abrEwmaFastLive):this.bwEstimator.update(o.abrEwmaSlowVoD,o.abrEwmaFastVoD)},a._abandonRulesCheck=function(){var l=this.fragCurrent,h=this.partCurrent,o=this.hls,s=o.autoLevelEnabled,A=o.config,_=o.media;if(!l||!_)return;var w=h?h.stats:l.stats,L=h?h.duration:l.duration;if(w.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!s||_.paused||!_.playbackRate||!_.readyState)return;var R=performance.now()-w.loading.start,C=Math.abs(_.playbackRate);if(R<=500*L/C)return;var S=o.levels,x=o.minAutoLevel,p=S[l.level],T=w.total||Math.max(w.loaded,Math.round(L*p.maxBitrate/8)),v=Math.max(1,w.bwEstimate?w.bwEstimate/8:w.loaded*1e3/R),y=(T-w.loaded)/v,F=_.currentTime,B=(G.BufferHelper.bufferInfo(_,F,A.maxBufferHole).end-F)/C;if(B>=2*L/C||y<=B)return;var O=Number.POSITIVE_INFINITY,j;for(j=l.level-1;j>x;j--){var P=S[j].maxBitrate;if(O=L*P/(8*.8*v),O<B)break}if(O>=y)return;var b=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+l.sn+(h?" part "+h.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+j+`
|
|
Current BW estimate: `+(Object(X.isFiniteNumber)(b)?(b/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+y.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+O.toFixed(3)+` s
|
|
Time to underbuffer: `+B.toFixed(3)+" s"),o.nextLoadLevel=j,this.bwEstimator.sample(R,w.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),o.trigger(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:h,stats:w})},a.onFragLoaded=function(l,h){var o=h.frag,s=h.part;if(o.type===i.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(o.sn)){var A=s?s.stats:o.stats,_=s?s.duration:o.duration;if(this.clearTimer(),this.lastLoadedFragLevel=o.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var w=this.hls.levels[o.level],L=(w.loaded?w.loaded.bytes:0)+A.loaded,R=(w.loaded?w.loaded.duration:0)+_;w.loaded={bytes:L,duration:R},w.realBitrate=Math.round(8*L/R)}if(o.bitrateTest){var C={stats:A,frag:o,part:s,id:o.type};this.onFragBuffered(U.Events.FRAG_BUFFERED,C),o.bitrateTest=!1}}},a.onFragBuffered=function(l,h){var o=h.frag,s=h.part,A=s?s.stats:o.stats;if(A.aborted)return;if(o.type!==i.PlaylistLevelType.MAIN||o.sn==="initSegment")return;var _=A.parsing.end-A.loading.start;this.bwEstimator.sample(_,A.loaded),A.bwEstimate=this.bwEstimator.getEstimate(),o.bitrateTest?this.bitrateTestDelay=_/1e3:this.bitrateTestDelay=0},a.onError=function(l,h){switch(h.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var l=this.fragCurrent,h=this.partCurrent,o=this.hls,s=o.maxAutoLevel,A=o.config,_=o.minAutoLevel,w=o.media,L=h?h.duration:l?l.duration:0,R=w?w.currentTime:0,C=w&&w.playbackRate!==0?Math.abs(w.playbackRate):1,S=this.bwEstimator?this.bwEstimator.getEstimate():A.abrEwmaDefaultEstimate,x=(G.BufferHelper.bufferInfo(w,R,A.maxBufferHole).end-R)/C,p=this.findBestLevel(S,_,s,x,A.abrBandWidthFactor,A.abrBandWidthUpFactor);if(p>=0)return p;D.logger.trace((x?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var T=L?Math.min(L,A.maxStarvationDelay):A.maxStarvationDelay,v=A.abrBandWidthFactor,y=A.abrBandWidthUpFactor;if(!x){var F=this.bitrateTestDelay;if(F){var B=L?Math.min(L,A.maxLoadingDelay):A.maxLoadingDelay;T=B-F,D.logger.trace("bitrate test took "+Math.round(1e3*F)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*T)+" ms"),v=y=1}}return p=this.findBestLevel(S,_,s,x+T,v,y),Math.max(p,0)},a.findBestLevel=function(l,h,o,s,A,_){for(var w,L=this.fragCurrent,R=this.partCurrent,C=this.lastLoadedFragLevel,S=this.hls.levels,x=S[C],p=!!(x!=null&&(w=x.details)!==null&&w!==void 0&&w.live),T=x==null?void 0:x.codecSet,v=R?R.duration:L?L.duration:0,y=o;y>=h;y--){var F=S[y];if(!F||T&&F.codecSet!==T)continue;var B=F.details,O=(R?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||v,j=void 0;y<=C?j=A*l:j=_*l;var P=S[y].maxBitrate,b=P*O/j;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(j)+"/"+P+"/"+O+"/"+s+"/"+b),j>P&&(!b||p&&!this.bitrateTestDelay||b<s))return y}return-1},d(u,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,h=this.bwEstimator;if(l!==-1&&(!h||!h.canEstimate()))return l;var o=this.getNextABRAutoLevel();return l!==-1&&(o=Math.min(l,o)),o},set:function(l){this._nextAutoLevel=l}}]),u}();$.default=m},"./src/controller/audio-stream-controller.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/polyfills/number.ts"),N=k("./src/controller/base-stream-controller.ts"),U=k("./src/events.ts"),G=k("./src/utils/buffer-helper.ts"),W=k("./src/controller/fragment-tracker.ts"),i=k("./src/types/level.ts"),D=k("./src/types/loader.ts"),g=k("./src/loader/fragment.ts"),d=k("./src/demux/chunk-cache.ts"),m=k("./src/demux/transmuxer-interface.ts"),u=k("./src/types/transmuxer.ts"),a=k("./src/controller/fragment-finders.ts"),f=k("./src/utils/discontinuities.ts"),l=k("./src/errors.ts"),h=k("./src/utils/logger.ts");function o(){return o=Object.assign||function(L){for(var R=1;R<arguments.length;R++){var C=arguments[R];for(var S in C)Object.prototype.hasOwnProperty.call(C,S)&&(L[S]=C[S])}return L},o.apply(this,arguments)}function s(L,R){L.prototype=Object.create(R.prototype),L.prototype.constructor=L,A(L,R)}function A(L,R){return A=Object.setPrototypeOf||function(S,x){return S.__proto__=x,S},A(L,R)}var _=100,w=function(L){s(R,L);function R(S,x){var p;return p=L.call(this,S,x,"[audio-stream-controller]")||this,p.videoBuffer=null,p.videoTrackCC=-1,p.waitingVideoCC=-1,p.audioSwitch=!1,p.trackId=-1,p.waitingData=null,p.mainDetails=null,p.bufferFlushed=!1,p._registerListeners(),p}var C=R.prototype;return C.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},C._registerListeners=function(){var x=this.hls;x.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(U.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.on(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.on(U.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.on(U.Events.ERROR,this.onError,this),x.on(U.Events.BUFFER_RESET,this.onBufferReset,this),x.on(U.Events.BUFFER_CREATED,this.onBufferCreated,this),x.on(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.on(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C._unregisterListeners=function(){var x=this.hls;x.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(U.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.off(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.off(U.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.off(U.Events.ERROR,this.onError,this),x.off(U.Events.BUFFER_RESET,this.onBufferReset,this),x.off(U.Events.BUFFER_CREATED,this.onBufferCreated,this),x.off(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.off(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C.onInitPtsFound=function(x,p){var T=p.frag,v=p.id,y=p.initPTS;if(v==="main"){var F=T.cc;this.initPTS[T.cc]=y,this.log("InitPTS for cc: "+F+" found from main: "+y),this.videoTrackCC=F,this.state===N.State.WAITING_INIT_PTS&&this.tick()}},C.startLoad=function(x){if(!this.levels){this.startPosition=x,this.state=N.State.STOPPED;return}var p=this.lastCurrentTime;this.stopLoad(),this.setInterval(_),this.fragLoadError=0,p>0&&x===-1?(this.log("Override startPosition with lastCurrentTime @"+p.toFixed(3)),this.state=N.State.IDLE):(this.loadedmetadata=!1,this.state=N.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()},C.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_TRACK:{var x,p=this.levels,T=this.trackId,v=p==null||((x=p[T])===null||x===void 0)?void 0:x.details;if(v){if(this.waitForCdnTuneIn(v))break;this.state=N.State.WAITING_INIT_PTS}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var y,F=performance.now(),B=this.retryDate;(!B||F>=B||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=N.State.IDLE);break}case N.State.WAITING_INIT_PTS:{var O=this.waitingData;if(O){var j=O.frag,P=O.part,b=O.cache,Y=O.complete;if(this.initPTS[j.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.FRAG_LOADING;var ee=b.flush(),ae={frag:j,part:P,payload:ee,networkDetails:null};this._handleFragmentLoadProgress(ae),Y&&L.prototype._handleFragmentLoadComplete.call(this,ae)}else if(this.videoTrackCC!==this.waitingVideoCC)h.logger.log("Waiting fragment cc ("+j.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var le=this.getLoadPosition(),Re=G.BufferHelper.bufferInfo(this.mediaBuffer,le,this.config.maxBufferHole),Ee=Object(a.fragmentWithinToleranceTest)(Re.end,this.config.maxFragLookUpTolerance,j);Ee<0&&(h.logger.log("Waiting fragment cc ("+j.cc+") @ "+j.start+" cancelled because another fragment at "+Re.end+" is needed"),this.clearWaitingFragment())}}else this.state=N.State.IDLE}}this.onTickEnd()},C.clearWaitingFragment=function(){var x=this.waitingData;x&&(this.fragmentTracker.removeFragment(x.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.IDLE)},C.onTickEnd=function(){var x=this.media;if(!x||!x.readyState)return;var p=this.mediaBuffer?this.mediaBuffer:x,T=p.buffered;!this.loadedmetadata&&T.length&&(this.loadedmetadata=!0),this.lastCurrentTime=x.currentTime},C.doTickIdle=function(){var x,p,T=this.hls,v=this.levels,y=this.media,F=this.trackId,B=T.config;if(!v||!v[F])return;if(!y&&(this.startFragRequested||!B.startFragPrefetch))return;var O=v[F],j=O.details;if(!j||j.live&&this.levelLastLoaded!==F||this.waitForCdnTuneIn(j)){this.state=N.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var P=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(P===null)return;var b=P.len,Y=this.getMaxBufferLength(),ee=this.audioSwitch;if(b>=Y&&!ee)return;if(!ee&&this._streamEnded(P,j)){T.trigger(U.Events.BUFFER_EOS,{type:"audio"}),this.state=N.State.ENDED;return}var ae=j.fragments,le=ae[0].start,Re=P.end;if(ee){var Ee=this.getLoadPosition();Re=Ee,j.PTSKnown&&Ee<le&&((P.end>le||P.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),y.currentTime=le+.05))}var Te=this.getNextFragment(Re,j);if(!Te){this.bufferFlushed=!0;return}((x=Te.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((p=Te.decryptdata)!==null&&p!==void 0&&p.key)?this.loadKey(Te,j):this.loadFragment(Te,j,Re)},C.getMaxBufferLength=function(){var x=L.prototype.getMaxBufferLength.call(this),p=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return p===null?x:Math.max(x,p.len)},C.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},C.onAudioTracksUpdated=function(x,p){var T=p.audioTracks;this.resetTransmuxer(),this.levels=T.map(function(v){return new i.Level(v)})},C.onAudioTrackSwitching=function(x,p){var T=!!p.url;this.trackId=p.id;var v=this.fragCurrent;v!=null&&v.loader&&v.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),T?this.setInterval(_):this.resetTransmuxer(),T?(this.audioSwitch=!0,this.state=N.State.IDLE):this.state=N.State.STOPPED,this.tick()},C.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},C.onLevelLoaded=function(x,p){this.mainDetails=p.details},C.onAudioTrackLoaded=function(x,p){var T,v=this.levels,y=p.details,F=p.id;if(!v){this.warn("Audio tracks were reset while loading level "+F);return}this.log("Track "+F+" loaded ["+y.startSN+","+y.endSN+"],duration:"+y.totalduration);var B=v[F],O=0;if(y.live||(T=B.details)!==null&&T!==void 0&&T.live){var j=this.mainDetails;if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed||!j)return;!B.details&&y.hasProgramDateTime&&j.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(y,j),O=y.fragments[0].start):O=this.alignPlaylists(y,B.details)}B.details=y,this.levelLastLoaded=F,!this.startFragRequested&&(this.mainDetails||!y.live)&&this.setStartPosition(B.details,O),this.state===N.State.WAITING_TRACK&&!this.waitForCdnTuneIn(y)&&(this.state=N.State.IDLE),this.tick()},C._handleFragmentLoadProgress=function(x){var p,T=x.frag,v=x.part,y=x.payload,F=this.config,B=this.trackId,O=this.levels;if(!O){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+T.sn+" of level "+T.level+" will not be buffered");return}var j=O[B];console.assert(j,"Audio track is defined on fragment load progress");var P=j.details;console.assert(P,"Audio track details are defined on fragment load progress");var b=F.defaultAudioCodec||j.audioCodec||"mp4a.40.2",Y=this.transmuxer;Y||(Y=this.transmuxer=new m.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ee=this.initPTS[T.cc],ae=(p=T.initSegment)===null||p===void 0?void 0:p.data;if(ee!==void 0){var le=!1,Re=v?v.index:-1,Ee=Re!==-1,Te=new u.ChunkMetadata(T.level,T.sn,T.stats.chunkCount,y.byteLength,Re,Ee);Y.push(y,ae,b,"",T,v,P.totalduration,le,Te,ee)}else{h.logger.log("Unknown video PTS for cc "+T.cc+", waiting for video PTS before demuxing audio frag "+T.sn+" of ["+P.startSN+" ,"+P.endSN+"],track "+B);var Ae=this.waitingData=this.waitingData||{frag:T,part:v,cache:new d.default,complete:!1},Oe=Ae.cache;Oe.push(new Uint8Array(y)),this.waitingVideoCC=this.videoTrackCC,this.state=N.State.WAITING_INIT_PTS}},C._handleFragmentLoadComplete=function(x){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,x)},C.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},C.onBufferCreated=function(x,p){var T=p.tracks.audio;T&&(this.mediaBuffer=T.buffer),p.tracks.video&&(this.videoBuffer=p.tracks.video.buffer)},C.onFragBuffered=function(x,p){var T=p.frag,v=p.part;if(T.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(T)){this.warn("Fragment "+T.sn+(v?" p: "+v.index:"")+" of level "+T.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}T.sn!=="initSegment"&&(this.fragPrevious=T,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(T,v)},C.onError=function(x,p){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:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,p);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==N.State.ERROR&&this.state!==N.State.STOPPED&&(this.state=p.fatal?N.State.ERROR:N.State.IDLE,this.warn(p.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(p.parent==="audio"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var T=!0,v=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);v&&v.len>.5&&(T=!this.reduceMaxBufferLength(v.len)),T&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},C.onBufferFlushed=function(x,p){var T=p.type;T===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},C._handleTransmuxComplete=function(x){var p,T="audio",v=this.hls,y=x.remuxResult,F=x.chunkMeta,B=this.getCurrentContext(F);if(!B){this.warn("The loading context changed while buffering fragment "+F.sn+" of level "+F.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(F.level);return}var O=B.frag,j=B.part,P=y.audio,b=y.text,Y=y.id3,ee=y.initSegment;if(this.fragContextChanged(O))return;if(this.state=N.State.PARSING,this.audioSwitch&&P&&this.completeAudioSwitch(),ee!=null&&ee.tracks&&(this._bufferInitSegment(ee.tracks,O,F),v.trigger(U.Events.FRAG_PARSING_INIT_SEGMENT,{frag:O,id:T,tracks:ee.tracks})),P){var ae=P.startPTS,le=P.endPTS,Re=P.startDTS,Ee=P.endDTS;j&&(j.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:le,startDTS:Re,endDTS:Ee}),O.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ae,le,Re,Ee),this.bufferFragmentData(P,O,j,F)}if(Y!=null&&(p=Y.samples)!==null&&p!==void 0&&p.length){var Te=o({frag:O,id:T},Y);v.trigger(U.Events.FRAG_PARSING_METADATA,Te)}if(b){var Ae=o({frag:O,id:T},b);v.trigger(U.Events.FRAG_PARSING_USERDATA,Ae)}},C._bufferInitSegment=function(x,p,T){if(this.state!==N.State.PARSING)return;x.video&&delete x.video;var v=x.audio;if(!v)return;v.levelCodec=v.codec,v.id="audio",this.log("Init audio buffer, container:"+v.container+", codecs[parsed]=["+v.codec+"]"),this.hls.trigger(U.Events.BUFFER_CODECS,x);var y=v.initSegment;if(y!=null&&y.byteLength){var F={type:"audio",frag:p,part:null,chunkMeta:T,parent:p.type,data:y};this.hls.trigger(U.Events.BUFFER_APPENDING,F)}this.tick()},C.loadFragment=function(x,p,T){var v=this.fragmentTracker.getState(x);this.fragCurrent=x,(this.audioSwitch||v===W.FragmentState.NOT_LOADED||v===W.FragmentState.PARTIAL)&&(x.sn==="initSegment"?this._loadInitSegment(x):p.live&&!Object(X.isFiniteNumber)(this.initPTS[x.cc])?(this.log("Waiting for video PTS in continuity counter "+x.cc+" of live stream before loading audio fragment "+x.sn+" of level "+this.trackId),this.state=N.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,x,p,T)))},C.completeAudioSwitch=function(){var x=this.hls,p=this.media,T=this.trackId;p&&(this.log("Switching audio track : flushing all audio"),L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,x.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:T})},R}(N.default);$.default=w},"./src/controller/audio-track-controller.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/events.ts"),N=k("./src/errors.ts"),U=k("./src/controller/base-playlist-controller.ts"),G=k("./src/types/loader.ts");function W(m,u){for(var a=0;a<u.length;a++){var f=u[a];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}function i(m,u,a){return u&&W(m.prototype,u),a&&W(m,a),m}function D(m,u){m.prototype=Object.create(u.prototype),m.prototype.constructor=m,g(m,u)}function g(m,u){return g=Object.setPrototypeOf||function(f,l){return f.__proto__=l,f},g(m,u)}var d=function(m){D(u,m);function u(f){var l;return l=m.call(this,f,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var a=u.prototype;return a.registerListeners=function(){var l=this.hls;l.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(X.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var l=this.hls;l.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(X.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,m.prototype.destroy.call(this)},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},a.onManifestParsed=function(l,h){this.tracks=h.audioTracks||[]},a.onAudioTrackLoaded=function(l,h){var o=h.id,s=h.details,A=this.tracksInGroup[o];if(!A){this.warn("Invalid audio track id "+o);return}var _=A.details;A.details=h.details,this.log("audioTrack "+o+" loaded ["+s.startSN+"-"+s.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,h,_))},a.onLevelLoading=function(l,h){this.switchLevel(h.level)},a.onLevelSwitching=function(l,h){this.switchLevel(h.level)},a.switchLevel=function(l){var h=this.hls.levels[l];if(!(h!=null&&h.audioGroupIds))return;var o=h.audioGroupIds[h.urlId];if(this.groupId!==o){this.groupId=o;var s=this.tracks.filter(function(_){return!o||_.groupId===o});this.selectDefaultTrack&&!s.some(function(_){return _.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=s;var A={audioTracks:s};this.log("Updating audio tracks, "+s.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(X.Events.AUDIO_TRACKS_UPDATED,A),this.selectInitialTrack()}},a.onError=function(l,h){if(m.prototype.onError.call(this,l,h),h.fatal||!h.context)return;h.context.type===G.PlaylistContextType.AUDIO_TRACK&&h.context.id===this.trackId&&h.context.groupId===this.groupId&&this.retryLoadingOrFail(h)},a.setAudioTrack=function(l){var h=this.tracksInGroup;if(l<0||l>=h.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var o=h[this.trackId];this.log("Now switching to audio-track index "+l);var s=h[l],A=s.id,_=s.groupId,w=_===void 0?"":_,L=s.name,R=s.type,C=s.url;if(this.trackId=l,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:w,name:L,type:R,url:C}),s.details&&!s.details.live)return;var S=this.switchParams(s.url,o==null?void 0:o.details);this.loadPlaylist(S)},a.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var h=this.trackName,o=this.findTrackId(h)||this.findTrackId();o!==-1?this.setAudioTrack(o):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(l){for(var h=this.tracksInGroup,o=0;o<h.length;o++){var s=h[o];if((!this.selectDefaultTrack||s.default)&&(!l||l===s.name))return s.id}return-1},a.loadPlaylist=function(l){var h=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(h)){var o=h.id,s=h.groupId,A=h.url;if(l)try{A=l.addDirectives(A)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("loading audio-track playlist for id: "+o),this.clearTimer(),this.hls.trigger(X.Events.AUDIO_TRACK_LOADING,{url:A,id:o,groupId:s,deliveryDirectives:l||null})}},i(u,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),u}(U.default);$.default=d},"./src/controller/base-playlist-controller.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return i});var X=k("./src/polyfills/number.ts"),N=k("./src/types/level.ts"),U=k("./src/controller/level-helper.ts"),G=k("./src/utils/logger.ts"),W=k("./src/errors.ts"),i=function(){function D(d,m){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=G.logger.log.bind(G.logger,m+":"),this.warn=G.logger.warn.bind(G.logger,m+":"),this.hls=d}var g=D.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(m,u){u.fatal&&u.type===W.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(m,u){var a=u==null?void 0:u.renditionReports;if(a)for(var f=0;f<a.length;f++){var l=a[f],h=""+l.URI;if(h===m.substr(-h.length)){var o=parseInt(l["LAST-MSN"]),s=parseInt(l["LAST-PART"]);if(u&&this.hls.config.lowLatencyMode){var A=Math.min(u.age-u.partTarget,u.targetduration);s!==void 0&&A>u.partTarget&&(s+=1)}if(Object(X.isFiniteNumber)(o))return new N.HlsUrlParameters(o,Object(X.isFiniteNumber)(s)?s:void 0,N.HlsSkip.No)}}},g.loadPlaylist=function(m){},g.shouldLoadTrack=function(m){return this.canLoad&&m&&!!m.url&&(!m.details||m.details.live)},g.playlistLoaded=function(m,u,a){var f=this,l=u.details,h=u.stats,o=h.loading.end?Math.max(0,self.performance.now()-h.loading.end):0;if(l.advancedDateTime=Date.now()-o,l.live||a!=null&&a.live){if(l.reloaded(a),a&&this.log("live playlist "+m+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),a&&l.fragments.length>0&&Object(U.mergeDetails)(a,l),!this.canLoad||!l.live)return;var s,A=void 0,_=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var w=this.hls.config.lowLatencyMode,L=l.lastPartSn,R=l.endSN,C=l.lastPartIndex,S=C!==-1,x=L===R,p=w?0:C;S?(A=x?R+1:L,_=x?p:C+1):A=R+1;var T=l.age,v=T+l.ageHeader,y=Math.min(v-l.partTarget,l.targetduration*1.5);if(y>0){if(a&&y>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+y+" with playlist age: "+l.age),y=0;else{var F=Math.floor(y/l.targetduration);if(A+=F,_!==void 0){var B=Math.round(y%l.targetduration/l.partTarget);_+=B}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+T.toFixed(2)+"s goal: "+y+" skip sn "+F+" to part "+_)}l.tuneInGoal=y}if(s=this.getDeliveryDirectives(l,u.deliveryDirectives,A,_),w||!x){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(l,u.deliveryDirectives,A,_);var O=Object(U.computeReloadInterval)(l,h);A!==void 0&&l.canBlockReload&&(O-=l.partTarget||1),this.log("reload live playlist "+m+" in "+Math.round(O)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(s)},O)}else this.clearTimer()},g.getDeliveryDirectives=function(m,u,a,f){var l=Object(N.getSkipValue)(m,a);return u!=null&&u.skip&&m.deltaUpdateFailed&&(a=u.msn,f=u.part,l=N.HlsSkip.No),new N.HlsUrlParameters(a,f,l)},g.retryLoadingOrFail=function(m){var u=this,a=this.hls.config,f=this.retryCount<a.levelLoadingMaxRetry;if(f){var l;if(this.retryCount++,m.details.indexOf("LoadTimeOut")>-1&&(l=m.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+m.details+'"'),this.loadPlaylist();else{var h=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.loadPlaylist()},h),this.warn("retry playlist loading #"+this.retryCount+" in "+h+' ms after "'+m.details+'"')}}else this.warn('cannot recover from error "'+m.details+'"'),this.clearTimer(),m.fatal=!0;return f},D}()},"./src/controller/base-stream-controller.ts":function(ne,$,k){"use strict";k.r($),k.d($,"State",function(){return R}),k.d($,"default",function(){return C});var X=k("./src/polyfills/number.ts"),N=k("./src/task-loop.ts"),U=k("./src/controller/fragment-tracker.ts"),G=k("./src/utils/buffer-helper.ts"),W=k("./src/utils/logger.ts"),i=k("./src/events.ts"),D=k("./src/errors.ts"),g=k("./src/types/transmuxer.ts"),d=k("./src/utils/mp4-tools.ts"),m=k("./src/utils/discontinuities.ts"),u=k("./src/controller/fragment-finders.ts"),a=k("./src/controller/level-helper.ts"),f=k("./src/loader/fragment-loader.ts"),l=k("./src/crypt/decrypter.ts"),h=k("./src/utils/time-ranges.ts"),o=k("./src/types/loader.ts");function s(S,x){for(var p=0;p<x.length;p++){var T=x[p];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(S,T.key,T)}}function A(S,x,p){return x&&s(S.prototype,x),p&&s(S,p),S}function _(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function w(S,x){S.prototype=Object.create(x.prototype),S.prototype.constructor=S,L(S,x)}function L(S,x){return L=Object.setPrototypeOf||function(T,v){return T.__proto__=v,T},L(S,x)}var R={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},C=function(S){w(x,S);function x(T,v,y){var F;return F=S.call(this)||this,F.hls=void 0,F.fragPrevious=null,F.fragCurrent=null,F.fragmentTracker=void 0,F.transmuxer=null,F._state=R.STOPPED,F.media=void 0,F.mediaBuffer=void 0,F.config=void 0,F.bitrateTest=!1,F.lastCurrentTime=0,F.nextLoadPosition=0,F.startPosition=0,F.loadedmetadata=!1,F.fragLoadError=0,F.retryDate=0,F.levels=null,F.fragmentLoader=void 0,F.levelLastLoaded=null,F.startFragRequested=!1,F.decrypter=void 0,F.initPTS=[],F.onvseeking=null,F.onvended=null,F.logPrefix="",F.log=void 0,F.warn=void 0,F.logPrefix=y,F.log=W.logger.log.bind(W.logger,y+":"),F.warn=W.logger.warn.bind(W.logger,y+":"),F.hls=T,F.fragmentLoader=new f.default(T.config),F.fragmentTracker=v,F.config=T.config,F.decrypter=new l.default(T,T.config),T.on(i.Events.KEY_LOADED,F.onKeyLoaded,_(F)),F}var p=x.prototype;return p.doTick=function(){this.onTickEnd()},p.onTickEnd=function(){},p.startLoad=function(v){},p.stopLoad=function(){this.fragmentLoader.abort();var v=this.fragCurrent;v&&this.fragmentTracker.removeFragment(v),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=R.STOPPED},p._streamEnded=function(v,y){var F=this.fragCurrent,B=this.fragmentTracker;if(!y.live&&F&&F.sn===y.endSN&&!v.nextStart){var O=B.getState(F);return O===U.FragmentState.PARTIAL||O===U.FragmentState.OK}return!1},p.onMediaAttached=function(v,y){var F=this.media=this.mediaBuffer=y.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),F.addEventListener("seeking",this.onvseeking),F.addEventListener("ended",this.onvended);var B=this.config;this.levels&&B.autoStartLoad&&this.state===R.STOPPED&&this.startLoad(B.startPosition)},p.onMediaDetaching=function(){var v=this.media;v!=null&&v.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),v&&(v.removeEventListener("seeking",this.onvseeking),v.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},p.onMediaSeeking=function(){var v=this.config,y=this.fragCurrent,F=this.media,B=this.mediaBuffer,O=this.state,j=F?F.currentTime:0,P=G.BufferHelper.bufferInfo(B||F,j,v.maxBufferHole);if(this.log("media seeking to "+(Object(X.isFiniteNumber)(j)?j.toFixed(3):j)+", state: "+O),O===R.ENDED)this.resetLoadingState();else if(y&&!P.len){var b=v.maxFragLookUpTolerance,Y=y.start-b,ee=y.start+y.duration+b,ae=j>ee;(j<Y||ae)&&(ae&&y.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),y.loader.abort()),this.resetLoadingState())}F&&(this.lastCurrentTime=j),!this.loadedmetadata&&!P.len&&(this.nextLoadPosition=this.startPosition=j),this.tickImmediate()},p.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},p.onKeyLoaded=function(v,y){if(this.state!==R.KEY_LOADING||y.frag!==this.fragCurrent||!this.levels)return;this.state=R.IDLE;var F=this.levels[y.frag.level].details;F&&this.loadFragment(y.frag,F,y.frag.start)},p.onHandlerDestroying=function(){this.stopLoad(),S.prototype.onHandlerDestroying.call(this)},p.onHandlerDestroyed=function(){this.state=R.STOPPED,this.hls.off(i.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,S.prototype.onHandlerDestroyed.call(this)},p.loadKey=function(v,y){this.log("Loading key for "+v.sn+" of ["+y.startSN+"-"+y.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level),this.state=R.KEY_LOADING,this.fragCurrent=v,this.hls.trigger(i.Events.KEY_LOADING,{frag:v})},p.loadFragment=function(v,y,F){this._loadFragForPlayback(v,y,F)},p._loadFragForPlayback=function(v,y,F){var B=this,O=function(P){if(B.fragContextChanged(v)){B.warn("Fragment "+v.sn+(P.part?" p: "+P.part.index:"")+" of level "+v.level+" was dropped during download."),B.fragmentTracker.removeFragment(v);return}v.stats.chunkCount++,B._handleFragmentLoadProgress(P)};this._doFragLoad(v,y,F,O).then(function(j){if(!j)return;B.fragLoadError=0;var P=B.state;if(B.fragContextChanged(v)){(P===R.FRAG_LOADING||P===R.BACKTRACKING||!B.fragCurrent&&P===R.PARSING)&&(B.fragmentTracker.removeFragment(v),B.state=R.IDLE);return}if("payload"in j&&(B.log("Loaded fragment "+v.sn+" of level "+v.level),B.hls.trigger(i.Events.FRAG_LOADED,j),B.state===R.BACKTRACKING)){B.fragmentTracker.backtrack(v,j),B.resetFragmentLoading(v);return}B._handleFragmentLoadComplete(j)}).catch(function(j){B.warn(j),B.resetFragmentLoading(v)})},p.flushMainBuffer=function(v,y,F){if(F===void 0&&(F=null),!(v-y))return;var B={startOffset:v,endOffset:y,type:F};this.fragLoadError=0,this.hls.trigger(i.Events.BUFFER_FLUSHING,B)},p._loadInitSegment=function(v){var y=this;this._doFragLoad(v).then(function(F){if(!F||y.fragContextChanged(v)||!y.levels)throw new Error("init load aborted");return F}).then(function(F){var B=y.hls,O=F.payload,j=v.decryptdata;if(O&&O.byteLength>0&&j&&j.key&&j.iv&&j.method==="AES-128"){var P=self.performance.now();return y.decrypter.webCryptoDecrypt(new Uint8Array(O),j.key.buffer,j.iv.buffer).then(function(b){var Y=self.performance.now();return B.trigger(i.Events.FRAG_DECRYPTED,{frag:v,payload:b,stats:{tstart:P,tdecrypt:Y}}),F.payload=b,F})}return F}).then(function(F){var B=y.fragCurrent,O=y.hls,j=y.levels;if(!j)throw new Error("init load aborted, missing levels");var P=j[v.level].details;console.assert(P,"Level details are defined when init segment is loaded");var b=v.stats;y.state=R.IDLE,y.fragLoadError=0,v.data=new Uint8Array(F.payload),b.parsing.start=b.buffering.start=self.performance.now(),b.parsing.end=b.buffering.end=self.performance.now(),F.frag===B&&O.trigger(i.Events.FRAG_BUFFERED,{stats:b,frag:B,part:null,id:v.type}),y.tick()}).catch(function(F){y.warn(F),y.resetFragmentLoading(v)})},p.fragContextChanged=function(v){var y=this.fragCurrent;return!v||!y||v.level!==y.level||v.sn!==y.sn||v.urlId!==y.urlId},p.fragBufferedComplete=function(v,y){var F=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+v.type+" sn: "+v.sn+(y?" part: "+y.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level+" "+h.default.toString(G.BufferHelper.getBuffered(F))),this.state=R.IDLE,this.tick()},p._handleFragmentLoadComplete=function(v){var y=this.transmuxer;if(!y)return;var F=v.frag,B=v.part,O=v.partsLoaded,j=!O||O.length===0||O.some(function(b){return!b}),P=new g.ChunkMetadata(F.level,F.sn,F.stats.chunkCount+1,0,B?B.index:-1,!j);y.flush(P)},p._handleFragmentLoadProgress=function(v){},p._doFragLoad=function(v,y,F,B){var O=this;if(F===void 0&&(F=null),!this.levels)throw new Error("frag load aborted, missing levels");if(F=Math.max(v.start,F||0),this.config.lowLatencyMode&&y){var j=y.partList;if(j&&B){F>v.end&&y.fragmentHint&&(v=y.fragmentHint);var P=this.getNextPart(j,v,F);if(P>-1){var b=j[P];return this.log("Loading part sn: "+v.sn+" p: "+b.index+" cc: "+v.cc+" of playlist ["+y.startSN+"-"+y.endSN+"] parts [0-"+P+"-"+(j.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(F.toFixed(3))),this.nextLoadPosition=b.start+b.duration,this.state=R.FRAG_LOADING,this.hls.trigger(i.Events.FRAG_LOADING,{frag:v,part:j[P],targetBufferTime:F}),this.doFragPartsLoad(v,j,P,B).catch(function(Y){return O.handleFragLoadError(Y)})}else if(!v.url||this.loadedEndOfParts(j,F))return Promise.resolve(null)}}return this.log("Loading fragment "+v.sn+" cc: "+v.cc+" "+(y?"of ["+y.startSN+"-"+y.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(F.toFixed(3))),Object(X.isFiniteNumber)(v.sn)&&!this.bitrateTest&&(this.nextLoadPosition=v.start+v.duration),this.state=R.FRAG_LOADING,this.hls.trigger(i.Events.FRAG_LOADING,{frag:v,targetBufferTime:F}),this.fragmentLoader.load(v,B).catch(function(Y){return O.handleFragLoadError(Y)})},p.doFragPartsLoad=function(v,y,F,B){var O=this;return new Promise(function(j,P){var b=[],Y=function ee(ae){var le=y[ae];O.fragmentLoader.loadPart(v,le,B).then(function(Re){b[le.index]=Re;var Ee=Re.part;O.hls.trigger(i.Events.FRAG_LOADED,Re);var Te=y[ae+1];if(Te&&Te.fragment===v)ee(ae+1);else return j({frag:v,part:Ee,partsLoaded:b})}).catch(P)};Y(F)})},p.handleFragLoadError=function(v){var y=v.data;return y&&y.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(y.frag,y.part):this.hls.trigger(i.Events.ERROR,y),null},p._handleTransmuxerFlush=function(v){var y=this.getCurrentContext(v);if(!y||this.state!==R.PARSING){this.fragCurrent||(this.state=R.IDLE);return}var F=y.frag,B=y.part,O=y.level,j=self.performance.now();F.stats.parsing.end=j,B&&(B.stats.parsing.end=j),this.updateLevelTiming(F,B,O,v.partial)},p.getCurrentContext=function(v){var y=this.levels,F=v.level,B=v.sn,O=v.part;if(!y||!y[F])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+F+". The current chunk will not be buffered."),null;var j=y[F],P=O>-1?Object(a.getPartWith)(j,B,O):null,b=P?P.fragment:Object(a.getFragmentWithSN)(j,B,this.fragCurrent);return b?{frag:b,part:P,level:j}:null},p.bufferFragmentData=function(v,y,F,B){if(!v||this.state!==R.PARSING)return;var O=v.data1,j=v.data2,P=O;if(O&&j&&(P=Object(d.appendUint8Array)(O,j)),!P||!P.length)return;var b={type:v.type,frag:y,part:F,chunkMeta:B,parent:y.type,data:P};this.hls.trigger(i.Events.BUFFER_APPENDING,b),v.dropped&&v.independent&&!F&&this.flushBufferGap(y)},p.flushBufferGap=function(v){var y=this.media;if(!y)return;if(!G.BufferHelper.isBuffered(y,y.currentTime)){this.flushMainBuffer(0,v.start);return}var F=y.currentTime,B=G.BufferHelper.bufferInfo(y,F,0),O=v.duration,j=Math.min(this.config.maxFragLookUpTolerance*2,O*.25),P=Math.max(Math.min(v.start-j,B.end-j),F+j);v.start-P>j&&this.flushMainBuffer(P,v.start)},p.getFwdBufferInfo=function(v,y){var F=this.config,B=this.getLoadPosition();if(!Object(X.isFiniteNumber)(B))return null;var O=G.BufferHelper.bufferInfo(v,B,F.maxBufferHole);if(O.len===0&&O.nextStart!==void 0){var j=this.fragmentTracker.getBufferedFrag(B,y);if(j&&O.nextStart<j.end)return G.BufferHelper.bufferInfo(v,B,Math.max(O.nextStart,F.maxBufferHole))}return O},p.getMaxBufferLength=function(v){var y=this.config,F;return v?F=Math.max(8*y.maxBufferSize/v,y.maxBufferLength):F=y.maxBufferLength,Math.min(F,y.maxMaxBufferLength)},p.reduceMaxBufferLength=function(v){var y=this.config,F=v||y.maxBufferLength;return y.maxMaxBufferLength>=F?(y.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+y.maxMaxBufferLength+"s"),!0):!1},p.getNextFragment=function(v,y){var F,B,O=y.fragments,j=O.length;if(!j)return null;var P=this.config,b=O[0].start,Y;if(y.live){var ee=P.initialLiveManifestSize;if(j<ee)return this.warn("Not enough fragments to start playback (have: "+j+", need: "+ee+")"),null;!y.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(Y=this.getInitialLiveFragment(y,O),this.startPosition=Y?this.hls.liveSyncPosition||Y.start:v)}else v<=b&&(Y=O[0]);if(!Y){var ae=P.lowLatencyMode?y.partEnd:y.fragmentEnd;Y=this.getFragmentAtPosition(v,ae,y)}return(F=Y)!==null&&F!==void 0&&F.initSegment&&!((B=Y)!==null&&B!==void 0&&B.initSegment.data)&&!this.bitrateTest&&(Y=Y.initSegment),Y},p.getNextPart=function(v,y,F){for(var B=-1,O=!1,j=!0,P=0,b=v.length;P<b;P++){var Y=v[P];if(j=j&&!Y.independent,B>-1&&F<Y.start)break;var ee=Y.loaded;!ee&&(O||Y.independent||j)&&Y.fragment===y&&(B=P),O=ee}return B},p.loadedEndOfParts=function(v,y){var F=v[v.length-1];return F&&y>F.start&&F.loaded},p.getInitialLiveFragment=function(v,y){var F=this.fragPrevious,B=null;if(F){if(v.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+F.programDateTime),B=Object(u.findFragmentByPDT)(y,F.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var O=F.sn+1;if(O>=v.startSN&&O<=v.endSN){var j=y[O-v.startSN];F.cc===j.cc&&(B=j,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(u.findFragWithCC)(y,F.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var P=this.hls.liveSyncPosition;P!==null&&(B=this.getFragmentAtPosition(P,this.bitrateTest?v.fragmentEnd:v.edge,v))}return B},p.getFragmentAtPosition=function(v,y,F){var B=this.config,O=this.fragPrevious,j=F.fragments,P=F.endSN,b=F.fragmentHint,Y=B.maxFragLookUpTolerance,ee=!!(B.lowLatencyMode&&F.partList&&b);ee&&b&&!this.bitrateTest&&(j=j.concat(b),P=b.sn);var ae;if(v<y){var le=v>y-Y?0:Y;ae=Object(u.findFragmentByPTS)(O,j,v,le)}else ae=j[j.length-1];if(ae){var Re=ae.sn-F.startSN,Ee=O&&ae.level===O.level,Te=j[Re+1],Ae=this.fragmentTracker.getState(ae);if(Ae===U.FragmentState.BACKTRACKED){ae=null;for(var Oe=Re;j[Oe]&&this.fragmentTracker.getState(j[Oe])===U.FragmentState.BACKTRACKED;)O?ae=j[Oe--]:ae=j[--Oe];ae||(ae=Te)}else O&&ae.sn===O.sn&&!ee&&(Ee&&(ae.sn<P&&this.fragmentTracker.getState(Te)!==U.FragmentState.OK?(this.log("SN "+ae.sn+" just loaded, load next one: "+Te.sn),ae=Te):ae=null))}return ae},p.synchronizeToLiveEdge=function(v){var y=this.config,F=this.media;if(!F)return;var B=this.hls.liveSyncPosition,O=F.currentTime,j=v.fragments[0].start,P=v.edge,b=O>=j-y.maxFragLookUpTolerance&&O<=P;if(B!==null&&F.duration>B&&(O<B||!b)){var Y=y.liveMaxLatencyDuration!==void 0?y.liveMaxLatencyDuration:y.liveMaxLatencyDurationCount*v.targetduration;(!b&&F.readyState<4||O<P-Y)&&(this.loadedmetadata||(this.nextLoadPosition=B),F.readyState&&(this.warn("Playback: "+O.toFixed(3)+" is located too far from the end of live sliding playlist: "+P+", reset currentTime to : "+B.toFixed(3)),F.currentTime=B))}},p.alignPlaylists=function(v,y){var F=this.levels,B=this.levelLastLoaded,O=this.fragPrevious,j=B!==null?F[B]:null,P=v.fragments.length;if(!P)return this.warn("No fragments in live playlist"),0;var b=v.fragments[0].start,Y=!y,ee=v.alignedSliding&&Object(X.isFiniteNumber)(b);if(Y||!ee&&!b){Object(m.alignStream)(O,j,v);var ae=v.fragments[0].start;return this.log("Live playlist sliding: "+ae.toFixed(2)+" start-sn: "+(y?y.startSN:"na")+"->"+v.startSN+" prev-sn: "+(O?O.sn:"na")+" fragments: "+P),ae}return b},p.waitForCdnTuneIn=function(v){var y=3;return v.live&&v.canBlockReload&&v.tuneInGoal>Math.max(v.partHoldBack,v.partTarget*y)},p.setStartPosition=function(v,y){var F=this.startPosition;if(F<y&&(F=-1),F===-1||this.lastCurrentTime===-1){var B=v.startTimeOffset;Object(X.isFiniteNumber)(B)?(F=y+B,B<0&&(F+=v.totalduration),F=Math.min(Math.max(y,F),y+v.totalduration),this.log("Start time offset "+B+" found in playlist, adjust startPosition to "+F),this.startPosition=F):v.live?F=this.hls.liveSyncPosition||y:this.startPosition=F=0,this.lastCurrentTime=F}this.nextLoadPosition=F},p.getLoadPosition=function(){var v=this.media,y=0;return this.loadedmetadata&&v?y=v.currentTime:this.nextLoadPosition&&(y=this.nextLoadPosition),y},p.handleFragLoadAborted=function(v,y){this.transmuxer&&v.sn!=="initSegment"&&v.stats.aborted&&(this.warn("Fragment "+v.sn+(y?" part"+y.index:"")+" of level "+v.level+" was aborted"),this.resetFragmentLoading(v))},p.resetFragmentLoading=function(v){(!this.fragCurrent||!this.fragContextChanged(v))&&(this.state=R.IDLE)},p.onFragmentOrKeyLoadError=function(v,y){if(y.fatal)return;var F=y.frag;if(!F||F.type!==v)return;var B=this.fragCurrent;console.assert(B&&F.sn===B.sn&&F.level===B.level&&F.urlId===B.urlId,"Frag load error must match current frag to retry");var O=this.config;if(this.fragLoadError+1<=O.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(F.level))return;var j=Math.min(Math.pow(2,this.fragLoadError)*O.fragLoadingRetryDelay,O.fragLoadingMaxRetryTimeout);this.warn("Fragment "+F.sn+" of "+v+" "+F.level+" failed to load, retrying in "+j+"ms"),this.retryDate=self.performance.now()+j,this.fragLoadError++,this.state=R.FRAG_LOADING_WAITING_RETRY}else y.levelRetry?(v===o.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=R.IDLE):(W.logger.error(y.details+" reaches max retry, redispatch as fatal ..."),y.fatal=!0,this.hls.stopLoad(),this.state=R.ERROR)},p.afterBufferFlushed=function(v,y,F){if(!v)return;var B=G.BufferHelper.getBuffered(v);this.fragmentTracker.detectEvictedFragments(y,B,F),this.state===R.ENDED&&this.resetLoadingState()},p.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=R.IDLE},p.resetLiveStartWhenNotLoaded=function(v){if(!this.loadedmetadata){this.startFragRequested=!1;var y=this.levels?this.levels[v].details:null;if(y!=null&&y.live)return this.startPosition=-1,this.setStartPosition(y,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},p.updateLevelTiming=function(v,y,F,B){var O=this,j=F.details;console.assert(!!j,"level.details must be defined");var P=Object.keys(v.elementaryStreams).reduce(function(b,Y){var ee=v.elementaryStreams[Y];if(ee){var ae=ee.endPTS-ee.startPTS;if(ae<=0)return O.warn("Could not parse fragment "+v.sn+" "+Y+" duration reliably ("+ae+") resetting transmuxer to fallback to playlist timing"),O.resetTransmuxer(),b||!1;var le=B?0:Object(a.updateFragPTSDTS)(j,v,ee.startPTS,ee.endPTS,ee.startDTS,ee.endDTS);return O.hls.trigger(i.Events.LEVEL_PTS_UPDATED,{details:j,level:F,drift:le,type:Y,frag:v,start:ee.startPTS,end:ee.endPTS}),!0}return b},!1);P?(this.state=R.PARSED,this.hls.trigger(i.Events.FRAG_PARSED,{frag:v,part:y})):this.resetLoadingState()},p.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},A(x,[{key:"state",get:function(){return this._state},set:function(v){var y=this._state;y!==v&&(this._state=v,this.log(y+"->"+v))}}]),x}(N.default)},"./src/controller/buffer-controller.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return u});var X=k("./src/polyfills/number.ts"),N=k("./src/events.ts"),U=k("./src/utils/logger.ts"),G=k("./src/errors.ts"),W=k("./src/utils/buffer-helper.ts"),i=k("./src/utils/mediasource-helper.ts"),D=k("./src/loader/fragment.ts"),g=k("./src/controller/buffer-operation-queue.ts"),d=Object(i.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function a(l){var h=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var o=h.hls,s=h.media,A=h.mediaSource;U.logger.log("[buffer-controller]: Media source opened"),s&&(h.updateMediaElementDuration(),o.trigger(N.Events.MEDIA_ATTACHED,{media:s})),A&&A.removeEventListener("sourceopen",h._onMediaSourceOpen),h.checkPendingTracks()},this._onMediaSourceClose=function(){U.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){U.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var f=a.prototype;return f.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},f.destroy=function(){this.unregisterListeners(),this.details=null},f.registerListeners=function(){var h=this.hls;h.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(N.Events.BUFFER_RESET,this.onBufferReset,this),h.on(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.on(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.on(N.Events.BUFFER_EOS,this.onBufferEos,this),h.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.on(N.Events.FRAG_PARSED,this.onFragParsed,this),h.on(N.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var h=this.hls;h.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(N.Events.BUFFER_RESET,this.onBufferReset,this),h.off(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.off(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.off(N.Events.BUFFER_EOS,this.onBufferEos,this),h.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.off(N.Events.FRAG_PARSED,this.onFragParsed,this),h.off(N.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(h,o){var s=2;(o.audio&&!o.video||!o.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,U.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(h,o){var s=this.media=o.media;if(s&&d){var A=this.mediaSource=new d;A.addEventListener("sourceopen",this._onMediaSourceOpen),A.addEventListener("sourceended",this._onMediaSourceEnded),A.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(A),this._objectUrl=s.src}},f.onMediaDetaching=function(){var h=this.media,o=this.mediaSource,s=this._objectUrl;if(o){if(U.logger.log("[buffer-controller]: media source detaching"),o.readyState==="open")try{o.endOfStream()}catch(A){U.logger.warn("[buffer-controller]: onMediaDetaching: "+A.message+" while calling endOfStream")}this.onBufferReset(),o.removeEventListener("sourceopen",this._onMediaSourceOpen),o.removeEventListener("sourceended",this._onMediaSourceEnded),o.removeEventListener("sourceclose",this._onMediaSourceClose),h&&(s&&self.URL.revokeObjectURL(s),h.src===s?(h.removeAttribute("src"),h.load()):U.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(N.Events.MEDIA_DETACHED,void 0)},f.onBufferReset=function(){var h=this;this.getSourceBufferTypes().forEach(function(o){var s=h.sourceBuffer[o];try{s&&(h.removeBufferListeners(o),h.mediaSource&&h.mediaSource.removeSourceBuffer(s),h.sourceBuffer[o]=void 0)}catch(A){U.logger.warn("[buffer-controller]: Failed to reset the "+o+" buffer",A)}}),this._initSourceBuffer()},f.onBufferCodecs=function(h,o){var s=this,A=this.getSourceBufferTypes().length;if(Object.keys(o).forEach(function(_){if(A){var w=s.tracks[_];if(w&&typeof w.buffer.changeType=="function"){var L=o[_],R=L.codec,C=L.levelCodec,S=L.container,x=(w.levelCodec||w.codec).replace(m,"$1"),p=(C||R).replace(m,"$1");if(x!==p){var T=S+";codecs="+(C||R);s.appendChangeType(_,T)}}}else s.pendingTracks[_]=o[_]}),A)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(h,o){var s=this,A=this.operationQueue,_={execute:function(){var L=s.sourceBuffer[h];L&&(U.logger.log("[buffer-controller]: changing "+h+" sourceBuffer type to "+o),L.changeType(o)),A.shiftAndExecuteNext(h)},onStart:function(){},onComplete:function(){},onError:function(L){U.logger.warn("[buffer-controller]: Failed to change "+h+" SourceBuffer type",L)}};A.append(_,h)},f.onBufferAppending=function(h,o){var s=this,A=this.hls,_=this.operationQueue,w=this.tracks,L=o.data,R=o.type,C=o.frag,S=o.part,x=o.chunkMeta,p=x.buffering[R],T=self.performance.now();p.start=T;var v=C.stats.buffering,y=S?S.stats.buffering:null;v.start===0&&(v.start=T),y&&y.start===0&&(y.start=T);var F=w.audio,B=R==="audio"&&x.id===1&&(F==null?void 0:F.container)==="audio/mpeg",O={execute:function(){if(p.executeStart=self.performance.now(),B){var P=s.sourceBuffer[R];if(P){var b=C.start-P.timestampOffset;Math.abs(b)>=.1&&(U.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+C.start+" (delta: "+b+") sn: "+C.sn+")"),P.timestampOffset=C.start)}}s.appendExecutor(L,R)},onStart:function(){},onComplete:function(){var P=self.performance.now();p.executeEnd=p.end=P,v.first===0&&(v.first=P),y&&y.first===0&&(y.first=P);var b=s.sourceBuffer,Y={};for(var ee in b)Y[ee]=W.BufferHelper.getBuffered(b[ee]);s.appendError=0,s.hls.trigger(N.Events.BUFFER_APPENDED,{type:R,frag:C,part:S,chunkMeta:x,parent:C.type,timeRanges:Y})},onError:function(P){U.logger.error("[buffer-controller]: Error encountered while trying to append to the "+R+" SourceBuffer",P);var b={type:G.ErrorTypes.MEDIA_ERROR,parent:C.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:P,fatal:!1};P.code===DOMException.QUOTA_EXCEEDED_ERR?b.details=G.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,b.details=G.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>A.config.appendErrorMaxRetry&&(U.logger.error("[buffer-controller]: Failed "+A.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),b.fatal=!0)),A.trigger(N.Events.ERROR,b)}};_.append(O,R)},f.onBufferFlushing=function(h,o){var s=this,A=this.operationQueue,_=function(L){return{execute:s.removeExecutor.bind(s,L,o.startOffset,o.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(N.Events.BUFFER_FLUSHED,{type:L})},onError:function(C){U.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",C)}}};o.type?A.append(_(o.type),o.type):this.getSourceBufferTypes().forEach(function(w){A.append(_(w),w)})},f.onFragParsed=function(h,o){var s=this,A=o.frag,_=o.part,w=[],L=_?_.elementaryStreams:A.elementaryStreams;L[D.ElementaryStreamTypes.AUDIOVIDEO]?w.push("audiovideo"):(L[D.ElementaryStreamTypes.AUDIO]&&w.push("audio"),L[D.ElementaryStreamTypes.VIDEO]&&w.push("video"));var R=function(){var S=self.performance.now();A.stats.buffering.end=S,_&&(_.stats.buffering.end=S);var x=_?_.stats:A.stats;s.hls.trigger(N.Events.FRAG_BUFFERED,{frag:A,part:_,stats:x,id:A.type})};w.length===0&&U.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+A.type+" level: "+A.level+" sn: "+A.sn),this.blockBuffers(R,w)},f.onFragChanged=function(h,o){this.flushBackBuffer()},f.onBufferEos=function(h,o){var s=this,A=this.getSourceBufferTypes().reduce(function(_,w){var L=s.sourceBuffer[w];return(!o.type||o.type===w)&&(L&&!L.ended&&(L.ended=!0,U.logger.log("[buffer-controller]: "+w+" sourceBuffer now EOS"))),_&&!!(!L||L.ended)},!0);A&&this.blockBuffers(function(){var _=s.mediaSource;if(!_||_.readyState!=="open")return;_.endOfStream()})},f.onLevelUpdated=function(h,o){var s=o.details;if(!s.fragments.length)return;this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},f.flushBackBuffer=function(){var h=this.hls,o=this.details,s=this.media,A=this.sourceBuffer;if(!s||o===null)return;var _=this.getSourceBufferTypes();if(!_.length)return;var w=o.live&&h.config.liveBackBufferLength!==null?h.config.liveBackBufferLength:h.config.backBufferLength;if(!Object(X.isFiniteNumber)(w)||w<0)return;var L=s.currentTime,R=o.levelTargetDuration,C=Math.max(w,R),S=Math.floor(L/R)*R-C;_.forEach(function(x){var p=A[x];if(p){var T=W.BufferHelper.getBuffered(p);T.length>0&&S>T.start(0)&&(h.trigger(N.Events.BACK_BUFFER_REACHED,{bufferEnd:S}),o.live&&h.trigger(N.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:S}),h.trigger(N.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:S,type:x}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var h=this.details,o=this.hls,s=this.media,A=this.mediaSource,_=h.fragments[0].start+h.totalduration,w=s.duration,L=Object(X.isFiniteNumber)(A.duration)?A.duration:0;h.live&&o.config.liveDurationInfinity?(U.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),A.duration=Infinity,this.updateSeekableRange(h)):(_>L&&_>w||!Object(X.isFiniteNumber)(w))&&(U.logger.log("[buffer-controller]: Updating Media Source duration to "+_.toFixed(3)),A.duration=_)},f.updateSeekableRange=function(h){var o=this.mediaSource,s=h.fragments,A=s.length;if(A&&h.live&&o!==null&&o!==void 0&&o.setLiveSeekableRange){var _=Math.max(0,s[0].start),w=Math.max(_,_+h.totalduration);o.setLiveSeekableRange(_,w)}},f.checkPendingTracks=function(){var h=this.bufferCodecEventsExpected,o=this.operationQueue,s=this.pendingTracks,A=Object.keys(s).length;if(A&&!h||A===2){this.createSourceBuffers(s),this.pendingTracks={};var _=this.getSourceBufferTypes();if(_.length===0){this.hls.trigger(N.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}_.forEach(function(w){o.executeNext(w)})}},f.createSourceBuffers=function(h){var o=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var A=0;for(var _ in h)if(!o[_]){var w=h[_];if(!w)throw Error("source buffer exists for track "+_+", however track does not");var L=w.levelCodec||w.codec,R=w.container+";codecs="+L;U.logger.log("[buffer-controller]: creating sourceBuffer("+R+")");try{var C=o[_]=s.addSourceBuffer(R),S=_;this.addBufferListener(S,"updatestart",this._onSBUpdateStart),this.addBufferListener(S,"updateend",this._onSBUpdateEnd),this.addBufferListener(S,"error",this._onSBUpdateError),this.tracks[_]={buffer:C,codec:L,container:w.container,levelCodec:w.levelCodec,id:w.id},A++}catch(x){U.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+x.message),this.hls.trigger(N.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,mimeType:R})}}A&&this.hls.trigger(N.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(h){var o=this.operationQueue,s=o.current(h);s.onStart()},f._onSBUpdateEnd=function(h){var o=this.operationQueue,s=o.current(h);s.onComplete(),o.shiftAndExecuteNext(h)},f._onSBUpdateError=function(h,o){U.logger.error("[buffer-controller]: "+h+" SourceBuffer error",o),this.hls.trigger(N.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(h);s&&s.onError(o)},f.removeExecutor=function(h,o,s){var A=this.media,_=this.mediaSource,w=this.operationQueue,L=this.sourceBuffer,R=L[h];if(!A||!_||!R){U.logger.warn("[buffer-controller]: Attempting to remove from the "+h+" SourceBuffer, but it does not exist"),w.shiftAndExecuteNext(h);return}var C=Object(X.isFiniteNumber)(A.duration)?A.duration:Infinity,S=Object(X.isFiniteNumber)(_.duration)?_.duration:Infinity,x=Math.max(0,o),p=Math.min(s,C,S);p>x?(U.logger.log("[buffer-controller]: Removing ["+x+","+p+"] from the "+h+" SourceBuffer"),console.assert(!R.updating,h+" sourceBuffer must not be updating"),R.remove(x,p)):w.shiftAndExecuteNext(h)},f.appendExecutor=function(h,o){var s=this.operationQueue,A=this.sourceBuffer,_=A[o];if(!_){U.logger.warn("[buffer-controller]: Attempting to append to the "+o+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(o);return}_.ended=!1,console.assert(!_.updating,o+" sourceBuffer must not be updating"),_.appendBuffer(h)},f.blockBuffers=function(h,o){var s=this;if(o===void 0&&(o=this.getSourceBufferTypes()),!o.length){U.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(h);return}var A=this.operationQueue,_=o.map(function(w){return A.appendBlocker(w)});Promise.all(_).then(function(){h(),o.forEach(function(w){var L=s.sourceBuffer[w];(!L||!L.updating)&&A.shiftAndExecuteNext(w)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(h,o,s){var A=this.sourceBuffer[h];if(!A)return;var _=s.bind(this,h);this.listeners[h].push({event:o,listener:_}),A.addEventListener(o,_)},f.removeBufferListeners=function(h){var o=this.sourceBuffer[h];if(!o)return;this.listeners[h].forEach(function(s){o.removeEventListener(s.event,s.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return N});var X=k("./src/utils/logger.ts"),N=function(){function U(W){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=W}var G=U.prototype;return G.append=function(i,D){var g=this.queues[D];g.push(i),g.length===1&&this.buffers[D]&&this.executeNext(D)},G.insertAbort=function(i,D){var g=this.queues[D];g.unshift(i),this.executeNext(D)},G.appendBlocker=function(i){var D,g=new Promise(function(m){D=m}),d={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(d,i),g},G.executeNext=function(i){var D=this.buffers,g=this.queues,d=D[i],m=g[i];if(m.length){var u=m[0];try{u.execute()}catch(a){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(a),(!d||!d.updating)&&(m.shift(),this.executeNext(i))}}},G.shiftAndExecuteNext=function(i){this.queues[i].shift(),this.executeNext(i)},G.current=function(i){return this.queues[i][0]},U}()},"./src/controller/cap-level-controller.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/events.ts");function N(W,i){for(var D=0;D<i.length;D++){var g=i[D];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(W,g.key,g)}}function U(W,i,D){return i&&N(W.prototype,i),D&&N(W,D),W}var G=function(){function W(D){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=D,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var i=W.prototype;return i.setStreamController=function(g){this.streamController=g},i.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},i.registerListeners=function(){var g=this.hls;g.on(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},i.unregisterListener=function(){var g=this.hls;g.off(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},i.onFpsDropLevelCapping=function(g,d){W.isLevelAllowed(d.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(d.droppedLevel)},i.onMediaAttaching=function(g,d){this.media=d.media instanceof HTMLVideoElement?d.media:null},i.onManifestParsed=function(g,d){var m=this.hls;this.restrictedLevels=[],this.firstLevel=d.firstLevel,m.config.capLevelToPlayerSize&&d.video&&this.startCapping()},i.onBufferCodecs=function(g,d){var m=this.hls;m.config.capLevelToPlayerSize&&d.video&&this.startCapping()},i.onMediaDetaching=function(){this.stopCapping()},i.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var d=this.hls;d.autoLevelCapping=this.getMaxLevel(g.length-1),d.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=d.autoLevelCapping}}},i.getMaxLevel=function(g){var d=this,m=this.hls.levels;if(!m.length)return-1;var u=m.filter(function(a,f){return W.isLevelAllowed(f,d.restrictedLevels)&&f<=g});return this.clientRect=null,W.getMaxLevelByMediaSize(u,this.mediaWidth,this.mediaHeight)},i.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},i.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},i.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,d={width:0,height:0};if(g){var m=g.getBoundingClientRect();d.width=m.width,d.height=m.height,!d.width&&!d.height&&(d.width=m.right-m.left||g.width||0,d.height=m.bottom-m.top||g.height||0)}return this.clientRect=d,d},W.isLevelAllowed=function(g,d){return d===void 0&&(d=[]),d.indexOf(g)===-1},W.getMaxLevelByMediaSize=function(g,d,m){if(!g||!g.length)return-1;for(var u=function(o,s){return s?o.width!==s.width||o.height!==s.height:!0},a=g.length-1,f=0;f<g.length;f+=1){var l=g[f];if((l.width>=d||l.height>=m)&&u(l,g[f+1])){a=f;break}}return a},U(W,[{key:"mediaWidth",get:function(){return this.getDimensions().width*W.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*W.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(d){}return g}}]),W}();$.default=G},"./src/controller/cmcd-controller.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return u});var X=k("./src/events.ts"),N=k("./src/types/cmcd.ts"),U=k("./src/utils/buffer-helper.ts"),G=k("./src/utils/logger.ts");function W(a,f){for(var l=0;l<f.length;l++){var h=f[l];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(a,h.key,h)}}function i(a,f,l){return f&&W(a.prototype,f),l&&W(a,l),a}function D(a,f){var l=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(l)return(l=l.call(a)).next.bind(l);if(Array.isArray(a)||(l=g(a))||f&&a&&typeof a.length=="number"){l&&(a=l);var h=0;return function(){return h>=a.length?{done:!0}:{done:!1,value:a[h++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g(a,f){if(!a)return;if(typeof a=="string")return d(a,f);var l=Object.prototype.toString.call(a).slice(8,-1);if(l==="Object"&&a.constructor&&(l=a.constructor.name),l==="Map"||l==="Set")return Array.from(a);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return d(a,f)}function d(a,f){(f==null||f>a.length)&&(f=a.length);for(var l=0,h=new Array(f);l<f;l++)h[l]=a[l];return h}function m(){return m=Object.assign||function(a){for(var f=1;f<arguments.length;f++){var l=arguments[f];for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(a[h]=l[h])}return a},m.apply(this,arguments)}var u=function(){function a(l){var h=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(){h.initialized&&(h.starved=!0),h.buffering=!0},this.onPlaying=function(){h.initialized||(h.initialized=!0),h.buffering=!1},this.applyPlaylistData=function(A){try{h.apply(A,{ot:N.CMCDObjectType.MANIFEST,su:!h.initialized})}catch(_){G.logger.warn("Could not generate manifest CMCD data.",_)}},this.applyFragmentData=function(A){try{var _=A.frag,w=h.hls.levels[_.level],L=h.getObjectType(_),R={d:_.duration*1e3,ot:L};(L===N.CMCDObjectType.VIDEO||L===N.CMCDObjectType.AUDIO||L==N.CMCDObjectType.MUXED)&&(R.br=w.bitrate/1e3,R.tb=h.getTopBandwidth(L),R.bl=h.getBufferLength(L)),h.apply(A,R)}catch(C){G.logger.warn("Could not generate segment CMCD data.",C)}},this.hls=l;var o=this.config=l.config,s=o.cmcd;s!=null&&(o.pLoader=this.createPlaylistLoader(),o.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||a.uuid(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.registerListeners())}var f=a.prototype;return f.registerListeners=function(){var h=this.hls;h.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),h.on(X.Events.BUFFER_CREATED,this.onBufferCreated,this)},f.unregisterListeners=function(){var h=this.hls;h.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),h.off(X.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},f.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},f.onMediaAttached=function(h,o){this.media=o.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},f.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},f.onBufferCreated=function(h,o){var s,A;this.audioBuffer=(s=o.tracks.audio)===null||s===void 0?void 0:s.buffer,this.videoBuffer=(A=o.tracks.video)===null||A===void 0?void 0:A.buffer},f.createData=function(){var h;return{v:N.CMCDVersion,sf:N.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(h=this.media)===null||h===void 0?void 0:h.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},f.apply=function(h,o){o===void 0&&(o={}),m(o,this.createData());var s=o.ot===N.CMCDObjectType.INIT||o.ot===N.CMCDObjectType.VIDEO||o.ot===N.CMCDObjectType.MUXED;if(this.starved&&s&&(o.bs=!0,o.su=!0,this.starved=!1),o.su==null&&(o.su=this.buffering),this.useHeaders){var A=a.toHeaders(o);if(!Object.keys(A).length)return;h.headers||(h.headers={}),m(h.headers,A)}else{var _=a.toQuery(o);if(!_)return;h.url=a.appendQueryToUri(h.url,_)}},f.getObjectType=function(h){var o=h.type;return o==="subtitle"?N.CMCDObjectType.TIMED_TEXT:h.sn==="initSegment"?N.CMCDObjectType.INIT:o==="audio"?N.CMCDObjectType.AUDIO:o==="main"?this.hls.audioTracks.length?N.CMCDObjectType.VIDEO:N.CMCDObjectType.MUXED:void 0},f.getTopBandwidth=function(h){for(var o=0,s=h===N.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,A=D(s),_;!(_=A()).done;){var w=_.value;w.bitrate>o&&(o=w.bitrate)}return o>0?o:NaN},f.getBufferLength=function(h){var o=this.hls.media,s=h===N.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!o)return NaN;var A=U.BufferHelper.bufferInfo(s,o.currentTime,this.config.maxBufferHole);return A.len*1e3},f.createPlaylistLoader=function(){var h=this.config.pLoader,o=this.applyPlaylistData,s=h||this.config.loader;return function(){function A(w){this.loader=void 0,this.loader=new s(w)}var _=A.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(L,R,C){o(L),this.loader.load(L,R,C)},i(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},f.createFragmentLoader=function(){var h=this.config.fLoader,o=this.applyFragmentData,s=h||this.config.loader;return function(){function A(w){this.loader=void 0,this.loader=new s(w)}var _=A.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(L,R,C){o(L),this.loader.load(L,R,C)},i(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},a.uuid=function(){var h=URL.createObjectURL(new Blob),o=h.toString();return URL.revokeObjectURL(h),o.substr(o.lastIndexOf("/")+1)},a.serialize=function(h){for(var o=[],s=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},A=function(B){return Math.round(B)},_=function(B){return A(B/100)*100},w=function(B){return encodeURIComponent(B)},L={br:A,d:A,bl:_,dl:_,mtp:_,nor:w,rtp:_,tb:A},R=Object.keys(h||{}).sort(),C=D(R),S;!(S=C()).done;){var x=S.value,p=h[x];if(!s(p))continue;if(x==="v"&&p===1)continue;if(x=="pr"&&p===1)continue;var T=L[x];T&&(p=T(p));var v=typeof p,y=void 0;x==="ot"||x==="sf"||x==="st"?y=x+"="+p:v==="boolean"?y=x:v==="number"?y=x+"="+p:y=x+"="+JSON.stringify(p),o.push(y)}return o.join(",")},a.toHeaders=function(h){for(var o=Object.keys(h),s={},A=["Object","Request","Session","Status"],_=[{},{},{},{}],w={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},L=0,R=o;L<R.length;L++){var C=R[L],S=w[C]!=null?w[C]:1;_[S][C]=h[C]}for(var x=0;x<_.length;x++){var p=a.serialize(_[x]);p&&(s["CMCD-"+A[x]]=p)}return s},a.toQuery=function(h){return"CMCD="+encodeURIComponent(a.serialize(h))},a.appendQueryToUri=function(h,o){if(!o)return h;var s=h.includes("?")?"&":"?";return""+h+s+o},a}()},"./src/controller/eme-controller.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/events.ts"),N=k("./src/errors.ts"),U=k("./src/utils/logger.ts"),G=k("./src/utils/mediakeys-helper.ts");function W(u,a){for(var f=0;f<a.length;f++){var l=a[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(u,l.key,l)}}function i(u,a,f){return a&&W(u.prototype,a),f&&W(u,f),u}var D=3,g=function(a,f,l){var h={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(o){h.audioCapabilities.push({contentType:'audio/mp4; codecs="'+o+'"',robustness:l.audioRobustness||""})}),f.forEach(function(o){h.videoCapabilities.push({contentType:'video/mp4; codecs="'+o+'"',robustness:l.videoRobustness||""})}),[h]},d=function(a,f,l,h){switch(a){case G.KeySystems.WIDEVINE:return g(f,l,h);default:throw new Error("Unknown key-system: "+a)}},m=function(){function u(f){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=f,this._config=f.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=u.prototype;return a.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},a._registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a._unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a.getLicenseServerUrl=function(l){switch(l){case G.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},a._attemptKeySystemAccess=function(l,h,o){var s=this,A=d(l,h,o,this._drmSystemOptions);U.logger.log("Requesting encrypted media key-system access");var _=this.requestMediaKeySystemAccess(l,A);this.mediaKeysPromise=_.then(function(w){return s._onMediaKeySystemAccessObtained(l,w)}),_.catch(function(w){U.logger.error('Failed to obtain key-system "'+l+'" access:',w)})},a._onMediaKeySystemAccessObtained=function(l,h){var o=this;U.logger.log('Access for key-system "'+l+'" obtained');var s={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:h,mediaKeySystemDomain:l};this._mediaKeysList.push(s);var A=Promise.resolve().then(function(){return h.createMediaKeys()}).then(function(_){return s.mediaKeys=_,U.logger.log('Media-keys created for key-system "'+l+'"'),o._onMediaKeysCreated(),_});return A.catch(function(_){U.logger.error("Failed to create media-keys:",_)}),A},a._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(h){h.mediaKeysSession||(h.mediaKeysSession=h.mediaKeys.createSession(),l._onNewMediaKeySession(h.mediaKeysSession))})},a._onNewMediaKeySession=function(l){var h=this;U.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(o){h._onKeySessionMessage(l,o.message)},!1)},a._onKeySessionMessage=function(l,h){U.logger.log("Got EME message event, creating license request"),this._requestLicense(h,function(o){U.logger.log("Received license data (length: "+(o&&o.byteLength)+"), updating key-session"),l.update(o)})},a.onMediaEncrypted=function(l){var h=this;if(U.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){U.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var o=function(A){if(!h._media)return;h._attemptSetMediaKeys(A),h._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(o).catch(o)},a._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var h=this._mediaKeysList[0];if(!h||!h.mediaKeys){U.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}U.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(h.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(l,h){var o=this,s=this._mediaKeysList[0];if(!s){U.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(s.mediaKeysSessionInitialized){U.logger.warn("Key-Session already initialized but requested again");return}var A=s.mediaKeysSession;if(!A){U.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!h){U.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}U.logger.log('Generating key-session request for "'+l+'" init data type'),s.mediaKeysSessionInitialized=!0,A.generateRequest(l,h).then(function(){U.logger.debug("Key-session generation succeeded")}).catch(function(_){U.logger.error("Error generating key-session request:",_),o.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._createLicenseXhr=function(l,h,o){var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,s,l,h,o);var A=this._licenseXhrSetup;if(A)try{A.call(this.hls,s,l),A=void 0}catch(_){U.logger.error(_)}try{s.readyState||s.open("POST",l,!0),A&&A.call(this.hls,s,l)}catch(_){throw new Error("issue setting up KeySystem license XHR "+_)}return s},a._onLicenseRequestReadyStageChange=function(l,h,o,s){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,U.logger.log("License request succeeded");var A=l.response,_=this._licenseResponseCallback;if(_)try{A=_.call(this.hls,l,h)}catch(L){U.logger.error(L)}s(A)}else{if(U.logger.error("License Request XHR failed ("+h+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var w=D-this._requestLicenseFailureCount+1;U.logger.warn("Retrying license request, "+w+" attempts left"),this._requestLicense(o,s)}break}},a._generateLicenseRequestChallenge=function(l,h){switch(l.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return h}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},a._requestLicense=function(l,h){U.logger.log("Requesting content license for key-system");var o=this._mediaKeysList[0];if(!o){U.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(o.mediaKeySystemDomain),A=this._createLicenseXhr(s,l,h);U.logger.log("Sending license request to URL: "+s);var _=this._generateLicenseRequestChallenge(o,l);A.send(_)}catch(w){U.logger.error("Failure requesting DRM license: "+w),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(l,h){if(!this._emeEnabled)return;var o=h.media;this._media=o,o.addEventListener("encrypted",this._onMediaEncrypted)},a.onMediaDetached=function(){var l=this._media,h=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(h.map(function(o){if(o.mediaKeysSession)return o.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},a.onManifestParsed=function(l,h){if(!this._emeEnabled)return;var o=h.levels.map(function(A){return A.audioCodec}).filter(function(A){return!!A}),s=h.levels.map(function(A){return A.videoCodec}).filter(function(A){return!!A});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,o,s)},i(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();$.default=m},"./src/controller/fps-controller.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/events.ts"),N=k("./src/utils/logger.ts"),U=function(){function G(i){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=i,this.registerListeners()}var W=G.prototype;return W.setStreamController=function(D){this.streamController=D},W.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},W.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},W.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},W.onMediaAttaching=function(D,g){var d=this.hls.config;if(d.capLevelOnFPSDrop){var m=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=m,m&&typeof m.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),d.fpsDroppedMonitoringPeriod)}},W.checkFPS=function(D,g,d){var m=performance.now();if(g){if(this.lastTime){var u=m-this.lastTime,a=d-this.lastDroppedFrames,f=g-this.lastDecodedFrames,l=1e3*a/u,h=this.hls;if(h.trigger(X.Events.FPS_DROP,{currentDropped:a,currentDecoded:f,totalDroppedFrames:d}),l>0&&a>h.config.fpsDroppedMonitoringThreshold*f){var o=h.currentLevel;N.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+o),o>0&&(h.autoLevelCapping===-1||h.autoLevelCapping>=o)&&(o=o-1,h.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:o,droppedLevel:h.currentLevel}),h.autoLevelCapping=o,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=d,this.lastDecodedFrames=g}},W.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var g=D.getVideoPlaybackQuality();this.checkFPS(D,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},G}();$.default=U},"./src/controller/fragment-finders.ts":function(ne,$,k){"use strict";k.r($),k.d($,"findFragmentByPDT",function(){return U}),k.d($,"findFragmentByPTS",function(){return G}),k.d($,"fragmentWithinToleranceTest",function(){return W}),k.d($,"pdtWithinToleranceTest",function(){return i}),k.d($,"findFragWithCC",function(){return D});var X=k("./src/polyfills/number.ts"),N=k("./src/utils/binary-search.ts");function U(g,d,m){if(d===null||!Array.isArray(g)||!g.length||!Object(X.isFiniteNumber)(d))return null;var u=g[0].programDateTime;if(d<(u||0))return null;var a=g[g.length-1].endProgramDateTime;if(d>=(a||0))return null;m=m||0;for(var f=0;f<g.length;++f){var l=g[f];if(i(d,m,l))return l}return null}function G(g,d,m,u){m===void 0&&(m=0),u===void 0&&(u=0);var a=null;if(g?a=d[g.sn-d[0].sn+1]||null:m===0&&d[0].start===0&&(a=d[0]),a&&W(m,u,a)===0)return a;var f=N.default.search(d,W.bind(null,m,u));return f||a}function W(g,d,m){g===void 0&&(g=0),d===void 0&&(d=0);var u=Math.min(d,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-u<=g?1:m.start-u>g&&m.start?-1:0}function i(g,d,m){var u=Math.min(d,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,a=m.endProgramDateTime||0;return a-u>g}function D(g,d){return N.default.search(g,function(m){return m.cc<d?1:m.cc>d?-1:0})}},"./src/controller/fragment-tracker.ts":function(ne,$,k){"use strict";k.r($),k.d($,"FragmentState",function(){return U}),k.d($,"FragmentTracker",function(){return G});var X=k("./src/events.ts"),N=k("./src/types/loader.ts"),U;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(U||(U={}));var G=function(){function D(d){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=d,this._registerListeners()}var g=D.prototype;return g._registerListeners=function(){var m=this.hls;m.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var m=this.hls;m.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(m,u){if(u===N.PlaylistLevelType.MAIN){var a=this.activeFragment,f=this.activeParts;if(!a)return null;if(f)for(var l=f.length;l--;){var h=f[l],o=h?h.end:a.appendedPTS;if(h.start<=m&&o!==void 0&&m<=o)return l>9&&(this.activeParts=f.slice(l-9)),h}else if(a.start<=m&&a.appendedPTS!==void 0&&m<=a.appendedPTS)return a}return this.getBufferedFrag(m,u)},g.getBufferedFrag=function(m,u){for(var a=this.fragments,f=Object.keys(a),l=f.length;l--;){var h=a[f[l]];if((h==null?void 0:h.body.type)===u&&h.buffered){var o=h.body;if(o.start<=m&&m<=o.end)return o}}return null},g.detectEvictedFragments=function(m,u,a){var f=this;Object.keys(this.fragments).forEach(function(l){var h=f.fragments[l];if(!h)return;if(!h.buffered){h.body.type===a&&f.removeFragment(h.body);return}var o=h.range[m];if(!o)return;o.time.some(function(s){var A=!f.isTimeBuffered(s.startPTS,s.endPTS,u);return A&&f.removeFragment(h.body),A})})},g.detectPartialFragments=function(m){var u=this,a=this.timeRanges,f=m.frag,l=m.part;if(!a||f.sn==="initSegment")return;var h=i(f),o=this.fragments[h];if(!o)return;Object.keys(a).forEach(function(s){var A=f.elementaryStreams[s];if(!A)return;var _=a[s],w=l!==null||A.partial===!0;o.range[s]=u.getBufferedTimes(f,l,w,_)}),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body)},g.fragBuffered=function(m){var u=i(m),a=this.fragments[u];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},g.getBufferedTimes=function(m,u,a,f){for(var l={time:[],partial:a},h=u?u.start:m.start,o=u?u.end:m.end,s=m.minEndPTS||o,A=m.maxStartPTS||h,_=0;_<f.length;_++){var w=f.start(_)-this.bufferPadding,L=f.end(_)+this.bufferPadding;if(A>=w&&s<=L){l.time.push({startPTS:Math.max(h,f.start(_)),endPTS:Math.min(o,f.end(_))});break}else if(h<L&&o>w)l.partial=!0,l.time.push({startPTS:Math.max(h,f.start(_)),endPTS:Math.min(o,f.end(_))});else if(o<=w)break}return l},g.getPartialFragment=function(m){var u=null,a,f,l,h=0,o=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(A){var _=s[A];if(!_)return;W(_)&&(f=_.body.start-o,l=_.body.end+o,m>=f&&m<=l&&(a=Math.min(m-f,l-m),h<=a&&(u=_.body,h=a)))}),u},g.getState=function(m){var u=i(m),a=this.fragments[u];return a?a.buffered?W(a)?U.PARTIAL:U.OK:a.backtrack?U.BACKTRACKED:U.APPENDING:U.NOT_LOADED},g.backtrack=function(m,u){var a=i(m),f=this.fragments[a];if(!f||f.backtrack)return null;var l=f.backtrack=u||f.loaded;return f.loaded=null,l},g.getBacktrackData=function(m){var u=i(m),a=this.fragments[u];if(a){var f,l=a.backtrack;if(l!=null&&(f=l.payload)!==null&&f!==void 0&&f.byteLength)return l;this.removeFragment(m)}return null},g.isTimeBuffered=function(m,u,a){for(var f,l,h=0;h<a.length;h++){if(f=a.start(h)-this.bufferPadding,l=a.end(h)+this.bufferPadding,m>=f&&u<=l)return!0;if(u<=f)return!1}return!1},g.onFragLoaded=function(m,u){var a=u.frag,f=u.part;if(a.sn==="initSegment"||a.bitrateTest||f)return;var l=i(a);this.fragments[l]={body:a,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(m,u){var a=this,f=u.frag,l=u.part,h=u.timeRanges;if(f.type===N.PlaylistLevelType.MAIN)if(this.activeFragment=f,l){var o=this.activeParts;o||(this.activeParts=o=[]),o.push(l)}else this.activeParts=null;this.timeRanges=h,Object.keys(h).forEach(function(s){var A=h[s];if(a.detectEvictedFragments(s,A),!l)for(var _=0;_<A.length;_++)f.appendedPTS=Math.max(A.end(_),f.appendedPTS||0)})},g.onFragBuffered=function(m,u){this.detectPartialFragments(u)},g.hasFragment=function(m){var u=i(m);return!!this.fragments[u]},g.removeFragmentsInRange=function(m,u,a){var f=this;Object.keys(this.fragments).forEach(function(l){var h=f.fragments[l];if(!h)return;if(h.buffered){var o=h.body;o.type===a&&o.start<u&&o.end>m&&f.removeFragment(o)}})},g.removeFragment=function(m){var u=i(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[u]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function W(D){var g,d;return D.buffered&&(((g=D.range.video)===null||g===void 0?void 0:g.partial)||((d=D.range.audio)===null||d===void 0?void 0:d.partial))}function i(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(ne,$,k){"use strict";k.r($),k.d($,"STALL_MINIMUM_DURATION_MS",function(){return W}),k.d($,"MAX_START_GAP_JUMP",function(){return i}),k.d($,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),k.d($,"SKIP_BUFFER_RANGE_START",function(){return g}),k.d($,"default",function(){return d});var X=k("./src/utils/buffer-helper.ts"),N=k("./src/errors.ts"),U=k("./src/events.ts"),G=k("./src/utils/logger.ts"),W=250,i=2,D=.1,g=.05,d=function(){function m(a,f,l,h){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=f,this.fragmentTracker=l,this.hls=h}var u=m.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(f){var l=this.config,h=this.media,o=this.stalled,s=h.currentTime,A=h.seeking,_=this.seeking&&!A,w=!this.seeking&&A;if(this.seeking=A,s!==f){if(this.moved=!0,o!==null){if(this.stallReported){var L=self.performance.now()-o;G.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((w||_)&&(this.stalled=null),h.paused||h.ended||h.playbackRate===0||!X.BufferHelper.getBuffered(h).length)return;var R=X.BufferHelper.bufferInfo(h,s,0),C=R.len>0,S=R.nextStart||0;if(!C&&!S)return;if(A){var x=R.len>i,p=!S||S-s>i&&!this.fragmentTracker.getPartialFragment(s);if(x||p)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var T,v=Math.max(S,R.start||0)-s,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,F=y==null||((T=y.details)===null||T===void 0)?void 0:T.live,B=F?y.details.targetduration*2:i;if(v>0&&v<=B){this._trySkipBufferHole(null);return}}var O=self.performance.now();if(o===null){this.stalled=O;return}var j=O-o;!A&&j>=W&&this._reportStall(R.len);var P=X.BufferHelper.bufferInfo(h,s,l.maxBufferHole);this._tryFixBufferStall(P,j)},u._tryFixBufferStall=function(f,l){var h=this.config,o=this.fragmentTracker,s=this.media,A=s.currentTime,_=o.getPartialFragment(A);if(_){var w=this._trySkipBufferHole(_);if(w)return}f.len>h.maxBufferHole&&l>h.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(f){var l=this.hls,h=this.media,o=this.stallReported;o||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+h.currentTime+" due to low buffer (buffer="+f+")"),l.trigger(U.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},u._trySkipBufferHole=function(f){for(var l=this.config,h=this.hls,o=this.media,s=o.currentTime,A=0,_=X.BufferHelper.getBuffered(o),w=0;w<_.length;w++){var L=_.start(w);if(s+l.maxBufferHole>=A&&s<L){var R=Math.max(L+g,o.currentTime+D);return G.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+R),this.moved=!0,this.stalled=null,o.currentTime=R,f&&h.trigger(U.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+s+" to "+R,frag:f}),R}A=_.end(w)}return 0},u._tryNudgeBuffer=function(){var f=this.config,l=this.hls,h=this.media,o=h.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<f.nudgeMaxRetry){var A=o+s*f.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+o+" to "+A),h.currentTime=A,l.trigger(U.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else G.logger.error("Playhead still not moving while enough data buffered @"+o+" after "+f.nudgeMaxRetry+" nudges"),l.trigger(U.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},m}()},"./src/controller/id3-track-controller.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/events.ts"),N=k("./src/utils/texttrack-utils.ts"),U=k("./src/demux/id3.ts"),G=.25,W=function(){function i(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var D=i.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var d=this.hls;d.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),d.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var d=this.hls;d.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),d.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(d,m){this.media=m.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(N.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(d){if(!this.media)return;for(var m=0;m<d.length;m++){var u=d[m];if(u.kind==="metadata"&&u.label==="id3")return Object(N.sendAddTrackEvent)(u,this.media),u}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(d,m){if(!this.media)return;var u=m.frag,a=m.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var f=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<a.length;l++){var h=U.getID3Frames(a[l].data);if(h){var o=a[l].pts,s=l<a.length-1?a[l+1].pts:u.end,A=s-o;A<=0&&(s=o+G);for(var _=0;_<h.length;_++){var w=h[_];if(!U.isTimeStampFrame(w)){var L=new f(o,s,"");L.value=w,this.id3Track.addCue(L)}}}}},D.onBufferFlushing=function(d,m){var u=m.startOffset,a=m.endOffset,f=m.type;if(!f||f==="audio"){var l=this.id3Track;l&&Object(N.removeCuesInRange)(l,u,a)}},i}();$.default=W},"./src/controller/latency-controller.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return i});var X=k("./src/errors.ts"),N=k("./src/events.ts"),U=k("./src/utils/logger.ts");function G(D,g){for(var d=0;d<g.length;d++){var m=g[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(D,m.key,m)}}function W(D,g,d){return g&&G(D.prototype,g),d&&G(D,d),D}var i=function(){function D(d){var m=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return m.timeupdate()},this.hls=d,this.config=d.config,this.registerListeners()}var g=D.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(N.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(N.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(N.Events.ERROR,this.onError)},g.onMediaAttached=function(m,u){this.media=u.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(m,u){var a=u.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(m,u){if(u.details!==X.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,U.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var m=this.media,u=this.levelDetails;if(!m||!u)return;this.currentTime=m.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var f=this.config,l=f.lowLatencyMode,h=f.maxLiveSyncPlaybackRate;if(!l||h===1)return;var o=this.targetLatency;if(o===null)return;var s=a-o,A=Math.min(this.maxLatency,o+u.targetduration),_=s<A;if(u.live&&_&&s>.05&&this.forwardBufferLength>1){var w=Math.min(2,Math.max(1,h)),L=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;m.playbackRate=Math.min(w,Math.max(1,L))}else m.playbackRate!==1&&m.playbackRate!==0&&(m.playbackRate=1)},g.estimateLiveEdge=function(){var m=this.levelDetails;return m===null?null:m.edge+m.age},g.computeLatency=function(){var m=this.estimateLiveEdge();return m===null?null:m-this.currentTime},W(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var m=this.config,u=this.levelDetails;return m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:u?m.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var m=this.levelDetails;if(m===null)return null;var u=m.holdBack,a=m.partHoldBack,f=m.targetduration,l=this.config,h=l.liveSyncDuration,o=l.liveSyncDurationCount,s=l.lowLatencyMode,A=this.hls.userConfig,_=s&&a||u;(A.liveSyncDuration||A.liveSyncDurationCount||_===0)&&(_=h!==void 0?h:o*f);var w=f,L=1;return _+Math.min(this.stallCount*L,w)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),u=this.targetLatency,a=this.levelDetails;if(m===null||u===null||a===null)return null;var f=a.edge,l=m-u-this.edgeStalled,h=f-a.totalduration,o=f-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(h,l),o)}},{key:"drift",get:function(){var m=this.levelDetails;return m===null?1:m.drift}},{key:"edgeStalled",get:function(){var m=this.levelDetails;if(m===null)return 0;var u=(this.config.lowLatencyMode&&m.partTarget||m.targetduration)*3;return Math.max(m.age-u,0)}},{key:"forwardBufferLength",get:function(){var m=this.media,u=this.levelDetails;if(!m||!u)return 0;var a=m.buffered.length;return a?m.buffered.end(a-1):u.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return l});var X=k("./src/types/level.ts"),N=k("./src/events.ts"),U=k("./src/errors.ts"),G=k("./src/utils/codecs.ts"),W=k("./src/controller/level-helper.ts"),i=k("./src/controller/base-playlist-controller.ts"),D=k("./src/types/loader.ts");function g(){return g=Object.assign||function(h){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var A in s)Object.prototype.hasOwnProperty.call(s,A)&&(h[A]=s[A])}return h},g.apply(this,arguments)}function d(h,o){for(var s=0;s<o.length;s++){var A=o[s];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}function m(h,o,s){return o&&d(h.prototype,o),s&&d(h,s),h}function u(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,a(h,o)}function a(h,o){return a=Object.setPrototypeOf||function(A,_){return A.__proto__=_,A},a(h,o)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(h){u(o,h);function o(A){var _;return _=h.call(this,A,"[level-controller]")||this,_._levels=[],_._firstLevel=-1,_._startLevel=void 0,_.currentLevelIndex=-1,_.manualLevelIndex=-1,_.onParsedComplete=void 0,_._registerListeners(),_}var s=o.prototype;return s._registerListeners=function(){var _=this.hls;_.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),_.on(N.Events.ERROR,this.onError,this)},s._unregisterListeners=function(){var _=this.hls;_.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),_.off(N.Events.ERROR,this.onError,this)},s.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,h.prototype.destroy.call(this)},s.startLoad=function(){var _=this._levels;_.forEach(function(w){w.loadError=0}),h.prototype.startLoad.call(this)},s.onManifestLoaded=function(_,w){var L=[],R=[],C=[],S,x={},p,T=!1,v=!1,y=!1;if(w.levels.forEach(function(j){var P=j.attrs;T=T||!!(j.width&&j.height),v=v||!!j.videoCodec,y=y||!!j.audioCodec,f&&j.audioCodec&&j.audioCodec.indexOf("mp4a.40.34")!==-1&&(j.audioCodec=void 0);var b=j.bitrate+"-"+j.attrs.RESOLUTION+"-"+j.attrs.CODECS;p=x[b],p?p.url.push(j.url):(p=new X.Level(j),x[b]=p,L.push(p)),P&&(P.AUDIO&&Object(W.addGroupId)(p,"audio",P.AUDIO),P.SUBTITLES&&Object(W.addGroupId)(p,"text",P.SUBTITLES))}),(T||v)&&y&&(L=L.filter(function(j){var P=j.videoCodec,b=j.width,Y=j.height;return!!P||!!(b&&Y)})),L=L.filter(function(j){var P=j.audioCodec,b=j.videoCodec;return(!P||Object(G.isCodecSupportedInMp4)(P,"audio"))&&(!b||Object(G.isCodecSupportedInMp4)(b,"video"))}),w.audioTracks&&(R=w.audioTracks.filter(function(j){return!j.audioCodec||Object(G.isCodecSupportedInMp4)(j.audioCodec,"audio")}),Object(W.assignTrackIdsByGroup)(R)),w.subtitles&&(C=w.subtitles,Object(W.assignTrackIdsByGroup)(C)),L.length>0){S=L[0].bitrate,L.sort(function(j,P){return j.bitrate-P.bitrate}),this._levels=L;for(var F=0;F<L.length;F++)if(L[F].bitrate===S){this._firstLevel=F,this.log("manifest loaded, "+L.length+" level(s) found, first bitrate: "+S);break}var B=y&&!v,O={levels:L,audioTracks:R,subtitleTracks:C,firstLevel:this._firstLevel,stats:w.stats,audio:y,video:v,altAudio:!B&&R.some(function(j){return!!j.url})};this.hls.trigger(N.Events.MANIFEST_PARSED,O),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(N.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:w.url,reason:"no level with compatible codecs found in manifest"})},s.onError=function(_,w){if(h.prototype.onError.call(this,_,w),w.fatal)return;var L=w.context,R=this._levels[this.currentLevelIndex];if(L&&(L.type===D.PlaylistContextType.AUDIO_TRACK&&R.audioGroupIds&&L.groupId===R.audioGroupIds[R.urlId]||L.type===D.PlaylistContextType.SUBTITLE_TRACK&&R.textGroupIds&&L.groupId===R.textGroupIds[R.urlId])){this.redundantFailover(this.currentLevelIndex);return}var C=!1,S=!0,x;switch(w.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:case U.ErrorDetails.KEY_LOAD_ERROR:case U.ErrorDetails.KEY_LOAD_TIMEOUT:if(w.frag){var p=this._levels[w.frag.level];p?(p.fragmentError++,p.fragmentError>this.hls.config.fragLoadingMaxRetry&&(x=w.frag.level)):x=w.frag.level}break;case U.ErrorDetails.LEVEL_LOAD_ERROR:case U.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(S=!1),x=L.level),C=!0;break;case U.ErrorDetails.REMUX_ALLOC_ERROR:x=w.level,C=!0;break}x!==void 0&&this.recoverLevel(w,x,C,S)},s.recoverLevel=function(_,w,L,R){var C=_.details,S=this._levels[w];if(S.loadError++,L){var x=this.retryLoadingOrFail(_);if(x)_.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(R){var p=S.url.length;if(p>1&&S.loadError<p)_.levelRetry=!0,this.redundantFailover(w);else if(this.manualLevelIndex===-1){var T=w===0?this._levels.length-1:w-1;this.currentLevelIndex!==T&&this._levels[T].loadError===0&&(this.warn(C+": switch to "+T),_.levelRetry=!0,this.hls.nextAutoLevel=T)}}},s.redundantFailover=function(_){var w=this._levels[_],L=w.url.length;if(L>1){var R=(w.urlId+1)%L;this.warn("Switching to redundant URL-id "+R),this._levels.forEach(function(C){C.urlId=R}),this.level=_}},s.onFragLoaded=function(_,w){var L=w.frag;if(L!==void 0&&L.type===D.PlaylistLevelType.MAIN){var R=this._levels[L.level];R!==void 0&&(R.fragmentError=0,R.loadError=0)}},s.onLevelLoaded=function(_,w){var L,R=w.level,C=w.details,S=this._levels[R];if(!S){var x;this.warn("Invalid level index "+R),(x=w.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(C.deltaUpdateFailed=!0);return}R===this.currentLevelIndex?(S.fragmentError===0&&(S.loadError=0,this.retryCount=0),this.playlistLoaded(R,w,S.details)):(L=w.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(C.deltaUpdateFailed=!0)},s.onAudioTrackSwitched=function(_,w){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var R=-1,C=this.hls.audioTracks[w.id].groupId,S=0;S<L.audioGroupIds.length;S++)if(L.audioGroupIds[S]===C){R=S;break}R!==L.urlId&&(L.urlId=R,this.startLoad())}},s.loadPlaylist=function(_){var w=this.currentLevelIndex,L=this._levels[w];if(this.canLoad&&L&&L.url.length>0){var R=L.urlId,C=L.url[R];if(_)try{C=_.addDirectives(C)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Attempt loading level index "+w+(_?" at sn "+_.msn+" part "+_.part:"")+" with URL-id "+R+" "+C),this.clearTimer(),this.hls.trigger(N.Events.LEVEL_LOADING,{url:C,level:w,id:R,deliveryDirectives:_||null})}},s.removeLevel=function(_,w){var L=function(S,x){return x!==w},R=this._levels.filter(function(C,S){return S!==_?!0:C.url.length>1&&w!==void 0?(C.url=C.url.filter(L),C.audioGroupIds&&(C.audioGroupIds=C.audioGroupIds.filter(L)),C.textGroupIds&&(C.textGroupIds=C.textGroupIds.filter(L)),C.urlId=0,!0):!1}).map(function(C,S){var x=C.details;return x!=null&&x.fragments&&x.fragments.forEach(function(p){p.level=S}),C});this._levels=R,this.hls.trigger(N.Events.LEVELS_UPDATED,{levels:R})},m(o,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(_){var w,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===_&&(w=L[_])!==null&&w!==void 0&&w.details)return;if(_<0||_>=L.length){var R=_<0;if(this.hls.trigger(N.Events.ERROR,{type:U.ErrorTypes.OTHER_ERROR,details:U.ErrorDetails.LEVEL_SWITCH_ERROR,level:_,fatal:R,reason:"invalid level idx"}),R)return;_=Math.min(_,L.length-1)}this.clearTimer();var C=this.currentLevelIndex,S=L[C],x=L[_];this.log("switching to level "+_+" from "+C),this.currentLevelIndex=_;var p=g({},x,{level:_,maxBitrate:x.maxBitrate,uri:x.uri,urlId:x.urlId});delete p._urlId,this.hls.trigger(N.Events.LEVEL_SWITCHING,p);var T=x.details;if(!T||T.live){var v=this.switchParams(x.uri,S==null?void 0:S.details);this.loadPlaylist(v)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(_){this.manualLevelIndex=_,this._startLevel===void 0&&(this._startLevel=_),_!==-1&&(this.level=_)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(_){this._firstLevel=_}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var _=this.hls.config.startLevel;return _!==void 0?_:this._firstLevel}else return this._startLevel},set:function(_){this._startLevel=_}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(_){this.level=_,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=_)}}]),o}(i.default)},"./src/controller/level-helper.ts":function(ne,$,k){"use strict";k.r($),k.d($,"addGroupId",function(){return U}),k.d($,"assignTrackIdsByGroup",function(){return G}),k.d($,"updatePTS",function(){return W}),k.d($,"updateFragPTSDTS",function(){return D}),k.d($,"mergeDetails",function(){return g}),k.d($,"mapPartIntersection",function(){return d}),k.d($,"mapFragmentIntersection",function(){return m}),k.d($,"adjustSliding",function(){return u}),k.d($,"addSliding",function(){return a}),k.d($,"computeReloadInterval",function(){return f}),k.d($,"getFragmentWithSN",function(){return l}),k.d($,"getPartWith",function(){return h});var X=k("./src/polyfills/number.ts"),N=k("./src/utils/logger.ts");function U(o,s,A){switch(s){case"audio":o.audioGroupIds||(o.audioGroupIds=[]),o.audioGroupIds.push(A);break;case"text":o.textGroupIds||(o.textGroupIds=[]),o.textGroupIds.push(A);break}}function G(o){var s={};o.forEach(function(A){var _=A.groupId||"";A.id=s[_]=s[_]||0,s[_]++})}function W(o,s,A){var _=o[s],w=o[A];i(_,w)}function i(o,s){var A=s.startPTS;if(Object(X.isFiniteNumber)(A)){var _=0,w;s.sn>o.sn?(_=A-o.start,w=o):(_=o.start-A,w=s),w.duration!==_&&(w.duration=_)}else if(s.sn>o.sn){var L=o.cc===s.cc;L&&o.minEndPTS?s.start=o.start+(o.minEndPTS-o.start):s.start=o.start+o.duration}else s.start=Math.max(o.start-s.duration,0)}function D(o,s,A,_,w,L){var R=_-A;R<=0&&(N.logger.warn("Fragment should have a positive duration",s),_=A+s.duration,L=w+s.duration);var C=A,S=_,x=s.startPTS,p=s.endPTS;if(Object(X.isFiniteNumber)(x)){var T=Math.abs(x-A);Object(X.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(T,s.deltaPTS):s.deltaPTS=T,C=Math.max(A,x),A=Math.min(A,x),w=Math.min(w,s.startDTS),S=Math.min(_,p),_=Math.max(_,p),L=Math.max(L,s.endDTS)}s.duration=_-A;var v=A-s.start;s.appendedPTS=_,s.start=s.startPTS=A,s.maxStartPTS=C,s.startDTS=w,s.endPTS=_,s.minEndPTS=S,s.endDTS=L;var y=s.sn;if(!o||y<o.startSN||y>o.endSN)return 0;var F,B=y-o.startSN,O=o.fragments;for(O[B]=s,F=B;F>0;F--)i(O[F],O[F-1]);for(F=B;F<O.length-1;F++)i(O[F],O[F+1]);return o.fragmentHint&&i(O[O.length-1],o.fragmentHint),o.PTSKnown=o.alignedSliding=!0,v}function g(o,s){for(var A=null,_=o.fragments,w=_.length-1;w>=0;w--){var L=_[w].initSegment;if(L){A=L;break}}o.fragmentHint&&delete o.fragmentHint.endPTS;var R=0,C;if(m(o,s,function(F,B){F.relurl&&(R=F.cc-B.cc),Object(X.isFiniteNumber)(F.startPTS)&&Object(X.isFiniteNumber)(F.endPTS)&&(B.start=B.startPTS=F.startPTS,B.startDTS=F.startDTS,B.appendedPTS=F.appendedPTS,B.maxStartPTS=F.maxStartPTS,B.endPTS=F.endPTS,B.endDTS=F.endDTS,B.minEndPTS=F.minEndPTS,B.duration=F.endPTS-F.startPTS,B.duration&&(C=B),s.PTSKnown=s.alignedSliding=!0),B.elementaryStreams=F.elementaryStreams,B.loader=F.loader,B.stats=F.stats,B.urlId=F.urlId,F.initSegment&&(B.initSegment=F.initSegment,A=F.initSegment)}),A){var S=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;S.forEach(function(F){var B;(!F.initSegment||F.initSegment.relurl===((B=A)===null||B===void 0?void 0:B.relurl))&&(F.initSegment=A)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(F){return!F}),s.deltaUpdateFailed)){N.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var x=s.skippedSegments;x--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var p=s.fragments;if(R){N.logger.warn("discontinuity sliding from playlist, take drift into account");for(var T=0;T<p.length;T++)p[T].cc+=R}s.skippedSegments&&(s.startCC=s.fragments[0].cc),d(o.partList,s.partList,function(F,B){B.elementaryStreams=F.elementaryStreams,B.stats=F.stats}),C?D(s,C,C.startPTS,C.endPTS,C.startDTS,C.endDTS):u(o,s),p.length&&(s.totalduration=s.edge-p[0].start),s.driftStartTime=o.driftStartTime,s.driftStart=o.driftStart;var v=s.advancedDateTime;if(s.advanced&&v){var y=s.edge;s.driftStart||(s.driftStartTime=v,s.driftStart=y),s.driftEndTime=v,s.driftEnd=y}else s.driftEndTime=o.driftEndTime,s.driftEnd=o.driftEnd,s.advancedDateTime=o.advancedDateTime}function d(o,s,A){if(o&&s)for(var _=0,w=0,L=o.length;w<=L;w++){var R=o[w],C=s[w+_];R&&C&&R.index===C.index&&R.fragment.sn===C.fragment.sn?A(R,C):_--}}function m(o,s,A){for(var _=s.skippedSegments,w=Math.max(o.startSN,s.startSN)-s.startSN,L=(o.fragmentHint?1:0)+(_?s.endSN:Math.min(o.endSN,s.endSN))-s.startSN,R=s.startSN-o.startSN,C=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,S=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,x=w;x<=L;x++){var p=S[R+x],T=C[x];_&&!T&&x<_&&(T=s.fragments[x]=p),p&&T&&A(p,T)}}function u(o,s){var A=s.startSN+s.skippedSegments-o.startSN,_=o.fragments;if(A<0||A>=_.length)return;a(s,_[A].start)}function a(o,s){if(s){for(var A=o.fragments,_=o.skippedSegments;_<A.length;_++)A[_].start+=s;o.fragmentHint&&(o.fragmentHint.start+=s)}}function f(o,s){var A=1e3*o.levelTargetDuration,_=A/2,w=o.age,L=w>0&&w<A*3,R=s.loading.end-s.loading.start,C,S=o.availabilityDelay;if(o.updated===!1)if(L){var x=333*o.misses;C=Math.max(Math.min(_,R*2),x),o.availabilityDelay=(o.availabilityDelay||0)+C}else C=_;else L?(S=Math.min(S||A/2,w),o.availabilityDelay=S,C=S+A-w):C=A-R;return Math.round(C)}function l(o,s,A){if(!o||!o.details)return null;var _=o.details,w=_.fragments[s-_.startSN];return w||(w=_.fragmentHint,w&&w.sn===s?w:s<_.startSN&&A&&A.sn===s?A:null)}function h(o,s,A){if(!o||!o.details)return null;var _=o.details.partList;if(_)for(var w=_.length;w--;){var L=_[w];if(L.index===A&&L.fragment.sn===s)return L}return null}},"./src/controller/stream-controller.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return _});var X=k("./src/polyfills/number.ts"),N=k("./src/controller/base-stream-controller.ts"),U=k("./src/is-supported.ts"),G=k("./src/events.ts"),W=k("./src/utils/buffer-helper.ts"),i=k("./src/controller/fragment-tracker.ts"),D=k("./src/types/loader.ts"),g=k("./src/loader/fragment.ts"),d=k("./src/demux/transmuxer-interface.ts"),m=k("./src/types/transmuxer.ts"),u=k("./src/controller/gap-controller.ts"),a=k("./src/errors.ts"),f=k("./src/utils/logger.ts");function l(w,L){for(var R=0;R<L.length;R++){var C=L[R];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(w,C.key,C)}}function h(w,L,R){return L&&l(w.prototype,L),R&&l(w,R),w}function o(w,L){w.prototype=Object.create(L.prototype),w.prototype.constructor=w,s(w,L)}function s(w,L){return s=Object.setPrototypeOf||function(C,S){return C.__proto__=S,C},s(w,L)}var A=100,_=function(w){o(L,w);function L(C,S){var x;return x=w.call(this,C,S,"[stream-controller]")||this,x.audioCodecSwap=!1,x.gapController=null,x.level=-1,x._forceStartLoad=!1,x.altAudio=!1,x.audioOnly=!1,x.fragPlaying=null,x.onvplaying=null,x.onvseeked=null,x.fragLastKbps=0,x.stalled=!1,x.couldBacktrack=!1,x.audioCodecSwitch=!1,x.videoBuffer=null,x._registerListeners(),x}var R=L.prototype;return R._registerListeners=function(){var S=this.hls;S.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),S.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),S.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),S.on(G.Events.ERROR,this.onError,this),S.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),S.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),S.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),S.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),S.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R._unregisterListeners=function(){var S=this.hls;S.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),S.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),S.off(G.Events.ERROR,this.onError,this),S.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),S.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),S.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),S.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),S.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},R.startLoad=function(S){if(this.levels){var x=this.lastCurrentTime,p=this.hls;if(this.stopLoad(),this.setInterval(A),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var T=p.startLevel;T===-1&&(p.config.testBandwidth?(T=0,this.bitrateTest=!0):T=p.nextAutoLevel),this.level=p.nextLoadLevel=T,this.loadedmetadata=!1}x>0&&S===-1&&(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),S=x),this.state=N.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=S,this.tick()}else this._forceStartLoad=!0,this.state=N.State.STOPPED},R.stopLoad=function(){this._forceStartLoad=!1,w.prototype.stopLoad.call(this)},R.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_LEVEL:{var S,x=this.levels,p=this.level,T=x==null||((S=x[p])===null||S===void 0)?void 0:S.details;if(T&&(!T.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(T))break;this.state=N.State.IDLE;break}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var v,y=self.performance.now(),F=this.retryDate;(!F||y>=F||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=N.State.IDLE)}break;default:break}this.onTickEnd()},R.onTickEnd=function(){w.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},R.doTickIdle=function(){var S,x,p=this.hls,T=this.levelLastLoaded,v=this.levels,y=this.media,F=p.config,B=p.nextLoadLevel;if(T===null||!y&&(this.startFragRequested||!F.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!v||!v[B])return;var O=v[B];this.level=p.nextLoadLevel=B;var j=O.details;if(!j||this.state===N.State.WAITING_LEVEL||j.live&&this.levelLastLoaded!==B){this.state=N.State.WAITING_LEVEL;return}var P=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:y,D.PlaylistLevelType.MAIN);if(P===null)return;var b=P.len,Y=this.getMaxBufferLength(O.maxBitrate);if(b>=Y)return;if(this._streamEnded(P,j)){var ee={};this.altAudio&&(ee.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,ee),this.state=N.State.ENDED;return}var ae=P.end,le=this.getNextFragment(ae,j);if(this.couldBacktrack&&!this.fragPrevious&&le&&le.sn!=="initSegment"){var Re=le.sn-j.startSN;Re>1&&(le=j.fragments[Re-1],this.fragmentTracker.removeFragment(le))}if(le&&this.fragmentTracker.getState(le)===i.FragmentState.OK&&this.nextLoadPosition>ae){var Ee=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(y,Ee,D.PlaylistLevelType.MAIN),le=this.getNextFragment(this.nextLoadPosition,j)}if(!le)return;le.initSegment&&!le.initSegment.data&&!this.bitrateTest&&(le=le.initSegment),((S=le.decryptdata)===null||S===void 0?void 0:S.keyFormat)==="identity"&&!((x=le.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(le,j):this.loadFragment(le,j,ae)},R.loadFragment=function(S,x,p){var T,v=this.fragmentTracker.getState(S);if(this.fragCurrent=S,v===i.FragmentState.BACKTRACKED){var y=this.fragmentTracker.getBacktrackData(S);if(y){this._handleFragmentLoadProgress(y),this._handleFragmentLoadComplete(y);return}else v=i.FragmentState.NOT_LOADED}v===i.FragmentState.NOT_LOADED||v===i.FragmentState.PARTIAL?S.sn==="initSegment"?this._loadInitSegment(S):this.bitrateTest?(S.bitrateTest=!0,this.log("Fragment "+S.sn+" of level "+S.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(S)):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,S,x,p)):v===i.FragmentState.APPENDING?this.reduceMaxBufferLength(S.duration)&&this.fragmentTracker.removeFragment(S):((T=this.media)===null||T===void 0?void 0:T.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},R.getAppendedFrag=function(S){var x=this.fragmentTracker.getAppendedFrag(S,D.PlaylistLevelType.MAIN);return x&&"fragment"in x?x.fragment:x},R.getBufferedFrag=function(S){return this.fragmentTracker.getBufferedFrag(S,D.PlaylistLevelType.MAIN)},R.followingBufferedFrag=function(S){return S?this.getBufferedFrag(S.end+.5):null},R.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},R.nextLevelSwitch=function(){var S=this.levels,x=this.media;if(x!=null&&x.readyState){var p,T=this.getAppendedFrag(x.currentTime);if(T&&T.start>1&&this.flushMainBuffer(0,T.start-1),!x.paused&&S){var v=this.hls.nextLoadLevel,y=S[v],F=this.fragLastKbps;F&&this.fragCurrent?p=this.fragCurrent.duration*y.maxBitrate/(1e3*F)+1:p=0}else p=0;var B=this.getBufferedFrag(x.currentTime+p);if(B){var O=this.followingBufferedFrag(B);if(O){this.abortCurrentFrag();var j=O.maxStartPTS?O.maxStartPTS:O.start,P=O.duration,b=Math.max(B.end,j+Math.min(Math.max(P-this.config.maxFragLookUpTolerance,P*.5),P*.75));this.flushMainBuffer(b,Number.POSITIVE_INFINITY)}}}},R.abortCurrentFrag=function(){var S=this.fragCurrent;this.fragCurrent=null,S!=null&&S.loader&&S.loader.abort(),this.state===N.State.KEY_LOADING&&(this.state=N.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},R.flushMainBuffer=function(S,x){w.prototype.flushMainBuffer.call(this,S,x,this.altAudio?"video":null)},R.onMediaAttached=function(S,x){w.prototype.onMediaAttached.call(this,S,x);var p=x.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),p.addEventListener("playing",this.onvplaying),p.addEventListener("seeked",this.onvseeked),this.gapController=new u.default(this.config,p,this.fragmentTracker,this.hls)},R.onMediaDetaching=function(){var S=this.media;S&&(S.removeEventListener("playing",this.onvplaying),S.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),w.prototype.onMediaDetaching.call(this)},R.onMediaPlaying=function(){this.tick()},R.onMediaSeeked=function(){var S=this.media,x=S?S.currentTime:null;Object(X.isFiniteNumber)(x)&&this.log("Media seeked to "+x.toFixed(3)),this.tick()},R.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},R.onManifestParsed=function(S,x){var p=!1,T=!1,v;x.levels.forEach(function(y){v=y.audioCodec,v&&(v.indexOf("mp4a.40.2")!==-1&&(p=!0),v.indexOf("mp4a.40.5")!==-1&&(T=!0))}),this.audioCodecSwitch=p&&T&&!Object(U.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=x.levels,this.startFragRequested=!1},R.onLevelLoading=function(S,x){var p=this.levels;if(!p||this.state!==N.State.IDLE)return;var T=p[x.level];(!T.details||T.details.live&&this.levelLastLoaded!==x.level||this.waitForCdnTuneIn(T.details))&&(this.state=N.State.WAITING_LEVEL)},R.onLevelLoaded=function(S,x){var p,T=this.levels,v=x.level,y=x.details,F=y.totalduration;if(!T){this.warn("Levels were reset while loading level "+v);return}this.log("Level "+v+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.endCC+"] duration:"+F);var B=this.fragCurrent;B&&(this.state===N.State.FRAG_LOADING||this.state===N.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==x.level&&B.loader&&(this.state=N.State.IDLE,B.loader.abort()));var O=T[v],j=0;if(y.live||(p=O.details)!==null&&p!==void 0&&p.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;j=this.alignPlaylists(y,O.details)}if(O.details=y,this.levelLastLoaded=v,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:y,level:v}),this.state===N.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=N.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,j),this.tick()},R._handleFragmentLoadProgress=function(S){var x,p=S.frag,T=S.part,v=S.payload,y=this.levels;if(!y){this.warn("Levels were reset while fragment load was in progress. Fragment "+p.sn+" of level "+p.level+" will not be buffered");return}var F=y[p.level],B=F.details;if(!B){this.warn("Dropping fragment "+p.sn+" of level "+p.level+" after level details were reset");return}var O=F.videoCodec,j=B.PTSKnown||!B.live,P=(x=p.initSegment)===null||x===void 0?void 0:x.data,b=this._getAudioCodec(F),Y=this.transmuxer=this.transmuxer||new d.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ee=T?T.index:-1,ae=ee!==-1,le=new m.ChunkMetadata(p.level,p.sn,p.stats.chunkCount,v.byteLength,ee,ae),Re=this.initPTS[p.cc];Y.push(v,P,b,O,p,T,B.totalduration,j,le,Re)},R.onAudioTrackSwitching=function(S,x){var p=this.altAudio,T=!!x.url,v=x.id;if(!T){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var y=this.fragCurrent;y!=null&&y.loader&&(this.log("Switching to main audio track, cancel main fragment load"),y.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var F=this.hls;p&&F.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),F.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:v})}},R.onAudioTrackSwitched=function(S,x){var p=x.id,T=!!this.hls.audioTracks[p].url;if(T){var v=this.videoBuffer;v&&this.mediaBuffer!==v&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=v)}this.altAudio=T,this.tick()},R.onBufferCreated=function(S,x){var p=x.tracks,T,v,y=!1;for(var F in p){var B=p[F];if(B.id==="main"){if(v=F,T=B,F==="video"){var O=p[F];O&&(this.videoBuffer=O.buffer)}}else y=!0}y&&T?(this.log("Alternate track found, use "+v+".buffered to schedule main fragment loading"),this.mediaBuffer=T.buffer):this.mediaBuffer=this.media},R.onFragBuffered=function(S,x){var p=x.frag,T=x.part;if(p&&p.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(p)){this.warn("Fragment "+p.sn+(T?" p: "+T.index:"")+" of level "+p.level+" finished buffering, but was aborted. state: "+this.state),this.state===N.State.PARSED&&(this.state=N.State.IDLE);return}var v=T?T.stats:p.stats;this.fragLastKbps=Math.round(8*v.total/(v.buffering.end-v.loading.first)),p.sn!=="initSegment"&&(this.fragPrevious=p),this.fragBufferedComplete(p,T)},R.onError=function(S,x){switch(x.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(D.PlaylistLevelType.MAIN,x);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==N.State.ERROR&&(x.fatal?(this.warn(""+x.details),this.state=N.State.ERROR):!x.levelRetry&&this.state===N.State.WAITING_LEVEL&&(this.state=N.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="main"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var p=!0,T=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);T&&T.len>.5&&(p=!this.reduceMaxBufferLength(T.len)),p&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},R.checkBuffer=function(){var S=this.media,x=this.gapController;if(!S||!x||!S.readyState)return;var p=W.BufferHelper.getBuffered(S);!this.loadedmetadata&&p.length?(this.loadedmetadata=!0,this.seekToStartPos()):x.poll(this.lastCurrentTime),this.lastCurrentTime=S.currentTime},R.onFragLoadEmergencyAborted=function(){this.state=N.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},R.onBufferFlushed=function(S,x){var p=x.type;if(p!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var T=(p===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(T,p,D.PlaylistLevelType.MAIN)}},R.onLevelsUpdated=function(S,x){this.levels=x.levels},R.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},R.seekToStartPos=function(){var S=this.media,x=S.currentTime,p=this.startPosition;if(p>=0&&x<p){if(S.seeking){f.logger.log("could not seek to "+p+", already seeking at "+x);return}var T=W.BufferHelper.getBuffered(S),v=T.length?T.start(0):0,y=v-p;y>0&&(y<this.config.maxBufferHole||y<this.config.maxFragLookUpTolerance)&&(f.logger.log("adjusting start position by "+y+" to match buffer start"),p+=y,this.startPosition=p),this.log("seek to target start position "+p+" from current time "+x),S.currentTime=p}},R._getAudioCodec=function(S){var x=this.config.defaultAudioCodec||S.audioCodec;return this.audioCodecSwap&&x&&(this.log("Swapping audio codec"),x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),x},R._loadBitrateTestFrag=function(S){var x=this;this._doFragLoad(S).then(function(p){var T=x.hls;if(!p||T.nextLoadLevel||x.fragContextChanged(S))return;x.fragLoadError=0,x.state=N.State.IDLE,x.startFragRequested=!1,x.bitrateTest=!1;var v=S.stats;v.parsing.start=v.parsing.end=v.buffering.start=v.buffering.end=self.performance.now(),T.trigger(G.Events.FRAG_LOADED,p)})},R._handleTransmuxComplete=function(S){var x,p="main",T=this.hls,v=S.remuxResult,y=S.chunkMeta,F=this.getCurrentContext(y);if(!F){this.warn("The loading context changed while buffering fragment "+y.sn+" of level "+y.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(y.level);return}var B=F.frag,O=F.part,j=F.level,P=v.video,b=v.text,Y=v.id3,ee=v.initSegment,ae=this.altAudio?void 0:v.audio;if(this.fragContextChanged(B))return;if(this.state=N.State.PARSING,ee){ee.tracks&&(this._bufferInitSegment(j,ee.tracks,B,y),T.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:p,tracks:ee.tracks}));var le=ee.initPTS,Re=ee.timescale;Object(X.isFiniteNumber)(le)&&(this.initPTS[B.cc]=le,T.trigger(G.Events.INIT_PTS_FOUND,{frag:B,id:p,initPTS:le,timescale:Re}))}if(P&&v.independent!==!1){if(j.details){var Ee=P.startPTS,Te=P.endPTS,Ae=P.startDTS,Oe=P.endDTS;if(O)O.elementaryStreams[P.type]={startPTS:Ee,endPTS:Te,startDTS:Ae,endDTS:Oe};else if(P.firstKeyFrame&&P.independent&&(this.couldBacktrack=!0),P.dropped&&P.independent){var ce=this.getLoadPosition()+this.config.maxBufferHole;if(ce<Ee){this.backtrack(B);return}B.setElementaryStreamInfo(P.type,B.start,Te,B.start,Oe,!0)}B.setElementaryStreamInfo(P.type,Ee,Te,Ae,Oe),this.bufferFragmentData(P,B,O,y)}}else if(v.independent===!1){this.backtrack(B);return}if(ae){var ue=ae.startPTS,Pe=ae.endPTS,qe=ae.startDTS,ze=ae.endDTS;O&&(O.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:Pe,startDTS:qe,endDTS:ze}),B.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ue,Pe,qe,ze),this.bufferFragmentData(ae,B,O,y)}if(Y!=null&&(x=Y.samples)!==null&&x!==void 0&&x.length){var et={frag:B,id:p,samples:Y.samples};T.trigger(G.Events.FRAG_PARSING_METADATA,et)}if(b){var nt={frag:B,id:p,samples:b.samples};T.trigger(G.Events.FRAG_PARSING_USERDATA,nt)}},R._bufferInitSegment=function(S,x,p,T){var v=this;if(this.state!==N.State.PARSING)return;this.audioOnly=!!x.audio&&!x.video,this.altAudio&&!this.audioOnly&&delete x.audio;var y=x.audio,F=x.video,B=x.audiovideo;if(y){var O=S.audioCodec,j=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(O&&(O.indexOf("mp4a.40.5")!==-1?O="mp4a.40.2":O="mp4a.40.5"),y.metadata.channelCount!==1&&j.indexOf("firefox")===-1&&(O="mp4a.40.5")),j.indexOf("android")!==-1&&y.container!=="audio/mpeg"&&(O="mp4a.40.2",this.log("Android: force audio codec to "+O)),S.audioCodec&&S.audioCodec!==O&&this.log('Swapping manifest audio codec "'+S.audioCodec+'" for "'+O+'"'),y.levelCodec=O,y.id="main",this.log("Init audio buffer, container:"+y.container+", codecs[selected/level/parsed]=["+(O||"")+"/"+(S.audioCodec||"")+"/"+y.codec+"]")}F&&(F.levelCodec=S.videoCodec,F.id="main",this.log("Init video buffer, container:"+F.container+", codecs[level/parsed]=["+(S.videoCodec||"")+"/"+F.codec+"]")),B&&this.log("Init audiovideo buffer, container:"+B.container+", codecs[level/parsed]=["+(S.attrs.CODECS||"")+"/"+B.codec+"]"),this.hls.trigger(G.Events.BUFFER_CODECS,x),Object.keys(x).forEach(function(P){var b=x[P],Y=b.initSegment;Y!=null&&Y.byteLength&&v.hls.trigger(G.Events.BUFFER_APPENDING,{type:P,data:Y,frag:p,part:null,chunkMeta:T,parent:p.type})}),this.tick()},R.backtrack=function(S){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(S);var x=this.fragmentTracker.backtrack(S);this.fragPrevious=null,this.nextLoadPosition=S.start,x?this.resetFragmentLoading(S):this.state=N.State.BACKTRACKING},R.checkFragmentChanged=function(){var S=this.media,x=null;if(S&&S.readyState>1&&S.seeking===!1){var p=S.currentTime;if(W.BufferHelper.isBuffered(S,p)?x=this.getAppendedFrag(p):W.BufferHelper.isBuffered(S,p+.1)&&(x=this.getAppendedFrag(p+.1)),x){var T=this.fragPlaying,v=x.level;(!T||x.sn!==T.sn||T.level!==v||x.urlId!==T.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:x}),(!T||T.level!==v)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:v}),this.fragPlaying=x)}}},h(L,[{key:"nextLevel",get:function(){var S=this.nextBufferedFrag;return S?S.level:-1}},{key:"currentLevel",get:function(){var S=this.media;if(S){var x=this.getAppendedFrag(S.currentTime);if(x)return x.level}return-1}},{key:"nextBufferedFrag",get:function(){var S=this.media;if(S){var x=this.getAppendedFrag(S.currentTime);return this.followingBufferedFrag(x)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(N.default)},"./src/controller/subtitle-stream-controller.ts":function(ne,$,k){"use strict";k.r($),k.d($,"SubtitleStreamController",function(){return o});var X=k("./src/events.ts"),N=k("./src/utils/logger.ts"),U=k("./src/utils/buffer-helper.ts"),G=k("./src/controller/fragment-finders.ts"),W=k("./src/utils/discontinuities.ts"),i=k("./src/controller/level-helper.ts"),D=k("./src/controller/fragment-tracker.ts"),g=k("./src/controller/base-stream-controller.ts"),d=k("./src/types/loader.ts"),m=k("./src/types/level.ts");function u(s,A){for(var _=0;_<A.length;_++){var w=A[_];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(s,w.key,w)}}function a(s,A,_){return A&&u(s.prototype,A),_&&u(s,_),s}function f(s,A){s.prototype=Object.create(A.prototype),s.prototype.constructor=s,l(s,A)}function l(s,A){return l=Object.setPrototypeOf||function(w,L){return w.__proto__=L,w},l(s,A)}var h=500,o=function(s){f(A,s);function A(w,L){var R;return R=s.call(this,w,L,"[subtitle-stream-controller]")||this,R.levels=[],R.currentTrackId=-1,R.tracksBuffered=[],R.mainDetails=null,R._registerListeners(),R}var _=A.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var L=this.hls;L.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.on(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.on(X.Events.ERROR,this.onError,this),L.on(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.on(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.on(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_._unregisterListeners=function(){var L=this.hls;L.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.off(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.off(X.Events.ERROR,this.onError,this),L.off(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.off(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.off(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(h),this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},_.onLevelLoaded=function(L,R){this.mainDetails=R.details},_.onSubtitleFragProcessed=function(L,R){var C=R.frag,S=R.success;if(this.fragPrevious=C,this.state=g.State.IDLE,!S)return;var x=this.tracksBuffered[this.currentTrackId];if(!x)return;for(var p,T=C.start,v=0;v<x.length;v++)if(T>=x[v].start&&T<=x[v].end){p=x[v];break}var y=C.start+C.duration;p?p.end=y:(p={start:T,end:y},x.push(p)),this.fragmentTracker.fragBuffered(C)},_.onBufferFlushing=function(L,R){var C=R.startOffset,S=R.endOffset;if(C===0&&S!==Number.POSITIVE_INFINITY){var x=this.currentTrackId,p=this.levels;if(!p.length||!p[x]||!p[x].details)return;var T=p[x].details,v=T.targetduration,y=S-v;if(y<=0)return;R.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(function(F){for(var B=0;B<F.length;){if(F[B].end<=y){F.shift();continue}else if(F[B].start<y)F[B].start=y;else break;B++}}),this.fragmentTracker.removeFragmentsInRange(C,y,d.PlaylistLevelType.SUBTITLE)}},_.onError=function(L,R){var C,S=R.frag;if(!S||S.type!==d.PlaylistLevelType.SUBTITLE)return;(C=this.fragCurrent)!==null&&C!==void 0&&C.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},_.onSubtitleTracksUpdated=function(L,R){var C=this,S=R.subtitleTracks;this.tracksBuffered=[],this.levels=S.map(function(x){return new m.Level(x)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(x){C.tracksBuffered[x.id]=[]}),this.mediaBuffer=null},_.onSubtitleTrackSwitch=function(L,R){if(this.currentTrackId=R.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var C=this.levels[this.currentTrackId];C!=null&&C.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,C&&this.setInterval(h)},_.onSubtitleTrackLoaded=function(L,R){var C,S=R.details,x=R.id,p=this.currentTrackId,T=this.levels;if(!T.length)return;var v=T[p];if(x>=T.length||x!==p||!v)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,S.live||(C=v.details)!==null&&C!==void 0&&C.live){var y=this.mainDetails;if(S.deltaUpdateFailed||!y)return;var F=y.fragments[0];if(!v.details)S.hasProgramDateTime&&y.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(S,y):F&&Object(i.addSliding)(S,F.start);else{var B=this.alignPlaylists(S,v.details);B===0&&F&&Object(i.addSliding)(S,F.start)}}if(v.details=S,this.levelLastLoaded=x,this.tick(),S.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var O=Object(G.findFragmentByPTS)(null,S.fragments,this.media.currentTime,0);O||(this.warn("Subtitle playlist not aligned with playback"),v.details=void 0)}},_._handleFragmentLoadComplete=function(L){var R=L.frag,C=L.payload,S=R.decryptdata,x=this.hls;if(this.fragContextChanged(R))return;if(C&&C.byteLength>0&&S&&S.key&&S.iv&&S.method==="AES-128"){var p=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(C),S.key.buffer,S.iv.buffer).then(function(T){var v=performance.now();x.trigger(X.Events.FRAG_DECRYPTED,{frag:R,payload:T,stats:{tstart:p,tdecrypt:v}})})}},_.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var L,R=this.currentTrackId,C=this.levels;if(!C.length||!C[R]||!C[R].details)return;var S=C[R].details,x=S.targetduration,p=this.config,T=this.media,v=U.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,T.currentTime-x,p.maxBufferHole),y=v.end,F=v.len,B=this.getMaxBufferLength()+x;if(F>B)return;console.assert(S,"Subtitle track details are defined on idle subtitle stream controller tick");var O=S.fragments,j=O.length,P=S.edge,b,Y=this.fragPrevious;if(y<P){var ee=p.maxFragLookUpTolerance;Y&&S.hasProgramDateTime&&(b=Object(G.findFragmentByPDT)(O,Y.endProgramDateTime,ee)),b||(b=Object(G.findFragmentByPTS)(Y,O,y,ee),!b&&Y&&Y.start<O[0].start&&(b=O[0]))}else b=O[j-1];(L=b)!==null&&L!==void 0&&L.encrypted?(N.logger.log("Loading key for "+b.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(X.Events.KEY_LOADING,{frag:b})):b&&this.fragmentTracker.getState(b)===D.FragmentState.NOT_LOADED&&this.loadFragment(b,S,y)}},_.loadFragment=function(L,R,C){this.fragCurrent=L,s.prototype.loadFragment.call(this,L,R,C)},a(A,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),A}(g.default)},"./src/controller/subtitle-track-controller.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/events.ts"),N=k("./src/utils/texttrack-utils.ts"),U=k("./src/controller/base-playlist-controller.ts"),G=k("./src/types/loader.ts");function W(u,a){for(var f=0;f<a.length;f++){var l=a[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(u,l.key,l)}}function i(u,a,f){return a&&W(u.prototype,a),f&&W(u,f),u}function D(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,g(u,a)}function g(u,a){return g=Object.setPrototypeOf||function(l,h){return l.__proto__=h,l},g(u,a)}var d=function(u){D(a,u);function a(l){var h;return h=u.call(this,l,"[subtitle-track-controller]")||this,h.media=null,h.tracks=[],h.groupId=null,h.tracksInGroup=[],h.trackId=-1,h.selectDefaultTrack=!0,h.queuedDefaultTrack=-1,h.trackChangeListener=function(){return h.onTextTracksChanged()},h.asyncPollTrackChange=function(){return h.pollTrackChange(0)},h.useTextTrackPolling=!1,h.subtitlePollingInterval=-1,h.subtitleDisplay=!0,h.registerListeners(),h}var f=a.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,u.prototype.destroy.call(this)},f.registerListeners=function(){var h=this.hls;h.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),h.on(X.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var h=this.hls;h.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),h.off(X.Events.ERROR,this.onError,this)},f.onMediaAttached=function(h,o){if(this.media=o.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},f.pollTrackChange=function(h){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,h)},f.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 h=m(this.media.textTracks);h.forEach(function(o){Object(N.clearCurrentCues)(o)}),this.subtitleTrack=-1,this.media=null},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(h,o){this.tracks=o.subtitleTracks},f.onSubtitleTrackLoaded=function(h,o){var s=o.id,A=o.details,_=this.trackId,w=this.tracksInGroup[_];if(!w){this.warn("Invalid subtitle track id "+s);return}var L=w.details;w.details=o.details,this.log("subtitle track "+s+" loaded ["+A.startSN+"-"+A.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,o,L))},f.onLevelLoading=function(h,o){this.switchLevel(o.level)},f.onLevelSwitching=function(h,o){this.switchLevel(o.level)},f.switchLevel=function(h){var o=this.hls.levels[h];if(!(o!=null&&o.textGroupIds))return;var s=o.textGroupIds[o.urlId];if(this.groupId!==s){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,_=this.tracks.filter(function(R){return!s||R.groupId===s});this.tracksInGroup=_;var w=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=s;var L={subtitleTracks:_};this.log("Updating subtitle tracks, "+_.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,L),w!==-1&&this.setSubtitleTrack(w,A)}},f.findTrackId=function(h){for(var o=this.tracksInGroup,s=0;s<o.length;s++){var A=o[s];if((!this.selectDefaultTrack||A.default)&&(!h||h===A.name))return A.id}return-1},f.onError=function(h,o){if(u.prototype.onError.call(this,h,o),o.fatal||!o.context)return;o.context.type===G.PlaylistContextType.SUBTITLE_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},f.loadPlaylist=function(h){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var s=o.id,A=o.groupId,_=o.url;if(h)try{_=h.addDirectives(_)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("Loading subtitle playlist for id "+s),this.hls.trigger(X.Events.SUBTITLE_TRACK_LOADING,{url:_,id:s,groupId:A,deliveryDirectives:h||null})}},f.toggleTrackModes=function(h){var o=this,s=this.media,A=this.subtitleDisplay,_=this.trackId;if(!s)return;var w=m(s.textTracks),L=w.filter(function(S){return S.groupId===o.groupId});if(h===-1)[].slice.call(w).forEach(function(S){S.mode="disabled"});else{var R=L[_];R&&(R.mode="disabled")}var C=L[h];C&&(C.mode=A?"showing":"hidden")},f.setSubtitleTrack=function(h,o){var s,A=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=h;return}if(this.trackId!==h&&this.toggleTrackModes(h),this.trackId===h&&(h===-1||(s=A[h])!==null&&s!==void 0&&s.details)||h<-1||h>=A.length)return;this.clearTimer();var _=A[h];if(this.log("Switching to subtitle track "+h),this.trackId=h,_){var w=_.id,L=_.groupId,R=L===void 0?"":L,C=_.name,S=_.type,x=_.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:w,groupId:R,name:C,type:S,url:x});var p=this.switchParams(_.url,o==null?void 0:o.details);this.loadPlaylist(p)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:h})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var h=-1,o=m(this.media.textTracks),s=0;s<o.length;s++)if(o[s].mode==="hidden")h=s;else if(o[s].mode==="showing"){h=s;break}this.subtitleTrack!==h&&(this.subtitleTrack=h)},i(a,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(h){this.selectDefaultTrack=!1;var o=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(h,o)}}]),a}(U.default);function m(u){for(var a=[],f=0;f<u.length;f++){var l=u[f];l.kind==="subtitles"&&l.label&&a.push(u[f])}return a}$.default=d},"./src/controller/timeline-controller.ts":function(ne,$,k){"use strict";k.r($),k.d($,"TimelineController",function(){return m});var X=k("./src/polyfills/number.ts"),N=k("./src/events.ts"),U=k("./src/utils/cea-608-parser.ts"),G=k("./src/utils/output-filter.ts"),W=k("./src/utils/webvtt-parser.ts"),i=k("./src/utils/texttrack-utils.ts"),D=k("./src/utils/imsc1-ttml-parser.ts"),g=k("./src/types/loader.ts"),d=k("./src/utils/logger.ts"),m=function(){function l(o){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),this.captionsProperties=void 0,this.hls=o,this.config=o.config,this.Cues=o.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var s=new G.default(this,"textTrack1"),A=new G.default(this,"textTrack2"),_=new G.default(this,"textTrack3"),w=new G.default(this,"textTrack4");this.cea608Parser1=new U.default(1,s,A),this.cea608Parser2=new U.default(3,_,w)}o.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.on(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.on(N.Events.FRAG_LOADING,this.onFragLoading,this),o.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.on(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.on(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.on(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var h=l.prototype;return h.destroy=function(){var s=this.hls;s.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.off(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.off(N.Events.FRAG_LOADING,this.onFragLoading,this),s.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.off(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.off(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},h.addCues=function(s,A,_,w,L){for(var R=!1,C=L.length;C--;){var S=L[C],x=a(S[0],S[1],A,_);if(x>=0&&(S[0]=Math.min(S[0],A),S[1]=Math.max(S[1],_),R=!0,x/(_-A)>.5))return}if(R||L.push([A,_]),this.config.renderTextTracksNatively){var p=this.captionsTracks[s];this.Cues.newCue(p,A,_,w)}else{var T=this.Cues.newCue(null,A,_,w);this.hls.trigger(N.Events.CUES_PARSED,{type:"captions",cues:T,track:s})}},h.onInitPtsFound=function(s,A){var _=this,w=A.frag,L=A.id,R=A.initPTS,C=A.timescale,S=this.unparsedVttFrags;L==="main"&&(this.initPTS[w.cc]=R,this.timescale[w.cc]=C),S.length&&(this.unparsedVttFrags=[],S.forEach(function(x){_.onFragLoaded(N.Events.FRAG_LOADED,x)}))},h.getExistingTrack=function(s){var A=this.media;if(A)for(var _=0;_<A.textTracks.length;_++){var w=A.textTracks[_];if(w[s])return w}return null},h.createCaptionsTrack=function(s){this.config.renderTextTracksNatively?this.createNativeTrack(s):this.createNonNativeTrack(s)},h.createNativeTrack=function(s){if(this.captionsTracks[s])return;var A=this.captionsProperties,_=this.captionsTracks,w=this.media,L=A[s],R=L.label,C=L.languageCode,S=this.getExistingTrack(s);if(S)_[s]=S,Object(i.clearCurrentCues)(_[s]),Object(i.sendAddTrackEvent)(_[s],w);else{var x=this.createTextTrack("captions",R,C);x&&(x[s]=!0,_[s]=x)}},h.createNonNativeTrack=function(s){if(this.nonNativeCaptionsTracks[s])return;var A=this.captionsProperties[s];if(!A)return;var _=A.label,w={_id:s,label:_,kind:"captions",default:A.media?!!A.media.default:!1,closedCaptions:A.media};this.nonNativeCaptionsTracks[s]=w,this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[w]})},h.createTextTrack=function(s,A,_){var w=this.media;return w?w.addTextTrack(s,A,_):void 0},h.onMediaAttaching=function(s,A){this.media=A.media,this._cleanTracks()},h.onMediaDetaching=function(){var s=this.captionsTracks;Object.keys(s).forEach(function(A){Object(i.clearCurrentCues)(s[A]),delete s[A]}),this.nonNativeCaptionsTracks={}},h.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),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())},h._cleanTracks=function(){var s=this.media;if(!s)return;var A=s.textTracks;if(A)for(var _=0;_<A.length;_++)Object(i.clearCurrentCues)(A[_])},h.onSubtitleTracksUpdated=function(s,A){var _=this;this.textTracks=[];var w=A.subtitleTracks||[],L=w.some(function(x){return x.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var R=this.tracks&&w&&this.tracks.length===w.length;if(this.tracks=w||[],this.config.renderTextTracksNatively){var C=this.media?this.media.textTracks:[];this.tracks.forEach(function(x,p){var T;if(p<C.length){for(var v=null,y=0;y<C.length;y++)if(u(C[y],x)){v=C[y];break}v&&(T=v)}T?Object(i.clearCurrentCues)(T):(T=_.createTextTrack("subtitles",x.name,x.lang),T&&(T.mode="disabled")),T&&(T.groupId=x.groupId,_.textTracks.push(T))})}else if(!R&&this.tracks&&this.tracks.length){var S=this.tracks.map(function(x){return{label:x.name,kind:x.type.toLowerCase(),default:x.default,subtitleTrack:x}});this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:S})}}},h.onManifestLoaded=function(s,A){var _=this;this.config.enableCEA708Captions&&A.captions&&A.captions.forEach(function(w){var L=/(?:CC|SERVICE)([1-4])/.exec(w.instreamId);if(!L)return;var R="textTrack"+L[1],C=_.captionsProperties[R];if(!C)return;C.label=w.name,w.lang&&(C.languageCode=w.lang),C.media=w})},h.onFragLoading=function(s,A){var _=this.cea608Parser1,w=this.cea608Parser2,L=this.lastSn,R=this.lastPartIndex;if(!this.enabled||!(_&&w))return;if(A.frag.type===g.PlaylistLevelType.MAIN){var C,S,x=A.frag.sn,p=(C=A==null||((S=A.part)===null||S===void 0)?void 0:S.index)!=null?C:-1;x===L+1||x===L&&p===R+1||(_.reset(),w.reset()),this.lastSn=x,this.lastPartIndex=p}},h.onFragLoaded=function(s,A){var _=A.frag,w=A.payload,L=this.initPTS,R=this.unparsedVttFrags;if(_.type===g.PlaylistLevelType.SUBTITLE)if(w.byteLength){if(!Object(X.isFiniteNumber)(L[_.cc])){R.push(A),L.length&&this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Missing initial subtitle PTS")});return}var C=_.decryptdata;if(C==null||C.key==null||C.method!=="AES-128"){var S=this.tracks[_.level],x=this.vttCCs;x[_.cc]||(x[_.cc]={start:_.start,prevCC:this.prevCC,new:!0},this.prevCC=_.cc),S&&S.textCodec===D.IMSC1_CODEC?this._parseIMSC1(_,w):this._parseVTTs(_,w,x)}}else this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Empty subtitle payload")})},h._parseIMSC1=function(s,A){var _=this,w=this.hls;Object(D.parseIMSC1)(A,this.initPTS[s.cc],this.timescale[s.cc],function(L){_._appendCues(L,s.level),w.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(L){d.logger.log("Failed to parse IMSC1: "+L),w.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:L})})},h._parseVTTs=function(s,A,_){var w=this,L=this.hls;Object(W.parseWebVTT)(A,this.initPTS[s.cc],this.timescale[s.cc],_,s.cc,s.start,function(R){w._appendCues(R,s.level),L.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(R){w._fallbackToIMSC1(s,A),d.logger.log("Failed to parse VTT cue: "+R),L.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:R})})},h._fallbackToIMSC1=function(s,A){var _=this,w=this.tracks[s.level];w.textCodec||Object(D.parseIMSC1)(A,this.initPTS[s.cc],this.timescale[s.cc],function(){w.textCodec=D.IMSC1_CODEC,_._parseIMSC1(s,A)},function(){w.textCodec="wvtt"})},h._appendCues=function(s,A){var _=this.hls;if(this.config.renderTextTracksNatively){var w=this.textTracks[A];if(w.mode==="disabled")return;s.forEach(function(C){return Object(i.addCueToTrack)(w,C)})}else{var L=this.tracks[A],R=L.default?"default":"subtitles"+A;_.trigger(N.Events.CUES_PARSED,{type:"subtitles",cues:s,track:R})}},h.onFragDecrypted=function(s,A){var _=A.frag;if(_.type===g.PlaylistLevelType.SUBTITLE){if(!Object(X.isFiniteNumber)(this.initPTS[_.cc])){this.unparsedVttFrags.push(A);return}this.onFragLoaded(N.Events.FRAG_LOADED,A)}},h.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},h.onFragParsingUserdata=function(s,A){var _=this.cea608Parser1,w=this.cea608Parser2;if(!this.enabled||!(_&&w))return;for(var L=0;L<A.samples.length;L++){var R=A.samples[L].bytes;if(R){var C=this.extractCea608Data(R);_.addData(A.samples[L].pts,C[0]),w.addData(A.samples[L].pts,C[1])}}},h.onBufferFlushing=function(s,A){var _=A.startOffset,w=A.endOffset,L=A.endOffsetSubtitles,R=A.type,C=this.media;if(!C||C.currentTime<w)return;if(!R||R==="video"){var S=this.captionsTracks;Object.keys(S).forEach(function(p){return Object(i.removeCuesInRange)(S[p],_,w)})}if(this.config.renderTextTracksNatively&&(_===0&&L!==void 0)){var x=this.textTracks;Object.keys(x).forEach(function(p){return Object(i.removeCuesInRange)(x[p],_,L)})}},h.extractCea608Data=function(s){for(var A=s[0]&31,_=2,w=[[],[]],L=0;L<A;L++){var R=s[_++],C=127&s[_++],S=127&s[_++],x=(4&R)!==0,p=3&R;if(C===0&&S===0)continue;x&&((p===0||p===1)&&(w[p].push(C),w[p].push(S)))}return w},l}();function u(l,h){return l&&l.label===h.name&&!(l.textTrack1||l.textTrack2)}function a(l,h,o,s){return Math.min(h,s)-Math.max(l,o)}function f(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return X});var X=function(){function N(G,W){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=W}var U=N.prototype;return U.decrypt=function(W,i){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},i,W)},N}()},"./src/crypt/aes-decryptor.ts":function(ne,$,k){"use strict";k.r($),k.d($,"removePadding",function(){return N}),k.d($,"default",function(){return U});var X=k("./src/utils/typed-array.ts");function N(G){var W=G.byteLength,i=W&&new DataView(G.buffer).getUint8(W-1);return i?Object(X.sliceUint8)(G,0,W-i):G}var U=function(){function G(){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 W=G.prototype;return W.uint8ArrayToUint32Array_=function(D){for(var g=new DataView(D),d=new Uint32Array(4),m=0;m<4;m++)d[m]=g.getUint32(m*4);return d},W.initTable=function(){var D=this.sBox,g=this.invSBox,d=this.subMix,m=d[0],u=d[1],a=d[2],f=d[3],l=this.invSubMix,h=l[0],o=l[1],s=l[2],A=l[3],_=new Uint32Array(256),w=0,L=0,R=0;for(R=0;R<256;R++)R<128?_[R]=R<<1:_[R]=R<<1^283;for(R=0;R<256;R++){var C=L^L<<1^L<<2^L<<3^L<<4;C=C>>>8^C&255^99,D[w]=C,g[C]=w;var S=_[w],x=_[S],p=_[x],T=_[C]*257^C*16843008;m[w]=T<<24|T>>>8,u[w]=T<<16|T>>>16,a[w]=T<<8|T>>>24,f[w]=T,T=p*16843009^x*65537^S*257^w*16843008,h[C]=T<<24|T>>>8,o[C]=T<<16|T>>>16,s[C]=T<<8|T>>>24,A[C]=T,w?(w=S^_[_[_[p^S]]],L^=_[_[L]]):w=L=1}},W.expandKey=function(D){for(var g=this.uint8ArrayToUint32Array_(D),d=!0,m=0;m<g.length&&d;)d=g[m]===this.key[m],m++;if(d)return;this.key=g;var u=this.keySize=g.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);var a=this.ksRows=(u+6+1)*4,f,l,h=this.keySchedule=new Uint32Array(a),o=this.invKeySchedule=new Uint32Array(a),s=this.sBox,A=this.rcon,_=this.invSubMix,w=_[0],L=_[1],R=_[2],C=_[3],S,x;for(f=0;f<a;f++){if(f<u){S=h[f]=g[f];continue}x=S,f%u===0?(x=x<<8|x>>>24,x=s[x>>>24]<<24|s[x>>>16&255]<<16|s[x>>>8&255]<<8|s[x&255],x^=A[f/u|0]<<24):u>6&&f%u===4&&(x=s[x>>>24]<<24|s[x>>>16&255]<<16|s[x>>>8&255]<<8|s[x&255]),h[f]=S=(h[f-u]^x)>>>0}for(l=0;l<a;l++)f=a-l,l&3?x=h[f]:x=h[f-4],l<4||f<=4?o[l]=x:o[l]=w[s[x>>>24]]^L[s[x>>>16&255]]^R[s[x>>>8&255]]^C[s[x&255]],o[l]=o[l]>>>0},W.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},W.decrypt=function(D,g,d){for(var m=this.keySize+6,u=this.invKeySchedule,a=this.invSBox,f=this.invSubMix,l=f[0],h=f[1],o=f[2],s=f[3],A=this.uint8ArrayToUint32Array_(d),_=A[0],w=A[1],L=A[2],R=A[3],C=new Int32Array(D),S=new Int32Array(C.length),x,p,T,v,y,F,B,O,j,P,b,Y,ee,ae,le=this.networkToHostOrderSwap;g<C.length;){for(j=le(C[g]),P=le(C[g+1]),b=le(C[g+2]),Y=le(C[g+3]),y=j^u[0],F=Y^u[1],B=b^u[2],O=P^u[3],ee=4,ae=1;ae<m;ae++)x=l[y>>>24]^h[F>>16&255]^o[B>>8&255]^s[O&255]^u[ee],p=l[F>>>24]^h[B>>16&255]^o[O>>8&255]^s[y&255]^u[ee+1],T=l[B>>>24]^h[O>>16&255]^o[y>>8&255]^s[F&255]^u[ee+2],v=l[O>>>24]^h[y>>16&255]^o[F>>8&255]^s[B&255]^u[ee+3],y=x,F=p,B=T,O=v,ee=ee+4;x=a[y>>>24]<<24^a[F>>16&255]<<16^a[B>>8&255]<<8^a[O&255]^u[ee],p=a[F>>>24]<<24^a[B>>16&255]<<16^a[O>>8&255]<<8^a[y&255]^u[ee+1],T=a[B>>>24]<<24^a[O>>16&255]<<16^a[y>>8&255]<<8^a[F&255]^u[ee+2],v=a[O>>>24]<<24^a[y>>16&255]<<16^a[F>>8&255]<<8^a[B&255]^u[ee+3],S[g]=le(x^_),S[g+1]=le(v^w),S[g+2]=le(T^L),S[g+3]=le(p^R),_=j,w=P,L=b,R=Y,g=g+4}return S.buffer},G}()},"./src/crypt/decrypter.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return g});var X=k("./src/crypt/aes-crypto.ts"),N=k("./src/crypt/fast-aes-key.ts"),U=k("./src/crypt/aes-decryptor.ts"),G=k("./src/utils/logger.ts"),W=k("./src/utils/mp4-tools.ts"),i=k("./src/utils/typed-array.ts"),D=16,g=function(){function d(u,a,f){var l=f===void 0?{}:f,h=l.removePKCS7Padding,o=h===void 0?!0:h;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=u,this.config=a,this.removePKCS7Padding=o,o)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(A){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var m=d.prototype;return m.destroy=function(){this.observer=null},m.isSync=function(){return this.config.enableSoftwareAES},m.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var f=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(U.removePadding)(f):f},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(a,f,l,h){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),f,l);var o=this.flush();o&&h(o.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),f,l).then(h)},m.softwareDecrypt=function(a,f,l){var h=this.currentIV,o=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(a=Object(W.appendUint8Array)(s,a),this.remainderData=null);var A=this.getValidChunk(a);if(!A.length)return null;h&&(l=h);var _=this.softwareDecrypter;_||(_=this.softwareDecrypter=new U.default),_.expandKey(f);var w=o;return this.currentResult=_.decrypt(A.buffer,0,l),this.currentIV=Object(i.sliceUint8)(A,-16).buffer,w||null},m.webCryptoDecrypt=function(a,f,l){var h=this,o=this.subtle;return(this.key!==f||!this.fastAesKey)&&(this.key=f,this.fastAesKey=new N.default(o,f)),this.fastAesKey.expandKey().then(function(s){if(!o)return Promise.reject(new Error("web crypto not initialized"));var A=new X.default(o,l);return A.decrypt(a.buffer,s)}).catch(function(s){return h.onWebCryptoError(s,a,f,l)})},m.onWebCryptoError=function(a,f,l,h){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(f,l,h)},m.getValidChunk=function(a){var f=a,l=a.length-a.length%D;return l!==a.length&&(f=Object(i.sliceUint8)(a,0,l),this.remainderData=Object(i.sliceUint8)(a,l)),f},m.logOnce=function(a){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},d}()},"./src/crypt/fast-aes-key.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return X});var X=function(){function N(G,W){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=W}var U=N.prototype;return U.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},N}()},"./src/demux/aacdemuxer.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/demux/base-audio-demuxer.ts"),N=k("./src/demux/adts.ts"),U=k("./src/utils/logger.ts"),G=k("./src/demux/id3.ts");function W(g,d){g.prototype=Object.create(d.prototype),g.prototype.constructor=g,i(g,d)}function i(g,d){return i=Object.setPrototypeOf||function(u,a){return u.__proto__=a,u},i(g,d)}var D=function(g){W(d,g);function d(u,a){var f;return f=g.call(this)||this,f.observer=void 0,f.config=void 0,f.observer=u,f.config=a,f}var m=d.prototype;return m.resetInitSegment=function(a,f,l){g.prototype.resetInitSegment.call(this,a,f,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:l,inputTimeScale:9e4,dropped:0}},d.probe=function(a){if(!a)return!1;for(var f=G.getID3Data(a,0)||[],l=f.length,h=a.length;l<h;l++)if(N.probe(a,l))return U.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(a,f){return N.canParse(a,f)},m.appendFrame=function(a,f,l){N.initTrackConfig(a,this.observer,f,l,a.manifestCodec);var h=N.appendFrame(a,f,l,this.initPTS,this.frameIndex);if(h&&h.missing===0)return h},d}(X.default);D.minProbeByteLength=9,$.default=D},"./src/demux/adts.ts":function(ne,$,k){"use strict";k.r($),k.d($,"getAudioConfig",function(){return G}),k.d($,"isHeaderPattern",function(){return W}),k.d($,"getHeaderLength",function(){return i}),k.d($,"getFullFrameLength",function(){return D}),k.d($,"canGetFrameLength",function(){return g}),k.d($,"isHeader",function(){return d}),k.d($,"canParse",function(){return m}),k.d($,"probe",function(){return u}),k.d($,"initTrackConfig",function(){return a}),k.d($,"getFrameDuration",function(){return f}),k.d($,"parseFrameHeader",function(){return l}),k.d($,"appendFrame",function(){return h});var X=k("./src/utils/logger.ts"),N=k("./src/errors.ts"),U=k("./src/events.ts");function G(o,s,A,_){var w,L,R,C,S=navigator.userAgent.toLowerCase(),x=_,p=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];w=((s[A+2]&192)>>>6)+1;var T=(s[A+2]&60)>>>2;if(T>p.length-1){o.trigger(U.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+T});return}return R=(s[A+2]&1)<<2,R|=(s[A+3]&192)>>>6,X.logger.log("manifest codec:"+_+", ADTS type:"+w+", samplingIndex:"+T),/firefox/i.test(S)?T>=6?(w=5,C=new Array(4),L=T-3):(w=2,C=new Array(2),L=T):S.indexOf("android")!==-1?(w=2,C=new Array(2),L=T):(w=5,C=new Array(4),_&&(_.indexOf("mp4a.40.29")!==-1||_.indexOf("mp4a.40.5")!==-1)||!_&&T>=6?L=T-3:((_&&_.indexOf("mp4a.40.2")!==-1&&(T>=6&&R===1||/vivaldi/i.test(S))||!_&&R===1)&&(w=2,C=new Array(2)),L=T)),C[0]=w<<3,C[0]|=(T&14)>>1,C[1]|=(T&1)<<7,C[1]|=R<<3,w===5&&(C[1]|=(L&14)>>1,C[2]=(L&1)<<7,C[2]|=2<<2,C[3]=0),{config:C,samplerate:p[T],channelCount:R,codec:"mp4a.40."+w,manifestCodec:x}}function W(o,s){return o[s]===255&&(o[s+1]&246)===240}function i(o,s){return o[s+1]&1?7:9}function D(o,s){return(o[s+3]&3)<<11|o[s+4]<<3|(o[s+5]&224)>>>5}function g(o,s){return s+5<o.length}function d(o,s){return s+1<o.length&&W(o,s)}function m(o,s){return g(o,s)&&W(o,s)&&D(o,s)<=o.length-s}function u(o,s){if(d(o,s)){var A=i(o,s);if(s+A>=o.length)return!1;var _=D(o,s);if(_<=A)return!1;var w=s+_;return w===o.length||d(o,w)}return!1}function a(o,s,A,_,w){if(!o.samplerate){var L=G(s,A,_,w);if(!L)return;o.config=L.config,o.samplerate=L.samplerate,o.channelCount=L.channelCount,o.codec=L.codec,o.manifestCodec=L.manifestCodec,X.logger.log("parsed codec:"+o.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function f(o){return 1024*9e4/o}function l(o,s,A,_,w){var L=i(o,s),R=D(o,s);if(R-=L,R>0){var C=A+_*w;return{headerLength:L,frameLength:R,stamp:C}}}function h(o,s,A,_,w){var L=f(o.samplerate),R=l(s,A,_,w,L);if(R){var C=R.frameLength,S=R.headerLength,x=R.stamp,p=S+C,T=Math.max(0,A+p-s.length),v;T?(v=new Uint8Array(p-S),v.set(s.subarray(A+S,s.length),0)):v=s.subarray(A+S,A+p);var y={unit:v,pts:x};return T||o.samples.push(y),{sample:y,length:p,missing:T}}}},"./src/demux/base-audio-demuxer.ts":function(ne,$,k){"use strict";k.r($),k.d($,"initPTSFn",function(){return D});var X=k("./src/polyfills/number.ts"),N=k("./src/demux/id3.ts"),U=k("./src/demux/dummy-demuxed-track.ts"),G=k("./src/utils/mp4-tools.ts"),W=k("./src/utils/typed-array.ts"),i=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var d=g.prototype;return d.resetInitSegment=function(u,a,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},d.resetTimeStamp=function(){},d.resetContiguity=function(){},d.canParse=function(u,a){return!1},d.appendFrame=function(u,a,f){},d.demux=function(u,a){this.cachedData&&(u=Object(G.appendUint8Array)(this.cachedData,u),this.cachedData=null);var f=N.getID3Data(u,0),l=f?f.length:0,h,o,s=this._audioTrack,A=this._id3Track,_=f?N.getTimeStamp(f):void 0,w=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(_,a)),f&&f.length>0&&A.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),o=this.initPTS;l<w;){if(this.canParse(u,l)){var L=this.appendFrame(s,u,l);L?(this.frameIndex++,o=L.sample.pts,l+=L.length,h=l):l=w}else N.canParse(u,l)?(f=N.getID3Data(u,l),A.samples.push({pts:o,dts:o,data:f}),l+=f.length,h=l):l++;if(l===w&&h!==w){var R=Object(W.sliceUint8)(u,h);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,R):this.cachedData=R}}return{audioTrack:s,avcTrack:Object(U.dummyTrack)(),id3Track:A,textTrack:Object(U.dummyTrack)()}},d.demuxSampleAes=function(u,a,f){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},d.flush=function(u){var a=this.cachedData;return a&&(this.cachedData=null,this.demux(a,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(U.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(U.dummyTrack)()}},d.destroy=function(){},g}(),D=function(d,m){return Object(X.isFiniteNumber)(d)?d*90:m*9e4};$.default=i},"./src/demux/chunk-cache.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return X});var X=function(){function U(){this.chunks=[],this.dataLength=0}var G=U.prototype;return G.push=function(i){this.chunks.push(i),this.dataLength+=i.length},G.flush=function(){var i=this.chunks,D=this.dataLength,g;if(i.length)i.length===1?g=i[0]:g=N(i,D);else return new Uint8Array(0);return this.reset(),g},G.reset=function(){this.chunks.length=0,this.dataLength=0},U}();function N(U,G){for(var W=new Uint8Array(G),i=0,D=0;D<U.length;D++){var g=U[D];W.set(g,i),i+=g.length}return W}},"./src/demux/dummy-demuxed-track.ts":function(ne,$,k){"use strict";k.r($),k.d($,"dummyTrack",function(){return X});function X(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/utils/logger.ts"),N=function(){function U(W){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=W,this.bytesAvailable=W.byteLength,this.word=0,this.bitsAvailable=0}var G=U.prototype;return G.loadWord=function(){var i=this.data,D=this.bytesAvailable,g=i.byteLength-D,d=new Uint8Array(4),m=Math.min(4,D);if(m===0)throw new Error("no bytes available");d.set(i.subarray(g,g+m)),this.word=new DataView(d.buffer).getUint32(0),this.bitsAvailable=m*8,this.bytesAvailable-=m},G.skipBits=function(i){var D;this.bitsAvailable>i?(this.word<<=i,this.bitsAvailable-=i):(i-=this.bitsAvailable,D=i>>3,i-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=i,this.bitsAvailable-=i)},G.readBits=function(i){var D=Math.min(this.bitsAvailable,i),g=this.word>>>32-D;return i>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=i-D,D>0&&this.bitsAvailable?g<<D|this.readBits(D):g},G.skipLZ=function(){var i;for(i=0;i<this.bitsAvailable;++i)if((this.word&2147483648>>>i)!==0)return this.word<<=i,this.bitsAvailable-=i,i;return this.loadWord(),i+this.skipLZ()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var i=this.skipLZ();return this.readBits(i+1)-1},G.readEG=function(){var i=this.readUEG();return 1&i?1+i>>>1:-1*(i>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(i){for(var D=8,g=8,d,m=0;m<i;m++)g!==0&&(d=this.readEG(),g=(D+d+256)%256),D=g===0?D:g},G.readSPS=function(){var i=0,D=0,g=0,d=0,m,u,a,f=this.readUByte.bind(this),l=this.readBits.bind(this),h=this.readUEG.bind(this),o=this.readBoolean.bind(this),s=this.skipBits.bind(this),A=this.skipEG.bind(this),_=this.skipUEG.bind(this),w=this.skipScalingList.bind(this);f();var L=f();if(l(5),s(3),f(),_(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var R=h();if(R===3&&s(1),_(),_(),s(1),o())for(u=R!==3?8:12,a=0;a<u;a++)o()&&(a<6?w(16):w(64))}_();var C=h();if(C===0)h();else if(C===1)for(s(1),A(),A(),m=h(),a=0;a<m;a++)A();_(),s(1);var S=h(),x=h(),p=l(1);p===0&&s(1),s(1),o()&&(i=h(),D=h(),g=h(),d=h());var T=[1,1];if(o()&&o()){var v=f();switch(v){case 1:T=[1,1];break;case 2:T=[12,11];break;case 3:T=[10,11];break;case 4:T=[16,11];break;case 5:T=[40,33];break;case 6:T=[24,11];break;case 7:T=[20,11];break;case 8:T=[32,11];break;case 9:T=[80,33];break;case 10:T=[18,11];break;case 11:T=[15,11];break;case 12:T=[64,33];break;case 13:T=[160,99];break;case 14:T=[4,3];break;case 15:T=[3,2];break;case 16:T=[2,1];break;case 255:{T=[f()<<8|f(),f()<<8|f()];break}}}return{width:Math.ceil((S+1)*16-i*2-D*2),height:(2-p)*(x+1)*16-(p?2:4)*(g+d),pixelRatio:T}},G.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},U}();$.default=N},"./src/demux/id3.ts":function(ne,$,k){"use strict";k.r($),k.d($,"isHeader",function(){return X}),k.d($,"isFooter",function(){return N}),k.d($,"getID3Data",function(){return U}),k.d($,"canParse",function(){return W}),k.d($,"getTimeStamp",function(){return i}),k.d($,"isTimeStampFrame",function(){return D}),k.d($,"getID3Frames",function(){return d}),k.d($,"decodeFrame",function(){return m}),k.d($,"utf8ArrayToStr",function(){return h}),k.d($,"testables",function(){return o});var X=function(w,L){return L+10<=w.length&&(w[L]===73&&w[L+1]===68&&w[L+2]===51&&(w[L+3]<255&&w[L+4]<255&&(w[L+6]<128&&w[L+7]<128&&w[L+8]<128&&w[L+9]<128)))},N=function(w,L){return L+10<=w.length&&(w[L]===51&&w[L+1]===68&&w[L+2]===73&&(w[L+3]<255&&w[L+4]<255&&(w[L+6]<128&&w[L+7]<128&&w[L+8]<128&&w[L+9]<128)))},U=function(w,L){for(var R=L,C=0;X(w,L);){C+=10;var S=G(w,L+6);C+=S,N(w,L+10)&&(C+=10),L+=C}return C>0?w.subarray(R,R+C):void 0},G=function(w,L){var R=0;return R=(w[L]&127)<<21,R|=(w[L+1]&127)<<14,R|=(w[L+2]&127)<<7,R|=w[L+3]&127,R},W=function(w,L){return X(w,L)&&G(w,L+6)+10<=w.length-L},i=function(w){for(var L=d(w),R=0;R<L.length;R++){var C=L[R];if(D(C))return l(C)}return},D=function(w){return w&&w.key==="PRIV"&&w.info==="com.apple.streaming.transportStreamTimestamp"},g=function(w){var L=String.fromCharCode(w[0],w[1],w[2],w[3]),R=G(w,4),C=10;return{type:L,size:R,data:w.subarray(C,C+R)}},d=function(w){for(var L=0,R=[];X(w,L);){var C=G(w,L+6);L+=10;for(var S=L+C;L+8<S;){var x=g(w.subarray(L)),p=m(x);p&&R.push(p),L+=x.size+10}N(w,L)&&(L+=10)}return R},m=function(w){return w.type==="PRIV"?u(w):w.type[0]==="W"?f(w):a(w)},u=function(w){if(w.size<2)return;var L=h(w.data,!0),R=new Uint8Array(w.data.subarray(L.length+1));return{key:w.type,info:L,data:R.buffer}},a=function(w){if(w.size<2)return;if(w.type==="TXXX"){var L=1,R=h(w.data.subarray(L),!0);L+=R.length+1;var C=h(w.data.subarray(L));return{key:w.type,info:R,data:C}}var S=h(w.data.subarray(1));return{key:w.type,data:S}},f=function(w){if(w.type==="WXXX"){if(w.size<2)return;var L=1,R=h(w.data.subarray(L),!0);L+=R.length+1;var C=h(w.data.subarray(L));return{key:w.type,info:R,data:C}}var S=h(w.data);return{key:w.type,data:S}},l=function(w){if(w.data.byteLength===8){var L=new Uint8Array(w.data),R=L[3]&1,C=(L[4]<<23)+(L[5]<<15)+(L[6]<<7)+L[7];return C/=45,R&&(C+=4772185884e-2),Math.round(C)}return},h=function(w,L){L===void 0&&(L=!1);var R=A();if(R){var C=R.decode(w);if(L){var S=C.indexOf("\0");return S!==-1?C.substring(0,S):C}return C.replace(/\0/g,"")}for(var x=w.length,p,T,v,y="",F=0;F<x;){if(p=w[F++],p===0&&L)return y;if(p===0||p===3)continue;switch(p>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:y+=String.fromCharCode(p);break;case 12:case 13:T=w[F++],y+=String.fromCharCode((p&31)<<6|T&63);break;case 14:T=w[F++],v=w[F++],y+=String.fromCharCode((p&15)<<12|(T&63)<<6|(v&63)<<0);break;default:}}return y},o={decodeTextFrame:a},s;function A(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/demux/base-audio-demuxer.ts"),N=k("./src/demux/id3.ts"),U=k("./src/utils/logger.ts"),G=k("./src/demux/mpegaudio.ts");function W(g,d){g.prototype=Object.create(d.prototype),g.prototype.constructor=g,i(g,d)}function i(g,d){return i=Object.setPrototypeOf||function(u,a){return u.__proto__=a,u},i(g,d)}var D=function(g){W(d,g);function d(){return g.apply(this,arguments)||this}var m=d.prototype;return m.resetInitSegment=function(a,f,l){g.prototype.resetInitSegment.call(this,a,f,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:l,inputTimeScale:9e4,dropped:0}},d.probe=function(a){if(!a)return!1;for(var f=N.getID3Data(a,0)||[],l=f.length,h=a.length;l<h;l++)if(G.probe(a,l))return U.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(a,f){return G.canParse(a,f)},m.appendFrame=function(a,f,l){return this.initPTS===null?void 0:G.appendFrame(a,f,l,this.initPTS,this.frameIndex)},d}(X.default);D.minProbeByteLength=4,$.default=D},"./src/demux/mp4demuxer.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/utils/mp4-tools.ts"),N=k("./src/demux/dummy-demuxed-track.ts"),U=function(){function G(i,D){this.remainderData=null,this.config=void 0,this.config=D}var W=G.prototype;return W.resetTimeStamp=function(){},W.resetInitSegment=function(){},W.resetContiguity=function(){},G.probe=function(D){return Object(X.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},W.demux=function(D){var g=D,d=Object(N.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(X.appendUint8Array)(this.remainderData,D));var m=Object(X.segmentValidRange)(g);this.remainderData=m.remainder,d.samples=m.valid||new Uint8Array}else d.samples=g;return{audioTrack:Object(N.dummyTrack)(),avcTrack:d,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},W.flush=function(){var D=Object(N.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(N.dummyTrack)(),avcTrack:D,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},W.demuxSampleAes=function(D,g,d){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},W.destroy=function(){},G}();U.minProbeByteLength=1024,$.default=U},"./src/demux/mpegaudio.ts":function(ne,$,k){"use strict";k.r($),k.d($,"appendFrame",function(){return i}),k.d($,"parseHeader",function(){return D}),k.d($,"isHeaderPattern",function(){return g}),k.d($,"isHeader",function(){return d}),k.d($,"canParse",function(){return m}),k.d($,"probe",function(){return u});var X=null,N=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],U=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],G=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],W=[0,1,1,4];function i(a,f,l,h,o){if(l+24>f.length)return;var s=D(f,l);if(s&&l+s.frameLength<=f.length){var A=s.samplesPerFrame*9e4/s.sampleRate,_=h+o*A,w={unit:f.subarray(l,l+s.frameLength),pts:_,dts:_};return a.config=[],a.channelCount=s.channelCount,a.samplerate=s.sampleRate,a.samples.push(w),{sample:w,length:s.frameLength,missing:0}}}function D(a,f){var l=a[f+1]>>3&3,h=a[f+1]>>1&3,o=a[f+2]>>4&15,s=a[f+2]>>2&3;if(l!==1&&o!==0&&o!==15&&s!==3){var A=a[f+2]>>1&1,_=a[f+3]>>6,w=l===3?3-h:h===3?3:4,L=N[w*14+o-1]*1e3,R=l===3?0:l===2?1:2,C=U[R*3+s],S=_===3?1:2,x=G[l][h],p=W[h],T=x*8*p,v=Math.floor(x*L/C+A)*p;if(X===null){var y=navigator.userAgent||"",F=y.match(/Chrome\/(\d+)/i);X=F?parseInt(F[1]):0}var B=!!X&&X<=87;return B&&h===2&&L>=224e3&&_===0&&(a[f+3]=a[f+3]|128),{sampleRate:C,channelCount:S,frameLength:v,samplesPerFrame:T}}}function g(a,f){return a[f]===255&&(a[f+1]&224)===224&&(a[f+1]&6)!==0}function d(a,f){return f+1<a.length&&g(a,f)}function m(a,f){var l=4;return g(a,f)&&l<=a.length-f}function u(a,f){if(f+1<a.length&&g(a,f)){var l=4,h=D(a,f),o=l;h!=null&&h.frameLength&&(o=h.frameLength);var s=f+o;return s===a.length||d(a,s)}return!1}},"./src/demux/sample-aes.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/crypt/decrypter.ts"),N=k("./src/demux/tsdemuxer.ts"),U=function(){function G(i,D,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new X.default(i,D,{removePKCS7Padding:!1})}var W=G.prototype;return W.decryptBuffer=function(D,g){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,g)},W.decryptAacSample=function(D,g,d,m){var u=D[g].unit,a=u.subarray(16,u.length-u.length%16),f=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),l=this;this.decryptBuffer(f,function(h){var o=new Uint8Array(h);u.set(o,16),m||l.decryptAacSamples(D,g+1,d)})},W.decryptAacSamples=function(D,g,d){for(;;g++){if(g>=D.length){d();return}if(D[g].unit.length<32)continue;var m=this.decrypter.isSync();if(this.decryptAacSample(D,g,d,m),!m)return}},W.getAvcEncryptedData=function(D){for(var g=Math.floor((D.length-48)/160)*16+16,d=new Int8Array(g),m=0,u=32;u<=D.length-16;u+=160,m+=16)d.set(D.subarray(u,u+16),m);return d},W.getAvcDecryptedUnit=function(D,g){for(var d=new Uint8Array(g),m=0,u=32;u<=D.length-16;u+=160,m+=16)D.set(d.subarray(m,m+16),u);return D},W.decryptAvcSample=function(D,g,d,m,u,a){var f=Object(N.discardEPB)(u.data),l=this.getAvcEncryptedData(f),h=this;this.decryptBuffer(l.buffer,function(o){u.data=h.getAvcDecryptedUnit(f,o),a||h.decryptAvcSamples(D,g,d+1,m)})},W.decryptAvcSamples=function(D,g,d,m){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,d=0){if(g>=D.length){m();return}for(var u=D[g].units;!(d>=u.length);d++){var a=u[d];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(D,g,d,m,a,f),!f)return}}},G}();$.default=U},"./src/demux/transmuxer-interface.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return u});var X=k("./node_modules/webworkify-webpack/index.js"),N=k.n(X),U=k("./src/events.ts"),G=k("./src/demux/transmuxer.ts"),W=k("./src/utils/logger.ts"),i=k("./src/errors.ts"),D=k("./src/utils/mediasource-helper.ts"),g=k("./node_modules/eventemitter3/index.js"),d=k.n(g),m=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function a(l,h,o,s){var A=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=l,this.id=h,this.onTransmuxComplete=o,this.onFlush=s;var _=l.config,w=function(x,p){p=p||{},p.frag=A.frag,p.id=A.id,l.trigger(x,p)};this.observer=new g.EventEmitter,this.observer.on(U.Events.FRAG_DECRYPTED,w),this.observer.on(U.Events.ERROR,w);var L={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},R=navigator.vendor;if(_.enableWorker&&typeof Worker!="undefined"){W.logger.log("demuxing in webworker");var C;try{C=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),C.addEventListener("message",this.onwmsg),C.onerror=function(S){l.trigger(U.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(S.message+" ("+S.filename+":"+S.lineno+")")})},C.postMessage({cmd:"init",typeSupported:L,vendor:R,id:h,config:JSON.stringify(_)})}catch(S){W.logger.warn("Error in worker:",S),W.logger.error("Error while initializing DemuxerWorker, fallback to inline"),C&&self.URL.revokeObjectURL(C.objectURL),this.transmuxer=new G.default(this.observer,L,_,R,h),this.worker=null}}else this.transmuxer=new G.default(this.observer,L,_,R,h)}var f=a.prototype;return f.destroy=function(){var h=this.worker;if(h)h.removeEventListener("message",this.onwmsg),h.terminate(),this.worker=null;else{var o=this.transmuxer;o&&(o.destroy(),this.transmuxer=null)}var s=this.observer;s&&s.removeAllListeners(),this.observer=null},f.push=function(h,o,s,A,_,w,L,R,C,S){var x=this;C.transmuxing.start=self.performance.now();var p=this.transmuxer,T=this.worker,v=w?w.start:_.start,y=_.decryptdata,F=this.frag,B=!(F&&_.cc===F.cc),O=!(F&&C.level===F.level),j=F?C.sn-F.sn:-1,P=this.part?C.part-this.part.index:1,b=!O&&(j===1||j===0&&P===1),Y=self.performance.now();(O||j||_.stats.parsing.start===0)&&(_.stats.parsing.start=Y),w&&(P||!b)&&(w.stats.parsing.start=Y);var ee=new G.TransmuxState(B,b,R,O,v);if(!b||B){W.logger.log("[transmuxer-interface, "+_.type+"]: Starting new transmux session for sn: "+C.sn+" p: "+C.part+" level: "+C.level+" id: "+C.id+`
|
|
discontinuity: `+B+`
|
|
trackSwitch: `+O+`
|
|
contiguous: `+b+`
|
|
accurateTimeOffset: `+R+`
|
|
timeOffset: `+v);var ae=new G.TransmuxConfig(s,A,o,L,S);this.configureTransmuxer(ae)}if(this.frag=_,this.part=w,T)T.postMessage({cmd:"demux",data:h,decryptdata:y,chunkMeta:C,state:ee},h instanceof ArrayBuffer?[h]:[]);else if(p){var le=p.push(h,y,C,ee);Object(G.isPromise)(le)?le.then(function(Re){x.handleTransmuxComplete(Re)}):this.handleTransmuxComplete(le)}},f.flush=function(h){var o=this;h.transmuxing.start=self.performance.now();var s=this.transmuxer,A=this.worker;if(A)A.postMessage({cmd:"flush",chunkMeta:h});else if(s){var _=s.flush(h);Object(G.isPromise)(_)?_.then(function(w){o.handleFlushResult(w,h)}):this.handleFlushResult(_,h)}},f.handleFlushResult=function(h,o){var s=this;h.forEach(function(A){s.handleTransmuxComplete(A)}),this.onFlush(o)},f.onWorkerMessage=function(h){var o=h.data,s=this.hls;switch(o.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(o.data);break}case"flush":{this.onFlush(o.data);break}default:{o.data=o.data||{},o.data.frag=this.frag,o.data.id=this.id,s.trigger(o.event,o.data);break}}},f.configureTransmuxer=function(h){var o=this.worker,s=this.transmuxer;o?o.postMessage({cmd:"configure",config:h}):s&&s.configure(h)},f.handleTransmuxComplete=function(h){h.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(h)},a}()},"./src/demux/transmuxer-worker.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return i});var X=k("./src/demux/transmuxer.ts"),N=k("./src/events.ts"),U=k("./src/utils/logger.ts"),G=k("./node_modules/eventemitter3/index.js"),W=k.n(G);function i(u){var a=new G.EventEmitter,f=function(h,o){u.postMessage({event:h,data:o})};a.on(N.Events.FRAG_DECRYPTED,f),a.on(N.Events.ERROR,f),u.addEventListener("message",function(l){var h=l.data;switch(h.cmd){case"init":{var o=JSON.parse(h.config);u.transmuxer=new X.default(a,h.typeSupported,o,h.vendor,h.id),Object(U.enableLogs)(o.debug),f("init",null);break}case"configure":{u.transmuxer.configure(h.config);break}case"demux":{var s=u.transmuxer.push(h.data,h.decryptdata,h.chunkMeta,h.state);Object(X.isPromise)(s)?s.then(function(w){D(u,w)}):D(u,s);break}case"flush":{var A=h.chunkMeta,_=u.transmuxer.flush(A);Object(X.isPromise)(_)?_.then(function(w){d(u,w,A)}):d(u,_,A);break}default:break}})}function D(u,a){if(m(a.remuxResult))return;var f=[],l=a.remuxResult,h=l.audio,o=l.video;h&&g(f,h),o&&g(f,o),u.postMessage({event:"transmuxComplete",data:a},f)}function g(u,a){a.data1&&u.push(a.data1.buffer),a.data2&&u.push(a.data2.buffer)}function d(u,a,f){a.forEach(function(l){D(u,l)}),u.postMessage({event:"flush",data:f})}function m(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return o}),k.d($,"isPromise",function(){return _}),k.d($,"TransmuxConfig",function(){return w}),k.d($,"TransmuxState",function(){return L});var X=k("./src/events.ts"),N=k("./src/errors.ts"),U=k("./src/crypt/decrypter.ts"),G=k("./src/demux/aacdemuxer.ts"),W=k("./src/demux/mp4demuxer.ts"),i=k("./src/demux/tsdemuxer.ts"),D=k("./src/demux/mp3demuxer.ts"),g=k("./src/remux/mp4-remuxer.ts"),d=k("./src/remux/passthrough-remuxer.ts"),m=k("./src/demux/chunk-cache.ts"),u=k("./src/utils/mp4-tools.ts"),a=k("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(R){a.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var l=[{demux:i.default,remux:g.default},{demux:W.default,remux:d.default},{demux:G.default,remux:g.default},{demux:D.default,remux:g.default}],h=1024;l.forEach(function(R){var C=R.demux;h=Math.max(h,C.minProbeByteLength)});var o=function(){function R(S,x,p,T,v){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new m.default,this.observer=S,this.typeSupported=x,this.config=p,this.vendor=T,this.id=v}var C=R.prototype;return C.configure=function(x){this.transmuxConfig=x,this.decrypter&&this.decrypter.reset()},C.push=function(x,p,T,v){var y=this,F=T.transmuxing;F.executeStart=f();var B=new Uint8Array(x),O=this.cache,j=this.config,P=this.currentTransmuxState,b=this.transmuxConfig;v&&(this.currentTransmuxState=v);var Y=s(B,p);if(Y&&Y.method==="AES-128"){var ee=this.getDecrypter();if(j.enableSoftwareAES){var ae=ee.softwareDecrypt(B,Y.key.buffer,Y.iv.buffer);if(!ae)return F.executeEnd=f(),A(T);B=new Uint8Array(ae)}else return this.decryptionPromise=ee.webCryptoDecrypt(B,Y.key.buffer,Y.iv.buffer).then(function(Me){var Ge=y.push(Me,null,T);return y.decryptionPromise=null,Ge}),this.decryptionPromise}var le=v||P,Re=le.contiguous,Ee=le.discontinuity,Te=le.trackSwitch,Ae=le.accurateTimeOffset,Oe=le.timeOffset,ce=b.audioCodec,ue=b.videoCodec,Pe=b.defaultInitPts,qe=b.duration,ze=b.initSegmentData;if((Ee||Te)&&this.resetInitSegment(ze,ce,ue,qe),Ee&&this.resetInitialTimestamp(Pe),Re||this.resetContiguity(),this.needsProbing(B,Ee,Te)){if(O.dataLength){var et=O.flush();B=Object(u.appendUint8Array)(et,B)}this.configureTransmuxer(B,b)}var nt=this.transmux(B,Y,Oe,Ae,T),Ie=this.currentTransmuxState;return Ie.contiguous=!0,Ie.discontinuity=!1,Ie.trackSwitch=!1,F.executeEnd=f(),nt},C.flush=function(x){var p=this,T=x.transmuxing;T.executeStart=f();var v=this.decrypter,y=this.cache,F=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return p.flush(x)});var O=[],j=F.timeOffset;if(v){var P=v.flush();P&&O.push(this.push(P,null,x))}var b=y.dataLength;y.reset();var Y=this.demuxer,ee=this.remuxer;if(!Y||!ee)return b>=h&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),T.executeEnd=f(),[A(x)];var ae=Y.flush(j);return _(ae)?ae.then(function(le){return p.flushRemux(O,le,x),O}):(this.flushRemux(O,ae,x),O)},C.flushRemux=function(x,p,T){var v=p.audioTrack,y=p.avcTrack,F=p.id3Track,B=p.textTrack,O=this.currentTransmuxState,j=O.accurateTimeOffset,P=O.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+T.sn+(T.part>-1?" p: "+T.part:"")+" of level "+T.level);var b=this.remuxer.remux(v,y,F,B,P,j,!0,this.id);x.push({remuxResult:b,chunkMeta:T}),T.transmuxing.executeEnd=f()},C.resetInitialTimestamp=function(x){var p=this.demuxer,T=this.remuxer;if(!p||!T)return;p.resetTimeStamp(x),T.resetTimeStamp(x)},C.resetContiguity=function(){var x=this.demuxer,p=this.remuxer;if(!x||!p)return;x.resetContiguity(),p.resetNextTimestamp()},C.resetInitSegment=function(x,p,T,v){var y=this.demuxer,F=this.remuxer;if(!y||!F)return;y.resetInitSegment(p,T,v),F.resetInitSegment(x,p,T)},C.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},C.transmux=function(x,p,T,v,y){var F;return p&&p.method==="SAMPLE-AES"?F=this.transmuxSampleAes(x,p,T,v,y):F=this.transmuxUnencrypted(x,T,v,y),F},C.transmuxUnencrypted=function(x,p,T,v){var y=this.demuxer.demux(x,p,!1,!this.config.progressive),F=y.audioTrack,B=y.avcTrack,O=y.id3Track,j=y.textTrack,P=this.remuxer.remux(F,B,O,j,p,T,!1,this.id);return{remuxResult:P,chunkMeta:v}},C.transmuxSampleAes=function(x,p,T,v,y){var F=this;return this.demuxer.demuxSampleAes(x,p,T).then(function(B){var O=F.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,T,v,!1,F.id);return{remuxResult:O,chunkMeta:y}})},C.configureTransmuxer=function(x,p){for(var T=this.config,v=this.observer,y=this.typeSupported,F=this.vendor,B=p.audioCodec,O=p.defaultInitPts,j=p.duration,P=p.initSegmentData,b=p.videoCodec,Y,ee=0,ae=l.length;ee<ae;ee++)if(l[ee].demux.probe(x)){Y=l[ee];break}Y||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),Y={demux:W.default,remux:d.default});var le=this.demuxer,Re=this.remuxer,Ee=Y.remux,Te=Y.demux;(!Re||!(Re instanceof Ee))&&(this.remuxer=new Ee(v,T,y,F)),(!le||!(le instanceof Te))&&(this.demuxer=new Te(v,T,y),this.probe=Te.probe),this.resetInitSegment(P,B,b,j),this.resetInitialTimestamp(O)},C.needsProbing=function(x,p,T){return!this.demuxer||!this.remuxer||p||T},C.getDecrypter=function(){var x=this.decrypter;return x||(x=this.decrypter=new U.default(this.observer,this.config)),x},R}();function s(R,C){var S=null;return R.byteLength>0&&C!=null&&C.key!=null&&C.iv!==null&&C.method!=null&&(S=C),S}var A=function(C){return{remuxResult:{},chunkMeta:C}};function _(R){return"then"in R&&R.then instanceof Function}var w=function(C,S,x,p,T){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=C,this.videoCodec=S,this.initSegmentData=x,this.duration=p,this.defaultInitPts=T},L=function(C,S,x,p,T){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=C,this.contiguous=S,this.accurateTimeOffset=x,this.trackSwitch=p,this.timeOffset=T}},"./src/demux/tsdemuxer.ts":function(ne,$,k){"use strict";k.r($),k.d($,"discardEPB",function(){return A});var X=k("./src/demux/adts.ts"),N=k("./src/demux/mpegaudio.ts"),U=k("./src/demux/exp-golomb.ts"),G=k("./src/demux/id3.ts"),W=k("./src/demux/sample-aes.ts"),i=k("./src/events.ts"),D=k("./src/utils/mp4-tools.ts"),g=k("./src/utils/logger.ts"),d=k("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},u=function(){function _(L,R,C){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=L,this.config=R,this.typeSupported=C}_.probe=function(R){var C=_.syncOffset(R);return C<0?!1:(C&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+C+", junk ahead ?"),!0)},_.syncOffset=function(R){for(var C=Math.min(1e3,R.length-3*188),S=0;S<C;){if(R[S]===71&&R[S+188]===71&&R[S+2*188]===71)return S;S++}return-1},_.createTrack=function(R,C){return{container:R==="video"||R==="audio"?"video/mp2t":void 0,type:R,id:m[R],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:R==="audio"?C:void 0}};var w=_.prototype;return w.resetInitSegment=function(R,C,S){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=_.createTrack("video",S),this._audioTrack=_.createTrack("audio",S),this._id3Track=_.createTrack("id3",S),this._txtTrack=_.createTrack("text",S),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=R,this.videoCodec=C,this._duration=S},w.resetTimeStamp=function(){},w.resetContiguity=function(){var R=this._audioTrack,C=this._avcTrack,S=this._id3Track;R&&(R.pesData=null),C&&(C.pesData=null),S&&(S.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},w.demux=function(R,C,S,x){S===void 0&&(S=!1),x===void 0&&(x=!1),S||(this.sampleAes=null);var p,T=this._avcTrack,v=this._audioTrack,y=this._id3Track,F=T.pid,B=T.pesData,O=v.pid,j=y.pid,P=v.pesData,b=y.pesData,Y=!1,ee=this.pmtParsed,ae=this._pmtId,le=R.length;if(this.remainderData&&(R=Object(D.appendUint8Array)(this.remainderData,R),le=R.length,this.remainderData=null),le<188&&!x)return this.remainderData=R,{audioTrack:v,avcTrack:T,id3Track:y,textTrack:this._txtTrack};var Re=Math.max(0,_.syncOffset(R));le-=(le+Re)%188,le<R.byteLength&&!x&&(this.remainderData=new Uint8Array(R.buffer,le,R.buffer.byteLength-le));for(var Ee=Re;Ee<le;Ee+=188)if(R[Ee]===71){var Te=!!(R[Ee+1]&64),Ae=((R[Ee+1]&31)<<8)+R[Ee+2],Oe=(R[Ee+3]&48)>>4,ce=void 0;if(Oe>1){if(ce=Ee+5+R[Ee+4],ce===Ee+188)continue}else ce=Ee+4;switch(Ae){case F:Te&&(B&&(p=h(B))&&this.parseAVCPES(p,!1),B={data:[],size:0}),B&&(B.data.push(R.subarray(ce,Ee+188)),B.size+=Ee+188-ce);break;case O:Te&&(P&&(p=h(P))&&(v.isAAC?this.parseAACPES(p):this.parseMPEGPES(p)),P={data:[],size:0}),P&&(P.data.push(R.subarray(ce,Ee+188)),P.size+=Ee+188-ce);break;case j:Te&&(b&&(p=h(b))&&this.parseID3PES(p),b={data:[],size:0}),b&&(b.data.push(R.subarray(ce,Ee+188)),b.size+=Ee+188-ce);break;case 0:Te&&(ce+=R[ce]+1),ae=this._pmtId=f(R,ce);break;case ae:{Te&&(ce+=R[ce]+1);var ue=l(R,ce,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,S);F=ue.avc,F>0&&(T.pid=F),O=ue.audio,O>0&&(v.pid=O,v.isAAC=ue.isAAC),j=ue.id3,j>0&&(y.pid=j),Y&&!ee&&(g.logger.log("reparse from beginning"),Y=!1,Ee=Re-188),ee=this.pmtParsed=!0;break}case 17:case 8191:break;default:Y=!0;break}}else this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T.pesData=B,v.pesData=P,y.pesData=b;var Pe={audioTrack:v,avcTrack:T,id3Track:y,textTrack:this._txtTrack};return x&&this.extractRemainingSamples(Pe),Pe},w.flush=function(){var R=this.remainderData;this.remainderData=null;var C;return R?C=this.demux(R,-1,!1,!0):C={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(C),this.sampleAes?this.decrypt(C,this.sampleAes):C},w.extractRemainingSamples=function(R){var C=R.audioTrack,S=R.avcTrack,x=R.id3Track,p=S.pesData,T=C.pesData,v=x.pesData,y;p&&(y=h(p))?(this.parseAVCPES(y,!0),S.pesData=null):S.pesData=p,T&&(y=h(T))?(C.isAAC?this.parseAACPES(y):this.parseMPEGPES(y),C.pesData=null):(T!=null&&T.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),C.pesData=T),v&&(y=h(v))?(this.parseID3PES(y),x.pesData=null):x.pesData=v},w.demuxSampleAes=function(R,C,S){var x=this.demux(R,S,!0,!this.config.progressive),p=this.sampleAes=new W.default(this.observer,this.config,C);return this.decrypt(x,p)},w.decrypt=function(R,C){return new Promise(function(S){var x=R.audioTrack,p=R.avcTrack;x.samples&&x.isAAC?C.decryptAacSamples(x.samples,0,function(){p.samples?C.decryptAvcSamples(p.samples,0,0,function(){S(R)}):S(R)}):p.samples&&C.decryptAvcSamples(p.samples,0,0,function(){S(R)})})},w.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},w.parseAVCPES=function(R,C){var S=this,x=this._avcTrack,p=this.parseAVCNALu(R.data),T=!1,v=this.avcSample,y,F=!1;R.data=null,v&&p.length&&!x.audFound&&(o(v,x),v=this.avcSample=a(!1,R.pts,R.dts,"")),p.forEach(function(B){switch(B.type){case 1:{y=!0,v||(v=S.avcSample=a(!0,R.pts,R.dts,"")),T&&(v.debug+="NDR "),v.frame=!0;var O=B.data;if(F&&O.length>4){var j=new U.default(O).readSliceType();(j===2||j===4||j===7||j===9)&&(v.key=!0)}break}case 5:y=!0,v||(v=S.avcSample=a(!0,R.pts,R.dts,"")),T&&(v.debug+="IDR "),v.key=!0,v.frame=!0;break;case 6:{y=!0,T&&v&&(v.debug+="SEI ");var P=new U.default(A(B.data));P.readUByte();for(var b=0,Y=0,ee=!1,ae=0;!ee&&P.bytesAvailable>1;){b=0;do ae=P.readUByte(),b+=ae;while(ae===255);Y=0;do ae=P.readUByte(),Y+=ae;while(ae===255);if(b===4&&P.bytesAvailable!==0){ee=!0;var le=P.readUByte();if(le===181){var Re=P.readUShort();if(Re===49){var Ee=P.readUInt();if(Ee===1195456820){var Te=P.readUByte();if(Te===3){for(var Ae=P.readUByte(),Oe=P.readUByte(),ce=31&Ae,ue=[Ae,Oe],Pe=0;Pe<ce;Pe++)ue.push(P.readUByte()),ue.push(P.readUByte()),ue.push(P.readUByte());s(S._txtTrack.samples,{type:3,pts:R.pts,bytes:ue})}}}}}else if(b===5&&P.bytesAvailable!==0){if(ee=!0,Y>16){for(var qe=[],ze=0;ze<16;ze++)qe.push(P.readUByte().toString(16)),(ze===3||ze===5||ze===7||ze===9)&&qe.push("-");for(var et=Y-16,nt=new Uint8Array(et),Ie=0;Ie<et;Ie++)nt[Ie]=P.readUByte();s(S._txtTrack.samples,{pts:R.pts,payloadType:b,uuid:qe.join(""),userData:Object(G.utf8ArrayToStr)(nt),userDataBytes:nt})}}else if(Y<P.bytesAvailable)for(var Me=0;Me<Y;Me++)P.readUByte()}break}case 7:if(y=!0,F=!0,T&&v&&(v.debug+="SPS "),!x.sps){var Ge=new U.default(B.data),se=Ge.readSPS();x.width=se.width,x.height=se.height,x.pixelRatio=se.pixelRatio,x.sps=[B.data],x.duration=S._duration;for(var be=B.data.subarray(1,4),xe="avc1.",Se=0;Se<3;Se++){var Be=be[Se].toString(16);Be.length<2&&(Be="0"+Be),xe+=Be}x.codec=xe}break;case 8:y=!0,T&&v&&(v.debug+="PPS "),x.pps||(x.pps=[B.data]);break;case 9:y=!1,x.audFound=!0,v&&o(v,x),v=S.avcSample=a(!1,R.pts,R.dts,T?"AUD ":"");break;case 12:y=!1;break;default:y=!1,v&&(v.debug+="unknown NAL "+B.type+" ");break}if(v&&y){var He=v.units;He.push(B)}}),C&&v&&(o(v,x),this.avcSample=null)},w.getLastNalUnit=function(){var R,C=this.avcSample,S;if(!C||C.units.length===0){var x=this._avcTrack.samples;C=x[x.length-1]}if((R=C)!==null&&R!==void 0&&R.units){var p=C.units;S=p[p.length-1]}return S},w.parseAVCNALu=function(R){var C=R.byteLength,S=this._avcTrack,x=S.naluState||0,p=x,T=[],v=0,y,F,B,O=-1,j=0;for(x===-1&&(O=0,j=R[0]&31,x=0,v=1);v<C;){if(y=R[v++],!x){x=y?0:1;continue}if(x===1){x=y?0:2;continue}if(!y)x=3;else if(y===1){if(O>=0){var P={data:R.subarray(O,v-x-1),type:j};T.push(P)}else{var b=this.getLastNalUnit();if(b&&(p&&v<=4-p&&(b.state&&(b.data=b.data.subarray(0,b.data.byteLength-p))),F=v-x-1,F>0)){var Y=new Uint8Array(b.data.byteLength+F);Y.set(b.data,0),Y.set(R.subarray(0,F),b.data.byteLength),b.data=Y,b.state=0}}v<C?(B=R[v]&31,O=v,j=B,x=0):x=-1}else x=0}if(O>=0&&x>=0){var ee={data:R.subarray(O,C),type:j,state:x};T.push(ee)}if(T.length===0){var ae=this.getLastNalUnit();if(ae){var le=new Uint8Array(ae.data.byteLength+R.byteLength);le.set(ae.data,0),le.set(R,ae.data.byteLength),ae.data=le}}return S.naluState=x,T},w.parseAACPES=function(R){var C=0,S=this._audioTrack,x=this.aacOverFlow,p=R.data;if(x){this.aacOverFlow=null;var T=x.sample.unit.byteLength,v=Math.min(x.missing,T),y=T-v;x.sample.unit.set(p.subarray(0,v),y),S.samples.push(x.sample),C=x.missing}var F,B;for(F=C,B=p.length;F<B-1&&!X.isHeader(p,F);F++);if(F!==C){var O,j;if(F<B-1?(O="AAC PES did not start with ADTS header,offset:"+F,j=!1):(O="no ADTS header found in AAC PES",j=!0),g.logger.warn("parsing error:"+O),this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:j,reason:O}),j)return}X.initTrackConfig(S,this.observer,p,F,this.audioCodec);var P;if(R.pts!==void 0)P=R.pts;else if(x){var b=X.getFrameDuration(S.samplerate);P=x.sample.pts+b}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var Y=0;F<B;)if(X.isHeader(p,F)){if(F+5<B){var ee=X.appendFrame(S,p,F,P,Y);if(ee)if(ee.missing)this.aacOverFlow=ee;else{F+=ee.length,Y++;continue}}break}else F++},w.parseMPEGPES=function(R){var C=R.data,S=C.length,x=0,p=0,T=R.pts;if(T===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;p<S;)if(N.isHeader(C,p)){var v=N.appendFrame(this._audioTrack,C,p,T,x);if(v)p+=v.length,x++;else break}else p++},w.parseID3PES=function(R){if(R.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(R)},_}();u.minProbeByteLength=188;function a(_,w,L,R){return{key:_,frame:!1,pts:w,dts:L,units:[],debug:R,length:0}}function f(_,w){return(_[w+10]&31)<<8|_[w+11]}function l(_,w,L,R){var C={audio:-1,avc:-1,id3:-1,isAAC:!0},S=(_[w+1]&15)<<8|_[w+2],x=w+3+S-4,p=(_[w+10]&15)<<8|_[w+11];for(w+=12+p;w<x;){var T=(_[w+1]&31)<<8|_[w+2];switch(_[w]){case 207:if(!R){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:C.audio===-1&&(C.audio=T);break;case 21:C.id3===-1&&(C.id3=T);break;case 219:if(!R){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:C.avc===-1&&(C.avc=T);break;case 3:case 4:L?C.audio===-1&&(C.audio=T,C.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}w+=((_[w+3]&15)<<8|_[w+4])+5}return C}function h(_){var w=0,L,R,C,S,x,p=_.data;if(!_||_.size===0)return null;for(;p[0].length<19&&p.length>1;){var T=new Uint8Array(p[0].length+p[1].length);T.set(p[0]),T.set(p[1],p[0].length),p[0]=T,p.splice(1,1)}L=p[0];var v=(L[0]<<16)+(L[1]<<8)+L[2];if(v===1){if(R=(L[4]<<8)+L[5],R&&R>_.size-6)return null;var y=L[7];y&192&&(S=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,y&64?(x=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,S-x>60*9e4&&(g.logger.warn(Math.round((S-x)/9e4)+"s delta between PTS and DTS, align them"),S=x)):x=S),C=L[8];var F=C+9;if(_.size<=F)return null;_.size-=F;for(var B=new Uint8Array(_.size),O=0,j=p.length;O<j;O++){L=p[O];var P=L.byteLength;if(F)if(F>P){F-=P;continue}else L=L.subarray(F),P-=F,F=0;B.set(L,w),w+=P}return R&&(R-=C+3),{data:B,pts:S,dts:x,len:R}}return null}function o(_,w){if(_.units.length&&_.frame){if(_.pts===void 0){var L=w.samples,R=L.length;if(R){var C=L[R-1];_.pts=C.pts,_.dts=C.dts}else{w.dropped++;return}}w.samples.push(_)}_.debug.length&&g.logger.log(_.pts+"/"+_.dts+":"+_.debug)}function s(_,w){var L=_.length;if(L>0){if(w.pts>=_[L-1].pts)_.push(w);else for(var R=L-1;R>=0;R--)if(w.pts<_[R].pts){_.splice(R,0,w);break}}else _.push(w)}function A(_){for(var w=_.byteLength,L=[],R=1;R<w-2;)_[R]===0&&_[R+1]===0&&_[R+2]===3?(L.push(R+2),R+=2):R++;if(L.length===0)return _;var C=w-L.length,S=new Uint8Array(C),x=0;for(R=0;R<C;x++,R++)x===L[0]&&(x++,L.shift()),S[R]=_[x];return S}$.default=u},"./src/errors.ts":function(ne,$,k){"use strict";k.r($),k.d($,"ErrorTypes",function(){return X}),k.d($,"ErrorDetails",function(){return N});var X;(function(U){U.NETWORK_ERROR="networkError",U.MEDIA_ERROR="mediaError",U.KEY_SYSTEM_ERROR="keySystemError",U.MUX_ERROR="muxError",U.OTHER_ERROR="otherError"})(X||(X={}));var N;(function(U){U.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",U.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",U.KEY_SYSTEM_NO_SESSION="keySystemNoSession",U.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",U.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",U.MANIFEST_LOAD_ERROR="manifestLoadError",U.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",U.MANIFEST_PARSING_ERROR="manifestParsingError",U.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",U.LEVEL_EMPTY_ERROR="levelEmptyError",U.LEVEL_LOAD_ERROR="levelLoadError",U.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",U.LEVEL_SWITCH_ERROR="levelSwitchError",U.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",U.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",U.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",U.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",U.FRAG_LOAD_ERROR="fragLoadError",U.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",U.FRAG_DECRYPT_ERROR="fragDecryptError",U.FRAG_PARSING_ERROR="fragParsingError",U.REMUX_ALLOC_ERROR="remuxAllocError",U.KEY_LOAD_ERROR="keyLoadError",U.KEY_LOAD_TIMEOUT="keyLoadTimeOut",U.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",U.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",U.BUFFER_APPEND_ERROR="bufferAppendError",U.BUFFER_APPENDING_ERROR="bufferAppendingError",U.BUFFER_STALLED_ERROR="bufferStalledError",U.BUFFER_FULL_ERROR="bufferFullError",U.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",U.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",U.INTERNAL_EXCEPTION="internalException",U.INTERNAL_ABORTED="aborted",U.UNKNOWN="unknown"})(N||(N={}))},"./src/events.ts":function(ne,$,k){"use strict";k.r($),k.d($,"Events",function(){return X});var X;(function(N){N.MEDIA_ATTACHING="hlsMediaAttaching",N.MEDIA_ATTACHED="hlsMediaAttached",N.MEDIA_DETACHING="hlsMediaDetaching",N.MEDIA_DETACHED="hlsMediaDetached",N.BUFFER_RESET="hlsBufferReset",N.BUFFER_CODECS="hlsBufferCodecs",N.BUFFER_CREATED="hlsBufferCreated",N.BUFFER_APPENDING="hlsBufferAppending",N.BUFFER_APPENDED="hlsBufferAppended",N.BUFFER_EOS="hlsBufferEos",N.BUFFER_FLUSHING="hlsBufferFlushing",N.BUFFER_FLUSHED="hlsBufferFlushed",N.MANIFEST_LOADING="hlsManifestLoading",N.MANIFEST_LOADED="hlsManifestLoaded",N.MANIFEST_PARSED="hlsManifestParsed",N.LEVEL_SWITCHING="hlsLevelSwitching",N.LEVEL_SWITCHED="hlsLevelSwitched",N.LEVEL_LOADING="hlsLevelLoading",N.LEVEL_LOADED="hlsLevelLoaded",N.LEVEL_UPDATED="hlsLevelUpdated",N.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",N.LEVELS_UPDATED="hlsLevelsUpdated",N.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",N.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",N.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",N.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",N.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",N.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",N.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",N.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",N.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",N.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",N.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",N.CUES_PARSED="hlsCuesParsed",N.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",N.INIT_PTS_FOUND="hlsInitPtsFound",N.FRAG_LOADING="hlsFragLoading",N.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",N.FRAG_LOADED="hlsFragLoaded",N.FRAG_DECRYPTED="hlsFragDecrypted",N.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",N.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",N.FRAG_PARSING_METADATA="hlsFragParsingMetadata",N.FRAG_PARSED="hlsFragParsed",N.FRAG_BUFFERED="hlsFragBuffered",N.FRAG_CHANGED="hlsFragChanged",N.FPS_DROP="hlsFpsDrop",N.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",N.ERROR="hlsError",N.DESTROYING="hlsDestroying",N.KEY_LOADING="hlsKeyLoading",N.KEY_LOADED="hlsKeyLoaded",N.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",N.BACK_BUFFER_REACHED="hlsBackBufferReached"})(X||(X={}))},"./src/hls.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return _});var X=k("./node_modules/url-toolkit/src/url-toolkit.js"),N=k.n(X),U=k("./src/loader/playlist-loader.ts"),G=k("./src/loader/key-loader.ts"),W=k("./src/controller/id3-track-controller.ts"),i=k("./src/controller/latency-controller.ts"),D=k("./src/controller/level-controller.ts"),g=k("./src/controller/fragment-tracker.ts"),d=k("./src/controller/stream-controller.ts"),m=k("./src/is-supported.ts"),u=k("./src/utils/logger.ts"),a=k("./src/config.ts"),f=k("./node_modules/eventemitter3/index.js"),l=k.n(f),h=k("./src/events.ts"),o=k("./src/errors.ts");function s(w,L){for(var R=0;R<L.length;R++){var C=L[R];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(w,C.key,C)}}function A(w,L,R){return L&&s(w.prototype,L),R&&s(w,R),w}var _=function(){w.isSupported=function(){return Object(m.isSupported)()};function w(R){R===void 0&&(R={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new f.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var C=this.config=Object(a.mergeConfig)(w.DefaultConfig,R);this.userConfig=R,Object(u.enableLogs)(C.debug),this._autoLevelCapping=-1,C.progressive&&Object(a.enableStreamingMode)(C);var S=C.abrController,x=C.bufferController,p=C.capLevelController,T=C.fpsController,v=this.abrController=new S(this),y=this.bufferController=new x(this),F=this.capLevelController=new p(this),B=new T(this),O=new U.default(this),j=new G.default(this),P=new W.default(this),b=this.levelController=new D.default(this),Y=new g.FragmentTracker(this),ee=this.streamController=new d.default(this,Y);F.setStreamController(ee),B.setStreamController(ee);var ae=[b,ee];this.networkControllers=ae;var le=[O,j,v,y,F,B,P,Y];this.audioTrackController=this.createController(C.audioTrackController,null,ae),this.createController(C.audioStreamController,Y,ae),this.subtitleTrackController=this.createController(C.subtitleTrackController,null,ae),this.createController(C.subtitleStreamController,Y,ae),this.createController(C.timelineController,null,le),this.emeController=this.createController(C.emeController,null,le),this.cmcdController=this.createController(C.cmcdController,null,le),this.latencyController=this.createController(i.default,null,le),this.coreComponents=le}var L=w.prototype;return L.createController=function(C,S,x){if(C){var p=S?new C(this,S):new C(this);return x&&x.push(p),p}return null},L.on=function(C,S,x){x===void 0&&(x=this),this._emitter.on(C,S,x)},L.once=function(C,S,x){x===void 0&&(x=this),this._emitter.once(C,S,x)},L.removeAllListeners=function(C){this._emitter.removeAllListeners(C)},L.off=function(C,S,x,p){x===void 0&&(x=this),this._emitter.off(C,S,x,p)},L.listeners=function(C){return this._emitter.listeners(C)},L.emit=function(C,S,x){return this._emitter.emit(C,S,x)},L.trigger=function(C,S){if(this.config.debug)return this.emit(C,C,S);try{return this.emit(C,C,S)}catch(x){u.logger.error("An internal error happened while handling event "+C+'. Error message: "'+x.message+'". Here is a stacktrace:',x),this.trigger(h.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:C,error:x})}return!1},L.listenerCount=function(C){return this._emitter.listenerCount(C)},L.destroy=function(){u.logger.log("destroy"),this.trigger(h.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(C){return C.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(C){return C.destroy()}),this.coreComponents.length=0},L.attachMedia=function(C){u.logger.log("attachMedia"),this._media=C,this.trigger(h.Events.MEDIA_ATTACHING,{media:C})},L.detachMedia=function(){u.logger.log("detachMedia"),this.trigger(h.Events.MEDIA_DETACHING,void 0),this._media=null},L.loadSource=function(C){this.stopLoad();var S=this.media,x=this.url,p=this.url=X.buildAbsoluteURL(self.location.href,C,{alwaysNormalize:!0});u.logger.log("loadSource:"+p),S&&x&&x!==p&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(S)),this.trigger(h.Events.MANIFEST_LOADING,{url:C})},L.startLoad=function(C){C===void 0&&(C=-1),u.logger.log("startLoad("+C+")"),this.networkControllers.forEach(function(S){S.startLoad(C)})},L.stopLoad=function(){u.logger.log("stopLoad"),this.networkControllers.forEach(function(C){C.stopLoad()})},L.swapAudioCodec=function(){u.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},L.recoverMediaError=function(){u.logger.log("recoverMediaError");var C=this._media;this.detachMedia(),C&&this.attachMedia(C)},L.removeLevel=function(C,S){S===void 0&&(S=0),this.levelController.removeLevel(C,S)},A(w,[{key:"levels",get:function(){var C=this.levelController.levels;return C||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(C){u.logger.log("set currentLevel:"+C),this.loadLevel=C,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(C){u.logger.log("set nextLevel:"+C),this.levelController.manualLevel=C,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(C){u.logger.log("set loadLevel:"+C),this.levelController.manualLevel=C}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(C){this.levelController.nextLoadLevel=C}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(C){u.logger.log("set firstLevel:"+C),this.levelController.firstLevel=C}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(C){u.logger.log("set startLevel:"+C),C!==-1&&(C=Math.max(C,this.minAutoLevel)),this.levelController.startLevel=C}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(C){var S=!!C;S!==this.config.capLevelToPlayerSize&&(S?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=S)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(C){this._autoLevelCapping!==C&&(u.logger.log("set autoLevelCapping:"+C),this._autoLevelCapping=C)}},{key:"bandwidthEstimate",get:function(){var C=this.abrController.bwEstimator;return C?C.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var C=this.levels,S=this.config.minAutoBitrate;if(!C)return 0;for(var x=C.length,p=0;p<x;p++)if(C[p].maxBitrate>S)return p;return 0}},{key:"maxAutoLevel",get:function(){var C=this.levels,S=this.autoLevelCapping,x;return S===-1&&C&&C.length?x=C.length-1:x=S,x}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(C){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,C)}},{key:"audioTracks",get:function(){var C=this.audioTrackController;return C?C.audioTracks:[]}},{key:"audioTrack",get:function(){var C=this.audioTrackController;return C?C.audioTrack:-1},set:function(C){var S=this.audioTrackController;S&&(S.audioTrack=C)}},{key:"subtitleTracks",get:function(){var C=this.subtitleTrackController;return C?C.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var C=this.subtitleTrackController;return C?C.subtitleTrack:-1},set:function(C){var S=this.subtitleTrackController;S&&(S.subtitleTrack=C)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var C=this.subtitleTrackController;return C?C.subtitleDisplay:!1},set:function(C){var S=this.subtitleTrackController;S&&(S.subtitleDisplay=C)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(C){this.config.lowLatencyMode=C}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return h.Events}},{key:"ErrorTypes",get:function(){return o.ErrorTypes}},{key:"ErrorDetails",get:function(){return o.ErrorDetails}},{key:"DefaultConfig",get:function(){return w.defaultConfig?w.defaultConfig:a.hlsDefaultConfig},set:function(C){w.defaultConfig=C}}]),w}();_.defaultConfig=void 0},"./src/is-supported.ts":function(ne,$,k){"use strict";k.r($),k.d($,"isSupported",function(){return U}),k.d($,"changeTypeSupported",function(){return G});var X=k("./src/utils/mediasource-helper.ts");function N(){return self.SourceBuffer||self.WebKitSourceBuffer}function U(){var W=Object(X.getMediaSource)();if(!W)return!1;var i=N(),D=W&&typeof W.isTypeSupported=="function"&&W.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!i||i.prototype&&typeof i.prototype.appendBuffer=="function"&&typeof i.prototype.remove=="function";return!!D&&!!g}function G(){var W,i=N();return typeof(i==null||((W=i.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return u}),k.d($,"LoadError",function(){return f});var X=k("./src/polyfills/number.ts"),N=k("./src/errors.ts");function U(l,h){l.prototype=Object.create(h.prototype),l.prototype.constructor=l,g(l,h)}function G(l){var h=typeof Map=="function"?new Map:void 0;return G=function(s){if(s===null||!D(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h!="undefined"){if(h.has(s))return h.get(s);h.set(s,A)}function A(){return W(s,arguments,d(this).constructor)}return A.prototype=Object.create(s.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),g(A,s)},G(l)}function W(l,h,o){return i()?W=Reflect.construct:W=function(A,_,w){var L=[null];L.push.apply(L,_);var R=Function.bind.apply(A,L),C=new R;return w&&g(C,w.prototype),C},W.apply(null,arguments)}function i(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function D(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function g(l,h){return g=Object.setPrototypeOf||function(s,A){return s.__proto__=A,s},g(l,h)}function d(l){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},d(l)}var m=Math.pow(2,17),u=function(){function l(o){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=o}var h=l.prototype;return h.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},h.abort=function(){this.loader&&this.loader.abort()},h.load=function(s,A){var _=this,w=s.url;if(!w)return Promise.reject(new f({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(w?"part list":"url")));this.abort();var L=this.config,R=L.fLoader,C=L.loader;return new Promise(function(S,x){_.loader&&_.loader.destroy();var p=_.loader=s.loader=R?new R(L):new C(L),T=a(s),v={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:m};s.stats=p.stats,p.load(T,v,{onSuccess:function(F,B,O,j){_.resetLoader(s,p),S({frag:s,part:null,payload:F.data,networkDetails:j})},onError:function(F,B,O){_.resetLoader(s,p),x(new f({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:F,networkDetails:O}))},onAbort:function(F,B,O){_.resetLoader(s,p),x(new f({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:O}))},onTimeout:function(F,B,O){_.resetLoader(s,p),x(new f({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:O}))},onProgress:function(F,B,O,j){A&&A({frag:s,part:null,payload:O,networkDetails:j})}})})},h.loadPart=function(s,A,_){var w=this;this.abort();var L=this.config,R=L.fLoader,C=L.loader;return new Promise(function(S,x){w.loader&&w.loader.destroy();var p=w.loader=s.loader=R?new R(L):new C(L),T=a(s,A),v={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:m};A.stats=p.stats,p.load(T,v,{onSuccess:function(F,B,O,j){w.resetLoader(s,p),w.updateStatsFromPart(s,A);var P={frag:s,part:A,payload:F.data,networkDetails:j};_(P),S(P)},onError:function(F,B,O){w.resetLoader(s,p),x(new f({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:A,response:F,networkDetails:O}))},onAbort:function(F,B,O){s.stats.aborted=A.stats.aborted,w.resetLoader(s,p),x(new f({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:A,networkDetails:O}))},onTimeout:function(F,B,O){w.resetLoader(s,p),x(new f({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:A,networkDetails:O}))}})})},h.updateStatsFromPart=function(s,A){var _=s.stats,w=A.stats,L=w.total;if(_.loaded+=w.loaded,L){var R=Math.round(s.duration/A.duration),C=Math.min(Math.round(_.loaded/L),R),S=R-C,x=S*Math.round(_.loaded/C);_.total=_.loaded+x}else _.total=Math.max(_.loaded,_.total);var p=_.loading,T=w.loading;p.start?p.first+=T.first-T.start:(p.start=T.start,p.first=T.first),p.end=T.end},h.resetLoader=function(s,A){s.loader=null,this.loader===A&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),A.destroy()},l}();function a(l,h){h===void 0&&(h=null);var o=h||l,s={frag:l,part:h,responseType:"arraybuffer",url:o.url,headers:{},rangeStart:0,rangeEnd:0},A=o.byteRangeStartOffset,_=o.byteRangeEndOffset;return Object(X.isFiniteNumber)(A)&&Object(X.isFiniteNumber)(_)&&(s.rangeStart=A,s.rangeEnd=_),s}var f=function(l){U(h,l);function h(o){for(var s,A=arguments.length,_=new Array(A>1?A-1:0),w=1;w<A;w++)_[w-1]=arguments[w];return s=l.call.apply(l,[this].concat(_))||this,s.data=void 0,s.data=o,s}return h}(G(Error))},"./src/loader/fragment.ts":function(ne,$,k){"use strict";k.r($),k.d($,"ElementaryStreamTypes",function(){return u}),k.d($,"BaseSegment",function(){return a}),k.d($,"Fragment",function(){return f}),k.d($,"Part",function(){return l});var X=k("./src/polyfills/number.ts"),N=k("./node_modules/url-toolkit/src/url-toolkit.js"),U=k.n(N),G=k("./src/utils/logger.ts"),W=k("./src/loader/level-key.ts"),i=k("./src/loader/load-stats.ts");function D(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,g(h,o)}function g(h,o){return g=Object.setPrototypeOf||function(A,_){return A.__proto__=_,A},g(h,o)}function d(h,o){for(var s=0;s<o.length;s++){var A=o[s];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}function m(h,o,s){return o&&d(h.prototype,o),s&&d(h,s),h}var u;(function(h){h.AUDIO="audio",h.VIDEO="video",h.AUDIOVIDEO="audiovideo"})(u||(u={}));var a=function(){function h(s){var A;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(A={},A[u.AUDIO]=null,A[u.VIDEO]=null,A[u.AUDIOVIDEO]=null,A),this.baseurl=s}var o=h.prototype;return o.setByteRange=function(A,_){var w=A.split("@",2),L=[];w.length===1?L[0]=_?_.byteRangeEndOffset:0:L[0]=parseInt(w[1]),L[1]=parseInt(w[0])+L[0],this._byteRange=L},m(h,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(N.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(A){this._url=A}}]),h}(),f=function(h){D(o,h);function o(A,_){var w;return w=h.call(this,_)||this,w._decryptdata=null,w.rawProgramDateTime=null,w.programDateTime=null,w.tagList=[],w.duration=0,w.sn=0,w.levelkey=void 0,w.type=void 0,w.loader=null,w.level=-1,w.cc=0,w.startPTS=void 0,w.endPTS=void 0,w.appendedPTS=void 0,w.startDTS=void 0,w.endDTS=void 0,w.start=0,w.deltaPTS=void 0,w.maxStartPTS=void 0,w.minEndPTS=void 0,w.stats=new i.LoadStats,w.urlId=0,w.data=void 0,w.bitrateTest=!1,w.title=null,w.initSegment=null,w.type=A,w}var s=o.prototype;return s.createInitializationVector=function(_){for(var w=new Uint8Array(16),L=12;L<16;L++)w[L]=_>>8*(15-L)&255;return w},s.setDecryptDataFromLevelKey=function(_,w){var L=_;return(_==null?void 0:_.method)==="AES-128"&&_.uri&&!_.iv&&(L=W.LevelKey.fromURI(_.uri),L.method=_.method,L.iv=this.createInitializationVector(w),L.keyFormat="identity"),L},s.setElementaryStreamInfo=function(_,w,L,R,C,S){S===void 0&&(S=!1);var x=this.elementaryStreams,p=x[_];if(!p){x[_]={startPTS:w,endPTS:L,startDTS:R,endDTS:C,partial:S};return}p.startPTS=Math.min(p.startPTS,w),p.endPTS=Math.max(p.endPTS,L),p.startDTS=Math.min(p.startDTS,R),p.endDTS=Math.max(p.endDTS,C)},s.clearElementaryStreamInfo=function(){var _=this.elementaryStreams;_[u.AUDIO]=null,_[u.VIDEO]=null,_[u.AUDIOVIDEO]=null},m(o,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var _=this.sn;typeof _!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&G.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),_=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,_)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(X.isFiniteNumber)(this.programDateTime))return null;var _=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+_*1e3}},{key:"encrypted",get:function(){var _;return!!((_=this.decryptdata)!==null&&_!==void 0&&_.keyFormat&&this.decryptdata.uri)}}]),o}(a),l=function(h){D(o,h);function o(s,A,_,w,L){var R;R=h.call(this,_)||this,R.fragOffset=0,R.duration=0,R.gap=!1,R.independent=!1,R.relurl=void 0,R.fragment=void 0,R.index=void 0,R.stats=new i.LoadStats,R.duration=s.decimalFloatingPoint("DURATION"),R.gap=s.bool("GAP"),R.independent=s.bool("INDEPENDENT"),R.relurl=s.enumeratedString("URI"),R.fragment=A,R.index=w;var C=s.enumeratedString("BYTERANGE");return C&&R.setByteRange(C,L),L&&(R.fragOffset=L.fragOffset+L.duration),R}return m(o,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var A=this.elementaryStreams;return!!(A.audio||A.video||A.audiovideo)}}]),o}(a)},"./src/loader/key-loader.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return G});var X=k("./src/events.ts"),N=k("./src/errors.ts"),U=k("./src/utils/logger.ts"),G=function(){function W(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var i=W.prototype;return i._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},i._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},i.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var d=this.loaders[g];d&&d.destroy()}this.loaders={}},i.onKeyLoading=function(g,d){var m=d.frag,u=m.type,a=this.loaders[u];if(!m.decryptdata){U.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=m.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(a&&(U.logger.warn("abort previous key loader for type:"+u),a.abort()),!f){U.logger.warn("key uri is falsy");return}var h=l.loader,o=m.loader=this.loaders[u]=new h(l);this.decrypturl=f,this.decryptkey=null;var s={url:f,frag:m,responseType:"arraybuffer"},A={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},_={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};o.load(s,A,_)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:m}))},i.loadsuccess=function(g,d,m){var u=m.frag;if(!u.decryptdata){U.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(g.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:u})},i.loaderror=function(g,d){var m=d.frag,u=m.loader;u&&u.abort(),delete this.loaders[m.type],this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:m,response:g})},i.loadtimeout=function(g,d){var m=d.frag,u=m.loader;u&&u.abort(),delete this.loaders[m.type],this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:m})},W}()},"./src/loader/level-details.ts":function(ne,$,k){"use strict";k.r($),k.d($,"LevelDetails",function(){return W});var X=k("./src/polyfills/number.ts");function N(i,D){for(var g=0;g<D.length;g++){var d=D[g];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(i,d.key,d)}}function U(i,D,g){return D&&N(i.prototype,D),g&&N(i,g),i}var G=10,W=function(){function i(g){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=g}var D=i.prototype;return D.reloaded=function(d){if(!d){this.advanced=!0,this.updated=!0;return}var m=this.lastPartSn-d.lastPartSn,u=this.lastPartIndex-d.lastPartIndex;this.updated=this.endSN!==d.endSN||!!u||!!m,this.advanced=this.endSN>d.endSN||m>0||m===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(d.misses*.6):this.misses=d.misses+1,this.availabilityDelay=d.availabilityDelay},U(i,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(X.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||G}},{key:"drift",get:function(){var d=this.driftEndTime-this.driftStartTime;if(d>0){var m=this.driftEnd-this.driftStart;return m*1e3/d}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var d;return(d=this.fragments)!==null&&d!==void 0&&d.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 d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),i}()},"./src/loader/level-key.ts":function(ne,$,k){"use strict";k.r($),k.d($,"LevelKey",function(){return W});var X=k("./node_modules/url-toolkit/src/url-toolkit.js"),N=k.n(X);function U(i,D){for(var g=0;g<D.length;g++){var d=D[g];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(i,d.key,d)}}function G(i,D,g){return D&&U(i.prototype,D),g&&U(i,g),i}var W=function(){i.fromURL=function(g,d){return new i(g,d)},i.fromURI=function(g){return new i(g)};function i(D,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(X.buildAbsoluteURL)(D,g,{alwaysNormalize:!0}):this._uri=D}return G(i,[{key:"uri",get:function(){return this._uri}}]),i}()},"./src/loader/load-stats.ts":function(ne,$,k){"use strict";k.r($),k.d($,"LoadStats",function(){return X});var X=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return o});var X=k("./src/polyfills/number.ts"),N=k("./node_modules/url-toolkit/src/url-toolkit.js"),U=k.n(N),G=k("./src/loader/fragment.ts"),W=k("./src/loader/level-details.ts"),i=k("./src/loader/level-key.ts"),D=k("./src/utils/attr-list.ts"),g=k("./src/utils/logger.ts"),d=k("./src/utils/codecs.ts"),m=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,u=/#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"),f=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function h(L){var R,C;return l.test((R=(C=N.parseURL(L))===null||C===void 0?void 0:C.path)!=null?R:"")}var o=function(){function L(){}return L.findGroup=function(C,S){for(var x=0;x<C.length;x++){var p=C[x];if(p.id===S)return p}},L.convertAVC1ToAVCOTI=function(C){var S=C.split(".");if(S.length>2){var x=S.shift()+".";return x+=parseInt(S.shift()).toString(16),x+=("000"+parseInt(S.shift()).toString(16)).substr(-4),x}return C},L.resolve=function(C,S){return N.buildAbsoluteURL(S,C,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(C,S){var x=[],p={},T=!1;m.lastIndex=0;for(var v;(v=m.exec(C))!=null;)if(v[1]){var y=new D.AttrList(v[1]),F={attrs:y,bitrate:y.decimalInteger("AVERAGE-BANDWIDTH")||y.decimalInteger("BANDWIDTH"),name:y.NAME,url:L.resolve(v[2],S)},B=y.decimalResolution("RESOLUTION");B&&(F.width=B.width,F.height=B.height),s((y.CODECS||"").split(/[ ,]+/).filter(function(j){return j}),F),F.videoCodec&&F.videoCodec.indexOf("avc1")!==-1&&(F.videoCodec=L.convertAVC1ToAVCOTI(F.videoCodec)),x.push(F)}else if(v[3]){var O=new D.AttrList(v[3]);O["DATA-ID"]&&(T=!0,p[O["DATA-ID"]]=O)}return{levels:x,sessionData:T?p:null}},L.parseMasterPlaylistMedia=function(C,S,x,p){p===void 0&&(p=[]);var T,v=[],y=0;for(u.lastIndex=0;(T=u.exec(C))!==null;){var F=new D.AttrList(T[1]);if(F.TYPE===x){var B={attrs:F,bitrate:0,id:y++,groupId:F["GROUP-ID"],instreamId:F["INSTREAM-ID"],name:F.NAME||F.LANGUAGE||"",type:x,default:F.bool("DEFAULT"),autoselect:F.bool("AUTOSELECT"),forced:F.bool("FORCED"),lang:F.LANGUAGE,url:F.URI?L.resolve(F.URI,S):""};if(p.length){var O=L.findGroup(p,B.groupId)||p[0];A(B,O,"audioCodec"),A(B,O,"textCodec")}v.push(B)}}return v},L.parseLevelPlaylist=function(C,S,x,p,T){var v=new W.LevelDetails(S),y=v.fragments,F=null,B=0,O=0,j=0,P=0,b=null,Y=new G.Fragment(p,S),ee,ae,le,Re=-1,Ee=!1;for(a.lastIndex=0,v.m3u8=C;(ee=a.exec(C))!==null;){Ee&&(Ee=!1,Y=new G.Fragment(p,S),Y.start=j,Y.sn=B,Y.cc=P,Y.level=x,F&&(Y.initSegment=F,Y.rawProgramDateTime=F.rawProgramDateTime));var Te=ee[1];if(Te){Y.duration=parseFloat(Te);var Ae=(" "+ee[2]).slice(1);Y.title=Ae||null,Y.tagList.push(Ae?["INF",Te,Ae]:["INF",Te])}else if(ee[3])Object(X.isFiniteNumber)(Y.duration)&&(Y.start=j,le&&(Y.levelkey=le),Y.sn=B,Y.level=x,Y.cc=P,Y.urlId=T,y.push(Y),Y.relurl=(" "+ee[3]).slice(1),w(Y,b),b=Y,j+=Y.duration,B++,O=0,Ee=!0);else if(ee[4]){var Oe=(" "+ee[4]).slice(1);b?Y.setByteRange(Oe,b):Y.setByteRange(Oe)}else if(ee[5])Y.rawProgramDateTime=(" "+ee[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),Re===-1&&(Re=y.length);else{if(ee=ee[0].match(f),!ee){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae<ee.length&&!(typeof ee[ae]!="undefined");ae++);var ce=(" "+ee[ae]).slice(1),ue=(" "+ee[ae+1]).slice(1),Pe=ee[ae+2]?(" "+ee[ae+2]).slice(1):"";switch(ce){case"PLAYLIST-TYPE":v.type=ue.toUpperCase();break;case"MEDIA-SEQUENCE":B=v.startSN=parseInt(ue);break;case"SKIP":{var qe=new D.AttrList(ue),ze=qe.decimalInteger("SKIPPED-SEGMENTS");if(Object(X.isFiniteNumber)(ze)){v.skippedSegments=ze;for(var et=ze;et--;)y.unshift(null);B+=ze}var nt=qe.enumeratedString("RECENTLY-REMOVED-DATERANGES");nt&&(v.recentlyRemovedDateranges=nt.split(" "));break}case"TARGETDURATION":v.targetduration=parseFloat(ue);break;case"VERSION":v.version=parseInt(ue);break;case"EXTM3U":break;case"ENDLIST":v.live=!1;break;case"#":(ue||Pe)&&Y.tagList.push(Pe?[ue,Pe]:[ue]);break;case"DIS":P++;case"GAP":Y.tagList.push([ce]);break;case"BITRATE":Y.tagList.push([ce,ue]);break;case"DISCONTINUITY-SEQ":P=parseInt(ue);break;case"KEY":{var Ie,Me=new D.AttrList(ue),Ge=Me.enumeratedString("METHOD"),se=Me.URI,be=Me.hexadecimalInteger("IV"),xe=Me.enumeratedString("KEYFORMATVERSIONS"),Se=Me.enumeratedString("KEYID"),Be=(Ie=Me.enumeratedString("KEYFORMAT"))!=null?Ie:"identity",He=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(He.indexOf(Be)>-1){g.logger.warn("Keyformat "+Be+" is not supported from the manifest");continue}else if(Be!=="identity")continue;Ge&&(le=i.LevelKey.fromURL(S,se),se&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ge)>=0&&(le.method=Ge,le.keyFormat=Be,Se&&(le.keyID=Se),xe&&(le.keyFormatVersions=xe),le.iv=be));break}case"START":{var Ye=new D.AttrList(ue),Ve=Ye.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(Ve)&&(v.startTimeOffset=Ve);break}case"MAP":{var lt=new D.AttrList(ue);Y.relurl=lt.URI,lt.BYTERANGE&&Y.setByteRange(lt.BYTERANGE),Y.level=x,Y.sn="initSegment",le&&(Y.levelkey=le),Y.initSegment=null,F=Y,Ee=!0;break}case"SERVER-CONTROL":{var $e=new D.AttrList(ue);v.canBlockReload=$e.bool("CAN-BLOCK-RELOAD"),v.canSkipUntil=$e.optionalFloat("CAN-SKIP-UNTIL",0),v.canSkipDateRanges=v.canSkipUntil>0&&$e.bool("CAN-SKIP-DATERANGES"),v.partHoldBack=$e.optionalFloat("PART-HOLD-BACK",0),v.holdBack=$e.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Qe=new D.AttrList(ue);v.partTarget=Qe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var De=v.partList;De||(De=v.partList=[]);var ct=O>0?De[De.length-1]:void 0,ut=O++,ke=new G.Part(new D.AttrList(ue),Y,S,ut,ct);De.push(ke),Y.duration+=ke.duration;break}case"PRELOAD-HINT":{var Ne=new D.AttrList(ue);v.preloadHint=Ne;break}case"RENDITION-REPORT":{var _e=new D.AttrList(ue);v.renditionReports=v.renditionReports||[],v.renditionReports.push(_e);break}default:g.logger.warn("line parsed but not handled: "+ee);break}}}b&&!b.relurl?(y.pop(),j-=b.duration,v.partList&&(v.fragmentHint=b)):v.partList&&(w(Y,b),Y.cc=P,v.fragmentHint=Y);var fe=y.length,ve=y[0],ie=y[fe-1];if(j+=v.skippedSegments*v.targetduration,j>0&&fe&&ie){v.averagetargetduration=j/fe;var re=ie.sn;v.endSN=re!=="initSegment"?re:0,ve&&(v.startCC=ve.cc,ve.initSegment||v.fragments.every(function(oe){return oe.relurl&&h(oe.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),Y=new G.Fragment(p,S),Y.relurl=ie.relurl,Y.level=x,Y.sn="initSegment",ve.initSegment=Y,v.needSidxRanges=!0))}else v.endSN=0,v.startCC=0;return v.fragmentHint&&(j+=v.fragmentHint.duration),v.totalduration=j,v.endCC=P,Re>0&&_(y,Re),v},L}();function s(L,R){["video","audio","text"].forEach(function(C){var S=L.filter(function(p){return Object(d.isCodecType)(p,C)});if(S.length){var x=S.filter(function(p){return p.lastIndexOf("avc1",0)===0||p.lastIndexOf("mp4a",0)===0});R[C+"Codec"]=x.length>0?x[0]:S[0],L=L.filter(function(p){return S.indexOf(p)===-1})}}),R.unknownCodecs=L}function A(L,R,C){var S=R[C];S&&(L[C]=S)}function _(L,R){for(var C=L[R],S=R;S--;){var x=L[S];if(!x)return;x.programDateTime=C.programDateTime-x.duration*1e3,C=x}}function w(L,R){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):R!=null&&R.programDateTime&&(L.programDateTime=R.endProgramDateTime),Object(X.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/polyfills/number.ts"),N=k("./src/events.ts"),U=k("./src/errors.ts"),G=k("./src/utils/logger.ts"),W=k("./src/utils/mp4-tools.ts"),i=k("./src/loader/m3u8-parser.ts"),D=k("./src/types/loader.ts"),g=k("./src/utils/attr-list.ts");function d(a){var f=a.type;switch(f){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function m(a,f){var l=a.url;return(l===void 0||l.indexOf("data:")===0)&&(l=f.url),l}var u=function(){function a(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var f=a.prototype;return f.registerListeners=function(){var h=this.hls;h.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.on(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var h=this.hls;h.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.off(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(h){var o=this.hls.config,s=o.pLoader,A=o.loader,_=s||A,w=new _(o);return h.loader=w,this.loaders[h.type]=w,w},f.getInternalLoader=function(h){return this.loaders[h.type]},f.resetInternalLoader=function(h){this.loaders[h]&&delete this.loaders[h]},f.destroyInternalLoaders=function(){for(var h in this.loaders){var o=this.loaders[h];o&&o.destroy(),this.resetInternalLoader(h)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(h,o){var s=o.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},f.onLevelLoading=function(h,o){var s=o.id,A=o.level,_=o.url,w=o.deliveryDirectives;this.load({id:s,groupId:null,level:A,responseType:"text",type:D.PlaylistContextType.LEVEL,url:_,deliveryDirectives:w})},f.onAudioTrackLoading=function(h,o){var s=o.id,A=o.groupId,_=o.url,w=o.deliveryDirectives;this.load({id:s,groupId:A,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:_,deliveryDirectives:w})},f.onSubtitleTrackLoading=function(h,o){var s=o.id,A=o.groupId,_=o.url,w=o.deliveryDirectives;this.load({id:s,groupId:A,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:_,deliveryDirectives:w})},f.load=function(h){var o,s=this.hls.config,A=this.getInternalLoader(h);if(A){var _=A.context;if(_&&_.url===h.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+h.type),A.abort()}var w,L,R,C;switch(h.type){case D.PlaylistContextType.MANIFEST:w=s.manifestLoadingMaxRetry,L=s.manifestLoadingTimeOut,R=s.manifestLoadingRetryDelay,C=s.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:w=0,L=s.levelLoadingTimeOut;break;default:w=s.levelLoadingMaxRetry,L=s.levelLoadingTimeOut,R=s.levelLoadingRetryDelay,C=s.levelLoadingMaxRetryTimeout;break}if(A=this.createInternalLoader(h),(o=h.deliveryDirectives)!==null&&o!==void 0&&o.part){var S;if(h.type===D.PlaylistContextType.LEVEL&&h.level!==null?S=this.hls.levels[h.level].details:h.type===D.PlaylistContextType.AUDIO_TRACK&&h.id!==null?S=this.hls.audioTracks[h.id].details:h.type===D.PlaylistContextType.SUBTITLE_TRACK&&h.id!==null&&(S=this.hls.subtitleTracks[h.id].details),S){var x=S.partTarget,p=S.targetduration;x&&p&&(L=Math.min(Math.max(x*3,p*.8)*1e3,L))}}var T={timeout:L,maxRetry:w,retryDelay:R,maxRetryDelay:C,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};A.load(h,T,v)},f.loadsuccess=function(h,o,s,A){if(A===void 0&&(A=null),s.isSidxRequest){this.handleSidxRequest(h,s),this.handlePlaylistLoaded(h,o,s,A);return}this.resetInternalLoader(s.type);var _=h.data;if(_.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(h,s,"no EXTM3U delimiter",A);return}o.parsing.start=performance.now(),_.indexOf("#EXTINF:")>0||_.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(h,o,s,A):this.handleMasterPlaylist(h,o,s,A)},f.loaderror=function(h,o,s){s===void 0&&(s=null),this.handleNetworkError(o,s,!1,h)},f.loadtimeout=function(h,o,s){s===void 0&&(s=null),this.handleNetworkError(o,s,!0)},f.handleMasterPlaylist=function(h,o,s,A){var _=this.hls,w=h.data,L=m(h,s),R=i.default.parseMasterPlaylist(w,L),C=R.levels,S=R.sessionData;if(!C.length){this.handleManifestParsingError(h,s,"no level found in manifest",A);return}var x=C.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),p=C.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),T=i.default.parseMasterPlaylistMedia(w,L,"AUDIO",x),v=i.default.parseMasterPlaylistMedia(w,L,"SUBTITLES",p),y=i.default.parseMasterPlaylistMedia(w,L,"CLOSED-CAPTIONS");if(T.length){var F=T.some(function(B){return!B.url});!F&&C[0].audioCodec&&!C[0].attrs.AUDIO&&(G.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),T.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}_.trigger(N.Events.MANIFEST_LOADED,{levels:C,audioTracks:T,subtitles:v,captions:y,url:L,stats:o,networkDetails:A,sessionData:S})},f.handleTrackOrLevelPlaylist=function(h,o,s,A){var _=this.hls,w=s.id,L=s.level,R=s.type,C=m(h,s),S=Object(X.isFiniteNumber)(w)?w:0,x=Object(X.isFiniteNumber)(L)?L:S,p=d(s),T=i.default.parseLevelPlaylist(h.data,C,x,p,S);if(!T.fragments.length){_.trigger(N.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:C,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(R===D.PlaylistContextType.MANIFEST){var v={attrs:new g.AttrList({}),bitrate:0,details:T,name:"",url:C};_.trigger(N.Events.MANIFEST_LOADED,{levels:[v],audioTracks:[],url:C,stats:o,networkDetails:A,sessionData:null})}if(o.parsing.end=performance.now(),T.needSidxRanges){var y,F=(y=T.fragments[0].initSegment)===null||y===void 0?void 0:y.url;this.load({url:F,isSidxRequest:!0,type:R,level:L,levelDetails:T,id:w,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=T,this.handlePlaylistLoaded(h,o,s,A)},f.handleSidxRequest=function(h,o){var s=Object(W.parseSegmentIndex)(new Uint8Array(h.data));if(!s)return;var A=s.references,_=o.levelDetails;A.forEach(function(w,L){var R=w.info,C=_.fragments[L];C.byteRange.length===0&&C.setByteRange(String(1+R.end-R.start)+"@"+String(R.start)),C.initSegment&&C.initSegment.setByteRange(String(s.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(h,o,s,A){this.hls.trigger(N.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:o.type===D.PlaylistContextType.MANIFEST,url:h.url,reason:s,response:h,context:o,networkDetails:A})},f.handleNetworkError=function(h,o,s,A){s===void 0&&(s=!1),G.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+h.type+" level: "+h.level+" id: "+h.id+' group-id: "'+h.groupId+'"');var _=U.ErrorDetails.UNKNOWN,w=!1,L=this.getInternalLoader(h);switch(h.type){case D.PlaylistContextType.MANIFEST:_=s?U.ErrorDetails.MANIFEST_LOAD_TIMEOUT:U.ErrorDetails.MANIFEST_LOAD_ERROR,w=!0;break;case D.PlaylistContextType.LEVEL:_=s?U.ErrorDetails.LEVEL_LOAD_TIMEOUT:U.ErrorDetails.LEVEL_LOAD_ERROR,w=!1;break;case D.PlaylistContextType.AUDIO_TRACK:_=s?U.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:U.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,w=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:_=s?U.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:U.ErrorDetails.SUBTITLE_LOAD_ERROR,w=!1;break}L&&this.resetInternalLoader(h.type);var R={type:U.ErrorTypes.NETWORK_ERROR,details:_,fatal:w,url:h.url,loader:L,context:h,networkDetails:o};A&&(R.response=A),this.hls.trigger(N.Events.ERROR,R)},f.handlePlaylistLoaded=function(h,o,s,A){var _=s.type,w=s.level,L=s.id,R=s.groupId,C=s.loader,S=s.levelDetails,x=s.deliveryDirectives;if(!(S!=null&&S.targetduration)){this.handleManifestParsingError(h,s,"invalid target duration",A);return}if(!C)return;S.live&&(C.getCacheAge&&(S.ageHeader=C.getCacheAge()||0),(!C.getCacheAge||isNaN(S.ageHeader))&&(S.ageHeader=0));switch(_){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(N.Events.LEVEL_LOADED,{details:S,level:w||0,id:L||0,stats:o,networkDetails:A,deliveryDirectives:x});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(N.Events.AUDIO_TRACK_LOADED,{details:S,id:L||0,groupId:R||"",stats:o,networkDetails:A,deliveryDirectives:x});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(N.Events.SUBTITLE_TRACK_LOADED,{details:S,id:L||0,groupId:R||"",stats:o,networkDetails:A,deliveryDirectives:x});break}},a}();$.default=u},"./src/polyfills/number.ts":function(ne,$,k){"use strict";k.r($),k.d($,"isFiniteNumber",function(){return X}),k.d($,"MAX_SAFE_INTEGER",function(){return N});var X=Number.isFinite||function(U){return typeof U=="number"&&isFinite(U)},N=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ne,$,k){"use strict";k.r($);var X=function(){function N(){}return N.getSilentFrame=function(G,W){switch(G){case"mp4a.40.2":if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===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(W===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(W===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(W===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(W===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},N}();$.default=X},"./src/remux/mp4-generator.ts":function(ne,$,k){"use strict";k.r($);var X=Math.pow(2,32)-1,N=function(){function U(){}return U.init=function(){U.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 W;for(W in U.types)U.types.hasOwnProperty(W)&&(U.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.charCodeAt(3)]);var i=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),D=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]);U.HDLR_TYPES={video:i,audio:D};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),d=new Uint8Array([0,0,0,0,0,0,0,0]);U.STTS=U.STSC=U.STCO=d,U.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),U.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),U.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),U.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var m=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);U.FTYP=U.box(U.types.ftyp,m,a,m,u),U.DINF=U.box(U.types.dinf,U.box(U.types.dref,g))},U.box=function(W){for(var i=8,D=arguments.length,g=new Array(D>1?D-1:0),d=1;d<D;d++)g[d-1]=arguments[d];for(var m=g.length,u=m;m--;)i+=g[m].byteLength;var a=new Uint8Array(i);for(a[0]=i>>24&255,a[1]=i>>16&255,a[2]=i>>8&255,a[3]=i&255,a.set(W,4),m=0,i=8;m<u;m++)a.set(g[m],i),i+=g[m].byteLength;return a},U.hdlr=function(W){return U.box(U.types.hdlr,U.HDLR_TYPES[W])},U.mdat=function(W){return U.box(U.types.mdat,W)},U.mdhd=function(W,i){i*=W;var D=Math.floor(i/(X+1)),g=Math.floor(i%(X+1));return U.box(U.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,D>>24,D>>16&255,D>>8&255,D&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},U.mdia=function(W){return U.box(U.types.mdia,U.mdhd(W.timescale,W.duration),U.hdlr(W.type),U.minf(W))},U.mfhd=function(W){return U.box(U.types.mfhd,new Uint8Array([0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255]))},U.minf=function(W){return W.type==="audio"?U.box(U.types.minf,U.box(U.types.smhd,U.SMHD),U.DINF,U.stbl(W)):U.box(U.types.minf,U.box(U.types.vmhd,U.VMHD),U.DINF,U.stbl(W))},U.moof=function(W,i,D){return U.box(U.types.moof,U.mfhd(W),U.traf(D,i))},U.moov=function(W){for(var i=W.length,D=[];i--;)D[i]=U.trak(W[i]);return U.box.apply(null,[U.types.moov,U.mvhd(W[0].timescale,W[0].duration)].concat(D).concat(U.mvex(W)))},U.mvex=function(W){for(var i=W.length,D=[];i--;)D[i]=U.trex(W[i]);return U.box.apply(null,[U.types.mvex].concat(D))},U.mvhd=function(W,i){i*=W;var D=Math.floor(i/(X+1)),g=Math.floor(i%(X+1)),d=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,D>>24,D>>16&255,D>>8&255,D&255,g>>24,g>>16&255,g>>8&255,g&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return U.box(U.types.mvhd,d)},U.sdtp=function(W){var i=W.samples||[],D=new Uint8Array(4+i.length),g,d;for(g=0;g<i.length;g++)d=i[g].flags,D[g+4]=d.dependsOn<<4|d.isDependedOn<<2|d.hasRedundancy;return U.box(U.types.sdtp,D)},U.stbl=function(W){return U.box(U.types.stbl,U.stsd(W),U.box(U.types.stts,U.STTS),U.box(U.types.stsc,U.STSC),U.box(U.types.stsz,U.STSZ),U.box(U.types.stco,U.STCO))},U.avc1=function(W){var i=[],D=[],g,d,m;for(g=0;g<W.sps.length;g++)d=W.sps[g],m=d.byteLength,i.push(m>>>8&255),i.push(m&255),i=i.concat(Array.prototype.slice.call(d));for(g=0;g<W.pps.length;g++)d=W.pps[g],m=d.byteLength,D.push(m>>>8&255),D.push(m&255),D=D.concat(Array.prototype.slice.call(d));var u=U.box(U.types.avcC,new Uint8Array([1,i[3],i[4],i[5],252|3,224|W.sps.length].concat(i).concat([W.pps.length]).concat(D))),a=W.width,f=W.height,l=W.pixelRatio[0],h=W.pixelRatio[1];return U.box(U.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,f>>8&255,f&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]),u,U.box(U.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),U.box(U.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,h>>24,h>>16&255,h>>8&255,h&255])))},U.esds=function(W){var i=W.config.length;return new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(W.config).concat([6,1,2]))},U.mp4a=function(W){var i=W.samplerate;return U.box(U.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,i>>8&255,i&255,0,0]),U.box(U.types.esds,U.esds(W)))},U.mp3=function(W){var i=W.samplerate;return U.box(U.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,i>>8&255,i&255,0,0]))},U.stsd=function(W){return W.type==="audio"?!W.isAAC&&W.codec==="mp3"?U.box(U.types.stsd,U.STSD,U.mp3(W)):U.box(U.types.stsd,U.STSD,U.mp4a(W)):U.box(U.types.stsd,U.STSD,U.avc1(W))},U.tkhd=function(W){var i=W.id,D=W.duration*W.timescale,g=W.width,d=W.height,m=Math.floor(D/(X+1)),u=Math.floor(D%(X+1));return U.box(U.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,i&255,0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,u>>24,u>>16&255,u>>8&255,u&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,g>>8&255,g&255,0,0,d>>8&255,d&255,0,0]))},U.traf=function(W,i){var D=U.sdtp(W),g=W.id,d=Math.floor(i/(X+1)),m=Math.floor(i%(X+1));return U.box(U.types.traf,U.box(U.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),U.box(U.types.tfdt,new Uint8Array([1,0,0,0,d>>24,d>>16&255,d>>8&255,d&255,m>>24,m>>16&255,m>>8&255,m&255])),U.trun(W,D.length+16+20+8+16+8+8),D)},U.trak=function(W){return W.duration=W.duration||4294967295,U.box(U.types.trak,U.tkhd(W),U.mdia(W))},U.trex=function(W){var i=W.id;return U.box(U.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},U.trun=function(W,i){var D=W.samples||[],g=D.length,d=12+16*g,m=new Uint8Array(d),u,a,f,l,h,o;for(i+=8+d,m.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255],0),u=0;u<g;u++)a=D[u],f=a.duration,l=a.size,h=a.flags,o=a.cts,m.set([f>>>24&255,f>>>16&255,f>>>8&255,f&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,h.degradPrio&240<<8,h.degradPrio&15,o>>>24&255,o>>>16&255,o>>>8&255,o&255],12+16*u);return U.box(U.types.trun,m)},U.initSegment=function(W){U.types||U.init();var i=U.moov(W),D=new Uint8Array(U.FTYP.byteLength+i.byteLength);return D.set(U.FTYP),D.set(i,U.FTYP.byteLength),D},U}();N.types=void 0,N.HDLR_TYPES=void 0,N.STTS=void 0,N.STSC=void 0,N.STCO=void 0,N.STSZ=void 0,N.VMHD=void 0,N.SMHD=void 0,N.STSD=void 0,N.FTYP=void 0,N.DINF=void 0,$.default=N},"./src/remux/mp4-remuxer.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return o}),k.d($,"normalizePts",function(){return s});var X=k("./src/polyfills/number.ts"),N=k("./src/remux/aac-helper.ts"),U=k("./src/remux/mp4-generator.ts"),G=k("./src/events.ts"),W=k("./src/errors.ts"),i=k("./src/utils/logger.ts"),D=k("./src/types/loader.ts"),g=k("./src/utils/timescale-conversion.ts");function d(){return d=Object.assign||function(L){for(var R=1;R<arguments.length;R++){var C=arguments[R];for(var S in C)Object.prototype.hasOwnProperty.call(C,S)&&(L[S]=C[S])}return L},d.apply(this,arguments)}var m=10*1e3,u=1024,a=1152,f=null,l=null,h=!1,o=function(){function L(C,S,x,p){if(p===void 0&&(p=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=C,this.config=S,this.typeSupported=x,this.ISGenerated=!1,f===null){var T=navigator.userAgent||"",v=T.match(/Chrome\/(\d+)/i);f=v?parseInt(v[1]):0}if(l===null){var y=navigator.userAgent.match(/Safari\/(\d+)/i);l=y?parseInt(y[1]):0}h=!!f&&f<75||!!l&&l<600}var R=L.prototype;return R.destroy=function(){},R.resetTimeStamp=function(S){i.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=S},R.resetNextTimestamp=function(){i.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},R.resetInitSegment=function(){i.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},R.getVideoStartPts=function(S){var x=!1,p=S.reduce(function(T,v){var y=v.pts-T;return y<-4294967296?(x=!0,s(T,v.pts)):y>0?T:v.pts},S[0].pts);return x&&i.logger.debug("PTS rollover detected"),p},R.remux=function(S,x,p,T,v,y,F,B){var O,j,P,b,Y,ee,ae=v,le=v,Re=S.pid>-1,Ee=x.pid>-1,Te=x.samples.length,Ae=S.samples.length>0,Oe=Te>1,ce=(!Re||Ae)&&(!Ee||Oe)||this.ISGenerated||F;if(ce){this.ISGenerated||(P=this.generateIS(S,x,v));var ue=this.isVideoContiguous,Pe=-1;if(Oe&&(Pe=A(x.samples),!ue&&this.config.forceKeyFrameOnDiscontinuity))if(ee=!0,Pe>0){i.logger.warn("[mp4-remuxer]: Dropped "+Pe+" out of "+Te+" video samples due to a missing keyframe");var qe=this.getVideoStartPts(x.samples);x.samples=x.samples.slice(Pe),x.dropped+=Pe,le+=(x.samples[0].pts-qe)/(x.timescale||9e4)}else Pe===-1&&(i.logger.warn("[mp4-remuxer]: No keyframe found out of "+Te+" video samples"),ee=!1);if(this.ISGenerated){if(Ae&&Oe){var ze=this.getVideoStartPts(x.samples),et=s(S.samples[0].pts,ze)-ze,nt=et/x.inputTimeScale;ae+=Math.max(0,nt),le+=Math.max(0,-nt)}if(Ae){if(S.samplerate||(i.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),P=this.generateIS(S,x,v)),j=this.remuxAudio(S,ae,this.isAudioContiguous,y,Ee||Oe||B===D.PlaylistLevelType.AUDIO?le:void 0),Oe){var Ie=j?j.endPTS-j.startPTS:0;x.inputTimeScale||(i.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),P=this.generateIS(S,x,v)),O=this.remuxVideo(x,le,ue,Ie)}}else Oe&&(O=this.remuxVideo(x,le,ue,0));O&&(O.firstKeyFrame=Pe,O.independent=Pe!==-1)}}return this.ISGenerated&&(p.samples.length&&(Y=this.remuxID3(p,v)),T.samples.length&&(b=this.remuxText(T,v))),{audio:j,video:O,initSegment:P,independent:ee,text:b,id3:Y}},R.generateIS=function(S,x,p){var T=S.samples,v=x.samples,y=this.typeSupported,F={},B=!Object(X.isFiniteNumber)(this._initPTS),O="audio/mp4",j,P,b;if(B&&(j=P=Infinity),S.config&&T.length&&(S.timescale=S.samplerate,S.isAAC||(y.mpeg?(O="audio/mpeg",S.codec=""):y.mp3&&(S.codec="mp3")),F.audio={id:"audio",container:O,codec:S.codec,initSegment:!S.isAAC&&y.mpeg?new Uint8Array(0):U.default.initSegment([S]),metadata:{channelCount:S.channelCount}},B&&(b=S.inputTimeScale,j=P=T[0].pts-Math.round(b*p))),x.sps&&x.pps&&v.length&&(x.timescale=x.inputTimeScale,F.video={id:"main",container:"video/mp4",codec:x.codec,initSegment:U.default.initSegment([x]),metadata:{width:x.width,height:x.height}},B)){b=x.inputTimeScale;var Y=this.getVideoStartPts(v),ee=Math.round(b*p);P=Math.min(P,s(v[0].dts,Y)-ee),j=Math.min(j,Y-ee)}if(Object.keys(F).length)return this.ISGenerated=!0,B&&(this._initPTS=j,this._initDTS=P),{tracks:F,initPTS:j,timescale:b}},R.remuxVideo=function(S,x,p,T){var v=S.inputTimeScale,y=S.samples,F=[],B=y.length,O=this._initPTS,j=this.nextAvcDts,P=8,b,Y,ee,ae=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY,Re=0,Ee=!1;if(!p||j===null){var Te=x*v,Ae=y[0].pts-s(y[0].dts,y[0].pts);j=Te-Ae}for(var Oe=0;Oe<B;Oe++){var ce=y[Oe];if(ce.pts=s(ce.pts-O,j),ce.dts=s(ce.dts-O,j),ce.dts>ce.pts){var ue=9e4*.2;Re=Math.max(Math.min(Re,ce.pts-ce.dts),-1*ue)}ce.dts<y[Oe>0?Oe-1:Oe].dts&&(Ee=!0)}Ee&&y.sort(function(mt,yt){var tt=mt.dts-yt.dts,Ut=mt.pts-yt.pts;return tt||Ut}),Y=y[0].dts,ee=y[y.length-1].dts;var Pe=Math.round((ee-Y)/(B-1));if(Re<0){if(Re<Pe*-2){i.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-Pe,!0)+" ms");for(var qe=Re,ze=0;ze<B;ze++)y[ze].dts=qe=Math.max(qe,y[ze].pts-Pe),y[ze].pts=Math.max(qe,y[ze].pts)}else{i.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(Re,!0)+" ms to overcome this issue");for(var et=0;et<B;et++)y[et].dts=y[et].dts+Re}Y=y[0].dts}if(p){var nt=Y-j,Ie=nt>Pe,Me=nt<-1;if(Ie||Me){Ie?i.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(nt,!0)+" ms ("+nt+"dts) hole between fragments detected, filling it"):i.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-nt,!0)+" ms ("+nt+"dts) overlapping between fragments detected"),Y=j;var Ge=y[0].pts-nt;y[0].dts=Y,y[0].pts=Ge,i.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Ge,!0)+"/"+Object(g.toMsFromMpegTsClock)(Y,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(nt,!0)+" ms")}}h&&(Y=Math.max(0,Y));for(var se=0,be=0,xe=0;xe<B;xe++){for(var Se=y[xe],Be=Se.units,He=Be.length,Ye=0,Ve=0;Ve<He;Ve++)Ye+=Be[Ve].data.length;be+=Ye,se+=He,Se.length=Ye,Se.dts=Math.max(Se.dts,Y),Se.pts=Math.max(Se.pts,Se.dts,0),ae=Math.min(Se.pts,ae),le=Math.max(Se.pts,le)}ee=y[B-1].dts;var lt=be+4*se+8,$e;try{$e=new Uint8Array(lt)}catch(mt){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:lt,reason:"fail allocating video mdat "+lt});return}var Qe=new DataView($e.buffer);Qe.setUint32(0,lt),$e.set(U.default.types.mdat,4);for(var De=0;De<B;De++){for(var ct=y[De],ut=ct.units,ke=0,Ne=0,_e=ut.length;Ne<_e;Ne++){var fe=ut[Ne],ve=fe.data,ie=fe.data.byteLength;Qe.setUint32(P,ie),P+=4,$e.set(ve,P),P+=ie,ke+=4+ie}if(De<B-1)b=y[De+1].dts-ct.dts;else{var re=this.config,oe=ct.dts-y[De>0?De-1:De].dts;if(re.stretchShortVideoTrack&&this.nextAudioPts!==null){var de=Math.floor(re.maxBufferHole*v),ye=(T?ae+T*v:this.nextAudioPts)-ct.pts;ye>de?(b=ye-oe,b<0&&(b=oe),i.logger.log("[mp4-remuxer]: It is approximately "+ye/90+" ms to the next segment; using duration "+b/90+" ms for the last video frame.")):b=oe}else b=oe}var Le=Math.round(ct.pts-ct.dts);F.push(new _(ct.key,b,ke,Le))}if(F.length&&f&&f<70){var Ue=F[0].flags;Ue.dependsOn=2,Ue.isNonSync=0}console.assert(b!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=j=ee+b,this.isVideoContiguous=!0;var Je=U.default.moof(S.sequenceNumber++,Y,d({},S,{samples:F})),dt="video",rt={data1:Je,data2:$e,startPTS:ae/v,endPTS:(le+b)/v,startDTS:Y/v,endDTS:j/v,type:dt,hasAudio:!1,hasVideo:!0,nb:F.length,dropped:S.dropped};return S.samples=[],S.dropped=0,console.assert($e.length,"MDAT length must not be zero"),rt},R.remuxAudio=function(S,x,p,T,v){var y=S.inputTimeScale,F=S.samplerate?S.samplerate:y,B=y/F,O=S.isAAC?u:a,j=O*B,P=this._initPTS,b=!S.isAAC&&this.typeSupported.mpeg,Y=[],ee=S.samples,ae=b?0:8,le=this.nextAudioPts||-1,Re=x*y;if(this.isAudioContiguous=p=p||ee.length&&le>0&&(T&&Math.abs(Re-le)<9e3||Math.abs(s(ee[0].pts-P,Re)-le)<20*j),ee.forEach(function(ve){ve.pts=s(ve.pts-P,Re)}),!p||le<0){if(ee=ee.filter(function(ve){return ve.pts>=0}),!ee.length)return;v===0?le=0:T?le=Math.max(0,Re):le=ee[0].pts}if(S.isAAC)for(var Ee=v!==void 0,Te=this.config.maxAudioFramesDrift,Ae=0,Oe=le;Ae<ee.length;Ae++){var ce=ee[Ae],ue=ce.pts,Pe=ue-Oe,qe=Math.abs(1e3*Pe/y);if(Pe<=-Te*j&&Ee)Ae===0&&(i.logger.warn("Audio frame @ "+(ue/y).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Pe/y)+" ms."),this.nextAudioPts=le=Oe=ue);else if(Pe>=Te*j&&qe<m&&Ee){var ze=Math.round(Pe/j);Oe=ue-ze*j,Oe<0&&(ze--,Oe+=j),Ae===0&&(this.nextAudioPts=le=Oe),i.logger.warn("[mp4-remuxer]: Injecting "+ze+" audio frame @ "+(Oe/y).toFixed(3)+"s due to "+Math.round(1e3*Pe/y)+" ms gap.");for(var et=0;et<ze;et++){var nt=Math.max(Oe,0),Ie=N.default.getSilentFrame(S.manifestCodec||S.codec,S.channelCount);Ie||(i.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ie=ce.unit.subarray()),ee.splice(Ae,0,{unit:Ie,pts:nt}),Oe+=j,Ae++}}ce.pts=Oe,Oe+=j}for(var Me=null,Ge=null,se,be=0,xe=ee.length;xe--;)be+=ee[xe].unit.byteLength;for(var Se=0,Be=ee.length;Se<Be;Se++){var He=ee[Se],Ye=He.unit,Ve=He.pts;if(Ge!==null){var lt=Y[Se-1];lt.duration=Math.round((Ve-Ge)/B)}else if(p&&S.isAAC&&(Ve=le),Me=Ve,be>0){be+=ae;try{se=new Uint8Array(be)}catch(ve){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:be,reason:"fail allocating audio mdat "+be});return}if(!b){var $e=new DataView(se.buffer);$e.setUint32(0,be),se.set(U.default.types.mdat,4)}}else return;se.set(Ye,ae);var Qe=Ye.byteLength;ae+=Qe,Y.push(new _(!0,O,Qe,0)),Ge=Ve}var De=Y.length;if(!De)return;var ct=Y[Y.length-1];this.nextAudioPts=le=Ge+B*ct.duration;var ut=b?new Uint8Array(0):U.default.moof(S.sequenceNumber++,Me/B,d({},S,{samples:Y}));S.samples=[];var ke=Me/y,Ne=le/y,_e="audio",fe={data1:ut,data2:se,startPTS:ke,endPTS:Ne,startDTS:ke,endDTS:Ne,type:_e,hasAudio:!0,hasVideo:!1,nb:De};return this.isAudioContiguous=!0,console.assert(se.length,"MDAT length must not be zero"),fe},R.remuxEmptyAudio=function(S,x,p,T){var v=S.inputTimeScale,y=S.samplerate?S.samplerate:v,F=v/y,B=this.nextAudioPts,O=(B!==null?B:T.startDTS*v)+this._initDTS,j=T.endDTS*v+this._initDTS,P=F*u,b=Math.ceil((j-O)/P),Y=N.default.getSilentFrame(S.manifestCodec||S.codec,S.channelCount);if(i.logger.warn("[mp4-remuxer]: remux empty Audio"),!Y){i.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ee=[],ae=0;ae<b;ae++){var le=O+ae*P;ee.push({unit:Y,pts:le,dts:le})}return S.samples=ee,this.remuxAudio(S,x,p,!1)},R.remuxID3=function(S,x){var p=S.samples.length;if(!p)return;for(var T=S.inputTimeScale,v=this._initPTS,y=this._initDTS,F=0;F<p;F++){var B=S.samples[F];B.pts=s(B.pts-v,x*T)/T,B.dts=s(B.dts-y,x*T)/T}var O=S.samples;return S.samples=[],{samples:O}},R.remuxText=function(S,x){var p=S.samples.length;if(!p)return;for(var T=S.inputTimeScale,v=this._initPTS,y=0;y<p;y++){var F=S.samples[y];F.pts=s(F.pts-v,x*T)/T}S.samples.sort(function(O,j){return O.pts-j.pts});var B=S.samples;return S.samples=[],{samples:B}},L}();function s(L,R){var C;if(R===null)return L;for(R<L?C=-8589934592:C=8589934592;Math.abs(L-R)>4294967296;)L+=C;return L}function A(L){for(var R=0;R<L.length;R++)if(L[R].key)return R;return-1}var _=function(R,C,S,x){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=C,this.size=S,this.cts=x,this.flags=new w(R)},w=function(R){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=R?2:1,this.isNonSync=R?0:1}},"./src/remux/passthrough-remuxer.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/polyfills/number.ts"),N=k("./src/utils/mp4-tools.ts"),U=k("./src/loader/fragment.ts"),G=k("./src/utils/logger.ts"),W=function(){function g(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var d=g.prototype;return d.destroy=function(){},d.resetTimeStamp=function(u){this.initPTS=u,this.lastEndDTS=null},d.resetNextTimestamp=function(){this.lastEndDTS=null},d.resetInitSegment=function(u,a,f){this.audioCodec=a,this.videoCodec=f,this.generateInitSegment(u),this.emitInitSegment=!0},d.generateInitSegment=function(u){var a=this.audioCodec,f=this.videoCodec;if(!u||!u.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(N.parseInitSegment)(u);a||(a=D(l.audio,U.ElementaryStreamTypes.AUDIO)),f||(f=D(l.video,U.ElementaryStreamTypes.VIDEO));var h={};l.audio&&l.video?h.audiovideo={container:"video/mp4",codec:a+","+f,initSegment:u,id:"main"}:l.audio?h.audio={container:"audio/mp4",codec:a,initSegment:u,id:"audio"}:l.video?h.video={container:"video/mp4",codec:f,initSegment:u,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=h},d.remux=function(u,a,f,l,h){var o=this.initPTS,s=this.lastEndDTS,A={audio:void 0,video:void 0,text:l,id3:f,initSegment:void 0};Object(X.isFiniteNumber)(s)||(s=this.lastEndDTS=h||0);var _=a.samples;if(!_||!_.length)return A;var w={initPTS:void 0,timescale:1},L=this.initData;if((!L||!L.length)&&(this.generateInitSegment(_),L=this.initData),!L||!L.length)return G.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),A;this.emitInitSegment&&(w.tracks=this.initTracks,this.emitInitSegment=!1),Object(X.isFiniteNumber)(o)||(this.initPTS=w.initPTS=o=i(L,_,s));var R=Object(N.getDuration)(_,L),C=s,S=R+C;Object(N.offsetStartDTS)(L,_,o),R>0?this.lastEndDTS=S:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var x=!!L.audio,p=!!L.video,T="";x&&(T+="audio"),p&&(T+="video");var v={data1:_,startPTS:C,startDTS:C,endPTS:S,endDTS:S,type:T,hasAudio:x,hasVideo:p,nb:1,dropped:0};return A.audio=v.type==="audio"?v:void 0,A.video=v.type!=="audio"?v:void 0,A.text=l,A.id3=f,A.initSegment=w,A},g}(),i=function(d,m,u){return Object(N.getStartDTS)(d,m)-u};function D(g,d){var m=g==null?void 0:g.codec;return m&&m.length>4?m:m==="hvc1"?"hvc1.1.c.L120.90":m==="av01"?"av01.0.04M.08":m==="avc1"||d===U.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}$.default=W},"./src/task-loop.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return X});var X=function(){function N(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var U=N.prototype;return U.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},U.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},U.onHandlerDestroyed=function(){},U.hasInterval=function(){return!!this._tickInterval},U.hasNextTick=function(){return!!this._tickTimer},U.setInterval=function(W){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,W),!0)},U.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},U.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},U.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},U.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},U.doTick=function(){},N}()},"./src/types/cmcd.ts":function(ne,$,k){"use strict";k.r($),k.d($,"CMCDVersion",function(){return X}),k.d($,"CMCDObjectType",function(){return N}),k.d($,"CMCDStreamingFormat",function(){return U}),k.d($,"CMCDStreamType",function(){return G});var X=1,N;(function(W){W.MANIFEST="m",W.AUDIO="a",W.VIDEO="v",W.MUXED="av",W.INIT="i",W.CAPTION="c",W.TIMED_TEXT="tt",W.KEY="k",W.OTHER="o"})(N||(N={}));var U;(function(W){W.DASH="d",W.HLS="h",W.SMOOTH="s",W.OTHER="o"})(U||(U={}));var G;(function(W){W.VOD="v",W.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(ne,$,k){"use strict";k.r($),k.d($,"HlsSkip",function(){return U}),k.d($,"getSkipValue",function(){return G}),k.d($,"HlsUrlParameters",function(){return W}),k.d($,"Level",function(){return i});function X(D,g){for(var d=0;d<g.length;d++){var m=g[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(D,m.key,m)}}function N(D,g,d){return g&&X(D.prototype,g),d&&X(D,d),D}var U;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(U||(U={}));function G(D,g){var d=D.canSkipUntil,m=D.canSkipDateRanges,u=D.endSN,a=g!==void 0?g-u:0;return d&&a<d?m?U.v2:U.Yes:U.No}var W=function(){function D(d,m,u){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=d,this.part=m,this.skip=u}var g=D.prototype;return g.addDirectives=function(m){var u=new self.URL(m);return this.msn!==void 0&&u.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&u.searchParams.set("_HLS_part",this.part.toString()),this.skip&&u.searchParams.set("_HLS_skip",this.skip),u.toString()},D}(),i=function(){function D(g){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(d){return d}).join(",").replace(/\.[^.,]+/g,"")}return N(D,[{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(d){var m=d%this.url.length;this._urlId!==m&&(this.details=void 0,this._urlId=m)}}]),D}()},"./src/types/loader.ts":function(ne,$,k){"use strict";k.r($),k.d($,"PlaylistContextType",function(){return X}),k.d($,"PlaylistLevelType",function(){return N});var X;(function(U){U.MANIFEST="manifest",U.LEVEL="level",U.AUDIO_TRACK="audioTrack",U.SUBTITLE_TRACK="subtitleTrack"})(X||(X={}));var N;(function(U){U.MAIN="main",U.AUDIO="audio",U.SUBTITLE="subtitle"})(N||(N={}))},"./src/types/transmuxer.ts":function(ne,$,k){"use strict";k.r($),k.d($,"ChunkMetadata",function(){return X});var X=function(G,W,i,D,g,d){D===void 0&&(D=0),g===void 0&&(g=-1),d===void 0&&(d=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=N(),this.buffering={audio:N(),video:N(),audiovideo:N()},this.level=G,this.sn=W,this.id=i,this.size=D,this.part=g,this.partial=d};function N(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ne,$,k){"use strict";k.r($),k.d($,"AttrList",function(){return U});var X=/^(\d+)x(\d+)$/,N=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,U=function(){function G(i){typeof i=="string"&&(i=G.parseAttrList(i));for(var D in i)i.hasOwnProperty(D)&&(this[D]=i[D])}var W=G.prototype;return W.decimalInteger=function(D){var g=parseInt(this[D],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},W.hexadecimalInteger=function(D){if(this[D]){var g=(this[D]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var d=new Uint8Array(g.length/2),m=0;m<g.length/2;m++)d[m]=parseInt(g.slice(m*2,m*2+2),16);return d}else return null},W.hexadecimalIntegerAsNumber=function(D){var g=parseInt(this[D],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},W.decimalFloatingPoint=function(D){return parseFloat(this[D])},W.optionalFloat=function(D,g){var d=this[D];return d?parseFloat(d):g},W.enumeratedString=function(D){return this[D]},W.bool=function(D){return this[D]==="YES"},W.decimalResolution=function(D){var g=X.exec(this[D]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},G.parseAttrList=function(D){var g,d={},m='"';for(N.lastIndex=0;(g=N.exec(D))!==null;){var u=g[2];u.indexOf(m)===0&&u.lastIndexOf(m)===u.length-1&&(u=u.slice(1,-1)),d[g[1]]=u}return d},G}()},"./src/utils/binary-search.ts":function(ne,$,k){"use strict";k.r($);var X={search:function(U,G){for(var W=0,i=U.length-1,D=null,g=null;W<=i;){D=(W+i)/2|0,g=U[D];var d=G(g);if(d>0)W=D+1;else if(d<0)i=D-1;else return g}return null}};$.default=X},"./src/utils/buffer-helper.ts":function(ne,$,k){"use strict";k.r($),k.d($,"BufferHelper",function(){return U});var X=k("./src/utils/logger.ts"),N={length:0,start:function(){return 0},end:function(){return 0}},U=function(){function G(){}return G.isBuffered=function(i,D){try{if(i){for(var g=G.getBuffered(i),d=0;d<g.length;d++)if(D>=g.start(d)&&D<=g.end(d))return!0}}catch(m){}return!1},G.bufferInfo=function(i,D,g){try{if(i){var d=G.getBuffered(i),m=[],u;for(u=0;u<d.length;u++)m.push({start:d.start(u),end:d.end(u)});return this.bufferedInfo(m,D,g)}}catch(a){}return{len:0,start:D,end:D,nextStart:void 0}},G.bufferedInfo=function(i,D,g){D=Math.max(0,D),i.sort(function(w,L){var R=w.start-L.start;return R||L.end-w.end});var d=[];if(g)for(var m=0;m<i.length;m++){var u=d.length;if(u){var a=d[u-1].end;i[m].start-a<g?i[m].end>a&&(d[u-1].end=i[m].end):d.push(i[m])}else d.push(i[m])}else d=i;for(var f=0,l,h=D,o=D,s=0;s<d.length;s++){var A=d[s].start,_=d[s].end;if(D+g>=A&&D<_)h=A,o=_,f=o-D;else if(D+g<A){l=A;break}}return{len:f,start:h||0,end:o||0,nextStart:l}},G.getBuffered=function(i){try{return i.buffered}catch(D){return X.logger.log("failed to get media.buffered",D),N}},G}()},"./src/utils/cea-608-parser.ts":function(ne,$,k){"use strict";k.r($),k.d($,"Row",function(){return o}),k.d($,"CaptionScreen",function(){return s});var X=k("./src/utils/logger.ts"),N={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},U=function(S){var x=S;return N.hasOwnProperty(S)&&(x=N[S]),String.fromCharCode(x)},G=15,W=100,i={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},D={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},d={25:2,26:4,29:6,30:8,31:10,27:13,28:15},m=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u;(function(C){C[C.ERROR=0]="ERROR",C[C.TEXT=1]="TEXT",C[C.WARNING=2]="WARNING",C[C.INFO=2]="INFO",C[C.DEBUG=3]="DEBUG",C[C.DATA=3]="DATA"})(u||(u={}));var a=function(){function C(){this.time=null,this.verboseLevel=u.ERROR}var S=C.prototype;return S.log=function(p,T){this.verboseLevel>=p&&X.logger.log(this.time+" ["+p+"] "+T)},C}(),f=function(S){for(var x=[],p=0;p<S.length;p++)x.push(S[p].toString(16));return x},l=function(){function C(x,p,T,v,y){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=x||"white",this.underline=p||!1,this.italics=T||!1,this.background=v||"black",this.flash=y||!1}var S=C.prototype;return S.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},S.setStyles=function(p){for(var T=["foreground","underline","italics","background","flash"],v=0;v<T.length;v++){var y=T[v];p.hasOwnProperty(y)&&(this[y]=p[y])}},S.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},S.equals=function(p){return this.foreground===p.foreground&&this.underline===p.underline&&this.italics===p.italics&&this.background===p.background&&this.flash===p.flash},S.copy=function(p){this.foreground=p.foreground,this.underline=p.underline,this.italics=p.italics,this.background=p.background,this.flash=p.flash},S.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},C}(),h=function(){function C(x,p,T,v,y,F){this.uchar=void 0,this.penState=void 0,this.uchar=x||" ",this.penState=new l(p,T,v,y,F)}var S=C.prototype;return S.reset=function(){this.uchar=" ",this.penState.reset()},S.setChar=function(p,T){this.uchar=p,this.penState.copy(T)},S.setPenState=function(p){this.penState.copy(p)},S.equals=function(p){return this.uchar===p.uchar&&this.penState.equals(p.penState)},S.copy=function(p){this.uchar=p.uchar,this.penState.copy(p.penState)},S.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},C}(),o=function(){function C(x){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var p=0;p<W;p++)this.chars.push(new h);this.logger=x,this.pos=0,this.currPenState=new l}var S=C.prototype;return S.equals=function(p){for(var T=!0,v=0;v<W;v++)if(!this.chars[v].equals(p.chars[v])){T=!1;break}return T},S.copy=function(p){for(var T=0;T<W;T++)this.chars[T].copy(p.chars[T])},S.isEmpty=function(){for(var p=!0,T=0;T<W;T++)if(!this.chars[T].isEmpty()){p=!1;break}return p},S.setCursor=function(p){this.pos!==p&&(this.pos=p),this.pos<0?(this.logger.log(u.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>W&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=W)},S.moveCursor=function(p){var T=this.pos+p;if(p>1)for(var v=this.pos+1;v<T+1;v++)this.chars[v].setPenState(this.currPenState);this.setCursor(T)},S.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},S.insertChar=function(p){p>=144&&this.backSpace();var T=U(p);if(this.pos>=W){this.logger.log(u.ERROR,"Cannot insert "+p.toString(16)+" ("+T+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(T,this.currPenState),this.moveCursor(1)},S.clearFromPos=function(p){var T;for(T=p;T<W;T++)this.chars[T].reset()},S.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},S.clearToEndOfRow=function(){this.clearFromPos(this.pos)},S.getTextString=function(){for(var p=[],T=!0,v=0;v<W;v++){var y=this.chars[v].uchar;y!==" "&&(T=!1),p.push(y)}return T?"":p.join("")},S.setPenStyles=function(p){this.currPenState.setStyles(p);var T=this.chars[this.pos];T.setPenState(this.currPenState)},C}(),s=function(){function C(x){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var p=0;p<G;p++)this.rows.push(new o(x));this.logger=x,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var S=C.prototype;return S.reset=function(){for(var p=0;p<G;p++)this.rows[p].clear();this.currRow=G-1},S.equals=function(p){for(var T=!0,v=0;v<G;v++)if(!this.rows[v].equals(p.rows[v])){T=!1;break}return T},S.copy=function(p){for(var T=0;T<G;T++)this.rows[T].copy(p.rows[T])},S.isEmpty=function(){for(var p=!0,T=0;T<G;T++)if(!this.rows[T].isEmpty()){p=!1;break}return p},S.backSpace=function(){var p=this.rows[this.currRow];p.backSpace()},S.clearToEndOfRow=function(){var p=this.rows[this.currRow];p.clearToEndOfRow()},S.insertChar=function(p){var T=this.rows[this.currRow];T.insertChar(p)},S.setPen=function(p){var T=this.rows[this.currRow];T.setPenStyles(p)},S.moveCursor=function(p){var T=this.rows[this.currRow];T.moveCursor(p)},S.setCursor=function(p){this.logger.log(u.INFO,"setCursor: "+p);var T=this.rows[this.currRow];T.setCursor(p)},S.setPAC=function(p){this.logger.log(u.INFO,"pacData = "+JSON.stringify(p));var T=p.row-1;if(this.nrRollUpRows&&T<this.nrRollUpRows-1&&(T=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==T){for(var v=0;v<G;v++)this.rows[v].clear();var y=this.currRow+1-this.nrRollUpRows,F=this.lastOutputScreen;if(F){var B=F.rows[y].cueStartTime,O=this.logger.time;if(B&&O!==null&&B<O)for(var j=0;j<this.nrRollUpRows;j++)this.rows[T-this.nrRollUpRows+j+1].copy(F.rows[y+j])}}this.currRow=T;var P=this.rows[this.currRow];if(p.indent!==null){var b=p.indent,Y=Math.max(b-1,0);P.setCursor(p.indent),p.color=P.chars[Y].penState.foreground}var ee={foreground:p.color,underline:p.underline,italics:p.italics,background:"black",flash:!1};this.setPen(ee)},S.setBkgData=function(p){this.logger.log(u.INFO,"bkgData = "+JSON.stringify(p)),this.backSpace(),this.setPen(p),this.insertChar(32)},S.setRollUpRows=function(p){this.nrRollUpRows=p},S.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(u.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(u.TEXT,this.getDisplayText());var p=this.currRow+1-this.nrRollUpRows,T=this.rows.splice(p,1)[0];T.clear(),this.rows.splice(this.currRow,0,T),this.logger.log(u.INFO,"Rolling up")},S.getDisplayText=function(p){p=p||!1;for(var T=[],v="",y=-1,F=0;F<G;F++){var B=this.rows[F].getTextString();B&&(y=F+1,p?T.push("Row "+y+": '"+B+"'"):T.push(B.trim()))}return T.length>0&&(p?v="["+T.join(" | ")+"]":v=T.join(`
|
|
`)),v},S.getTextAndFormat=function(){return this.rows},C}(),A=function(){function C(x,p,T){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=x,this.outputFilter=p,this.mode=null,this.verbose=0,this.displayedMemory=new s(T),this.nonDisplayedMemory=new s(T),this.lastOutputScreen=new s(T),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=T}var S=C.prototype;return S.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},S.getHandler=function(){return this.outputFilter},S.setHandler=function(p){this.outputFilter=p},S.setPAC=function(p){this.writeScreen.setPAC(p)},S.setBkgData=function(p){this.writeScreen.setBkgData(p)},S.setMode=function(p){if(p===this.mode)return;this.mode=p,this.logger.log(u.INFO,"MODE="+p),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=p},S.insertChars=function(p){for(var T=0;T<p.length;T++)this.writeScreen.insertChar(p[T]);var v=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(u.INFO,v+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(u.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},S.ccRCL=function(){this.logger.log(u.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},S.ccBS=function(){if(this.logger.log(u.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},S.ccAOF=function(){},S.ccAON=function(){},S.ccDER=function(){this.logger.log(u.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},S.ccRU=function(p){this.logger.log(u.INFO,"RU("+p+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(p)},S.ccFON=function(){this.logger.log(u.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},S.ccRDC=function(){this.logger.log(u.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},S.ccTR=function(){this.logger.log(u.INFO,"TR"),this.setMode("MODE_TEXT")},S.ccRTD=function(){this.logger.log(u.INFO,"RTD"),this.setMode("MODE_TEXT")},S.ccEDM=function(){this.logger.log(u.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},S.ccCR=function(){this.logger.log(u.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},S.ccENM=function(){this.logger.log(u.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},S.ccEOC=function(){if(this.logger.log(u.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var p=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=p,this.writeScreen=this.nonDisplayedMemory,this.logger.log(u.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},S.ccTO=function(p){this.logger.log(u.INFO,"TO("+p+") - Tab Offset"),this.writeScreen.moveCursor(p)},S.ccMIDROW=function(p){var T={flash:!1};if(T.underline=p%2===1,T.italics=p>=46,T.italics)T.foreground="white";else{var v=Math.floor(p/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];T.foreground=y[v]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(T)),this.writeScreen.setPen(T)},S.outputDataUpdate=function(p){p===void 0&&(p=!1);var T=this.logger.time;if(T===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=T:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,T,this.lastOutputScreen),p&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:T),this.lastOutputScreen.copy(this.displayedMemory))},S.cueSplitAtTime=function(p){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,p,this.displayedMemory),this.cueStartTime=p))},C}(),_=function(){function C(x,p,T){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var v=new a;this.channels=[null,new A(x,p,v),new A(x+1,T,v)],this.cmdHistory=R(),this.logger=v}var S=C.prototype;return S.getHandler=function(p){return this.channels[p].getHandler()},S.setHandler=function(p,T){this.channels[p].setHandler(T)},S.addData=function(p,T){var v,y,F,B=!1;this.logger.time=p;for(var O=0;O<T.length;O+=2){if(y=T[O]&127,F=T[O+1]&127,y===0&&F===0)continue;if(this.logger.log(u.DATA,"["+f([T[O],T[O+1]])+"] -> ("+f([y,F])+")"),v=this.parseCmd(y,F),v||(v=this.parseMidrow(y,F)),v||(v=this.parsePAC(y,F)),v||(v=this.parseBackgroundAttributes(y,F)),!v&&(B=this.parseChars(y,F),B)){var j=this.currentChannel;if(j&&j>0){var P=this.channels[j];P.insertChars(B)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!v&&!B&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+f([y,F])+" orig: "+f([T[O],T[O+1]]))}},S.parseCmd=function(p,T){var v=this.cmdHistory,y=(p===20||p===28||p===21||p===29)&&T>=32&&T<=47,F=(p===23||p===31)&&T>=33&&T<=35;if(!(y||F))return!1;if(L(p,T,v))return w(null,null,v),this.logger.log(u.DEBUG,"Repeated command ("+f([p,T])+") is dropped"),!0;var B=p===20||p===21||p===23?1:2,O=this.channels[B];return p===20||p===21||p===28||p===29?T===32?O.ccRCL():T===33?O.ccBS():T===34?O.ccAOF():T===35?O.ccAON():T===36?O.ccDER():T===37?O.ccRU(2):T===38?O.ccRU(3):T===39?O.ccRU(4):T===40?O.ccFON():T===41?O.ccRDC():T===42?O.ccTR():T===43?O.ccRTD():T===44?O.ccEDM():T===45?O.ccCR():T===46?O.ccENM():T===47&&O.ccEOC():O.ccTO(T-32),w(p,T,v),this.currentChannel=B,!0},S.parseMidrow=function(p,T){var v=0;if((p===17||p===25)&&T>=32&&T<=47){if(p===17?v=1:v=2,v!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[v];return y?(y.ccMIDROW(T),this.logger.log(u.DEBUG,"MIDROW ("+f([p,T])+")"),!0):!1}return!1},S.parsePAC=function(p,T){var v,y=this.cmdHistory,F=(p>=17&&p<=23||p>=25&&p<=31)&&T>=64&&T<=127,B=(p===16||p===24)&&T>=64&&T<=95;if(!(F||B))return!1;if(L(p,T,y))return w(null,null,y),!0;var O=p<=23?1:2;T>=64&&T<=95?v=O===1?i[p]:g[p]:v=O===1?D[p]:d[p];var j=this.channels[O];return j?(j.setPAC(this.interpretPAC(v,T)),w(p,T,y),this.currentChannel=O,!0):!1},S.interpretPAC=function(p,T){var v,y={color:null,italics:!1,indent:null,underline:!1,row:p};return T>95?v=T-96:v=T-64,y.underline=(v&1)===1,v<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(v/2)]:v<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((v-16)/2)*4,y},S.parseChars=function(p,T){var v,y=null,F=null;if(p>=25?(v=2,F=p-8):(v=1,F=p),F>=17&&F<=19){var B;F===17?B=T+80:F===18?B=T+112:B=T+144,this.logger.log(u.INFO,"Special char '"+U(B)+"' in channel "+v),y=[B]}else p>=32&&p<=127&&(y=T===0?[p]:[p,T]);if(y){var O=f(y);this.logger.log(u.DEBUG,"Char codes = "+O.join(",")),w(p,T,this.cmdHistory)}return y},S.parseBackgroundAttributes=function(p,T){var v=(p===16||p===24)&&T>=32&&T<=47,y=(p===23||p===31)&&T>=45&&T<=47;if(!(v||y))return!1;var F,B={};p===16||p===24?(F=Math.floor((T-32)/2),B.background=m[F],T%2===1&&(B.background=B.background+"_semi")):T===45?B.background="transparent":(B.foreground="black",T===47&&(B.underline=!0));var O=p<=23?1:2,j=this.channels[O];return j.setBkgData(B),w(p,T,this.cmdHistory),!0},S.reset=function(){for(var p=0;p<Object.keys(this.channels).length;p++){var T=this.channels[p];T&&T.reset()}this.cmdHistory=R()},S.cueSplitAtTime=function(p){for(var T=0;T<this.channels.length;T++){var v=this.channels[T];v&&v.cueSplitAtTime(p)}},C}();function w(C,S,x){x.a=C,x.b=S}function L(C,S,x){return x.a===C&&x.b===S}function R(){return{a:null,b:null}}$.default=_},"./src/utils/codecs.ts":function(ne,$,k){"use strict";k.r($),k.d($,"isCodecType",function(){return N}),k.d($,"isCodecSupportedInMp4",function(){return U});var X={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function N(G,W){var i=X[W];return!!i&&i[G.slice(0,4)]===!0}function U(G,W){return MediaSource.isTypeSupported((W||"video")+'/mp4;codecs="'+G+'"')}},"./src/utils/cues.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/utils/vttparser.ts"),N=k("./src/utils/webvtt-parser.ts"),U=k("./src/utils/texttrack-utils.ts"),G=/\s/,W={newCue:function(D,g,d,m){for(var u=[],a,f,l,h,o,s=self.VTTCue||self.TextTrackCue,A=0;A<m.rows.length;A++)if(a=m.rows[A],l=!0,h=0,o="",!a.isEmpty()){for(var _=0;_<a.chars.length;_++)G.test(a.chars[_].uchar)&&l?h++:(o+=a.chars[_].uchar,l=!1);a.cueStartTime=g,g===d&&(d+=1e-4),h>=16?h--:h++;var w=Object(X.fixLineBreaks)(o.trim()),L=Object(N.generateCueId)(g,d,w);(!D||!D.cues||!D.cues.getCueById(L))&&(f=new s(g,d,w),f.id=L,f.line=A+1,f.align="left",f.position=10+Math.min(80,Math.floor(h*8/32)*10),u.push(f))}return D&&u.length&&(u.sort(function(R,C){return R.line==="auto"||C.line==="auto"?0:R.line>8&&C.line>8?C.line-R.line:R.line-C.line}),u.forEach(function(R){return Object(U.addCueToTrack)(D,R)})),u}};$.default=W},"./src/utils/discontinuities.ts":function(ne,$,k){"use strict";k.r($),k.d($,"findFirstFragWithCC",function(){return G}),k.d($,"shouldAlignOnDiscontinuities",function(){return W}),k.d($,"findDiscontinuousReferenceFrag",function(){return i}),k.d($,"adjustSlidingStart",function(){return g}),k.d($,"alignStream",function(){return d}),k.d($,"alignPDT",function(){return u}),k.d($,"alignFragmentByPDTDelta",function(){return a}),k.d($,"alignMediaPlaylistByPDT",function(){return f});var X=k("./src/polyfills/number.ts"),N=k("./src/utils/logger.ts"),U=k("./src/controller/level-helper.ts");function G(l,h){for(var o=null,s=0,A=l.length;s<A;s++){var _=l[s];if(_&&_.cc===h){o=_;break}}return o}function W(l,h,o){return!!(h.details&&(o.endCC>o.startCC||l&&l.cc<o.startCC))}function i(l,h){var o=l.fragments,s=h.fragments;if(!s.length||!o.length){N.logger.log("No fragments to align");return}var A=G(o,s[0].cc);if(!A||A&&!A.startPTS){N.logger.log("No frag in previous level to align on");return}return A}function D(l,h){if(l){var o=l.start+h;l.start=l.startPTS=o,l.endPTS=o+l.duration}}function g(l,h){for(var o=h.fragments,s=0,A=o.length;s<A;s++)D(o[s],l);h.fragmentHint&&D(h.fragmentHint,l),h.alignedSliding=!0}function d(l,h,o){if(!h)return;m(l,o,h),!o.alignedSliding&&h.details&&u(o,h.details),!o.alignedSliding&&h.details&&!o.skippedSegments&&Object(U.adjustSliding)(h.details,o)}function m(l,h,o){if(W(l,o,h)){var s=i(o.details,h);s&&Object(X.isFiniteNumber)(s.start)&&(N.logger.log("Adjusting PTS using last level due to CC increase within current level "+h.url),g(s.start,h))}}function u(l,h){if(!h.fragments.length||!l.hasProgramDateTime||!h.hasProgramDateTime)return;var o=h.fragments[0].programDateTime,s=l.fragments[0].programDateTime,A=(s-o)/1e3+h.fragments[0].start;A&&Object(X.isFiniteNumber)(A)&&(N.logger.log("Adjusting PTS using programDateTime delta "+(s-o)+"ms, sliding:"+A.toFixed(3)+" "+l.url+" "),g(A,l))}function a(l,h){var o=l.programDateTime;if(!o)return;var s=(o-h)/1e3;l.start=l.startPTS=s,l.endPTS=s+l.duration}function f(l,h){if(!h.fragments.length||!l.hasProgramDateTime||!h.hasProgramDateTime)return;var o=h.fragments[0].programDateTime,s=h.fragments[0].start,A=o-s*1e3;l.fragments.forEach(function(_){a(_,A)}),l.fragmentHint&&a(l.fragmentHint,A),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/utils/ewma.ts"),N=function(){function U(W,i,D){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=D,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new X.default(W),this.fast_=new X.default(i)}var G=U.prototype;return G.update=function(i,D){var g=this.slow_,d=this.fast_;this.slow_.halfLife!==i&&(this.slow_=new X.default(i,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new X.default(D,d.getEstimate(),d.getTotalWeight()))},G.sample=function(i,D){i=Math.max(i,this.minDelayMs_);var g=8*D,d=i/1e3,m=g/d;this.fast_.sample(d,m),this.slow_.sample(d,m)},G.canEstimate=function(){var i=this.fast_;return i&&i.getTotalWeight()>=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},U}();$.default=N},"./src/utils/ewma.ts":function(ne,$,k){"use strict";k.r($);var X=function(){function N(G,W,i){W===void 0&&(W=0),i===void 0&&(i=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=G,this.alpha_=G?Math.exp(Math.log(.5)/G):0,this.estimate_=W,this.totalWeight_=i}var U=N.prototype;return U.sample=function(W,i){var D=Math.pow(this.alpha_,W);this.estimate_=i*(1-D)+D*this.estimate_,this.totalWeight_+=W},U.getTotalWeight=function(){return this.totalWeight_},U.getEstimate=function(){if(this.alpha_){var W=1-Math.pow(this.alpha_,this.totalWeight_);if(W)return this.estimate_/W}return this.estimate_},N}();$.default=X},"./src/utils/fetch-loader.ts":function(ne,$,k){"use strict";k.r($),k.d($,"fetchSupported",function(){return a});var X=k("./src/polyfills/number.ts"),N=k("./src/loader/load-stats.ts"),U=k("./src/demux/chunk-cache.ts");function G(s,A){s.prototype=Object.create(A.prototype),s.prototype.constructor=s,d(s,A)}function W(s){var A=typeof Map=="function"?new Map:void 0;return W=function(w){if(w===null||!g(w))return w;if(typeof w!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A!="undefined"){if(A.has(w))return A.get(w);A.set(w,L)}function L(){return i(w,arguments,m(this).constructor)}return L.prototype=Object.create(w.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),d(L,w)},W(s)}function i(s,A,_){return D()?i=Reflect.construct:i=function(L,R,C){var S=[null];S.push.apply(S,R);var x=Function.bind.apply(L,S),p=new x;return C&&d(p,C.prototype),p},i.apply(null,arguments)}function D(){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(s){return!1}}function g(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function d(s,A){return d=Object.setPrototypeOf||function(w,L){return w.__proto__=L,w},d(s,A)}function m(s){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},m(s)}function u(){return u=Object.assign||function(s){for(var A=1;A<arguments.length;A++){var _=arguments[A];for(var w in _)Object.prototype.hasOwnProperty.call(_,w)&&(s[w]=_[w])}return s},u.apply(this,arguments)}function a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(s){}return!1}var f=function(){function s(_){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=_.fetchSetup||h,this.controller=new self.AbortController,this.stats=new N.LoadStats}var A=s.prototype;return A.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},A.abortInternal=function(){var w=this.response;(!w||!w.ok)&&(this.stats.aborted=!0,this.controller.abort())},A.abort=function(){var w;this.abortInternal(),(w=this.callbacks)!==null&&w!==void 0&&w.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},A.load=function(w,L,R){var C=this,S=this.stats;if(S.loading.start)throw new Error("Loader can only be used once.");S.loading.start=self.performance.now();var x=l(w,this.controller.signal),p=R.onProgress,T=w.responseType==="arraybuffer",v=T?"byteLength":"length";this.context=w,this.config=L,this.callbacks=R,this.request=this.fetchSetup(w,x),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){C.abortInternal(),R.onTimeout(S,w,C.response)},L.timeout),self.fetch(this.request).then(function(y){if(C.response=C.loader=y,!y.ok){var F=y.status,B=y.statusText;throw new o(B||"fetch, bad network response",F,y)}return S.loading.first=Math.max(self.performance.now(),S.loading.start),S.total=parseInt(y.headers.get("Content-Length")||"0"),p&&Object(X.isFiniteNumber)(L.highWaterMark)?C.loadProgressively(y,S,w,L.highWaterMark,p):T?y.arrayBuffer():y.text()}).then(function(y){var F=C.response;self.clearTimeout(C.requestTimeout),S.loading.end=Math.max(self.performance.now(),S.loading.first),S.loaded=S.total=y[v];var B={url:F.url,data:y};p&&!Object(X.isFiniteNumber)(L.highWaterMark)&&p(S,w,y,F),R.onSuccess(B,S,w,F)}).catch(function(y){if(self.clearTimeout(C.requestTimeout),S.aborted)return;var F=y.code||0;R.onError({code:F,text:y.message},w,y.details)})},A.getCacheAge=function(){var w=null;if(this.response){var L=this.response.headers.get("age");w=L?parseFloat(L):null}return w},A.loadProgressively=function(w,L,R,C,S){C===void 0&&(C=0);var x=new U.default,p=w.body.getReader(),T=function v(){return p.read().then(function(y){if(y.done)return x.dataLength&&S(L,R,x.flush(),w),Promise.resolve(new ArrayBuffer(0));var F=y.value,B=F.length;return L.loaded+=B,B<C||x.dataLength?(x.push(F),x.dataLength>=C&&S(L,R,x.flush(),w)):S(L,R,F,w),v()}).catch(function(){return Promise.reject()})};return T()},s}();function l(s,A){var _={method:"GET",mode:"cors",credentials:"same-origin",signal:A,headers:new self.Headers(u({},s.headers))};return s.rangeEnd&&_.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),_}function h(s,A){return new self.Request(s.url,A)}var o=function(s){G(A,s);function A(_,w,L){var R;return R=s.call(this,_)||this,R.code=void 0,R.details=void 0,R.code=w,R.details=L,R}return A}(W(Error));$.default=f},"./src/utils/imsc1-ttml-parser.ts":function(ne,$,k){"use strict";k.r($),k.d($,"IMSC1_CODEC",function(){return g}),k.d($,"parseIMSC1",function(){return a});var X=k("./src/utils/mp4-tools.ts"),N=k("./src/utils/vttparser.ts"),U=k("./src/utils/vttcue.ts"),G=k("./src/demux/id3.ts"),W=k("./src/utils/timescale-conversion.ts"),i=k("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(C){for(var S=1;S<arguments.length;S++){var x=arguments[S];for(var p in x)Object.prototype.hasOwnProperty.call(x,p)&&(C[p]=x[p])}return C},D.apply(this,arguments)}var g="stpp.ttml.im1t",d=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,m=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,u={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(C,S,x,p,T){var v=Object(X.findBox)(new Uint8Array(C),["mdat"]);if(v.length===0){T(new Error("Could not parse IMSC1 mdat"));return}var y=v[0],F=Object(G.utf8ArrayToStr)(new Uint8Array(C,y.start,y.end-y.start)),B=Object(W.toTimescaleFromScale)(S,1,x);try{p(f(F,B))}catch(O){T(O)}}function f(C,S){var x=new DOMParser,p=x.parseFromString(C,"text/xml"),T=p.getElementsByTagName("tt")[0];if(!T)throw new Error("Invalid ttml");var v={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},y=Object.keys(v).reduce(function(P,b){return P[b]=T.getAttribute("ttp:"+b)||v[b],P},{}),F=T.getAttribute("xml:space")!=="preserve",B=h(l(T,"styling","style")),O=h(l(T,"layout","region")),j=l(T,"body","[begin]");return[].map.call(j,function(P){var b=o(P,F);if(!b||!P.hasAttribute("begin"))return null;var Y=w(P.getAttribute("begin"),y),ee=w(P.getAttribute("dur"),y),ae=w(P.getAttribute("end"),y);if(Y===null)throw _(P);if(ae===null){if(ee===null)throw _(P);ae=Y+ee}var le=new U.default(Y-S,ae-S,b);le.id=Object(i.generateCueId)(le.startTime,le.endTime,le.text);var Re=O[P.getAttribute("region")],Ee=B[P.getAttribute("style")];le.position=10,le.size=80;var Te=s(Re,Ee),Ae=Te.textAlign;if(Ae){var Oe=u[Ae];Oe&&(le.lineAlign=Oe),le.align=Ae}return D(le,Te),le}).filter(function(P){return P!==null})}function l(C,S,x){var p=C.getElementsByTagName(S)[0];return p?[].slice.call(p.querySelectorAll(x)):[]}function h(C){return C.reduce(function(S,x){var p=x.getAttribute("xml:id");return p&&(S[p]=x),S},{})}function o(C,S){return[].slice.call(C.childNodes).reduce(function(x,p,T){var v;return p.nodeName==="br"&&T?x+`
|
|
`:(v=p.childNodes)!==null&&v!==void 0&&v.length?o(p,S):S?x+p.textContent.trim().replace(/\s+/g," "):x+p.textContent},"")}function s(C,S){var x="http://www.w3.org/ns/ttml#styling",p=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return p.reduce(function(T,v){var y=A(S,x,v)||A(C,x,v);return y&&(T[v]=y),T},{})}function A(C,S,x){return C.hasAttributeNS(S,x)?C.getAttributeNS(S,x):null}function _(C){return new Error("Could not parse ttml timestamp "+C)}function w(C,S){if(!C)return null;var x=Object(N.parseTimeStamp)(C);return x===null&&(d.test(C)?x=L(C,S):m.test(C)&&(x=R(C,S))),x}function L(C,S){var x=d.exec(C),p=(x[4]|0)+(x[5]|0)/S.subFrameRate;return(x[1]|0)*3600+(x[2]|0)*60+(x[3]|0)+p/S.frameRate}function R(C,S){var x=m.exec(C),p=Number(x[1]),T=x[2];switch(T){case"h":return p*3600;case"m":return p*60;case"ms":return p*1e3;case"f":return p/S.frameRate;case"t":return p/S.tickRate}return p}},"./src/utils/logger.ts":function(ne,$,k){"use strict";k.r($),k.d($,"enableLogs",function(){return i}),k.d($,"logger",function(){return D});var X=function(){},N={trace:X,debug:X,log:X,warn:X,info:X,error:X},U=N;function G(g){var d=self.console[g];return d?d.bind(self.console,"["+g+"] >"):X}function W(g){for(var d=arguments.length,m=new Array(d>1?d-1:0),u=1;u<d;u++)m[u-1]=arguments[u];m.forEach(function(a){U[a]=g[a]?g[a].bind(g):G(a)})}function i(g){if(self.console&&g===!0||typeof g=="object"){W(g,"debug","log","info","warn","error");try{U.log()}catch(d){U=N}}else U=N}var D=U},"./src/utils/mediakeys-helper.ts":function(ne,$,k){"use strict";k.r($),k.d($,"KeySystems",function(){return X}),k.d($,"requestMediaKeySystemAccess",function(){return N});var X;(function(U){U.WIDEVINE="com.widevine.alpha",U.PLAYREADY="com.microsoft.playready"})(X||(X={}));var N=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ne,$,k){"use strict";k.r($),k.d($,"getMediaSource",function(){return X});function X(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ne,$,k){"use strict";k.r($),k.d($,"bin2str",function(){return W}),k.d($,"readUint16",function(){return i}),k.d($,"readUint32",function(){return D}),k.d($,"writeUint32",function(){return g}),k.d($,"findBox",function(){return d}),k.d($,"parseSegmentIndex",function(){return m}),k.d($,"parseInitSegment",function(){return u}),k.d($,"getStartDTS",function(){return a}),k.d($,"getDuration",function(){return f}),k.d($,"computeRawDurationFromSamples",function(){return l}),k.d($,"offsetStartDTS",function(){return h}),k.d($,"segmentValidRange",function(){return o}),k.d($,"appendUint8Array",function(){return s});var X=k("./src/utils/typed-array.ts"),N=k("./src/loader/fragment.ts"),U=Math.pow(2,32)-1,G=[].push;function W(A){return String.fromCharCode.apply(null,A)}function i(A,_){"data"in A&&(_+=A.start,A=A.data);var w=A[_]<<8|A[_+1];return w<0?65536+w:w}function D(A,_){"data"in A&&(_+=A.start,A=A.data);var w=A[_]<<24|A[_+1]<<16|A[_+2]<<8|A[_+3];return w<0?4294967296+w:w}function g(A,_,w){"data"in A&&(_+=A.start,A=A.data),A[_]=w>>24,A[_+1]=w>>16&255,A[_+2]=w>>8&255,A[_+3]=w&255}function d(A,_){var w=[];if(!_.length)return w;var L,R,C;"data"in A?(L=A.data,R=A.start,C=A.end):(L=A,R=0,C=L.byteLength);for(var S=R;S<C;){var x=D(L,S),p=W(L.subarray(S+4,S+8)),T=x>1?S+x:C;if(p===_[0])if(_.length===1)w.push({data:L,start:S+8,end:T});else{var v=d({data:L,start:S+8,end:T},_.slice(1));v.length&&G.apply(w,v)}S=T}return w}function m(A){var _=d(A,["moov"]),w=_[0],L=w?w.end:null,R=d(A,["sidx"]);if(!R||!R[0])return null;var C=[],S=R[0],x=S.data[0],p=x===0?8:16,T=D(S,p);p+=4;var v=0,y=0;x===0?p+=8:p+=16,p+=2;var F=S.end+y,B=i(S,p);p+=2;for(var O=0;O<B;O++){var j=p,P=D(S,j);j+=4;var b=P&2147483647,Y=(P&2147483648)>>>31;if(Y===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ee=D(S,j);j+=4,C.push({referenceSize:b,subsegmentDuration:ee,info:{duration:ee/T,start:F,end:F+b-1}}),F+=b,j+=4,p=j}return{earliestPresentationTime:v,timescale:T,version:x,referencesCount:B,references:C,moovEndOffset:L}}function u(A){for(var _=[],w=d(A,["moov","trak"]),L=0;L<w.length;L++){var R=w[L],C=d(R,["tkhd"])[0];if(C){var S=C.data[C.start],x=S===0?12:20,p=D(C,x),T=d(R,["mdia","mdhd"])[0];if(T){S=T.data[T.start],x=S===0?12:20;var v=D(T,x),y=d(R,["mdia","hdlr"])[0];if(y){var F=W(y.data.subarray(y.start+8,y.start+12)),B={soun:N.ElementaryStreamTypes.AUDIO,vide:N.ElementaryStreamTypes.VIDEO}[F];if(B){var O=d(R,["mdia","minf","stbl","stsd"])[0],j=void 0;O&&(j=W(O.data.subarray(O.start+12,O.start+16))),_[p]={timescale:v,type:B},_[B]={timescale:v,id:p,codec:j}}}}}}var P=d(A,["moov","mvex","trex"]);return P.forEach(function(b){var Y=D(b,4),ee=_[Y];ee&&(ee.default={duration:D(b,12),flags:D(b,20)})}),_}function a(A,_){return d(_,["moof","traf"]).reduce(function(w,L){var R=d(L,["tfdt"])[0],C=R.data[R.start],S=d(L,["tfhd"]).reduce(function(x,p){var T=D(p,4),v=A[T];if(v){var y=D(R,4);C===1&&(y*=Math.pow(2,32),y+=D(R,8));var F=v.timescale||9e4,B=y/F;if(isFinite(B)&&(x===null||B<x))return B}return x},null);return S!==null&&isFinite(S)&&(w===null||S<w)?S:w},null)||0}function f(A,_){for(var w=0,L=0,R=0,C=d(A,["moof","traf"]),S=0;S<C.length;S++){var x=C[S],p=d(x,["tfhd"])[0],T=D(p,4),v=_[T];if(!v)continue;var y=v.default,F=D(p,0)|(y==null?void 0:y.flags),B=y==null?void 0:y.duration;F&8&&(F&2?B=D(p,12):B=D(p,8));for(var O=v.timescale||9e4,j=d(x,["trun"]),P=0;P<j.length;P++){if(B){var b=D(j[P],4);w=B*b}else w=l(j[P]);v.type===N.ElementaryStreamTypes.VIDEO?L+=w/O:v.type===N.ElementaryStreamTypes.AUDIO&&(R+=w/O)}}if(L===0&&R===0){var Y=m(A);if(Y!=null&&Y.references)return Y.references.reduce(function(ee,ae){return ee+ae.info.duration||0},0)}return L||R}function l(A){var _=D(A,0),w=8;_&1&&(w+=4),_&4&&(w+=4);for(var L=0,R=D(A,4),C=0;C<R;C++){if(_&256){var S=D(A,w);L+=S,w+=4}_&512&&(w+=4),_&1024&&(w+=4),_&2048&&(w+=4)}return L}function h(A,_,w){d(_,["moof","traf"]).forEach(function(L){d(L,["tfhd"]).forEach(function(R){var C=D(R,4),S=A[C];if(!S)return;var x=S.timescale||9e4;d(L,["tfdt"]).forEach(function(p){var T=p.data[p.start],v=D(p,4);if(T===0)g(p,4,v-w*x);else{v*=Math.pow(2,32),v+=D(p,8),v-=w*x,v=Math.max(v,0);var y=Math.floor(v/(U+1)),F=Math.floor(v%(U+1));g(p,4,y),g(p,8,F)}})})})}function o(A){var _={valid:null,remainder:null},w=d(A,["moof"]);if(w){if(w.length<2)return _.remainder=A,_}else return _;var L=w[w.length-1];return _.valid=Object(X.sliceUint8)(A,0,L.start-8),_.remainder=Object(X.sliceUint8)(A,L.start-8),_}function s(A,_){var w=new Uint8Array(A.length+_.length);return w.set(A),w.set(_,A.length),w}},"./src/utils/output-filter.ts":function(ne,$,k){"use strict";k.r($),k.d($,"default",function(){return X});var X=function(){function N(G,W){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=W}var U=N.prototype;return U.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},U.newCue=function(W,i,D){(this.startTime===null||this.startTime>W)&&(this.startTime=W),this.endTime=i,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},U.reset=function(){this.cueRanges=[]},N}()},"./src/utils/texttrack-utils.ts":function(ne,$,k){"use strict";k.r($),k.d($,"sendAddTrackEvent",function(){return N}),k.d($,"addCueToTrack",function(){return U}),k.d($,"clearCurrentCues",function(){return G}),k.d($,"removeCuesInRange",function(){return W}),k.d($,"getCuesInRange",function(){return D});var X=k("./src/utils/logger.ts");function N(g,d){var m;try{m=new Event("addtrack")}catch(u){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=g,d.dispatchEvent(m)}function U(g,d){var m=g.mode;if(m==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(d.id))try{if(g.addCue(d),!g.cues.getCueById(d.id))throw new Error("addCue is failed for: "+d)}catch(a){X.logger.debug("[texttrack-utils]: "+a);var u=new self.TextTrackCue(d.startTime,d.endTime,d.text);u.id=d.id,g.addCue(u)}m==="disabled"&&(g.mode=m)}function G(g){var d=g.mode;if(d==="disabled"&&(g.mode="hidden"),g.cues)for(var m=g.cues.length;m--;)g.removeCue(g.cues[m]);d==="disabled"&&(g.mode=d)}function W(g,d,m){var u=g.mode;if(u==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var a=D(g.cues,d,m),f=0;f<a.length;f++)g.removeCue(a[f]);u==="disabled"&&(g.mode=u)}function i(g,d){if(d<g[0].startTime)return 0;var m=g.length-1;if(d>g[m].endTime)return-1;for(var u=0,a=m;u<=a;){var f=Math.floor((a+u)/2);if(d<g[f].startTime)a=f-1;else if(d>g[f].startTime&&u<m)u=f+1;else return f}return g[u].startTime-d<d-g[a].startTime?u:a}function D(g,d,m){var u=[],a=i(g,d);if(a>-1)for(var f=a,l=g.length;f<l;f++){var h=g[f];if(h.startTime>=d&&h.endTime<=m)u.push(h);else if(h.startTime>m)return u}return u}},"./src/utils/time-ranges.ts":function(ne,$,k){"use strict";k.r($);var X={toString:function(U){for(var G="",W=U.length,i=0;i<W;i++)G+="["+U.start(i).toFixed(3)+","+U.end(i).toFixed(3)+"]";return G}};$.default=X},"./src/utils/timescale-conversion.ts":function(ne,$,k){"use strict";k.r($),k.d($,"toTimescaleFromBase",function(){return N}),k.d($,"toTimescaleFromScale",function(){return U}),k.d($,"toMsFromMpegTsClock",function(){return G}),k.d($,"toMpegTsClockFromTimescale",function(){return W});var X=9e4;function N(i,D,g,d){g===void 0&&(g=1),d===void 0&&(d=!1);var m=i*D*g;return d?Math.round(m):m}function U(i,D,g,d){return g===void 0&&(g=1),d===void 0&&(d=!1),N(i,D,1/g,d)}function G(i,D){return D===void 0&&(D=!1),N(i,1e3,1/X,D)}function W(i,D){return D===void 0&&(D=1),N(i,X,1/D)}},"./src/utils/typed-array.ts":function(ne,$,k){"use strict";k.r($),k.d($,"sliceUint8",function(){return X});function X(N,U,G){return Uint8Array.prototype.slice?N.slice(U,G):new Uint8Array(Array.prototype.slice.call(N,U,G))}},"./src/utils/vttcue.ts":function(ne,$,k){"use strict";k.r($),$.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var X=["","lr","rl"],N=["start","middle","end","left","right"];function U(g,d){if(typeof d!="string")return!1;if(!Array.isArray(g))return!1;var m=d.toLowerCase();return~g.indexOf(m)?m:!1}function G(g){return U(X,g)}function W(g){return U(N,g)}function i(g){for(var d=arguments.length,m=new Array(d>1?d-1:0),u=1;u<d;u++)m[u-1]=arguments[u];for(var a=1;a<arguments.length;a++){var f=arguments[a];for(var l in f)g[l]=f[l]}return g}function D(g,d,m){var u=this,a={enumerable:!0};u.hasBeenReset=!1;var f="",l=!1,h=g,o=d,s=m,A=null,_="",w=!0,L="auto",R="start",C=50,S="middle",x=50,p="middle";Object.defineProperty(u,"id",i({},a,{get:function(){return f},set:function(v){f=""+v}})),Object.defineProperty(u,"pauseOnExit",i({},a,{get:function(){return l},set:function(v){l=!!v}})),Object.defineProperty(u,"startTime",i({},a,{get:function(){return h},set:function(v){if(typeof v!="number")throw new TypeError("Start time must be set to a number.");h=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",i({},a,{get:function(){return o},set:function(v){if(typeof v!="number")throw new TypeError("End time must be set to a number.");o=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"text",i({},a,{get:function(){return s},set:function(v){s=""+v,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",i({},a,{get:function(){return A},set:function(v){A=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",i({},a,{get:function(){return _},set:function(v){var y=G(v);if(y===!1)throw new SyntaxError("An invalid or illegal string was specified.");_=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",i({},a,{get:function(){return w},set:function(v){w=!!v,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",i({},a,{get:function(){return L},set:function(v){if(typeof v!="number"&&v!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");L=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"lineAlign",i({},a,{get:function(){return R},set:function(v){var y=W(v);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");R=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",i({},a,{get:function(){return C},set:function(v){if(v<0||v>100)throw new Error("Position must be between 0 and 100.");C=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",i({},a,{get:function(){return S},set:function(v){var y=W(v);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");S=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",i({},a,{get:function(){return x},set:function(v){if(v<0||v>100)throw new Error("Size must be between 0 and 100.");x=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",i({},a,{get:function(){return p},set:function(v){var y=W(v);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");p=y,this.hasBeenReset=!0}})),u.displayState=void 0}return D.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(ne,$,k){"use strict";k.r($),k.d($,"parseTimeStamp",function(){return U}),k.d($,"fixLineBreaks",function(){return d}),k.d($,"VTTParser",function(){return m});var X=k("./src/utils/vttcue.ts"),N=function(){function u(){}var a=u.prototype;return a.decode=function(l,h){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},u}();function U(u){function a(l,h,o,s){return(l|0)*3600+(h|0)*60+(o|0)+parseFloat(s||0)}var f=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?a(f[2],f[3],0,f[4]):a(f[1],f[2],f[3],f[4]):null}var G=function(){function u(){this.values=Object.create(null)}var a=u.prototype;return a.set=function(l,h){!this.get(l)&&h!==""&&(this.values[l]=h)},a.get=function(l,h,o){return o?this.has(l)?this.values[l]:h[o]:this.has(l)?this.values[l]:h},a.has=function(l){return l in this.values},a.alt=function(l,h,o){for(var s=0;s<o.length;++s)if(h===o[s]){this.set(l,h);break}},a.integer=function(l,h){/^-?\d+$/.test(h)&&this.set(l,parseInt(h,10))},a.percent=function(l,h){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(h)){var o=parseFloat(h);if(o>=0&&o<=100)return this.set(l,o),!0}return!1},u}();function W(u,a,f,l){var h=l?u.split(l):[u];for(var o in h){if(typeof h[o]!="string")continue;var s=h[o].split(f);if(s.length!==2)continue;var A=s[0],_=s[1];a(A,_)}}var i=new X.default(0,0,""),D=i.align==="middle"?"middle":"center";function g(u,a,f){var l=u;function h(){var A=U(u);if(A===null)throw new Error("Malformed timestamp: "+l);return u=u.replace(/^[^\sa-zA-Z-]+/,""),A}function o(A,_){var w=new G;W(A,function(C,S){var x;switch(C){case"region":for(var p=f.length-1;p>=0;p--)if(f[p].id===S){w.set(C,f[p].region);break}break;case"vertical":w.alt(C,S,["rl","lr"]);break;case"line":x=S.split(","),w.integer(C,x[0]),w.percent(C,x[0])&&w.set("snapToLines",!1),w.alt(C,x[0],["auto"]),x.length===2&&w.alt("lineAlign",x[1],["start",D,"end"]);break;case"position":x=S.split(","),w.percent(C,x[0]),x.length===2&&w.alt("positionAlign",x[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":w.percent(C,S);break;case"align":w.alt(C,S,["start",D,"end","left","right"]);break}},/:/,/\s/),_.region=w.get("region",null),_.vertical=w.get("vertical","");var L=w.get("line","auto");L==="auto"&&i.line===-1&&(L=-1),_.line=L,_.lineAlign=w.get("lineAlign","start"),_.snapToLines=w.get("snapToLines",!0),_.size=w.get("size",100),_.align=w.get("align",D);var R=w.get("position","auto");R==="auto"&&i.position===50&&(R=_.align==="start"||_.align==="left"?0:_.align==="end"||_.align==="right"?100:50),_.position=R}function s(){u=u.replace(/^\s+/,"")}if(s(),a.startTime=h(),s(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);u=u.substr(3),s(),a.endTime=h(),s(),o(u,a)}function d(u){return u.replace(/<br(?: \/)?>/gi,`
|
|
`)}var m=function(){function u(){this.state="INITIAL",this.buffer="",this.decoder=new N,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var a=u.prototype;return a.parse=function(l){var h=this;l&&(h.buffer+=h.decoder.decode(l,{stream:!0}));function o(){var R=h.buffer,C=0;for(R=d(R);C<R.length&&R[C]!=="\r"&&R[C]!==`
|
|
`;)++C;var S=R.substr(0,C);return R[C]==="\r"&&++C,R[C]===`
|
|
`&&++C,h.buffer=R.substr(C),S}function s(R){W(R,function(C,S){},/:/)}try{var A="";if(h.state==="INITIAL"){if(!/\r\n|\n/.test(h.buffer))return this;A=o();var _=A.match(/^()?WEBVTT([ \t].*)?$/);if(!_||!_[0])throw new Error("Malformed WebVTT signature.");h.state="HEADER"}for(var w=!1;h.buffer;){if(!/\r\n|\n/.test(h.buffer))return this;w?w=!1:A=o();switch(h.state){case"HEADER":/:/.test(A)?s(A):A||(h.state="ID");continue;case"NOTE":A||(h.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(A)){h.state="NOTE";break}if(!A)continue;if(h.cue=new X.default(0,0,""),h.state="CUE",A.indexOf("-->")===-1){h.cue.id=A;continue}case"CUE":if(!h.cue){h.state="BADCUE";continue}try{g(A,h.cue,h.regionList)}catch(R){h.cue=null,h.state="BADCUE";continue}h.state="CUETEXT";continue;case"CUETEXT":{var L=A.indexOf("-->")!==-1;if(!A||L&&(w=!0)){h.oncue&&h.cue&&h.oncue(h.cue),h.cue=null,h.state="ID";continue}if(h.cue===null)continue;h.cue.text&&(h.cue.text+=`
|
|
`),h.cue.text+=A}continue;case"BADCUE":A||(h.state="ID")}}}catch(R){h.state==="CUETEXT"&&h.cue&&h.oncue&&h.oncue(h.cue),h.cue=null,h.state=h.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
|
|
|
|
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(h){l.onparsingerror&&l.onparsingerror(h)}return l.onflush&&l.onflush(),this},u}()},"./src/utils/webvtt-parser.ts":function(ne,$,k){"use strict";k.r($),k.d($,"generateCueId",function(){return m}),k.d($,"parseWebVTT",function(){return a});var X=k("./src/polyfills/number.ts"),N=k("./src/utils/vttparser.ts"),U=k("./src/demux/id3.ts"),G=k("./src/utils/timescale-conversion.ts"),W=k("./src/remux/mp4-remuxer.ts"),i=/\r\n|\n\r|\n|\r/g,D=function(l,h,o){return o===void 0&&(o=0),l.substr(o,h.length)===h},g=function(l){var h=parseInt(l.substr(-3)),o=parseInt(l.substr(-6,2)),s=parseInt(l.substr(-9,2)),A=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(h)||!Object(X.isFiniteNumber)(o)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(A))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return h+=1e3*o,h+=60*1e3*s,h+=60*60*1e3*A,h},d=function(l){for(var h=5381,o=l.length;o;)h=h*33^l.charCodeAt(--o);return(h>>>0).toString()};function m(f,l,h){return d(f.toString())+d(l.toString())+d(h)}var u=function(l,h,o){var s=l[h],A=l[s.prevCC];if(!A||!A.new&&s.new){l.ccOffset=l.presentationOffset=s.start,s.new=!1;return}for(;(_=A)!==null&&_!==void 0&&_.new;){var _;l.ccOffset+=s.start-A.start,s.new=!1,s=A,A=l[s.prevCC]}l.presentationOffset=o};function a(f,l,h,o,s,A,_,w){var L=new N.VTTParser,R=Object(U.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(i,`
|
|
`).split(`
|
|
`),C=[],S=Object(G.toMpegTsClockFromTimescale)(l,h),x="00:00.000",p=0,T=0,v,y=!0,F=!1;L.oncue=function(B){var O=o[s],j=o.ccOffset,P=(p-S)/9e4;if(O!=null&&O.new&&(T!==void 0?j=o.ccOffset=O.start:u(o,s,P)),P&&(j=P-o.presentationOffset),F){var b=B.endTime-B.startTime,Y=Object(W.normalizePts)((B.startTime+j-T)*9e4,A*9e4)/9e4;B.startTime=Y,B.endTime=Y+b}var ee=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(ee)),B.id||(B.id=m(B.startTime,B.endTime,ee)),B.endTime>0&&C.push(B)},L.onparsingerror=function(B){v=B},L.onflush=function(){if(v){w(v);return}_(C)},R.forEach(function(B){if(y)if(D(B,"X-TIMESTAMP-MAP=")){y=!1,F=!0,B.substr(16).split(",").forEach(function(O){D(O,"LOCAL:")?x=O.substr(6):D(O,"MPEGTS:")&&(p=parseInt(O.substr(7)))});try{T=g(x)/1e3}catch(O){F=!1,v=O}return}else B===""&&(y=!1);L.parse(B+`
|
|
`)}),L.flush()}},"./src/utils/xhr-loader.ts":function(ne,$,k){"use strict";k.r($);var X=k("./src/utils/logger.ts"),N=k("./src/loader/load-stats.ts"),U=/^age:\s*[\d.]+\s*$/m,G=function(){function W(D){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=D?D.xhrSetup:null,this.stats=new N.LoadStats,this.retryDelay=0}var i=W.prototype;return i.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},i.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},i.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},i.load=function(g,d,m){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=d,this.callbacks=m,this.retryDelay=d.retryDelay,this.loadInternal()},i.loadInternal=function(){var g=this.config,d=this.context;if(!g)return;var m=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.loaded=0;var a=this.xhrSetup;try{if(a)try{a(m,d.url)}catch(h){m.open("GET",d.url,!0),a(m,d.url)}m.readyState||m.open("GET",d.url,!0);var f=this.context.headers;if(f)for(var l in f)m.setRequestHeader(l,f[l])}catch(h){this.callbacks.onError({code:m.status,text:h.message},d,m);return}d.rangeEnd&&m.setRequestHeader("Range","bytes="+d.rangeStart+"-"+(d.rangeEnd-1)),m.onreadystatechange=this.readystatechange.bind(this),m.onprogress=this.loadprogress.bind(this),m.responseType=d.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),m.send()},i.readystatechange=function(){var g=this.context,d=this.loader,m=this.stats;if(!g||!d)return;var u=d.readyState,a=this.config;if(m.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),m.loading.first===0&&(m.loading.first=Math.max(self.performance.now(),m.loading.start)),u===4){d.onreadystatechange=null,d.onprogress=null;var f=d.status;if(f>=200&&f<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var l,h;if(g.responseType==="arraybuffer"?(l=d.response,h=l.byteLength):(l=d.responseText,h=l.length),m.loaded=m.total=h,!this.callbacks)return;var o=this.callbacks.onProgress;if(o&&o(m,g,l,d),!this.callbacks)return;var s={url:d.responseURL,data:l};this.callbacks.onSuccess(s,m,g,d)}else m.retry>=a.maxRetry||f>=400&&f<499?(X.logger.error(f+" while loading "+g.url),this.callbacks.onError({code:f,text:d.statusText},g,d)):(X.logger.warn(f+" while loading "+g.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,a.maxRetryDelay),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},i.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},i.loadprogress=function(g){var d=this.stats;d.loaded=g.loaded,g.lengthComputable&&(d.total=g.total)},i.getCacheAge=function(){var g=null;if(this.loader&&U.test(this.loader.getAllResponseHeaders())){var d=this.loader.getResponseHeader("age");g=d?parseFloat(d):null}return g},W}();$.default=G}}).default})},vHTk:function(ot,ge,J){ot.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|