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.
441 lines
1.2 MiB
441 lines
1.2 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[79,5,7,21],{"+NIl":function(st,be,Q){(function(ie){ie(Q("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function($,M){"use strict";function X(l,u){l.cmdState.push(u)}function F(l){return l.cmdState.length>0?l.cmdState[l.cmdState.length-1]:null}function U(l){var u=l.cmdState.pop();u&&u.closeBracket()}function G(l){for(var u=l.cmdState,f=u.length-1;f>=0;f--){var o=u[f];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function W(l,u,f){return function(){this.name=l,this.bracketNo=0,this.style=u,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(l,u){l.f=u}function g(l,u){var f;if(l.match(/^\\[a-zA-Z@]+/)){var o=l.current().slice(1);return f=i.hasOwnProperty(o)?i[o]:i.DEFAULT,f=new f,X(u,f),D(u,p),f.style}if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/\\]/))return"tag";if(l.match("\\["))return D(u,function(s,a){return m(s,a,"\\]")}),"keyword";if(l.match("\\("))return D(u,function(s,a){return m(s,a,"\\)")}),"keyword";if(l.match("$$"))return D(u,function(s,a){return m(s,a,"$$")}),"keyword";if(l.match("$"))return D(u,function(s,a){return m(s,a,"$")}),"keyword";var h=l.next();if(h=="%")return l.skipToEnd(),"comment";if(h=="}"||h=="]"){if(f=F(u),f)f.closeBracket(h),D(u,p);else return"error";return"bracket"}else return h=="{"||h=="["?(f=i.DEFAULT,f=new f,X(u,f),"bracket"):/\d/.test(h)?(l.eatWhile(/[\w.%]/),"atom"):(l.eatWhile(/[\w\-_]/),f=G(u),f.name=="begin"&&(f.argument=l.current()),f.styleIdentifier())}function m(l,u,f){if(l.eatSpace())return null;if(f&&l.match(f))return D(u,g),"keyword";if(l.match(/^\\[a-zA-Z@]+/))return"tag";if(l.match(/^[a-zA-Z]+/))return"variable-2";if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/]/))return"tag";if(l.match(/^[\^_&]/))return"tag";if(l.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(l.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=l.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(l.skipToEnd(),"comment"):"error"}function p(l,u){var f=l.peek(),o;return f=="{"||f=="["?(o=F(u),o.openBracket(f),l.eat(f),D(u,g),"bracket"):/[ \t\r]/.test(f)?(l.eat(f),null):(D(u,g),U(u),g(l,u))}return{startState:function(){var l=M.inMathMode?function(u,f){return m(u,f)}:g;return{cmdState:[],f:l}},copyState:function(l){return{cmdState:l.cmdState.slice(),f:l.f}},token:function(l,u){return u.f(l,u)},blankLine:function(l){l.f=g,l.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"+ua5":function(st,be,Q){},"/cxE":function(st,be,Q){"use strict";Q.d(be,"f",function(){return M}),Q.d(be,"g",function(){return X}),Q.d(be,"h",function(){return F}),Q.d(be,"e",function(){return G}),Q.d(be,"b",function(){return W}),Q.d(be,"c",function(){return i}),Q.d(be,"d",function(){return D}),Q.d(be,"a",function(){return g});class ie{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+`
|
|
|
|
`+m.stack):m},0)}}emit(m){this.listeners.forEach(p=>{p(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const $=new ie;function M(m){G(m)||$.onUnexpectedError(m);return}function X(m){G(m)||$.onUnexpectedExternalError(m);return}function F(m){if(m instanceof Error){let{name:p,message:l}=m;const u=m.stacktrace||m.stack;return{$isError:!0,name:p,message:l,stack:u}}return m}const U="Canceled";function G(m){return m instanceof Error&&m.name===U&&m.message===U}function W(){const m=new Error(U);return m.name=m.message,m}function i(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function D(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class g extends Error{constructor(m){super("NotSupported");m&&(this.message=m)}}},"19Vz":function(st,be,Q){(function(ie){ie(Q("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(W,i,D){var g=D&&D!=ie.Init;if(i&&!g)W.on("blur",F),W.on("change",U),W.on("swapDoc",U),ie.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){X(W)}),U(W);else if(!i&&g){W.off("blur",F),W.off("change",U),W.off("swapDoc",U),ie.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),$(W);var m=W.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}i&&!W.hasFocus()&&F(W)});function $(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function M(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?M(W):$(W)},20)}function F(W){G(W)&&M(W)}function U(W){var i=W.getWrapperElement(),D=G(W);i.className=i.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?M(W):$(W)}function G(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(st,be,Q){(function(ie){ie(Q("VrN/"))})(function(ie){"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},M={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(X,F){var U=X.indentUnit,G={},W=F.htmlMode?$:M;for(var i in W)G[i]=W[i];for(var i in F)G[i]=F[i];var D,g;function m(c,T){function y(B){return T.tokenize=B,B(c,T)}var v=c.next();if(v=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?y(u("atom","]]>")):null:c.match("--")?y(u("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),y(f(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),T.tokenize=u("meta","?>"),"meta"):(D=c.eat("/")?"closeTag":"openTag",T.tokenize=p,"tag bracket");if(v=="&"){var N;return c.eat("#")?c.eat("x")?N=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):N=c.eatWhile(/[\d]/)&&c.eat(";"):N=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),N?"atom":"error"}else return c.eatWhile(/[^&<]/),null}m.isInText=!0;function p(c,T){var y=c.next();if(y==">"||y=="/"&&c.eat(">"))return T.tokenize=m,D=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return D="equals",null;if(y=="<"){T.tokenize=m,T.state=a,T.tagName=T.tagStart=null;var v=T.tokenize(c,T);return v?v+" tag error":"tag error"}else return/[\'\"]/.test(y)?(T.tokenize=l(y),T.stringStartCol=c.column(),T.tokenize(c,T)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(c){var T=function(y,v){for(;!y.eol();)if(y.next()==c){v.tokenize=p;break}return"string"};return T.isInAttribute=!0,T}function u(c,T){return function(y,v){for(;!y.eol();){if(y.match(T)){v.tokenize=m;break}y.next()}return c}}function f(c){return function(T,y){for(var v;(v=T.next())!=null;){if(v=="<")return y.tokenize=f(c+1),y.tokenize(T,y);if(v==">")if(c==1){y.tokenize=m;break}else return y.tokenize=f(c-1),y.tokenize(T,y)}return"meta"}}function o(c,T,y){this.prev=c.context,this.tagName=T,this.indent=c.indented,this.startOfLine=y,(G.doNotIndent.hasOwnProperty(T)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function h(c){c.context&&(c.context=c.context.prev)}function s(c,T){for(var y;;){if(!c.context)return;if(y=c.context.tagName,!G.contextGrabbers.hasOwnProperty(y)||!G.contextGrabbers[y].hasOwnProperty(T))return;h(c)}}function a(c,T,y){return c=="openTag"?(y.tagStart=T.column(),A):c=="closeTag"?_:a}function A(c,T,y){return c=="word"?(y.tagName=T.current(),g="tag",R):G.allowMissingTagName&&c=="endTag"?(g="tag bracket",R(c,T,y)):(g="error",A)}function _(c,T,y){if(c=="word"){var v=T.current();return y.context&&y.context.tagName!=v&&G.implicitlyClosed.hasOwnProperty(y.context.tagName)&&h(y),y.context&&y.context.tagName==v||G.matchClosing===!1?(g="tag",S):(g="tag error",L)}else return G.allowMissingTagName&&c=="endTag"?(g="tag bracket",S(c,T,y)):(g="error",L)}function S(c,T,y){return c!="endTag"?(g="error",S):(h(y),a)}function L(c,T,y){return g="error",S(c,T,y)}function R(c,T,y){if(c=="word")return g="attribute",C;if(c=="endTag"||c=="selfcloseTag"){var v=y.tagName,N=y.tagStart;return y.tagName=y.tagStart=null,c=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(v)?s(y,v):(s(y,v),y.context=new o(y,v,N==y.indented)),a}return g="error",R}function C(c,T,y){return c=="equals"?w:(G.allowMissing||(g="error"),R(c,T,y))}function w(c,T,y){return c=="string"?x:c=="word"&&G.allowUnquoted?(g="string",R):(g="error",R(c,T,y))}function x(c,T,y){return c=="string"?x:R(c,T,y)}return{startState:function(c){var T={tokenize:m,state:a,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(T.baseIndent=c),T},token:function(c,T){if(!T.tagName&&c.sol()&&(T.indented=c.indentation()),c.eatSpace())return null;D=null;var y=T.tokenize(c,T);return(y||D)&&y!="comment"&&(g=null,T.state=T.state(D||y,c,T),g&&(y=g=="error"?y+" error":g)),y},indent:function(c,T,y){var v=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+U;if(v&&v.noIndent)return ie.Pass;if(c.tokenize!=p&&c.tokenize!=m)return y?y.match(/^(\s*)/)[0].length:0;if(c.tagName)return G.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+U*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(T))return 0;var N=T&&/^<(\/)?([\w_:\.-]*)/.exec(T);if(N&&N[1])for(;v;)if(v.tagName==N[2]){v=v.prev;break}else if(G.implicitlyClosed.hasOwnProperty(v.tagName))v=v.prev;else break;else if(N)for(;v;){var B=G.contextGrabbers[v.tagName];if(B&&B.hasOwnProperty(N[2]))v=v.prev;else break}for(;v&&v.prev&&!v.startOfLine;)v=v.prev;return v?v.indent+U:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(c){c.state==w&&(c.state=R)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var T=[],y=c.context;y;y=y.prev)y.tagName&&T.push(y.tagName);return T.reverse()}}}),ie.defineMIME("text/xml","xml"),ie.defineMIME("application/xml","xml"),ie.mimeModes.hasOwnProperty("text/html")||ie.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(st,be,Q){"use strict";Q.d(be,"a",function(){return $});class ie{constructor(M){this.element=M,this.next=ie.Undefined,this.prev=ie.Undefined}}ie.Undefined=new ie(void 0);class ${constructor(){this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ie.Undefined}clear(){let M=this._first;for(;M!==ie.Undefined;){const X=M.next;M.prev=ie.Undefined,M.next=ie.Undefined,M=X}this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}unshift(M){return this._insert(M,!1)}push(M){return this._insert(M,!0)}_insert(M,X){const F=new ie(M);if(this._first===ie.Undefined)this._first=F,this._last=F;else if(X){const G=this._last;this._last=F,F.prev=G,G.next=F}else{const G=this._first;this._first=F,F.next=G,G.prev=F}this._size+=1;let U=!1;return()=>{U||(U=!0,this._remove(F))}}shift(){if(this._first===ie.Undefined)return;{const M=this._first.element;return this._remove(this._first),M}}pop(){if(this._last===ie.Undefined)return;{const M=this._last.element;return this._remove(this._last),M}}_remove(M){if(M.prev!==ie.Undefined&&M.next!==ie.Undefined){const X=M.prev;X.next=M.next,M.next.prev=X}else M.prev===ie.Undefined&&M.next===ie.Undefined?(this._first=ie.Undefined,this._last=ie.Undefined):M.next===ie.Undefined?(this._last=this._last.prev,this._last.next=ie.Undefined):M.prev===ie.Undefined&&(this._first=this._first.next,this._first.prev=ie.Undefined);this._size-=1}*[Symbol.iterator](){let M=this._first;for(;M!==ie.Undefined;)yield M.element,M=M.next}}},"3/fG":function(st,be,Q){"use strict";Q.d(be,"a",function(){return $});function ie(M,X){let F;return X.length===0?F=M:F=M.replace(/\{(\d+)\}/g,function(U,G){const W=G[0];return typeof X[W]!="undefined"?X[W]:U}),F}function $(M,X,...F){return ie(X,F)}},"3Rgl":function(st,be,Q){"use strict";Q.r(be);var ie=Q("+L6B"),$=Q("2/Rp"),M=Q("6UJt"),X=Q("DFOY"),F=Q("/zsF"),U=Q("PArb"),G=Q("5NDa"),W=Q("5rEg"),i=Q("OaEy"),D=Q("2fM7"),g=Q("14J3"),m=Q("BMrR"),p=Q("jCWc"),l=Q("kPKH"),u=Q("sPJy"),f=Q("bE4q"),o=Q("miYZ"),h=Q("tsqr"),s=Q("k1fw"),a=Q("9og8"),A=Q("y8nQ"),_=Q("Vl3Y"),S=Q("tJVT"),L=Q("PpiC"),R=Q("B9cy"),C=Q("Ol7k"),w=Q("lUTK"),x=Q("BvKs"),c=Q("WmNS"),T=Q.n(c),y=Q("q1tI"),v=Q.n(y),N=Q("Ot1p"),B=Q("Ty5D"),O=Q("9kvl"),j=Q("55Ip"),P=Q("gJ3r"),b=Q("m7e3"),Y=Q.n(b),ee=x.a.SubMenu,le=C.a.Content,ue=C.a.Sider,ke=function(Ae){var ce,pe,se,ae,Oe,xe,Pe,De=Ae.graduation,Ge=Ae.globalSetting,Le=Ae.loading,Fe=Ae.user,We=Ae.dispatch,oe=Object(L.a)(Ae,["graduation","globalSetting","loading","user","dispatch"]),ge=Object(B.i)(),Se=Object(B.h)(),Ce=Fe.userInfo,je=_.a.useForm(),Ve=Object(S.a)(je,1),Qe=Ve[0],Je=De.addTopicData,at=function(){var Xe=Object(a.a)(T.a.mark(function qe(){var Ne,lt,nt;return T.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return Ne=Qe.getFieldsValue(),lt=Object(s.a)({},Ne),lt.city&&(lt.province=lt.city[0],lt.city=lt.city[1]),Ue.next=5,We({type:"graduation/addTopic",payload:{coursesId:ge.coursesId,attachment_ids:[],graduation_topic:lt}});case 5:nt=Ue.sent,nt.status?h.b.error(nt.message):O.d.push("/classrooms/".concat(ge.coursesId,"/graduation_topics/").concat(ge.categoryId));case 7:case"end":return Ue.stop()}},qe)}));return function(){return Xe.apply(this,arguments)}}();return Object(y.useEffect)(function(){We({type:"graduation/addTopicDefaultData",payload:Object(s.a)({},ge)})},[ge.coursesId]),v.a.createElement("section",{className:"edu-container"},v.a.createElement("section",{className:"animated fadeIn"},v.a.createElement("aside",{className:"mt10"},Ce&&v.a.createElement(f.a,{separator:">"},v.a.createElement(f.a.Item,null,v.a.createElement(j.a,{to:"".concat(Ce.first_category_url)},Ce==null||((ce=Ce.course)===null||ce===void 0)?void 0:ce.course_name)),v.a.createElement(f.a.Item,null,v.a.createElement(j.a,{to:"/classrooms/".concat(ge.coursesId,"/graduation_topics/").concat(ge.categoryId)},"\u6BD5\u8BBE\u9009\u9898")),v.a.createElement(f.a.Item,null,"\u65B0\u5EFA"))),v.a.createElement("aside",{className:[Y.a.title,"mt20"].join(" ")},v.a.createElement(m.a,{style:{width:"100%"}},v.a.createElement(l.a,{flex:"1"},v.a.createElement("strong",{className:"font20 ml5"},"\u65B0\u5EFA\u6BD5\u8BBE\u9009\u9898")),v.a.createElement(l.a,null,v.a.createElement(j.a,{className:"font16 c-light-black",to:"/classrooms/".concat(ge.coursesId,"/exercise")},"\u8FD4\u56DE"))))),v.a.createElement("section",{className:[Y.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},v.a.createElement(_.a,{layout:"vertical",form:Qe,scrollToFirstError:!0,onFinish:function(){var Xe=Object(a.a)(T.a.mark(function qe(Ne){return T.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:at();case 1:case"end":return nt.stop()}},qe)}));return function(qe){return Xe.apply(this,arguments)}}()},v.a.createElement(_.a.Item,{name:"tea_id",label:"\u6307\u5BFC\u8001\u5E08\uFF1A",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6307\u5BFC\u8001\u5E08"}]},v.a.createElement(D.a,{size:"large",placeholder:"\u8BF7\u9009\u62E9\u6307\u5BFC\u8001\u5E08",style:{width:200}},(pe=Je.teacher_list)===null||pe===void 0?void 0:pe.map(function(Xe,qe){return v.a.createElement(D.a.Option,{value:Xe.id,key:qe},Xe.name)}))),v.a.createElement(_.a.Item,{name:"name",label:"\u9009\u9898\u540D\u79F0\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},v.a.createElement(W.a,{maxLength:60,size:"large",placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),v.a.createElement(U.a,null),v.a.createElement(_.a.Item,{label:"\u9009\u9898\u7B80\u4ECB",name:"description",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5185\u5BB9"}]},v.a.createElement(N.a,{watch:!0,placeholder:"\u8BF7\u7B80\u8981\u8BF4\u660E\u9009\u9898\u5185\u5BB9\uFF0C\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"})),v.a.createElement(m.a,{gutter:[20,0]},v.a.createElement(l.a,{flex:"1"},v.a.createElement(_.a.Item,{name:"topic_type"},v.a.createElement(D.a,{size:"large",placeholder:"\u8BF7\u9009\u62E9\u9009\u9898\u7C7B\u578B"},(se=Je.topic_type)===null||se===void 0?void 0:se.map(function(Xe,qe){return v.a.createElement(D.a.Option,{value:Xe.id,key:qe},Xe.name)})))),v.a.createElement(l.a,{flex:"1"},v.a.createElement(_.a.Item,{name:"topic_source"},v.a.createElement(D.a,{size:"large",placeholder:"\u8BF7\u9009\u62E9\u9009\u9898\u6765\u6E90"},(ae=Je.topic_source)===null||ae===void 0?void 0:ae.map(function(Xe,qe){return v.a.createElement(D.a.Option,{value:Xe.id,key:qe},Xe.name)})))),v.a.createElement(l.a,{flex:"1"},v.a.createElement(_.a.Item,{name:"topic_property_first"},v.a.createElement(D.a,{size:"large",placeholder:"\u8BF7\u9009\u62E9\u9009\u9898\u6027\u8D281"},(Oe=Je.topic_property_first)===null||Oe===void 0?void 0:Oe.map(function(Xe,qe){return v.a.createElement(D.a.Option,{value:Xe.id,key:qe},Xe.name)})))),v.a.createElement(l.a,{flex:"1"},v.a.createElement(_.a.Item,{name:"topic_property_second"},v.a.createElement(D.a,{size:"large",placeholder:"\u8BF7\u9009\u62E9\u9009\u9898\u6027\u8D282"},(xe=Je.topic_property_second)===null||xe===void 0?void 0:xe.map(function(Xe,qe){return v.a.createElement(D.a.Option,{value:Xe.id,key:qe},Xe.name)})))),v.a.createElement(l.a,{flex:"150px"})),v.a.createElement(U.a,null),v.a.createElement(_.a.Item,{name:"source_unit",label:"\u9009\u9898\u6765\u6E90\u5355\u4F4D\uFF1A"},v.a.createElement(W.a,{width:"200",size:"large",style:{width:200},placeholder:"\u8BF7\u586B\u5199\u6765\u6E90\u5355\u4F4D"})),v.a.createElement(_.a.Item,{name:"topic_repeat",label:"\u9009\u9898\u91CD\u590D\u60C5\u51B5\uFF1A"},v.a.createElement(D.a,{size:"large",placeholder:"\u8BF7\u9009\u62E9\u91CD\u590D\u60C5\u51B5",style:{width:200}},(Pe=Je.topic_repeat)===null||Pe===void 0?void 0:Pe.map(function(Xe,qe){return v.a.createElement(D.a.Option,{value:Xe.id,key:qe},Xe.name)}))),v.a.createElement(_.a.Item,{name:"city",label:"\u8C03\u7814\u6216\u5B9E\u4E60\u5730\u70B9\uFF1A"},v.a.createElement(X.a,{size:"large",style:{width:200},options:P.a,placeholder:"\u8BF7\u9009\u62E9\u6240\u5728\u5730"})))),v.a.createElement("aside",{className:Y.a.btns},v.a.createElement($.a,{type:"primary",onClick:function(){Qe.submit()}},"\u4FDD\u5B58"),v.a.createElement(j.a,{to:"/classrooms/".concat(ge.coursesId,"/graduation_topics/").concat(ge.categoryId)},"\u53D6\u6D88")))};be.default=Object(O.a)(function(we){var Ae=we.graduation,ce=we.loading,pe=we.user,se=we.globalSetting;return{graduation:Ae,globalSetting:se,user:pe,loading:ce.effects}})(ke)},"55Ip":function(st,be,Q){"use strict";Q.d(be,"a",function(){return s});var ie=Q("Ty5D"),$=Q("dI71"),M=Q("q1tI"),X=Q.n(M),F=Q("YS25"),U=Q("17x9"),G=Q.n(U),W=Q("wx14"),i=Q("zLVn"),D=Q("9R94"),g=function(w){Object($.a)(x,w);function x(){for(var T,y=arguments.length,v=new Array(y),N=0;N<y;N++)v[N]=arguments[N];return T=w.call.apply(w,[this].concat(v))||this,T.history=Object(F.a)(T.props),T}var c=x.prototype;return c.render=function(){return X.a.createElement(ie.c,{history:this.history,children:this.props.children})},x}(X.a.Component),m=function(w){Object($.a)(x,w);function x(){for(var T,y=arguments.length,v=new Array(y),N=0;N<y;N++)v[N]=arguments[N];return T=w.call.apply(w,[this].concat(v))||this,T.history=Object(F.b)(T.props),T}var c=x.prototype;return c.render=function(){return X.a.createElement(ie.c,{history:this.history,children:this.props.children})},x}(X.a.Component),p=function(x,c){return typeof x=="function"?x(c):x},l=function(x,c){return typeof x=="string"?Object(F.c)(x,null,null,c):x},u=function(x){return x},f=X.a.forwardRef;typeof f=="undefined"&&(f=u);function o(w){return!!(w.metaKey||w.altKey||w.ctrlKey||w.shiftKey)}var h=f(function(w,x){var c=w.innerRef,T=w.navigate,y=w.onClick,v=Object(i.a)(w,["innerRef","navigate","onClick"]),N=v.target,B=Object(W.a)({},v,{onClick:function(j){try{y&&y(j)}catch(P){throw j.preventDefault(),P}!j.defaultPrevented&&j.button===0&&(!N||N==="_self")&&!o(j)&&(j.preventDefault(),T())}});return u!==f?B.ref=x||c:B.ref=c,X.a.createElement("a",B)}),s=f(function(w,x){var c=w.component,T=c===void 0?h:c,y=w.replace,v=w.to,N=w.innerRef,B=Object(i.a)(w,["component","replace","to","innerRef"]);return X.a.createElement(ie.e.Consumer,null,function(O){O||Object(D.a)(!1);var j=O.history,P=l(p(v,O.location),O.location),b=P?j.createHref(P):"",Y=Object(W.a)({},B,{href:b,navigate:function(){var le=p(v,O.location),ue=y?j.replace:j.push;ue(le)}});return u!==f?Y.ref=x||N:Y.innerRef=N,X.a.createElement(T,Y)})});if(!1)var a,A;var _=function(x){return x},S=X.a.forwardRef;typeof S=="undefined"&&(S=_);function L(){for(var w=arguments.length,x=new Array(w),c=0;c<w;c++)x[c]=arguments[c];return x.filter(function(T){return T}).join(" ")}var R=S(function(w,x){var c=w["aria-current"],T=c===void 0?"page":c,y=w.activeClassName,v=y===void 0?"active":y,N=w.activeStyle,B=w.className,O=w.exact,j=w.isActive,P=w.location,b=w.sensitive,Y=w.strict,ee=w.style,le=w.to,ue=w.innerRef,ke=Object(i.a)(w,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return X.a.createElement(ie.e.Consumer,null,function(we){we||Object(D.a)(!1);var Ae=P||we.location,ce=l(p(le,Ae),Ae),pe=ce.pathname,se=pe&&pe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ae=se?Object(ie.f)(Ae.pathname,{path:se,exact:O,sensitive:b,strict:Y}):null,Oe=!!(j?j(ae,Ae):ae),xe=Oe?L(B,v):B,Pe=Oe?Object(W.a)({},ee,{},N):ee,De=Object(W.a)({"aria-current":Oe&&T||null,className:xe,style:Pe,to:ce},ke);return _!==S?De.ref=x||ue:De.innerRef=ue,X.a.createElement(s,De)})});if(!1)var C},"5VLF":function(st,be,Q){"use strict";var ie,$;function M(X,F,U){var G=function(W,i){return X.js_beautify(W,i)};return G.js=X.js_beautify,G.css=F.css_beautify,G.html=U.html_beautify,G.js_beautify=X.js_beautify,G.css_beautify=F.css_beautify,G.html_beautify=U.html_beautify,G}!(ie=[Q("6UM0"),Q("TXwP"),Q("psGv")],$=function(X,F,U){return M(X,F,U)}.apply(be,ie),$!==void 0&&(st.exports=$))},"5Y4S":function(st,be,Q){"use strict";Q.d(be,"a",function(){return M});var ie=Q("MNsG");const $=ie.b.performance&&typeof ie.b.performance.now=="function";class M{constructor(X){this._highResolution=$&&X,this._startTime=this._now(),this._stopTime=-1}static create(X=!0){return new M(X)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ie.b.performance.now():Date.now()}}},"6UM0":function(st,be,Q){var ie,$;(function(){var M;(function(){"use strict";var F=[function(i,D,g){var m=g(1).Beautifier,p=g(5).Options;function l(u,f){var o=new m(u,f);return o.beautify()}i.exports=l,i.exports.defaultOptions=function(){return new p}},function(i,D,g){var m=g(2).Output,p=g(3).Token,l=g(4),u=g(5).Options,f=g(7).Tokenizer,o=g(7).line_starters,h=g(7).positionable_operators,s=g(7).TOKEN;function a(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 S(b,Y){return b&&b.type===s.RESERVED&&b.text===Y}function L(b,Y){return b&&b.type===s.RESERVED&&a(b.text,Y)}var R=["case","return","do","if","throw","else","await","break","continue","async"],C=["before-newline","after-newline","preserve-newline"],w=_(C),x=[w.before_newline,w.preserve_newline],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function T(b,Y){if(Y.multiline_frame||Y.mode===c.ForInitializer||Y.mode===c.Conditional)return;b.remove_indent(Y.start_line_index)}function y(b){b=b.replace(l.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 v(b){return b===c.ArrayLiteral}function N(b){return a(b,[c.Expression,c.ForInitializer,c.Conditional])}function B(b,Y){for(var ee=0;ee<b.length;ee++){var le=b[ee].trim();if(le.charAt(0)!==Y)return!1}return!0}function O(b,Y){for(var ee=0,le=b.length,ue;ee<le;ee++)if(ue=b[ee],ue&&ue.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 u(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 le={mode:Y,parent:b,last_token:b?b.last_token:new p(s.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 le},j.prototype._reset=function(b){var Y=b.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,Y),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.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&&l.lineBreak.test(Y||"")&&(ee=Y.match(l.lineBreak)[0]));for(var le=this._tokens.next();le;)this.handle_token(le),this._last_last_text=this._flags.last_token.text,this._flags.last_token=le,le=this._tokens.next();return b=this._output.get_code(ee),b},j.prototype.handle_token=function(b,Y){b.type===s.START_EXPR?this.handle_start_expr(b):b.type===s.END_EXPR?this.handle_end_expr(b):b.type===s.START_BLOCK?this.handle_start_block(b):b.type===s.END_BLOCK?this.handle_end_block(b):b.type===s.WORD?this.handle_word(b):b.type===s.RESERVED?this.handle_word(b):b.type===s.SEMICOLON?this.handle_semicolon(b):b.type===s.STRING?this.handle_string(b):b.type===s.EQUALS?this.handle_equals(b):b.type===s.OPERATOR?this.handle_operator(b):b.type===s.COMMA?this.handle_comma(b):b.type===s.BLOCK_COMMENT?this.handle_block_comment(b,Y):b.type===s.COMMENT?this.handle_comment(b,Y):b.type===s.DOT?this.handle_dot(b):b.type===s.EOF?this.handle_eof(b):b.type===s.UNKNOWN?this.handle_unknown(b,Y):this.handle_unknown(b,Y)},j.prototype.handle_whitespace_and_comments=function(b,Y){var ee=b.newlines,le=this._options.keep_array_indentation&&v(this._flags.mode);if(b.comments_before)for(var ue=b.comments_before.next();ue;)this.handle_whitespace_and_comments(ue,Y),this.handle_token(ue,Y),ue=b.comments_before.next();if(le)for(var ke=0;ke<ee;ke+=1)this.print_newline(ke>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 we=1;we<ee;we+=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,le=a(this._flags.last_token.text,h)||a(b.text,h);if(le){var ue=a(this._flags.last_token.text,h)&&a(this._options.operator_position,x)||a(b.text,h);ee=ee&&ue}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!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var ee=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&S(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==="["||v(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===s.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===c.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===c.ObjectLiteral&&this._flags.mode===c.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===s.WORD,Y=Y||S(this._flags.last_token,"do"),Y=Y||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&L(this._flags.last_token,P)&&!b.newlines,Y=Y||S(this._flags.last_token,"else")&&!(S(b,"if")&&!b.comments_before),Y=Y||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),Y=Y||this._flags.last_token.type===s.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(b.text==="--"||b.text==="++")&&this._last_last_text!=="function"&&b.type!==s.WORD&&b.type!==s.RESERVED,Y=Y||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"])),Y?(this.set_mode(c.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=c.Expression;if(b.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){L(this._flags.last_token,o)&&(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=c.ArrayLiteral,v(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())),a(this._flags.last_token.type,[s.START_EXPR,s.END_EXPR,s.WORD,s.OPERATOR,s.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===s.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,Y=c.ForInitializer):a(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,Y=c.Conditional):a(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:(a(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var ee=this._tokens.peek(-3);if(this._options.space_after_named_function&&ee){var le=this._tokens.peek(-4);L(ee,["async","function"])||ee.text==="*"&&L(le,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(ee.text==="{"||ee.text===","||ee.text==="*"&&(le.text==="{"||le.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===s.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&a(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===s.START_BLOCK?this.print_newline():(this._flags.last_token.type===s.END_EXPR||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===s.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===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(b,b.text==="]"&&v(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===s.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===c.Conditional&&(this._previous_flags.mode=c.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===s.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):ee&&(a(ee.text,[":",","])&&a(Y.type,[s.STRING,s.WORD,s.RESERVED])||a(Y.text,["get","set","..."])&&a(ee.type,[s.WORD,s.RESERVED]))?a(this._last_last_text,["class","interface"])&&!a(ee.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):a(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||L(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(L(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var le=!Y.comments_before&&Y.text==="}",ue=le&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var ke=0,we=null;this._flags.inline_frame=!0;do if(ke+=1,we=this._tokens.peek(ke-1),we.newlines){this._flags.inline_frame=!1;break}while(we.type!==s.EOF&&!(we.type===s.END_BLOCK&&we.opened===b))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(ue||this._flags.last_token.type===s.EQUALS||L(this._flags.last_token,R)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(v(this._previous_flags.mode)&&(this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.COMMA)&&((this._flags.last_token.type===s.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.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!==s.OPERATOR&&this._flags.last_token.type!==s.START_EXPR&&(this._flags.last_token.type===s.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(b),this.indent(),!le&&!(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===c.Statement;)this.restore_mode();var Y=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!Y?this._output.space_before_token=!0:this._options.brace_style==="expand"?Y||this.print_newline():Y||(v(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===s.RESERVED){if(a(b.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)b.type=s.WORD;else if(b.text==="import"&&a(this._tokens.peek().text,["(","."]))b.type=s.WORD;else if(a(b.text,["as","from"])&&!this._flags.import_block)b.type=s.WORD;else if(this._flags.mode===c.ObjectLiteral){var Y=this._tokens.peek();Y.text===":"&&(b.type=s.WORD)}}if(this.start_of_statement(b)?L(this._flags.last_token,["var","let","const"])&&b.type===s.WORD&&(this._flags.declaration_statement=!0):b.newlines&&!N(this._flags.mode)&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==s.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(S(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&&S(b,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.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===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b)),S(b,"function")){(a(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(a(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===s.OPERATOR))&&(!this._output.just_added_blankline()&&!b.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?L(this._flags.last_token,["get","set","new","export"])||L(this._flags.last_token,P)?this._output.space_before_token=!0:S(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===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(N(this._flags.mode)||v(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===s.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===s.SEMICOLON&&this._flags.mode===c.BlockStatement?ee="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&N(this._flags.mode)?ee="SPACE":this._flags.last_token.type===s.STRING?ee="NEWLINE":this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&a(this._last_last_text,["{",","]))?ee="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?ee="SPACE":ee="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,ee="NEWLINE"),L(b,o)&&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===s.END_BLOCK&&this._previous_flags.mode===c.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 le=this._output.current_line;le.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!==s.END_EXPR?(this._flags.last_token.type!==s.START_EXPR||!L(b,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(b,"if")&&S(b.previous,"else")?this._output.space_before_token=!0:this.print_newline()):L(b,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&v(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===s.WORD||b.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(b),this._flags.last_word=b.text,b.type===s.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&&S(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===c.Statement&&!(this._flags.if_block&&S(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===s.WORD)||(this.start_of_statement(b)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(b),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b):b.text.startsWith("`")&&this._flags.last_token.type===s.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?(N(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===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.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"])||a(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),ee=a(b.text,["-","+"])&&(a(this._flags.last_token.type,[s.START_BLOCK,s.START_EXPR,s.EQUALS,s.OPERATOR])||a(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(b)){var le=!Y;this.handle_whitespace_and_comments(b,le)}if(b.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(b);return}if(b.text==="::"){this.print_token(b);return}if(this._flags.last_token.type===s.OPERATOR&&a(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!==s.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 ue=!0,ke=!0,we=!1;if(b.text===":"?this._flags.ternary_depth===0?ue=!1:(this._flags.ternary_depth-=1,we=!0):b.text==="?"&&(this._flags.ternary_depth+=1),!ee&&!Y&&this._options.preserve_newlines&&a(b.text,h)){var Ae=b.text===":",ce=Ae&&we,pe=Ae&&!we;switch(this._options.operator_position){case w.before_newline:this._output.space_before_token=!pe,this.print_token(b),(!Ae||ce)&&this.allow_wrap_or_preserved_newline(b),this._output.space_before_token=!0;return;case w.after_newline:this._output.space_before_token=!0,!Ae||ce?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 w.preserve_newline:pe||this.allow_wrap_or_preserved_newline(b),ue=!(this._output.just_added_newline()||pe),this._output.space_before_token=ue,this.print_token(b),this._output.space_before_token=!0;return}}if(Y){this.allow_wrap_or_preserved_newline(b),ue=!1;var se=this._tokens.peek();ke=se&&a(se.type,[s.WORD,s.RESERVED])}else if(b.text==="...")this.allow_wrap_or_preserved_newline(b),ue=this._flags.last_token.type===s.START_BLOCK,ke=!1;else if(a(b.text,["--","++","!","~"])||ee){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(b),ue=!1,ke=!1,b.newlines&&(b.text==="--"||b.text==="++"||b.text==="~")){var ae=L(this._flags.last_token,R)&&b.newlines;ae&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ae,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(ue=!0),this._flags.last_token.type===s.RESERVED?ue=!0:this._flags.last_token.type===s.END_EXPR?ue=!(this._flags.last_token.text==="]"&&(b.text==="--"||b.text==="++")):this._flags.last_token.type===s.OPERATOR&&(ue=a(b.text,["--","-","++","+"])&&a(this._flags.last_token.text,["--","-","++","+"]),a(b.text,["+","-"])&&a(this._flags.last_token.text,["--","++"])&&(ke=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ue,this.print_token(b),this._output.space_before_token=ke},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(!l.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=y(b.text),le,ue=!1,ke=!1,we=b.whitespace_before,Ae=we.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),ue=B(ee,"*"),ke=O(ee,we),ue&&(this._flags.alignment=1),le=0;le<ee.length;le++)ue?(this.print_token_line_indentation(b),this._output.add_token(A(ee[le]))):ke&&ee[le]?(this.print_token_line_indentation(b),this._output.add_token(ee[le].substring(Ae))):(this._output.current_line.set_indent(-1),this._output.add_token(ee[le])),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===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b)},i.exports.Beautifier=j},function(i){function D(p){this.__parent=p,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 p=new D(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},D.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},D.prototype.has_match=function(p){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(p))return!0;return!1},D.prototype.set_indent=function(p,l){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=l||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 p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__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(p){this.__items.push(p);var l=p.lastIndexOf(`
|
|
`);l!==-1?this.__character_count=p.length-l:this.__character_count+=p.length},D.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},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 p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function g(p,l){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),l=l||"",p.indent_level>0&&(l=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}g.prototype.get_indent_size=function(p,l){var u=this.__base_string_length;return l=l||0,p<0&&(u=0),u+=p*this.__indent_size,u+=l,u},g.prototype.get_indent_string=function(p,l){var u=this.__base_string;return l=l||0,p<0&&(p=0,u=""),l+=p*this.__indent_size,this.__ensure_cache(l),u+=this.__cache[l],u},g.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var p=this.__cache.length,l=0,u="";this.__indent_size&&p>=this.__indent_size&&(l=Math.floor(p/this.__indent_size),p-=l*this.__indent_size,u=new Array(l+1).join(this.__indent_string)),p&&(u+=new Array(p+1).join(" ")),this.__cache.push(u)};function m(p,l){this.__indent_cache=new g(p,l),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.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()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,l){return this.__indent_cache.get_indent_string(p,l)},m.prototype.get_indent_size=function(p,l){return this.__indent_cache.get_indent_size(p,l)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
|
|
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var u=this.__lines.join(`
|
|
`);return p!==`
|
|
`&&(u=u.replace(/[\n]/g,p)),u},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,l){return p=p||0,l=l||0,this.next_line.set_indent(p,l),this.__lines.length>1?(this.current_line.set_indent(p,l),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var l=0;l<p.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.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(" "))},m.prototype.remove_indent=function(p){for(var l=this.__lines.length;p<l;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&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},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,l){for(var u=this.__lines.length-2;u>=0;){var f=this.__lines[u];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==l){this.__lines.splice(u+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},i.exports.Output=m},function(i){function D(g,m,p,l){this.type=g,this.text=m,this.comments_before=null,this.newlines=p||0,this.whitespace_before=l||"",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",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\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",l="\\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",u="(?:\\\\u[0-9a-fA-F]{4}|["+g+p+"])",f="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+l+"])*";D.identifier=new RegExp(u+f,"g"),D.identifierStart=new RegExp(u),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+p+l+"])+");var o=/[\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 m=g(6).Options,p=["before-newline","after-newline","preserve-newline"];function l(u){m.call(this,u,"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 o=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<o.length;h++)o[h]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=o[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",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}l.prototype=new m,i.exports.Options=l},function(i){function D(p,l){this.raw_options=g(p,l),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(p,l){var u=this.raw_options[p],f=l||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(f=u.concat()):typeof u=="string"&&(f=u.split(/[^a-zA-Z0-9_\/\-]+/)),f},D.prototype._get_boolean=function(p,l){var u=this.raw_options[p],f=u===void 0?!!l:!!u;return f},D.prototype._get_characters=function(p,l){var u=this.raw_options[p],f=l||"";return typeof u=="string"&&(f=u.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),f},D.prototype._get_number=function(p,l){var u=this.raw_options[p];l=parseInt(l,10),isNaN(l)&&(l=0);var f=parseInt(u,10);return isNaN(f)&&(f=l),f},D.prototype._get_selection=function(p,l,u){var f=this._get_selection_list(p,l,u);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
|
|
`+l+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f[0]},D.prototype._get_selection_list=function(p,l,u){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(u=u||[l[0]],!this._is_valid_selection(u,l))throw new Error("Invalid Default Value!");var f=this._get_array(p,u);if(!this._is_valid_selection(f,l))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
|
|
`+l+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f},D.prototype._is_valid_selection=function(p,l){return p.length&&l.length&&!p.some(function(u){return l.indexOf(u)===-1})};function g(p,l){var u={};p=m(p);var f;for(f in p)f!==l&&(u[f]=p[f]);if(l&&p[l])for(f in p[l])u[f]=p[l][f];return u}function m(p){var l={},u;for(u in p){var f=u.replace(/-/g,"_");l[f]=p[u]}return l}i.exports.Options=D,i.exports.normalizeOpts=m,i.exports.mergeOpts=g},function(i,D,g){var m=g(8).InputScanner,p=g(9).Tokenizer,l=g(9).TOKEN,u=g(13).Directives,f=g(4),o=g(12).Pattern,h=g(14).TemplatablePattern;function s(B,O){return O.indexOf(B)!==-1}var a={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:l.START,RAW:l.RAW,EOF:l.EOF},A=new u(/\/\*/,/\*\//),_=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,S=/[0-9]/,L=/[^\d\.]/,R=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),C=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";C=C.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),C="\\?\\.(?!\\d) "+C,C=C.replace(/ /g,"|");var w=new RegExp(C),x="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=x.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),T=new RegExp("^(?:"+c.join("|")+")$"),y,v=function(B,O){p.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 o(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(w),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(/[`}\\]/)}};v.prototype=new p,v.prototype._is_comment=function(B){return B.type===a.COMMENT||B.type===a.BLOCK_COMMENT||B.type===a.UNKNOWN},v.prototype._is_opening=function(B){return B.type===a.START_BLOCK||B.type===a.START_EXPR},v.prototype._is_closing=function(B,O){return(B.type===a.END_BLOCK||B.type===a.END_EXPR)&&O&&(B.text==="]"&&O.text==="["||B.text===")"&&O.text==="("||B.text==="}"&&O.text==="{")},v.prototype._reset=function(){y=!1},v.prototype._get_next_token=function(B,O){var j=null;this._readWhitespace();var P=this._input.peek();return P===null?this._create_token(a.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(a.UNKNOWN,this._input.next()),j)},v.prototype._read_word=function(B){var O;if(O=this.__patterns.identifier.read(),O!=="")return O=O.replace(f.allLineBreaks,`
|
|
`),!(B.type===a.DOT||B.type===a.RESERVED&&(B.text==="set"||B.text==="get"))&&T.test(O)?(O==="in"||O==="of")&&(B.type===a.WORD||B.type===a.STRING)?this._create_token(a.OPERATOR,O):this._create_token(a.RESERVED,O):this._create_token(a.WORD,O);if(O=this.__patterns.number.read(),O!=="")return this._create_token(a.WORD,O)},v.prototype._read_singles=function(B){var O=null;return B==="("||B==="["?O=this._create_token(a.START_EXPR,B):B===")"||B==="]"?O=this._create_token(a.END_EXPR,B):B==="{"?O=this._create_token(a.START_BLOCK,B):B==="}"?O=this._create_token(a.END_BLOCK,B):B===";"?O=this._create_token(a.SEMICOLON,B):B==="."&&L.test(this._input.peek(1))?O=this._create_token(a.DOT,B):B===","&&(O=this._create_token(a.COMMA,B)),O&&this._input.next(),O},v.prototype._read_punctuation=function(){var B=this.__patterns.punct.read();if(B!=="")return B==="="?this._create_token(a.EQUALS,B):B==="?."?this._create_token(a.DOT,B):this._create_token(a.OPERATOR,B)},v.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(a.UNKNOWN,O.trim()+`
|
|
`);if(O=this.__patterns.include.read(),O)return this._create_token(a.UNKNOWN,O.trim()+`
|
|
`);B=this._input.next();var j="#";if(this._input.hasNext()&&this._input.testChar(S)){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(a.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 y=!0,this._create_token(a.COMMENT,O)}}else if(y&&B==="-"&&(O=this.__patterns.html_comment_end.read(),O))return y=!1,this._create_token(a.COMMENT,O);return null},v.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(a.BLOCK_COMMENT,j),O.directives=P}else this._input.peek(1)==="/"&&(j=this.__patterns.comment.read(),O=this._create_token(a.COMMENT,j))}return O},v.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=N(O)),this._input.peek()===B&&(O+=this._input.next()),O=O.replace(f.allLineBreaks,`
|
|
`),this._create_token(a.STRING,O)}return null},v.prototype._allow_regexp_or_xml=function(B){return B.type===a.RESERVED&&s(B.text,["return","case","throw","else","do","typeof","yield"])||B.type===a.END_EXPR&&B.text===")"&&B.opened.previous.type===a.RESERVED&&s(B.opened.previous.text,["if","while","for"])||s(B.type,[a.COMMENT,a.START_EXPR,a.START_BLOCK,a.START,a.END_BLOCK,a.OPERATOR,a.EQUALS,a.EOF,a.SEMICOLON,a.COMMA])},v.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(a.STRING,j)}return null},v.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 le=!!P[1],ue=P[2],ke=!!P[P.length-1]||ue.slice(0,8)==="![CDATA[";if(!ke&&(ue===b||Y&&ue.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(le?--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(a.STRING,j)}}return null};function N(B){for(var O="",j=0,P=new m(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}v.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=v,i.exports.TOKEN=a,i.exports.positionable_operators=R.slice(),i.exports.line_starters=x.slice()},function(i){var D=RegExp.prototype.hasOwnProperty("sticky");function g(m){this.__input=m||"",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 m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},g.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},g.prototype.__match=function(m,p){m.lastIndex=p;var l=m.exec(this.__input);return l&&!(D&&m.sticky)&&(l.index!==p&&(l=null)),l},g.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},g.prototype.testChar=function(m,p){var l=this.peek(p);return m.lastIndex=0,l!==null&&m.test(l)},g.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},g.prototype.read=function(m,p,l){var u="",f;return m&&(f=this.match(m),f&&(u+=f[0])),p&&(f||!m)&&(u+=this.readUntil(p,l)),u},g.prototype.readUntil=function(m,p){var l="",u=this.__position;m.lastIndex=this.__position;var f=m.exec(this.__input);return f?(u=f.index,p&&(u+=f[0].length)):u=this.__input_length,l=this.__input.substring(this.__position,u),this.__position=u,l},g.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},g.prototype.get_regexp=function(m,p){var l=null,u="g";return p&&D&&(u="y"),typeof m=="string"&&m!==""?l=new RegExp(m,u):m&&(l=new RegExp(m.source,u)),l},g.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(m){var p=this.__position,l=this.readUntilAfter(m);return this.__position=p,l},g.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},i.exports.InputScanner=g},function(i,D,g){var m=g(8).InputScanner,p=g(3).Token,l=g(10).TokenStream,u=g(11).WhitespacePattern,f={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(h,s){this._input=new m(h),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new u(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var h,s=new p(f.START,""),a=null,A=[],_=new l;s.type!==f.EOF;){for(h=this._get_next_token(s,a);this._is_comment(h);)_.add(h),h=this._get_next_token(s,a);_.isEmpty()||(h.comments_before=_,_=new l),h.parent=a,this._is_opening(h)?(A.push(a),a=h):a&&this._is_closing(h,a)&&(h.opened=a,a.closed=h,a=A.pop(),h.parent=a),h.previous=s,s.next=h,this.__tokens.add(h),s=h}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(h,s){this._readWhitespace();var a=this._input.read(/.+/g);return a?this._create_token(f.RAW,a):this._create_token(f.EOF,"")},o.prototype._is_comment=function(h){return!1},o.prototype._is_opening=function(h){return!1},o.prototype._is_closing=function(h,s){return!1},o.prototype._create_token=function(h,s){var a=new p(h,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return a},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},i.exports.Tokenizer=o,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 m=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(m=this.__tokens[g]),m},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 m=g(12).Pattern;function p(l,u){m.call(this,l,u),u?this._line_regexp=this._input.get_regexp(u._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new m,p.prototype.__set_whitespace_patterns=function(l,u){l+="\\t ",u+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+u+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+u+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var u=this.__split(this._newline_regexp,l);this.newline_count=u.length-1,this.whitespace_before_token=u[this.newline_count]}return l},p.prototype.matching=function(l,u){var f=this._create();return f.__set_whitespace_patterns(l,u),f._update(),f},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(l,u){l.lastIndex=0;for(var f=0,o=[],h=l.exec(u);h;)o.push(u.substring(f,h.index)),f=h.index+h[0].length,h=l.exec(u);return f<u.length?o.push(u.substring(f,u.length)):o.push(""),o},i.exports.WhitespacePattern=p},function(i){function D(g,m){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._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 m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(g),m._update(),m},D.prototype.until=function(g){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(g),m._update(),m},D.prototype.starting_with=function(g){var m=this._create();return m._starting_pattern=this._input.get_regexp(g,!0),m._update(),m},D.prototype.matching=function(g){var m=this._create();return m._match_pattern=this._input.get_regexp(g,!0),m._update(),m},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},i.exports.Pattern=D},function(i){function D(g,m){g=typeof g=="string"?g:g.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+m,"g")}D.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(g);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(g);return m},D.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=D},function(i,D,g){var m=g(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(u,f){m.call(this,u,f),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),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 o=new m(u);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}/)}}l.prototype=new m,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(u){var f=this._create();return f._disabled[u]=!0,f._update(),f},l.prototype.read_options=function(u){var f=this._create();for(var o in p)f._disabled[o]=u.templating.indexOf(o)===-1;return f._update(),f},l.prototype.exclude=function(u){var f=this._create();return f._excluded[u]=!0,f._update(),f},l.prototype.read=function(){var u="";this._match_pattern?u=this._input.read(this._starting_pattern):u=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),u+=f,f=this._read_template();return this._until_after&&(u+=this._input.readUntilAfter(this._until_pattern)),u},l.prototype.__set_templated_pattern=function(){var u=[];this._disabled.php||u.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||u.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||u.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(u.push(this.__patterns.django._starting_pattern.source),u.push(this.__patterns.django_value._starting_pattern.source),u.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||u.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&u.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+u.join("|")+")")},l.prototype._read_template=function(){var u="",f=this._input.peek();if(f==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(u=u||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(u=u||this.__patterns.erb.read())}else f==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(u=u||this.__patterns.handlebars_comment.read(),u=u||this.__patterns.handlebars_unescaped.read(),u=u||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(u=u||this.__patterns.django_value.read()),this._excluded.django||(u=u||this.__patterns.django_comment.read(),u=u||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(u=u||this.__patterns.smarty_comment.read(),u=u||this.__patterns.smarty_literal.read(),u=u||this.__patterns.smarty.read()));return u},i.exports.TemplatablePattern=l}],U={};function G(i){var D=U[i];if(D!==void 0)return D.exports;var g=U[i]={exports:{}};return F[i](g,g.exports,G),g.exports}var W=G(0);M=W})();var X=M;!(ie=[],$=function(){return{js_beautify:X}}.apply(be,ie),$!==void 0&&(st.exports=$))})()},"746U":function(st,be,Q){"use strict";Q.d(be,"f",function(){return ie}),Q.d(be,"l",function(){return $}),Q.d(be,"k",function(){return M}),Q.d(be,"j",function(){return X}),Q.d(be,"g",function(){return F}),Q.d(be,"m",function(){return U}),Q.d(be,"h",function(){return G}),Q.d(be,"n",function(){return W}),Q.d(be,"c",function(){return i}),Q.d(be,"a",function(){return D}),Q.d(be,"i",function(){return g}),Q.d(be,"o",function(){return m}),Q.d(be,"e",function(){return u}),Q.d(be,"d",function(){return f}),Q.d(be,"p",function(){return o}),Q.d(be,"b",function(){return h});function ie(s){return Array.isArray(s)}function $(s){return typeof s=="string"}function M(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function X(s){return typeof s=="number"&&!isNaN(s)}function F(s){return s===!0||s===!1}function U(s){return typeof s=="undefined"}function G(s){return!W(s)}function W(s){return U(s)||s===null}function i(s,a){if(!s)throw new Error(a?`Unexpected type, expected '${a}'`:"Unexpected type")}function D(s){if(W(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function g(s){return typeof s=="function"}function m(s,a){const A=Math.min(s.length,a.length);for(let _=0;_<A;_++)p(s[_],a[_])}function p(s,a){if($(a)){if(typeof s!==a)throw new Error(`argument does not match constraint: typeof ${a}`)}else if(g(a)){try{if(s instanceof a)return}catch(A){}if(!W(s)&&s.constructor===a)return;if(a.length===1&&a.call(void 0,s)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function l(s){let a=[],A=Object.getPrototypeOf(s);for(;Object.prototype!==A;)a=a.concat(Object.getOwnPropertyNames(A)),A=Object.getPrototypeOf(A);return a}function u(s){const a=[];for(const A of l(s))typeof s[A]=="function"&&a.push(A);return a}function f(s,a){const A=S=>function(){const L=Array.prototype.slice.call(arguments,0);return a(S,L)};let _={};for(const S of s)_[S]=A(S);return _}function o(s){return s===null?void 0:s}function h(s,a="Unreachable"){throw new Error(a)}},"7Cbv":function(st,be,Q){"use strict";var ie=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),$=new Uint8Array(16);function M(){if(!ie)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ie($)}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 F(p){return typeof p=="string"&&X.test(p)}for(var U=F,G=[],W=0;W<256;++W)G.push((W+256).toString(16).substr(1));function i(p){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,u=(G[p[l+0]]+G[p[l+1]]+G[p[l+2]]+G[p[l+3]]+"-"+G[p[l+4]]+G[p[l+5]]+"-"+G[p[l+6]]+G[p[l+7]]+"-"+G[p[l+8]]+G[p[l+9]]+"-"+G[p[l+10]]+G[p[l+11]]+G[p[l+12]]+G[p[l+13]]+G[p[l+14]]+G[p[l+15]]).toLowerCase();if(!U(u))throw TypeError("Stringified UUID is invalid");return u}var D=i;function g(p,l,u){p=p||{};var f=p.random||(p.rng||M)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,l){u=u||0;for(var o=0;o<16;++o)l[u+o]=f[o];return l}return D(f)}var m=be.a=g},"7ahc":function(st,be,Q){"use strict";Q.d(be,"a",function(){return A});var ie=Q("k1fw"),$=Q("0Owb"),M=Q("+L6B"),X=Q("2/Rp"),F=Q("y8nQ"),U=Q("Vl3Y"),G=Q("tJVT"),W=Q("OaEy"),i=Q("2fM7"),D=Q("q1tI"),g=Q.n(D),m=Q("VrN/"),p=Q.n(m),l=Q("p77/"),u=Q.n(l),f=Q("c5Ni"),o=Q.n(f),h=i.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},a={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"]};be.b=function(_){var S=_.callback,L=_.onCancel,R=Object(D.useState)("python"),C=Object(G.a)(R,2),w=C[0],x=C[1];function c(y){x(a[y][1])}function T(y){S(y)}return g.a.createElement(U.a,Object($.a)({},s,{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:c},Object.keys(a).map(function(y){return g.a.createElement(h,{key:y,value:y},a[y][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:w})),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 S=_.value,L=_.onChange,R=_.mode,C=_.options,w=C===void 0?{}:C,x=Object(D.useRef)(),c=Object(D.useState)(),T=Object(G.a)(c,2),y=T[0],v=T[1];return Object(D.useEffect)(function(){if(y){function N(B){var O=B.getValue();L&&L(O)}return y.on("change",N),function(){y.off("change",N)}}},[y,L]),Object(D.useEffect)(function(){y&&y.setOption("mode",R)},[y,R]),Object(D.useEffect)(function(){y&&((S!==y.getValue()||S==="")&&setTimeout(function(){y.setValue(S||" ")},300))},[y,S]),Object(D.useEffect)(function(){if(x.current&&!y){var N=p.a.fromTextArea(x.current,Object(ie.a)({mode:R,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},w));v(N)}},[x.current,y]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:x}))}},"8EBN":function(st,be,Q){(function(ie){ie(Q("VrN/"))})(function(ie){"use strict";ie.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;$<ie.modeInfo.length;$++){var M=ie.modeInfo[$];M.mimes&&(M.mime=M.mimes[0])}ie.findModeByMIME=function(X){X=X.toLowerCase();for(var F=0;F<ie.modeInfo.length;F++){var U=ie.modeInfo[F];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 ie.findModeByMIME("application/xml");if(/\+json$/.test(X))return ie.findModeByMIME("application/json")},ie.findModeByExtension=function(X){X=X.toLowerCase();for(var F=0;F<ie.modeInfo.length;F++){var U=ie.modeInfo[F];if(U.ext){for(var G=0;G<U.ext.length;G++)if(U.ext[G]==X)return U}}},ie.findModeByFileName=function(X){for(var F=0;F<ie.modeInfo.length;F++){var U=ie.modeInfo[F];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 ie.findModeByExtension(W)},ie.findModeByName=function(X){X=X.toLowerCase();for(var F=0;F<ie.modeInfo.length;F++){var U=ie.modeInfo[F];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(st,be,Q){"use strict";Q.d(be,"a",function(){return F}),Q.d(be,"b",function(){return U}),Q.d(be,"d",function(){return G}),Q.d(be,"e",function(){return W}),Q.d(be,"c",function(){return i});var ie=Q("MI8n"),$=Q("pmY6"),M=Q("3/fG"),X=function(D,g,m,p){function l(u){return u instanceof m?u:new m(function(f){f(u)})}return new(m||(m=Promise))(function(u,f){function o(a){try{s(p.next(a))}catch(A){f(A)}}function h(a){try{s(p.throw(a))}catch(A){f(A)}}function s(a){a.done?u(a.value):l(a.value).then(o,h)}s((p=p.apply(D,g||[])).next())})};class F extends $.a{constructor(D,g="",m="",p=!0,l){super();this._onDidChange=this._register(new ie.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=g,this._cssClass=m,this._enabled=p,this._actionCallback=l}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 ie.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ie.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 m;try{yield this.runAction(D,g)}catch(p){m=p}this._onDidRun.fire({action:D,error:m})})}runAction(D,g){return X(this,void 0,void 0,function*(){yield D.run(g)})}}class G extends F{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,m,p){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=g,this.class=p,this._actions=m}get actions(){return this._actions}dispose(){}run(){return X(this,void 0,void 0,function*(){})}}class i extends F{constructor(){super(i.ID,M.a("submenu.empty","(empty)"),void 0,!1)}}i.ID="vs.actions.empty"},"8hTe":function(st,be,Q){st.exports={button:"button___1wy9m"}},"9Bee":function(st,be,Q){"use strict";var ie=Q("DYRE"),$=Q("zeV3"),M=Q("+L6B"),X=Q("2/Rp"),F=Q("k1fw"),U=Q("9og8"),G=Q("tJVT"),W=Q("WmNS"),i=Q.n(W),D=Q("q1tI"),g=Q.n(D),m=Q("vg9a"),p=Q("DlQD"),l=Q.n(p),u=Q("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 ye=Object(G.a)(z,1),Ke=ye[0];return Ke.length>=H.length?q.slice(H.length):q}).join(`
|
|
`)}var o=[],h=["<ul>"],s=new l.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){o.length=0,h=["<ul>"]}var _={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(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=S(V,E,q.level,z),z.length>0&&(H.push("<ul>"),z.forEach(function(ye){H.push(ye)}),H.push("</ul>")),H.push("</li>"),E=S(V,E,I,H),E}function L(){return S(o,0,0,h),h.push("</ul>"),h.join("")}var R={heading:function(E){var I=a.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 ye=x(),Ke=q;q=ye,c[ye]={type:"block",expression:Ke}}return{type:"code",raw:H,lang:z,text:q}}}},C=/(?:\${2})([^\n`]+?)(?:\${2})/gi,w=0,x=function(){return"__special_katext_id_".concat(w++,"__")},c={};function T(){return c}function y(){w=0,c={}}function v(V){return V=V.replace(C,function(E,I){var H=x();return c[H]={type:"inline",expression:I},H}),V}var N=s.listitem;s.listitem=function(V){return N(v(V))};var B=s.paragraph;s.paragraph=function(V){return B(v(V))};var O=s.tablecell;s.tablecell=function(V,E){return O(v(V),E)},s.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(u.escape)(V,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(I?V:Object(u.escape)(V,!0))+"</code></pre>"},s.heading=function(V,E,I){var H=this.options.headerPrefix+I.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:H,level:E,text:V}),"<h"+E+' id="'+H+'">'+V+"</h"+E+">"},l.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),l.a.use({tokenizer:R,renderer:s});var j=l.a,P=Q("SJMd"),b=Q("ulZh"),Y=Q.n(b),ee=Q("m3rI"),le=Q("Oy/b"),ue=Q("p5ED"),ke=Q("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 we=function(V,E){return(we=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 Ae(V,E){function I(){this.constructor=V}we(V,E),V.prototype=E===null?Object.create(E):(I.prototype=E.prototype,new I)}function ce(V,E,I,H){return new(I||(I=Promise))(function(q,z){function ye(pt){try{tt(H.next(pt))}catch(Ye){z(Ye)}}function Ke(pt){try{tt(H.throw(pt))}catch(Ye){z(Ye)}}function tt(pt){var Ye;pt.done?q(pt.value):(Ye=pt.value,Ye instanceof I?Ye:new I(function(_t){_t(Ye)})).then(ye,Ke)}tt((H=H.apply(V,E||[])).next())})}function pe(V,E){var I,H,q,z,ye={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return z={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function Ke(tt){return function(pt){return function(Ye){if(I)throw new TypeError("Generator is already executing.");for(;ye;)try{if(I=1,H&&(q=2&Ye[0]?H.return:Ye[0]?H.throw||((q=H.return)&&q.call(H),0):H.next)&&!(q=q.call(H,Ye[1])).done)return q;switch(H=0,q&&(Ye=[2&Ye[0],q.value]),Ye[0]){case 0:case 1:q=Ye;break;case 4:return ye.label++,{value:Ye[1],done:!1};case 5:ye.label++,H=Ye[1],Ye=[0];continue;case 7:Ye=ye.ops.pop(),ye.trys.pop();continue;default:if(!(q=ye.trys,(q=q.length>0&&q[q.length-1])||Ye[0]!==6&&Ye[0]!==2)){ye=0;continue}if(Ye[0]===3&&(!q||Ye[1]>q[0]&&Ye[1]<q[3])){ye.label=Ye[1];break}if(Ye[0]===6&&ye.label<q[1]){ye.label=q[1],q=Ye;break}if(q&&ye.label<q[2]){ye.label=q[2],ye.ops.push(Ye);break}q[2]&&ye.ops.pop(),ye.trys.pop();continue}Ye=E.call(V,ye)}catch(_t){Ye=[6,_t],H=0}finally{I=q=0}if(5&Ye[0])throw Ye[1];return{value:Ye[0]?Ye[1]:void 0,done:!0}}([tt,pt])}}}function se(){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],ye=0,Ke=z.length;ye<Ke;ye++,q++)H[q]=z[ye];return H}var ae=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],ye=z[0],Ke=z[1];E.setAttribute(ye,Ke)}},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 ye=document.createElementNS("http://www.w3.org/2000/svg","line");return ye.setAttribute("x1",E.toString()),ye.setAttribute("y1",I.toString()),ye.setAttribute("x2",H.toString()),ye.setAttribute("y2",q.toString()),z&&V.setAttributes(ye,z),ye},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,ye,Ke){var tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return V.setAttributes(tt,[["id",E],["orient",I],["markerWidth",H.toString()],["markerHeight",q.toString()],["refX",z.toString()],["refY",ye.toString()]]),tt.appendChild(Ke),tt},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}(),Oe=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}(),xe=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 ye=H!==void 0?H:document.createElement("canvas");E===null&&(q.markersOnly=!0,q.naturalSize=!1);var Ke=document.createElementNS("http://www.w3.org/2000/svg","svg");Ke.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ke.setAttribute("width",I.width.baseVal.valueAsString),Ke.setAttribute("height",I.height.baseVal.valueAsString),Ke.setAttribute("viewBox","0 0 "+I.viewBox.baseVal.width.toString()+" "+I.viewBox.baseVal.height.toString()),Ke.innerHTML=I.innerHTML,q.naturalSize===!0?(Ke.width.baseVal.value=E.naturalWidth,Ke.height.baseVal.value=E.naturalHeight):q.width!==void 0&&q.height!==void 0&&(Ke.width.baseVal.value=q.width,Ke.height.baseVal.value=q.height),ye.width=Ke.width.baseVal.value,ye.height=Ke.height.baseVal.value;var tt=Ke.outerHTML,pt=ye.getContext("2d");q.markersOnly!==!0&&pt.drawImage(E,0,0,ye.width,ye.height);var Ye=window.URL,_t=new Image(ye.width,ye.height);_t.setAttribute("crossOrigin","anonymous");var jt=new Blob([tt],{type:"image/svg+xml"}),$t=Ye.createObjectURL(jt);_t.onload=function(){pt.drawImage(_t,0,0),Ye.revokeObjectURL($t);var ji=ye.toDataURL(q.imageType,q.imageQuality);z(ji)},_t.src=$t})},V}(),Pe=function(){},De=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 Ge("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ge("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ge("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Le("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Le("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}(),Ge=function(V,E){this.selector=V,this.style=E},Le=function(V,E){this.localName=V,this.style=E},Fe=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 ye=document.createElement("div");ye.className=""+I.toolbarButtonStyleClass.name,ye.setAttribute("data-type-name",z.typeName),ye.innerHTML=z.icon,ye.addEventListener("click",function(){I.markerToolbarButtonClicked(ye,z)}),I.buttons.push(ye),I.markerButtons.push(ye)}),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 Le("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 Le("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Le("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Le("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 Le("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var E=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Le("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 Le("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Le("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ge("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ge("."+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}(),We=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 Le("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 Le("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var I=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Le("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Le("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Le("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 Le("toolbox-panel-row_colors",`
|
|
background-color: `+((E=this.uiStyleSettings.toolboxBackgroundColor)!==null&&E!==void 0?E:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Le("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 Le("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Le("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Ge("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ge("."+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 ye;z.uiStyleSettings=q.uiStyleSettings;var Ke=document.createElement("div");Ke.className=q.toolboxButtonStyleClass.name+" "+((ye=q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ye!==void 0?ye:q.toolboxButtonStyleColorsClass.name),Ke.innerHTML=z.icon,Ke.title=z.title,Ke.addEventListener("click",function(){q.panelButtonClick(z)}),q.panelButtons.push(Ke),q.buttonRow.appendChild(Ke)}),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,ye){var Ke,tt;z.className=I.toolboxButtonStyleClass.name+" "+(ye===H?""+((Ke=I.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:I.toolboxActiveButtonStyleColorsClass.name):""+((tt=I.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&tt!==void 0?tt:I.toolboxButtonStyleColorsClass.name))})},V}(),oe=function(V,E){this.title=V,this.icon=E},ge=function(V){function E(I,H,q,z){var ye=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 ye.colors=[],ye.addTransparent=!1,ye.colorBoxes=[],ye.colors=H,ye.currentColor=q,ye.setCurrentColor=ye.setCurrentColor.bind(ye),ye.getColorBox=ye.getColorBox.bind(ye),ye}return Ae(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,ye=document.createElement("div");ye.style.display="inline-block",ye.style.boxSizing="content-box",ye.style.width=z-2+"px",ye.style.height=z-2+"px",ye.style.padding="1px",ye.style.marginRight="2px",ye.style.marginBottom="2px",ye.style.borderWidth="2px",ye.style.borderStyle="solid",ye.style.borderRadius=(z+2)/2+"px",ye.style.borderColor=I===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ye.addEventListener("click",function(){H.setCurrentColor(I,ye)});var Ke=document.createElement("div");return Ke.style.display="inline-block",Ke.style.width=z-2+"px",Ke.style.height=z-2+"px",Ke.style.backgroundColor=I,Ke.style.borderRadius=z/2+"px",I==="transparent"&&(Ke.style.fill=this.uiStyleSettings.toolboxAccentColor,Ke.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>`),ye.appendChild(Ke),ye},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}(oe),Se=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}(),Ce=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}(),je=function(){function V(){this.GRIP_SIZE=10,this.visual=ae.createGroup(),this.visual.appendChild(ae.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ae.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}(),Ve=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}(),Qe=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(ae.createTransform()),z.setupControlBox(),z}return Ae(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=ae.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 ye=this.container.transform.baseVal.getItem(0);ye.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ye,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,ye=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,ye=this.manipulationStartHeight+this.manipulationStartTop-z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ye=this.manipulationStartHeight+I.y-this.manipulationStartY}q>=0?(this.left=H,this.width=q):(this.left=H+q,this.width=-q),ye>=0?(this.top=z,this.height=ye):(this.top=z+ye,this.height=-ye),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=ae.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=ae.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=ae.createGroup();var I=ae.createTransform();I.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(I),this.container.appendChild(this.controlBox),this.controlRect=ae.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=ae.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 Ce,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 je;return I.visual.transform.baseVal.appendItem(ae.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,ye=(this.height+this.CB_DISTANCE)/2-I/2,Ke=this.height+this.CB_DISTANCE-I/2,tt=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,tt,q),this.positionGrip(this.controlGrips.centerLeft.visual,H,ye),this.positionGrip(this.controlGrips.centerRight.visual,tt,ye),this.positionGrip(this.controlGrips.bottomLeft.visual,H,Ke),this.positionGrip(this.controlGrips.bottomCenter.visual,z,Ke),this.positionGrip(this.controlGrips.bottomRight.visual,tt,Ke),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:Ve.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ve.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(Ve.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,H.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ve.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}(Se),Je=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 Ae(E,V),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual)},E.prototype.createVisual=function(){this.visual=ae.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),ae.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&&ae.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},E.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&ae.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},E.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&ae.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},E.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&ae.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}(Qe),at=function(V){function E(I,H,q,z){var ye=V.call(this,I,z||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ye.widths=[],ye.widthBoxes=[],ye.widths=H,ye.currentWidth=q,ye.setCurrentWidth=ye.setCurrentWidth.bind(ye),ye}return Ae(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 ye=document.createElement("div");ye.innerText=q.toString(),ye.style.marginRight="5px",z.appendChild(ye);var Ke=document.createElement("div");Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.display="flex",Ke.style.alignItems="center";var tt=document.createElement("hr");tt.style.minWidth="20px",tt.style.border="0px",tt.style.borderTop=q+"px solid "+I.uiStyleSettings.toolboxColor,tt.style.flexGrow="2",Ke.appendChild(tt),z.appendChild(Ke),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}(oe),Xe=function(V){function E(I,H,q,z){var ye=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 ye.styles=[],ye.styleBoxes=[],ye.styles=H,ye.currentStyle=q,ye.setCurrentStyle=ye.setCurrentStyle.bind(ye),ye}return Ae(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 ye=document.createElement("div");ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.overflow="hidden";var Ke=`<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>`;ye.innerHTML=Ke,z.appendChild(ye),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}(oe),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 ge("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new at("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Xe("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Ae(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}(Je),Ne=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},lt=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 Ae(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=ae.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 je;return I.visual.transform.baseVal.appendItem(ae.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}(Se),nt=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 ge("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new at("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Xe("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Ae(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=ae.createGroup(),this.selectorLine=ae.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ae.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()),ae.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ae.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ae.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}(lt),Be=function(V){function E(I,H,q,z){var ye=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 ye.fonts=[],ye.fontBoxes=[],ye.fonts=H,ye.currentFont=q,ye.setCurrentFont=ye.setCurrentFont.bind(ye),ye}return Ae(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 ye=document.createElement("div");ye.style.display="flex",ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.fontFamily=q,ye.style.overflow="hidden";var Ke=document.createElement("div");Ke.style.whiteSpace="nowrap",Ke.style.overflow="hidden",Ke.style.textOverflow="ellipsis",Ke.innerHTML="The quick brown fox jumps over the lazy dog",ye.appendChild(Ke),z.appendChild(ye),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}(oe),Ue=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 ge("Color",q.defaultColorSet,q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.fontFamilyPanel=new Be("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z}return Ae(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=ae.createGroup(),this.bgRectangle=ae.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ae.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ae.createTransform()),this.textElement.transform.baseVal.appendItem(ae.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(ae.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&&(ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ae.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&&ae.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&&ae.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}(Qe),Te=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 ge("Color",q.defaultColorSet,q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.lineWidthPanel=new at("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.lineWidthPanel.onWidthChanged=z.setLineWidth,z}return Ae(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=ae.createGroup(),this.drawingImage=ae.createImage(),this.visual.appendChild(this.drawingImage);var I=ae.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),ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ae.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],ye=H[2],Ke=H[3],tt=!1,pt=0;pt<this.canvasElement.height;pt++)for(var Ye=0;Ye<this.canvasElement.width;Ye++)I.data[pt*this.canvasElement.width*4+4*Ye+3]>0&&(tt=!0,pt<z&&(z=pt),Ye<q&&(q=Ye),pt>Ke&&(Ke=pt),Ye>ye&&(ye=Ye));if(tt){this.left=q/this.pixelRatio,this.top=z/this.pixelRatio,this.width=(ye-q)/this.pixelRatio,this.height=(Ke-z)/this.pixelRatio;var _t=document.createElement("canvas");_t.width=ye-q,_t.height=Ke-z,_t.getContext("2d").putImageData(this.canvasContext.getImageData(q,z,ye-q,Ke-z),0,0),this.drawingImgUrl=_t.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},E.prototype.setDrawingImage=function(){ae.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ae.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}(Qe),ve=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 Ae(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(Ke){var tt="both";switch(Ke){case 0:tt="both";break;case 1:tt="start";break;case 2:tt="end";break;case 3:tt="none"}var pt=document.createElement("div");if(pt.style.display="flex",pt.style.flexGrow="2",pt.style.alignItems="center",pt.style.justifyContent="space-between",pt.style.padding="5px",pt.style.borderWidth="2px",pt.style.borderStyle="solid",pt.style.borderColor=tt===z.currentType?z.uiStyleSettings.toolboxAccentColor:"transparent",pt.addEventListener("click",function(){I.setCurrentType(tt,pt)}),H.appendChild(pt),tt==="both"||tt==="start"){var Ye=document.createElement("div");Ye.style.display="flex",Ye.style.alignItems="center",Ye.style.minHeight="20px",Ye.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>`,Ye.style.marginLeft="5px",pt.appendChild(Ye)}var _t=document.createElement("div");_t.style.display="flex",_t.style.alignItems="center",_t.style.minHeight="20px",_t.style.flexGrow="2";var jt=document.createElement("hr");if(jt.style.minWidth="20px",jt.style.border="0px",jt.style.borderTop="3px solid "+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee"),jt.style.flexGrow="2",_t.appendChild(jt),pt.appendChild(_t),tt==="both"||tt==="end"){var $t=document.createElement("div");$t.style.display="flex",$t.style.alignItems="center",$t.style.minHeight="20px",$t.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>`,$t.style.marginRight="5px",pt.appendChild($t)}z.typeBoxes.push(pt)},z=this,ye=0;ye<4;ye++)q(ye);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}(oe),_e=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 ve("Arrow type","end"),z.arrowTypePanel.onArrowTypeChanged=z.setArrowType,z}return Ae(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=ae.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ae.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ae.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",ae.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ae.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}(nt),re=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 ge("Color",q.defaultColorSet,q.defaultFillColor),z.fillPanel.onColorChanged=z.setFillColor,z}return Ae(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}(Je),ne=function(V){function E(I,H,q,z){var ye=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 ye.opacities=[],ye.opacityBoxes=[],ye.opacities=H,ye.currentOpacity=q,ye.setCurrentOpacity=ye.setCurrentOpacity.bind(ye),ye}return Ae(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 ye=document.createElement("div");ye.innerText=100*q+"%",z.appendChild(ye),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}(oe),he=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 ge("Color",q.defaultColorSet,z.fillColor),z.fillPanel.onColorChanged=z.setFillColor,z.opacityPanel=new ne("Opacity",q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return Ae(E,V),E.prototype.setOpacity=function(I){this.opacity=I,this.visual&&ae.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}(re),fe='<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>',Ee=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 ge("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 ge("Fill color",q.defaultColorSet,z.bgColor,fe),z.bgColorPanel.onColorChanged=z.setBgColor,z.fontFamilyPanel=new Be("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z.tipGrip=new je,z.tipGrip.visual.transform.baseVal.appendItem(ae.createTransform()),z.controlBox.appendChild(z.tipGrip.visual),z}return Ae(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(){ae.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ae.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&&(ae.setAttributes(this.bgRectangle,[["fill",I]]),ae.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(){ae.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}(Ue),Me=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 ge("Line color",se(q.defaultColorSet,["transparent"]),q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.fillPanel=new ge("Fill color",se(q.defaultColorSet,["transparent"]),z.fillColor,fe),z.fillPanel.onColorChanged=z.setFillColor,z.strokeWidthPanel=new at("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Xe("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z.opacityPanel=new ne("Opacity",q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return Ae(E,V),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual)},E.prototype.createVisual=function(){this.visual=ae.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),ae.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&&ae.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},E.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&ae.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(I),this.stateChanged()},E.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&ae.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},E.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&ae.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},E.prototype.setOpacity=function(I){this.opacity=I,this.visual&&ae.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}(Qe),ze=function(V){function E(I,H,q){return V.call(this,I,H,q)||this}return Ae(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=ae.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(ae.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ae.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(ae.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&&(ae.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()]]),ae.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}(nt),ot=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 Ae(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}(Me),mt=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}(),ft=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 ge("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new at("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Xe("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Ae(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=ae.createGroup(),this.selectorCurve=ae.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ae.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()),ae.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ae.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ae.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},E.prototype.setupControlBox=function(){V.prototype.setupControlBox.call(this),this.curveControlLine1=ae.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ae.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}(lt),wt=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}(),St=function(V){function E(I,H,q){var z=V.call(this,I,!1)||this;return z.dataUrl=H,z.state=q,z}return Ae(E,V),E}(wt),dt=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 Ae(E,V),E}(wt),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}(),Lt=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 Ne,this._isOpen=!1,this.undoRedoManager=new mt,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 De(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,Te,_e,Ue,ot,Me,he,Ee,ze,re,nt,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[qe,Te,_e,Ue,Me,he,Ee]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"BASIC_MARKER_TYPES",{get:function(){return[qe,Te,_e,Ue,he]},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(),Oe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},V.prototype.show=function(){var E=this;this.styles.styleSheetRoot===void 0&&Pe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Pe.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(I){return I(new wt(E))})},V.prototype.render=function(){return ce(this,void 0,void 0,function(){var E;return pe(this,function(I){switch(I.label){case 0:return this.setCurrentMarker(),(E=new xe).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 wt(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 wt(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 Ue?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=ae.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 Fe(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 We(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 dt(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 dt(E,H))})}}},V.prototype.clear=function(){var E=this,I=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ye){var Ke=new dt(E,void 0,!0);ye(Ke),Ke.defaultPrevented&&(I=!0)}),!I)){this.setCurrentMarker();for(var H=function(ye){var Ke=q.markers[ye];q.setCurrentMarker(q.markers[ye]),q._currentMarker.dispose(),q.markerImage.removeChild(q._currentMarker.container),q.markers.splice(q.markers.indexOf(q._currentMarker),1),q.eventListeners.markerdelete.forEach(function(tt){return tt(new dt(E,Ke))})},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 wt(E))})}else this.undoRedoManager.replaceLastUndoStep(I),this.eventListeners.statechange.forEach(function(z){return z(new wt(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 wt(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 wt(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 ce(this,void 0,void 0,function(){var E,I,H=this;return pe(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 St(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(ye){return ye.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 wt(I))})},V.prototype.addNewMarker=function(E){var I=ae.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 dt(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 Te&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Te):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(H){return H(new dt(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 dt(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 dt(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 dt(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){Oe.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 wt(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 wt(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 qt=function(V,E){return(qt=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 Qt(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}qt(V,E),V.prototype=E===null?Object.create(E):(I.prototype=E.prototype,new I)}function It(V,E,I,H){return new(I||(I=Promise))(function(q,z){function ye(pt){try{tt(H.next(pt))}catch(Ye){z(Ye)}}function Ke(pt){try{tt(H.throw(pt))}catch(Ye){z(Ye)}}function tt(pt){var Ye;pt.done?q(pt.value):(Ye=pt.value,Ye instanceof I?Ye:new I(function(_t){_t(Ye)})).then(ye,Ke)}tt((H=H.apply(V,E||[])).next())})}function Ci(V,E){var I,H,q,z,ye={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return z={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function Ke(tt){return function(pt){return function(Ye){if(I)throw new TypeError("Generator is already executing.");for(;ye;)try{if(I=1,H&&(q=2&Ye[0]?H.return:Ye[0]?H.throw||((q=H.return)&&q.call(H),0):H.next)&&!(q=q.call(H,Ye[1])).done)return q;switch(H=0,q&&(Ye=[2&Ye[0],q.value]),Ye[0]){case 0:case 1:q=Ye;break;case 4:return ye.label++,{value:Ye[1],done:!1};case 5:ye.label++,H=Ye[1],Ye=[0];continue;case 7:Ye=ye.ops.pop(),ye.trys.pop();continue;default:if(!(q=ye.trys,(q=q.length>0&&q[q.length-1])||Ye[0]!==6&&Ye[0]!==2)){ye=0;continue}if(Ye[0]===3&&(!q||Ye[1]>q[0]&&Ye[1]<q[3])){ye.label=Ye[1];break}if(Ye[0]===6&&ye.label<q[1]){ye.label=q[1],q=Ye;break}if(q&&ye.label<q[2]){ye.label=q[2],ye.ops.push(Ye);break}q[2]&&ye.ops.pop(),ye.trys.pop();continue}Ye=E.call(V,ye)}catch(_t){Ye=[6,_t],H=0}finally{I=q=0}if(5&Ye[0])throw Ye[1];return{value:Ye[0]?Ye[1]:void 0,done:!0}}([tt,pt])}}}var Ki=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}(),yt=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],ye=z[0],Ke=z[1];E.setAttribute(ye,Ke)}},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 ye=document.createElementNS("http://www.w3.org/2000/svg","line");return ye.setAttribute("x1",E.toString()),ye.setAttribute("y1",I.toString()),ye.setAttribute("x2",H.toString()),ye.setAttribute("y2",q.toString()),z&&V.setAttributes(ye,z),ye},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,ye,Ke){var tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return V.setAttributes(tt,[["id",E],["orient",I],["markerWidth",H.toString()],["markerHeight",q.toString()],["refX",z.toString()],["refY",ye.toString()]]),tt.appendChild(Ke),tt},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,ye,Ke,tt){return"M"+E+","+I+"V"+(I+q)+"H"+(E+H)+"V"+I+"H"+z+"V"+ye+"H"+(z+Ke)+"V"+(ye+tt)+"H"+z+"V"+I+"Z"},V}(),Li=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 bt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new bt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new bt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new xt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new xt("_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}(),bt=function(V,E){this.selector=V,this.style=E},xt=function(V,E){this.localName=V,this.style=E},Ft=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}(),ti=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}(),di=function(V){function E(){var I=V!==null&&V.apply(this,arguments)||this;return I.buttons=[],I}return Qt(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}(ti),Pt=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}(),ct=function(V){function E(){var I=V!==null&&V.apply(this,arguments)||this;return I.elements=[],I}return Qt(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}(ti),Ui=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}(),Vt=function(){function V(){}return V.getIcon=function(E,I){if(E>0&&I>0){var H=new Ui(E,I),q=H.ratio>=1?20:H.getHorizontalLength(20),z=H.ratio<1?20:H.getVerticalLength(20),ye=document.createElementNS("http://www.w3.org/2000/svg","svg");ye.setAttribute("xmlns","http://www.w3.org/2000/svg"),ye.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ye);var Ke=yt.createDefs();ye.appendChild(Ke);var tt=yt.createElement("clipPath",[["id","text-bg-clip"]]);Ke.appendChild(tt);var pt=yt.createPath(yt.getHollowRectanglePath((24-q)/2,(24-z)/2,q,z,(24-q)/2+2,(24-z)/2+2,q-4,z-4));ye.appendChild(pt);var Ye=yt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ye.appendChild(yt.createTSpan(E+":"+I)),ye.appendChild(Ye);var _t=Ye.getBBox();yt.setAttributes(Ye,[["x",((24-_t.width)/2).toString()],["y",((24-_t.height)/2-_t.y).toString()]]);var jt=yt.createPath(yt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(_t.width))/2,(24-Math.ceil(_t.height))/2,Math.ceil(_t.width),Math.ceil(_t.height)));return tt.appendChild(jt),yt.setAttributes(pt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ye),ye.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}(),Jt=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 Qt(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}(Pt),Ot=function(){function V(E,I){this.GRIP_SIZE=10,this.color=E,this.fillColor=I,this.visual=yt.createGroup(),this.visual.appendChild(yt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(yt.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 yt.setAttributes(H,[["cx",E.toString()],["cy",I.toString()]])})},V}(),li=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&&yt.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=yt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=yt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var I=0;I<this.numberOfGridLines;I++)this.horizontalGridLines.push(yt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(yt.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=yt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ot(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),yt.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,ye){var Ke=I.y+H*(ye+1);yt.setAttributes(z,[["x1",""+I.x],["y1",""+Ke],["x2",""+(I.x+I.width)],["y2",""+Ke]])});var q=I.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(z,ye){var Ke=I.x+q*(ye+1);yt.setAttributes(z,[["x1",""+Ke],["y1",""+I.y],["x2",""+Ke],["y2",""+(I.y+I.height)]])}),yt.setAttributes(this.cropShadeElement,[["d",yt.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,ye){var Ke=H/E,tt=q/I;return{x:(z.x-ye)*Ke+ye,y:(z.y-ye)*tt+ye,width:z.width*Ke,height:z.height*tt}},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}(),Ii=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();yt.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=yt.createPath(I);var z=yt.createTransform();this.scaleShape.transform.baseVal.appendItem(z),E.appendChild(this.scaleShape),this.angleLabelElement=yt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=yt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ye=yt.createTSpan("");return ye.innerHTML="°",this.angleLabelElement.appendChild(ye),E.appendChild(this.angleLabelElement),document.body.removeChild(E),E},V}(),Xi=function(){function V(){this.naturalSize=!1,this.imageType="image/png"}return V.prototype.rasterize=function(E,I,H,q,z,ye,Ke){var tt=this;return new Promise(function(pt){var Ye=document.createElement("canvas");Ye.width=E.width.baseVal.value-2*q,Ye.height=E.height.baseVal.value-2*q;var _t=1,jt=1;tt.naturalSize===!0?(_t=I.naturalWidth/(E.width.baseVal.value-2*q)/ye,jt=I.naturalHeight/(E.height.baseVal.value-2*q)/Ke,Ye.width=I.naturalWidth/ye,Ye.height=I.naturalHeight/Ke):tt.width!==void 0&&tt.height!==void 0&&(_t=tt.width/H.width,jt=tt.height/H.height,Ye.width*=_t,Ye.height*=jt);var $t=Ye.getContext("2d");$t.translate(Ye.width/2,Ye.height/2),$t.rotate(z*Math.PI/180),$t.scale(ye,Ke),$t.translate(-Ye.width/2,-Ye.height/2),$t.drawImage(I,0,0,Ye.width,Ye.height);var ji=document.createElement("canvas");ji.width=H.width*_t,ji.height=H.height*jt,ji.getContext("2d").putImageData($t.getImageData((H.x-q)*_t,(H.y-q)*jt,H.width*_t,H.height*jt),0,0),pt(ji.toDataURL(tt.imageType,tt.imageQuality))})},V}(),Ze=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 Li(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",yt.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();yt.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=yt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=yt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=yt.createGroup(),this.editingTargetRotationScaleContainer=yt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var E=yt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(E);var I=yt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(I),this.editingTargetContainer=yt.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=yt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new li(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 Ft,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 di;I.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(I);var H=[];this.aspectRatios.forEach(function(jt){var $t=new Pt(Vt.getIcon(jt.horizontal,jt.vertical),jt.horizontal===0&&jt.vertical===0?"FREE":jt.horizontal+":"+jt.vertical);$t.onClick=function(){return E.ratioButtonClicked(jt)},H.push($t)}),this.aspectRatioButton=new Jt(Vt.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 Pt('<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 Pt('<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),!Ki.isLicensed){var ye=new ct;this.topToolbar.addElementBlock(ye);var Ke=document.createElement("div");Ke.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var tt=document.createElement("a");tt.style.color="currentColor",tt.href="https://markerjs.com/products/cropro",tt.target="_blank",tt.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>',Ke.appendChild(tt),ye.addElement(Ke)}var pt=new di;pt.minWidth=3*this.toolbarHeight+"px",pt.contentAlign="end",this.topToolbar.addButtonBlock(pt);var Ye=new Pt('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Ye.onClick=this.startRenderAndClose,pt.addButton(Ye),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ye.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var _t=new Pt('<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");_t.onClick=this.close,pt.addButton(_t),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(_t.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},V.prototype.addBottomToolbar=function(){var E=this;this.bottomToolbar=new Ft,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 di;I.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(I);var H=new Pt('<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 Pt('<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 ct;z.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(z),this.straightener=new Ii("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(pt){E.rotateBy(pt),E.straightener.angle=E.rotationAngle},z.addElement(this.straightener.getUI());var ye=new di;ye.minWidth=2*this.toolbarHeight+"px",ye.contentAlign="end",this.bottomToolbar.addButtonBlock(ye);var Ke=new Pt('<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");Ke.onClick=this.flipHorizontallyButtonClicked,ye.addButton(Ke);var tt=new Pt('<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");tt.onClick=this.flipVerticallyButtonClicked,ye.addButton(tt)},V.prototype.ratioButtonClicked=function(E){this.aspectRatio=E,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},V.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Vt.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 Ui(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 It(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 It(this,void 0,void 0,function(){var E;return Ci(this,function(I){switch(I.label){case 0:return(E=new Xi).naturalSize=this.renderAtNaturalSize,E.imageType=this.renderImageType,E.imageQuality=this.renderImageQuality,E.width=this.renderWidth,E.height=this.renderHeight,this.unzoomFromCrop(),yt.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 xt("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 xt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new xt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var E=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xt("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 xt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new bt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new bt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new xt("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 xt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new xt("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 xt("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 xt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},V.instanceCounter=0,V}(),Ct=Q("8hTe"),pr=Q.n(Ct),mr=/<pre[^>]*>/g;function gr(V){var E=document.createElement("div");return E.innerHTML=V,E.childNodes.length===0?"":E.childNodes[0].nodeValue}var vr=be.a=function(V){var E=V.value,I=E===void 0?"":E,H=V.edit,q=H===void 0?!1:H,z=V.className,ye=V.showTextOnly,Ke=V.showLines,tt=V.replaces,pt=V.zoomImg,Ye=V.hasMask,_t=V.style,jt=_t===void 0?{}:_t,$t=V.stylesPrev,ji=$t===void 0?{}:$t,Ei=String(I),xi=Object(D.useRef)(),Qi=Object(D.useRef)(),Ir=Object(D.useState)(""),ci=Object(G.a)(Ir,2),zi=ci[0],lr=ci[1],ur=Object(D.useState)("office"),Hi=Object(G.a)(ur,2),Dr=Hi[0],yr=Hi[1],Kr=function(){var Ht=new Ze(Qi.current);Ht.displayMode="popup",Ht.addRenderEventListener(function(){var yi=Object(U.a)(i.a.mark(function kt(ai){var Kt;return i.a.wrap(function(fi){for(;;)switch(fi.prev=fi.next){case 0:return xi.current.style.display="none",fi.next=3,Object(ke.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ai}});case 3:Kt=fi.sent,Kt!=null&&Kt.id&&tt(Qi.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 5:case"end":return fi.stop()}},kt)}));return function(kt){return yi.apply(this,arguments)}}()),Ht.show()},zr=function(){var Ht=new Lt(Qi.current);Ht.settings.displayMode="popup",Ht.addEventListener("render",function(){var yi=Object(U.a)(i.a.mark(function kt(ai){var Kt;return i.a.wrap(function(fi){for(;;)switch(fi.prev=fi.next){case 0:if(xi.current.style.display="none",!Qi.current){fi.next=6;break}return fi.next=4,Object(ke.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ai.dataUrl}});case 4:Kt=fi.sent,Kt!=null&&Kt.id&&tt(Qi.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 6:case"end":return fi.stop()}},kt)}));return function(kt){return yi.apply(this,arguments)}}()),Ht.show(),window.markerArea=Ht},Zi=Object(D.useMemo)(function(){xi.current&&(xi.current.style.zIndex=-1);try{var ri=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ht=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ei=Ei.replace(ri,"("+ee.a.API_SERVER+"/api/attachments/").replace(Ht,'"'+ee.a.API_SERVER+"/api/attachments/").replace(yi,'"'+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(rr){}var kt=j(Ei),ai=T();if(Ei.match(/\[TOC\]/)&&(kt=kt.replace("<p>[TOC]</p>",L()),A()),kt=kt.replace(/(__special_katext_id_\d+__)/g,function(rr,fi){var Ai=ai[fi],Vr=Ai.type,Er=Ai.expression;return Object(le.renderToString)(gr(Er)||"",{displayMode:Vr==="block",throwOnError:!1,output:"html"})}),kt=kt.replace(/▁/g,"\u2581\u2581\u2581"),y(),ye){var Kt=document.createElement("div");return Kt.innerHTML=kt,Kt.innerText}return setTimeout(function(){return dn()},500),kt},[Ei]),$i=Object(D.useRef)();_.WebkitLineClamp=Ke,Ke&&(jt=Object(F.a)(Object(F.a)({},jt),_));function br(ri){var Ht=ri.target;if(Ht.tagName.toUpperCase()==="IMG"){if(pt){var yi=Ht.getAttribute("src");lr(yi),yr("image")}}else if(Ht.tagName.toUpperCase()==="A"){var kt=Ht.getAttribute("href");if(kt.indexOf("office")>-1)ri.preventDefault(),lr(kt),yr("office");else if(kt.indexOf("application/pdf")>-1)ri.preventDefault(),lr(kt),yr("pdf");else if(kt.indexOf("text/html")>-1)ri.preventDefault(),lr(kt),yr("html");else if(kt.startsWith("#")){ri.preventDefault();var ai=document.getElementById(kt.replace("#",""));ai&&ai.scrollIntoView(!0)}}}var dn=function(){var Ht,yi=(Ht=$i.current)===null||Ht===void 0?void 0:Ht.querySelectorAll("video");yi==null||yi.forEach(function(kt){if(kt.oncontextmenu=function(){return!1},kt.src.indexOf(".m3u8")>-1&&!kt.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var ai=new Y.a;ai.loadSource(kt.src),ai.attachMedia(kt)}}})};Object(D.useEffect)(function(){if($i.current&&Zi&&(Zi.match(mr)&&window.PR.prettyPrint()),$i.current)return $i.current.addEventListener("click",br),function(){$i.current.removeEventListener("click",br),y(),A()}},[Zi,$i.current,br]);var _r=function(Ht){if(!q)return;Ht.target.nodeName==="IMG"?(xi.current.style.zIndex=1,xi.current.style.display="flex",xi.current.style.width=Ht.target.clientWidth+"px",xi.current.style.height=Ht.target.clientHeight+"px",xi.current.style.top=Ht.target.offsetTop+"px",xi.current.style.left=Ht.target.offsetLeft+"px",Qi.current.src=Ht.target.getAttribute("src")):xi.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:$i,style:Object(F.a)({},jt),className:"".concat(z||""," markdown-body ").concat(pr.a.mdBody),onMouseOver:_r,dangerouslySetInnerHTML:{__html:Zi}}),g.a.createElement("div",{ref:xi,className:pr.a.button},g.a.createElement($.a,null,g.a.createElement(X.a,{onClick:function(){return Kr()}},"\u88C1\u526A"),g.a.createElement(X.a,{onClick:function(){return zr()}},"\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(ue.a,{close:!0,data:zi,type:zi!=null&&zi.length?Dr:"",style:Object(F.a)({},ji),onClose:function(){return lr("")}}))}},"9VGf":function(st,be,Q){"use strict";Q.d(be,"a",function(){return M});var ie=Q("q1tI"),$=Q.n(ie);function M(X,F){var U=Object(ie.useRef)();Object(ie.useEffect)(function(){U.current=X}),Object(ie.useEffect)(function(){function G(){U.current()}if(F!==null){var W=setInterval(G,F);return function(){return clearInterval(W)}}},[F])}},BU3w:function(st,be,Q){"use strict";Q.d(be,"a",function(){return U});var ie=Q("MNnm"),$="rc-util-key";function M(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(ie.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 m=M(i),p=m.firstChild;return i.prepend&&m.prepend?m.prepend(D):i.prepend&&p?m.insertBefore(D,p):m.appendChild(D),D}var F=new Map;function U(G,W){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=M(i);if(!F.has(D)){var g=X("",i),m=g.parentNode;F.set(D,m),m.removeChild(g)}var p=Array.from(F.get(D).children).find(function(h){return h.tagName==="STYLE"&&h[$]===W});if(p){var l,u;if(((l=i.csp)===null||l===void 0?void 0:l.nonce)&&p.nonce!==((u=i.csp)===null||u===void 0?void 0:u.nonce)){var f;p.nonce=(f=i.csp)===null||f===void 0?void 0:f.nonce}return p.innerHTML!==G&&(p.innerHTML=G),p}var o=X(G,i);return o[$]=W,o}},Bd2K:function(st,be,Q){(function(ie){ie(Q("VrN/"),Q("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(i,D,g){if(g!=ie.Init&&g&&i.removeKeyMap("autoCloseTags"),!D)return;var m={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(m["'/'"]=function(p){return U(p)}),(typeof D!="object"||D.whenOpening!==!1)&&(m["'>'"]=function(p){return X(p)}),i.addKeyMap(m)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],M=["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 ie.Pass;for(var D=i.listSelections(),g=[],m=i.getOption("autoCloseTags"),p=0;p<D.length;p++){if(!D[p].empty())return ie.Pass;var l=D[p].head,u=i.getTokenAt(l),f=ie.innerMode(i.getMode(),u.state),o=f.state,h=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(o),s=h&&h.name;if(!s)return ie.Pass;var a=f.mode.configuration=="html",A=typeof m=="object"&&m.dontCloseTags||a&&$,_=typeof m=="object"&&m.indentTags||a&&M;u.end>l.ch&&(s=s.slice(0,s.length-u.end+l.ch));var S=s.toLowerCase();if(!s||u.type=="string"&&(u.end!=l.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||u.string.length==1)||u.type=="tag"&&h.close||u.string.indexOf("/")==l.ch-u.start-1||A&&G(A,S)>-1||W(i,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(o)||[],s,l,!0))return ie.Pass;var L=typeof m=="object"&&m.emptyTags;if(L&&G(L,s)>-1){g[p]={text:"/>",newPos:ie.Pos(l.line,l.ch+2)};continue}var R=_&&G(_,S)>-1;g[p]={indent:R,text:">"+(R?`
|
|
|
|
`:"")+"</"+s+">",newPos:R?ie.Pos(l.line+1,0):ie.Pos(l.line,l.ch+1)}}for(var C=typeof m=="object"&&m.dontIndentOnAutoClose,p=D.length-1;p>=0;p--){var w=g[p];i.replaceRange(w.text,D[p].head,D[p].anchor,"+insert");var x=i.listSelections().slice(0);x[p]={head:w.newPos,anchor:w.newPos},i.setSelections(x),!C&&w.indent&&(i.indentLine(w.newPos.line,null,!0),i.indentLine(w.newPos.line+1,null,!0))}}function F(i,D){for(var g=i.listSelections(),m=[],p=D?"/":"</",l=i.getOption("autoCloseTags"),u=typeof l=="object"&&l.dontIndentOnSlash,f=0;f<g.length;f++){if(!g[f].empty())return ie.Pass;var o=g[f].head,h=i.getTokenAt(o),s=ie.innerMode(i.getMode(),h.state),a=s.state;if(D&&(h.type=="string"||h.string.charAt(0)!="<"||h.start!=o.ch-1))return ie.Pass;var A,_=s.mode.name!="xml"&&i.getMode().name=="htmlmixed";if(_&&s.mode.name=="javascript")A=p+"script";else if(_&&s.mode.name=="css")A=p+"style";else{var S=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(a);if(!S||S.length&&W(i,S,S[S.length-1],o))return ie.Pass;A=p+S[S.length-1]}i.getLine(o.line).charAt(h.end)!=">"&&(A+=">"),m[f]=A}if(i.replaceSelections(m),g=i.listSelections(),!u)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")?ie.Pass:F(i,!0)}ie.commands.closeTag=function(i){return F(i)};function G(i,D){if(i.indexOf)return i.indexOf(D);for(var g=0,m=i.length;g<m;++g)if(i[g]==D)return g;return-1}function W(i,D,g,m,p){if(!ie.scanForClosingTag)return!1;var l=Math.min(i.lastLine()+1,m.line+500),u=ie.scanForClosingTag(i,m,null,l);if(!u||u.tag!=g)return!1;for(var f=p?1:0,o=D.length-1;o>=0&&D[o]==g;o--)++f;m=u.to;for(var o=1;o<f;o++){var h=ie.scanForClosingTag(i,m,null,l);if(!h||h.tag!=g)return!1;m=h.to}return!0}})},BjJ7:function(st,be,Q){"use strict";Q.d(be,"d",function(){return $}),Q.d(be,"c",function(){return M}),Q.d(be,"e",function(){return X}),Q.d(be,"b",function(){return F}),Q.d(be,"a",function(){return G});var ie=Q("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 M(W){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],g=0;g<W.length;g++){var m=W[g],p=i?"".concat(i,"/").concat(m.name):"".concat(m.name);D.push({title:m.name,isLeaf:!(m.type==="tree"),key:p})}return D}function X(W,i,D){for(var g=0;g<W.length;g++){var m=W[g];if(m.key===i){m.children=D;break}m.children&&X(m.children,i,D)}return W}function F(W,i,D){var g;return function(){var m=this,p=arguments,l=function(){g=null,D||W.apply(m,p)},u=D&&!g;clearTimeout(g),g=setTimeout(l,i),u&&W.apply(m,p)}}var U=!0,G=ie.a.API_SERVER},"C+DQ":function(st,be,Q){},"C/vA":function(st,be,Q){"use strict";Q.d(be,"a",function(){return ie});function ie($){const M=this;let X=!1,F;return function(){return X||(X=!0,F=$.apply(M,arguments)),F}}},"Cg/j":function(st,be,Q){"use strict";Q.d(be,"b",function(){return ie}),Q.d(be,"a",function(){return $}),Q.d(be,"c",function(){return X}),Q.d(be,"d",function(){return F});var ie;(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})(ie||(ie={}));const $=X("instantiationService");function M(U,G,W,i){G[ie.DI_TARGET]===G?G[ie.DI_DEPENDENCIES].push({id:U,index:W,optional:i}):(G[ie.DI_DEPENDENCIES]=[{id:U,index:W,optional:i}],G[ie.DI_TARGET]=G)}function X(U){if(ie.serviceIds.has(U))return ie.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");M(G,W,D,!1)};return G.toString=()=>U,ie.serviceIds.set(U,G),G}function F(U){return function(G,W,i){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");M(U,G,i,!0)}}},DlQD:function(st,be,Q){(function(ie,$){st.exports=$()})(this,function(){"use strict";function ie(Te,ve){for(var _e=0;_e<ve.length;_e++){var re=ve[_e];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(Te,re.key,re)}}function $(Te,ve,_e){return ve&&ie(Te.prototype,ve),_e&&ie(Te,_e),Te}function M(Te,ve){if(!Te)return;if(typeof Te=="string")return X(Te,ve);var _e=Object.prototype.toString.call(Te).slice(8,-1);if(_e==="Object"&&Te.constructor&&(_e=Te.constructor.name),_e==="Map"||_e==="Set")return Array.from(Te);if(_e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_e))return X(Te,ve)}function X(Te,ve){(ve==null||ve>Te.length)&&(ve=Te.length);for(var _e=0,re=new Array(ve);_e<ve;_e++)re[_e]=Te[_e];return re}function F(Te,ve){var _e;if(typeof Symbol=="undefined"||Te[Symbol.iterator]==null){if(Array.isArray(Te)||(_e=M(Te))||ve&&Te&&typeof Te.length=="number"){_e&&(Te=_e);var re=0;return function(){return re>=Te.length?{done:!0}:{done:!1,value:Te[re++]}}}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 _e=Te[Symbol.iterator](),_e.next.bind(_e)}function U(Te,ve){return ve={exports:{}},Te(ve,ve.exports),ve.exports}var G=U(function(Te){function ve(){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 _e(re){Te.exports.defaults=re}Te.exports={defaults:ve(),getDefaults:ve,changeDefaults:_e}}),W=G.defaults,i=G.getDefaults,D=G.changeDefaults,g=/[&<>"']/,m=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,u={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(ve){return u[ve]};function o(Te,ve){if(ve){if(g.test(Te))return Te.replace(m,f)}else if(p.test(Te))return Te.replace(l,f);return Te}var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(Te){return Te.replace(h,function(ve,_e){return _e=_e.toLowerCase(),_e==="colon"?":":_e.charAt(0)==="#"?_e.charAt(1)==="x"?String.fromCharCode(parseInt(_e.substring(2),16)):String.fromCharCode(+_e.substring(1)):""})}var a=/(^|[^\[])\^/g;function A(Te,ve){Te=Te.source||Te,ve=ve||"";var _e={replace:function(ne,he){return he=he.source||he,he=he.replace(a,"$1"),Te=Te.replace(ne,he),_e},getRegex:function(){return new RegExp(Te,ve)}};return _e}var _=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(Te,ve,_e){if(Te){var re;try{re=decodeURIComponent(s(_e)).replace(_,"").toLowerCase()}catch(ne){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}ve&&!S.test(_e)&&(_e=c(ve,_e));try{_e=encodeURI(_e).replace(/%25/g,"%")}catch(ne){return null}return _e}var R={},C=/^[^:]+:\/*[^/]*$/,w=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(Te,ve){R[" "+Te]||(C.test(Te)?R[" "+Te]=Te+"/":R[" "+Te]=N(Te,"/",!0)),Te=R[" "+Te];var _e=Te.indexOf(":")===-1;return ve.substring(0,2)==="//"?_e?ve:Te.replace(w,"$1")+ve:ve.charAt(0)==="/"?_e?ve:Te.replace(x,"$1")+ve:Te+ve}var T={exec:function(){}};function y(Te){for(var ve=1,_e,re;ve<arguments.length;ve++){_e=arguments[ve];for(re in _e)Object.prototype.hasOwnProperty.call(_e,re)&&(Te[re]=_e[re])}return Te}function v(Te,ve){var _e=Te.replace(/\|/g,function(he,fe,Ee){for(var Me=!1,ze=fe;--ze>=0&&Ee[ze]==="\\";)Me=!Me;return Me?"|":" |"}),re=_e.split(/ \|/),ne=0;if(re.length>ve)re.splice(ve);else for(;re.length<ve;)re.push("");for(;ne<re.length;ne++)re[ne]=re[ne].trim().replace(/\\\|/g,"|");return re}function N(Te,ve,_e){var re=Te.length;if(re===0)return"";for(var ne=0;ne<re;){var he=Te.charAt(re-ne-1);if(he===ve&&!_e)ne++;else if(he!==ve&&_e)ne++;else break}return Te.substr(0,re-ne)}function B(Te,ve){if(Te.indexOf(ve[1])===-1)return-1;for(var _e=Te.length,re=0,ne=0;ne<_e;ne++)if(Te[ne]==="\\")ne++;else if(Te[ne]===ve[0])re++;else if(Te[ne]===ve[1]&&(re--,re<0))return ne;return-1}function O(Te){Te&&Te.sanitize&&!Te.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:o,unescape:s,edit:A,cleanUrl:L,resolveUrl:c,noopTest:T,merge:y,splitCells:v,rtrim:N,findClosingBracket:B,checkSanitizeDeprecation:O},P=G.defaults,b=j.rtrim,Y=j.splitCells,ee=j.escape,le=j.findClosingBracket;function ue(Te,ve,_e){var re=ve.href,ne=ve.title?ee(ve.title):null,he=Te[1].replace(/\\([\[\]])/g,"$1");return Te[0].charAt(0)!=="!"?{type:"link",raw:_e,href:re,title:ne,text:he}:{type:"image",raw:_e,href:re,title:ne,text:ee(he)}}function ke(Te,ve){var _e=Te.match(/^(\s+)(?:```)/);if(_e===null)return ve;var re=_e[1];return ve.split(`
|
|
`).map(function(ne){var he=ne.match(/^\s+/);if(he===null)return ne;var fe=he[0];return fe.length>=re.length?ne.slice(re.length):ne}).join(`
|
|
`)}var we=function(){function Te(_e){this.options=_e||P}var ve=Te.prototype;return ve.space=function(re){var ne=this.rules.block.newline.exec(re);if(ne)return ne[0].length>1?{type:"space",raw:ne[0]}:{raw:`
|
|
`}},ve.code=function(re,ne){var he=this.rules.block.code.exec(re);if(he){var fe=ne[ne.length-1];if(fe&&fe.type==="paragraph")return{raw:he[0],text:he[0].trimRight()};var Ee=he[0].replace(/^ {4}/gm,"");return{type:"code",raw:he[0],codeBlockStyle:"indented",text:this.options.pedantic?Ee:b(Ee,`
|
|
`)}}},ve.fences=function(re){var ne=this.rules.block.fences.exec(re);if(ne){var he=ne[0],fe=ke(he,ne[3]||"");return{type:"code",raw:he,lang:ne[2]?ne[2].trim():ne[2],text:fe}}},ve.heading=function(re){var ne=this.rules.block.heading.exec(re);if(ne)return{type:"heading",raw:ne[0],depth:ne[1].length,text:ne[2]}},ve.nptable=function(re){var ne=this.rules.block.nptable.exec(re);if(ne){var he={type:"table",header:Y(ne[1].replace(/^ *| *\| *$/g,"")),align:ne[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ne[3]?ne[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ne[0]};if(he.header.length===he.align.length){var fe=he.align.length,Ee;for(Ee=0;Ee<fe;Ee++)/^ *-+: *$/.test(he.align[Ee])?he.align[Ee]="right":/^ *:-+: *$/.test(he.align[Ee])?he.align[Ee]="center":/^ *:-+ *$/.test(he.align[Ee])?he.align[Ee]="left":he.align[Ee]=null;for(fe=he.cells.length,Ee=0;Ee<fe;Ee++)he.cells[Ee]=Y(he.cells[Ee],he.header.length);return he}}},ve.hr=function(re){var ne=this.rules.block.hr.exec(re);if(ne)return{type:"hr",raw:ne[0]}},ve.blockquote=function(re){var ne=this.rules.block.blockquote.exec(re);if(ne){var he=ne[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ne[0],text:he}}},ve.list=function(re){var ne=this.rules.block.list.exec(re);if(ne){for(var he=ne[0],fe=ne[2],Ee=fe.length>1,Me=fe[fe.length-1]===")",ze={type:"list",raw:he,ordered:Ee,start:Ee?+fe.slice(0,-1):"",loose:!1,items:[]},ot=ne[0].match(this.rules.block.item),mt=!1,ft,wt,St,dt,Ut,Lt,qt,Qt=ot.length,It=0;It<Qt;It++)ft=ot[It],he=ft,wt=ft.length,ft=ft.replace(/^ *([*+-]|\d+[.)]) */,""),~ft.indexOf(`
|
|
`)&&(wt-=ft.length,ft=this.options.pedantic?ft.replace(/^ {1,4}/gm,""):ft.replace(new RegExp("^ {1,"+wt+"}","gm"),"")),It!==Qt-1&&(St=this.rules.block.bullet.exec(ot[It+1])[0],(Ee?St.length===1||!Me&&St[St.length-1]===")":St.length>1||this.options.smartLists&&St!==fe)&&(dt=ot.slice(It+1).join(`
|
|
`),ze.raw=ze.raw.substring(0,ze.raw.length-dt.length),It=Qt-1)),Ut=mt||/\n\n(?!\s*$)/.test(ft),It!==Qt-1&&(mt=ft.charAt(ft.length-1)===`
|
|
`,Ut||(Ut=mt)),Ut&&(ze.loose=!0),Lt=/^\[[ xX]\] /.test(ft),qt=void 0,Lt&&(qt=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),ze.items.push({type:"list_item",raw:he,task:Lt,checked:qt,loose:Ut,text:ft});return ze}},ve.html=function(re){var ne=this.rules.block.html.exec(re);if(ne)return{type:this.options.sanitize?"paragraph":"html",raw:ne[0],pre:!this.options.sanitizer&&(ne[1]==="pre"||ne[1]==="script"||ne[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ne[0]):ee(ne[0]):ne[0]}},ve.def=function(re){var ne=this.rules.block.def.exec(re);if(ne){ne[3]&&(ne[3]=ne[3].substring(1,ne[3].length-1));var he=ne[1].toLowerCase().replace(/\s+/g," ");return{tag:he,raw:ne[0],href:ne[2],title:ne[3]}}},ve.table=function(re){var ne=this.rules.block.table.exec(re);if(ne){var he={type:"table",header:Y(ne[1].replace(/^ *| *\| *$/g,"")),align:ne[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ne[3]?ne[3].replace(/\n$/,"").split(`
|
|
`):[]};if(he.header.length===he.align.length){he.raw=ne[0];var fe=he.align.length,Ee;for(Ee=0;Ee<fe;Ee++)/^ *-+: *$/.test(he.align[Ee])?he.align[Ee]="right":/^ *:-+: *$/.test(he.align[Ee])?he.align[Ee]="center":/^ *:-+ *$/.test(he.align[Ee])?he.align[Ee]="left":he.align[Ee]=null;for(fe=he.cells.length,Ee=0;Ee<fe;Ee++)he.cells[Ee]=Y(he.cells[Ee].replace(/^ *\| *| *\| *$/g,""),he.header.length);return he}}},ve.lheading=function(re){var ne=this.rules.block.lheading.exec(re);if(ne)return{type:"heading",raw:ne[0],depth:ne[2].charAt(0)==="="?1:2,text:ne[1]}},ve.paragraph=function(re){var ne=this.rules.block.paragraph.exec(re);if(ne)return{type:"paragraph",raw:ne[0],text:ne[1].charAt(ne[1].length-1)===`
|
|
`?ne[1].slice(0,-1):ne[1]}},ve.text=function(re,ne){var he=this.rules.block.text.exec(re);if(he){var fe=ne[ne.length-1];return fe&&fe.type==="text"?{raw:he[0],text:he[0]}:{type:"text",raw:he[0],text:he[0]}}},ve.escape=function(re){var ne=this.rules.inline.escape.exec(re);if(ne)return{type:"escape",raw:ne[0],text:ee(ne[1])}},ve.tag=function(re,ne,he){var fe=this.rules.inline.tag.exec(re);if(fe)return!ne&&/^<a /i.test(fe[0])?ne=!0:ne&&/^<\/a>/i.test(fe[0])&&(ne=!1),!he&&/^<(pre|code|kbd|script)(\s|>)/i.test(fe[0])?he=!0:he&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(fe[0])&&(he=!1),{type:this.options.sanitize?"text":"html",raw:fe[0],inLink:ne,inRawBlock:he,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(fe[0]):ee(fe[0]):fe[0]}},ve.link=function(re){var ne=this.rules.inline.link.exec(re);if(ne){var he=le(ne[2],"()");if(he>-1){var fe=ne[0].indexOf("!")===0?5:4,Ee=fe+ne[1].length+he;ne[2]=ne[2].substring(0,he),ne[0]=ne[0].substring(0,Ee).trim(),ne[3]=""}var Me=ne[2],ze="";if(this.options.pedantic){var ot=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Me);ot?(Me=ot[1],ze=ot[3]):ze=""}else ze=ne[3]?ne[3].slice(1,-1):"";Me=Me.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=ue(ne,{href:Me&&Me.replace(this.rules.inline._escapes,"$1"),title:ze&&ze.replace(this.rules.inline._escapes,"$1")},ne[0]);return mt}},ve.reflink=function(re,ne){var he;if((he=this.rules.inline.reflink.exec(re))||(he=this.rules.inline.nolink.exec(re))){var fe=(he[2]||he[1]).replace(/\s+/g," ");if(fe=ne[fe.toLowerCase()],!fe||!fe.href){var Ee=he[0].charAt(0);return{type:"text",raw:Ee,text:Ee}}var Me=ue(he,fe,he[0]);return Me}},ve.strong=function(re,ne,he){he===void 0&&(he="");var fe=this.rules.inline.strong.start.exec(re);if(fe&&(!fe[1]||fe[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){ne=ne.slice(-1*re.length);var Ee=fe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ee.lastIndex=0;for(var Me;(fe=Ee.exec(ne))!=null;)if(Me=this.rules.inline.strong.middle.exec(ne.slice(0,fe.index+3)),Me)return{type:"strong",raw:re.slice(0,Me[0].length),text:re.slice(2,Me[0].length-2)}}},ve.em=function(re,ne,he){he===void 0&&(he="");var fe=this.rules.inline.em.start.exec(re);if(fe&&(!fe[1]||fe[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){ne=ne.slice(-1*re.length);var Ee=fe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ee.lastIndex=0;for(var Me;(fe=Ee.exec(ne))!=null;)if(Me=this.rules.inline.em.middle.exec(ne.slice(0,fe.index+2)),Me)return{type:"em",raw:re.slice(0,Me[0].length),text:re.slice(1,Me[0].length-1)}}},ve.codespan=function(re){var ne=this.rules.inline.code.exec(re);if(ne){var he=ne[2].replace(/\n/g," "),fe=/[^ ]/.test(he),Ee=he.startsWith(" ")&&he.endsWith(" ");return fe&&Ee&&(he=he.substring(1,he.length-1)),he=ee(he,!0),{type:"codespan",raw:ne[0],text:he}}},ve.br=function(re){var ne=this.rules.inline.br.exec(re);if(ne)return{type:"br",raw:ne[0]}},ve.del=function(re){var ne=this.rules.inline.del.exec(re);if(ne)return{type:"del",raw:ne[0],text:ne[1]}},ve.autolink=function(re,ne){var he=this.rules.inline.autolink.exec(re);if(he){var fe,Ee;return he[2]==="@"?(fe=ee(this.options.mangle?ne(he[1]):he[1]),Ee="mailto:"+fe):(fe=ee(he[1]),Ee=fe),{type:"link",raw:he[0],text:fe,href:Ee,tokens:[{type:"text",raw:fe,text:fe}]}}},ve.url=function(re,ne){var he;if(he=this.rules.inline.url.exec(re)){var fe,Ee;if(he[2]==="@")fe=ee(this.options.mangle?ne(he[0]):he[0]),Ee="mailto:"+fe;else{var Me;do Me=he[0],he[0]=this.rules.inline._backpedal.exec(he[0])[0];while(Me!==he[0]);fe=ee(he[0]),he[1]==="www."?Ee="http://"+fe:Ee=fe}return{type:"link",raw:he[0],text:fe,href:Ee,tokens:[{type:"text",raw:fe,text:fe}]}}},ve.inlineText=function(re,ne,he){var fe=this.rules.inline.text.exec(re);if(fe){var Ee;return ne?Ee=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(fe[0]):ee(fe[0]):fe[0]:Ee=ee(this.options.smartypants?he(fe[0]):fe[0]),{type:"text",raw:fe[0],text:Ee}}},Te}(),Ae=j.noopTest,ce=j.edit,pe=j.merge,se={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:Ae,table:Ae,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,se.def=ce(se.def).replace("label",se._label).replace("title",se._title).getRegex(),se.bullet=/(?:[*+-]|\d{1,9}[.)])/,se.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,se.item=ce(se.item,"gm").replace(/bull/g,se.bullet).getRegex(),se.list=ce(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex(),se._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",se._comment=/<!--(?!-?>)[\s\S]*?-->/,se.html=ce(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),se.paragraph=ce(se._paragraph).replace("hr",se.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",se._tag).getRegex(),se.blockquote=ce(se.blockquote).replace("paragraph",se.paragraph).getRegex(),se.normal=pe({},se),se.gfm=pe({},se.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*|$)"}),se.gfm.nptable=ce(se.gfm.nptable).replace("hr",se.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",se._tag).getRegex(),se.gfm.table=ce(se.gfm.table).replace("hr",se.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",se._tag).getRegex(),se.pedantic=pe({},se.normal,{html:ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._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:Ae,paragraph:ce(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ae={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ae,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:Ae,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ae._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ae.punctuation=ce(ae.punctuation).replace(/punctuation/g,ae._punctuation).getRegex(),ae._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ae._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ae.em.start=ce(ae.em.start).replace(/punctuation/g,ae._punctuation).getRegex(),ae.em.middle=ce(ae.em.middle).replace(/punctuation/g,ae._punctuation).replace(/overlapSkip/g,ae._overlapSkip).getRegex(),ae.em.endAst=ce(ae.em.endAst,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.em.endUnd=ce(ae.em.endUnd,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.start=ce(ae.strong.start).replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.middle=ce(ae.strong.middle).replace(/punctuation/g,ae._punctuation).replace(/blockSkip/g,ae._blockSkip).getRegex(),ae.strong.endAst=ce(ae.strong.endAst,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.endUnd=ce(ae.strong.endUnd,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.blockSkip=ce(ae._blockSkip,"g").getRegex(),ae.overlapSkip=ce(ae._overlapSkip,"g").getRegex(),ae._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ae._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ae._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])?)+(?![-_])/,ae.autolink=ce(ae.autolink).replace("scheme",ae._scheme).replace("email",ae._email).getRegex(),ae._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ae.tag=ce(ae.tag).replace("comment",se._comment).replace("attribute",ae._attribute).getRegex(),ae._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ae._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ae._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ae.link=ce(ae.link).replace("label",ae._label).replace("href",ae._href).replace("title",ae._title).getRegex(),ae.reflink=ce(ae.reflink).replace("label",ae._label).getRegex(),ae.reflinkSearch=ce(ae.reflinkSearch,"g").replace("reflink",ae.reflink).replace("nolink",ae.nolink).getRegex(),ae.normal=pe({},ae),ae.pedantic=pe({},ae.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:ce(/^!?\[(label)\]\((.*?)\)/).replace("label",ae._label).getRegex(),reflink:ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae._label).getRegex()}),ae.gfm=pe({},ae.normal,{escape:ce(ae.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ae.gfm.url=ce(ae.gfm.url,"i").replace("email",ae.gfm._extended_email).getRegex(),ae.breaks=pe({},ae.gfm,{br:ce(ae.br).replace("{2,}","*").getRegex(),text:ce(ae.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Oe={block:se,inline:ae},xe=G.defaults,Pe=Oe.block,De=Oe.inline;function Ge(Te){return Te.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Le(Te){var ve="",_e,re,ne=Te.length;for(_e=0;_e<ne;_e++)re=Te.charCodeAt(_e),Math.random()>.5&&(re="x"+re.toString(16)),ve+="&#"+re+";";return ve}var Fe=function(){function Te(_e){this.tokens=[],this.tokens.links=Object.create(null),this.options=_e||xe,this.options.tokenizer=this.options.tokenizer||new we,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:Pe.normal,inline:De.normal};this.options.pedantic?(re.block=Pe.pedantic,re.inline=De.pedantic):this.options.gfm&&(re.block=Pe.gfm,this.options.breaks?re.inline=De.breaks:re.inline=De.gfm),this.tokenizer.rules=re}Te.lex=function(re,ne){var he=new Te(ne);return he.lex(re)};var ve=Te.prototype;return ve.lex=function(re){return re=re.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(re,this.tokens,!0),this.inline(this.tokens),this.tokens},ve.blockTokens=function(re,ne,he){ne===void 0&&(ne=[]),he===void 0&&(he=!0),re=re.replace(/^ +$/gm,"");for(var fe,Ee,Me,ze;re;){if(fe=this.tokenizer.space(re)){re=re.substring(fe.raw.length),fe.type&&ne.push(fe);continue}if(fe=this.tokenizer.code(re,ne)){re=re.substring(fe.raw.length),fe.type?ne.push(fe):(ze=ne[ne.length-1],ze.raw+=`
|
|
`+fe.raw,ze.text+=`
|
|
`+fe.text);continue}if(fe=this.tokenizer.fences(re)){re=re.substring(fe.raw.length),ne.push(fe);continue}if(fe=this.tokenizer.heading(re)){re=re.substring(fe.raw.length),ne.push(fe);continue}if(fe=this.tokenizer.nptable(re)){re=re.substring(fe.raw.length),ne.push(fe);continue}if(fe=this.tokenizer.hr(re)){re=re.substring(fe.raw.length),ne.push(fe);continue}if(fe=this.tokenizer.blockquote(re)){re=re.substring(fe.raw.length),fe.tokens=this.blockTokens(fe.text,[],he),ne.push(fe);continue}if(fe=this.tokenizer.list(re)){for(re=re.substring(fe.raw.length),Me=fe.items.length,Ee=0;Ee<Me;Ee++)fe.items[Ee].tokens=this.blockTokens(fe.items[Ee].text,[],!1);ne.push(fe);continue}if(fe=this.tokenizer.html(re)){re=re.substring(fe.raw.length),ne.push(fe);continue}if(he&&(fe=this.tokenizer.def(re))){re=re.substring(fe.raw.length),this.tokens.links[fe.tag]||(this.tokens.links[fe.tag]={href:fe.href,title:fe.title});continue}if(fe=this.tokenizer.table(re)){re=re.substring(fe.raw.length),ne.push(fe);continue}if(fe=this.tokenizer.lheading(re)){re=re.substring(fe.raw.length),ne.push(fe);continue}if(he&&(fe=this.tokenizer.paragraph(re))){re=re.substring(fe.raw.length),ne.push(fe);continue}if(fe=this.tokenizer.text(re,ne)){re=re.substring(fe.raw.length),fe.type?ne.push(fe):(ze=ne[ne.length-1],ze.raw+=`
|
|
`+fe.raw,ze.text+=`
|
|
`+fe.text);continue}if(re){var ot="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(ot);break}else throw new Error(ot)}}return ne},ve.inline=function(re){var ne,he,fe,Ee,Me,ze,ot=re.length;for(ne=0;ne<ot;ne++){ze=re[ne];switch(ze.type){case"paragraph":case"text":case"heading":{ze.tokens=[],this.inlineTokens(ze.text,ze.tokens);break}case"table":{for(ze.tokens={header:[],cells:[]},Ee=ze.header.length,he=0;he<Ee;he++)ze.tokens.header[he]=[],this.inlineTokens(ze.header[he],ze.tokens.header[he]);for(Ee=ze.cells.length,he=0;he<Ee;he++)for(Me=ze.cells[he],ze.tokens.cells[he]=[],fe=0;fe<Me.length;fe++)ze.tokens.cells[he][fe]=[],this.inlineTokens(Me[fe],ze.tokens.cells[he][fe]);break}case"blockquote":{this.inline(ze.tokens);break}case"list":{for(Ee=ze.items.length,he=0;he<Ee;he++)this.inline(ze.items[he].tokens);break}}}return re},ve.inlineTokens=function(re,ne,he,fe,Ee){ne===void 0&&(ne=[]),he===void 0&&(he=!1),fe===void 0&&(fe=!1),Ee===void 0&&(Ee="");var Me,ze=re,ot;if(this.tokens.links){var mt=Object.keys(this.tokens.links);if(mt.length>0)for(;(ot=this.tokenizer.rules.inline.reflinkSearch.exec(ze))!=null;)mt.includes(ot[0].slice(ot[0].lastIndexOf("[")+1,-1))&&(ze=ze.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ot=this.tokenizer.rules.inline.blockSkip.exec(ze))!=null;)ze=ze.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Me=this.tokenizer.escape(re)){re=re.substring(Me.raw.length),ne.push(Me);continue}if(Me=this.tokenizer.tag(re,he,fe)){re=re.substring(Me.raw.length),he=Me.inLink,fe=Me.inRawBlock,ne.push(Me);continue}if(Me=this.tokenizer.link(re)){re=re.substring(Me.raw.length),Me.type==="link"&&(Me.tokens=this.inlineTokens(Me.text,[],!0,fe)),ne.push(Me);continue}if(Me=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Me.raw.length),Me.type==="link"&&(Me.tokens=this.inlineTokens(Me.text,[],!0,fe)),ne.push(Me);continue}if(Me=this.tokenizer.strong(re,ze,Ee)){re=re.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],he,fe),ne.push(Me);continue}if(Me=this.tokenizer.em(re,ze,Ee)){re=re.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],he,fe),ne.push(Me);continue}if(Me=this.tokenizer.codespan(re)){re=re.substring(Me.raw.length),ne.push(Me);continue}if(Me=this.tokenizer.br(re)){re=re.substring(Me.raw.length),ne.push(Me);continue}if(Me=this.tokenizer.del(re)){re=re.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],he,fe),ne.push(Me);continue}if(Me=this.tokenizer.autolink(re,Le)){re=re.substring(Me.raw.length),ne.push(Me);continue}if(!he&&(Me=this.tokenizer.url(re,Le))){re=re.substring(Me.raw.length),ne.push(Me);continue}if(Me=this.tokenizer.inlineText(re,fe,Ge)){re=re.substring(Me.raw.length),Ee=Me.raw.slice(-1),ne.push(Me);continue}if(re){var ft="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return ne},$(Te,null,[{key:"rules",get:function(){return{block:Pe,inline:De}}}]),Te}(),We=G.defaults,oe=j.cleanUrl,ge=j.escape,Se=function(){function Te(_e){this.options=_e||We}var ve=Te.prototype;return ve.code=function(re,ne,he){var fe=(ne||"").match(/\S*/)[0];if(this.options.highlight){var Ee=this.options.highlight(re,fe);Ee!=null&&Ee!==re&&(he=!0,re=Ee)}return fe?'<pre><code class="'+this.options.langPrefix+ge(fe,!0)+'">'+(he?re:ge(re,!0))+`</code></pre>
|
|
`:"<pre><code>"+(he?re:ge(re,!0))+`</code></pre>
|
|
`},ve.blockquote=function(re){return`<blockquote>
|
|
`+re+`</blockquote>
|
|
`},ve.html=function(re){return re},ve.heading=function(re,ne,he,fe){return this.options.headerIds?"<h"+ne+' id="'+this.options.headerPrefix+fe.slug(he)+'">'+re+"</h"+ne+`>
|
|
`:"<h"+ne+">"+re+"</h"+ne+`>
|
|
`},ve.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ve.list=function(re,ne,he){var fe=ne?"ol":"ul",Ee=ne&&he!==1?' start="'+he+'"':"";return"<"+fe+Ee+`>
|
|
`+re+"</"+fe+`>
|
|
`},ve.listitem=function(re){return"<li>"+re+`</li>
|
|
`},ve.checkbox=function(re){return"<input "+(re?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ve.paragraph=function(re){return"<p>"+re+`</p>
|
|
`},ve.table=function(re,ne){return ne&&(ne="<tbody>"+ne+"</tbody>"),`<table>
|
|
<thead>
|
|
`+re+`</thead>
|
|
`+ne+`</table>
|
|
`},ve.tablerow=function(re){return`<tr>
|
|
`+re+`</tr>
|
|
`},ve.tablecell=function(re,ne){var he=ne.header?"th":"td",fe=ne.align?"<"+he+' align="'+ne.align+'">':"<"+he+">";return fe+re+"</"+he+`>
|
|
`},ve.strong=function(re){return"<strong>"+re+"</strong>"},ve.em=function(re){return"<em>"+re+"</em>"},ve.codespan=function(re){return"<code>"+re+"</code>"},ve.br=function(){return this.options.xhtml?"<br/>":"<br>"},ve.del=function(re){return"<del>"+re+"</del>"},ve.link=function(re,ne,he){if(re=oe(this.options.sanitize,this.options.baseUrl,re),re===null)return he;var fe='<a href="'+ge(re)+'"';return ne&&(fe+=' title="'+ne+'"'),fe+=">"+he+"</a>",fe},ve.image=function(re,ne,he){if(re=oe(this.options.sanitize,this.options.baseUrl,re),re===null)return he;var fe='<img src="'+re+'" alt="'+he+'"';return ne&&(fe+=' title="'+ne+'"'),fe+=this.options.xhtml?"/>":">",fe},ve.text=function(re){return re},Te}(),Ce=function(){function Te(){}var ve=Te.prototype;return ve.strong=function(re){return re},ve.em=function(re){return re},ve.codespan=function(re){return re},ve.del=function(re){return re},ve.html=function(re){return re},ve.text=function(re){return re},ve.link=function(re,ne,he){return""+he},ve.image=function(re,ne,he){return""+he},ve.br=function(){return""},Te}(),je=function(){function Te(){this.seen={}}var ve=Te.prototype;return ve.slug=function(re){var ne=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ne)){var he=ne;do this.seen[he]++,ne=he+"-"+this.seen[he];while(this.seen.hasOwnProperty(ne))}return this.seen[ne]=0,ne},Te}(),Ve=G.defaults,Qe=j.unescape,Je=function(){function Te(_e){this.options=_e||Ve,this.options.renderer=this.options.renderer||new Se,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ce,this.slugger=new je}Te.parse=function(re,ne){var he=new Te(ne);return he.parse(re)};var ve=Te.prototype;return ve.parse=function(re,ne){ne===void 0&&(ne=!0);var he="",fe,Ee,Me,ze,ot,mt,ft,wt,St,dt,Ut,Lt,qt,Qt,It,Ci,Ki,yt,Li=re.length;for(fe=0;fe<Li;fe++){dt=re[fe];switch(dt.type){case"space":continue;case"hr":{he+=this.renderer.hr();continue}case"heading":{he+=this.renderer.heading(this.parseInline(dt.tokens),dt.depth,Qe(this.parseInline(dt.tokens,this.textRenderer)),this.slugger);continue}case"code":{he+=this.renderer.code(dt.text,dt.lang,dt.escaped);continue}case"table":{for(wt="",ft="",ze=dt.header.length,Ee=0;Ee<ze;Ee++)ft+=this.renderer.tablecell(this.parseInline(dt.tokens.header[Ee]),{header:!0,align:dt.align[Ee]});for(wt+=this.renderer.tablerow(ft),St="",ze=dt.cells.length,Ee=0;Ee<ze;Ee++){for(mt=dt.tokens.cells[Ee],ft="",ot=mt.length,Me=0;Me<ot;Me++)ft+=this.renderer.tablecell(this.parseInline(mt[Me]),{header:!1,align:dt.align[Me]});St+=this.renderer.tablerow(ft)}he+=this.renderer.table(wt,St);continue}case"blockquote":{St=this.parse(dt.tokens),he+=this.renderer.blockquote(St);continue}case"list":{for(Ut=dt.ordered,Lt=dt.start,qt=dt.loose,ze=dt.items.length,St="",Ee=0;Ee<ze;Ee++)It=dt.items[Ee],Ci=It.checked,Ki=It.task,Qt="",It.task&&(yt=this.renderer.checkbox(Ci),qt?It.tokens.length>0&&It.tokens[0].type==="text"?(It.tokens[0].text=yt+" "+It.tokens[0].text,It.tokens[0].tokens&&It.tokens[0].tokens.length>0&&It.tokens[0].tokens[0].type==="text"&&(It.tokens[0].tokens[0].text=yt+" "+It.tokens[0].tokens[0].text)):It.tokens.unshift({type:"text",text:yt}):Qt+=yt),Qt+=this.parse(It.tokens,qt),St+=this.renderer.listitem(Qt,Ki,Ci);he+=this.renderer.list(St,Ut,Lt);continue}case"html":{he+=this.renderer.html(dt.text);continue}case"paragraph":{he+=this.renderer.paragraph(this.parseInline(dt.tokens));continue}case"text":{for(St=dt.tokens?this.parseInline(dt.tokens):dt.text;fe+1<Li&&re[fe+1].type==="text";)dt=re[++fe],St+=`
|
|
`+(dt.tokens?this.parseInline(dt.tokens):dt.text);he+=ne?this.renderer.paragraph(St):St;continue}default:{var bt='Token with "'+dt.type+'" type was not found.';if(this.options.silent){console.error(bt);return}else throw new Error(bt)}}}return he},ve.parseInline=function(re,ne){ne=ne||this.renderer;var he="",fe,Ee,Me=re.length;for(fe=0;fe<Me;fe++){Ee=re[fe];switch(Ee.type){case"escape":{he+=ne.text(Ee.text);break}case"html":{he+=ne.html(Ee.text);break}case"link":{he+=ne.link(Ee.href,Ee.title,this.parseInline(Ee.tokens,ne));break}case"image":{he+=ne.image(Ee.href,Ee.title,Ee.text);break}case"strong":{he+=ne.strong(this.parseInline(Ee.tokens,ne));break}case"em":{he+=ne.em(this.parseInline(Ee.tokens,ne));break}case"codespan":{he+=ne.codespan(Ee.text);break}case"br":{he+=ne.br();break}case"del":{he+=ne.del(this.parseInline(Ee.tokens,ne));break}case"text":{he+=ne.text(Ee.text);break}default:{var ze='Token with "'+Ee.type+'" type was not found.';if(this.options.silent){console.error(ze);return}else throw new Error(ze)}}}return he},Te}(),at=j.merge,Xe=j.checkSanitizeDeprecation,qe=j.escape,Ne=G.getDefaults,lt=G.changeDefaults,nt=G.defaults;function Be(Te,ve,_e){if(typeof Te=="undefined"||Te===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Te!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Te)+", string expected");if(typeof ve=="function"&&(_e=ve,ve=null),ve=at({},Be.defaults,ve||{}),Xe(ve),_e){var re=ve.highlight,ne;try{ne=Fe.lex(Te,ve)}catch(Me){return _e(Me)}var he=function(ze){var ot;if(!ze)try{ot=Je.parse(ne,ve)}catch(mt){ze=mt}return ve.highlight=re,ze?_e(ze):_e(null,ot)};if(!re||re.length<3)return he();if(delete ve.highlight,!ne.length)return he();var fe=0;Be.walkTokens(ne,function(Me){Me.type==="code"&&(fe++,setTimeout(function(){re(Me.text,Me.lang,function(ze,ot){if(ze)return he(ze);ot!=null&&ot!==Me.text&&(Me.text=ot,Me.escaped=!0),fe--,fe===0&&he()})},0))}),fe===0&&he();return}try{var Ee=Fe.lex(Te,ve);return ve.walkTokens&&Be.walkTokens(Ee,ve.walkTokens),Je.parse(Ee,ve)}catch(Me){if(Me.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ve.silent)return"<p>An error occurred:</p><pre>"+qe(Me.message+"",!0)+"</pre>";throw Me}}Be.options=Be.setOptions=function(Te){return at(Be.defaults,Te),lt(Be.defaults),Be},Be.getDefaults=Ne,Be.defaults=nt,Be.use=function(Te){var ve=at({},Te);if(Te.renderer&&function(){var re=Be.defaults.renderer||new Se,ne=function(Ee){var Me=re[Ee];re[Ee]=function(){for(var ze=arguments.length,ot=new Array(ze),mt=0;mt<ze;mt++)ot[mt]=arguments[mt];var ft=Te.renderer[Ee].apply(re,ot);return ft===!1&&(ft=Me.apply(re,ot)),ft}};for(var he in Te.renderer)ne(he);ve.renderer=re}(),Te.tokenizer&&function(){var re=Be.defaults.tokenizer||new we,ne=function(Ee){var Me=re[Ee];re[Ee]=function(){for(var ze=arguments.length,ot=new Array(ze),mt=0;mt<ze;mt++)ot[mt]=arguments[mt];var ft=Te.tokenizer[Ee].apply(re,ot);return ft===!1&&(ft=Me.apply(re,ot)),ft}};for(var he in Te.tokenizer)ne(he);ve.tokenizer=re}(),Te.walkTokens){var _e=Be.defaults.walkTokens;ve.walkTokens=function(re){Te.walkTokens(re),_e&&_e(re)}}Be.setOptions(ve)},Be.walkTokens=function(Te,ve){for(var _e=F(Te),re;!(re=_e()).done;){var ne=re.value;ve(ne);switch(ne.type){case"table":{for(var he=F(ne.tokens.header),fe;!(fe=he()).done;){var Ee=fe.value;Be.walkTokens(Ee,ve)}for(var Me=F(ne.tokens.cells),ze;!(ze=Me()).done;)for(var ot=ze.value,mt=F(ot),ft;!(ft=mt()).done;){var wt=ft.value;Be.walkTokens(wt,ve)}break}case"list":{Be.walkTokens(ne.items,ve);break}default:ne.tokens&&Be.walkTokens(ne.tokens,ve)}}},Be.Parser=Je,Be.parser=Je.parse,Be.Renderer=Se,Be.TextRenderer=Ce,Be.Lexer=Fe,Be.lexer=Fe.lex,Be.Tokenizer=we,Be.Slugger=je,Be.parse=Be;var Ue=Be;return Ue})},ELLl:function(st,be,Q){(function(ie){ie(Q("VrN/"))})(function(ie){var $={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},M=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(u,f,o){o&&o!=ie.Init&&(u.removeKeyMap(F),u.state.closeBrackets=null),f&&(U(X(f,"pairs")),u.state.closeBrackets=f,u.addKeyMap(F))});function X(u,f){return f=="pairs"&&typeof u=="string"?u:typeof u=="object"&&u[f]!=null?u[f]:$[f]}var F={Backspace:i,Enter:D};function U(u){for(var f=0;f<u.length;f++){var o=u.charAt(f),h="'"+o+"'";F[h]||(F[h]=G(o))}}U($.pairs+"`");function G(u){return function(f){return m(f,u)}}function W(u){var f=u.state.closeBrackets;if(!f||f.override)return f;var o=u.getModeAt(u.getCursor());return o.closeBrackets||f}function i(u){var f=W(u);if(!f||u.getOption("disableInput"))return ie.Pass;for(var o=X(f,"pairs"),h=u.listSelections(),s=0;s<h.length;s++){if(!h[s].empty())return ie.Pass;var a=p(u,h[s].head);if(!a||o.indexOf(a)%2!=0)return ie.Pass}for(var s=h.length-1;s>=0;s--){var A=h[s].head;u.replaceRange("",M(A.line,A.ch-1),M(A.line,A.ch+1),"+delete")}}function D(u){var f=W(u),o=f&&X(f,"explode");if(!o||u.getOption("disableInput"))return ie.Pass;for(var h=u.listSelections(),s=0;s<h.length;s++){if(!h[s].empty())return ie.Pass;var a=p(u,h[s].head);if(!a||o.indexOf(a)%2!=0)return ie.Pass}u.operation(function(){var A=u.lineSeparator()||`
|
|
`;u.replaceSelection(A+A,null),u.execCommand("goCharLeft"),h=u.listSelections();for(var _=0;_<h.length;_++){var S=h[_].head.line;u.indentLine(S,null,!0),u.indentLine(S+1,null,!0)}})}function g(u){var f=ie.cmpPos(u.anchor,u.head)>0;return{anchor:new M(u.anchor.line,u.anchor.ch+(f?-1:1)),head:new M(u.head.line,u.head.ch+(f?1:-1))}}function m(u,f){var o=W(u);if(!o||u.getOption("disableInput"))return ie.Pass;var h=X(o,"pairs"),s=h.indexOf(f);if(s==-1)return ie.Pass;for(var a=X(o,"closeBefore"),A=X(o,"triples"),_=h.charAt(s+1)==f,S=u.listSelections(),L=s%2==0,R,C=0;C<S.length;C++){var w=S[C],x=w.head,c,T=u.getRange(x,M(x.line,x.ch+1));if(L&&!w.empty())c="surround";else if((_||!L)&&T==f)_&&l(u,x)?c="both":A.indexOf(f)>=0&&u.getRange(x,M(x.line,x.ch+3))==f+f+f?c="skipThree":c="skip";else if(_&&x.ch>1&&A.indexOf(f)>=0&&u.getRange(M(x.line,x.ch-2),x)==f+f){if(x.ch>2&&/\bstring/.test(u.getTokenTypeAt(M(x.line,x.ch-2))))return ie.Pass;c="addFour"}else if(_){var y=x.ch==0?" ":u.getRange(M(x.line,x.ch-1),x);if(!ie.isWordChar(T)&&y!=f&&!ie.isWordChar(y))c="both";else return ie.Pass}else if(L&&(T.length===0||/\s/.test(T)||a.indexOf(T)>-1))c="both";else return ie.Pass;if(!R)R=c;else if(R!=c)return ie.Pass}var v=s%2?h.charAt(s-1):f,N=s%2?f:h.charAt(s+1);u.operation(function(){if(R=="skip")u.execCommand("goCharRight");else if(R=="skipThree")for(var B=0;B<3;B++)u.execCommand("goCharRight");else if(R=="surround"){for(var O=u.getSelections(),B=0;B<O.length;B++)O[B]=v+O[B]+N;u.replaceSelections(O,"around"),O=u.listSelections().slice();for(var B=0;B<O.length;B++)O[B]=g(O[B]);u.setSelections(O)}else R=="both"?(u.replaceSelection(v+N,null),u.triggerElectric(v+N),u.execCommand("goCharLeft")):R=="addFour"&&(u.replaceSelection(v+v+v+v,"before"),u.execCommand("goCharRight"))})}function p(u,f){var o=u.getRange(M(f.line,f.ch-1),M(f.line,f.ch+1));return o.length==2?o:null}function l(u,f){var o=u.getTokenAt(M(f.line,f.ch+1));return/\bstring/.test(o.type)&&o.start==f.ch&&(f.ch==0||!/\bstring/.test(u.getTokenTypeAt(f)))}})},FWmy:function(st,be,Q){"use strict";Q.d(be,"a",function(){return ie});function ie($,M){if(!$)throw new Error(M?`Assertion failed (${M})`:"Assertion Failed")}},HmJG:function(st,be,Q){},JYp7:function(st,be,Q){"use strict";Q.d(be,"a",function(){return ie});var ie;(function($){function M(a){return a&&typeof a=="object"&&typeof a[Symbol.iterator]=="function"}$.is=M;const X=Object.freeze([]);function F(){return X}$.empty=F;function*U(a){yield a}$.single=U;function G(a){return a||X}$.from=G;function W(a){return!a||a[Symbol.iterator]().next().done===!0}$.isEmpty=W;function i(a){return a[Symbol.iterator]().next().value}$.first=i;function D(a,A){for(const _ of a)if(A(_))return!0;return!1}$.some=D;function g(a,A){for(const _ of a)if(A(_))return _;return}$.find=g;function*m(a,A){for(const _ of a)A(_)&&(yield _)}$.filter=m;function*p(a,A){let _=0;for(const S of a)yield A(S,_++)}$.map=p;function*l(...a){for(const A of a)for(const _ of A)yield _}$.concat=l;function*u(a){for(const A of a)for(const _ of A)yield _}$.concatNested=u;function f(a,A,_){let S=_;for(const L of a)S=A(S,L);return S}$.reduce=f;function*o(a,A,_=a.length){for(A<0&&(A+=a.length),_<0?_+=a.length:_>a.length&&(_=a.length);A<_;A++)yield a[A]}$.slice=o;function h(a,A=Number.POSITIVE_INFINITY){const _=[];if(A===0)return[_,a];const S=a[Symbol.iterator]();for(let L=0;L<A;L++){const R=S.next();if(R.done)return[_,$.empty()];_.push(R.value)}return[_,{[Symbol.iterator](){return S}}]}$.consume=h;function s(a,A,_=(S,L)=>S===L){const S=a[Symbol.iterator](),L=A[Symbol.iterator]();for(;;){const R=S.next(),C=L.next();if(R.done!==C.done)return!1;if(R.done)return!0;if(!_(R.value,C.value))return!1}}$.equals=s})(ie||(ie={}))},LdHM:function(st,be,Q){"use strict";Q.d(be,"b",function(){return a}),Q.d(be,"a",function(){return _});var ie=Q("1OyB"),$=Q("vuIU"),M=Q("Ji7U"),X=Q("LK+K"),F=Q("q1tI"),U=Q("rePB"),G=Q("Ff2n"),W=Q("ODXe"),i=Q("4IlW"),D=Q("bX4T"),g=Q("YrtM"),m=Q("TSYQ"),p=Q.n(m),l=Q("+nKL"),u=Q("8OUc"),f=function(Y,ee){var le=Y.prefixCls,ue=Y.id,ke=Y.flattenOptions,we=Y.childrenAsData,Ae=Y.values,ce=Y.searchValue,pe=Y.multiple,se=Y.defaultActiveFirstOption,ae=Y.height,Oe=Y.itemHeight,xe=Y.notFoundContent,Pe=Y.open,De=Y.menuItemSelectedIcon,Ge=Y.virtual,Le=Y.onSelect,Fe=Y.onToggleOpen,We=Y.onActiveValue,oe=Y.onScroll,ge=Y.onMouseEnter,Se="".concat(le,"-item"),Ce=Object(g.a)(function(){return ke},[Pe,ke],function(Ue,Te){return Te[0]&&Ue[1]!==Te[1]}),je=F.useRef(null),Ve=function(Te){Te.preventDefault()},Qe=function(Te){je.current&&je.current.scrollTo({index:Te})},Je=function(Te){for(var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,_e=Ce.length,re=0;re<_e;re+=1){var ne=(Te+re*ve+_e)%_e,he=Ce[ne],fe=he.group,Ee=he.data;if(!fe&&!Ee.disabled)return ne}return-1},at=F.useState(function(){return Je(0)}),Xe=Object(W.a)(at,2),qe=Xe[0],Ne=Xe[1],lt=function(Te){Ne(Te);var ve=Ce[Te];if(!ve){We(null,-1);return}We(ve.data.value,Te)};F.useEffect(function(){lt(se!==!1?Je(0):-1)},[Ce.length,ce]),F.useEffect(function(){var Ue=setTimeout(function(){if(!pe&&Pe&&Ae.size===1){var Te=Array.from(Ae)[0],ve=Ce.findIndex(function(_e){var re=_e.data;return re.value===Te});lt(ve),Qe(ve)}});return function(){return clearTimeout(Ue)}},[Pe]);var nt=function(Te){Te!==void 0&&Le(Te,{selected:!Ae.has(Te)}),pe||Fe(!1)};if(F.useImperativeHandle(ee,function(){return{onKeyDown:function(Te){var ve=Te.which;switch(ve){case i.a.UP:case i.a.DOWN:{var _e=0;if(ve===i.a.UP?_e=-1:ve===i.a.DOWN&&(_e=1),_e!==0){var re=Je(qe+_e,_e);Qe(re),lt(re)}break}case i.a.ENTER:{var ne=Ce[qe];ne&&!ne.data.disabled?nt(ne.data.value):nt(void 0),Pe&&Te.preventDefault();break}case i.a.ESC:Fe(!1)}},onKeyUp:function(){},scrollTo:function(Te){Qe(Te)}}}),Ce.length===0)return F.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),className:"".concat(Se,"-empty"),onMouseDown:Ve},xe);function Be(Ue){var Te=Ce[Ue];if(!Te)return null;var ve=Te.data||{},_e=ve.value,re=ve.label,ne=ve.children,he=Object(D.a)(ve,!0),fe=we?ne:re;return Te?F.createElement("div",Object.assign({"aria-label":typeof fe=="string"?fe:null},he,{key:Ue,role:"option",id:"".concat(ue,"_list_").concat(Ue),"aria-selected":Ae.has(_e)}),_e):null}return F.createElement(F.Fragment,null,F.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),style:{height:0,width:0,overflow:"hidden"}},Be(qe-1),Be(qe),Be(qe+1)),F.createElement(l.a,{itemKey:"key",ref:je,data:Ce,height:ae,itemHeight:Oe,fullHeight:!1,onMouseDown:Ve,onScroll:oe,virtual:Ge,onMouseEnter:ge},function(Ue,Te){var ve,_e=Ue.group,re=Ue.groupOption,ne=Ue.data,he=ne.label,fe=ne.key;if(_e)return F.createElement("div",{className:p()(Se,"".concat(Se,"-group"))},he!==void 0?he:fe);var Ee=ne.disabled,Me=ne.value,ze=ne.title,ot=ne.children,mt=ne.style,ft=ne.className,wt=Object(G.a)(ne,["disabled","value","title","children","style","className"]),St=Ae.has(Me),dt="".concat(Se,"-option"),Ut=p()(Se,dt,ft,(ve={},Object(U.a)(ve,"".concat(dt,"-grouped"),re),Object(U.a)(ve,"".concat(dt,"-active"),qe===Te&&!Ee),Object(U.a)(ve,"".concat(dt,"-disabled"),Ee),Object(U.a)(ve,"".concat(dt,"-selected"),St),ve)),Lt=we?ot:he,qt=!De||typeof De=="function"||St;return F.createElement("div",Object.assign({},wt,{"aria-selected":St,className:Ut,title:ze,onMouseMove:function(){if(qe===Te||Ee)return;lt(Te)},onClick:function(){Ee||nt(Me)},style:mt}),F.createElement("div",{className:"".concat(dt,"-content")},Lt||Me),F.isValidElement(De)||St,qt&&F.createElement(u.a,{className:"".concat(Se,"-option-state"),customizeIcon:De,customizeIconProps:{isSelected:St}},St?"\u2713":null))}))},o=F.forwardRef(f);o.displayName="OptionList";var h=o,s=function(){return null};s.isSelectOption=!0;var a=s,A=function(){return null};A.isSelectOptGroup=!0;var _=A,S=Q("VTBJ"),L=Q("Zm9Q");function R(b){var Y=b.key,ee=b.props,le=ee.children,ue=ee.value,ke=Object(G.a)(ee,["children","value"]);return Object(S.a)({key:Y,value:ue!==void 0?ue:Y,children:le},ke)}function C(b){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(b).map(function(ee,le){if(!F.isValidElement(ee)||!ee.type)return null;var ue=ee.type.isSelectOptGroup,ke=ee.key,we=ee.props,Ae=we.children,ce=Object(G.a)(we,["children"]);return Y||!ue?R(ee):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(ke===null?le:ke,"__"),label:ke},ce),{},{options:C(Ae)})}).filter(function(ee){return ee})}var w=Q("2Qr1"),x=Q("qNPg"),c=Q("U8pU"),T=Q("Kwbf"),y=Q("WKfj");function v(b){var Y=b.mode,ee=b.options,le=b.children,ue=b.backfill,ke=b.allowClear,we=b.placeholder,Ae=b.getInputElement,ce=b.showSearch,pe=b.onSearch,se=b.defaultOpen,ae=b.autoFocus,Oe=b.labelInValue,xe=b.value,Pe=b.inputValue,De=b.optionLabelProp,Ge=Y==="multiple"||Y==="tags",Le=ce!==void 0?ce:Ge||Y==="combobox",Fe=ee||C(le);if(Object(T.a)(Y!=="tags"||Fe.every(function(Se){return!Se.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var We=Fe.some(function(Se){return Se.options?Se.options.some(function(Ce){return typeof("value"in Ce?Ce.value:Ce.key)=="number"}):typeof("value"in Se?Se.value:Se.key)=="number"});Object(T.a)(!We,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(T.a)(Y!=="combobox"||!De,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(T.a)(Y==="combobox"||!ue,"`backfill` only works with `combobox` mode."),Object(T.a)(Y==="combobox"||!Ae,"`getInputElement` only work with `combobox` mode."),Object(T.b)(Y!=="combobox"||!Ae||!ke||!we,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),pe&&!Le&&Y!=="combobox"&&Y!=="tags"&&Object(T.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(T.b)(!se||ae,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),xe!=null){var oe=Object(y.d)(xe);Object(T.a)(!Oe||oe.every(function(Se){return Object(c.a)(Se)==="object"&&("key"in Se||"value"in Se)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(T.a)(!Ge||Array.isArray(xe),"`value` should be array when `mode` is `multiple` or `tags`")}if(le){var ge=null;Object(L.a)(le).some(function(Se){if(!F.isValidElement(Se)||!Se.type)return!1;var Ce=Se.type;if(Ce.isSelectOption)return!1;if(Ce.isSelectOptGroup){var je=Object(L.a)(Se.props.children).every(function(Ve){return!F.isValidElement(Ve)||!Se.type||Ve.type.isSelectOption?!0:(ge=Ve.type,!1)});return!je}return ge=Ce,!0}),ge&&Object(T.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ge.displayName||ge.name||ge,"`.")),Object(T.a)(Pe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=v,B=Object(x.a)({prefixCls:"rc-select",components:{optionList:h},convertChildrenToData:C,flattenOptions:w.d,getLabeledValue:w.e,filterOptions:w.b,isValueDisabled:w.g,findValueOption:w.c,warningProps:N,fillOptionsWithMissingValue:w.a}),O=function(b){Object(M.a)(ee,b);var Y=Object(X.a)(ee);function ee(){var le;return Object(ie.a)(this,ee),le=Y.apply(this,arguments),le.selectRef=F.createRef(),le.focus=function(){le.selectRef.current.focus()},le.blur=function(){le.selectRef.current.blur()},le}return Object($.a)(ee,[{key:"render",value:function(){return F.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),ee}(F.Component);O.Option=a,O.OptGroup=_;var j=O,P=be.c=j},M8RZ:function(st,be,Q){"use strict";Q.d(be,"a",function(){return i});var ie=Q("fWQN"),$=Q("mtLc"),M=Q("yKVA"),X=Q("879j"),F=Q("q1tI"),U=Q.n(F),G=Q("i8i4"),W=Q.n(G),i=function(D){Object(M.a)(m,D);var g=Object(X.a)(m);function m(p){var l;Object(ie.a)(this,m),l=g.call(this,p);var u=window.document;return l.node=u.createElement("div"),u.body.appendChild(l.node),l}return Object($.a)(m,[{key:"render",value:function(){var l=this.props.children;return Object(G.createPortal)(l,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(U.a.Component)},MI8n:function(st,be,Q){"use strict";Q.d(be,"c",function(){return F}),Q.d(be,"b",function(){return i}),Q.d(be,"e",function(){return D}),Q.d(be,"a",function(){return g}),Q.d(be,"d",function(){return m}),Q.d(be,"f",function(){return p});var ie=Q("/cxE"),$=Q("pmY6"),M=Q("24hK"),X=Q("5Y4S"),F;(function(l){l.None=()=>$.a.None;function u(v){return(N,B=null,O)=>{let j=!1,P;return P=v(b=>j?void 0:(P?P.dispose():j=!0,N.call(B,b)),null,O),j&&P.dispose(),P}}l.once=u;function f(v,N){return _((B,O=null,j)=>v(P=>B.call(O,N(P)),null,j))}l.map=f;function o(v,N){return _((B,O=null,j)=>v(P=>{N(P),B.call(O,P)},null,j))}l.forEach=o;function h(v,N){return _((B,O=null,j)=>v(P=>N(P)&&B.call(O,P),null,j))}l.filter=h;function s(v){return v}l.signal=s;function a(...v){return(N,B=null,O)=>Object($.e)(...v.map(j=>j(P=>N.call(B,P),null,O)))}l.any=a;function A(v,N,B){let O=B;return f(v,j=>(O=N(O,j),O))}l.reduce=A;function _(v){let N;const B=new i({onFirstListenerAdd(){N=v(B.fire,B)},onLastListenerRemove(){N.dispose()}});return B.event}function S(v,N,B=100,O=!1,j){let P,b,Y,ee=0;const le=new i({leakWarningThreshold:j,onFirstListenerAdd(){P=v(ue=>{ee++,b=N(b,ue),O&&!Y&&(le.fire(b),b=void 0),clearTimeout(Y),Y=setTimeout(()=>{const ke=b;b=void 0,Y=void 0,(!O||ee>1)&&le.fire(ke),ee=0},B)})},onLastListenerRemove(){P.dispose()}});return le.event}l.debounce=S;function L(v,N=(B,O)=>B===O){let B=!0,O;return h(v,j=>{const P=B||!N(j,O);return B=!1,O=j,P})}l.latch=L;function R(v,N){return[l.filter(v,N),l.filter(v,B=>!N(B))]}l.split=R;function C(v,N=!1,B=[]){let O=B.slice(),j=v(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=v(Y=>b.fire(Y)))},onFirstListenerDidAdd(){O&&(N?setTimeout(P):P())},onLastListenerRemove(){j&&j.dispose(),j=null}});return b.event}l.buffer=C;class w{constructor(v){this.event=v}map(v){return new w(f(this.event,v))}forEach(v){return new w(o(this.event,v))}filter(v){return new w(h(this.event,v))}reduce(v,N){return new w(A(this.event,v,N))}latch(){return new w(L(this.event))}debounce(v,N=100,B=!1,O){return new w(S(this.event,v,N,B,O))}on(v,N,B){return this.event(v,N,B)}once(v,N,B){return u(this.event)(v,N,B)}}function x(v){return new w(v)}l.chain=x;function c(v,N,B=O=>O){const O=(...Y)=>b.fire(B(...Y)),j=()=>v.on(N,O),P=()=>v.removeListener(N,O),b=new i({onFirstListenerAdd:j,onLastListenerRemove:P});return b.event}l.fromNodeEventEmitter=c;function T(v,N,B=O=>O){const O=(...Y)=>b.fire(B(...Y)),j=()=>v.addEventListener(N,O),P=()=>v.removeEventListener(N,O),b=new i({onFirstListenerAdd:j,onLastListenerRemove:P});return b.event}l.fromDOMEventEmitter=T;function y(v){return new Promise(N=>u(v)(N))}l.toPromise=y})(F||(F={}));class U{constructor(l){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${l}_${U._idPool++}`}start(l){this._stopWatch=new X.a(!0),this._listenerCount=l}stop(){if(this._stopWatch){const l=this._stopWatch.elapsed();this._elapsedOverall+=l,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${l.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(l,u=Math.random().toString(18).slice(2,5)){this.customThreshold=l,this.name=u,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(l){let u=G;if(typeof this.customThreshold=="number"&&(u=this.customThreshold),u<=0||l<u)return;this._stacks||(this._stacks=new Map);const f=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),o=this._stacks.get(f)||0;if(this._stacks.set(f,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=u*.5;let h,s=0;for(const[a,A]of this._stacks)(!h||s<A)&&(h=a,s=A);console.warn(`[${this.name}] potential listener LEAK detected, having ${l} listeners already. MOST frequent listener (${s}):`),console.warn(h)}return()=>{const h=this._stacks.get(f)||0;this._stacks.set(f,h-1)}}}class i{constructor(l){var u;this._disposed=!1,this._options=l,this._leakageMon=G>0?new W(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((u=this._options)===null||u===void 0?void 0:u._profName)?new U(this._options._profName):void 0}get event(){return this._event||(this._event=(l,u,f)=>{var o;this._listeners||(this._listeners=new M.a);const h=this._listeners.isEmpty();h&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(u?[l,u]:l);h&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,l,u);const a=(o=this._leakageMon)===null||o===void 0?void 0:o.check(this._listeners.size),A=Object($.i)(()=>{if(a&&a(),!this._disposed&&(s(),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(l){var u,f;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new M.a);for(let o of this._listeners)this._deliveryQueue.push([o,l]);for((u=this._perfMon)===null||u===void 0||u.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[o,h]=this._deliveryQueue.shift();try{typeof o=="function"?o.call(void 0,h):o[0].call(o[1],h)}catch(s){Object(ie.f)(s)}}(f=this._perfMon)===null||f===void 0||f.stop()}}dispose(){var l,u,f,o,h;this._disposed||(this._disposed=!0,(l=this._listeners)===null||l===void 0||l.clear(),(u=this._deliveryQueue)===null||u===void 0||u.clear(),(o=(f=this._options)===null||f===void 0?void 0:f.onLastListenerRemove)===null||o===void 0||o.call(f),(h=this._leakageMon)===null||h===void 0||h.dispose())}}class D extends i{constructor(l){super(l);this._isPaused=0,this._eventQueue=new M.a,this._mergeFn=l==null?void 0:l.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const l=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(l))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(l){this._listeners&&(this._isPaused!==0?this._eventQueue.push(l):super.fire(l))}}class g extends D{constructor(l){var u;super(l);this._delay=(u=l.delay)!==null&&u!==void 0?u:100}fire(l){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(l)}}class m{constructor(){this.buffers=[]}wrapEvent(l){return(u,f,o)=>l(h=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>u.call(f,h)):u.call(f,h)},void 0,o)}bufferEvents(l){const u=[];this.buffers.push(u);const f=l();return this.buffers.pop(),u.forEach(o=>o()),f}}class p{constructor(){this.listening=!1,this.inputEvent=F.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(l){this.inputEvent=l,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=l(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(st,be,Q){"use strict";(function(ie,$){Q.d(be,"b",function(){return f}),Q.d(be,"i",function(){return a}),Q.d(be,"f",function(){return A}),Q.d(be,"d",function(){return _}),Q.d(be,"g",function(){return S}),Q.d(be,"h",function(){return L}),Q.d(be,"c",function(){return R}),Q.d(be,"k",function(){return C}),Q.d(be,"j",function(){return w}),Q.d(be,"a",function(){return x}),Q.d(be,"e",function(){return y});var M;const X="en";let F=!1,U=!1,G=!1,W=!1,i=!1,D=!1,g=!1,m,p=X,l,u;const f=typeof self=="object"?self:typeof ie=="object"?ie:{};let o;typeof f.vscode!="undefined"&&typeof f.vscode.process!="undefined"?o=f.vscode.process:typeof $!="undefined"&&(o=$);const h=typeof((M=o==null?void 0:o.versions)===null||M===void 0?void 0:M.electron)=="string"&&o.type==="renderer";if(typeof navigator=="object"&&!h)u=navigator.userAgent,F=u.indexOf("Windows")>=0,U=u.indexOf("Macintosh")>=0,g=(u.indexOf("Macintosh")>=0||u.indexOf("iPad")>=0||u.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=u.indexOf("Linux")>=0,D=!0,m=navigator.language,p=m;else if(typeof o=="object"){F=o.platform==="win32",U=o.platform==="darwin",G=o.platform==="linux",W=G&&!!o.env.SNAP&&!!o.env.SNAP_REVISION,m=X,p=X;const v=o.env.VSCODE_NLS_CONFIG;if(v)try{const N=JSON.parse(v),B=N.availableLanguages["*"];m=N.locale,p=B||X,l=N._translationsConfigFile}catch(N){}i=!0}else console.error("Unable to resolve platform.");let s=0;U?s=1:F?s=3:G&&(s=2);const a=F,A=U,_=G,S=i,L=D,R=g,C=u,w=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(o==null?void 0:o.nextTick)=="function")return o.nextTick.bind(o);const N=Promise.resolve();return B=>N.then(B)}(),x=U||g?2:F?1:3;let c=!0,T=!1;function y(){if(!T){T=!0;const v=new Uint8Array(2);v[0]=1,v[1]=2;const N=new Uint16Array(v.buffer);c=N[0]===(2<<8)+1}return c}}).call(this,Q("IyRk"),Q("Q2Ig"))},N0LK:function(st,be,Q){"use strict";Q.d(be,"C",function(){return ie}),Q.d(be,"v",function(){return M}),Q.d(be,"s",function(){return X}),Q.d(be,"t",function(){return F}),Q.d(be,"U",function(){return U}),Q.d(be,"J",function(){return G}),Q.d(be,"O",function(){return W}),Q.d(be,"p",function(){return i}),Q.d(be,"T",function(){return D}),Q.d(be,"q",function(){return g}),Q.d(be,"N",function(){return m}),Q.d(be,"M",function(){return p}),Q.d(be,"Q",function(){return l}),Q.d(be,"u",function(){return u}),Q.d(be,"x",function(){return f}),Q.d(be,"I",function(){return o}),Q.d(be,"f",function(){return h}),Q.d(be,"h",function(){return s}),Q.d(be,"g",function(){return a}),Q.d(be,"i",function(){return A}),Q.d(be,"G",function(){return _}),Q.d(be,"H",function(){return S}),Q.d(be,"r",function(){return L}),Q.d(be,"R",function(){return R}),Q.d(be,"d",function(){return C}),Q.d(be,"e",function(){return w}),Q.d(be,"E",function(){return x}),Q.d(be,"F",function(){return c}),Q.d(be,"j",function(){return T}),Q.d(be,"z",function(){return y}),Q.d(be,"K",function(){return N}),Q.d(be,"L",function(){return B}),Q.d(be,"m",function(){return j}),Q.d(be,"k",function(){return b}),Q.d(be,"A",function(){return ee}),Q.d(be,"a",function(){return le}),Q.d(be,"n",function(){return ue}),Q.d(be,"l",function(){return ke}),Q.d(be,"D",function(){return we}),Q.d(be,"B",function(){return Ae}),Q.d(be,"b",function(){return ce}),Q.d(be,"S",function(){return pe}),Q.d(be,"o",function(){return se}),Q.d(be,"P",function(){return ae}),Q.d(be,"w",function(){return Oe}),Q.d(be,"c",function(){return xe}),Q.d(be,"y",function(){return Ge});function ie(oe){return!oe||typeof oe!="string"?!0:oe.trim().length===0}const $=/{(\d+)}/g;function M(oe,...ge){return ge.length===0?oe:oe.replace($,function(Se,Ce){const je=parseInt(Ce,10);return isNaN(je)||je<0||je>=ge.length?Se:ge[je]})}function X(oe){return oe.replace(/[<>&]/g,function(ge){switch(ge){case"<":return"<";case">":return">";case"&":return"&";default:return ge}})}function F(oe){return oe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function U(oe,ge=" "){const Se=G(oe,ge);return W(Se,ge)}function G(oe,ge){if(!oe||!ge)return oe;const Se=ge.length;if(Se===0||oe.length===0)return oe;let Ce=0;for(;oe.indexOf(ge,Ce)===Ce;)Ce=Ce+Se;return oe.substring(Ce)}function W(oe,ge){if(!oe||!ge)return oe;const Se=ge.length,Ce=oe.length;if(Se===0||Ce===0)return oe;let je=Ce,Ve=-1;for(;!(Ve=oe.lastIndexOf(ge,je-1),Ve===-1||Ve+Se!==je);){if(Ve===0)return"";je=Ve}return oe.substring(0,je)}function i(oe){return oe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(oe){return oe.replace(/\*/g,"")}function g(oe,ge,Se={}){if(!oe)throw new Error("Cannot create regex from empty string");ge||(oe=F(oe)),Se.wholeWord&&(/\B/.test(oe.charAt(0))||(oe="\\b"+oe),/\B/.test(oe.charAt(oe.length-1))||(oe=oe+"\\b"));let Ce="";return Se.global&&(Ce+="g"),Se.matchCase||(Ce+="i"),Se.multiline&&(Ce+="m"),Se.unicode&&(Ce+="u"),new RegExp(oe,Ce)}function m(oe){if(oe.source==="^"||oe.source==="^$"||oe.source==="$"||oe.source==="^\\s*$")return!1;const ge=oe.exec("");return!!(ge&&oe.lastIndex===0)}function p(oe){return(oe.global?"g":"")+(oe.ignoreCase?"i":"")+(oe.multiline?"m":"")+(oe.unicode?"u":"")}function l(oe){return oe.split(/\r\n|\r|\n/)}function u(oe){for(let ge=0,Se=oe.length;ge<Se;ge++){const Ce=oe.charCodeAt(ge);if(Ce!==32&&Ce!==9)return ge}return-1}function f(oe,ge=0,Se=oe.length){for(let Ce=ge;Ce<Se;Ce++){const je=oe.charCodeAt(Ce);if(je!==32&&je!==9)return oe.substring(ge,Ce)}return oe.substring(ge,Se)}function o(oe,ge=oe.length-1){for(let Se=ge;Se>=0;Se--){const Ce=oe.charCodeAt(Se);if(Ce!==32&&Ce!==9)return Se}return-1}function h(oe,ge){return oe<ge?-1:oe>ge?1:0}function s(oe,ge,Se=0,Ce=oe.length,je=0,Ve=ge.length){for(;Se<Ce&&je<Ve;Se++,je++){let at=oe.charCodeAt(Se),Xe=ge.charCodeAt(je);if(at<Xe)return-1;if(at>Xe)return 1}const Qe=Ce-Se,Je=Ve-je;return Qe<Je?-1:Qe>Je?1:0}function a(oe,ge){return A(oe,ge,0,oe.length,0,ge.length)}function A(oe,ge,Se=0,Ce=oe.length,je=0,Ve=ge.length){for(;Se<Ce&&je<Ve;Se++,je++){let at=oe.charCodeAt(Se),Xe=ge.charCodeAt(je);if(at===Xe)continue;if(at>=128||Xe>=128)return s(oe.toLowerCase(),ge.toLowerCase(),Se,Ce,je,Ve);_(at)&&(at-=32),_(Xe)&&(Xe-=32);const qe=at-Xe;if(qe===0)continue;return qe}const Qe=Ce-Se,Je=Ve-je;return Qe<Je?-1:Qe>Je?1:0}function _(oe){return oe>=97&&oe<=122}function S(oe){return oe>=65&&oe<=90}function L(oe,ge){return oe.length===ge.length&&A(oe,ge)===0}function R(oe,ge){const Se=ge.length;return ge.length>oe.length?!1:A(oe,ge,0,Se)===0}function C(oe,ge){let Se,Ce=Math.min(oe.length,ge.length);for(Se=0;Se<Ce;Se++)if(oe.charCodeAt(Se)!==ge.charCodeAt(Se))return Se;return Ce}function w(oe,ge){let Se,Ce=Math.min(oe.length,ge.length);const je=oe.length-1,Ve=ge.length-1;for(Se=0;Se<Ce;Se++)if(oe.charCodeAt(je-Se)!==ge.charCodeAt(Ve-Se))return Se;return Ce}function x(oe){return 55296<=oe&&oe<=56319}function c(oe){return 56320<=oe&&oe<=57343}function T(oe,ge){return(oe-55296<<10)+(ge-56320)+65536}function y(oe,ge,Se){const Ce=oe.charCodeAt(Se);if(x(Ce)&&Se+1<ge){const je=oe.charCodeAt(Se+1);if(c(je))return T(Ce,je)}return Ce}function v(oe,ge){const Se=oe.charCodeAt(ge-1);if(c(Se)&&ge>1){const Ce=oe.charCodeAt(ge-2);if(x(Ce))return T(Ce,Se)}return Se}function N(oe,ge){const Se=Pe.getInstance(),Ce=ge,je=oe.length,Ve=y(oe,je,ge);ge+=Ve>=65536?2:1;let Qe=Se.getGraphemeBreakType(Ve);for(;ge<je;){const Je=y(oe,je,ge),at=Se.getGraphemeBreakType(Je);if(xe(Qe,at))break;ge+=Je>=65536?2:1,Qe=at}return ge-Ce}function B(oe,ge){const Se=Pe.getInstance(),Ce=ge,je=v(oe,ge);ge-=je>=65536?2:1;let Ve=Se.getGraphemeBreakType(je);for(;ge>0;){const Qe=v(oe,ge),Je=Se.getGraphemeBreakType(Qe);if(xe(Je,Ve))break;ge-=Qe>=65536?2:1,Ve=Je}return Ce-ge}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(oe){return O.test(oe)}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(oe){return P.test(oe)}const Y=/^[\t\n\r\x20-\x7E]*$/;function ee(oe){return Y.test(oe)}const le=/[\u2028\u2029]/;function ue(oe){return le.test(oe)}function ke(oe){for(let ge=0,Se=oe.length;ge<Se;ge++)if(we(oe.charCodeAt(ge)))return!0;return!1}function we(oe){return oe=+oe,oe>=11904&&oe<=55215||oe>=63744&&oe<=64255||oe>=65281&&oe<=65374}function Ae(oe){return oe>=127462&&oe<=127487||oe===8986||oe===8987||oe===9200||oe===9203||oe>=9728&&oe<=10175||oe===11088||oe===11093||oe>=127744&&oe<=128591||oe>=128640&&oe<=128764||oe>=128992&&oe<=129003||oe>=129280&&oe<=129535||oe>=129648&&oe<=129750}const ce=String.fromCharCode(65279);function pe(oe){return!!(oe&&oe.length>0&&oe.charCodeAt(0)===65279)}function se(oe,ge=!1){return oe?(ge&&(oe=oe.replace(/\\./g,"")),oe.toLowerCase()!==oe):!1}function ae(oe){const ge=90-65+1;return oe=oe%(2*ge),oe<ge?String.fromCharCode(97+oe):String.fromCharCode(65+oe-ge)}function Oe(oe){const ge=Pe.getInstance();return ge.getGraphemeBreakType(oe)}function xe(oe,ge){return oe===0?ge!==5&&ge!==7:oe===2&&ge===3?!1:oe===4||oe===2||oe===3||(ge===4||ge===2||ge===3)?!0:oe===8&&(ge===8||ge===9||ge===11||ge===12)||((oe===11||oe===9)&&(ge===9||ge===10)||((oe===12||oe===10)&&ge===10||(ge===5||ge===13||(ge===7||(oe===1||oe===13&&ge===14)))))?!1:!(oe===6&&ge===6)}class Pe{constructor(){this._data=De()}static getInstance(){return Pe._INSTANCE||(Pe._INSTANCE=new Pe),Pe._INSTANCE}getGraphemeBreakType(oe){if(oe<32)return oe===10?3:oe===13?2:4;if(oe<127)return 0;const ge=this._data,Se=ge.length/3;let Ce=1;for(;Ce<=Se;)if(oe<ge[3*Ce])Ce=2*Ce;else if(oe>ge[3*Ce+1])Ce=2*Ce+1;else return ge[3*Ce+2];return 0}}Pe._INSTANCE=null;function De(){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 Ge(oe,ge){if(oe===0)return 0;const Se=Le(oe,ge);if(Se!==void 0)return Se;const Ce=v(ge,oe);return oe-=Fe(Ce),oe}function Le(oe,ge){let Se=v(ge,oe);for(oe-=Fe(Se);We(Se)||Se===65039||Se===8419;){if(oe===0)return;Se=v(ge,oe),oe-=Fe(Se)}if(!Ae(Se))return;if(oe>=0){const Ce=v(ge,oe);Ce===8205&&(oe-=Fe(Ce))}return oe}function Fe(oe){return oe>=65536?2:1}function We(oe){return 127995<=oe&&oe<=127999}},Ot1p:function(st,be,Q){"use strict";var ie=Q("2qtc"),$=Q("kLXV"),M=Q("rAM+"),X=Q("miYZ"),F=Q("tsqr"),U=Q("9og8"),G=Q("tJVT"),W=Q("jrin"),i=Q("WmNS"),D=Q.n(i),g=Q("q1tI"),m=Q.n(g),p=Q("VrN/"),l=Q.n(p),u=Q("bdgK"),f=Q("p77/"),o=Q("Bd2K"),h=Q("ELLl"),s=Q("19Vz"),a=Q("lZu9"),A=Q("+NIl"),_=Q("kSUc"),S=Q("9Bee"),L=function(Ee){var Me=Ee.value,ze=Me===void 0?"":Me,ot=Ee.className,mt=Ee.showTextOnly,ft=Ee.showLines,wt=Ee.style,St=wt===void 0?{}:wt,dt=Object(g.useMemo)(function(){return""},[ze]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:dt}}))},R=Q("0Owb"),C=Q("dejd"),w=Q("C+DQ"),x=Q("1vsH"),c=Q("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 y(Ee){var Me=Ee.onActionCallback,ze=Ee.title,ot=Ee.icon,mt=Ee.actionName,ft=Ee.className,wt=ft===void 0?"":ft,St=Ee.children;function dt(){Me(mt)}return m.a.createElement("a",{title:ze,className:wt,onClick:dt},m.a.createElement("i",{className:"md-iconfont ".concat(ot)}),St)}var v=function(Ee){var Me=Ee.watch,ze=Ee.showNullButton,ot=Ee.onActionCallback,mt=Ee.fullScreen,ft=Ee.insertTemp,wt=Ee.hidetoolBar,St=Ee.uuid,dt=Ee.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(St,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var Ut=[].concat(T,[{title:"".concat(Me?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Me?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&Ut.map(function(Lt,qt){return m.a.createElement("li",{key:qt},Lt.actionName?m.a.createElement(y,Object(R.a)({},Lt,{onActionCallback:ot})):m.a.createElement("span",{className:"v-line"}))}),ze?m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ot},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:ot},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(y,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ot})))},N=Q("M8RZ"),B=Q("+L6B"),O=Q("2/Rp"),j=Q("y8nQ"),P=Q("Vl3Y"),b=Q("5NDa"),Y=Q("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},le=function(Ee){var Me=Ee.callback,ze=Ee.onCancel;function ot(mt){Me(mt)}return m.a.createElement(P.a,Object(R.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ot}),m.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(Y.a,null)),m.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(Y.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(O.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(O.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},ue=Q("7ahc"),ke=Q("HmJG"),we=Q("BjJ7"),Ae=P.a.useForm,ce={width:280,marginRight:10},pe={labelCol:{span:5},wrapperCol:{span:19}},se=function(Ee){var Me=Ee.callback,ze=Ee.onCancel,ot=Ae(),mt=Object(G.a)(ot,1),ft=mt[0];function wt(Ut){Me(Ut)}function St(Ut,Lt){if(Ut.status===-1){F.b.error(Ut.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Ut.id),type:Lt.type})}function dt(Ut){var Lt=Ut.target.files[0];Oe(Lt,St)}return m.a.createElement(P.a,Object(R.a)({form:ft},pe,{className:"upload-image-panel",onFinish:wt}),m.a.createElement(P.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(P.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(Y.a,{style:ce})),m.a.createElement(ae,{onFileChange:dt}))),m.a.createElement(P.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(Y.a,{style:{width:264}})),m.a.createElement(P.a.Item,{style:{textAlign:"right"}},m.a.createElement(O.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(O.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))};function ae(Ee){var Me=Ee.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Me}))}function Oe(Ee,Me){if(!Ee)throw new String("\u6CA1\u6709\u6587\u4EF6");var ze=new FormData;ze.append("editormd-image-file",Ee),ze.append("file_param_name","editormd-image-file"),ze.append("byxhr","true");var ot=new window.XMLHttpRequest;ot.withCredentials=!0,ot.addEventListener("load",function(mt){Me(JSON.parse(mt.target.responseText),Ee)},!1),ot.addEventListener("error",function(mt){console.error(mt)},!1),ot.open("POST","".concat(we.a,"/api/attachments.json")),ot.send(ze)}var xe=Q("giR+"),Pe=Q("fyUT"),De=Q("7Kak"),Ge=Q("9yH6"),Le=Ge.a.Group,Fe={margin:"0 8px"},We=function(Ee){var Me=Ee.callback,ze=Ee.onCancel;function ot(mt){Me(mt)}return m.a.createElement(P.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ot},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:Fe},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:Fe},"\u884C\u6570"),m.a.createElement(P.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(Pe.a,null)),m.a.createElement("span",{style:Fe},"\u5217\u6570"),m.a.createElement(P.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(Pe.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:Fe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(P.a.Item,{name:"align"},m.a.createElement(Le,null,m.a.createElement(Ge.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(Ge.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(Ge.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(Ge.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(O.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(O.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},oe=Q("ErOA"),ge=Q("7Cbv"),Se="link",Ce="upload-image",je="code-block",Ve="add-table",Qe="------------",Je={default:Qe,left:":".concat(Qe),center:":".concat(Qe,":"),right:"".concat(Qe,":")},at=Q("9VGf"),Xe,qe;function Ne(){}var lt=0,nt=1e4,Be="\u2581",Ue=`
|
|
**\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 Te(Ee){return/^\d+$/.test(Ee)?"".concat(Ee,"px"):Ee}var ve=navigator.platform.toUpperCase().indexOf("MAC")>=0,_e=ve?"Cmd":"Ctrl",re=["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"],ne=(Xe={},Object(W.a)(Xe,_e+"-B","bold"),Object(W.a)(Xe,_e+"-I","italic"),Xe),he=(qe={},Object(W.a)(qe,Se,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(qe,je,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(qe,Ce,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(qe,Ve,"\u6DFB\u52A0\u8868\u683C"),qe),fe=be.a=function(Ee){var Me=Ee.defaultValue,ze=Me===void 0?"":Me,ot=Ee.onChange,mt=Ee.width,ft=mt===void 0?"100%":mt,wt=Ee.height,St=wt===void 0?400:wt,dt=Ee.miniToolbar,Ut=dt===void 0?!1:dt,Lt=Ee.isFocus,qt=Lt===void 0?!1:Lt,Qt=Ee.watch,It=Ee.insertTemp,Ci=Ee.mode,Ki=Ci===void 0?"markdown":Ci,yt=Ee.id,Li=yt===void 0?"markdown-editor-id":yt,bt=Ee.showResizeBar,xt=bt===void 0?!1:bt,Ft=Ee.noStorage,ti=Ft===void 0?!1:Ft,di=Ee.showNullButton,Pt=di===void 0?!1:di,ct=Ee.hidetoolBar,Ui=ct===void 0?!1:ct,Vt=Ee.fullScreen,Jt=Vt===void 0?!1:Vt,Ot=Ee.onBlur,li=Ee.onCMBeforeChange,Ii=Ee.onFullScreen,Xi=Ee.className,Ze=Xi===void 0?"":Xi,Ct=Ee.disablePaste,pr=Ct===void 0?!1:Ct,mr=Ee.placeholder,gr=mr===void 0?"":mr,vr=Ee.values,V=vr===void 0?"":vr,E=Object(g.useState)(null),I=Object(G.a)(E,2),H=I[0],q=I[1],z=Object(g.useState)(ze),ye=Object(G.a)(z,2),Ke=ye[0],tt=ye[1],pt=Object(g.useState)(Qt),Ye=Object(G.a)(pt,2),_t=Ye[0],jt=Ye[1],$t=Object(g.useState)(Jt),ji=Object(G.a)($t,2),Ei=ji[0],xi=ji[1],Qi=Object(g.useState)(""),Ir=Object(G.a)(Qi,2),ci=Ir[0],zi=Ir[1],lr=Object(g.useState)(0),ur=Object(G.a)(lr,2),Hi=ur[0],Dr=ur[1],yr=Object(g.useState)(St),Kr=Object(G.a)(yr,2),zr=Kr[0],Zi=Kr[1],$i=Object(g.useState)(!1),br=Object(G.a)($i,2),dn=br[0],_r=br[1],ri=Object(g.useRef)(Object(ge.a)()),Ht=Object(g.useRef)(!1),yi=Object(g.useRef)(),kt=Object(g.useRef)(),ai=Object(g.useRef)(),Kt=Object(g.useRef)(),rr=Object(g.useRef)(),fi=function(){var gt=Object(U.a)(D.a.mark(function At(){var Et,Dt;return D.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,Object(oe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ri.current}});case 2:Dt=Yt.sent,Dt!=null&&(Et=Dt.attachments)!==null&&Et!==void 0&&Et.length&&(console.log("cm:",H,kt),Dt.attachments.map(function(Nt){Nt.content_type.indexOf("image")>-1?H.replaceSelection(".concat(Nt.content_type,")")):Nt.content_type.indexOf("video")>-1?H.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Nt.content_type.indexOf("pdf")>-1?H.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):H.replaceSelection("[".concat(Nt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,")"))}));case 4:case"end":return Yt.stop()}},At)}));return function(){return gt.apply(this,arguments)}}();Object(g.useEffect)(function(){tt(V),H==null||H.setValue(V)},[V]),Object(g.useEffect)(function(){Ii==null||Ii(Ei)},[Ei]),Object(g.useEffect)(function(){if(kt.current){var gt=l.a.fromTextArea(kt.current,{mode:Ki,lineNumbers:!Ut,lineWrapping:!0,value:ze,autoCloseTags:!0,autoCloseBrackets:!0});qt&>.focus();function At(Et,Dt){if(pr){Dt.preventDefault();return}var Bt=Dt.clipboardData;if(Bt){var Yt=Bt.types.toString(),Nt=Bt.items;if(Yt==="Files"||Bt.types.indexOf("Files")>-1){if(Dt.preventDefault(),Ki=="stex")return;try{var ui,Di=Nt[1];((ui=Nt[0])===null||ui===void 0?void 0:ui.kind)==="file"&&(Di=Nt[0]);var Mt=Di.getAsFile(),hr=Mt.name.split(".").pop();Oe(Mt,function(Wt){if(Wt.id){var ki,Ti,Ji;(Mt==null||((ki=Mt.type)===null||ki===void 0)?void 0:ki.indexOf("image"))>-1?gt.replaceSelection(".concat(Wt.content_type,")")):(Mt==null||((Ti=Mt.type)===null||Ti===void 0)?void 0:Ti.indexOf("video"))>-1?gt.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,'"></video>')):(Mt==null||((Ji=Mt.type)===null||Ji===void 0)?void 0:Ji.indexOf("pdf"))>-1?gt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Mt.type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):re.includes(hr)?gt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,'?type=office&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):gt.replaceSelection("[".concat(Mt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})}catch(Wt){F.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return gt.on("paste",At),gt.on("dragleave",function(Et,Dt){ai.current.classList.remove("mouse-hover-md")}),gt.on("dragover",function(Et,Dt){ai.current.classList.add("mouse-hover-md")}),gt.on("drop",function(Et,Dt){ai.current.classList.add("mouse-hover-md");var Bt;if(Bt=Dt.dataTransfer.files,Bt.length>0){Dt.preventDefault(),Dt.stopPropagation();for(var Yt=function(Di){var Mt=Bt[Di],hr=Mt.name.split(".").pop();Oe(Mt,function(Wt){if(Wt.id){var ki,Ti,Ji;(Mt==null||((ki=Mt.type)===null||ki===void 0)?void 0:ki.indexOf("image"))>-1?gt.replaceSelection(".concat(Wt.content_type,")")):(Mt==null||((Ti=Mt.type)===null||Ti===void 0)?void 0:Ti.indexOf("video"))>-1?gt.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,'"></video>')):(Mt==null||((Ji=Mt.type)===null||Ji===void 0)?void 0:Ji.indexOf("pdf"))>-1?gt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Mt.type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):re.includes(hr)?gt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,'?type=office&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):gt.replaceSelection("[".concat(Mt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})},Nt=0;Nt<Bt.length;Nt++)Yt(Nt)}}),q(gt),function(){gt.off("paste",At)}}},[]);var Ai=Object(g.useCallback)(function(){if(ai.current)try{}catch(gt){console.log(gt,"---- to set md editor body height")}},[zr,ai,Ei]);Object(g.useEffect)(function(){function gt(){var Et=new u.default(function(Dt){var Bt=Object(M.a)(Dt),Yt;try{for(Bt.s();!(Yt=Bt.n()).done;){var Nt=Yt.value;(Nt.target.offsetHeight>0||Nt.target.offsetWidth>0)&&(Ai(),H.setSize("100%","100%"),H.refresh())}}catch(ui){Bt.e(ui)}finally{Bt.f()}});return Et.observe(kt.current.parentElement),Et}if(H){var At=gt();return function(){At.unobserve(kt.current.parentElement)}}},[H,Ai]),Object(g.useEffect)(function(){if(H){for(var gt=[],At=function(){var Nt=Dt[Et];Bt=Object(G.a)(Nt,2);var ui=Bt[0],Di=Bt[1],Mt=Object(W.a)({},ui,function(){Vr(Di)});gt.push(Mt),H.addKeyMap(Mt)},Et=0,Dt=Object.entries(ne);Et<Dt.length;Et++){var Bt;At()}return yi.current=setInterval(function(){Ht.current&&fi()},4e3),function(){clearInterval(yi.current);var Yt=Object(M.a)(gt),Nt;try{for(Yt.s();!(Nt=Yt.n()).done;){var ui=Nt.value;H.removeKeyMap(ui)}}catch(Di){Yt.e(Di)}finally{Yt.f()}}}},[H]),Object(g.useEffect)(function(){Jt!==Ei&&xi(Jt)},[Jt]),Object(at.a)(function(){if(!ti&&Hi>0){var gt=new Date().getTime(),At=window.sessionStorage.getItem(Li);gt>=Hi+nt&&(!At||At!==Ke)&&(window.sessionStorage.setItem(Li,Ke),_r(!0))}},nt),Object(g.useEffect)(function(){jt(Qt)},[H,Qt]),Object(g.useEffect)(function(){H&&(qt&&H.focus())},[H,qt]),Object(g.useEffect)(function(){if(_t&&H){var gt=H.getScrollerElement();function At(Et){var Dt=Et.target;if(rr.current){var Bt=Dt.scrollTop/Dt.scrollHeight;rr.current.scrollTop=rr.current.scrollHeight*Bt}}return gt.addEventListener("scroll",At),function(){gt.removeEventListener("scroll",At)}}},[H,_t]),Object(g.useEffect)(function(){if(H&&li){function gt(At,Et){li(At,Et)}return H.on("beforeChange",gt),function(){H.off("beforeChange",gt)}}},[H,li]),Object(g.useEffect)(function(){if(H&&Ot){function gt(){Ot(H.getValue())}return H.on("blur",gt),function(){H.off("blur",gt)}}},[H,Ot]),Object(g.useEffect)(function(){if(H){function gt(At){var Et=At.getValue();tt(Et),Dr(new Date().getTime()),At.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ot&&ot(Et)}return H.on("change",gt),function(){H.off("change",gt)}}},[H,ot]),Object(g.useEffect)(function(){H&&(ze==null?(H.setValue(""),tt("")):ze!==H.getValue()&&(H.setValue(ze),tt(ze),H.setCursor(H.lineCount(),0)))},[H,ze]);var Vr=Object(g.useCallback)(function(gt){var At=H.getCursor(),Et=H.getSelection(),Dt=Et.split(`
|
|
`);switch(gt){case"bold":return H.replaceSelection("**"+Et+"**"),Et===""&&H.setCursor(At.line,At.ch+2),H.focus();case"italic":return H.replaceSelection("*"+Et+"*"),Et===""&&H.setCursor(At.line,At.ch+1),H.focus();case"code":return H.replaceSelection("`"+Et+"`"),Et===""&&H.setCursor(At.line,At.ch+1),H.focus();case"inline-latex":return H.replaceSelection("`$$"+Et+"$$`"),Et===""&&H.setCursor(At.line,At.ch+3),H.focus();case"latex":return H.replaceSelection("```latex\n"+Et+"\n```"),H.setCursor(At.line+1,Et.length+1),H.focus();case"line-break":return H.replaceSelection(`<br/>
|
|
`),H.focus();case"list-ul":return Et===""?H.replaceSelection("- "+Et):H.replaceSelection(Dt.map(function(Bt){return Bt===""?"":"- ".concat(Bt)}).join(`
|
|
`)),H.focus();case"list-ol":return Et===""?H.replaceSelection("1. "+Et):H.replaceSelection(Dt.map(function(Bt,Yt){return Bt===""?"":"".concat(Yt+1,". ").concat(Bt)}).join(`
|
|
`)),H.focus();case"add-null-ch":return Et===""&&H.setCursor(At.line,At.ch+1),H.replaceSelection(Be),H.focus();case"inster-template-1":return Et===""&&H.setCursor(At.line,At.ch),H.replaceSelection(Ue),H.focus();case"eraser":return H.setValue(""),H.focus();case"trigger-watch":return jt(!_t),H.focus();case"trigger-full-screen":return xi(!Ei),H.focus();case Se:zi(Se);return;case je:zi(je);return;case Ce:zi(Ce);return;case Ve:zi(Ve);return;default:throw new Error}},[H,_t,Ei]),Er=Object(g.useCallback)(function(gt){zi("");switch(ci){case Se:var At=gt.title,Et=gt.link;return H.replaceSelection("[".concat(At,"](").concat(Et,")")),H.focus();case je:var Dt=gt.language,Bt=gt.content;return H.replaceSelection(["```"+Dt,Bt,"```"].join(`
|
|
`)),H.focus();case Ce:var Yt=gt.src,Nt=gt.alt;return Nt?H.replaceSelection(".concat(Yt,' "').concat(Nt,'" )')):H.replaceSelection("")),H.focus();case Ve:for(var ui=gt.row,Di=gt.col,Mt=gt.align,hr=`
|
|
`,Wt=0;Wt<ui;Wt++){for(var ki=[],Ti=[],Ji=0;Ji<Di;Ji++)Wt===1&&Ti.push(Je[Mt]),ki.push(" ");Wt===1&&(hr+="| ".concat(Ti.join(" | "),` |
|
|
`)),hr+="| ".concat(ki.join(Di===1?"":" | "),` |
|
|
`)}return H.replaceSelection(hr+`
|
|
`),H.focus();default:throw new Error}},[H,ci]),cn=Object(g.useMemo)(function(){switch(ci){case Se:return m.a.createElement(le,{callback:Er,onCancel:xr});case je:return m.a.createElement(ue.b,{callback:Er,onCancel:xr});case Ce:return m.a.createElement(se,{callback:Er,onCancel:xr});case Ve:return m.a.createElement(We,{callback:Er,onCancel:xr});default:return null}},[ci]);function xr(){zi("")}Object(g.useEffect)(function(){if(Kt.current){var gt=Kt.current,At=!1,Et=0;function Dt(Nt){At=!0,Et=Nt.pageY}function Bt(){At=!1}function Yt(Nt){if(At){var ui=Nt.pageY-Et;ui<0&&(ui=0),ui>300&&(ui=300);var Di=St+ui+"px";Zi(Di)}}return gt.addEventListener("mousedown",Dt),document.addEventListener("mousemove",Yt),document.addEventListener("mouseup",Bt),function(){gt.removeEventListener("mousedown",Dt),document.removeEventListener("mousemove",Yt),document.removeEventListener("mouseup",Bt)}}},[H,Kt]),Object(g.useEffect)(function(){Zi(St)},[St]);var nr=Te(ft),fn=Te(zr),qi={width:nr,height:fn},pn=Object(g.useMemo)(function(){if(Hi){var gt=new Date(Hi),At=gt.getHours(),Et=gt.getMinutes(),Dt=gt.getSeconds();return At=At<10?"0"+At:At,Et=Et<10?"0"+Et:Et,Dt=Dt<10?"0"+Dt:Dt,"".concat(At,":").concat(Et,":").concat(Dt)}return 0},[Hi]);function jn(){window.sessionStorage.removeItem(Li),_r(!1),Dr(0)}function kr(){_r(!1),Dr(0),H.setValue(window.sessionStorage.getItem(Li))}function ua(gt,At){var Et=H.getValue();Et=Et.replace(gt,At),tt(Et),H==null||H.setValue(Et)}return m.a.createElement(g.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:ai},m.a.createElement("div",{className:"markdown-editor-container ".concat(Ze," ").concat(_t?"on-preview":""," ").concat(Ut?"mini":""," ").concat(Ei?"full-screen":""),style:qi},m.a.createElement(v,{insertTemp:It,watch:_t,fullScreen:Ei,showNullButton:Pt,onActionCallback:Vr,hidetoolBar:Ui,uuid:ri.current,setOpenPhones:function(){Ht.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:kt,placeholder:gr})),_t?m.a.createElement("div",{ref:rr,className:"preview-container"},Ki==="stex"&&m.a.createElement(L,{value:Ke}),Ki!=="stex"&&m.a.createElement(S.a,{edit:!0,value:Ke,replaces:ua})):null))),xt?m.a.createElement("a",{ref:Kt,className:"editor-resize"}):null,m.a.createElement(N.a,null,he[ci]?m.a.createElement($.a,{centered:!0,title:he[ci],visible:!0,onCancel:xr,footer:null,className:"markdown-popup-form"},cn):null))}},RxwV:function(st,be,Q){"use strict";var ie=Q("q1tI"),$=Q("uciX"),M=Q("2W6z"),X=Q.n(M),F=Q("4IlW"),U=Q("uK0f"),G=Q.n(U);function W(ce,pe){if(ce===pe)return!0;if(!ce||!pe)return!1;var se=ce.length;if(pe.length!==se)return!1;for(var ae=0;ae<se;ae++)if(ce[ae]!==pe[ae])return!1;return!0}function i(ce){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?i=function(se){return typeof se}:i=function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},i(ce)}function D(ce,pe){if(!(ce instanceof pe))throw new TypeError("Cannot call a class as a function")}function g(ce,pe){for(var se=0;se<pe.length;se++){var ae=pe[se];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(ce,ae.key,ae)}}function m(ce,pe,se){return pe&&g(ce.prototype,pe),se&&g(ce,se),ce}function p(ce,pe){if(typeof pe!="function"&&pe!==null)throw new TypeError("Super expression must either be null or a function");ce.prototype=Object.create(pe&&pe.prototype,{constructor:{value:ce,writable:!0,configurable:!0}}),pe&&l(ce,pe)}function l(ce,pe){return l=Object.setPrototypeOf||function(ae,Oe){return ae.__proto__=Oe,ae},l(ce,pe)}function u(ce){var pe=h();return function(){var se=s(ce),ae;if(pe){var Oe=s(this).constructor;ae=Reflect.construct(se,arguments,Oe)}else ae=se.apply(this,arguments);return f(this,ae)}}function f(ce,pe){return pe&&(i(pe)==="object"||typeof pe=="function")?pe:o(ce)}function o(ce){if(ce===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ce}function h(){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(ce){return!1}}function s(ce){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(se){return se.__proto__||Object.getPrototypeOf(se)},s(ce)}var a=function(){var ce=function(pe){p(ae,pe);var se=u(ae);function ae(){var Oe;return D(this,ae),Oe=se.apply(this,arguments),Oe.menuItems={},Oe.saveMenuItem=function(xe){return function(Pe){Oe.menuItems[xe]=Pe}},Oe}return m(ae,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(xe){!xe.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(xe){var Pe=this.props,De=Pe.fieldNames,Ge=Pe.defaultFieldNames;return De[xe]||Ge[xe]}},{key:"getOption",value:function(xe,Pe){var De=this.props,Ge=De.prefixCls,Le=De.expandTrigger,Fe=De.expandIcon,We=De.loadingIcon,oe=this.props.onSelect.bind(this,xe,Pe),ge=this.props.onItemDoubleClick.bind(this,xe,Pe),Se={onClick:oe,onDoubleClick:ge},Ce="".concat(Ge,"-menu-item"),je=null,Ve=xe[this.getFieldName("children")]&&xe[this.getFieldName("children")].length>0;(Ve||xe.isLeaf===!1)&&(Ce+=" ".concat(Ge,"-menu-item-expand"),xe.loading||(je=ie.createElement("span",{className:"".concat(Ge,"-menu-item-expand-icon")},Fe))),Le==="hover"&&(Ve||xe.isLeaf===!1)&&(Se={onMouseEnter:this.delayOnSelect.bind(this,oe),onMouseLeave:this.delayOnSelect.bind(this),onClick:oe}),this.isActiveOption(xe,Pe)&&(Ce+=" ".concat(Ge,"-menu-item-active"),Se.ref=this.saveMenuItem(Pe)),xe.disabled&&(Ce+=" ".concat(Ge,"-menu-item-disabled"));var Qe=null;xe.loading&&(Ce+=" ".concat(Ge,"-menu-item-loading"),Qe=We||null);var Je="";return"title"in xe?Je=xe.title:typeof xe[this.getFieldName("label")]=="string"&&(Je=xe[this.getFieldName("label")]),ie.createElement("li",Object.assign({key:xe[this.getFieldName("value")],className:Ce,title:Je},Se,{role:"menuitem",onMouseDown:function(Xe){return Xe.preventDefault()}}),xe[this.getFieldName("label")],je,Qe)}},{key:"getActiveOptions",value:function(xe){var Pe=this,De=this.props.options,Ge=xe||this.props.activeValue;return G()(De,function(Le,Fe){return Le[Pe.getFieldName("value")]===Ge[Fe]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var xe=this,Pe=this.props.options,De=this.getActiveOptions().map(function(Ge){return Ge[xe.getFieldName("children")]}).filter(function(Ge){return!!Ge});return De.unshift(Pe),De}},{key:"delayOnSelect",value:function(xe){for(var Pe=this,De=arguments.length,Ge=new Array(De>1?De-1:0),Le=1;Le<De;Le++)Ge[Le-1]=arguments[Le];this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),typeof xe=="function"&&(this.delayTimer=window.setTimeout(function(){xe(Ge),Pe.delayTimer=null},150))}},{key:"scrollActiveItemToView",value:function(){for(var xe=this.getShowOptions().length,Pe=0;Pe<xe;Pe++){var De=this.menuItems[Pe];De&&De.parentElement&&(De.parentElement.scrollTop=De.offsetTop)}}},{key:"isActiveOption",value:function(xe,Pe){var De=this.props.activeValue,Ge=De===void 0?[]:De;return Ge[Pe]===xe[this.getFieldName("value")]}},{key:"render",value:function(){var xe=this,Pe=this.props,De=Pe.prefixCls,Ge=Pe.dropdownMenuColumnStyle;return ie.createElement("div",null,this.getShowOptions().map(function(Le,Fe){return ie.createElement("ul",{className:"".concat(De,"-menu"),key:Fe,style:Ge},Le.map(function(We){return xe.getOption(We,Fe)}))}))}}]),ae}(ie.Component);return ce.defaultProps={options:[],value:[],activeValue:[],onSelect:function(){},prefixCls:"rc-cascader-menus",visible:!1,expandTrigger:"click"},ce}(),A=a,_={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}}},S=_;function L(ce){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?L=function(se){return typeof se}:L=function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},L(ce)}function R(ce,pe){if(ce==null)return{};var se=C(ce,pe),ae,Oe;if(Object.getOwnPropertySymbols){var xe=Object.getOwnPropertySymbols(ce);for(Oe=0;Oe<xe.length;Oe++){if(ae=xe[Oe],pe.indexOf(ae)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(ce,ae))continue;se[ae]=ce[ae]}}return se}function C(ce,pe){if(ce==null)return{};var se={},ae=Object.keys(ce),Oe,xe;for(xe=0;xe<ae.length;xe++){if(Oe=ae[xe],pe.indexOf(Oe)>=0)continue;se[Oe]=ce[Oe]}return se}function w(ce){return y(ce)||T(ce)||c(ce)||x()}function x(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(ce,pe){if(!ce)return;if(typeof ce=="string")return v(ce,pe);var se=Object.prototype.toString.call(ce).slice(8,-1);if(se==="Object"&&ce.constructor&&(se=ce.constructor.name),se==="Map"||se==="Set")return Array.from(ce);if(se==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(se))return v(ce,pe)}function T(ce){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(ce))return Array.from(ce)}function y(ce){if(Array.isArray(ce))return v(ce)}function v(ce,pe){(pe==null||pe>ce.length)&&(pe=ce.length);for(var se=0,ae=new Array(pe);se<pe;se++)ae[se]=ce[se];return ae}function N(ce,pe){if(!(ce instanceof pe))throw new TypeError("Cannot call a class as a function")}function B(ce,pe){for(var se=0;se<pe.length;se++){var ae=pe[se];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(ce,ae.key,ae)}}function O(ce,pe,se){return pe&&B(ce.prototype,pe),se&&B(ce,se),ce}function j(ce,pe){if(typeof pe!="function"&&pe!==null)throw new TypeError("Super expression must either be null or a function");ce.prototype=Object.create(pe&&pe.prototype,{constructor:{value:ce,writable:!0,configurable:!0}}),pe&&P(ce,pe)}function P(ce,pe){return P=Object.setPrototypeOf||function(ae,Oe){return ae.__proto__=Oe,ae},P(ce,pe)}function b(ce){var pe=le();return function(){var se=ue(ce),ae;if(pe){var Oe=ue(this).constructor;ae=Reflect.construct(se,arguments,Oe)}else ae=se.apply(this,arguments);return Y(this,ae)}}function Y(ce,pe){return pe&&(L(pe)==="object"||typeof pe=="function")?pe:ee(ce)}function ee(ce){if(ce===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ce}function le(){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(ce){return!1}}function ue(ce){return ue=Object.setPrototypeOf?Object.getPrototypeOf:function(se){return se.__proto__||Object.getPrototypeOf(se)},ue(ce)}var ke=function(){var ce=function(pe){j(ae,pe);var se=b(ae);function ae(Oe){var xe;N(this,ae),xe=se.call(this,Oe),xe.setPopupVisible=function(De){var Ge=xe.state.value;"popupVisible"in xe.props||xe.setState({popupVisible:De}),De&&!xe.state.popupVisible&&xe.setState({activeValue:Ge}),xe.props.onPopupVisibleChange(De)},xe.handleChange=function(De,Ge,Le){var Fe=Ge.visible;(Le.type!=="keydown"||Le.keyCode===F.a.ENTER)&&(xe.props.onChange(De.map(function(We){return We[xe.getFieldName("value")]}),De),xe.setPopupVisible(Fe))},xe.handlePopupVisibleChange=function(De){xe.setPopupVisible(De)},xe.handleMenuSelect=function(De,Ge,Le){var Fe=xe.trigger.getRootDomNode();Fe&&Fe.focus&&Fe.focus();var We=xe.props,oe=We.changeOnSelect,ge=We.loadData,Se=We.expandTrigger;if(!De||De.disabled)return;var Ce=xe.state.activeValue;Ce=Ce.slice(0,Ge+1),Ce[Ge]=De[xe.getFieldName("value")];var je=xe.getActiveOptions(Ce);if(De.isLeaf===!1&&!De[xe.getFieldName("children")]&&ge){oe&&xe.handleChange(je,{visible:!0},Le),xe.setState({activeValue:Ce}),ge(je);return}var Ve={};!De[xe.getFieldName("children")]||!De[xe.getFieldName("children")].length?(xe.handleChange(je,{visible:!1},Le),Ve.value=Ce):oe&&(Le.type==="click"||Le.type==="keydown")&&(Se==="hover"?xe.handleChange(je,{visible:!1},Le):xe.handleChange(je,{visible:!0},Le),Ve.value=Ce),Ve.activeValue=Ce,("value"in xe.props||Le.type==="keydown"&&Le.keyCode!==F.a.ENTER)&&delete Ve.value,xe.setState(Ve)},xe.handleItemDoubleClick=function(){var De=xe.props.changeOnSelect;De&&xe.setPopupVisible(!1)},xe.handleKeyDown=function(De){var Ge=xe.props.children;if(Ge&&Ge.props.onKeyDown){Ge.props.onKeyDown(De);return}var Le=w(xe.state.activeValue),Fe=Le.length-1<0?0:Le.length-1,We=xe.getCurrentLevelOptions(),oe=We.map(function(je){return je[xe.getFieldName("value")]}).indexOf(Le[Fe]);if(De.keyCode!==F.a.DOWN&&De.keyCode!==F.a.UP&&De.keyCode!==F.a.LEFT&&De.keyCode!==F.a.RIGHT&&De.keyCode!==F.a.ENTER&&De.keyCode!==F.a.SPACE&&De.keyCode!==F.a.BACKSPACE&&De.keyCode!==F.a.ESC&&De.keyCode!==F.a.TAB)return;if(!xe.state.popupVisible&&De.keyCode!==F.a.BACKSPACE&&De.keyCode!==F.a.LEFT&&De.keyCode!==F.a.RIGHT&&De.keyCode!==F.a.ESC&&De.keyCode!==F.a.TAB){xe.setPopupVisible(!0);return}if(De.keyCode===F.a.DOWN||De.keyCode===F.a.UP){De.preventDefault();var ge=oe;ge!==-1?De.keyCode===F.a.DOWN?(ge+=1,ge=ge>=We.length?0:ge):(ge-=1,ge=ge<0?We.length-1:ge):ge=0,Le[Fe]=We[ge][xe.getFieldName("value")]}else if(De.keyCode===F.a.LEFT||De.keyCode===F.a.BACKSPACE)De.preventDefault(),Le.splice(Le.length-1,1);else if(De.keyCode===F.a.RIGHT)De.preventDefault(),We[oe]&&We[oe][xe.getFieldName("children")]&&Le.push(We[oe][xe.getFieldName("children")][0][xe.getFieldName("value")]);else if(De.keyCode===F.a.ESC||De.keyCode===F.a.TAB){xe.setPopupVisible(!1);return}(!Le||Le.length===0)&&xe.setPopupVisible(!1);var Se=xe.getActiveOptions(Le),Ce=Se[Se.length-1];xe.handleMenuSelect(Ce,Se.length-1,De),xe.props.onKeyDown&&xe.props.onKeyDown(De)},xe.saveTrigger=function(De){xe.trigger=De};var Pe=[];return"value"in Oe?Pe=Oe.value||[]:"defaultValue"in Oe&&(Pe=Oe.defaultValue||[]),X()(!("filedNames"in Oe),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),xe.state={popupVisible:Oe.popupVisible,activeValue:Pe,value:Pe,prevProps:Oe},xe.defaultFieldNames={label:"label",value:"value",children:"children"},xe}return O(ae,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(xe){var Pe=this.defaultFieldNames,De=this.props,Ge=De.fieldNames,Le=De.filedNames;return"filedNames"in this.props?Le[xe]||Pe[xe]:Ge[xe]||Pe[xe]}},{key:"getFieldNames",value:function(){var xe=this.props,Pe=xe.fieldNames,De=xe.filedNames;return"filedNames"in this.props?De:Pe}},{key:"getCurrentLevelOptions",value:function(){var xe=this,Pe=this.props.options,De=Pe===void 0?[]:Pe,Ge=this.state.activeValue,Le=Ge===void 0?[]:Ge,Fe=G()(De,function(We,oe){return We[xe.getFieldName("value")]===Le[oe]},{childrenKeyName:this.getFieldName("children")});return Fe[Fe.length-2]?Fe[Fe.length-2][this.getFieldName("children")]:w(De).filter(function(We){return!We.disabled})}},{key:"getActiveOptions",value:function(xe){var Pe=this;return G()(this.props.options||[],function(De,Ge){return De[Pe.getFieldName("value")]===xe[Ge]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var xe=this.props,Pe=xe.prefixCls,De=xe.transitionName,Ge=xe.popupClassName,Le=xe.options,Fe=Le===void 0?[]:Le,We=xe.disabled,oe=xe.builtinPlacements,ge=xe.popupPlacement,Se=xe.children,Ce=xe.dropdownRender,je=R(xe,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),Ve=ie.createElement("div",null),Qe="";Fe&&Fe.length>0?Ve=ie.createElement(A,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):Qe=" ".concat(Pe,"-menus-empty");var Je=Ve;return Ce&&(Je=Ce(Ve)),ie.createElement($.a,Object.assign({ref:this.saveTrigger},je,{popupPlacement:ge,builtinPlacements:oe,popupTransitionName:De,action:We?[]:["click"],popupVisible:We?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(Pe,"-menus"),popupClassName:Ge+Qe,popup:Je}),ie.cloneElement(Se,{onKeyDown:this.handleKeyDown,tabIndex:We?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(xe,Pe){var De=Pe.prevProps,Ge=De===void 0?{}:De,Le={prevProps:xe};return"value"in xe&&!W(Ge.value,xe.value)&&(Le.value=xe.value||[],"loadData"in xe||(Le.activeValue=xe.value||[])),"popupVisible"in xe&&(Le.popupVisible=xe.popupVisible),Le}}]),ae}(ie.Component);return ce.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:S,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},ce}(),we=ke,Ae=be.a=we},SJMd:function(st,be){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var Q,ie,$,M=!1,X,F;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"],m=[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"],p=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],l=[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"],u="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"],o="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"],s=[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"],a=[i,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[m,l,p,f,o,h,s,a],_=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",L="kwd",R="com",C="typ",w="lit",x="pun",c="pln",T="tag",y="dec",v="src",N="atn",B="atv",O="nocode",j="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function P(Le){for(var Fe=0,We=!1,oe=!1,ge=0,Se=Le.length;ge<Se;++ge){var Ce=Le[ge];if(Ce.ignoreCase)oe=!0;else if(/[a-z]/i.test(Ce.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){We=!0,oe=!1;break}}var je={b:8,t:9,n:10,v:11,f:12,r:13};function Ve(qe){var Ne=qe.charCodeAt(0);if(Ne!==92)return Ne;var lt=qe.charAt(1);return Ne=je[lt],Ne||("0"<=lt&<<="7"?parseInt(qe.substring(1),8):lt==="u"||lt==="x"?parseInt(qe.substring(2),16):qe.charCodeAt(1))}function Qe(qe){if(qe<32)return(qe<16?"\\x0":"\\x")+qe.toString(16);var Ne=String.fromCharCode(qe);return Ne==="\\"||Ne==="-"||Ne==="]"||Ne==="^"?"\\"+Ne:Ne}function Je(qe){var Ne=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")),lt=[],nt=Ne[0]==="^",Be=["["];nt&&Be.push("^");for(var Ue=nt?1:0,Te=Ne.length;Ue<Te;++Ue){var ve=Ne[Ue];if(/\\[bdsw]/i.test(ve))Be.push(ve);else{var _e=Ve(ve),re;Ue+2<Te&&Ne[Ue+1]==="-"?(re=Ve(Ne[Ue+2]),Ue+=2):re=_e,lt.push([_e,re]),re<65||_e>122||(re<65||_e>90||lt.push([Math.max(65,_e)|32,Math.min(re,90)|32]),re<97||_e>122||lt.push([Math.max(97,_e)&~32,Math.min(re,122)&~32]))}}lt.sort(function(Ee,Me){return Ee[0]-Me[0]||Me[1]-Ee[1]});for(var ne=[],he=[],Ue=0;Ue<lt.length;++Ue){var fe=lt[Ue];fe[0]<=he[1]+1?he[1]=Math.max(he[1],fe[1]):ne.push(he=fe)}for(var Ue=0;Ue<ne.length;++Ue){var fe=ne[Ue];Be.push(Qe(fe[0])),fe[1]>fe[0]&&(fe[1]+1>fe[0]&&Be.push("-"),Be.push(Qe(fe[1])))}return Be.push("]"),Be.join("")}function at(qe){for(var Ne=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")),lt=Ne.length,nt=[],Be=0,Ue=0;Be<lt;++Be){var Te=Ne[Be];if(Te==="(")++Ue;else if(Te.charAt(0)==="\\"){var ve=+Te.substring(1);ve&&(ve<=Ue?nt[ve]=-1:Ne[Be]=Qe(ve))}}for(var Be=1;Be<nt.length;++Be)nt[Be]===-1&&(nt[Be]=++Fe);for(var Be=0,Ue=0;Be<lt;++Be){var Te=Ne[Be];if(Te==="(")++Ue,nt[Ue]||(Ne[Be]="(?:");else if(Te.charAt(0)==="\\"){var ve=+Te.substring(1);ve&&ve<=Ue&&(Ne[Be]="\\"+nt[ve])}}for(var Be=0;Be<lt;++Be)Ne[Be]==="^"&&Ne[Be+1]!=="^"&&(Ne[Be]="");if(qe.ignoreCase&&We)for(var Be=0;Be<lt;++Be){var Te=Ne[Be],_e=Te.charAt(0);Te.length>=2&&_e==="["?Ne[Be]=Je(Te):_e!=="\\"&&(Ne[Be]=Te.replace(/[a-zA-Z]/g,function(he){var fe=he.charCodeAt(0);return"["+String.fromCharCode(fe&~32,fe|32)+"]"}))}return Ne.join("")}for(var Xe=[],ge=0,Se=Le.length;ge<Se;++ge){var Ce=Le[ge];if(Ce.global||Ce.multiline)throw new Error(""+Ce);Xe.push("(?:"+at(Ce)+")")}return new RegExp(Xe.join("|"),oe?"gi":"g")}function b(Le,Fe){var We=/(?:^|\s)nocode(?:\s|$)/,oe=[],ge=0,Se=[],Ce=0;function je(Ve){var Qe=Ve.nodeType;if(Qe==1){if(We.test(Ve.className))return;for(var Je=Ve.firstChild;Je;Je=Je.nextSibling)je(Je);var at=Ve.nodeName.toLowerCase();(at==="br"||at==="li")&&(oe[Ce]=`
|
|
`,Se[Ce<<1]=ge++,Se[Ce++<<1|1]=Ve)}else if(Qe==3||Qe==4){var Xe=Ve.nodeValue;Xe.length&&(Fe?Xe=Xe.replace(/\r\n?/g,`
|
|
`):Xe=Xe.replace(/[ \t\r\n]+/g," "),oe[Ce]=Xe,Se[Ce<<1]=ge,ge+=Xe.length,Se[Ce++<<1|1]=Ve)}}return je(Le),{sourceCode:oe.join("").replace(/\n$/,""),spans:Se}}function Y(Le,Fe,We,oe,ge){if(!We)return;var Se={sourceNode:Le,pre:1,langExtension:null,numberLines:null,sourceCode:We,spans:null,basePos:Fe,decorations:null};oe(Se),ge.push.apply(ge,Se.decorations)}var ee=/\S/;function le(Le){for(var Fe=void 0,We=Le.firstChild;We;We=We.nextSibling){var oe=We.nodeType;Fe=oe===1?Fe?Le:We:oe===3&&ee.test(We.nodeValue)?Le:Fe}return Fe===Le?void 0:Fe}function ue(Le,Fe){var We={},oe;(function(){for(var Ce=Le.concat(Fe),je=[],Ve={},Qe=0,Je=Ce.length;Qe<Je;++Qe){var at=Ce[Qe],Xe=at[3];if(Xe)for(var qe=Xe.length;--qe>=0;)We[Xe.charAt(qe)]=at;var Ne=at[1],lt=""+Ne;Ve.hasOwnProperty(lt)||(je.push(Ne),Ve[lt]=null)}je.push(/[\0-\uffff]/),oe=P(je)})();var ge=Fe.length,Se=function(Ce){for(var je=Ce.sourceCode,Ve=Ce.basePos,Qe=Ce.sourceNode,Je=[Ve,c],at=0,Xe=je.match(oe)||[],qe={},Ne=0,lt=Xe.length;Ne<lt;++Ne){var nt=Xe[Ne],Be=qe[nt],Ue=void 0,Te;if(typeof Be=="string")Te=!1;else{var ve=We[nt.charAt(0)];if(ve)Ue=nt.match(ve[1]),Be=ve[0];else{for(var _e=0;_e<ge;++_e)if(ve=Fe[_e],Ue=nt.match(ve[1]),Ue){Be=ve[0];break}Ue||(Be=c)}Te=Be.length>=5&&Be.substring(0,5)==="lang-",Te&&!(Ue&&typeof Ue[1]=="string")&&(Te=!1,Be=v),Te||(qe[nt]=Be)}var re=at;if(at+=nt.length,!Te)Je.push(Ve+re,Be);else{var ne=Ue[1],he=nt.indexOf(ne),fe=he+ne.length;Ue[2]&&(fe=nt.length-Ue[2].length,he=fe-ne.length);var Ee=Be.substring(5);Y(Qe,Ve+re,nt.substring(0,he),Se,Je),Y(Qe,Ve+re+he,ne,ae(Ee,ne),Je),Y(Qe,Ve+re+fe,nt.substring(fe),Se,Je)}}Ce.decorations=Je};return Se}function ke(Le){var Fe=[],We=[];Le.tripleQuotedStrings?Fe.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Le.multiLineStrings?Fe.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Fe.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Le.verbatimStrings&&We.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var oe=Le.hashComments;oe&&(Le.cStyleComments?(oe>1?Fe.push([R,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Fe.push([R,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),We.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Fe.push([R,/^#[^\r\n]*/,null,"#"])),Le.cStyleComments&&(We.push([R,/^\/\/[^\r\n]*/,null]),We.push([R,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ge=Le.regexLiterals;if(ge){var Se=ge>1?"":`
|
|
\r`,Ce=Se?".":"[\\S\\s]",je="/(?=[^/*"+Se+"])(?:[^/\\x5B\\x5C"+Se+"]|\\x5C"+Ce+"|\\x5B(?:[^\\x5C\\x5D"+Se+"]|\\x5C"+Ce+")*(?:\\x5D|$))+/";We.push(["lang-regex",RegExp("^"+j+"("+je+")")])}var Ve=Le.types;Ve&&We.push([C,Ve]);var Qe=(""+Le.keywords).replace(/^ | $/g,"");Qe.length&&We.push([L,new RegExp("^(?:"+Qe.replace(/[\s,]+/g,"|")+")\\b"),null]),Fe.push([c,/^\s+/,null,` \r
|
|
\xA0`]);var Je="^.[^\\s\\w.$@'\"`/\\\\]*";return Le.regexLiterals&&(Je+="(?!s*/)"),We.push([w,/^@[a-z_$][a-z_$@0-9]*/i,null],[C,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[w,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[x,new RegExp(Je),null]),ue(Fe,We)}var we=ke({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ae(Le,Fe,We){for(var oe=/(?:^|\s)nocode(?:\s|$)/,ge=/\r\n?|\n/,Se=Le.ownerDocument,Ce=Se.createElement("li");Le.firstChild;)Ce.appendChild(Le.firstChild);var je=[Ce];function Ve(Ne){var lt=Ne.nodeType;if(lt==1&&!oe.test(Ne.className))if(Ne.nodeName==="br")Qe(Ne),Ne.parentNode&&Ne.parentNode.removeChild(Ne);else for(var nt=Ne.firstChild;nt;nt=nt.nextSibling)Ve(nt);else if((lt==3||lt==4)&&We){var Be=Ne.nodeValue,Ue=Be.match(ge);if(Ue){var Te=Be.substring(0,Ue.index);Ne.nodeValue=Te;var ve=Be.substring(Ue.index+Ue[0].length);if(ve){var _e=Ne.parentNode;_e.insertBefore(Se.createTextNode(ve),Ne.nextSibling)}Qe(Ne),Te||Ne.parentNode.removeChild(Ne)}}}function Qe(Ne){for(;!Ne.nextSibling;)if(Ne=Ne.parentNode,!Ne)return;function lt(Ue,Te){var ve=Te?Ue.cloneNode(!1):Ue,_e=Ue.parentNode;if(_e){var re=lt(_e,1),ne=Ue.nextSibling;re.appendChild(ve);for(var he=ne;he;he=ne)ne=he.nextSibling,re.appendChild(he)}return ve}for(var nt=lt(Ne.nextSibling,0),Be;(Be=nt.parentNode)&&Be.nodeType===1;)nt=Be;je.push(nt)}for(var Je=0;Je<je.length;++Je)Ve(je[Je]);Fe===(Fe|0)&&je[0].setAttribute("value",Fe);var at=Se.createElement("ol");at.className="linenums";for(var Xe=Math.max(0,Fe-1|0)||0,Je=0,qe=je.length;Je<qe;++Je)Ce=je[Je],Ce.className="L"+(Je+Xe)%10,Ce.firstChild||Ce.appendChild(Se.createTextNode("\xA0")),at.appendChild(Ce);Le.appendChild(at)}function ce(Le){var Fe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Fe=Fe&&+Fe[1]<=8;var We=/\n/g,oe=Le.sourceCode,ge=oe.length,Se=0,Ce=Le.spans,je=Ce.length,Ve=0,Qe=Le.decorations,Je=Qe.length,at=0;Qe[Je]=ge;var Xe,qe;for(qe=Xe=0;qe<Je;)Qe[qe]!==Qe[qe+2]?(Qe[Xe++]=Qe[qe++],Qe[Xe++]=Qe[qe++]):qe+=2;for(Je=Xe,qe=Xe=0;qe<Je;){for(var Ne=Qe[qe],lt=Qe[qe+1],nt=qe+2;nt+2<=Je&&Qe[nt+1]===lt;)nt+=2;Qe[Xe++]=Ne,Qe[Xe++]=lt,qe=nt}Je=Qe.length=Xe;var Be=Le.sourceNode,Ue="";Be&&(Ue=Be.style.display,Be.style.display="none");try{for(var Te=null;Ve<je;){var ve=Ce[Ve],_e=Ce[Ve+2]||ge,re=Qe[at+2]||ge,nt=Math.min(_e,re),ne=Ce[Ve+1],he;if(ne.nodeType!==1&&(he=oe.substring(Se,nt))){Fe&&(he=he.replace(We,"\r")),ne.nodeValue=he;var fe=ne.ownerDocument,Ee=fe.createElement("span");Ee.className=Qe[at+1];var Me=ne.parentNode;Me.replaceChild(Ee,ne),Ee.appendChild(ne),Se<_e&&(Ce[Ve+1]=ne=fe.createTextNode(oe.substring(nt,_e)),Me.insertBefore(ne,Ee.nextSibling))}Se=nt,Se>=_e&&(Ve+=2),Se>=re&&(at+=2)}}finally{Be&&(Be.style.display=Ue)}}var pe={};function se(Le,Fe){for(var We=Fe.length;--We>=0;){var oe=Fe[We];pe.hasOwnProperty(oe)?W.console&&console.warn("cannot override language handler %s",oe):pe[oe]=Le}}function ae(Le,Fe){return Le&&pe.hasOwnProperty(Le)||(Le=/^\s*</.test(Fe)?"default-markup":"default-code"),pe[Le]}se(we,["default-code"]),se(ue([],[[c,/^[^<?]+/],[y,/^<!\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"]),se(ue([[c,/^[\s]+/,null,` \r
|
|
`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[T,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!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"]),se(ue([],[[B,/^[\s\S]+/]]),["uq.val"]),se(ke({keywords:m,hashComments:!0,cStyleComments:!0,types:_}),["c","cc","cpp","cxx","cyc","m"]),se(ke({keywords:"null,true,false"}),["json"]),se(ke({keywords:l,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:_}),["cs"]),se(ke({keywords:p,cStyleComments:!0}),["java"]),se(ke({keywords:a,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),se(ke({keywords:h,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),se(ke({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),se(ke({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),se(ke({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),se(ke({keywords:u,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),se(ue([],[[S,/^[\s\S]+/]]),["regex"]);function Oe(Le){var Fe=Le.langExtension;try{var We=b(Le.sourceNode,Le.pre),oe=We.sourceCode;Le.sourceCode=oe,Le.spans=We.spans,Le.basePos=0,ae(Fe,oe)(Le),ce(Le)}catch(ge){W.console&&console.log(ge&&ge.stack||ge)}}function xe(Le,Fe,We){var oe=We||!1,ge=Fe||null,Se=document.createElement("div");Se.innerHTML="<pre>"+Le+"</pre>",Se=Se.firstChild,oe&&Ae(Se,oe,!0);var Ce={langExtension:ge,numberLines:oe,sourceNode:Se,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Oe(Ce),Se.innerHTML}function Pe(Le,Fe){var We=Fe||document.body,oe=We.ownerDocument||document;function ge(ve){return We.getElementsByTagName(ve)}for(var Se=[ge("pre"),ge("code"),ge("xmp")],Ce=[],je=0;je<Se.length;++je)for(var Ve=0,Qe=Se[je].length;Ve<Qe;++Ve)Ce.push(Se[je][Ve]);Se=null;var Je=Date;Je.now||(Je={now:function(){return+new Date}});var at=0,Xe=/\blang(?:uage)?-([\w.]+)(?!\S)/,qe=/\bprettyprint\b/,Ne=/\bprettyprinted\b/,lt=/pre|xmp/i,nt=/^code$/i,Be=/^(?:pre|code|xmp)$/i,Ue={};function Te(){for(var ve=W.PR_SHOULD_USE_CONTINUATION?Je.now()+250:Infinity;at<Ce.length&&Je.now()<ve;at++){for(var _e=Ce[at],re=Ue,ne=_e;ne=ne.previousSibling;){var he=ne.nodeType,fe=(he===7||he===8)&&ne.nodeValue;if(fe?!/^\??prettify\b/.test(fe):he!==3||/\S/.test(ne.nodeValue))break;if(fe){re={},fe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Qt,It,Ci){re[It]=Ci});break}}var Ee=_e.className;if((re!==Ue||qe.test(Ee))&&!Ne.test(Ee)){for(var Me=!1,ze=_e.parentNode;ze;ze=ze.parentNode){var ot=ze.tagName;if(Be.test(ot)&&ze.className&&qe.test(ze.className)){Me=!0;break}}if(!Me){_e.className+=" prettyprinted";var mt=re.lang;if(!mt){mt=Ee.match(Xe);var ft;!mt&&(ft=le(_e))&&nt.test(ft.tagName)&&(mt=ft.className.match(Xe)),mt&&(mt=mt[1])}var wt;if(lt.test(_e.tagName))wt=1;else{var St=_e.currentStyle,dt=oe.defaultView,Ut=St?St.whiteSpace:dt&&dt.getComputedStyle?dt.getComputedStyle(_e,null).getPropertyValue("white-space"):0;wt=Ut&&Ut.substring(0,3)==="pre"}var Lt=re.linenums;(Lt=Lt==="true"||+Lt)||(Lt=Ee.match(/\blinenums\b(?::(\d+))?/),Lt=Lt?Lt[1]&&Lt[1].length?+Lt[1]:!0:!1),Lt&&Ae(_e,Lt,wt);var qt={langExtension:mt,sourceNode:_e,numberLines:Lt,pre:wt,sourceCode:null,basePos:null,spans:null,decorations:null};Oe(qt)}}}at<Ce.length?W.setTimeout(Te,250):typeof Le=="function"&&Le()}Te()}var De=W.PR={createSimpleLexer:ue,registerLangHandler:se,sourceDecorator:ke,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:B,PR_COMMENT:R,PR_DECLARATION:y,PR_KEYWORD:L,PR_LITERAL:w,PR_NOCODE:O,PR_PLAIN:c,PR_PUNCTUATION:x,PR_SOURCE:v,PR_STRING:S,PR_TAG:T,PR_TYPE:C,prettyPrintOne:M?W.prettyPrintOne=xe:U=xe,prettyPrint:G=M?W.prettyPrint=Pe:G=Pe},Ge=W.define;typeof Ge=="function"&&Ge.amd&&Ge("google-code-prettify",[],function(){return De})})()},T8No:function(st,be,Q){"use strict";Q.d(be,"a",function(){return G}),Q.d(be,"e",function(){return W}),Q.d(be,"c",function(){return x}),Q.d(be,"b",function(){return c}),Q.d(be,"d",function(){return T}),Q.d(be,"f",function(){return N});var ie=Q("MNsG"),$=Q("N0LK"),M=Q("Cg/j");let X=ie.k||"";const F=new Map;F.set("false",!1),F.set("true",!0),F.set("isMac",ie.f),F.set("isLinux",ie.d),F.set("isWindows",ie.i),F.set("isWeb",ie.h),F.set("isMacNative",ie.f&&!ie.h),F.set("isEdge",X.indexOf("Edg/")>=0),F.set("isFirefox",X.indexOf("Firefox")>=0),F.set("isChrome",X.indexOf("Chrome")>=0),F.set("isSafari",X.indexOf("Safari")>=0);const U=Object.prototype.hasOwnProperty;class G{static has(O){return m.create(O)}static equals(O,j){return p.create(O,j)}static regex(O,j){return S.create(O,j)}static not(O){return o.create(O)}static and(...O){return C.create(O,null)}static or(...O){return w.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 w.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 p.create(P[0].trim(),this._deserializeValue(P[1],j))}if(O.indexOf("=~")>=0){let P=O.split("=~");return S.create(P[0].trim(),this._deserializeRegexValue(P[1],j))}if(O.indexOf(" in ")>=0){let P=O.split(" in ");return l.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(O)){const P=O.split(">=");return a.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 _.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)?o.create(O.substr(1).trim()):m.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(le){if(j)throw new Error(`bad regexp-value '${O}', parse error: ${le}`);return console.warn(`bad regexp-value '${O}', parse error: ${le}`),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 m{constructor(O,j){this.key=O,this.negated=j,this.type=2}static create(O,j=null){const P=F.get(O);return typeof P=="boolean"?P?g.INSTANCE:D.INSTANCE:new m(O,j)}cmp(O){return O.type!==this.type?this.type-O.type:y(this.key,O.key)}equals(O){return O.type===this.type?this.key===O.key:!1}substituteConstants(){const O=F.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=o.create(this.key,this)),this.negated}}class p{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?m.create(O,P):o.create(O,P);const b=F.get(O);if(typeof b=="boolean"){const Y=b?"true":"false";return j===Y?g.INSTANCE:D.INSTANCE}return new p(O,j,P)}cmp(O){return O.type!==this.type?this.type-O.type:v(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=F.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 l{constructor(O,j){this.key=O,this.valueKey=j,this.type=10,this.negated=null}static create(O,j){return new l(O,j)}cmp(O){return O.type!==this.type?this.type-O.type:v(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=u.create(this)),this.negated}}class u{constructor(O){this._actual=O,this.type=11}static create(O){return new u(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?o.create(O,P):m.create(O,P);const b=F.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:v(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=F.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=p.create(this.key,this.value,this)),this.negated}}class o{constructor(O,j){this.key=O,this.negated=j,this.type=3}static create(O,j=null){const P=F.get(O);return typeof P=="boolean"?P?D.INSTANCE:g.INSTANCE:new o(O,j)}cmp(O){return O.type!==this.type?this.type-O.type:y(this.key,O.key)}equals(O){return O.type===this.type?this.key===O.key:!1}substituteConstants(){const O=F.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=m.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 s{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 s(O,b,P))}cmp(O){return O.type!==this.type?this.type-O.type:v(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 a{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 a(O,b,P))}cmp(O){return O.type!==this.type?this.type-O.type:v(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:v(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 _{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:v(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 S{constructor(O,j){this.key=O,this.regexp=j,this.type=7,this.negated=null}static create(O,j){return new S(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(),le=P.length===0,ue=w.create(Y.expr.map(ke=>C.create([ke,ee],null)),null,le);ue&&(P.push(ue),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=w.create(O,this,!0)}return this.negated}}class w{constructor(O,j){this.expr=O,this.negated=j,this.type=9}static create(O,j,P){return w._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:w.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,le=O.length;ee<le;ee++){const ue=O[ee];if(!ue)continue;if(ue.type===0){Y=!0;continue}if(ue.type===1)return g.INSTANCE;if(ue.type===9){b=b.concat(ue.expr);continue}b.push(ue)}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 le=ee+1;le<b.length;le++)N(b[ee],b[le])&&(b.splice(le,1),le--);if(b.length===1)return b[0]}return new w(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 le of B(P))b.push(C.create([ee,le],null));const Y=O.length===0;O.unshift(w.create(b,null,Y))}this.negated=O[0]}return this.negated}}class x extends m{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 p.create(this.key,O)}}x._info=[];const c=Object(M.c)("contextKeyService"),T="setContext";function y(O,j){return O<j?-1:O>j?1:0}function v(O,j,P,b){return O<P?-1:O>P?1:j<b?-1:j>b?1:0}function N(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],le=ee.negate();for(let ue=Y+1;ue<b.length;ue++){const ke=b[ue];if(le.equals(ke))return!0}}return!1}function B(O){return O.type===9?O.expr:[O]}},TXwP:function(st,be,Q){var ie,$;(function(){var M;(function(){"use strict";var F=[,,function(i){function D(p){this.__parent=p,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 p=new D(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},D.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},D.prototype.has_match=function(p){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(p))return!0;return!1},D.prototype.set_indent=function(p,l){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=l||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 p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__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(p){this.__items.push(p);var l=p.lastIndexOf(`
|
|
`);l!==-1?this.__character_count=p.length-l:this.__character_count+=p.length},D.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},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 p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function g(p,l){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),l=l||"",p.indent_level>0&&(l=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}g.prototype.get_indent_size=function(p,l){var u=this.__base_string_length;return l=l||0,p<0&&(u=0),u+=p*this.__indent_size,u+=l,u},g.prototype.get_indent_string=function(p,l){var u=this.__base_string;return l=l||0,p<0&&(p=0,u=""),l+=p*this.__indent_size,this.__ensure_cache(l),u+=this.__cache[l],u},g.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var p=this.__cache.length,l=0,u="";this.__indent_size&&p>=this.__indent_size&&(l=Math.floor(p/this.__indent_size),p-=l*this.__indent_size,u=new Array(l+1).join(this.__indent_string)),p&&(u+=new Array(p+1).join(" ")),this.__cache.push(u)};function m(p,l){this.__indent_cache=new g(p,l),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.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()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,l){return this.__indent_cache.get_indent_string(p,l)},m.prototype.get_indent_size=function(p,l){return this.__indent_cache.get_indent_size(p,l)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
|
|
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var u=this.__lines.join(`
|
|
`);return p!==`
|
|
`&&(u=u.replace(/[\n]/g,p)),u},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,l){return p=p||0,l=l||0,this.next_line.set_indent(p,l),this.__lines.length>1?(this.current_line.set_indent(p,l),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var l=0;l<p.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.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(" "))},m.prototype.remove_indent=function(p){for(var l=this.__lines.length;p<l;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&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},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,l){for(var u=this.__lines.length-2;u>=0;){var f=this.__lines[u];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==l){this.__lines.splice(u+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},i.exports.Output=m},,,,function(i){function D(p,l){this.raw_options=g(p,l),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(p,l){var u=this.raw_options[p],f=l||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(f=u.concat()):typeof u=="string"&&(f=u.split(/[^a-zA-Z0-9_\/\-]+/)),f},D.prototype._get_boolean=function(p,l){var u=this.raw_options[p],f=u===void 0?!!l:!!u;return f},D.prototype._get_characters=function(p,l){var u=this.raw_options[p],f=l||"";return typeof u=="string"&&(f=u.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),f},D.prototype._get_number=function(p,l){var u=this.raw_options[p];l=parseInt(l,10),isNaN(l)&&(l=0);var f=parseInt(u,10);return isNaN(f)&&(f=l),f},D.prototype._get_selection=function(p,l,u){var f=this._get_selection_list(p,l,u);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
|
|
`+l+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f[0]},D.prototype._get_selection_list=function(p,l,u){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(u=u||[l[0]],!this._is_valid_selection(u,l))throw new Error("Invalid Default Value!");var f=this._get_array(p,u);if(!this._is_valid_selection(f,l))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
|
|
`+l+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f},D.prototype._is_valid_selection=function(p,l){return p.length&&l.length&&!p.some(function(u){return l.indexOf(u)===-1})};function g(p,l){var u={};p=m(p);var f;for(f in p)f!==l&&(u[f]=p[f]);if(l&&p[l])for(f in p[l])u[f]=p[l][f];return u}function m(p){var l={},u;for(u in p){var f=u.replace(/-/g,"_");l[f]=p[u]}return l}i.exports.Options=D,i.exports.normalizeOpts=m,i.exports.mergeOpts=g},,function(i){var D=RegExp.prototype.hasOwnProperty("sticky");function g(m){this.__input=m||"",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 m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},g.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},g.prototype.__match=function(m,p){m.lastIndex=p;var l=m.exec(this.__input);return l&&!(D&&m.sticky)&&(l.index!==p&&(l=null)),l},g.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},g.prototype.testChar=function(m,p){var l=this.peek(p);return m.lastIndex=0,l!==null&&m.test(l)},g.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},g.prototype.read=function(m,p,l){var u="",f;return m&&(f=this.match(m),f&&(u+=f[0])),p&&(f||!m)&&(u+=this.readUntil(p,l)),u},g.prototype.readUntil=function(m,p){var l="",u=this.__position;m.lastIndex=this.__position;var f=m.exec(this.__input);return f?(u=f.index,p&&(u+=f[0].length)):u=this.__input_length,l=this.__input.substring(this.__position,u),this.__position=u,l},g.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},g.prototype.get_regexp=function(m,p){var l=null,u="g";return p&&D&&(u="y"),typeof m=="string"&&m!==""?l=new RegExp(m,u):m&&(l=new RegExp(m.source,u)),l},g.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(m){var p=this.__position,l=this.readUntilAfter(m);return this.__position=p,l},g.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},i.exports.InputScanner=g},,,,,function(i){function D(g,m){g=typeof g=="string"?g:g.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+m,"g")}D.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(g);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(g);return m},D.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=D},,function(i,D,g){var m=g(16).Beautifier,p=g(17).Options;function l(u,f){var o=new m(u,f);return o.beautify()}i.exports=l,i.exports.defaultOptions=function(){return new p}},function(i,D,g){var m=g(17).Options,p=g(2).Output,l=g(8).InputScanner,u=g(13).Directives,f=new u(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,h=/\r\n|[\r\n]/g,s=/\s/,a=/(?:\s|\n)+/g,A=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,_=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(L,R){this._source_text=L||"",this._options=new m(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"]}S.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},S.prototype.eatWhitespace=function(L){for(var R=s.test(this._input.peek()),C=0;s.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},S.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},S.prototype.print_string=function(L){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(L)},S.prototype.preserveSingleSpace=function(L){L&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var L=this._source_text,R=this._options.eol;R==="auto"&&(R=`
|
|
`,L&&o.test(L||"")&&(R=L.match(o)[0])),L=L.replace(h,`
|
|
`);var C=L.match(/^[\t ]*/)[0];this._output=new p(this._options,C),this._input=new l(L),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var w=0,x=!1,c=!1,T=!1,y=!1,v=!1,N=!1,B=this._ch,O=!1,j,P,b;j=this._input.read(a),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 le=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);le.match(/[ :]$/)&&(le=this.eatString(": ").replace(/\s$/,""),this.print_string(le),this._output.space_before_token=!0),le=le.replace(/\s$/,""),le==="extend"?y=!0:le==="import"&&(v=!0),le in this.NESTED_AT_RULE?(this._nestedLevel+=1,le in this.CONDITIONAL_GROUP_RULE&&(T=!0)):!x&&w===0&&le.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(P),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!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),v=!1,y=!1,c&&(this.outdent(),c=!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 ue=0;ue<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ue++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ue])){O=!0;break}(x||T)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!y&&w===0?(this.print_string(":"),c||(c=!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 ke=b==='"'||b==="'";this.preserveSingleSpace(ke||P),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")O=!1,w===0?(c&&(this.outdent(),c=!1),y=!1,v=!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(),w++,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(")")),w&&(w--,this.outdent()));else{var we=!1;this._input.lookBack("with")&&(we=!0),this.preserveSingleSpace(P||we),this.print_string(this._ch),c&&b==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),N=!0):(this.eatWhitespace(),w++,this.indent())}else if(this._ch===")")w&&(w--,this.outdent()),N&&this._input.peek()===";"&&this._options.selector_separator_newline&&(N=!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&&(!c||N)&&w===0&&!v&&!y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&w===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&&s.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("="),s.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 Ae=b==='"'||b==="'";this.preserveSingleSpace(Ae||P),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&O&&this._output.add_new_line()}var ce=this._output.get_code(R);return ce},i.exports.Beautifier=S},function(i,D,g){var m=g(6).Options;function p(l){m.call(this,l,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var u=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||u;var f=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o<f.length;o++)f[o]!=="expand"?this.brace_style="collapse":this.brace_style=f[o]}p.prototype=new m,i.exports.Options=p}],U={};function G(i){var D=U[i];if(D!==void 0)return D.exports;var g=U[i]={exports:{}};return F[i](g,g.exports,G),g.exports}var W=G(15);M=W})();var X=M;!(ie=[],$=function(){return{css_beautify:X}}.apply(be,ie),$!==void 0&&(st.exports=$))})()},Vhoy:function(st,be,Q){"use strict";Q.d(be,"d",function(){return X}),Q.d(be,"e",function(){return F}),Q.d(be,"c",function(){return U}),Q.d(be,"b",function(){return G}),Q.d(be,"a",function(){return W});var ie=Q("MI8n");class ${constructor(){this._icons=new Map,this._onDidRegister=new ie.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 M=new $,X=M;function F(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,M.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(l){if(l instanceof G)return["codicon","codicon-"+l.id];const u=D.exec(l.id);if(!u)return g(G.error);let[,f,o]=u;const h=["codicon","codicon-"+f];return o&&h.push("codicon-modifier-"+o.substr(1)),h}i.asClassNameArray=g;function m(l){return g(l).join(" ")}i.asClassName=m;function p(l){return"."+g(l).join(".")}i.asCSSSelector=p})(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(st,be,Q){(function(ie,$){st.exports=$()})(this,function(){"use strict";var ie=navigator.userAgent,$=navigator.platform,M=/gecko\/\d/i.test(ie),X=/MSIE \d/.test(ie),F=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ie),U=/Edge\/(\d+)/.exec(ie),G=X||F||U,W=G&&(X?document.documentMode||6:+(U||F)[1]),i=!U&&/WebKit\//.test(ie),D=i&&/Qt\/\d+\.\d+/.test(ie),g=!U&&/Chrome\//.test(ie),m=/Opera\//.test(ie),p=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ie),u=/PhantomJS/.test(ie),f=!U&&/AppleWebKit/.test(ie)&&/Mobile\/\w+/.test(ie),o=/Android/.test(ie),h=f||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ie),s=f||/Mac/.test($),a=/\bCrOS\b/.test(ie),A=/win/i.test($),_=m&&ie.match(/Version\/(\d*\.\d*)/);_&&(_=Number(_[1])),_&&_>=15&&(m=!1,i=!0);var S=s&&(D||m&&(_==null||_<12.11)),L=M||G&&W>=9;function R(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var C=function(e,t){var n=e.className,r=R(t).exec(n);if(r){var d=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(d?r[1]+d:"")}};function w(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function x(e,t){return w(e).appendChild(t)}function c(e,t,n,r){var d=document.createElement(e);if(n&&(d.className=n),r&&(d.style.cssText=r),typeof t=="string")d.appendChild(document.createTextNode(t));else if(t)for(var k=0;k<t.length;++k)d.appendChild(t[k]);return d}function T(e,t,n,r){var d=c(e,t,n,r);return d.setAttribute("role","presentation"),d}var y;document.createRange?y=function(e,t,n,r){var d=document.createRange();return d.setEnd(r||e,n),d.setStart(e,t),d}:y=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(d){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function v(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 N(){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 n=e.className;R(t).test(n)||(e.className+=(n?" ":"")+t)}function O(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!R(n[r]).test(t)&&(t+=" "+n[r]);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,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Y(e,t,n,r,d){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var k=r||0,K=d||0;;){var J=e.indexOf(" ",k);if(J<0||J>=t)return K+(t-k);K+=J-k,K+=n-K%n,k=J+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 n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function le(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var ue=50,ke={toString:function(){return"CodeMirror.Pass"}},we={scroll:!1},Ae={origin:"*mouse"},ce={origin:"+move"};function pe(e,t,n){for(var r=0,d=0;;){var k=e.indexOf(" ",r);k==-1&&(k=e.length);var K=k-r;if(k==e.length||d+K>=t)return r+Math.min(K,t-d);if(d+=k-r,d+=n-d%n,r=k+1,d>=t)return r}}var se=[""];function ae(e){for(;se.length<=e;)se.push(Oe(se)+" ");return se[e]}function Oe(e){return e[e.length-1]}function xe(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Pe(e,t,n){for(var r=0,d=n(t);r<e.length&&n(e[r])<=d;)r++;e.splice(r,0,t)}function De(){}function Ge(e,t){var n;return Object.create?n=Object.create(e):(De.prototype=e,n=new De),t&&b(t,n),n}var Le=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Fe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Le.test(e))}function We(e,t){return t?t.source.indexOf("\\w")>-1&&Fe(e)?!0:t.test(e):Fe(e)}function oe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ge=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Se(e){return e.charCodeAt(0)>=768&&ge.test(e)}function Ce(e,t,n){for(;(n<0?t>0:t<e.length)&&Se(e.charAt(t));)t+=n;return t}function je(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var d=(t+n)/2,k=r<0?Math.ceil(d):Math.floor(d);if(k==t)return e(k)?t:n;e(k)?n=k:t=k+r}}function Ve(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var d=!1,k=0;k<e.length;++k){var K=e[k];(K.from<n&&K.to>t||t==n&&K.to==t)&&(r(Math.max(K.from,t),Math.min(K.to,n),K.level==1?"rtl":"ltr",k),d=!0)}d||r(t,n,"ltr")}var Qe=null;function Je(e,t,n){var r;Qe=null;for(var d=0;d<e.length;++d){var k=e[d];if(k.from<t&&k.to>t)return d;k.to==t&&(k.from!=k.to&&n=="before"?r=d:Qe=d),k.from==t&&(k.from!=k.to&&n!="before"?r=d:Qe=d)}return r!=null?r:Qe}var at=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,k=/[LRr]/,K=/[Lb1n]/,J=/[1n]/;function Z(te,de,me){this.level=te,this.from=de,this.to=me}return function(te,de){var me=de=="ltr"?"L":"R";if(te.length==0||de=="ltr"&&!r.test(te))return!1;for(var Ie=te.length,Re=[],He=0;He<Ie;++He)Re.push(n(te.charCodeAt(He)));for(var $e=0,et=me;$e<Ie;++$e){var it=Re[$e];it=="m"?Re[$e]=et:et=it}for(var ut=0,rt=me;ut<Ie;++ut){var ht=Re[ut];ht=="1"&&rt=="r"?Re[ut]="n":k.test(ht)&&(rt=ht,ht=="r"&&(Re[ut]="R"))}for(var Tt=1,vt=Re[0];Tt<Ie-1;++Tt){var Rt=Re[Tt];Rt=="+"&&vt=="1"&&Re[Tt+1]=="1"?Re[Tt]="1":Rt==","&&vt==Re[Tt+1]&&(vt=="1"||vt=="n")&&(Re[Tt]=vt),vt=Rt}for(var Xt=0;Xt<Ie;++Xt){var gi=Re[Xt];if(gi==",")Re[Xt]="N";else if(gi=="%"){var ei=void 0;for(ei=Xt+1;ei<Ie&&Re[ei]=="%";++ei);for(var Gi=Xt&&Re[Xt-1]=="!"||ei<Ie&&Re[ei]=="1"?"1":"N",Ni=Xt;Ni<ei;++Ni)Re[Ni]=Gi;Xt=ei-1}}for(var si=0,Fi=me;si<Ie;++si){var _i=Re[si];Fi=="L"&&_i=="1"?Re[si]="L":k.test(_i)&&(Fi=_i)}for(var hi=0;hi<Ie;++hi)if(d.test(Re[hi])){var oi=void 0;for(oi=hi+1;oi<Ie&&d.test(Re[oi]);++oi);for(var ii=(hi?Re[hi-1]:me)=="L",Bi=(oi<Ie?Re[oi]:me)=="L",un=ii==Bi?ii?"L":"R":me,Lr=hi;Lr<oi;++Lr)Re[Lr]=un;hi=oi-1}for(var Si=[],or,vi=0;vi<Ie;)if(K.test(Re[vi])){var Va=vi;for(++vi;vi<Ie&&K.test(Re[vi]);++vi);Si.push(new Z(0,Va,vi))}else{var fr=vi,Wr=Si.length,Gr=de=="rtl"?1:0;for(++vi;vi<Ie&&Re[vi]!="L";++vi);for(var Ri=fr;Ri<vi;)if(J.test(Re[Ri])){fr<Ri&&(Si.splice(Wr,0,new Z(1,fr,Ri)),Wr+=Gr);var hn=Ri;for(++Ri;Ri<vi&&J.test(Re[Ri]);++Ri);Si.splice(Wr,0,new Z(2,hn,Ri)),Wr+=Gr,fr=Ri}else++Ri;fr<vi&&Si.splice(Wr,0,new Z(1,fr,vi))}return de=="ltr"&&(Si[0].level==1&&(or=te.match(/^\s+/))&&(Si[0].from=or[0].length,Si.unshift(new Z(0,0,or[0].length))),Oe(Si).level==1&&(or=te.match(/\s+$/))&&(Oe(Si).to-=or[0].length,Si.push(new Z(0,Ie-or[0].length,Ie)))),de=="rtl"?Si.reverse():Si}}();function Xe(e,t){var n=e.order;return n==null&&(n=e.order=at(e.text,t)),n}var qe=[],Ne=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||qe).concat(n)}};function lt(e,t){return e._handlers&&e._handlers[t]||qe}function nt(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,d=r&&r[t];if(d){var k=le(d,n);k>-1&&(r[t]=d.slice(0,k).concat(d.slice(k+1)))}}}function Be(e,t){var n=lt(e,t);if(!n.length)return;for(var r=Array.prototype.slice.call(arguments,2),d=0;d<n.length;++d)n[d].apply(null,r)}function Ue(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Be(e,n||t.type,e,t),he(t)||t.codemirrorIgnore}function Te(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)le(n,t[r])==-1&&n.push(t[r])}function ve(e,t){return lt(e,t).length>0}function _e(e){e.prototype.on=function(t,n){Ne(this,t,n)},e.prototype.off=function(t,n){nt(this,t,n)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ne(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function he(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function fe(e){re(e),ne(e)}function Ee(e){return e.target||e.srcElement}function Me(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var ze=function(){if(G&&W<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),ot;function mt(e){if(ot==null){var t=c("span","\u200B");x(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ot=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&W<8))}var n=ot?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var ft;function wt(e){if(ft!=null)return ft;var t=x(e,document.createTextNode("A\u062EA")),n=y(t,0,1).getBoundingClientRect(),r=y(t,1,2).getBoundingClientRect();return w(e),!n||n.left==n.right?!1:ft=r.right-n.right<3}var St=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var d=e.indexOf(`
|
|
`,t);d==-1&&(d=e.length);var k=e.slice(t,e.charAt(d-1)=="\r"?d-1:d),K=k.indexOf("\r");K!=-1?(n.push(k.slice(0,K)),t+=K+1):(n.push(k),t=d+1)}return n}:function(e){return e.split(/\r\n?|\n/)},dt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ut=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Lt=null;function qt(e){if(Lt!=null)return Lt;var t=x(e,c("span","x")),n=t.getBoundingClientRect(),r=y(t,0,1).getBoundingClientRect();return Lt=Math.abs(n.left-r.left)>1}var Qt={},It={};function Ci(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Qt[e]=t}function Ki(e,t){It[e]=t}function yt(e){if(typeof e=="string"&&It.hasOwnProperty(e))e=It[e];else if(e&&typeof e.name=="string"&&It.hasOwnProperty(e.name)){var t=It[e.name];typeof t=="string"&&(t={name:t}),e=Ge(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return yt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return yt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Li(e,t){t=yt(t);var n=Qt[t.name];if(!n)return Li(e,"text/plain");var r=n(e,t);if(bt.hasOwnProperty(t.name)){var d=bt[t.name];for(var k in d){if(!d.hasOwnProperty(k))continue;r.hasOwnProperty(k)&&(r["_"+k]=r[k]),r[k]=d[k]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var K in t.modeProps)r[K]=t.modeProps[K];return r}var bt={};function xt(e,t){var n=bt.hasOwnProperty(e)?bt[e]:bt[e]={};b(t,n)}function Ft(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var d=t[r];d instanceof Array&&(d=d.concat([])),n[r]=d}return n}function ti(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function di(e,t,n){return e.startState?e.startState(t,n):!0}var Pt=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Pt.prototype.eol=function(){return this.pos>=this.string.length},Pt.prototype.sol=function(){return this.pos==this.lineStart},Pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Pt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Pt.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Pt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Pt.prototype.skipToEnd=function(){this.pos=this.string.length},Pt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.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)},Pt.prototype.indentation=function(){return Y(this.string,null,this.tabSize)-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(K){return n?K.toLowerCase():K},d=this.string.substr(this.pos,e.length);if(r(d)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var k=this.string.slice(this.pos).match(e);return k&&k.index>0?null:(k&&t!==!1&&(this.pos+=k[0].length),k)}},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ct(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var d=n.children[r],k=d.chunkSize();if(t<k){n=d;break}t-=k}return n.lines[t]}function Ui(e,t,n){var r=[],d=t.line;return e.iter(t.line,n.line+1,function(k){var K=k.text;d==n.line&&(K=K.slice(0,n.ch)),d==t.line&&(K=K.slice(t.ch)),r.push(K),++d}),r}function Vt(e,t,n){var r=[];return e.iter(t,n,function(d){r.push(d.text)}),r}function Jt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Ot(e){if(e.parent==null)return null;for(var t=e.parent,n=le(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var d=0;!(r.children[d]==t);++d)n+=r.children[d].chunkSize();return n+t.first}function li(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var d=e.children[r],k=d.height;if(t<k){e=d;continue e}t-=k,n+=d.chunkSize()}return n}while(!e.lines);for(var K=0;K<e.lines.length;++K){var J=e.lines[K],Z=J.height;if(t<Z)break;t-=Z}return n+K}function Ii(e,t){return t>=e.first&&t<e.first+e.size}function Xi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ze(e,t,n){if(n===void 0&&(n=null),!(this instanceof Ze))return new Ze(e,t,n);this.line=e,this.ch=t,this.sticky=n}function Ct(e,t){return e.line-t.line||e.ch-t.ch}function pr(e,t){return e.sticky==t.sticky&&Ct(e,t)==0}function mr(e){return Ze(e.line,e.ch)}function gr(e,t){return Ct(e,t)<0?t:e}function vr(e,t){return Ct(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 Ze(e.first,0);var n=e.first+e.size-1;return t.line>n?Ze(n,ct(e,n).text.length):I(t,ct(e,t.line).text.length)}function I(e,t){var n=e.ch;return n==null||n>t?Ze(e.line,t):n<0?Ze(e.line,0):e}function H(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=E(e,t[r]);return n}var q=function(e,t){this.state=e,this.lookAhead=t},z=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||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,n){return t instanceof q?new z(e,Ft(e.mode,t.state),n,t.lookAhead):new z(e,Ft(e.mode,t),n)},z.prototype.save=function(e){var t=e!==!1?Ft(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new q(t,this.maxLookAhead):t};function ye(e,t,n,r){var d=[e.state.modeGen],k={};Ei(e,t.text,e.doc.mode,n,function(te,de){return d.push(te,de)},k,r);for(var K=n.state,J=function(te){n.baseTokens=d;var de=e.state.overlays[te],me=1,Ie=0;n.state=!0,Ei(e,t.text,de.mode,n,function(Re,He){for(var $e=me;Ie<Re;){var et=d[me];et>Re&&d.splice(me,1,Re,d[me+1],et),me+=2,Ie=Math.min(Re,et)}if(!He)return;if(de.opaque)d.splice($e,me-$e,Re,"overlay "+He),me=$e+2;else for(;$e<me;$e+=2){var it=d[$e+1];d[$e+1]=(it?it+" ":"")+"overlay "+He}},k),n.state=K,n.baseTokens=null,n.baseTokenPos=1},Z=0;Z<e.state.overlays.length;++Z)J(Z);return{styles:d,classes:k.bgClass||k.textClass?k:null}}function Ke(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=tt(e,Ot(t)),d=t.text.length>e.options.maxHighlightLength&&Ft(e.doc.mode,r.state),k=ye(e,t,r);d&&(r.state=d),t.stateAfter=r.save(!d),t.styles=k.styles,k.classes?t.styleClasses=k.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function tt(e,t,n){var r=e.doc,d=e.display;if(!r.mode.startState)return new z(r,!0,t);var k=xi(e,t,n),K=k>r.first&&ct(r,k-1).stateAfter,J=K?z.fromSaved(r,K,k):new z(r,di(r.mode),k);return r.iter(k,t,function(Z){pt(e,Z.text,J);var te=J.line;Z.stateAfter=te==t-1||te%5==0||te>=d.viewFrom&&te<d.viewTo?J.save():null,J.nextLine()}),n&&(r.modeFrontier=J.line),J}function pt(e,t,n,r){var d=e.doc.mode,k=new Pt(t,e.options.tabSize,n);for(k.start=k.pos=r||0,t==""&&Ye(d,n.state);!k.eol();)_t(d,k,n.state),k.start=k.pos}function Ye(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=ti(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function _t(e,t,n,r){for(var d=0;d<10;d++){r&&(r[0]=ti(e,n).mode);var k=e.token(t,n);if(t.pos>t.start)return k}throw new Error("Mode "+e.name+" failed to advance stream.")}var jt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function $t(e,t,n,r){var d=e.doc,k=d.mode,K;t=E(d,t);var J=ct(d,t.line),Z=tt(e,t.line,n),te=new Pt(J.text,e.options.tabSize,Z),de;for(r&&(de=[]);(r||te.pos<t.ch)&&!te.eol();)te.start=te.pos,K=_t(k,te,Z.state),r&&de.push(new jt(te,K,Ft(d.mode,Z.state)));return r?de:new jt(te,K,Z.state)}function ji(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Ei(e,t,n,r,d,k,K){var J=n.flattenSpans;J==null&&(J=e.options.flattenSpans);var Z=0,te=null,de=new Pt(t,e.options.tabSize,r),me,Ie=e.options.addModeClass&&[null];for(t==""&&ji(Ye(n,r.state),k);!de.eol();){if(de.pos>e.options.maxHighlightLength?(J=!1,K&&pt(e,t,r,de.pos),de.pos=t.length,me=null):me=ji(_t(n,de,r.state,Ie),k),Ie){var Re=Ie[0].name;Re&&(me="m-"+(me?Re+" "+me:Re))}if(!J||te!=me){for(;Z<de.start;)Z=Math.min(de.start,Z+5e3),d(Z,te);te=me}de.start=de.pos}for(;Z<de.pos;){var He=Math.min(de.pos,Z+5e3);d(He,te),Z=He}}function xi(e,t,n){for(var r,d,k=e.doc,K=n?-1:t-(e.doc.mode.innerMode?1e3:100),J=t;J>K;--J){if(J<=k.first)return k.first;var Z=ct(k,J-1),te=Z.stateAfter;if(te&&(!n||J+(te instanceof q?te.lookAhead:0)<=k.modeFrontier))return J;var de=Y(Z.text,null,e.options.tabSize);(d==null||r>de)&&(d=J-1,r=de)}return d}function Qi(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var n=e.first,r=t-1;r>n;r--){var d=ct(e,r).stateAfter;if(d&&(!(d instanceof q)||r+d.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var Ir=!1,ci=!1;function zi(){Ir=!0}function lr(){ci=!0}function ur(e,t,n){this.marker=e,this.from=t,this.to=n}function Hi(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Dr(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function yr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Kr(e,t,n){var r;if(e)for(var d=0;d<e.length;++d){var k=e[d],K=k.marker,J=k.from==null||(K.inclusiveLeft?k.from<=t:k.from<t);if(J||k.from==t&&K.type=="bookmark"&&(!n||!k.marker.insertLeft)){var Z=k.to==null||(K.inclusiveRight?k.to>=t:k.to>t);(r||(r=[])).push(new ur(K,k.from,Z?null:k.to))}}return r}function zr(e,t,n){var r;if(e)for(var d=0;d<e.length;++d){var k=e[d],K=k.marker,J=k.to==null||(K.inclusiveRight?k.to>=t:k.to>t);if(J||k.from==t&&K.type=="bookmark"&&(!n||k.marker.insertLeft)){var Z=k.from==null||(K.inclusiveLeft?k.from<=t:k.from<t);(r||(r=[])).push(new ur(K,Z?null:k.from-t,k.to==null?null:k.to-t))}}return r}function Zi(e,t){if(t.full)return null;var n=Ii(e,t.from.line)&&ct(e,t.from.line).markedSpans,r=Ii(e,t.to.line)&&ct(e,t.to.line).markedSpans;if(!n&&!r)return null;var d=t.from.ch,k=t.to.ch,K=Ct(t.from,t.to)==0,J=Kr(n,d,K),Z=zr(r,k,K),te=t.text.length==1,de=Oe(t.text).length+(te?d:0);if(J)for(var me=0;me<J.length;++me){var Ie=J[me];if(Ie.to==null){var Re=Hi(Z,Ie.marker);Re?te&&(Ie.to=Re.to==null?null:Re.to+de):Ie.to=d}}if(Z)for(var He=0;He<Z.length;++He){var $e=Z[He];if($e.to!=null&&($e.to+=de),$e.from==null){var et=Hi(J,$e.marker);et||($e.from=de,te&&(J||(J=[])).push($e))}else $e.from+=de,te&&(J||(J=[])).push($e)}J&&(J=$i(J)),Z&&Z!=J&&(Z=$i(Z));var it=[J];if(!te){var ut=t.text.length-2,rt;if(ut>0&&J)for(var ht=0;ht<J.length;++ht)J[ht].to==null&&(rt||(rt=[])).push(new ur(J[ht].marker,null,null));for(var Tt=0;Tt<ut;++Tt)it.push(rt);it.push(Z)}return it}function $i(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function br(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(Re){if(Re.markedSpans)for(var He=0;He<Re.markedSpans.length;++He){var $e=Re.markedSpans[He].marker;$e.readOnly&&(!r||le(r,$e)==-1)&&(r||(r=[])).push($e)}}),!r)return null;for(var d=[{from:t,to:n}],k=0;k<r.length;++k)for(var K=r[k],J=K.find(0),Z=0;Z<d.length;++Z){var te=d[Z];if(Ct(te.to,J.from)<0||Ct(te.from,J.to)>0)continue;var de=[Z,1],me=Ct(te.from,J.from),Ie=Ct(te.to,J.to);(me<0||!K.inclusiveLeft&&!me)&&de.push({from:te.from,to:J.from}),(Ie>0||!K.inclusiveRight&&!Ie)&&de.push({from:J.to,to:te.to}),d.splice.apply(d,de),Z+=de.length-3}return d}function dn(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function _r(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function ri(e){return e.inclusiveLeft?-1:0}function Ht(e){return e.inclusiveRight?1:0}function yi(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),d=t.find(),k=Ct(r.from,d.from)||ri(e)-ri(t);if(k)return-k;var K=Ct(r.to,d.to)||Ht(e)-Ht(t);return K||t.id-e.id}function kt(e,t){var n=ci&&e.markedSpans,r;if(n)for(var d=void 0,k=0;k<n.length;++k)d=n[k],d.marker.collapsed&&(t?d.from:d.to)==null&&(!r||yi(r,d.marker)<0)&&(r=d.marker);return r}function ai(e){return kt(e,!0)}function Kt(e){return kt(e,!1)}function rr(e,t){var n=ci&&e.markedSpans,r;if(n)for(var d=0;d<n.length;++d){var k=n[d];k.marker.collapsed&&(k.from==null||k.from<t)&&(k.to==null||k.to>t)&&(!r||yi(r,k.marker)<0)&&(r=k.marker)}return r}function fi(e,t,n,r,d){var k=ct(e,t),K=ci&&k.markedSpans;if(K)for(var J=0;J<K.length;++J){var Z=K[J];if(!Z.marker.collapsed)continue;var te=Z.marker.find(0),de=Ct(te.from,n)||ri(Z.marker)-ri(d),me=Ct(te.to,r)||Ht(Z.marker)-Ht(d);if(de>=0&&me<=0||de<=0&&me>=0)continue;if(de<=0&&(Z.marker.inclusiveRight&&d.inclusiveLeft?Ct(te.to,n)>=0:Ct(te.to,n)>0)||de>=0&&(Z.marker.inclusiveRight&&d.inclusiveLeft?Ct(te.from,r)<=0:Ct(te.from,r)<0))return!0}}function Ai(e){for(var t;t=ai(e);)e=t.find(-1,!0).line;return e}function Vr(e){for(var t;t=Kt(e);)e=t.find(1,!0).line;return e}function Er(e){for(var t,n;t=Kt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function cn(e,t){var n=ct(e,t),r=Ai(n);return n==r?t:Ot(r)}function xr(e,t){if(t>e.lastLine())return t;var n=ct(e,t),r;if(!nr(e,n))return t;for(;r=Kt(n);)n=r.find(1,!0).line;return Ot(n)+1}function nr(e,t){var n=ci&&t.markedSpans;if(n)for(var r=void 0,d=0;d<n.length;++d){if(r=n[d],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&fn(e,t,r))return!0}}function fn(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return fn(e,r.line,Hi(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var d=void 0,k=0;k<t.markedSpans.length;++k)if(d=t.markedSpans[k],d.marker.collapsed&&!d.marker.widgetNode&&d.from==n.to&&(d.to==null||d.to!=n.from)&&(d.marker.inclusiveLeft||n.marker.inclusiveRight)&&fn(e,t,d))return!0}function qi(e){e=Ai(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var d=n.lines[r];if(d==e)break;t+=d.height}for(var k=n.parent;k;n=k,k=n.parent)for(var K=0;K<k.children.length;++K){var J=k.children[K];if(J==n)break;t+=J.height}return t}function pn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=ai(r);){var d=n.find(0,!0);r=d.from.line,t+=d.from.ch-d.to.ch}for(r=e;n=Kt(r);){var k=n.find(0,!0);t-=r.text.length-k.from.ch,r=k.to.line,t+=r.text.length-k.to.ch}return t}function jn(e){var t=e.display,n=e.doc;t.maxLine=ct(n,n.first),t.maxLineLength=pn(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var d=pn(r);d>t.maxLineLength&&(t.maxLineLength=d,t.maxLine=r)})}var kr=function(e,t,n){this.text=e,_r(this,t),this.height=n?n(this):1};kr.prototype.lineNo=function(){return Ot(this)},_e(kr);function ua(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),dn(e),_r(e,n);var d=r?r(e):1;d!=e.height&&Jt(e,d)}function gt(e){e.parent=null,dn(e)}var At={},Et={};function Dt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Et:At;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Bt(e,t){var n=T("span",null,null,i?"padding-right: .1px":null),r={pre:T("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var d=0;d<=(t.rest?t.rest.length:0);d++){var k=d?t.rest[d-1]:t.line,K=void 0;r.pos=0,r.addToken=Nt,wt(e.display.measure)&&(K=Xe(k,e.doc.direction))&&(r.addToken=Di(r.addToken,K)),r.map=[];var J=t!=e.display.externalMeasured&&Ot(k);hr(k,r,Ke(e,k,J)),k.styleClasses&&(k.styleClasses.bgClass&&(r.bgClass=O(k.styleClasses.bgClass,r.bgClass||"")),k.styleClasses.textClass&&(r.textClass=O(k.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(mt(e.display.measure))),d==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(i){var Z=r.content.lastChild;(/\bcm-tab\b/.test(Z.className)||Z.querySelector&&Z.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Be(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=O(r.pre.className,r.textClass||"")),r}function Yt(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Nt(e,t,n,r,d,k,K){if(!t)return;var J=e.splitSpaces?ui(t,e.trailingSpace):t,Z=e.cm.state.specialChars,te=!1,de;if(!Z.test(t))e.col+=t.length,de=document.createTextNode(J),e.map.push(e.pos,e.pos+t.length,de),G&&W<9&&(te=!0),e.pos+=t.length;else{de=document.createDocumentFragment();for(var me=0;;){Z.lastIndex=me;var Ie=Z.exec(t),Re=Ie?Ie.index-me:t.length-me;if(Re){var He=document.createTextNode(J.slice(me,me+Re));G&&W<9?de.appendChild(c("span",[He])):de.appendChild(He),e.map.push(e.pos,e.pos+Re,He),e.col+=Re,e.pos+=Re}if(!Ie)break;me+=Re+1;var $e=void 0;if(Ie[0]==" "){var et=e.cm.options.tabSize,it=et-e.col%et;$e=de.appendChild(c("span",ae(it),"cm-tab")),$e.setAttribute("role","presentation"),$e.setAttribute("cm-text"," "),e.col+=it}else Ie[0]=="\r"||Ie[0]==`
|
|
`?($e=de.appendChild(c("span",Ie[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),$e.setAttribute("cm-text",Ie[0]),e.col+=1):($e=e.cm.options.specialCharPlaceholder(Ie[0]),$e.setAttribute("cm-text",Ie[0]),G&&W<9?de.appendChild(c("span",[$e])):de.appendChild($e),e.col+=1);e.map.push(e.pos,e.pos+1,$e),e.pos++}}if(e.trailingSpace=J.charCodeAt(t.length-1)==32,n||r||d||te||k||K){var ut=n||"";r&&(ut+=r),d&&(ut+=d);var rt=c("span",[de],ut,k);if(K)for(var ht in K)K.hasOwnProperty(ht)&&ht!="style"&&ht!="class"&&rt.setAttribute(ht,K[ht]);return e.content.appendChild(rt)}e.content.appendChild(de)}function ui(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",d=0;d<e.length;d++){var k=e.charAt(d);k==" "&&n&&(d==e.length-1||e.charCodeAt(d+1)==32)&&(k="\xA0"),r+=k,n=k==" "}return r}function Di(e,t){return function(n,r,d,k,K,J,Z){d=d?d+" cm-force-border":"cm-force-border";for(var te=n.pos,de=te+r.length;;){for(var me=void 0,Ie=0;Ie<t.length&&!(me=t[Ie],me.to>te&&me.from<=te);Ie++);if(me.to>=de)return e(n,r,d,k,K,J,Z);e(n,r.slice(0,me.to-te),d,k,null,J,Z),k=null,r=r.slice(me.to-te),te=me.to}}}function Mt(e,t,n,r){var d=!r&&n.widgetNode;d&&e.map.push(e.pos,e.pos+t,d),!r&&e.cm.display.input.needsContentAttribute&&(d||(d=e.content.appendChild(document.createElement("span"))),d.setAttribute("cm-marker",n.id)),d&&(e.cm.display.input.setUneditable(d),e.content.appendChild(d)),e.pos+=t,e.trailingSpace=!1}function hr(e,t,n){var r=e.markedSpans,d=e.text,k=0;if(!r){for(var K=1;K<n.length;K+=2)t.addToken(t,d.slice(k,k=n[K]),Dt(n[K+1],t.cm.options));return}for(var J=d.length,Z=0,te=1,de="",me,Ie,Re=0,He,$e,et,it,ut;;){if(Re==Z){He=$e=et=Ie="",ut=null,it=null,Re=Infinity;for(var rt=[],ht=void 0,Tt=0;Tt<r.length;++Tt){var vt=r[Tt],Rt=vt.marker;if(Rt.type=="bookmark"&&vt.from==Z&&Rt.widgetNode)rt.push(Rt);else if(vt.from<=Z&&(vt.to==null||vt.to>Z||Rt.collapsed&&vt.to==Z&&vt.from==Z)){if(vt.to!=null&&vt.to!=Z&&Re>vt.to&&(Re=vt.to,$e=""),Rt.className&&(He+=" "+Rt.className),Rt.css&&(Ie=(Ie?Ie+";":"")+Rt.css),Rt.startStyle&&vt.from==Z&&(et+=" "+Rt.startStyle),Rt.endStyle&&vt.to==Re&&(ht||(ht=[])).push(Rt.endStyle,vt.to),Rt.title&&((ut||(ut={})).title=Rt.title),Rt.attributes)for(var Xt in Rt.attributes)(ut||(ut={}))[Xt]=Rt.attributes[Xt];Rt.collapsed&&(!it||yi(it.marker,Rt)<0)&&(it=vt)}else vt.from>Z&&Re>vt.from&&(Re=vt.from)}if(ht)for(var gi=0;gi<ht.length;gi+=2)ht[gi+1]==Re&&($e+=" "+ht[gi]);if(!it||it.from==Z)for(var ei=0;ei<rt.length;++ei)Mt(t,0,rt[ei]);if(it&&(it.from||0)==Z){if(Mt(t,(it.to==null?J+1:it.to)-Z,it.marker,it.from==null),it.to==null)return;it.to==Z&&(it=!1)}}if(Z>=J)break;for(var Gi=Math.min(J,Re);;){if(de){var Ni=Z+de.length;if(!it){var si=Ni>Gi?de.slice(0,Gi-Z):de;t.addToken(t,si,me?me+He:He,et,Z+si.length==Re?$e:"",Ie,ut)}if(Ni>=Gi){de=de.slice(Gi-Z),Z=Gi;break}Z=Ni,et=""}de=d.slice(k,k=n[te++]),me=Dt(n[te++],t.cm.options)}}}function Wt(e,t,n){this.line=t,this.rest=Er(t),this.size=this.rest?Ot(Oe(this.rest))-n+1:1,this.node=this.text=null,this.hidden=nr(e,t)}function ki(e,t,n){for(var r=[],d,k=t;k<n;k=d){var K=new Wt(e.doc,ct(e.doc,k),k);d=k+K.size,r.push(K)}return r}var Ti=null;function Ji(e){Ti?Ti.ops.push(e):e.ownsGroup=Ti={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var d=e.ops[r];if(d.cursorActivityHandlers)for(;d.cursorActivityCalled<d.cursorActivityHandlers.length;)d.cursorActivityHandlers[d.cursorActivityCalled++].call(null,d.cm)}}while(n<t.length)}function Io(e,t){var n=e.ownsGroup;if(!n)return;try{Lo(n)}finally{Ti=null,t(n)}}var mn=null;function bi(e,t){var n=lt(e,t);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2),d;Ti?d=Ti.delayedCallbacks:mn?d=mn:(d=mn=[],setTimeout(Do,0));for(var k=function(J){d.push(function(){return n[J].apply(null,r)})},K=0;K<n.length;++K)k(K)}function Do(){var e=mn;mn=null;for(var t=0;t<e.length;++t)e[t]()}function Xa(e,t,n,r){for(var d=0;d<t.changes.length;d++){var k=t.changes[d];k=="text"?Mo(e,t):k=="gutter"?Ja(e,t,n,r):k=="class"?ha(e,t):k=="widget"&&Po(e,t,r)}t.changes=null}function gn(e){return e.node==e.text&&(e.node=c("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 n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=gn(t);t.background=r.insertBefore(c("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Bt(e,t)}function Mo(e,t){var n=t.text.className,r=$a(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,ha(e,t)):n&&(t.text.className=n)}function ha(e,t){ko(e,t),t.line.wrapClass?gn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Ja(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var d=gn(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),d.insertBefore(t.gutterBackground,t.text)}var k=t.line.gutterMarkers;if(e.options.lineNumbers||k){var K=gn(t),J=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(J),K.insertBefore(J,t.text),t.line.gutterClass&&(J.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!k||!k["CodeMirror-linenumbers"])&&(t.lineNumber=J.appendChild(c("div",Xi(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),k)for(var Z=0;Z<e.display.gutterSpecs.length;++Z){var te=e.display.gutterSpecs[Z].className,de=k.hasOwnProperty(te)&&k[te];de&&J.appendChild(c("div",[de],"CodeMirror-gutter-elt","left: "+r.gutterLeft[te]+"px; width: "+r.gutterWidth[te]+"px"))}}}function Po(e,t,n){t.alignable&&(t.alignable=null);for(var r=R("CodeMirror-linewidget"),d=t.node.firstChild,k=void 0;d;d=k)k=d.nextSibling,r.test(d.className)&&t.node.removeChild(d);Qa(e,t,n)}function No(e,t,n,r){var d=$a(e,t);return t.text=t.node=d.pre,d.bgClass&&(t.bgClass=d.bgClass),d.textClass&&(t.textClass=d.textClass),ha(e,t),Ja(e,t,n,r),Qa(e,t,r),t.node}function Qa(e,t,n){if(Za(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Za(e,t.rest[r],t,n,!1)}function Za(e,t,n,r,d){if(!t.widgets)return;for(var k=gn(n),K=0,J=t.widgets;K<J.length;++K){var Z=J[K],te=c("div",[Z.node],"CodeMirror-linewidget"+(Z.className?" "+Z.className:""));Z.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Fo(Z,te,n,r),e.display.input.setUneditable(te),d&&Z.above?k.insertBefore(te,n.gutter||n.text):k.appendChild(te),bi(Z,"redraw")}}function Fo(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var d=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(d-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=d+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function vn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!v(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),x(t.display.measure,c("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function dr(e,t){for(var n=Ee(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Hn(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,c("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function ar(e){return ue-e.display.nativeBarWidth}function Mr(e){return e.display.scroller.clientWidth-ar(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-ar(e)-e.display.barHeight}function Bo(e,t,n){var r=e.options.lineWrapping,d=r&&Mr(e);if(!t.measure.heights||r&&t.measure.width!=d){var k=t.measure.heights=[];if(r){t.measure.width=d;for(var K=t.text.firstChild.getClientRects(),J=0;J<K.length-1;J++){var Z=K[J],te=K[J+1];Math.abs(Z.bottom-te.bottom)>2&&k.push((Z.bottom+te.top)/2-n.top)}}k.push(n.bottom-n.top)}}function es(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var d=0;d<e.rest.length;d++)if(Ot(e.rest[d])>n)return{map:e.measure.maps[d],cache:e.measure.caches[d],before:!0}}function Uo(e,t){t=Ai(t);var n=Ot(t),r=e.display.externalMeasured=new Wt(e.doc,t,n);r.lineN=n;var d=r.built=Bt(e,r);return r.text=d.pre,x(e.display.lineMeasure,d.pre),r}function ts(e,t,n,r){return sr(e,Yr(e,t),n,r)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Fr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Yr(e,t){var n=Ot(t),r=fa(e,n);r&&!r.text?r=null:r&&r.changes&&(Xa(e,r,n,ba(e)),e.curOp.forceUpdate=!0),r||(r=Uo(e,t));var d=es(r,t,n);return{line:t,view:r,rect:null,map:d.map,cache:d.cache,before:d.before,hasHeights:!1}}function sr(e,t,n,r,d){t.before&&(n=-1);var k=n+(r||""),K;return t.cache.hasOwnProperty(k)?K=t.cache[k]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Bo(e,t.view,t.rect),t.hasHeights=!0),K=Ho(e,t,n,r),K.bogus||(t.cache[k]=K)),{left:K.left,right:K.right,top:d?K.rtop:K.top,bottom:d?K.rbottom:K.bottom}}var is={left:0,right:0,top:0,bottom:0};function rs(e,t,n){for(var r,d,k,K,J,Z,te=0;te<e.length;te+=3)if(J=e[te],Z=e[te+1],t<J?(d=0,k=1,K="left"):t<Z?(d=t-J,k=d+1):(te==e.length-3||t==Z&&e[te+3]>t)&&(k=Z-J,d=k-1,t>=Z&&(K="right")),d!=null){if(r=e[te+2],J==Z&&n==(r.insertLeft?"left":"right")&&(K=n),n=="left"&&d==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)r=e[(te-=3)+2],K="left";if(n=="right"&&d==Z-J)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)r=e[(te+=3)+2],K="right";break}return{node:r,start:d,end:k,collapse:K,coverStart:J,coverEnd:Z}}function jo(e,t){var n=is;if(t=="left")for(var r=0;r<e.length&&!((n=e[r]).left!=n.right);r++);else for(var d=e.length-1;d>=0&&!((n=e[d]).left!=n.right);d--);return n}function Ho(e,t,n,r){var d=rs(t.map,n,r),k=d.node,K=d.start,J=d.end,Z=d.collapse,te;if(k.nodeType==3){for(var de=0;de<4;de++){for(;K&&Se(t.line.text.charAt(d.coverStart+K));)--K;for(;d.coverStart+J<d.coverEnd&&Se(t.line.text.charAt(d.coverStart+J));)++J;if(G&&W<9&&K==0&&J==d.coverEnd-d.coverStart?te=k.parentNode.getBoundingClientRect():te=jo(y(k,K,J).getClientRects(),r),te.left||te.right||K==0)break;J=K,K=K-1,Z="right"}G&&W<11&&(te=Wo(e.display.measure,te))}else{K>0&&(Z=r="right");var me;e.options.lineWrapping&&(me=k.getClientRects()).length>1?te=me[r=="right"?me.length-1:0]:te=k.getBoundingClientRect()}if(G&&W<9&&!K&&(!te||!te.left&&!te.right)){var Ie=k.parentNode.getClientRects()[0];Ie?te={left:Ie.left,right:Ie.left+$r(e.display),top:Ie.top,bottom:Ie.bottom}:te=is}for(var Re=te.top-t.rect.top,He=te.bottom-t.rect.top,$e=(Re+He)/2,et=t.view.measure.heights,it=0;it<et.length-1&&!($e<et[it]);it++);var ut=it?et[it-1]:0,rt=et[it],ht={left:(Z=="right"?te.right:te.left)-t.rect.left,right:(Z=="left"?te.left:te.right)-t.rect.left,top:ut,bottom:rt};return!te.left&&!te.right&&(ht.bogus=!0),e.options.singleCursorHeightPerLine||(ht.rtop=Re,ht.rbottom=He),ht}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!qt(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function ns(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,w(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ns(e.display.view[t])}function yn(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&&o?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return g&&o?-(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 n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=vn(e.widgets[n]));return t}function Wn(e,t,n,r,d){if(!d){var k=pa(t);n.top+=k,n.bottom+=k}if(r=="line")return n;r||(r="local");var K=qi(t);if(r=="local"?K+=Hn(e.display):K-=e.display.viewOffset,r=="page"||r=="window"){var J=e.display.lineSpace.getBoundingClientRect();K+=J.top+(r=="window"?0:os());var Z=J.left+(r=="window"?0:ss());n.left+=Z,n.right+=Z}return n.top+=K,n.bottom+=K,n}function ls(e,t,n){if(n=="div")return t;var r=t.left,d=t.top;if(n=="page")r-=ss(),d-=os();else if(n=="local"||!n){var k=e.display.sizer.getBoundingClientRect();r+=k.left,d+=k.top}var K=e.display.lineSpace.getBoundingClientRect();return{left:r-K.left,top:d-K.top}}function ma(e,t,n,r,d){return r||(r=ct(e.doc,t.line)),Wn(e,r,ts(e,r,t.ch,d),n)}function er(e,t,n,r,d,k){r=r||ct(e.doc,t.line),d||(d=Yr(e,r));function K(He,$e){var et=sr(e,d,He,$e?"right":"left",k);return $e?et.left=et.right:et.right=et.left,Wn(e,r,et,n)}var J=Xe(r,e.doc.direction),Z=t.ch,te=t.sticky;if(Z>=r.text.length?(Z=r.text.length,te="before"):Z<=0&&(Z=0,te="after"),!J)return K(te=="before"?Z-1:Z,te=="before");function de(He,$e,et){var it=J[$e],ut=it.level==1;return K(et?He-1:He,ut!=et)}var me=Je(J,Z,te),Ie=Qe,Re=de(Z,me,te=="before");return Ie!=null&&(Re.other=de(Z,Ie,te!="before")),Re}function us(e,t){var n=0;t=E(e.doc,t),e.options.lineWrapping||(n=$r(e.display)*t.ch);var r=ct(e.doc,t.line),d=qi(r)+Hn(e.display);return{left:n,right:n,top:d,bottom:d+r.height}}function ga(e,t,n,r,d){var k=Ze(e,t,n);return k.xRel=d,r&&(k.outside=r),k}function va(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return ga(r.first,0,null,-1,-1);var d=li(r,n),k=r.first+r.size-1;if(d>k)return ga(r.first+r.size-1,ct(r,k).text.length,null,1,1);t<0&&(t=0);for(var K=ct(r,d);;){var J=Go(e,K,d,t,n),Z=rr(K,J.ch+(J.xRel>0||J.outside>0?1:0));if(!Z)return J;var te=Z.find(1);if(te.line==d)return te;K=ct(r,d=te.line)}}function hs(e,t,n,r){r-=pa(t);var d=t.text.length,k=je(function(K){return sr(e,n,K-1).bottom<=r},d,0);return d=je(function(K){return sr(e,n,K).top>r},k,d),{begin:k,end:d}}function ds(e,t,n,r){n||(n=Yr(e,t));var d=Wn(e,t,sr(e,n,r),"line").top;return hs(e,t,n,d)}function ya(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Go(e,t,n,r,d){d-=qi(t);var k=Yr(e,t),K=pa(t),J=0,Z=t.text.length,te=!0,de=Xe(t,e.doc.direction);if(de){var me=(e.options.lineWrapping?zo:Ko)(e,t,n,k,de,r,d);te=me.level!=1,J=te?me.from:me.to-1,Z=te?me.to:me.from-1}var Ie=null,Re=null,He=je(function(Tt){var vt=sr(e,k,Tt);return vt.top+=K,vt.bottom+=K,ya(vt,r,d,!1)?(vt.top<=d&&vt.left<=r&&(Ie=Tt,Re=vt),!0):!1},J,Z),$e,et,it=!1;if(Re){var ut=r-Re.left<Re.right-r,rt=ut==te;He=Ie+(rt?0:1),et=rt?"after":"before",$e=ut?Re.left:Re.right}else{!te&&(He==Z||He==J)&&He++,et=He==0?"after":He==t.text.length?"before":sr(e,k,He-(te?1:0)).bottom+K<=d==te?"after":"before";var ht=er(e,Ze(n,He,et),"line",t,k);$e=ht.left,it=d<ht.top?-1:d>=ht.bottom?1:0}return He=Ce(t.text,He,1),ga(n,He,et,it,r-$e)}function Ko(e,t,n,r,d,k,K){var J=je(function(me){var Ie=d[me],Re=Ie.level!=1;return ya(er(e,Ze(n,Re?Ie.to:Ie.from,Re?"before":"after"),"line",t,r),k,K,!0)},0,d.length-1),Z=d[J];if(J>0){var te=Z.level!=1,de=er(e,Ze(n,te?Z.from:Z.to,te?"after":"before"),"line",t,r);ya(de,k,K,!0)&&de.top>K&&(Z=d[J-1])}return Z}function zo(e,t,n,r,d,k,K){var J=hs(e,t,r,K),Z=J.begin,te=J.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var de=null,me=null,Ie=0;Ie<d.length;Ie++){var Re=d[Ie];if(Re.from>=te||Re.to<=Z)continue;var He=Re.level!=1,$e=sr(e,r,He?Math.min(te,Re.to)-1:Math.max(Z,Re.from)).right,et=$e<k?k-$e+1e9:$e-k;(!de||me>et)&&(de=Re,me=et)}return de||(de=d[d.length-1]),de.from<Z&&(de={from:Z,to:de.to,level:de.level}),de.to>te&&(de={from:de.from,to:te,level:de.level}),de}var Pr;function Xr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pr==null){Pr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Pr.appendChild(document.createTextNode("x")),Pr.appendChild(c("br"));Pr.appendChild(document.createTextNode("x"))}x(e.measure,Pr);var n=Pr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),w(e.measure),n||1}function $r(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");x(e.measure,n);var r=t.getBoundingClientRect(),d=(r.right-r.left)/10;return d>2&&(e.cachedCharWidth=d),d||10}function ba(e){for(var t=e.display,n={},r={},d=t.gutters.clientLeft,k=t.gutters.firstChild,K=0;k;k=k.nextSibling,++K){var J=e.display.gutterSpecs[K].className;n[J]=k.offsetLeft+k.clientLeft+d,r[J]=k.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function cs(e){var t=Xr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/$r(e.display)-3);return function(d){if(nr(e.doc,d))return 0;var k=0;if(d.widgets)for(var K=0;K<d.widgets.length;K++)d.widgets[K].height&&(k+=d.widgets[K].height);return n?k+(Math.ceil(d.text.length/r)||1)*t:k+t}}function Ea(e){var t=e.doc,n=cs(e);t.iter(function(r){var d=n(r);d!=r.height&&Jt(r,d)})}function Nr(e,t,n,r){var d=e.display;if(!n&&Ee(t).getAttribute("cm-not-content")=="true")return null;var k,K,J=d.lineSpace.getBoundingClientRect();try{k=t.clientX-J.left,K=t.clientY-J.top}catch(me){return null}var Z=va(e,k,K),te;if(r&&Z.xRel>0&&(te=ct(e.doc,Z.line).text).length==Z.ch){var de=Y(te,te.length,e.options.tabSize)-te.length;Z=Ze(Z.line,Math.max(0,Math.round((k-qa(e.display).left)/$r(e.display))-de))}return Z}function Fr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function Mi(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var d=e.display;if(r&&n<d.viewTo&&(d.updateLineNumbers==null||d.updateLineNumbers>t)&&(d.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=d.viewTo)ci&&cn(e.doc,t)<d.viewTo&&wr(e);else if(n<=d.viewFrom)ci&&xr(e.doc,n+r)>d.viewFrom?wr(e):(d.viewFrom+=r,d.viewTo+=r);else if(t<=d.viewFrom&&n>=d.viewTo)wr(e);else if(t<=d.viewFrom){var k=Gn(e,n,n+r,1);k?(d.view=d.view.slice(k.index),d.viewFrom=k.lineN,d.viewTo+=r):wr(e)}else if(n>=d.viewTo){var K=Gn(e,t,t,-1);K?(d.view=d.view.slice(0,K.index),d.viewTo=K.lineN):wr(e)}else{var J=Gn(e,t,t,-1),Z=Gn(e,n,n+r,1);J&&Z?(d.view=d.view.slice(0,J.index).concat(ki(e,J.lineN,Z.lineN)).concat(d.view.slice(Z.index)),d.viewTo+=r):wr(e)}var te=d.externalMeasured;te&&(n<te.lineN?te.lineN+=r:t<te.lineN+te.size&&(d.externalMeasured=null))}function Tr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,d=e.display.externalMeasured;if(d&&t>=d.lineN&&t<d.lineN+d.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var k=r.view[Fr(e,t)];if(k.node==null)return;var K=k.changes||(k.changes=[]);le(K,n)==-1&&K.push(n)}function wr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gn(e,t,n,r){var d=Fr(e,t),k,K=e.display.view;if(!ci||n==e.doc.first+e.doc.size)return{index:d,lineN:n};for(var J=e.display.viewFrom,Z=0;Z<d;Z++)J+=K[Z].size;if(J!=t){if(r>0){if(d==K.length-1)return null;k=J+K[d].size-t,d++}else k=J-t;t+=k,n+=k}for(;cn(e.doc,n)!=n;){if(d==(r<0?0:K.length-1))return null;n+=r*K[d-(r<0?1:0)].size,d+=r}return{index:d,lineN:n}}function Vo(e,t,n){var r=e.display,d=r.view;d.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=ki(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=ki(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Fr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(ki(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Fr(e,n)))),r.viewTo=n}function fs(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var d=t[r];!d.hidden&&(!d.node||d.changes)&&++n}return n}function bn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},d=r.cursors=document.createDocumentFragment(),k=r.selection=document.createDocumentFragment(),K=0;K<n.sel.ranges.length;K++){if(!t&&K==n.sel.primIndex)continue;var J=n.sel.ranges[K];if(J.from().line>=e.display.viewTo||J.to().line<e.display.viewFrom)continue;var Z=J.empty();(Z||e.options.showCursorWhenSelecting)&&ms(e,J.head,d),Z||Yo(e,J,k)}return r}function ms(e,t,n){var r=er(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),d=n.appendChild(c("div","\xA0","CodeMirror-cursor"));if(d.style.left=r.left+"px",d.style.top=r.top+"px",d.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var k=n.appendChild(c("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));k.style.display="",k.style.left=r.other.left+"px",k.style.top=r.other.top+"px",k.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Kn(e,t){return e.top-t.top||e.left-t.left}function Yo(e,t,n){var r=e.display,d=e.doc,k=document.createDocumentFragment(),K=qa(e.display),J=K.left,Z=Math.max(r.sizerWidth,Mr(e)-r.sizer.offsetLeft)-K.right,te=d.direction=="ltr";function de(rt,ht,Tt,vt){ht<0&&(ht=0),ht=Math.round(ht),vt=Math.round(vt),k.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+rt+`px;
|
|
top: `+ht+"px; width: "+(Tt==null?Z-rt:Tt)+`px;
|
|
height: `+(vt-ht)+"px"))}function me(rt,ht,Tt){var vt=ct(d,rt),Rt=vt.text.length,Xt,gi;function ei(si,Fi){return ma(e,Ze(rt,si),"div",vt,Fi)}function Gi(si,Fi,_i){var hi=ds(e,vt,null,si),oi=Fi=="ltr"==(_i=="after")?"left":"right",ii=_i=="after"?hi.begin:hi.end-(/\s/.test(vt.text.charAt(hi.end-1))?2:1);return ei(ii,oi)[oi]}var Ni=Xe(vt,d.direction);return Ve(Ni,ht||0,Tt==null?Rt:Tt,function(si,Fi,_i,hi){var oi=_i=="ltr",ii=ei(si,oi?"left":"right"),Bi=ei(Fi-1,oi?"right":"left"),un=ht==null&&si==0,Lr=Tt==null&&Fi==Rt,Si=hi==0,or=!Ni||hi==Ni.length-1;if(Bi.top-ii.top<=3){var vi=(te?un:Lr)&&Si,Va=(te?Lr:un)&&or,fr=vi?J:(oi?ii:Bi).left,Wr=Va?Z:(oi?Bi:ii).right;de(fr,ii.top,Wr-fr,ii.bottom)}else{var Gr,Ri,hn,Ya;oi?(Gr=te&&un&&Si?J:ii.left,Ri=te?Z:Gi(si,_i,"before"),hn=te?J:Gi(Fi,_i,"after"),Ya=te&&Lr&&or?Z:Bi.right):(Gr=te?Gi(si,_i,"before"):J,Ri=!te&&un&&Si?Z:ii.right,hn=!te&&Lr&&or?J:Bi.left,Ya=te?Gi(Fi,_i,"after"):Z),de(Gr,ii.top,Ri-Gr,ii.bottom),ii.bottom<Bi.top&&de(J,ii.bottom,null,Bi.top),de(hn,Bi.top,Ya-hn,Bi.bottom)}(!Xt||Kn(ii,Xt)<0)&&(Xt=ii),Kn(Bi,Xt)<0&&(Xt=Bi),(!gi||Kn(ii,gi)<0)&&(gi=ii),Kn(Bi,gi)<0&&(gi=Bi)}),{start:Xt,end:gi}}var Ie=t.from(),Re=t.to();if(Ie.line==Re.line)me(Ie.line,Ie.ch,Re.ch);else{var He=ct(d,Ie.line),$e=ct(d,Re.line),et=Ai(He)==Ai($e),it=me(Ie.line,Ie.ch,et?He.text.length+1:null).end,ut=me(Re.line,et?0:null,Re.ch).start;et&&(it.top<ut.top-2?(de(it.right,it.top,null,it.bottom),de(J,ut.top,ut.left,ut.bottom)):de(it.right,it.top,ut.left-it.right,it.bottom)),it.bottom<ut.top&&de(J,it.bottom,null,ut.top)}n.appendChild(k)}function xa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Jr(e),t.cursorDiv.style.visibility=(n=!n)?"":"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,Jr(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Be(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 Jr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Be(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 zn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var d=t.view[r],k=e.options.lineWrapping,K=void 0,J=0;if(d.hidden)continue;if(G&&W<8){var Z=d.node.offsetTop+d.node.offsetHeight;K=Z-n,n=Z}else{var te=d.node.getBoundingClientRect();K=te.bottom-te.top,!k&&d.text.firstChild&&(J=d.text.firstChild.getBoundingClientRect().right-te.left-1)}var de=d.line.height-K;if((de>.005||de<-.005)&&(Jt(d.line,K),ys(d.line),d.rest))for(var me=0;me<d.rest.length;me++)ys(d.rest[me]);if(J>e.display.sizerWidth){var Ie=Math.ceil(J/$r(e.display));Ie>e.display.maxLineLength&&(e.display.maxLineLength=Ie,e.display.maxLine=d.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Vn(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Hn(e));var d=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,k=li(t,r),K=li(t,d);if(n&&n.ensure){var J=n.ensure.from.line,Z=n.ensure.to.line;J<k?(k=J,K=li(t,qi(ct(t,J))+e.wrapper.clientHeight)):Math.min(Z,t.lastLine())>=K&&(k=li(t,qi(ct(t,Z))-e.wrapper.clientHeight),K=Z)}return{from:k,to:Math.max(K,k+1)}}function Xo(e,t){if(Ue(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),d=null;if(t.top+r.top<0?d=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(d=!1),d!=null&&!u){var k=c("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-n.viewOffset-Hn(e.display))+`px;
|
|
height: `+(t.bottom-t.top+ar(e)+n.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(k),k.scrollIntoView(d),e.display.lineSpace.removeChild(k)}}function $o(e,t,n,r){r==null&&(r=0);var d;!e.options.lineWrapping&&t==n&&(t=t.ch?Ze(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?Ze(t.line,t.ch+1,"before"):t);for(var k=0;k<5;k++){var K=!1,J=er(e,t),Z=!n||n==t?J:er(e,n);d={left:Math.min(J.left,Z.left),top:Math.min(J.top,Z.top)-r,right:Math.max(J.left,Z.left),bottom:Math.max(J.bottom,Z.bottom)+r};var te=wa(e,d),de=e.doc.scrollTop,me=e.doc.scrollLeft;if(te.scrollTop!=null&&(En(e,te.scrollTop),Math.abs(e.doc.scrollTop-de)>1&&(K=!0)),te.scrollLeft!=null&&(Br(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-me)>1&&(K=!0)),!K)break}return d}function Jo(e,t){var n=wa(e,t);n.scrollTop!=null&&En(e,n.scrollTop),n.scrollLeft!=null&&Br(e,n.scrollLeft)}function wa(e,t){var n=e.display,r=Xr(e.display);t.top<0&&(t.top=0);var d=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,k=ca(e),K={};t.bottom-t.top>k&&(t.bottom=t.top+k);var J=e.doc.height+da(n),Z=t.top<r,te=t.bottom>J-r;if(t.top<d)K.scrollTop=Z?0:t.top;else if(t.bottom>d+k){var de=Math.min(t.top,(te?J:t.bottom)-k);de!=d&&(K.scrollTop=de)}var me=e.options.fixedGutter?0:n.gutters.offsetWidth,Ie=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-me,Re=Mr(e)-n.gutters.offsetWidth,He=t.right-t.left>Re;return He&&(t.right=t.left+Re),t.left<10?K.scrollLeft=0:t.left<Ie?K.scrollLeft=Math.max(0,t.left+me-(He?0:10)):t.right>Re+Ie-3&&(K.scrollLeft=t.right+(He?0:10)-Re),K}function Sa(e,t){if(t==null)return;Yn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qr(e){Yn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _n(e,t,n){(t!=null||n!=null)&&Yn(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Qo(e,t){Yn(e),e.curOp.scrollToPos=t}function Yn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=us(e,t.from),r=us(e,t.to);bs(e,n,r,t.margin)}}function bs(e,t,n,r){var d=wa(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});_n(e,d.scrollLeft,d.scrollTop)}function En(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;M||Aa(e,{top:t}),_s(e,t,!0),M&&Aa(e),wn(e,100)}function _s(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Br(e,t,n,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function xn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+da(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+ar(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Ur=function(e,t,n){this.cm=n;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),d=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=d.tabIndex=-1,e(r),e(d),Ne(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ne(d,"scroll",function(){d.clientWidth&&t(d.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&W<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ur.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var d=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+d)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var k=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+k)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Ur.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ur.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ur.prototype.zeroWidthHack=function(){var e=s&&!l?"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},Ur.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var d=e.getBoundingClientRect(),k=n=="vert"?document.elementFromPoint(d.right-1,(d.top+d.bottom)/2):document.elementFromPoint((d.right+d.left)/2,d.bottom-1);k!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Ur.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Tn=function(){};Tn.prototype.update=function(){return{bottom:0,right:0}},Tn.prototype.setScrollLeft=function(){},Tn.prototype.setScrollTop=function(){},Tn.prototype.clear=function(){};function Zr(e,t){t||(t=xn(e));var n=e.display.barWidth,r=e.display.barHeight;Es(e,t);for(var d=0;d<4&&n!=e.display.barWidth||r!=e.display.barHeight;d++)n!=e.display.barWidth&&e.options.lineWrapping&&zn(e),Es(e,xn(e)),n=e.display.barWidth,r=e.display.barHeight}function Es(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var xs={native:Ur,null:Tn};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),Ne(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Br(e,t):En(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function jr(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 Hr(e){var t=e.curOp;t&&Io(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;qo(n)})}function qo(e){for(var t=e.ops,n=0;n<t.length;n++)el(t[n]);for(var r=0;r<t.length;r++)tl(t[r]);for(var d=0;d<t.length;d++)il(t[d]);for(var k=0;k<t.length;k++)rl(t[k]);for(var K=0;K<t.length;K++)nl(t[K])}function el(e){var t=e.cm,n=t.display;sl(t),e.updateMaxLine&&jn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Xn(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,n=t.display;e.updatedDisplay&&zn(t),e.barMeasure=xn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+ar(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Mr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Br(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==N();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Zr(t,e.barMeasure),e.updatedDisplay&&Ra(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&gs(e.cm)}function nl(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&ws(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&_s(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Br(t,e.scrollLeft,!0,!0),e.scrollToPos){var d=$o(t,E(r,e.scrollToPos.from),E(r,e.scrollToPos.to),e.scrollToPos.margin);Xo(t,d)}var k=e.maybeHiddenMarkers,K=e.maybeUnhiddenMarkers;if(k)for(var J=0;J<k.length;++J)k[J].lines.length||Be(k[J],"hide");if(K)for(var Z=0;Z<K.length;++Z)K[Z].lines.length&&Be(K[Z],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Be(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Wi(e,t){if(e.curOp)return t();jr(e);try{return t()}finally{Hr(e)}}function pi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);jr(e);try{return t.apply(e,arguments)}finally{Hr(e)}}}function Oi(e){return function(){if(this.curOp)return e.apply(this,arguments);jr(this);try{return e.apply(this,arguments)}finally{Hr(this)}}}function mi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);jr(t);try{return e.apply(this,arguments)}finally{Hr(t)}}}function wn(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 n=+new Date+e.options.workTime,r=tt(e,t.highlightFrontier),d=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(k){if(r.line>=e.display.viewFrom){var K=k.styles,J=k.text.length>e.options.maxHighlightLength?Ft(t.mode,r.state):null,Z=ye(e,k,r,!0);J&&(r.state=J),k.styles=Z.styles;var te=k.styleClasses,de=Z.classes;de?k.styleClasses=de:te&&(k.styleClasses=null);for(var me=!K||K.length!=k.styles.length||te!=de&&(!te||!de||te.bgClass!=de.bgClass||te.textClass!=de.textClass),Ie=0;!me&&Ie<K.length;++Ie)me=K[Ie]!=k.styles[Ie];me&&d.push(r.line),k.stateAfter=r.save(),r.nextLine()}else k.text.length<=e.options.maxHighlightLength&&pt(e,k.text,r),k.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return wn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),d.length&&Wi(e,function(){for(var k=0;k<d.length;k++)Tr(e,d[k],"text")})}var Xn=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Vn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Mr(e),this.force=n,this.dims=ba(e),this.events=[]};Xn.prototype.signal=function(e,t){ve(e,t)&&this.events.push(arguments)},Xn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Be.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=ar(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=ar(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=N();if(!t||!v(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&v(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function ll(e){if(!e||!e.activeElt||e.activeElt==N())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&v(document.body,e.anchorNode)&&v(document.body,e.focusNode)){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return wr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&fs(e)==0)return!1;Cs(e)&&(wr(e),t.dims=ba(e));var d=r.first+r.size,k=Math.max(t.visible.from-e.options.viewportMargin,r.first),K=Math.min(d,t.visible.to+e.options.viewportMargin);n.viewFrom<k&&k-n.viewFrom<20&&(k=Math.max(r.first,n.viewFrom)),n.viewTo>K&&n.viewTo-K<20&&(K=Math.min(d,n.viewTo)),ci&&(k=cn(e.doc,k),K=xr(e.doc,K));var J=k!=n.viewFrom||K!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vo(e,k,K),n.viewOffset=qi(ct(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var Z=fs(e);if(!J&&Z==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var te=ol(e);return Z>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),Z>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(te),w(n.cursorDiv),w(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,J&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,wn(e,400)),n.updateLineNumbers=null,!0}function ws(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Mr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+da(e.display)-ca(e),n.top)}),t.visible=Vn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Vn(e.display,e.doc,n));if(!Ca(e,t))break;zn(e);var d=xn(e);bn(e),Zr(e,d),Ra(e,d),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 n=new Xn(e,t);if(Ca(e,n)){zn(e),ws(e,n);var r=xn(e);bn(e),Zr(e,r),Ra(e,r),n.finish()}}function ul(e,t,n){var r=e.display,d=e.options.lineNumbers,k=r.lineDiv,K=k.firstChild;function J(He){var $e=He.nextSibling;return i&&s&&e.display.currentWheelTarget==He?He.style.display="none":He.parentNode.removeChild(He),$e}for(var Z=r.view,te=r.viewFrom,de=0;de<Z.length;de++){var me=Z[de];if(!me.hidden)if(!me.node||me.node.parentNode!=k){var Ie=No(e,me,te,n);k.insertBefore(Ie,K)}else{for(;K!=me.node;)K=J(K);var Re=d&&t!=null&&t<=te&&me.lineNumber;me.changes&&(le(me.changes,"gutter")>-1&&(Re=!1),Xa(e,me,te,n)),Re&&(w(me.lineNumber),me.lineNumber.appendChild(document.createTextNode(Xi(e.options,te)))),K=me.node.nextSibling}te+=me.size}for(;K;)K=J(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+ar(e)+"px"}function Ss(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,d=t.gutters.offsetWidth,k=r+"px",K=0;K<n.length;K++)if(!n[K].hidden){e.options.fixedGutter&&(n[K].gutter&&(n[K].gutter.style.left=k),n[K].gutterBackground&&(n[K].gutterBackground.style.left=k));var J=n[K].alignable;if(J)for(var Z=0;Z<J.length;Z++)J[Z].style.left=k}e.options.fixedGutter&&(t.gutters.style.left=r+d+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Xi(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var d=r.measure.appendChild(c("div",[c("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),k=d.firstChild.offsetWidth,K=d.offsetWidth-k;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(k,r.lineGutter.offsetWidth-K)+1,r.lineNumWidth=r.lineNumInnerWidth+K,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Oa(e.display),!0}return!1}function La(e,t){for(var n=[],r=!1,d=0;d<e.length;d++){var k=e[d],K=null;if(typeof k!="string"&&(K=k.style,k=k.className),k=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:k,style:K})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function As(e){var t=e.gutters,n=e.gutterSpecs;w(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var d=n[r],k=d.className,K=d.style,J=t.appendChild(c("div",null,"CodeMirror-gutter "+k));K&&(J.style.cssText=K),k=="CodeMirror-linenumbers"&&(e.lineGutter=J,J.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Oa(e)}function Sn(e){As(e.display),Mi(e),Ss(e)}function hl(e,t,n,r){var d=this;this.input=n,d.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=T("div",null,"CodeMirror-code"),d.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=c("div",null,"CodeMirror-cursors"),d.measure=c("div",null,"CodeMirror-measure"),d.lineMeasure=c("div",null,"CodeMirror-measure"),d.lineSpace=T("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none");var k=T("div",[d.lineSpace],"CodeMirror-lines");d.mover=c("div",[k],null,"position: relative"),d.sizer=c("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=c("div",null,null,"position: absolute; height: "+ue+"px; width: 1px;"),d.gutters=c("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=c("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=c("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),G&&W<8&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),!i&&!(M&&h)&&(d.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(d.wrapper):e(d.wrapper)),d.viewFrom=d.viewTo=t.first,d.reportedViewFrom=d.reportedViewTo=t.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,d.gutterSpecs=La(r.gutters,r.lineNumbers),As(d),n.init(d)}var $n=0,Vi=null;G?Vi=-.53:M?Vi=15:g?Vi=-.7:p&&(Vi=-1/3);function Os(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function dl(e){var t=Os(e);return t.x*=Vi,t.y*=Vi,t}function Rs(e,t){var n=Os(t),r=n.x,d=n.y,k=e.display,K=k.scroller,J=K.scrollWidth>K.clientWidth,Z=K.scrollHeight>K.clientHeight;if(!(r&&J||d&&Z))return;if(d&&s&&i){e:for(var te=t.target,de=k.view;te!=K;te=te.parentNode)for(var me=0;me<de.length;me++)if(de[me].node==te){e.display.currentWheelTarget=te;break e}}if(r&&!M&&!m&&Vi!=null){d&&Z&&En(e,Math.max(0,K.scrollTop+d*Vi)),Br(e,Math.max(0,K.scrollLeft+r*Vi)),(!d||d&&Z)&&re(t),k.wheelStartX=null;return}if(d&&Vi!=null){var Ie=d*Vi,Re=e.doc.scrollTop,He=Re+k.wrapper.clientHeight;Ie<0?Re=Math.max(0,Re+Ie-50):He=Math.min(e.doc.height,He+Ie+50),Aa(e,{top:Re,bottom:He})}$n<20&&(k.wheelStartX==null?(k.wheelStartX=K.scrollLeft,k.wheelStartY=K.scrollTop,k.wheelDX=r,k.wheelDY=d,setTimeout(function(){if(k.wheelStartX==null)return;var $e=K.scrollLeft-k.wheelStartX,et=K.scrollTop-k.wheelStartY,it=et&&k.wheelDY&&et/k.wheelDY||$e&&k.wheelDX&&$e/k.wheelDX;if(k.wheelStartX=k.wheelStartY=null,!it)return;Vi=(Vi*$n+it)/($n+1),++$n},200)):(k.wheelDX+=r,k.wheelDY+=d))}var Yi=function(e,t){this.ranges=e,this.primIndex=t};Yi.prototype.primary=function(){return this.ranges[this.primIndex]},Yi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!pr(n.anchor,r.anchor)||!pr(n.head,r.head))return!1}return!0},Yi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Gt(mr(this.ranges[t].anchor),mr(this.ranges[t].head));return new Yi(e,this.primIndex)},Yi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Yi.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(Ct(t,r.from())>=0&&Ct(e,r.to())<=0)return n}return-1};var Gt=function(e,t){this.anchor=e,this.head=t};Gt.prototype.from=function(){return vr(this.anchor,this.head)},Gt.prototype.to=function(){return gr(this.anchor,this.head)},Gt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function tr(e,t,n){var r=e&&e.options.selectionsMayTouch,d=t[n];t.sort(function(Ie,Re){return Ct(Ie.from(),Re.from())}),n=le(t,d);for(var k=1;k<t.length;k++){var K=t[k],J=t[k-1],Z=Ct(J.to(),K.from());if(r&&!K.empty()?Z>0:Z>=0){var te=vr(J.from(),K.from()),de=gr(J.to(),K.to()),me=J.empty()?K.from()==K.head:J.from()==J.head;k<=n&&--n,t.splice(--k,2,new Gt(me?de:te,me?te:de))}}return new Yi(t,n)}function Sr(e,t){return new Yi([new Gt(e,t||e)],0)}function Cr(e){return e.text?Ze(e.from.line+e.text.length-1,Oe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return Cr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Cr(t).ch-t.to.ch),Ze(n,r)}function Ia(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var d=e.sel.ranges[r];n.push(new Gt(Ls(d.anchor,t),Ls(d.head,t)))}return tr(e.cm,n,e.sel.primIndex)}function Is(e,t,n){return e.line==t.line?Ze(n.line,e.ch-t.ch+n.ch):Ze(n.line+(e.line-t.line),e.ch)}function cl(e,t,n){for(var r=[],d=Ze(e.first,0),k=d,K=0;K<t.length;K++){var J=t[K],Z=Is(J.from,d,k),te=Is(Cr(J),d,k);if(d=J.to,k=te,n=="around"){var de=e.sel.ranges[K],me=Ct(de.head,de.anchor)<0;r[K]=new Gt(me?te:Z,me?Z:te)}else r[K]=new Gt(Z,Z)}return new Yi(r,e.sel.primIndex)}function Da(e){e.doc.mode=Li(e.options,e.doc.modeOption),Cn(e)}function Cn(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,wn(e,100),e.state.modeGen++,e.curOp&&Mi(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&Oe(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,n,r){function d(ut){return n?n[ut]:null}function k(ut,rt,ht){ua(ut,rt,ht,r),bi(ut,"change",ut,t)}function K(ut,rt){for(var ht=[],Tt=ut;Tt<rt;++Tt)ht.push(new kr(te[Tt],d(Tt),r));return ht}var J=t.from,Z=t.to,te=t.text,de=ct(e,J.line),me=ct(e,Z.line),Ie=Oe(te),Re=d(te.length-1),He=Z.line-J.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 $e=K(0,te.length-1);k(me,me.text,Re),He&&e.remove(J.line,He),$e.length&&e.insert(J.line,$e)}else if(de==me)if(te.length==1)k(de,de.text.slice(0,J.ch)+Ie+de.text.slice(Z.ch),Re);else{var et=K(1,te.length-1);et.push(new kr(Ie+de.text.slice(Z.ch),Re,r)),k(de,de.text.slice(0,J.ch)+te[0],d(0)),e.insert(J.line+1,et)}else if(te.length==1)k(de,de.text.slice(0,J.ch)+te[0]+me.text.slice(Z.ch),d(0)),e.remove(J.line+1,He);else{k(de,de.text.slice(0,J.ch)+te[0],d(0)),k(me,Ie+me.text.slice(Z.ch),Re);var it=K(1,te.length-1);He>1&&e.remove(J.line+1,He-1),e.insert(J.line+1,it)}bi(e,"change",e,t)}function Ar(e,t,n){function r(d,k,K){if(d.linked)for(var J=0;J<d.linked.length;++J){var Z=d.linked[J];if(Z.doc==k)continue;var te=K&&Z.sharedHist;if(n&&!te)continue;t(Z.doc,te),r(Z.doc,d,te)}}r(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||jn(e),e.options.mode=t.modeOption,Mi(e)}function Ms(e){(e.doc.direction=="rtl"?B:C)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Wi(e,function(){Ms(e),Mi(e)})}function Jn(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 n={from:mr(t.from),to:Cr(t),text:Ui(e,t.from,t.to)};return Fs(e,n,t.from.line,t.to.line+1),Ar(e,function(r){return Fs(r,n,t.from.line,t.to.line+1)},!0),n}function Ps(e){for(;e.length;){var t=Oe(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ps(e.done),Oe(e.done);if(e.done.length&&!Oe(e.done).ranges)return Oe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Oe(e.done)}function Ns(e,t,n,r){var d=e.history;d.undone.length=0;var k=+new Date,K,J;if((d.lastOp==r||d.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&d.lastModTime>k-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(K=pl(d,d.lastOp==r)))J=Oe(K.changes),Ct(t.from,t.to)==0&&Ct(t.from,J.to)==0?J.to=Cr(t):K.changes.push(Ma(e,t));else{var Z=Oe(d.done);for((!Z||!Z.ranges)&&Qn(e.sel,d.done),K={changes:[Ma(e,t)],generation:d.generation},d.done.push(K);d.done.length>d.undoDepth;)d.done.shift(),d.done[0].ranges||d.done.shift()}d.done.push(n),d.generation=++d.maxGeneration,d.lastModTime=d.lastSelTime=k,d.lastOp=d.lastSelOp=r,d.lastOrigin=d.lastSelOrigin=t.origin,J||Be(e,"historyAdded")}function ml(e,t,n,r){var d=t.charAt(0);return d=="*"||d=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,r){var d=e.history,k=r&&r.origin;n==d.lastSelOp||k&&d.lastSelOrigin==k&&(d.lastModTime==d.lastSelTime&&d.lastOrigin==k||ml(e,k,Oe(d.done),t))?d.done[d.done.length-1]=t:Qn(t,d.done),d.lastSelTime=+new Date,d.lastSelOrigin=k,d.lastSelOp=n,r&&r.clearRedo!==!1&&Ps(d.undone)}function Qn(e,t){var n=Oe(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Fs(e,t,n,r){var d=t["spans_"+e.id],k=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(K){K.markedSpans&&((d||(d=t["spans_"+e.id]={}))[k]=K.markedSpans),++k})}function vl(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function yl(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],d=0;d<t.text.length;++d)r.push(vl(n[d]));return r}function Bs(e,t){var n=yl(e,t),r=Zi(e,t);if(!n)return r;if(!r)return n;for(var d=0;d<n.length;++d){var k=n[d],K=r[d];if(k&&K){e:for(var J=0;J<K.length;++J){for(var Z=K[J],te=0;te<k.length;++te)if(k[te].marker==Z.marker)continue e;k.push(Z)}}else K&&(n[d]=K)}return n}function qr(e,t,n){for(var r=[],d=0;d<e.length;++d){var k=e[d];if(k.ranges){r.push(n?Yi.prototype.deepCopy.call(k):k);continue}var K=k.changes,J=[];r.push({changes:J});for(var Z=0;Z<K.length;++Z){var te=K[Z],de=void 0;if(J.push({from:te.from,to:te.to,text:te.text}),t)for(var me in te)(de=me.match(/^spans_(\d+)$/))&&(le(t,Number(de[1]))>-1&&(Oe(J)[me]=te[me],delete te[me]))}}return r}function Pa(e,t,n,r){if(r){var d=e.anchor;if(n){var k=Ct(t,d)<0;k!=Ct(n,d)<0?(d=t,t=n):k!=Ct(t,n)<0&&(t=n)}return new Gt(d,t)}else return new Gt(n||t,t)}function Zn(e,t,n,r,d){d==null&&(d=e.cm&&(e.cm.display.shift||e.extend)),wi(e,new Yi([Pa(e.sel.primary(),t,n,d)],0),r)}function Us(e,t,n){for(var r=[],d=e.cm&&(e.cm.display.shift||e.extend),k=0;k<e.sel.ranges.length;k++)r[k]=Pa(e.sel.ranges[k],t[k],null,d);var K=tr(e.cm,r,e.sel.primIndex);wi(e,K,n)}function Na(e,t,n,r){var d=e.sel.ranges.slice(0);d[t]=n,wi(e,tr(e.cm,d,e.sel.primIndex),r)}function js(e,t,n,r){wi(e,Sr(t,n),r)}function bl(e,t,n){var r={ranges:t.ranges,update:function(d){this.ranges=[];for(var k=0;k<d.length;k++)this.ranges[k]=new Gt(E(e,d[k].anchor),E(e,d[k].head))},origin:n&&n.origin};return Be(e,"beforeSelectionChange",e,r),e.cm&&Be(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?tr(e.cm,r.ranges,r.ranges.length-1):t}function Hs(e,t,n){var r=e.history.done,d=Oe(r);d&&d.ranges?(r[r.length-1]=t,qn(e,t,n)):wi(e,t,n)}function wi(e,t,n){qn(e,t,n),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function qn(e,t,n){(ve(e,"beforeSelectionChange")||e.cm&&ve(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,n));var r=n&&n.bias||(Ct(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,Ks(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&Qr(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,Te(e.cm)),bi(e,"cursorActivity",e)}function Gs(e){Ws(e,Ks(e,e.sel,null,!1))}function Ks(e,t,n,r){for(var d,k=0;k<t.ranges.length;k++){var K=t.ranges[k],J=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[k],Z=ea(e,K.anchor,J&&J.anchor,n,r),te=ea(e,K.head,J&&J.head,n,r);(d||Z!=K.anchor||te!=K.head)&&(d||(d=t.ranges.slice(0,k)),d[k]=new Gt(Z,te))}return d?tr(e.cm,d,t.primIndex):t}function en(e,t,n,r,d){var k=ct(e,t.line);if(k.markedSpans)for(var K=0;K<k.markedSpans.length;++K){var J=k.markedSpans[K],Z=J.marker,te="selectLeft"in Z?!Z.selectLeft:Z.inclusiveLeft,de="selectRight"in Z?!Z.selectRight:Z.inclusiveRight;if((J.from==null||(te?J.from<=t.ch:J.from<t.ch))&&(J.to==null||(de?J.to>=t.ch:J.to>t.ch))){if(d&&(Be(Z,"beforeCursorEnter"),Z.explicitlyCleared))if(k.markedSpans){--K;continue}else break;if(!Z.atomic)continue;if(n){var me=Z.find(r<0?1:-1),Ie=void 0;if((r<0?de:te)&&(me=zs(e,me,-r,me&&me.line==t.line?k:null)),me&&me.line==t.line&&(Ie=Ct(me,n))&&(r<0?Ie<0:Ie>0))return en(e,me,t,r,d)}var Re=Z.find(r<0?-1:1);return(r<0?te:de)&&(Re=zs(e,Re,r,Re.line==t.line?k:null)),Re?en(e,Re,t,r,d):null}}return t}function ea(e,t,n,r,d){var k=r||1,K=en(e,t,n,k,d)||!d&&en(e,t,n,k,!0)||en(e,t,n,-k,d)||!d&&en(e,t,n,-k,!0);return K||(e.cantEdit=!0,Ze(e.first,0))}function zs(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?E(e,Ze(t.line-1)):null:n>0&&t.ch==(r||ct(e,t.line)).text.length?t.line<e.first+e.size-1?Ze(t.line+1,0):null:new Ze(t.line,t.ch+n)}function Vs(e){e.setSelection(Ze(e.firstLine(),0),Ze(e.lastLine()),we)}function Ys(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(d,k,K,J){d&&(r.from=E(e,d)),k&&(r.to=E(e,k)),K&&(r.text=K),J!==void 0&&(r.origin=J)}),Be(e,"beforeChange",e,r),e.cm&&Be(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function tn(e,t,n){if(e.cm){if(!e.cm.curOp)return pi(e.cm,tn)(e,t,n);if(e.cm.state.suppressEdits)return}if((ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"))&&(t=Ys(e,t,!0),!t))return;var r=Ir&&!n&&br(e,t.from,t.to);if(r)for(var d=r.length-1;d>=0;--d)Xs(e,{from:r[d].from,to:r[d].to,text:d?[""]:t.text,origin:t.origin});else Xs(e,t)}function Xs(e,t){if(t.text.length==1&&t.text[0]==""&&Ct(t.from,t.to)==0)return;var n=Ia(e,t);Ns(e,t,n,e.cm?e.cm.curOp.id:NaN),An(e,t,n,Zi(e,t));var r=[];Ar(e,function(d,k){!k&&le(r,d.history)==-1&&(Zs(d.history,t),r.push(d.history)),An(d,t,null,Zi(d,t))})}function ta(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var d=e.history,k,K=e.sel,J=t=="undo"?d.done:d.undone,Z=t=="undo"?d.undone:d.done,te=0;te<J.length&&!(k=J[te],n?k.ranges&&!k.equals(e.sel):!k.ranges);te++);if(te==J.length)return;for(d.lastOrigin=d.lastSelOrigin=null;;)if(k=J.pop(),k.ranges){if(Qn(k,Z),n&&!k.equals(e.sel)){wi(e,k,{clearRedo:!1});return}K=k}else if(r){J.push(k);return}else break;var de=[];Qn(K,Z),Z.push({changes:de,generation:d.generation}),d.generation=k.generation||++d.maxGeneration;for(var me=ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"),Ie=function($e){var et=k.changes[$e];if(et.origin=t,me&&!Ys(e,et,!1))return J.length=0,{};de.push(Ma(e,et));var it=$e?Ia(e,et):Oe(J);An(e,et,it,Bs(e,et)),!$e&&e.cm&&e.cm.scrollIntoView({from:et.from,to:Cr(et)});var ut=[];Ar(e,function(rt,ht){!ht&&le(ut,rt.history)==-1&&(Zs(rt.history,et),ut.push(rt.history)),An(rt,et,null,Bs(rt,et))})},Re=k.changes.length-1;Re>=0;--Re){var He=Ie(Re);if(He)return He.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Yi(xe(e.sel.ranges,function(d){return new Gt(Ze(d.anchor.line+t,d.anchor.ch),Ze(d.head.line+t,d.head.ch))}),e.sel.primIndex),e.cm){Mi(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Tr(e.cm,r,"gutter")}}function An(e,t,n,r){if(e.cm&&!e.cm.curOp)return pi(e.cm,An)(e,t,n,r);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 d=t.text.length-1-(e.first-t.from.line);$s(e,d),t={from:Ze(e.first,0),to:Ze(t.to.line+d,t.to.ch),text:[Oe(t.text)],origin:t.origin}}var k=e.lastLine();t.to.line>k&&(t={from:t.from,to:Ze(k,ct(e,k).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ui(e,t.from,t.to),n||(n=Ia(e,t)),e.cm?_l(e.cm,t,r):ka(e,t,r),qn(e,n,we),e.cantEdit&&ea(e,Ze(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,n){var r=e.doc,d=e.display,k=t.from,K=t.to,J=!1,Z=k.line;e.options.lineWrapping||(Z=Ot(Ai(ct(r,k.line))),r.iter(Z,K.line+1,function(Re){if(Re==d.maxLine)return J=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Te(e),ka(r,t,n,cs(e)),e.options.lineWrapping||(r.iter(Z,k.line+t.text.length,function(Re){var He=pn(Re);He>d.maxLineLength&&(d.maxLine=Re,d.maxLineLength=He,d.maxLineChanged=!0,J=!1)}),J&&(e.curOp.updateMaxLine=!0)),Qi(r,k.line),wn(e,400);var te=t.text.length-(K.line-k.line)-1;t.full?Mi(e):k.line==K.line&&t.text.length==1&&!Ds(e.doc,t)?Tr(e,k.line,"text"):Mi(e,k.line,K.line+1,te);var de=ve(e,"changes"),me=ve(e,"change");if(me||de){var Ie={from:k,to:K,text:t.text,removed:t.removed,origin:t.origin};me&&bi(e,"change",e,Ie),de&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ie)}e.display.selForContextMenu=null}function rn(e,t,n,r,d){var k;r||(r=n),Ct(r,n)<0&&(k=[r,n],n=k[0],r=k[1]),typeof t=="string"&&(t=e.splitLines(t)),tn(e,{from:n,to:r,text:t,origin:d})}function Js(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Qs(e,t,n,r){for(var d=0;d<e.length;++d){var k=e[d],K=!0;if(k.ranges){k.copied||(k=e[d]=k.deepCopy(),k.copied=!0);for(var J=0;J<k.ranges.length;J++)Js(k.ranges[J].anchor,t,n,r),Js(k.ranges[J].head,t,n,r);continue}for(var Z=0;Z<k.changes.length;++Z){var te=k.changes[Z];if(n<te.from.line)te.from=Ze(te.from.line+r,te.from.ch),te.to=Ze(te.to.line+r,te.to.ch);else if(t<=te.to.line){K=!1;break}}K||(e.splice(0,d+1),d=0)}}function Zs(e,t){var n=t.from.line,r=t.to.line,d=t.text.length-(r-n)-1;Qs(e.done,n,r,d),Qs(e.undone,n,r,d)}function On(e,t,n,r){var d=t,k=t;return typeof t=="number"?k=ct(e,V(e,t)):d=Ot(t),d==null?null:(r(k,d)&&e.cm&&Tr(e.cm,d,n),k)}function Rn(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}Rn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var d=this.lines[n];this.height-=d.height,gt(d),bi(d,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function Ln(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var d=e[r];t+=d.chunkSize(),n+=d.height,d.parent=this}this.size=t,this.height=n,this.parent=null}Ln.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],d=r.chunkSize();if(e<d){var k=Math.min(t,d-e),K=r.height;if(r.removeInner(e,k),this.height-=K-r.height,d==k&&(this.children.splice(n--,1),r.parent=null),(t-=k)==0)break;e=0}else e-=d}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Rn))){var J=[];this.collapse(J),this.children=[new Rn(J)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var d=this.children[r],k=d.chunkSize();if(e<=k){if(d.insertInner(e,t,n),d.lines&&d.lines.length>50){for(var K=d.lines.length%25+25,J=K;J<d.lines.length;){var Z=new Rn(d.lines.slice(J,J+=25));d.height-=Z.height,this.children.splice(++r,0,Z),Z.parent=this}d.lines=d.lines.slice(0,K),this.maybeSpill()}break}e-=k}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Ln(t);if(e.parent){e.size-=n.size,e.height-=n.height;var d=le(e.parent.children,e);e.parent.children.splice(d+1,0,n)}else{var r=new Ln(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var d=this.children[r],k=d.chunkSize();if(e<k){var K=Math.min(t,k-e);if(d.iterN(e,K,n))return!0;if((t-=K)==0)break;e=0}else e-=k}}};var In=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};In.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Ot(n);if(r==null||!t)return;for(var d=0;d<t.length;++d)t[d]==this&&t.splice(d--,1);t.length||(n.widgets=null);var k=vn(this);Jt(n,Math.max(0,n.height-k)),e&&(Wi(e,function(){qs(e,n,-k),Tr(e,r,"widget")}),bi(e,"lineWidgetCleared",e,this,r))},In.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var d=vn(this)-t;if(!d)return;nr(this.doc,r)||Jt(r,r.height+d),n&&Wi(n,function(){n.curOp.forceUpdate=!0,qs(n,r,d),bi(n,"lineWidgetChanged",n,e,Ot(r))})},_e(In);function qs(e,t,n){qi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,n)}function El(e,t,n,r){var d=new In(e,n,r),k=e.cm;return k&&d.noHScroll&&(k.display.alignWidgets=!0),On(e,t,"widget",function(K){var J=K.widgets||(K.widgets=[]);if(d.insertAt==null?J.push(d):J.splice(Math.min(J.length-1,Math.max(0,d.insertAt)),0,d),d.line=K,k&&!nr(e,K)){var Z=qi(K)<e.scrollTop;Jt(K,K.height+vn(d)),Z&&Sa(k,d.height),k.curOp.forceUpdate=!0}return!0}),k&&bi(k,"lineWidgetAdded",k,d,typeof t=="number"?t:Ot(t)),d}var eo=0,Or=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};Or.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&jr(e),ve(this,"clear")){var n=this.find();n&&bi(this,"clear",n.from,n.to)}for(var r=null,d=null,k=0;k<this.lines.length;++k){var K=this.lines[k],J=Hi(K.markedSpans,this);e&&!this.collapsed?Tr(e,Ot(K),"text"):e&&(J.to!=null&&(d=Ot(K)),J.from!=null&&(r=Ot(K))),K.markedSpans=Dr(K.markedSpans,J),J.from==null&&this.collapsed&&!nr(this.doc,K)&&e&&Jt(K,Xr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var Z=0;Z<this.lines.length;++Z){var te=Ai(this.lines[Z]),de=pn(te);de>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=de,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Mi(e,r,d+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&bi(e,"markerCleared",e,this,r,d),t&&Hr(e),this.parent&&this.parent.clear()},Or.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,d=0;d<this.lines.length;++d){var k=this.lines[d],K=Hi(k.markedSpans,this);if(K.from!=null&&(n=Ze(t?k:Ot(k),K.from),e==-1))return n;if(K.to!=null&&(r=Ze(t?k:Ot(k),K.to),e==1))return r}return n&&{from:n,to:r}},Or.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;if(!t||!r)return;Wi(r,function(){var d=t.line,k=Ot(t.line),K=fa(r,k);if(K&&(ns(K),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!nr(n.doc,d)&&n.height!=null){var J=n.height;n.height=null;var Z=vn(n)-J;Z&&Jt(d,d.height+Z)}bi(r,"markerChanged",r,e)})},Or.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||le(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Or.prototype.detachLine=function(e){if(this.lines.splice(le(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},_e(Or);function nn(e,t,n,r,d){if(r&&r.shared)return xl(e,t,n,r,d);if(e.cm&&!e.cm.curOp)return pi(e.cm,nn)(e,t,n,r,d);var k=new Or(e,d),K=Ct(t,n);if(r&&b(r,k,!1),K>0||K==0&&k.clearWhenEmpty!==!1)return k;if(k.replacedWith&&(k.collapsed=!0,k.widgetNode=T("span",[k.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||k.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(k.widgetNode.insertLeft=!0)),k.collapsed){if(fi(e,t.line,t,n,k)||t.line!=n.line&&fi(e,n.line,t,n,k))throw new Error("Inserting collapsed marker partially overlapping an existing one");lr()}k.addToHistory&&Ns(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var J=t.line,Z=e.cm,te;if(e.iter(J,n.line+1,function(me){Z&&k.collapsed&&!Z.options.lineWrapping&&Ai(me)==Z.display.maxLine&&(te=!0),k.collapsed&&J!=t.line&&Jt(me,0),yr(me,new ur(k,J==t.line?t.ch:null,J==n.line?n.ch:null)),++J}),k.collapsed&&e.iter(t.line,n.line+1,function(me){nr(e,me)&&Jt(me,0)}),k.clearOnEnter&&Ne(k,"beforeCursorEnter",function(){return k.clear()}),k.readOnly&&(zi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),k.collapsed&&(k.id=++eo,k.atomic=!0),Z){if(te&&(Z.curOp.updateMaxLine=!0),k.collapsed)Mi(Z,t.line,n.line+1);else if(k.className||k.startStyle||k.endStyle||k.css||k.attributes||k.title)for(var de=t.line;de<=n.line;de++)Tr(Z,de,"text");k.atomic&&Gs(Z.doc),bi(Z,"markerAdded",Z,k)}return k}var Dn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Dn.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();bi(this,"clear")},Dn.prototype.find=function(e,t){return this.primary.find(e,t)},_e(Dn);function xl(e,t,n,r,d){r=b(r),r.shared=!1;var k=[nn(e,t,n,r,d)],K=k[0],J=r.widgetNode;return Ar(e,function(Z){J&&(r.widgetNode=J.cloneNode(!0)),k.push(nn(Z,E(Z,t),E(Z,n),r,d));for(var te=0;te<Z.linked.length;++te)if(Z.linked[te].isParent)return;K=Oe(k)}),new Dn(k,K)}function to(e){return e.findMarks(Ze(e.first,0),e.clipPos(Ze(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var n=0;n<t.length;n++){var r=t[n],d=r.find(),k=e.clipPos(d.from),K=e.clipPos(d.to);if(Ct(k,K)){var J=nn(e,k,K,r.primary,r.primary.type);r.markers.push(J),J.parent=r}}}function wl(e){for(var t=function(r){var d=e[r],k=[d.primary.doc];Ar(d.primary.doc,function(Z){return k.push(Z)});for(var K=0;K<d.markers.length;K++){var J=d.markers[K];le(k,J.doc)==-1&&(J.parent=null,d.markers.splice(K--,1))}},n=0;n<e.length;n++)t(n)}var Sl=0,Pi=function(e,t,n,r,d){if(!(this instanceof Pi))return new Pi(e,t,n,r,d);n==null&&(n=0),Ln.call(this,[new Rn([new kr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var k=Ze(n,0);this.sel=Sr(k),this.history=new Jn(null),this.id=++Sl,this.modeOption=t,this.lineSep=r,this.direction=d=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ka(this,{from:k,to:k,text:e}),wi(this,Sr(k),we)};Pi.prototype=Ge(Ln.prototype,{constructor:Pi,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Vt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:mi(function(e){var t=Ze(this.first,0),n=this.first+this.size-1;tn(this,{from:t,to:Ze(n,ct(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&_n(this.cm,0,0),wi(this,Sr(t),we)}),replaceRange:function(e,t,n,r){t=E(this,t),n=n?E(this,n):t,rn(this,e,t,n,r)},getRange:function(e,t,n){var r=Ui(this,E(this,e),E(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ii(this,e))return ct(this,e)},getLineNumber:function(e){return Ot(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ct(this,e)),Ai(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(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:mi(function(e,t,n){js(this,E(this,typeof e=="number"?Ze(e,t||0):e),null,n)}),setSelection:mi(function(e,t,n){js(this,E(this,e),E(this,t||e),n)}),extendSelection:mi(function(e,t,n){Zn(this,E(this,e),t&&E(this,t),n)}),extendSelections:mi(function(e,t){Us(this,H(this,e),t)}),extendSelectionsBy:mi(function(e,t){var n=xe(this.sel.ranges,e);Us(this,H(this,n),t)}),setSelections:mi(function(e,t,n){if(!e.length)return;for(var r=[],d=0;d<e.length;d++)r[d]=new Gt(E(this,e[d].anchor),E(this,e[d].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),wi(this,tr(this.cm,r,t),n)}),addSelection:mi(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Gt(E(this,e),E(this,t||e))),wi(this,tr(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var d=Ui(this,t[r].from(),t[r].to());n=n?n.concat(d):d}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var d=Ui(this,n[r].from(),n[r].to());e!==!1&&(d=d.join(e||this.lineSeparator())),t[r]=d}return t},replaceSelection:function(e,t,n){for(var r=[],d=0;d<this.sel.ranges.length;d++)r[d]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:mi(function(e,t,n){for(var r=[],d=this.sel,k=0;k<d.ranges.length;k++){var K=d.ranges[k];r[k]={from:K.from(),to:K.to(),text:this.splitLines(e[k]),origin:n}}for(var J=t&&t!="end"&&cl(this,r,t),Z=r.length-1;Z>=0;Z--)tn(this,r[Z]);J?Hs(this,J):this.cm&&Qr(this.cm)}),undo:mi(function(){ta(this,"undo")}),redo:mi(function(){ta(this,"redo")}),undoSelection:mi(function(){ta(this,"undo",!0)}),redoSelection:mi(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,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var d=0;d<e.undone.length;d++)e.undone[d].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Jn(this.history.maxGeneration),Ar(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:qr(this.history.done),undone:qr(this.history.undone)}},setHistory:function(e){var t=this.history=new Jn(this.history.maxGeneration);t.done=qr(e.done.slice(0),null,!0),t.undone=qr(e.undone.slice(0),null,!0)},setGutterMarker:mi(function(e,t,n){return On(this,e,"gutter",function(r){var d=r.gutterMarkers||(r.gutterMarkers={});return d[t]=n,!n&&oe(d)&&(r.gutterMarkers=null),!0})}),clearGutter:mi(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&On(t,n,"gutter",function(){return n.gutterMarkers[e]=null,oe(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Ii(this,e))return null;if(t=e,e=ct(this,e),!e)return null}else if(t=Ot(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:mi(function(e,t,n){return On(this,e,t=="gutter"?"gutter":"class",function(r){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[d])r[d]=n;else{if(R(n).test(r[d]))return!1;r[d]+=" "+n}return!0})}),removeLineClass:mi(function(e,t,n){return On(this,e,t=="gutter"?"gutter":"class",function(r){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",k=r[d];if(k)if(n==null)r[d]=null;else{var K=k.match(R(n));if(!K)return!1;var J=K.index+K[0].length;r[d]=k.slice(0,K.index)+(!K.index||J==k.length?"":" ")+k.slice(J)||null}else return!1;return!0})}),addLineWidget:mi(function(e,t,n){return El(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return nn(this,E(this,e),E(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=E(this,e),nn(this,e,e,n,"bookmark")},findMarksAt:function(e){e=E(this,e);var t=[],n=ct(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var d=n[r];(d.from==null||d.from<=e.ch)&&(d.to==null||d.to>=e.ch)&&t.push(d.marker.parent||d.marker)}return t},findMarks:function(e,t,n){e=E(this,e),t=E(this,t);var r=[],d=e.line;return this.iter(e.line,t.line+1,function(k){var K=k.markedSpans;if(K)for(var J=0;J<K.length;J++){var Z=K[J];!(Z.to!=null&&d==e.line&&e.ch>=Z.to||Z.from==null&&d!=e.line||Z.from!=null&&d==t.line&&Z.from>=t.ch)&&(!n||n(Z.marker))&&r.push(Z.marker.parent||Z.marker)}++d}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(d){var k=d.text.length+r;if(k>e)return t=e,!0;e-=k,++n}),E(this,Ze(n,t))},indexFromPos:function(e){e=E(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new Pi(Vt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new Pi(Vt(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(r,to(this)),r},unlinkDoc:function(e){if(e instanceof Zt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(to(this));break}if(e.history==this.history){var r=[e.id];Ar(e,function(d){return r.push(d.id)},!0),e.history=new Jn(null),e.history.done=qr(this.history.done,r),e.history.undone=qr(this.history.undone,r)}},iterLinkedDocs:function(e){Ar(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):St(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:mi(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)})}),Pi.prototype.eachLine=Pi.prototype.iter;var io=0;function Cl(e){var t=this;if(ro(t),Ue(t,e)||dr(t.display,e))return;re(e),G&&(io=+new Date);var n=Nr(t,e,!0),r=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var d=r.length,k=Array(d),K=0,J=function(){++K==d&&pi(t,function(){n=E(t.doc,n);var Re={from:n,to:n,text:t.doc.splitLines(k.filter(function(He){return He!=null}).join(t.doc.lineSeparator())),origin:"paste"};tn(t.doc,Re),Hs(t.doc,Sr(E(t.doc,n),E(t.doc,Cr(Re))))})()},Z=function(Re,He){if(t.options.allowDropFileTypes&&le(t.options.allowDropFileTypes,Re.type)==-1){J();return}var $e=new FileReader;$e.onerror=function(){return J()},$e.onload=function(){var et=$e.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(et)){J();return}k[He]=et,J()},$e.readAsText(Re)},te=0;te<r.length;te++)Z(r[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var de=e.dataTransfer.getData("Text");if(de){var me;if(t.state.draggingText&&!t.state.draggingText.copy&&(me=t.listSelections()),qn(t.doc,Sr(n,n)),me)for(var Ie=0;Ie<me.length;++Ie)rn(t.doc,"",me[Ie].anchor,me[Ie].head,"drag");t.replaceSelection(de,"around","paste"),t.display.input.focus()}}catch(Re){}}}function Al(e,t){if(G&&(!e.state.draggingText||+new Date-io<100)){fe(t);return}if(Ue(e,t)||dr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var n=c("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),m&&n.parentNode.removeChild(n)}}function Ol(e,t){var n=Nr(e,t);if(!n)return;var r=document.createDocumentFragment();ms(e,n,r),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),x(e.display.dragCursor,r)}function ro(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function no(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var d=t[r].CodeMirror;d&&n.push(d)}n.length&&n[0].operation(function(){for(var k=0;k<n.length;k++)e(n[k])})}var ao=!1;function Rl(){if(ao)return;Ll(),ao=!0}function Ll(){var e;Ne(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,no(Il)},100))}),Ne(window,"blur",function(){return no(Jr)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Rr={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"},kn=0;kn<10;kn++)Rr[kn+48]=Rr[kn+96]=String(kn);for(var ia=65;ia<=90;ia++)Rr[ia]=String.fromCharCode(ia);for(var Mn=1;Mn<=12;Mn++)Rr[Mn+111]=Rr[Mn+63235]="F"+Mn;var cr={};cr.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"},cr.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"},cr.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"},cr.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"]},cr.default=s?cr.macDefault:cr.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,d,k,K=0;K<t.length-1;K++){var J=t[K];if(/^(cmd|meta|m)$/i.test(J))k=!0;else if(/^a(lt)?$/i.test(J))n=!0;else if(/^(c|ctrl|control)$/i.test(J))r=!0;else if(/^s(hift)?$/i.test(J))d=!0;else throw new Error("Unrecognized modifier name: "+J)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),k&&(e="Cmd-"+e),d&&(e="Shift-"+e),e}function kl(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var d=xe(n.split(" "),Dl),k=0;k<d.length;k++){var K=void 0,J=void 0;k==d.length-1?(J=d.join(" "),K=r):(J=d.slice(0,k+1).join(" "),K="...");var Z=t[J];if(!Z)t[J]=K;else if(Z!=K)throw new Error("Inconsistent bindings for "+J)}delete e[n]}for(var te in t)e[te]=t[te];return e}function an(e,t,n,r){t=ra(t);var d=t.call?t.call(e,r):t[e];if(d===!1)return"nothing";if(d==="...")return"multi";if(d!=null&&n(d))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return an(e,t.fallthrough,n,r);for(var k=0;k<t.fallthrough.length;k++){var K=an(e,t.fallthrough[k],n,r);if(K)return K}}}function so(e){var t=typeof e=="string"?e:Rr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(S?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(S?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(m&&e.keyCode==34&&e.char)return!1;var n=Rr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),oo(n,e,t))}function ra(e){return typeof e=="string"?cr[e]:e}function sn(e,t){for(var n=e.doc.sel.ranges,r=[],d=0;d<n.length;d++){for(var k=t(n[d]);r.length&&Ct(k.from,Oe(r).to)<=0;){var K=r.pop();if(Ct(K.from,k.from)<0){k.from=K.from;break}}r.push(k)}Wi(e,function(){for(var J=r.length-1;J>=0;J--)rn(e.doc,"",r[J].from,r[J].to,"+delete");Qr(e)})}function Fa(e,t,n){var r=Ce(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ba(e,t,n){var r=Fa(e,t.ch,n);return r==null?null:new Ze(t.line,r,n<0?"after":"before")}function Ua(e,t,n,r,d){if(e){t.doc.direction=="rtl"&&(d=-d);var k=Xe(n,t.doc.direction);if(k){var K=d<0?Oe(k):k[0],J=d<0==(K.level==1),Z=J?"after":"before",te;if(K.level>0||t.doc.direction=="rtl"){var de=Yr(t,n);te=d<0?n.text.length-1:0;var me=sr(t,de,te).top;te=je(function(Ie){return sr(t,de,Ie).top==me},d<0==(K.level==1)?K.from:K.to-1,te),Z=="before"&&(te=Fa(n,te,1))}else te=d<0?K.to:K.from;return new Ze(r,te,Z)}}return new Ze(r,d<0?n.text.length:0,d<0?"before":"after")}function Ml(e,t,n,r){var d=Xe(t,e.doc.direction);if(!d)return Ba(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var k=Je(d,n.ch,n.sticky),K=d[k];if(e.doc.direction=="ltr"&&K.level%2==0&&(r>0?K.to>n.ch:K.from<n.ch))return Ba(t,n,r);var J=function(it,ut){return Fa(t,it instanceof Ze?it.ch:it,ut)},Z,te=function(it){return e.options.lineWrapping?(Z=Z||Yr(e,t),ds(e,t,Z,it)):{begin:0,end:t.text.length}},de=te(n.sticky=="before"?J(n,-1):n.ch);if(e.doc.direction=="rtl"||K.level==1){var me=K.level==1==r<0,Ie=J(n,me?1:-1);if(Ie!=null&&(me?Ie<=K.to&&Ie<=de.end:Ie>=K.from&&Ie>=de.begin)){var Re=me?"before":"after";return new Ze(n.line,Ie,Re)}}var He=function(it,ut,rt){for(var ht=function(Xt,gi){return gi?new Ze(n.line,J(Xt,1),"before"):new Ze(n.line,Xt,"after")};it>=0&&it<d.length;it+=ut){var Tt=d[it],vt=ut>0==(Tt.level!=1),Rt=vt?rt.begin:J(rt.end,-1);if(Tt.from<=Rt&&Rt<Tt.to)return ht(Rt,vt);if(Rt=vt?Tt.from:J(Tt.to,-1),rt.begin<=Rt&&Rt<rt.end)return ht(Rt,vt)}},$e=He(k+r,r,de);if($e)return $e;var et=r>0?de.end:J(de.begin,-1);return et!=null&&!(r>0&&et==t.text.length)&&($e=He(r>0?0:d.length-1,r,te(et)),$e)?$e:null}var Pn={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),we)},killLine:function(e){return sn(e,function(t){if(t.empty()){var n=ct(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:Ze(t.head.line+1,0)}:{from:t.head,to:Ze(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return sn(e,function(t){return{from:Ze(t.from().line,0),to:E(e.doc,Ze(t.to().line+1,0))}})},delLineLeft:function(e){return sn(e,function(t){return{from:Ze(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return sn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return sn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Ze(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ze(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 n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},ce)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},ce)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ho(e,t.head):r},ce)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,d=0;d<n.length;d++){var k=n[d].from(),K=Y(e.getLine(k.line),k.ch,r);t.push(ae(r-K%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Wi(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var d=t[r].head,k=ct(e.doc,d.line).text;if(k){if(d.ch==k.length&&(d=new Ze(d.line,d.ch-1)),d.ch>0)d=new Ze(d.line,d.ch+1),e.replaceRange(k.charAt(d.ch-1)+k.charAt(d.ch-2),Ze(d.line,d.ch-2),d,"+transpose");else if(d.line>e.doc.first){var K=ct(e.doc,d.line-1).text;K&&(d=new Ze(d.line,1),e.replaceRange(k.charAt(0)+e.doc.lineSeparator()+K.charAt(K.length-1),Ze(d.line-1,K.length-1),d,"+transpose"))}}n.push(new Gt(d,d))}e.setSelections(n)})},newlineAndIndent:function(e){return Wi(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Qr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var n=ct(e.doc,t),r=Ai(n);return r!=n&&(t=Ot(r)),Ua(!0,e,r,t,1)}function Pl(e,t){var n=ct(e.doc,t),r=Vr(n);return r!=n&&(t=Ot(r)),Ua(!0,e,n,t,-1)}function ho(e,t){var n=uo(e,t.line),r=ct(e.doc,n.line),d=Xe(r,e.doc.direction);if(!d||d[0].level==0){var k=Math.max(n.ch,r.text.search(/\S/)),K=t.line==n.line&&t.ch<=k&&t.ch;return Ze(n.line,K?0:k,n.sticky)}return n}function na(e,t,n){if(typeof t=="string"&&(t=Pn[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),d=t(e)!=ke}finally{e.display.shift=r,e.state.suppressEdits=!1}return d}function Nl(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var d=an(t,e.state.keyMaps[r],n,e);if(d)return d}return e.options.extraKeys&&an(t,e.options.extraKeys,n,e)||an(t,e.options.keyMap,n,e)}var Fl=new ee;function Nn(e,t,n,r){var d=e.state.keySeq;if(d){if(so(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==d&&(e.state.keySeq=null,e.display.input.reset())}),co(e,d+" "+t,n,r))return!0}return co(e,t,n,r)}function co(e,t,n,r){var d=Nl(e,t,r);return d=="multi"&&(e.state.keySeq=t),d=="handled"&&bi(e,"keyHandled",e,t,n),(d=="handled"||d=="multi")&&(re(n),xa(e)),!!d}function fo(e,t){var n=lo(t,!0);return n?t.shiftKey&&!e.state.keySeq?Nn(e,"Shift-"+n,t,function(r){return na(e,r,!0)})||Nn(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return na(e,r)}):Nn(e,n,t,function(r){return na(e,r)}):!1}function Bl(e,t,n){return Nn(e,"'"+n+"'",t,function(r){return na(e,r,!0)})}var ja=null;function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=N(),Ue(t,e))return;G&&W<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=fo(t,e);m&&(ja=r?n:null,!r&&n==88&&!Ut&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),M&&!s&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;B(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(C(t,"CodeMirror-crosshair"),nt(document,"keyup",n),nt(document,"mouseover",n))}Ne(document,"keyup",n),Ne(document,"mouseover",n)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ue(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(dr(t.display,e)||Ue(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(m&&n==ja){ja=null,re(e);return}if(m&&(!e.which||e.which<10)&&fo(t,e))return;var d=String.fromCharCode(r==null?n:r);if(d=="\b")return;if(Bl(t,e,d))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,n){this.time=e,this.pos=t,this.button=n};Ha.prototype.compare=function(e,t,n){return this.time+jl>e&&Ct(t,this.pos)==0&&n==this.button};var Fn,Bn;function Hl(e,t){var n=+new Date;return Bn&&Bn.compare(n,e,t)?(Fn=Bn=null,"triple"):Fn&&Fn.compare(n,e,t)?(Bn=new Ha(n,e,t),Fn=null,"double"):(Fn=new Ha(n,e,t),Bn=null,"single")}function vo(e){var t=this,n=t.display;if(Ue(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,dr(n,e)){i||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Wa(t,e))return;var r=Nr(t,e),d=Me(e),k=r?Hl(r,d):"single";if(window.focus(),d==1&&t.state.selectingText&&t.state.selectingText(e),r&&Wl(t,d,r,k,e))return;d==1?r?Kl(t,r,k,e):Ee(e)==n.scroller&&re(e):d==2?(r&&Zn(t.doc,r),setTimeout(function(){return n.input.focus()},20)):d==3&&(L?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,n,r,d){var k="Click";return r=="double"?k="Double"+k:r=="triple"&&(k="Triple"+k),k=(t==1?"Left":t==2?"Middle":"Right")+k,Nn(e,oo(k,d),d,function(K){if(typeof K=="string"&&(K=Pn[K]),!K)return!1;var J=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),J=K(e,n)!=ke}finally{e.state.suppressEdits=!1}return J})}function Gl(e,t,n){var r=e.getOption("configureMouse"),d=r?r(e,t,n):{};if(d.unit==null){var k=a?n.shiftKey&&n.metaKey:n.altKey;d.unit=k?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(d.extend==null||e.doc.extend)&&(d.extend=e.doc.extend||n.shiftKey),d.addNew==null&&(d.addNew=s?n.metaKey:n.ctrlKey),d.moveOnDrag==null&&(d.moveOnDrag=!(s?n.altKey:n.ctrlKey)),d}function Kl(e,t,n,r){G?setTimeout(P(gs,e),0):e.curOp.focus=N();var d=Gl(e,n,r),k=e.doc.sel,K;e.options.dragDrop&&ze&&!e.isReadOnly()&&n=="single"&&(K=k.contains(t))>-1&&(Ct((K=k.ranges[K]).from(),t)<0||t.xRel>0)&&(Ct(K.to(),t)>0||t.xRel<0)?zl(e,r,t,d):Vl(e,r,t,d)}function zl(e,t,n,r){var d=e.display,k=!1,K=pi(e,function(te){i&&(d.scroller.draggable=!1),e.state.draggingText=!1,nt(d.wrapper.ownerDocument,"mouseup",K),nt(d.wrapper.ownerDocument,"mousemove",J),nt(d.scroller,"dragstart",Z),nt(d.scroller,"drop",K),k||(re(te),r.addNew||Zn(e.doc,n,null,null,r.extend),i&&!p||G&&W==9?setTimeout(function(){d.wrapper.ownerDocument.body.focus({preventScroll:!0}),d.input.focus()},20):d.input.focus())}),J=function(te){k=k||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},Z=function(){return k=!0};i&&(d.scroller.draggable=!0),e.state.draggingText=K,K.copy=!r.moveOnDrag,d.scroller.dragDrop&&d.scroller.dragDrop(),Ne(d.wrapper.ownerDocument,"mouseup",K),Ne(d.wrapper.ownerDocument,"mousemove",J),Ne(d.scroller,"dragstart",Z),Ne(d.scroller,"drop",K),vs(e),setTimeout(function(){return d.input.focus()},20)}function yo(e,t,n){if(n=="char")return new Gt(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Gt(Ze(t.line,0),E(e.doc,Ze(t.line+1,0)));var r=n(e,t);return new Gt(r.from,r.to)}function Vl(e,t,n,r){var d=e.display,k=e.doc;re(t);var K,J,Z=k.sel,te=Z.ranges;if(r.addNew&&!r.extend?(J=k.sel.contains(n),J>-1?K=te[J]:K=new Gt(n,n)):(K=k.sel.primary(),J=k.sel.primIndex),r.unit=="rectangle")r.addNew||(K=new Gt(n,n)),n=Nr(e,t,!0,!0),J=-1;else{var de=yo(e,n,r.unit);r.extend?K=Pa(K,de.anchor,de.head,r.extend):K=de}r.addNew?J==-1?(J=te.length,wi(k,tr(e,te.concat([K]),J),{scroll:!1,origin:"*mouse"})):te.length>1&&te[J].empty()&&r.unit=="char"&&!r.extend?(wi(k,tr(e,te.slice(0,J).concat(te.slice(J+1)),0),{scroll:!1,origin:"*mouse"}),Z=k.sel):Na(k,J,K,Ae):(J=0,wi(k,new Yi([K],0),Ae),Z=k.sel);var me=n;function Ie(rt){if(Ct(me,rt)==0)return;if(me=rt,r.unit=="rectangle"){for(var ht=[],Tt=e.options.tabSize,vt=Y(ct(k,n.line).text,n.ch,Tt),Rt=Y(ct(k,rt.line).text,rt.ch,Tt),Xt=Math.min(vt,Rt),gi=Math.max(vt,Rt),ei=Math.min(n.line,rt.line),Gi=Math.min(e.lastLine(),Math.max(n.line,rt.line));ei<=Gi;ei++){var Ni=ct(k,ei).text,si=pe(Ni,Xt,Tt);Xt==gi?ht.push(new Gt(Ze(ei,si),Ze(ei,si))):Ni.length>si&&ht.push(new Gt(Ze(ei,si),Ze(ei,pe(Ni,gi,Tt))))}ht.length||ht.push(new Gt(n,n)),wi(k,tr(e,Z.ranges.slice(0,J).concat(ht),J),{origin:"*mouse",scroll:!1}),e.scrollIntoView(rt)}else{var Fi=K,_i=yo(e,rt,r.unit),hi=Fi.anchor,oi;Ct(_i.anchor,hi)>0?(oi=_i.head,hi=vr(Fi.from(),_i.anchor)):(oi=_i.anchor,hi=gr(Fi.to(),_i.head));var ii=Z.ranges.slice(0);ii[J]=Yl(e,new Gt(E(k,hi),oi)),wi(k,tr(e,ii,J),Ae)}}var Re=d.wrapper.getBoundingClientRect(),He=0;function $e(rt){var ht=++He,Tt=Nr(e,rt,!0,r.unit=="rectangle");if(!Tt)return;if(Ct(Tt,me)!=0){e.curOp.focus=N(),Ie(Tt);var vt=Vn(d,k);(Tt.line>=vt.to||Tt.line<vt.from)&&setTimeout(pi(e,function(){He==ht&&$e(rt)}),150)}else{var Rt=rt.clientY<Re.top?-20:rt.clientY>Re.bottom?20:0;Rt&&setTimeout(pi(e,function(){if(He!=ht)return;d.scroller.scrollTop+=Rt,$e(rt)}),50)}}function et(rt){e.state.selectingText=!1,He=Infinity,rt&&(re(rt),d.input.focus()),nt(d.wrapper.ownerDocument,"mousemove",it),nt(d.wrapper.ownerDocument,"mouseup",ut),k.history.lastSelOrigin=null}var it=pi(e,function(rt){rt.buttons===0||!Me(rt)?et(rt):$e(rt)}),ut=pi(e,et);e.state.selectingText=ut,Ne(d.wrapper.ownerDocument,"mousemove",it),Ne(d.wrapper.ownerDocument,"mouseup",ut)}function Yl(e,t){var n=t.anchor,r=t.head,d=ct(e.doc,n.line);if(Ct(n,r)==0&&n.sticky==r.sticky)return t;var k=Xe(d);if(!k)return t;var K=Je(k,n.ch,n.sticky),J=k[K];if(J.from!=n.ch&&J.to!=n.ch)return t;var Z=K+(J.from==n.ch==(J.level!=1)?0:1);if(Z==0||Z==k.length)return t;var te;if(r.line!=n.line)te=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var de=Je(k,r.ch,r.sticky),me=de-K||(r.ch-n.ch)*(J.level==1?-1:1);de==Z-1||de==Z?te=me<0:te=me>0}var Ie=k[Z+(te?-1:0)],Re=te==(Ie.level==1),He=Re?Ie.from:Ie.to,$e=Re?"after":"before";return n.ch==He&&n.sticky==$e?t:new Gt(new Ze(n.line,He,$e),r)}function bo(e,t,n,r){var d,k;if(t.touches)d=t.touches[0].clientX,k=t.touches[0].clientY;else try{d=t.clientX,k=t.clientY}catch(Ie){return!1}if(d>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&re(t);var K=e.display,J=K.lineDiv.getBoundingClientRect();if(k>J.bottom||!ve(e,n))return he(t);k-=J.top-K.viewOffset;for(var Z=0;Z<e.display.gutterSpecs.length;++Z){var te=K.gutters.childNodes[Z];if(te&&te.getBoundingClientRect().right>=d){var de=li(e.doc,k),me=e.display.gutterSpecs[Z];return Be(e,n,e,de,me.className,t),he(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(dr(e.display,t)||Xl(e,t))return;if(Ue(e,t,"contextmenu"))return;L||e.display.input.onContextMenu(t)}function Xl(e,t){return ve(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-"),yn(e)}var on={toString:function(){return"CodeMirror.Init"}},xo={},aa={};function $l(e){var t=e.optionHandlers;function n(r,d,k,K){e.defaults[r]=d,k&&(t[r]=K?function(J,Z,te){te!=on&&k(J,Z,te)}:k)}e.defineOption=n,e.Init=on,n("value","",function(r,d){return r.setValue(d)},!0),n("mode",null,function(r,d){r.doc.modeOption=d,Da(r)},!0),n("indentUnit",2,Da,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Cn(r),yn(r),Mi(r)},!0),n("lineSeparator",null,function(r,d){if(r.doc.lineSep=d,!d)return;var k=[],K=r.doc.first;r.doc.iter(function(Z){for(var te=0;;){var de=Z.text.indexOf(d,te);if(de==-1)break;te=de+d.length,k.push(Ze(K,de))}K++});for(var J=k.length-1;J>=0;J--)rn(r.doc,d,k[J],Ze(k[J].line,k[J].ch+d.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,d,k){r.state.specialChars=new RegExp(d.source+(d.test(" ")?"":"| "),"g"),k!=on&&r.refresh()}),n("specialCharPlaceholder",Yt,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",h?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,d){return r.getInputField().spellcheck=d},!0),n("autocorrect",!1,function(r,d){return r.getInputField().autocorrect=d},!0),n("autocapitalize",!1,function(r,d){return r.getInputField().autocapitalize=d},!0),n("rtlMoveVisually",!A),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){Eo(r),Sn(r)},!0),n("keyMap","default",function(r,d,k){var K=ra(d),J=k!=on&&ra(k);J&&J.detach&&J.detach(r,K),K.attach&&K.attach(r,J||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ql,!0),n("gutters",[],function(r,d){r.display.gutterSpecs=La(d,r.options.lineNumbers),Sn(r)},!0),n("fixedGutter",!0,function(r,d){r.display.gutters.style.left=d?_a(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Zr(r)},!0),n("scrollbarStyle","native",function(r){Ts(r),Zr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,d){r.display.gutterSpecs=La(r.options.gutters,d),Sn(r)},!0),n("firstLineNumber",1,Sn,!0),n("lineNumberFormatter",function(r){return r},Sn,!0),n("showCursorWhenSelecting",!1,bn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,d){d=="nocursor"&&(Jr(r),r.display.input.blur()),r.display.input.readOnlyChanged(d)}),n("screenReaderLabel",null,function(r,d){d=d===""?null:d,r.display.input.screenReaderLabelChanged(d)}),n("disableInput",!1,function(r,d){d||r.display.input.reset()},!0),n("dragDrop",!0,Jl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,bn,!0),n("singleCursorHeightPerLine",!0,bn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Cn,!0),n("addModeClass",!1,Cn,!0),n("pollInterval",100),n("undoDepth",200,function(r,d){return r.doc.history.undoDepth=d}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,Cn,!0),n("moveInputWithCursor",!0,function(r,d){d||r.display.input.resetPosition()}),n("tabindex",null,function(r,d){return r.display.input.getField().tabIndex=d||""}),n("autofocus",null),n("direction","ltr",function(r,d){return r.doc.setDirection(d)},!0),n("phrases",null)}function Jl(e,t,n){var r=n&&n!=on;if(!t!=!r){var d=e.display.dragFunctions,k=t?Ne:nt;k(e.display.scroller,"dragstart",d.start),k(e.display.scroller,"dragenter",d.enter),k(e.display.scroller,"dragover",d.over),k(e.display.scroller,"dragleave",d.leave),k(e.display.scroller,"drop",d.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"),jn(e)),Ea(e),Mi(e),yn(e),setTimeout(function(){return Zr(e)},100)}function Zt(e,t){var n=this;if(!(this instanceof Zt))return new Zt(e,t);this.options=t=t?b(t):{},b(xo,t,!1);var r=t.value;typeof r=="string"?r=new Pi(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var d=new Zt.inputStyles[t.inputStyle](this),k=this.display=new hl(e,r,d,t);k.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&&k.input.focus(),G&&W<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Zl(this),Rl(),jr(this),this.curOp.forceUpdate=!0,ks(this,r),t.autofocus&&!h||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ta(n)},20):Jr(this);for(var K in aa)aa.hasOwnProperty(K)&&aa[K](this,t[K],on);Cs(this),t.finishInit&&t.finishInit(this);for(var J=0;J<Ga.length;++J)Ga[J](this);Hr(this),i&&t.lineWrapping&&getComputedStyle(k.lineDiv).textRendering=="optimizelegibility"&&(k.lineDiv.style.textRendering="auto")}Zt.defaults=xo,Zt.optionHandlers=aa;function Zl(e){var t=e.display;Ne(t.scroller,"mousedown",pi(e,vo)),G&&W<11?Ne(t.scroller,"dblclick",pi(e,function(Z){if(Ue(e,Z))return;var te=Nr(e,Z);if(!te||Wa(e,Z)||dr(e.display,Z))return;re(Z);var de=e.findWordAt(te);Zn(e.doc,de.anchor,de.head)})):Ne(t.scroller,"dblclick",function(Z){return Ue(e,Z)||re(Z)}),Ne(t.scroller,"contextmenu",function(Z){return _o(e,Z)}),Ne(t.input.getField(),"contextmenu",function(Z){t.scroller.contains(Z.target)||_o(e,Z)});var n,r={end:0};function d(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function k(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 de=te.left-Z.left,me=te.top-Z.top;return de*de+me*me>20*20}Ne(t.scroller,"touchstart",function(Z){if(!Ue(e,Z)&&!k(Z)&&!Wa(e,Z)){t.input.ensurePolled(),clearTimeout(n);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-r.end<=300?r:null},Z.touches.length==1&&(t.activeTouch.left=Z.touches[0].pageX,t.activeTouch.top=Z.touches[0].pageY)}}),Ne(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ne(t.scroller,"touchend",function(Z){var te=t.activeTouch;if(te&&!dr(t,Z)&&te.left!=null&&!te.moved&&new Date-te.start<300){var de=e.coordsChar(t.activeTouch,"page"),me;!te.prev||K(te,te.prev)?me=new Gt(de,de):!te.prev.prev||K(te,te.prev.prev)?me=e.findWordAt(de):me=new Gt(Ze(de.line,0),E(e.doc,Ze(de.line+1,0))),e.setSelection(me.anchor,me.head),e.focus(),re(Z)}d()}),Ne(t.scroller,"touchcancel",d),Ne(t.scroller,"scroll",function(){t.scroller.clientHeight&&(En(e,t.scroller.scrollTop),Br(e,t.scroller.scrollLeft,!0),Be(e,"scroll",e))}),Ne(t.scroller,"mousewheel",function(Z){return Rs(e,Z)}),Ne(t.scroller,"DOMMouseScroll",function(Z){return Rs(e,Z)}),Ne(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Z){Ue(e,Z)||fe(Z)},over:function(Z){Ue(e,Z)||(Ol(e,Z),fe(Z))},start:function(Z){return Al(e,Z)},drop:pi(e,Cl),leave:function(Z){Ue(e,Z)||ro(e)}};var J=t.input.getField();Ne(J,"keyup",function(Z){return mo.call(e,Z)}),Ne(J,"keydown",pi(e,po)),Ne(J,"keypress",pi(e,go)),Ne(J,"focus",function(Z){return Ta(e,Z)}),Ne(J,"blur",function(Z){return Jr(e,Z)})}var Ga=[];Zt.defineInitHook=function(e){return Ga.push(e)};function Un(e,t,n,r){var d=e.doc,k;n==null&&(n="add"),n=="smart"&&(d.mode.indent?k=tt(e,t).state:n="prev");var K=e.options.tabSize,J=ct(d,t),Z=Y(J.text,null,K);J.stateAfter&&(J.stateAfter=null);var te=J.text.match(/^\s*/)[0],de;if(!r&&!/\S/.test(J.text))de=0,n="not";else if(n=="smart"&&(de=d.mode.indent(k,J.text.slice(te.length),J.text),de==ke||de>150)){if(!r)return;n="prev"}n=="prev"?t>d.first?de=Y(ct(d,t-1).text,null,K):de=0:n=="add"?de=Z+e.options.indentUnit:n=="subtract"?de=Z-e.options.indentUnit:typeof n=="number"&&(de=Z+n),de=Math.max(0,de);var me="",Ie=0;if(e.options.indentWithTabs)for(var Re=Math.floor(de/K);Re;--Re)Ie+=K,me+=" ";if(Ie<de&&(me+=ae(de-Ie)),me!=te)return rn(d,me,Ze(t,0),Ze(t,te.length),"+input"),J.stateAfter=null,!0;for(var He=0;He<d.sel.ranges.length;He++){var $e=d.sel.ranges[He];if($e.head.line==t&&$e.head.ch<te.length){var et=Ze(t,te.length);Na(d,He,new Gt(et,et));break}}}var ir=null;function sa(e){ir=e}function Ka(e,t,n,r,d){var k=e.doc;e.display.shift=!1,r||(r=k.sel);var K=+new Date-200,J=d=="paste"||e.state.pasteIncoming>K,Z=St(t),te=null;if(J&&r.ranges.length>1)if(ir&&ir.text.join(`
|
|
`)==t){if(r.ranges.length%ir.text.length==0){te=[];for(var de=0;de<ir.text.length;de++)te.push(k.splitLines(ir.text[de]))}}else Z.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(te=xe(Z,function(it){return[it]}));for(var me=e.curOp.updateInput,Ie=r.ranges.length-1;Ie>=0;Ie--){var Re=r.ranges[Ie],He=Re.from(),$e=Re.to();Re.empty()&&(n&&n>0?He=Ze(He.line,He.ch-n):e.state.overwrite&&!J?$e=Ze($e.line,Math.min(ct(k,$e.line).text.length,$e.ch+Oe(Z).length)):J&&ir&&ir.lineWise&&ir.text.join(`
|
|
`)==Z.join(`
|
|
`)&&(He=$e=Ze(He.line,0)));var et={from:He,to:$e,text:te?te[Ie%te.length]:Z,origin:d||(J?"paste":e.state.cutIncoming>K?"cut":"+input")};tn(e.doc,et),bi(e,"inputRead",e,et)}t&&!J&&wo(e,t),Qr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=me),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Wi(t,function(){return Ka(t,n,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var d=n.ranges[r];if(d.head.ch>100||r&&n.ranges[r-1].head.line==d.head.line)continue;var k=e.getModeAt(d.head),K=!1;if(k.electricChars){for(var J=0;J<k.electricChars.length;J++)if(t.indexOf(k.electricChars.charAt(J))>-1){K=Un(e,d.head.line,"smart");break}}else k.electricInput&&(k.electricInput.test(ct(e.doc,d.head.line).text.slice(0,d.head.ch))&&(K=Un(e,d.head.line,"smart")));K&&bi(e,"electricInput",e,d.head.line)}}function So(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var d=e.doc.sel.ranges[r].head.line,k={anchor:Ze(d,0),head:Ze(d+1,0)};n.push(k),t.push(e.getRange(k.anchor,k.head))}return{text:t,ranges:n}}function Co(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ao(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=c("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,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,d){var k=this.options,K=k[r];if(k[r]==d&&r!="mode")return;k[r]=d,t.hasOwnProperty(r)&&pi(this,t[r])(this,d,K),Be(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,d){this.state.keyMaps[d?"push":"unshift"](ra(r))},removeKeyMap:function(r){for(var d=this.state.keyMaps,k=0;k<d.length;++k)if(d[k]==r||d[k].name==r)return d.splice(k,1),!0},addOverlay:Oi(function(r,d){var k=r.token?r:e.getMode(this.options,r);if(k.startState)throw new Error("Overlays may not be stateful.");Pe(this.state.overlays,{mode:k,modeSpec:r,opaque:d&&d.opaque,priority:d&&d.priority||0},function(K){return K.priority}),this.state.modeGen++,Mi(this)}),removeOverlay:Oi(function(r){for(var d=this.state.overlays,k=0;k<d.length;++k){var K=d[k].modeSpec;if(K==r||typeof r=="string"&&K.name==r){d.splice(k,1),this.state.modeGen++,Mi(this);return}}}),indentLine:Oi(function(r,d,k){typeof d!="string"&&typeof d!="number"&&(d==null?d=this.options.smartIndent?"smart":"prev":d=d?"add":"subtract"),Ii(this.doc,r)&&Un(this,r,d,k)}),indentSelection:Oi(function(r){for(var d=this.doc.sel.ranges,k=-1,K=0;K<d.length;K++){var J=d[K];if(J.empty())J.head.line>k&&(Un(this,J.head.line,r,!0),k=J.head.line,K==this.doc.sel.primIndex&&Qr(this));else{var Z=J.from(),te=J.to(),de=Math.max(k,Z.line);k=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var me=de;me<k;++me)Un(this,me,r);var Ie=this.doc.sel.ranges;Z.ch==0&&d.length==Ie.length&&Ie[K].from().ch>0&&Na(this.doc,K,new Gt(Z,Ie[K].to()),we)}}}),getTokenAt:function(r,d){return $t(this,r,d)},getLineTokens:function(r,d){return $t(this,Ze(r),d,!0)},getTokenTypeAt:function(r){r=E(this.doc,r);var d=Ke(this,ct(this.doc,r.line)),k=0,K=(d.length-1)/2,J=r.ch,Z;if(J==0)Z=d[2];else for(;;){var te=k+K>>1;if((te?d[te*2-1]:0)>=J)K=te;else if(d[te*2+1]<J)k=te+1;else{Z=d[te*2+2];break}}var de=Z?Z.indexOf("overlay "):-1;return de<0?Z:de==0?null:Z.slice(0,de-1)},getModeAt:function(r){var d=this.doc.mode;return d.innerMode?e.innerMode(d,this.getTokenAt(r).state).mode:d},getHelper:function(r,d){return this.getHelpers(r,d)[0]},getHelpers:function(r,d){var k=[];if(!n.hasOwnProperty(d))return k;var K=n[d],J=this.getModeAt(r);if(typeof J[d]=="string")K[J[d]]&&k.push(K[J[d]]);else if(J[d])for(var Z=0;Z<J[d].length;Z++){var te=K[J[d][Z]];te&&k.push(te)}else J.helperType&&K[J.helperType]?k.push(K[J.helperType]):K[J.name]&&k.push(K[J.name]);for(var de=0;de<K._global.length;de++){var me=K._global[de];me.pred(J,this)&&le(k,me.val)==-1&&k.push(me.val)}return k},getStateAfter:function(r,d){var k=this.doc;return r=V(k,r==null?k.first+k.size-1:r),tt(this,r+1,d).state},cursorCoords:function(r,d){var k,K=this.doc.sel.primary();return r==null?k=K.head:typeof r=="object"?k=E(this.doc,r):k=r?K.from():K.to(),er(this,k,d||"page")},charCoords:function(r,d){return ma(this,E(this.doc,r),d||"page")},coordsChar:function(r,d){return r=ls(this,r,d||"page"),va(this,r.left,r.top)},lineAtHeight:function(r,d){return r=ls(this,{top:r,left:0},d||"page").top,li(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,d,k){var K=!1,J;if(typeof r=="number"){var Z=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>Z&&(r=Z,K=!0),J=ct(this.doc,r)}else J=r;return Wn(this,J,{top:0,left:0},d||"page",k||K).top+(K?this.doc.height-qi(J):0)},defaultTextHeight:function(){return Xr(this.display)},defaultCharWidth:function(){return $r(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,d,k,K,J){var Z=this.display;r=er(this,E(this.doc,r));var te=r.bottom,de=r.left;if(d.style.position="absolute",d.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(d),Z.sizer.appendChild(d),K=="over")te=r.top;else if(K=="above"||K=="near"){var me=Math.max(Z.wrapper.clientHeight,this.doc.height),Ie=Math.max(Z.sizer.clientWidth,Z.lineSpace.clientWidth);(K=="above"||r.bottom+d.offsetHeight>me)&&r.top>d.offsetHeight?te=r.top-d.offsetHeight:r.bottom+d.offsetHeight<=me&&(te=r.bottom),de+d.offsetWidth>Ie&&(de=Ie-d.offsetWidth)}d.style.top=te+"px",d.style.left=d.style.right="",J=="right"?(de=Z.sizer.clientWidth-d.offsetWidth,d.style.right="0px"):(J=="left"?de=0:J=="middle"&&(de=(Z.sizer.clientWidth-d.offsetWidth)/2),d.style.left=de+"px"),k&&Jo(this,{left:de,top:te,right:de+d.offsetWidth,bottom:te+d.offsetHeight})},triggerOnKeyDown:Oi(po),triggerOnKeyPress:Oi(go),triggerOnKeyUp:mo,triggerOnMouseDown:Oi(vo),execCommand:function(r){if(Pn.hasOwnProperty(r))return Pn[r].call(null,this)},triggerElectric:Oi(function(r){wo(this,r)}),findPosH:function(r,d,k,K){var J=1;d<0&&(J=-1,d=-d);for(var Z=E(this.doc,r),te=0;te<d&&!(Z=za(this.doc,Z,J,k,K),Z.hitSide);++te);return Z},moveH:Oi(function(r,d){var k=this;this.extendSelectionsBy(function(K){return k.display.shift||k.doc.extend||K.empty()?za(k.doc,K.head,r,d,k.options.rtlMoveVisually):r<0?K.from():K.to()},ce)}),deleteH:Oi(function(r,d){var k=this.doc.sel,K=this.doc;k.somethingSelected()?K.replaceSelection("",null,"+delete"):sn(this,function(J){var Z=za(K,J.head,r,d,!1);return r<0?{from:Z,to:J.head}:{from:J.head,to:Z}})}),findPosV:function(r,d,k,K){var J=1,Z=K;d<0&&(J=-1,d=-d);for(var te=E(this.doc,r),de=0;de<d;++de){var me=er(this,te,"div");if(Z==null?Z=me.left:me.left=Z,te=Oo(this,me,J,k),te.hitSide)break}return te},moveV:Oi(function(r,d){var k=this,K=this.doc,J=[],Z=!this.display.shift&&!K.extend&&K.sel.somethingSelected();if(K.extendSelectionsBy(function(de){if(Z)return r<0?de.from():de.to();var me=er(k,de.head,"div");de.goalColumn!=null&&(me.left=de.goalColumn),J.push(me.left);var Ie=Oo(k,me,r,d);return d=="page"&&de==K.sel.primary()&&Sa(k,ma(k,Ie,"div").top-me.top),Ie},ce),J.length)for(var te=0;te<K.sel.ranges.length;te++)K.sel.ranges[te].goalColumn=J[te]}),findWordAt:function(r){var d=this.doc,k=ct(d,r.line).text,K=r.ch,J=r.ch;if(k){var Z=this.getHelper(r,"wordChars");(r.sticky=="before"||J==k.length)&&K?--K:++J;for(var te=k.charAt(K),de=We(te,Z)?function(me){return We(me,Z)}:/\s/.test(te)?function(me){return/\s/.test(me)}:function(me){return!/\s/.test(me)&&!We(me)};K>0&&de(k.charAt(K-1));)--K;for(;J<k.length&&de(k.charAt(J));)++J}return new Gt(Ze(r.line,K),Ze(r.line,J))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):C(this.display.cursorDiv,"CodeMirror-overwrite"),Be(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Oi(function(r,d){_n(this,r,d)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-ar(this)-this.display.barHeight,width:r.scrollWidth-ar(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:Mr(this)}},scrollIntoView:Oi(function(r,d){r==null?(r={from:this.doc.sel.primary().head,to:null},d==null&&(d=this.options.cursorScrollMargin)):typeof r=="number"?r={from:Ze(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=d||0,r.from.line!=null?Qo(this,r):bs(this,r.from,r.to,r.margin)}),setSize:Oi(function(r,d){var k=this,K=function(Z){return typeof Z=="number"||/^\d+$/.test(String(Z))?Z+"px":Z};r!=null&&(this.display.wrapper.style.width=K(r)),d!=null&&(this.display.wrapper.style.height=K(d)),this.options.lineWrapping&&as(this);var J=this.display.viewFrom;this.doc.iter(J,this.display.viewTo,function(Z){if(Z.widgets){for(var te=0;te<Z.widgets.length;te++)if(Z.widgets[te].noHScroll){Tr(k,J,"widget");break}}++J}),this.curOp.forceUpdate=!0,Be(this,"refresh",this)}),operation:function(r){return Wi(this,r)},startOperation:function(){return jr(this)},endOperation:function(){return Hr(this)},refresh:Oi(function(){var r=this.display.cachedTextHeight;Mi(this),this.curOp.forceUpdate=!0,yn(this),_n(this,this.doc.scrollLeft,this.doc.scrollTop),Oa(this.display),(r==null||Math.abs(r-Xr(this.display))>.5||this.options.lineWrapping)&&Ea(this),Be(this,"refresh",this)}),swapDoc:Oi(function(r){var d=this.doc;return d.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,r),yn(this),this.display.input.reset(),_n(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,bi(this,"swapDoc",this,d),d}),phrase:function(r){var d=this.options.phrases;return d&&Object.prototype.hasOwnProperty.call(d,r)?d[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},_e(e),e.registerHelper=function(r,d,k){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][d]=k},e.registerGlobalHelper=function(r,d,k,K){e.registerHelper(r,d,K),n[r]._global.push({pred:k,val:K})}}function za(e,t,n,r,d){var k=t,K=n,J=ct(e,t.line),Z=d&&e.direction=="rtl"?-n:n;function te(){var ut=t.line+Z;return ut<e.first||ut>=e.first+e.size?!1:(t=new Ze(ut,t.ch,t.sticky),J=ct(e,ut))}function de(ut){var rt;if(r=="codepoint"){var ht=J.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(ht)?rt=null:rt=new Ze(t.line,Math.max(0,Math.min(J.text.length,t.ch+n*(ht>=55296&&ht<56320?2:1))),-n)}else d?rt=Ml(e.cm,J,t,n):rt=Ba(J,t,n);if(rt==null)if(!ut&&te())t=Ua(d,e.cm,J,t.line,Z);else return!1;else t=rt;return!0}if(r=="char"||r=="codepoint")de();else if(r=="column")de(!0);else if(r=="word"||r=="group")for(var me=null,Ie=r=="group",Re=e.cm&&e.cm.getHelper(t,"wordChars"),He=!0;!(n<0&&!de(!He));He=!1){var $e=J.text.charAt(t.ch)||`
|
|
`,et=We($e,Re)?"w":Ie&&$e==`
|
|
`?"n":!Ie||/\s/.test($e)?null:"p";if(Ie&&!He&&!et&&(et="s"),me&&me!=et){n<0&&(n=1,de(),t.sticky="after");break}if(et&&(me=et),n>0&&!de(!He))break}var it=ea(e,t,k,K,!0);return pr(k,it)&&(it.hitSide=!0),it}function Oo(e,t,n,r){var d=e.doc,k=t.left,K;if(r=="page"){var J=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Z=Math.max(J-.5*Xr(e.display),3);K=(n>0?t.bottom:t.top)+n*Z}else r=="line"&&(K=n>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,k,K),!te.outside);){if(n<0?K<=0:K>=d.height){te.hitSide=!0;break}K+=n*5}return te}var zt=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};zt.prototype.init=function(e){var t=this,n=this,r=n.cm,d=n.div=e.lineDiv;Co(d,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function k(J){for(var Z=J.target;Z;Z=Z.parentNode){if(Z==d)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Z.className))break}return!1}Ne(d,"paste",function(J){if(!k(J)||Ue(r,J)||To(J,r))return;W<=11&&setTimeout(pi(r,function(){return t.updateFromDOM()}),20)}),Ne(d,"compositionstart",function(J){t.composing={data:J.data,done:!1}}),Ne(d,"compositionupdate",function(J){t.composing||(t.composing={data:J.data,done:!1})}),Ne(d,"compositionend",function(J){t.composing&&(J.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ne(d,"touchstart",function(){return n.forceCompositionEnd()}),Ne(d,"input",function(){t.composing||t.readFromDOMSoon()});function K(J){if(!k(J)||Ue(r,J))return;if(r.somethingSelected())sa({lineWise:!1,text:r.getSelections()}),J.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var Z=So(r);sa({lineWise:!0,text:Z.text}),J.type=="cut"&&r.operation(function(){r.setSelections(Z.ranges,0,we),r.replaceSelection("",null,"cut")})}else return;if(J.clipboardData){J.clipboardData.clearData();var te=ir.text.join(`
|
|
`);if(J.clipboardData.setData("Text",te),J.clipboardData.getData("Text")==te){J.preventDefault();return}}var de=Ao(),me=de.firstChild;r.display.lineSpace.insertBefore(de,r.display.lineSpace.firstChild),me.value=ir.text.join(`
|
|
`);var Ie=document.activeElement;j(me),setTimeout(function(){r.display.lineSpace.removeChild(de),Ie.focus(),Ie==d&&n.showPrimarySelection()},50)}Ne(d,"copy",K),Ne(d,"cut",K)},zt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},zt.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},zt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},zt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},zt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),d=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||d.line<t.display.viewFrom){e.removeAllRanges();return}var k=oa(t,e.anchorNode,e.anchorOffset),K=oa(t,e.focusNode,e.focusOffset);if(k&&!k.bad&&K&&!K.bad&&Ct(vr(k,K),r)==0&&Ct(gr(k,K),d)==0)return;var J=t.display.view,Z=r.line>=t.display.viewFrom&&Ro(t,r)||{node:J[0].measure.map[2],offset:0},te=d.line<t.display.viewTo&&Ro(t,d);if(!te){var de=J[J.length-1].measure,me=de.maps?de.maps[de.maps.length-1]:de.map;te={node:me[me.length-1],offset:me[me.length-2]-me[me.length-3]}}if(!Z||!te){e.removeAllRanges();return}var Ie=e.rangeCount&&e.getRangeAt(0),Re;try{Re=y(Z.node,Z.offset,te.offset,te.node)}catch(He){}Re&&(!M&&t.state.focused?(e.collapse(Z.node,Z.offset),Re.collapsed||(e.removeAllRanges(),e.addRange(Re))):(e.removeAllRanges(),e.addRange(Re)),Ie&&e.anchorNode==null?e.addRange(Ie):M&&this.startGracePeriod()),this.rememberSelection()},zt.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)},zt.prototype.showMultipleSelections=function(e){x(this.cm.display.cursorDiv,e.cursors),x(this.cm.display.selectionDiv,e.selection)},zt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},zt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return v(this.div,t)},zt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},zt.prototype.blur=function(){this.div.blur()},zt.prototype.getField=function(){return this.div},zt.prototype.supportsTouch=function(){return!0},zt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Wi(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)},zt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},zt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(o&&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 n=oa(t,e.anchorNode,e.anchorOffset),r=oa(t,e.focusNode,e.focusOffset);n&&r&&Wi(t,function(){wi(t.doc,Sr(n,r),we),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},zt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),d=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=Ze(r.line-1,ct(e.doc,r.line-1).length)),d.ch==ct(e.doc,d.line).text.length&&d.line<e.lastLine()&&(d=Ze(d.line+1,0)),r.line<t.viewFrom||d.line>t.viewTo-1)return!1;var k,K,J;r.line==t.viewFrom||(k=Fr(e,r.line))==0?(K=Ot(t.view[0].line),J=t.view[0].node):(K=Ot(t.view[k].line),J=t.view[k-1].node.nextSibling);var Z=Fr(e,d.line),te,de;if(Z==t.view.length-1?(te=t.viewTo-1,de=t.lineDiv.lastChild):(te=Ot(t.view[Z+1].line)-1,de=t.view[Z+1].node.previousSibling),!J)return!1;for(var me=e.doc.splitLines(tu(e,J,de,K,te)),Ie=Ui(e.doc,Ze(K,0),Ze(te,ct(e.doc,te).text.length));me.length>1&&Ie.length>1;)if(Oe(me)==Oe(Ie))me.pop(),Ie.pop(),te--;else if(me[0]==Ie[0])me.shift(),Ie.shift(),K++;else break;for(var Re=0,He=0,$e=me[0],et=Ie[0],it=Math.min($e.length,et.length);Re<it&&$e.charCodeAt(Re)==et.charCodeAt(Re);)++Re;for(var ut=Oe(me),rt=Oe(Ie),ht=Math.min(ut.length-(me.length==1?Re:0),rt.length-(Ie.length==1?Re:0));He<ht&&ut.charCodeAt(ut.length-He-1)==rt.charCodeAt(rt.length-He-1);)++He;if(me.length==1&&Ie.length==1&&K==r.line)for(;Re&&Re>r.ch&&ut.charCodeAt(ut.length-He-1)==rt.charCodeAt(rt.length-He-1);)Re--,He++;me[me.length-1]=ut.slice(0,ut.length-He).replace(/^\u200b+/,""),me[0]=me[0].slice(Re).replace(/\u200b+$/,"");var Tt=Ze(K,Re),vt=Ze(te,Ie.length?Oe(Ie).length-He:0);if(me.length>1||me[0]||Ct(Tt,vt))return rn(e.doc,me,Tt,vt,"+input"),!0},zt.prototype.ensurePolled=function(){this.forceCompositionEnd()},zt.prototype.reset=function(){this.forceCompositionEnd()},zt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},zt.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)},zt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Wi(this.cm,function(){return Mi(e.cm)})},zt.prototype.setUneditable=function(e){e.contentEditable="false"},zt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||pi(this.cm,Ka)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},zt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},zt.prototype.onContextMenu=function(){},zt.prototype.resetPosition=function(){},zt.prototype.needsContentAttribute=!0;function Ro(e,t){var n=fa(e,t.line);if(!n||n.hidden)return null;var r=ct(e.doc,t.line),d=es(n,r,t.line),k=Xe(r,e.doc.direction),K="left";if(k){var J=Je(k,t.ch);K=J%2?"right":"left"}var Z=rs(d.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 ln(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,d){var k="",K=!1,J=e.doc.lineSeparator(),Z=!1;function te(Re){return function(He){return He.id==Re}}function de(){K&&(k+=J,Z&&(k+=J),K=Z=!1)}function me(Re){Re&&(de(),k+=Re)}function Ie(Re){if(Re.nodeType==1){var He=Re.getAttribute("cm-text");if(He){me(He);return}var $e=Re.getAttribute("cm-marker"),et;if($e){var it=e.findMarks(Ze(r,0),Ze(d+1,0),te(+$e));it.length&&(et=it[0].find(0))&&me(Ui(e.doc,et.from,et.to).join(J));return}if(Re.getAttribute("contenteditable")=="false")return;var ut=/^(pre|div|p|li|table|br)$/i.test(Re.nodeName);if(!/^br$/i.test(Re.nodeName)&&Re.textContent.length==0)return;ut&&de();for(var rt=0;rt<Re.childNodes.length;rt++)Ie(Re.childNodes[rt]);/^(pre|p)$/i.test(Re.nodeName)&&(Z=!0),ut&&(K=!0)}else Re.nodeType==3&&me(Re.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ie(t),t==n);)t=t.nextSibling,Z=!1;return k}function oa(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return ln(e.clipPos(Ze(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var d=0;d<e.display.view.length;d++){var k=e.display.view[d];if(k.node==r)return iu(k,t,n)}}function iu(e,t,n){var r=e.text.firstChild,d=!1;if(!t||!v(r,t))return ln(Ze(Ot(e.line),0),!0);if(t==r&&(d=!0,t=r.childNodes[n],n=0,!t)){var k=e.rest?Oe(e.rest):e.line;return ln(Ze(Ot(k),k.text.length),d)}var K=t.nodeType==3?t:null,J=t;for(!K&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(K=t.firstChild,n&&(n=K.nodeValue.length));J.parentNode!=r;)J=J.parentNode;var Z=e.measure,te=Z.maps;function de(et,it,ut){for(var rt=-1;rt<(te?te.length:0);rt++)for(var ht=rt<0?Z.map:te[rt],Tt=0;Tt<ht.length;Tt+=3){var vt=ht[Tt+2];if(vt==et||vt==it){var Rt=Ot(rt<0?e.line:e.rest[rt]),Xt=ht[Tt]+ut;return(ut<0||vt!=et)&&(Xt=ht[Tt+(ut?1:0)]),Ze(Rt,Xt)}}}var me=de(K,J,n);if(me)return ln(me,d);for(var Ie=J.nextSibling,Re=K?K.nodeValue.length-n:0;Ie;Ie=Ie.nextSibling){if(me=de(Ie,Ie.firstChild,0),me)return ln(Ze(me.line,me.ch-Re),d);Re+=Ie.textContent.length}for(var He=J.previousSibling,$e=n;He;He=He.previousSibling){if(me=de(He,He.firstChild,-1),me)return ln(Ze(me.line,me.ch+$e),d);$e+=He.textContent.length}}var ni=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ee,this.hasSelection=!1,this.composing=null};ni.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var d=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),f&&(d.style.width="0px"),Ne(d,"input",function(){G&&W>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Ne(d,"paste",function(K){if(Ue(r,K)||To(K,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function k(K){if(Ue(r,K))return;if(r.somethingSelected())sa({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var J=So(r);sa({lineWise:!0,text:J.text}),K.type=="cut"?r.setSelections(J.ranges,null,we):(n.prevInput="",d.value=J.text.join(`
|
|
`),j(d))}else return;K.type=="cut"&&(r.state.cutIncoming=+new Date)}Ne(d,"cut",k),Ne(d,"copy",k),Ne(e.scroller,"paste",function(K){if(dr(e,K)||Ue(r,K))return;if(!d.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var J=new Event("paste");J.clipboardData=K.clipboardData,d.dispatchEvent(J)}),Ne(e.lineSpace,"selectstart",function(K){dr(e,K)||re(K)}),Ne(d,"compositionstart",function(){var K=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:K,range:r.markText(K,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ne(d,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},ni.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},ni.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ni.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ps(e);if(e.options.moveInputWithCursor){var d=er(e,n.sel.primary().head,"div"),k=t.wrapper.getBoundingClientRect(),K=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,d.top+K.top-k.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,d.left+K.left-k.left))}return r},ni.prototype.showSelection=function(e){var t=this.cm,n=t.display;x(n.cursorDiv,e.cursors),x(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ni.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&j(this.textarea),G&&W>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",G&&W>=9&&(this.hasSelection=null))},ni.prototype.getField=function(){return this.textarea},ni.prototype.supportsTouch=function(){return!1},ni.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!h||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},ni.prototype.blur=function(){this.textarea.blur()},ni.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ni.prototype.receivedFocus=function(){this.slowPoll()},ni.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()})},ni.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},ni.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||dt(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var d=n.value;if(d==r&&!t.somethingSelected())return!1;if(G&&W>=9&&this.hasSelection===d||s&&/[\uf700-\uf7ff]/.test(d))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var k=d.charCodeAt(0);if(k==8203&&!r&&(r="\u200B"),k==8666)return this.reset(),this.cm.execCommand("undo")}for(var K=0,J=Math.min(r.length,d.length);K<J&&r.charCodeAt(K)==d.charCodeAt(K);)++K;return Wi(t,function(){Ka(t,d.slice(K),r.length-K,null,e.composing?"*compose":null),d.length>1e3||d.indexOf(`
|
|
`)>-1?n.value=e.prevInput="":e.prevInput=d,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ni.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ni.prototype.onKeyPress=function(){G&&W>=9&&(this.hasSelection=null),this.fastPoll()},ni.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,d=t.textarea;t.contextMenuPending&&t.contextMenuPending();var k=Nr(n,e),K=r.scroller.scrollTop;if(!k||m)return;var J=n.options.resetSelectionOnContextMenu;J&&n.doc.sel.contains(k)==-1&&pi(n,wi)(n.doc,Sr(k),we);var Z=d.style.cssText,te=t.wrapper.style.cssText,de=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",d.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-de.top-5)+"px; left: "+(e.clientX-de.left-5)+`px;
|
|
z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var me;i&&(me=window.scrollY),r.input.focus(),i&&window.scrollTo(null,me),r.input.reset(),n.somethingSelected()||(d.value=t.prevInput=" "),t.contextMenuPending=Re,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function Ie(){if(d.selectionStart!=null){var $e=n.somethingSelected(),et="\u200B"+($e?d.value:"");d.value="\u21DA",d.value=et,t.prevInput=$e?"":"\u200B",d.selectionStart=1,d.selectionEnd=et.length,r.selForContextMenu=n.doc.sel}}function Re(){if(t.contextMenuPending!=Re)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,d.style.cssText=Z,G&&W<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=K),d.selectionStart!=null){(!G||G&&W<9)&&Ie();var $e=0,et=function(){r.selForContextMenu==n.doc.sel&&d.selectionStart==0&&d.selectionEnd>0&&t.prevInput=="\u200B"?pi(n,Vs)(n):$e++<10?r.detectingSelectAll=setTimeout(et,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(et,200)}}if(G&&W>=9&&Ie(),L){fe(e);var He=function(){nt(window,"mouseup",He),setTimeout(Re,20)};Ne(window,"mouseup",He)}else setTimeout(Re,50)},ni.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ni.prototype.setUneditable=function(){},ni.prototype.needsContentAttribute=!1;function ru(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 n=N();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=J.getValue()}var d;if(e.form&&(Ne(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var k=e.form;d=k.submit;try{var K=k.submit=function(){r(),k.submit=d,k.submit(),k.submit=K}}catch(Z){}}t.finishInit=function(Z){Z.save=r,Z.getTextArea=function(){return e},Z.toTextArea=function(){Z.toTextArea=isNaN,r(),e.parentNode.removeChild(Z.getWrapperElement()),e.style.display="",e.form&&(nt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=d))}},e.style.display="none";var J=Zt(function(Z){return e.parentNode.insertBefore(Z,e.nextSibling)},t);return J}function nu(e){e.off=nt,e.on=Ne,e.wheelEventPixels=dl,e.Doc=Pi,e.splitLines=St,e.countColumn=Y,e.findColumn=pe,e.isWordChar=Fe,e.Pass=ke,e.signal=Be,e.Line=kr,e.changeEnd=Cr,e.scrollbarModel=xs,e.Pos=Ze,e.cmpPos=Ct,e.modes=Qt,e.mimeModes=It,e.resolveMode=yt,e.getMode=Li,e.modeExtensions=bt,e.extendMode=xt,e.copyState=Ft,e.startState=di,e.innerMode=ti,e.commands=Pn,e.keyMap=cr,e.keyName=lo,e.isModifierKey=so,e.lookupKey=an,e.normalizeKeyMap=kl,e.StringStream=Pt,e.SharedTextMarker=Dn,e.TextMarker=Or,e.LineWidget=In,e.e_preventDefault=re,e.e_stopPropagation=ne,e.e_stop=fe,e.addClass=B,e.contains=v,e.rmClass=C,e.keyNames=Rr}$l(Zt),ql(Zt);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Pi.prototype)Pi.prototype.hasOwnProperty(la)&&le(au,la)<0&&(Zt.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Pi.prototype[la]));return _e(Pi),Zt.inputStyles={textarea:ni,contenteditable:zt},Zt.defineMode=function(e){!Zt.defaults.mode&&e!="null"&&(Zt.defaults.mode=e),Ci.apply(this,arguments)},Zt.defineMIME=Ki,Zt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Zt.defineMIME("text/plain","null"),Zt.defineExtension=function(e,t){Zt.prototype[e]=t},Zt.defineDocExtension=function(e,t){Pi.prototype[e]=t},Zt.fromTextArea=ru,nu(Zt),Zt.version="5.58.2",Zt})},Y1PL:function(st,be,Q){"use strict";Q.r(be),Q.d(be,"ResizableTextArea",function(){return le});var ie=Q("wx14"),$=Q("1OyB"),M=Q("vuIU"),X=Q("Ji7U"),F=Q("LK+K"),U=Q("q1tI"),G=Q("VTBJ"),W=Q("rePB"),i=Q("Zm9Q"),D=Q("Kwbf"),g=Q("c+Xe"),m=Q("m+aA"),p=Q("bdgK"),l=new Map;function u(we){we.forEach(function(Ae){var ce,pe=Ae.target;(ce=l.get(pe))===null||ce===void 0||ce.forEach(function(se){return se(pe)})})}var f=new p.default(u),o=null,h=null;function s(we,Ae){l.has(we)||(l.set(we,new Set),f.observe(we)),l.get(we).add(Ae)}function a(we,Ae){l.has(we)&&(l.get(we).delete(Ae),l.get(we).size||(f.unobserve(we),l.delete(we)))}var A=function(we){Object(X.a)(ce,we);var Ae=Object(F.a)(ce);function ce(){return Object($.a)(this,ce),Ae.apply(this,arguments)}return Object(M.a)(ce,[{key:"render",value:function(){return this.props.children}}]),ce}(U.Component),_=U.createContext(null);function S(we){var Ae=we.children,ce=we.onBatchResize,pe=U.useRef(0),se=U.useRef([]),ae=U.useContext(_),Oe=U.useCallback(function(xe,Pe,De){pe.current+=1;var Ge=pe.current;se.current.push({size:xe,element:Pe,data:De}),Promise.resolve().then(function(){Ge===pe.current&&(ce==null||ce(se.current),se.current=[])}),ae==null||ae(xe,Pe,De)},[ce,ae]);return U.createElement(_.Provider,{value:Oe},Ae)}function L(we){var Ae=we.children,ce=we.disabled,pe=U.useRef(null),se=U.useRef(null),ae=U.useContext(_),Oe=U.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),xe=U.isValidElement(Ae)&&Object(g.c)(Ae),Pe=xe?Ae.ref:null,De=U.useMemo(function(){return Object(g.a)(Pe,pe)},[Pe,pe]),Ge=U.useRef(we);Ge.current=we;var Le=U.useCallback(function(Fe){var We=Ge.current,oe=We.onResize,ge=We.data,Se=Fe.getBoundingClientRect(),Ce=Se.width,je=Se.height,Ve=Fe.offsetWidth,Qe=Fe.offsetHeight,Je=Math.floor(Ce),at=Math.floor(je);if(Oe.current.width!==Je||Oe.current.height!==at||Oe.current.offsetWidth!==Ve||Oe.current.offsetHeight!==Qe){var Xe={width:Je,height:at,offsetWidth:Ve,offsetHeight:Qe};Oe.current=Xe;var qe=Ve===Math.round(Ce)?Ce:Ve,Ne=Qe===Math.round(je)?je:Qe,lt=Object(G.a)(Object(G.a)({},Xe),{},{offsetWidth:qe,offsetHeight:Ne});ae==null||ae(lt,Fe,ge),oe&&Promise.resolve().then(function(){oe(lt,Fe)})}},[]);return U.useEffect(function(){var Fe=Object(m.a)(pe.current)||Object(m.a)(se.current);return Fe&&!ce&&s(Fe,Le),function(){return a(Fe,Le)}},[pe.current,ce]),U.createElement(A,{ref:se},xe?U.cloneElement(Ae,{ref:De}):Ae)}var R="rc-observer-key";function C(we){var Ae=we.children,ce=Object(i.a)(Ae);return ce.map(function(pe,se){var ae=(pe==null?void 0:pe.key)||"".concat(R,"-").concat(se);return U.createElement(L,Object(ie.a)({},we,{key:ae}),pe)})}C.Collection=S;var w=C,x=Q("bT9E"),c=Q("TSYQ"),T=Q.n(c),y=`
|
|
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
|
|
`,v=["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"],N={},B;function O(we){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=we.getAttribute("id")||we.getAttribute("data-reactid")||we.getAttribute("name");if(Ae&&N[ce])return N[ce];var pe=window.getComputedStyle(we),se=pe.getPropertyValue("box-sizing")||pe.getPropertyValue("-moz-box-sizing")||pe.getPropertyValue("-webkit-box-sizing"),ae=parseFloat(pe.getPropertyValue("padding-bottom"))+parseFloat(pe.getPropertyValue("padding-top")),Oe=parseFloat(pe.getPropertyValue("border-bottom-width"))+parseFloat(pe.getPropertyValue("border-top-width")),xe=v.map(function(De){return"".concat(De,":").concat(pe.getPropertyValue(De))}).join(";"),Pe={sizingStyle:xe,paddingSize:ae,borderSize:Oe,boxSizing:se};return Ae&&ce&&(N[ce]=Pe),Pe}function j(we){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,pe=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)),we.getAttribute("wrap")?B.setAttribute("wrap",we.getAttribute("wrap")):B.removeAttribute("wrap");var se=O(we,Ae),ae=se.paddingSize,Oe=se.borderSize,xe=se.boxSizing,Pe=se.sizingStyle;B.setAttribute("style","".concat(Pe,";").concat(y)),B.value=we.value||we.placeholder||"";var De=Number.MIN_SAFE_INTEGER,Ge=Number.MAX_SAFE_INTEGER,Le=B.scrollHeight,Fe;if(xe==="border-box"?Le+=Oe:xe==="content-box"&&(Le-=ae),ce!==null||pe!==null){B.value=" ";var We=B.scrollHeight-ae;ce!==null&&(De=We*ce,xe==="border-box"&&(De=De+ae+Oe),Le=Math.max(De,Le)),pe!==null&&(Ge=We*pe,xe==="border-box"&&(Ge=Ge+ae+Oe),Fe=Le>Ge?"":"hidden",Le=Math.min(Ge,Le))}return{height:Le,minHeight:De,maxHeight:Ge,overflowY:Fe,resize:"none"}}var P=Q("Gytx"),b=Q.n(P),Y;(function(we){we[we.NONE=0]="NONE",we[we.RESIZING=1]="RESIZING",we[we.RESIZED=2]="RESIZED"})(Y||(Y={}));var ee=function(we){Object(X.a)(ce,we);var Ae=Object(F.a)(ce);function ce(pe){var se;return Object($.a)(this,ce),se=Ae.call(this,pe),se.nextFrameActionId=void 0,se.resizeFrameId=void 0,se.textArea=void 0,se.saveTextArea=function(ae){se.textArea=ae},se.handleResize=function(ae){var Oe=se.state.resizeStatus,xe=se.props,Pe=xe.autoSize,De=xe.onResize;if(Oe!==Y.NONE)return;typeof De=="function"&&De(ae),Pe&&se.resizeOnNextFrame()},se.resizeOnNextFrame=function(){cancelAnimationFrame(se.nextFrameActionId),se.nextFrameActionId=requestAnimationFrame(se.resizeTextarea)},se.resizeTextarea=function(){var ae=se.props.autoSize;if(!ae||!se.textArea)return;var Oe=ae.minRows,xe=ae.maxRows,Pe=j(se.textArea,!1,Oe,xe);se.setState({textareaStyles:Pe,resizeStatus:Y.RESIZING},function(){cancelAnimationFrame(se.resizeFrameId),se.resizeFrameId=requestAnimationFrame(function(){se.setState({resizeStatus:Y.RESIZED},function(){se.resizeFrameId=requestAnimationFrame(function(){se.setState({resizeStatus:Y.NONE}),se.fixFirefoxAutoScroll()})})})})},se.renderTextArea=function(){var ae=se.props,Oe=ae.prefixCls,xe=Oe===void 0?"rc-textarea":Oe,Pe=ae.autoSize,De=ae.onResize,Ge=ae.className,Le=ae.disabled,Fe=se.state,We=Fe.textareaStyles,oe=Fe.resizeStatus,ge=Object(x.a)(se.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Se=T()(xe,Ge,Object(W.a)({},"".concat(xe,"-disabled"),Le));"value"in ge&&(ge.value=ge.value||"");var Ce=Object(G.a)(Object(G.a)(Object(G.a)({},se.props.style),We),oe===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return U.createElement(w,{onResize:se.handleResize,disabled:!(Pe||De)},U.createElement("textarea",Object(ie.a)({},ge,{className:Se,style:Ce,ref:se.saveTextArea})))},se.state={textareaStyles:{},resizeStatus:Y.NONE},se}return Object(M.a)(ce,[{key:"componentDidUpdate",value:function(se){(se.value!==this.props.value||!b()(se.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 se=this.textArea.selectionStart,ae=this.textArea.selectionEnd;this.textArea.setSelectionRange(se,ae)}}catch(Oe){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ce}(U.Component),le=ee,ue=function(we){Object(X.a)(ce,we);var Ae=Object(F.a)(ce);function ce(pe){var se;Object($.a)(this,ce),se=Ae.call(this,pe),se.resizableTextArea=void 0,se.focus=function(){se.resizableTextArea.textArea.focus()},se.saveTextArea=function(Oe){se.resizableTextArea=Oe},se.handleChange=function(Oe){var xe=se.props.onChange;se.setValue(Oe.target.value,function(){se.resizableTextArea.resizeTextarea()}),xe&&xe(Oe)},se.handleKeyDown=function(Oe){var xe=se.props,Pe=xe.onPressEnter,De=xe.onKeyDown;Oe.keyCode===13&&Pe&&Pe(Oe),De&&De(Oe)};var ae=typeof pe.value=="undefined"||pe.value===null?pe.defaultValue:pe.value;return se.state={value:ae},se}return Object(M.a)(ce,[{key:"setValue",value:function(se,ae){"value"in this.props||this.setState({value:se},ae)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return U.createElement(le,Object(ie.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(se){return"value"in se?{value:se.value}:null}}]),ce}(U.Component),ke=be.default=ue},ZW9T:function(st,be,Q){"use strict";Q.d(be,"a",function(){return P});var ie=Q("k1fw"),$=Q("oBTY"),M=Q("miYZ"),X=Q("tsqr"),F=Q("rAM+"),U=Q("tJVT"),G=Q("PpiC"),W=Q("q1tI"),i=Q.n(W),D=Q("bdgK"),g=Q("9og8"),m=Q("WmNS"),p=Q.n(m),l={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"]},u={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(`
|
|
`)}]},o={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=Q("5VLF"),s=Q.n(h),a={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(le){return{label:le,kind:Y.languages.CompletionItemKind.Keyword,insertText:le}})},_=function(Y){return Object.keys(a.tables).map(function(ee){return{label:ee,kind:Y.languages.CompletionItemKind.Variable,insertText:ee}})},S=function(Y,ee){var le=a.tables[Y];return le?le.map(function(ue){return{label:ue,kind:ee.languages.CompletionItemKind.Field,insertText:ue}}):[]};function L(b,Y,ee,le,ue){var ke=Y.getWordUntilPosition(ee),we={startLineNumber:ee.lineNumber,endLineNumber:ee.lineNumber,startColumn:ke.startColumn,endColumn:ke.endColumn},Ae=le.map(function(ce){return{label:ce,kind:b.languages.CompletionItemKind.Keyword,insertText:ce,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:we}});return ue.map(function(ce){Ae.push(Object(ie.a)(Object(ie.a)({},ce),{},{range:we}))}),Ae}var R=function(b){a.languages.map(function(ue){return b.languages.registerDocumentFormattingEditProvider(ue,{provideDocumentFormattingEdits:function(we,Ae,ce){return Object(g.a)(p.a.mark(function pe(){var se;return p.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return se=s()(we.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}),Oe.abrupt("return",[{range:we.getFullModelRange(),text:se}]);case 2:case"end":return Oe.stop()}},pe)}))()}}),ue});var Y=f.quickKey.map(function(ue){return{label:ue.label,kind:b.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ee=o.quickKey.map(function(ue){return{label:ue.label,kind:b.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),le=u.quickKey.map(function(ue){return{label:ue.label,kind:b.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}});b.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ke,we){var Ae=ke.getWordUntilPosition(we),ce={startLineNumber:we.lineNumber,endLineNumber:we.lineNumber,startColumn:Ae.startColumn,endColumn:Ae.endColumn},pe=ke.getLineContent(we.lineNumber).substring(Ae.startColumn-2,Ae.endColumn);return{suggestions:[].concat(Object($.a)(f.keywords.map(function(se){return{label:se,kind:b.languages.CompletionItemKind.Function,documentation:se,insertText:se,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}})),Object($.a)(f.quickKey.map(function(se){return{label:se.label,kind:b.languages.CompletionItemKind.Function,documentation:se.content,insertText:pe.startsWith("#")?se.content.replace(/#/,""):se.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}})))}}}),b.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(ke,we){var Ae=ke.getWordUntilPosition(we),ce={startLineNumber:we.lineNumber,endLineNumber:we.lineNumber,startColumn:Ae.startColumn,endColumn:Ae.endColumn};return{suggestions:Object($.a)(l.keywords.map(function(pe){return{label:pe,kind:b.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}}))}}}),b.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ke,we){var Ae=ke.getWordUntilPosition(we),ce={startLineNumber:we.lineNumber,endLineNumber:we.lineNumber,startColumn:Ae.startColumn,endColumn:Ae.endColumn},pe=ke.getLineContent(we.lineNumber).substring(Ae.startColumn-2,Ae.endColumn);return{suggestions:[].concat(Object($.a)(u.keywords.map(function(se){return{label:se,kind:b.languages.CompletionItemKind.Function,documentation:se,insertText:se,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}})),Object($.a)(u.quickKey.map(function(se){return{label:se.label,kind:b.languages.CompletionItemKind.Function,documentation:se.content,insertText:pe.startsWith("#")?se.content.replace(/#/,""):se.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}})))}}}),b.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ke,we){var Ae=ke.getWordUntilPosition(we),ce={startLineNumber:we.lineNumber,endLineNumber:we.lineNumber,startColumn:Ae.startColumn,endColumn:Ae.endColumn},pe=ke.getLineContent(we.lineNumber).substring(Ae.startColumn-2,Ae.endColumn);return{suggestions:[].concat(Object($.a)(o.keywords.map(function(se){return{label:se,kind:b.languages.CompletionItemKind.Function,documentation:se,insertText:se,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}})),Object($.a)(o.quickKey.map(function(se){return{label:se.label,kind:b.languages.CompletionItemKind.Function,documentation:se.content,insertText:pe.startsWith("#")?se.content.replace(/#/,""):se.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}})))}}})},C="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",w=Q("fjLI"),x=Q("LvDl"),c=Q("+ua5");function T(b){return/^\d+$/.test(b)?"".concat(b,"px"):b}function y(){}var v=!1,N={"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 le=N[b[ee]];if(le)return le}return Y[0]}return N[Y]||Y}var O=null,j=be.b=function(b){var Y=b.width,ee=Y===void 0?"100%":Y,le=b.height,ue=le===void 0?"100%":le,ke=b.value,we=b.language,Ae=we===void 0?"javascript":we,ce=b.style,pe=ce===void 0?{}:ce,se=b.options,ae=se===void 0?{}:se,Oe=b.overrideServices,xe=Oe===void 0?{}:Oe,Pe=b.theme,De=Pe===void 0?"vs-dark":Pe,Ge=b.onEditBlur,Le=b.onSave,Fe=b.autoHeight,We=Fe===void 0?!1:Fe,oe=b.forbidCopy,ge=oe===void 0?!1:oe,Se=b.onChange,Ce=Se===void 0?y:Se,je=b.editorDidMount,Ve=je===void 0?y:je,Qe=b.onFocus,Je=Qe===void 0?y:Qe,at=b.filename,Xe=at===void 0?"educoder.txt":at,qe=b.errorLine,Ne=b.errorContent,lt=Ne===void 0?"":Ne,nt=Object(G.a)(b,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Be=Object(W.useRef)(),Ue=Object(W.useRef)({}),Te=Object(W.useRef)(),ve=Object(W.useRef)(),_e=Object(W.useRef)(!1),re=Object(W.useRef)(),ne=Object(W.useState)(!1),he=Object(U.a)(ne,2),fe=he[0],Ee=he[1];function Me(){var bt;return Be.current&&(bt=new D.default(function(xt){var Ft=Object(F.a)(xt),ti;try{for(Ft.s();!(ti=Ft.n()).done;){var di=ti.value;(di.target.offsetHeight>0||di.target.offsetWidth>0)&&Ue.current.instance.layout()}}catch(Pt){Ft.e(Pt)}finally{Ft.f()}}),bt.observe(Be.current)),bt}function ze(){X.b.warn(decodeURIComponent(C))}var ot=function(){var xt=Ue.current.instance;if(ke!=null&&xt&&fe){var Ft=xt.getModel();Ft&&ke!==Ft.getValue()&&(v=!0,Ft.setValue(ke),xt.layout(),v=!1)}};Object(W.useEffect)(function(){ve.current&&clearTimeout(ve.current),ve.current=setTimeout(function(){ot()},500)},[ke,fe,Ue.current]),Object(W.useEffect)(function(){if(qe&&Ue.current&&Ue.current.instance){var bt=Ue.current.instance;bt.changeViewZones(function(Ft){var ti=document.createElement("div");ti.style.padding="10px 20px",ti.style.width="calc(100% - 20px)",ti.className="my-error-line-wrp",ti.innerHTML=lt,Ft.addZone({afterLineNumber:qe||11,heightInLines:3,domNode:ti})});var xt={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}};bt.addOverlayWidget(xt),bt.revealPositionInCenter({lineNumber:20,column:1})}},[qe,Ue.current,fe]);function mt(){var bt=Ue.current.instance;if(bt){var xt=bt.getSelection(),Ft=Ue.current.pastePos||{},ti=new O.Range(Ft.startLineNumber||xt.endLineNumber,Ft.startColumn||xt.endColumn,Ft.endLineNumber||xt.endLineNumber,Ft.endColumn||xt.endColumn);setTimeout(function(){bt.executeEdits("",[{range:ti,text:""}])},300)}}function ft(bt){(window.navigator.platform.match("Mac")?bt.metaKey:bt.ctrlKey)&&bt.keyCode==83&&(bt.preventDefault(),Le())}var wt=function(){if(We&&Ue.current.instance){var xt=Ue.current.instance.getContentHeight();yt(xt<ue?ue:xt)}else yt(ue)};function St(bt){var xt=document.createEvent("MouseEvents");xt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),bt.dispatchEvent(xt)}function dt(bt,xt){var Ft=window.URL||window.webkitURL||window,ti=new Blob([xt]),di=document.createElementNS("http://www.w3.org/1999/xhtml","a");di.href=Ft.createObjectURL(ti),di.download=bt,St(di)}Object(W.useEffect)(function(){wt()},[wt]),Object(W.useEffect)(function(){Be.current&&!fe&&Promise.all([Q.e(16),Q.e(28)]).then(Q.t.bind(null,"M/lh",7)).then(function(bt){try{O=bt,Ue.current.instance=O.editor.create(Be.current,{value:ke,language:B(Ae),theme:De,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},xe);var xt=Ue.current.instance,Ft=w.d._menuItems,ti=Object($.a)(Ft).find(function(Vt){return Vt[0]._debugName=="EditorContext"}),di=ti[1],Pt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],ct=function(Jt,Ot){var li=Jt._first;do{var Ii,Xi,Ze=Ot.includes((Ii=li.element)===null||Ii===void 0||((Xi=Ii.command)===null||Xi===void 0)?void 0:Xi.id);Ze&&Jt._remove(li)}while(li=li.next)};if(Ve(xt,O),setTimeout(function(){wt(),Ue.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){dt(Xe||"educoder.txt",xt.getValue())}}),xt.getDomNode().addEventListener("input",function(){Te.current.autoFormat&&xt.getAction("editor.action.formatDocument").run()})},500),Ue.current.subscription=xt.onDidChangeModelContent(function(Vt){_e.current?clearTimeout(re.current):(wt(),Ce(xt.getValue(),Vt)),re.current=setTimeout(function(){_e.current=!1},500)}),window.Monaco||R(O,B(Ae)),ge&&(ct(di,Pt),Be.current.classList.add("noCopyPaste"),xt.onKeyDown(function(Vt){var Jt=Vt.keyCode,Ot=Vt.ctrlKey,li=Vt.metaKey;(Jt===33||Jt===52)&&(li||Ot)&&(ze(),Vt.preventDefault())})),window.Monaco=O,Ge&&xt.onDidBlurEditorWidget(function(){Ge(xt.getValue())}),Je&&xt.onDidFocusEditorText(function(){Je(xt.getValue())}),ge){xt.addCommand(O.KeyMod.CtrlCmd|O.KeyCode.KEY_V,function(){return ze(),null}),xt.onDidPaste(function(Vt){Ue.current.pastePos=Vt});try{window.addEventListener("paste",mt)}catch(Vt){}}var Ui=Me();return Ee(!0),function(){var Vt=Ue.current.instance;Vt.dispose();var Jt=Vt.getModel();Jt&&Jt.dispose(),Ue.current.subscription&&Ue.current.subscription.dispose(),ge&&window.removeEventListener("paste",mt),Ui.unobserve(Be.current)}}catch(Vt){}})},[]),Object(W.useEffect)(function(){var bt=Ue.current.instance;if(bt&&fe)return document.addEventListener("keydown",ft,!1),function(){document.removeEventListener("keydown",ft)}},[Le,fe]),Object(W.useEffect)(function(){var bt=Ue.current.instance;if(bt&&fe){var xt=B(Ae);O.editor.setModelLanguage(bt.getModel(),xt),console.log("language:",Ae,bt.getModel(),xt)}},[Ae,fe]),Object(W.useEffect)(function(){var bt=Ue.current.instance;bt&&fe&&O.editor.setTheme(De)},[De,fe]),Object(W.useEffect)(function(){var bt=Ue.current.instance;Te.current=ae,bt&&fe&&(bt.updateOptions(Object(ie.a)({},ae)),setTimeout(function(){bt.getModel().updateOptions(Object(ie.a)({},ae))},200))},[JSON.stringify(ae),fe]),Object(W.useEffect)(function(){var bt=Ue.current.instance;bt&&fe&&bt.layout()},[ee,ue,fe]);var Ut=Object(W.useState)(T(ee)),Lt=Object(U.a)(Ut,2),qt=Lt[0],Qt=Lt[1],It=Object(W.useState)(T(ue)),Ci=Object(U.a)(It,2),Ki=Ci[0],yt=Ci[1],Li=Object(ie.a)(Object(ie.a)({},pe),{},{width:qt,height:Ki});return i.a.createElement("div",{className:"my-monaco-editor",ref:Be,style:Li})};function P(b){var Y=b.width,ee=Y===void 0?"100%":Y,le=b.height,ue=le===void 0?"100%":le,ke=b.original,we=b.modified,Ae=b.language,ce=b.options,pe=ce===void 0?{}:ce,se=Object(W.useRef)(),ae=Object(W.useState)(null),Oe=Object(U.a)(ae,2),xe=Oe[0],Pe=Oe[1];function De(We){var oe;return se.current&&(oe=new D.default(function(ge){var Se=Object(F.a)(ge),Ce;try{for(Se.s();!(Ce=Se.n()).done;){var je=Ce.value;(je.target.offsetHeight>0||je.target.offsetWidth>0)&&We.layout()}}catch(Ve){Se.e(Ve)}finally{Se.f()}}),oe.observe(se.current)),oe}Object(W.useEffect)(function(){se.current&&Promise.all([Q.e(16),Q.e(28)]).then(Q.t.bind(null,"M/lh",7)).then(function(We){O=We;var oe=O.editor.createDiffEditor(se.current,Object(ie.a)(Object(ie.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},pe),{},{wordWrap:!0}));Pe(oe);var ge=De(oe);return function(){oe.dispose();var Se=oe.getModel();Se&&Se.dispose(),ge.unobserve(se.current)}})},[]),Object(W.useEffect)(function(){xe&&xe.setModel({original:O.editor.createModel(ke,Ae),modified:O.editor.createModel(we,Ae)})},[ke,we,Ae,xe]);var Ge=T(ee),Le=T(ue),Fe={width:Ge,height:Le};return i.a.createElement("div",{className:"my-diff-editor",ref:se,style:Fe})}},ZpRC:function(st,be,Q){"use strict";function ie(g){return typeof g=="object"&&g!=null&&g.nodeType===1}function $(g,m){return(!m||g!=="hidden")&&g!=="visible"&&g!=="clip"}function M(g,m){if(g.clientHeight<g.scrollHeight||g.clientWidth<g.scrollWidth){var p=getComputedStyle(g,null);return $(p.overflowY,m)||$(p.overflowX,m)||function(l){var u=function(f){if(!f.ownerDocument||!f.ownerDocument.defaultView)return null;try{return f.ownerDocument.defaultView.frameElement}catch(o){return null}}(l);return!!u&&(u.clientHeight<l.scrollHeight||u.clientWidth<l.scrollWidth)}(g)}return!1}function X(g,m,p,l,u,f,o,h){return f<g&&o>m||f>g&&o<m?0:f<=g&&h<=p||o>=m&&h>=p?f-g-l:o>m&&h<p||f<g&&h>p?o-m+u:0}var F=function(g,m){var p=window,l=m.scrollMode,u=m.block,f=m.inline,o=m.boundary,h=m.skipOverflowHiddenElements,s=typeof o=="function"?o:function(We){return We!==o};if(!ie(g))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,A=[],_=g;ie(_)&&s(_);){if((_=_.parentElement)===a){A.push(_);break}_!=null&&_===document.body&&M(_)&&!M(document.documentElement)||_!=null&&M(_,h)&&A.push(_)}for(var S=p.visualViewport?p.visualViewport.width:innerWidth,L=p.visualViewport?p.visualViewport.height:innerHeight,R=window.scrollX||pageXOffset,C=window.scrollY||pageYOffset,w=g.getBoundingClientRect(),x=w.height,c=w.width,T=w.top,y=w.right,v=w.bottom,N=w.left,B=u==="start"||u==="nearest"?T:u==="end"?v:T+x/2,O=f==="center"?N+c/2:f==="end"?y:N,j=[],P=0;P<A.length;P++){var b=A[P],Y=b.getBoundingClientRect(),ee=Y.height,le=Y.width,ue=Y.top,ke=Y.right,we=Y.bottom,Ae=Y.left;if(l==="if-needed"&&T>=0&&N>=0&&v<=L&&y<=S&&T>=ue&&v<=we&&N>=Ae&&y<=ke)return j;var ce=getComputedStyle(b),pe=parseInt(ce.borderLeftWidth,10),se=parseInt(ce.borderTopWidth,10),ae=parseInt(ce.borderRightWidth,10),Oe=parseInt(ce.borderBottomWidth,10),xe=0,Pe=0,De="offsetWidth"in b?b.offsetWidth-b.clientWidth-pe-ae:0,Ge="offsetHeight"in b?b.offsetHeight-b.clientHeight-se-Oe:0;if(a===b)xe=u==="start"?B:u==="end"?B-L:u==="nearest"?X(C,C+L,L,se,Oe,C+B,C+B+x,x):B-L/2,Pe=f==="start"?O:f==="center"?O-S/2:f==="end"?O-S:X(R,R+S,S,pe,ae,R+O,R+O+c,c),xe=Math.max(0,xe+C),Pe=Math.max(0,Pe+R);else{xe=u==="start"?B-ue-se:u==="end"?B-we+Oe+Ge:u==="nearest"?X(ue,we,ee,se,Oe+Ge,B,B+x,x):B-(ue+ee/2)+Ge/2,Pe=f==="start"?O-Ae-pe:f==="center"?O-(Ae+le/2)+De/2:f==="end"?O-ke+ae+De:X(Ae,ke,le,pe,ae+De,O,O+c,c);var Le=b.scrollLeft,Fe=b.scrollTop;B+=Fe-(xe=Math.max(0,Math.min(Fe+xe,b.scrollHeight-ee+Ge))),O+=Le-(Pe=Math.max(0,Math.min(Le+Pe,b.scrollWidth-le+De)))}j.push({el:b,top:xe,left:Pe})}return j};function U(g){return g===Object(g)&&Object.keys(g).length!==0}function G(g,m){m===void 0&&(m="auto");var p="scrollBehavior"in document.body.style;g.forEach(function(l){var u=l.el,f=l.top,o=l.left;u.scroll&&p?u.scroll({top:f,left:o,behavior:m}):(u.scrollTop=f,u.scrollLeft=o)})}function W(g){return g===!1?{block:"end",inline:"nearest"}:U(g)?g:{block:"start",inline:"nearest"}}function i(g,m){var p=!g.ownerDocument.documentElement.contains(g);if(U(m)&&typeof m.behavior=="function")return m.behavior(p?[]:F(g,m));if(p)return;var l=W(m);return G(F(g,l),l.behavior)}var D=be.a=i},bT9E:function(st,be,Q){"use strict";Q.d(be,"a",function(){return $});var ie=Q("VTBJ");function $(M,X){var F=Object(ie.a)({},M);return Array.isArray(X)&&X.forEach(function(U){delete F[U]}),F}},c5Ni:function(st,be,Q){},dejd:function(st,be,Q){},dmUQ:function(st,be,Q){"use strict";var ie=Q("Ff2n"),$=Q("rePB"),M=Q("1OyB"),X=Q("vuIU"),F=Q("Ji7U"),U=Q("md7G"),G=Q("foSv"),W=Q("q1tI"),i=Q.n(W),D=Q("TSYQ"),g=Q.n(D),m=Q("4IlW");function p(x,c){var T=Object.keys(x);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(x);c&&(y=y.filter(function(v){return Object.getOwnPropertyDescriptor(x,v).enumerable})),T.push.apply(T,y)}return T}function l(x){for(var c=1;c<arguments.length;c++){var T=arguments[c]!=null?arguments[c]:{};c%2?p(Object(T),!0).forEach(function(y){Object($.a)(x,y,T[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(T)):p(Object(T)).forEach(function(y){Object.defineProperty(x,y,Object.getOwnPropertyDescriptor(T,y))})}return x}function u(x){var c=f();return function(){var y=Object(G.a)(x),v;if(c){var N=Object(G.a)(this).constructor;v=Reflect.construct(y,arguments,N)}else v=y.apply(this,arguments);return Object(U.a)(this,v)}}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 o(){}function h(x){x.preventDefault()}var s=function(c){return c.replace(/[^\w.-]+/g,"")},a=200,A=600,_=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(c){return c!=null},L=function(c,T){return T===c||typeof T=="number"&&typeof c=="number"&&isNaN(T)&&isNaN(c)},R=function(x){Object(F.a)(T,x);var c=u(T);function T(y){var v;Object(M.a)(this,T),v=c.call(this,y),v.onKeyDown=function(O){var j=v.props,P=j.onKeyDown,b=j.onPressEnter;if(O.keyCode===m.a.UP){var Y=v.getRatio(O);v.up(O,Y,null),v.stop()}else if(O.keyCode===m.a.DOWN){var ee=v.getRatio(O);v.down(O,ee,null),v.stop()}else O.keyCode===m.a.ENTER&&b&&b(O);if(v.recordCursorPosition(),v.lastKeyCode=O.keyCode,P){for(var le=arguments.length,ue=new Array(le>1?le-1:0),ke=1;ke<le;ke++)ue[ke-1]=arguments[ke];P.apply(void 0,[O].concat(ue))}},v.onKeyUp=function(O){var j=v.props.onKeyUp;if(v.stop(),v.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))}},v.onChange=function(O){var j=v.props.onChange;v.state.focused&&(v.inputting=!0),v.rawInput=v.props.parser(v.getValueFromEvent(O)),v.setState({inputValue:v.rawInput}),j(v.toNumber(v.rawInput))},v.onMouseUp=function(){var O=v.props.onMouseUp;v.recordCursorPosition(),O&&O.apply(void 0,arguments)},v.onFocus=function(){var O;v.setState({focused:!0}),(O=v.props).onFocus.apply(O,arguments)},v.onBlur=function(){var O=v.props.onBlur;v.inputting=!1,v.setState({focused:!1});var j=v.getCurrentValidValue(v.state.inputValue),P=v.setValue(j,o);if(O){var b=v.input.value,Y=v.getInputDisplayValue({focus:!1,value:P});v.input.value=Y&&Number(Y),O.apply(void 0,arguments),v.input.value=b}},v.getRatio=function(O){var j=1;return O.metaKey||O.ctrlKey?j=.1:O.shiftKey&&(j=10),j},v.getFullNum=function(O){return isNaN(O)?O:/e/i.test(String(O))?Number(O).toFixed(18).replace(/\.?0+$/,""):O},v.getPrecision=function(O){if(S(v.props.precision))return v.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},v.getInputDisplayValue=function(O){var j=O||v.state,P=j.focused,b=j.inputValue,Y=j.value,ee;P?ee=b:ee=v.toPrecisionAsStep(Y),ee==null&&(ee="");var le=v.formatWrapper(ee);return S(v.props.decimalSeparator)&&(le=le.toString().replace(".",v.props.decimalSeparator)),le},v.recordCursorPosition=function(){try{v.cursorStart=v.input.selectionStart,v.cursorEnd=v.input.selectionEnd,v.currentValue=v.input.value,v.cursorBefore=v.input.value.substring(0,v.cursorStart),v.cursorAfter=v.input.value.substring(v.cursorEnd)}catch(O){}},v.restoreByAfter=function(O){if(O===void 0)return!1;var j=v.input.value,P=j.lastIndexOf(O);if(P===-1)return!1;var b=v.cursorBefore.length;return v.lastKeyCode===m.a.DELETE&&v.cursorBefore.charAt(b-1)===O[0]?(v.fixCaret(b,b),!0):P+O.length===j.length?(v.fixCaret(P,P),!0):!1},v.partRestoreByAfter=function(O){return O===void 0?!1:Array.prototype.some.call(O,function(j,P){var b=O.substring(P);return v.restoreByAfter(b)})},v.isNotCompleteNumber=function(O){return isNaN(O)||O===""||O===null||O&&O.toString().indexOf(".")===O.toString().length-1},v.stop=function(){v.autoStepTimer&&clearTimeout(v.autoStepTimer)},v.down=function(O,j,P){v.pressingUpOrDown=!0,v.step("down",O,j,P)},v.up=function(O,j,P){v.pressingUpOrDown=!0,v.step("up",O,j,P)},v.saveInput=function(O){v.input=O};var N=y.value;N===void 0&&(N=y.defaultValue),v.state={focused:y.autoFocus};var B=v.getValidValue(v.toNumber(N));return v.state=l(l({},v.state),{},{inputValue:v.toPrecisionAsStep(B),value:B}),v}return Object(X.a)(T,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(v){var N=this.props,B=N.value,O=N.onChange,j=N.max,P=N.min,b=this.state.focused;if(v){if(!L(v.value,B)||!L(v.max,j)||!L(v.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 le="value"in this.props?B:this.state.value;"max"in this.props&&v.max!==j&&typeof le=="number"&&le>j&&O&&O(j),"min"in this.props&&v.min!==P&&typeof le=="number"&&le<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 ue=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?ue=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(ue=this.cursorStart):ue=this.input.value.length,this.fixCaret(ue,ue)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ke){}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(v){var N=v;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(v){var N=v.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(v){var N=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(v);return isNaN(O)?v:(O<N&&(O=N),O>B&&(O=B),O)}},{key:"setValue",value:function(v,N){var B=this.props.precision,O=this.isNotCompleteNumber(parseFloat(v))?null:parseFloat(v),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),le=O!==P||ee!=="".concat(Y);return"value"in this.props?(Y=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Y},N)):this.setState({value:O,inputValue:this.toPrecisionAsStep(v)},N),le&&this.props.onChange(O),O}},{key:"getMaxPrecision",value:function(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,O=B.precision,j=B.step;if(S(O))return O;var P=this.getPrecision(N),b=this.getPrecision(j),Y=this.getPrecision(v);return v?Math.max(Y,P+b):P+b}},{key:"getPrecisionFactor",value:function(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(v,N);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(v){return this.props.formatter?this.props.formatter(v):v}},{key:"toPrecisionAsStep",value:function(v){if(this.isNotCompleteNumber(v)||v==="")return v;var N=Math.abs(this.getMaxPrecision(v));return isNaN(N)?v.toString():Number(v).toFixed(N)}},{key:"toNumber",value:function(v){var N=this.props.precision,B=this.state.focused,O=v&&v.length>16&&B;return this.isNotCompleteNumber(v)||O?v:S(N)?Math.round(v*Math.pow(10,N))/Math.pow(10,N):Number(v)}},{key:"upStep",value:function(v,N){var B=this.props.step,O=this.getPrecisionFactor(v,N),j=Math.abs(this.getMaxPrecision(v,N)),P=((O*v+O*B*N)/O).toFixed(j);return this.toNumber(P)}},{key:"downStep",value:function(v,N){var B=this.props.step,O=this.getPrecisionFactor(v,N),j=Math.abs(this.getMaxPrecision(v,N)),P=((O*v-O*B*N)/O).toFixed(j);return this.toNumber(P)}},{key:"step",value:function(v,N){var B=this,O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.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(v,"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[v](N,O,!0)},j?a:A)}},{key:"fixCaret",value:function(v,N){if(v===void 0||N===void 0||!this.input||!this.input.value)return;try{var B=this.input.selectionStart,O=this.input.selectionEnd;(v!==B||N!==O)&&this.input.setSelectionRange(v,N)}catch(j){}}},{key:"render",value:function(){var v,N=this.props,B=N.prefixCls,O=N.disabled,j=N.readOnly,P=N.useTouch,b=N.autoComplete,Y=N.upHandler,ee=N.downHandler,le=N.className,ue=N.max,ke=N.min,we=N.style,Ae=N.title,ce=N.onMouseEnter,pe=N.onMouseLeave,se=N.onMouseOver,ae=N.onMouseOut,Oe=N.required,xe=N.onClick,Pe=N.tabIndex,De=N.type,Ge=N.placeholder,Le=N.id,Fe=N.inputMode,We=N.pattern,oe=N.step,ge=N.maxLength,Se=N.autoFocus,Ce=N.name,je=N.onPaste,Ve=N.onInput,Qe=Object(ie.a)(N,["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"]),Je=this.state,at=Je.value,Xe=Je.focused,qe=g()(B,(v={},Object($.a)(v,le,!!le),Object($.a)(v,"".concat(B,"-disabled"),O),Object($.a)(v,"".concat(B,"-focused"),Xe),v)),Ne={};Object.keys(Qe).forEach(function(fe){(fe.substr(0,5)==="data-"||fe.substr(0,5)==="aria-"||fe==="role")&&(Ne[fe]=Qe[fe])});var lt=!j&&!O,nt=this.getInputDisplayValue(null),Be=(at||at===0)&&(isNaN(at)||Number(at)>=ue),Ue=(at||at===0)&&(isNaN(at)||Number(at)<=ke),Te=Be||O||j,ve=Ue||O||j,_e=g()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object($.a)({},"".concat(B,"-handler-up-disabled"),Te)),re=g()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object($.a)({},"".concat(B,"-handler-down-disabled"),ve)),ne=P?{onTouchStart:Te?o:this.up,onTouchEnd:this.stop}:{onMouseDown:Te?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},he=P?{onTouchStart:ve?o:this.down,onTouchEnd:this.stop}:{onMouseDown:ve?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return i.a.createElement("div",{className:qe,style:we,title:Ae,onMouseEnter:ce,onMouseLeave:pe,onMouseOver:se,onMouseOut:ae,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"},ne,{role:"button","aria-label":"Increase Value","aria-disabled":Te,className:_e}),Y||i.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:h})),i.a.createElement("span",Object.assign({unselectable:"on"},he,{role:"button","aria-label":"Decrease Value","aria-disabled":ve,className:re}),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":ke,"aria-valuemax":ue,"aria-valuenow":at,required:Oe,type:De,placeholder:Ge,onPaste:je,onClick:xe,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:Pe,autoComplete:b,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:lt?this.onKeyDown:o,onKeyUp:lt?this.onKeyUp:o,autoFocus:Se,maxLength:ge,readOnly:j,disabled:O,max:ue,min:ke,step:oe,name:Ce,title:Ae,id:Le,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(nt),pattern:We,inputMode:Fe,onInput:Ve},Ne))))}}]),T}(i.a.Component);R.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:_,min:-_,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:s,required:!1,autoComplete:"off"};var C=R,w=be.a=C},fjLI:function(st,be,Q){"use strict";Q.d(be,"f",function(){return p}),Q.d(be,"b",function(){return l}),Q.d(be,"a",function(){return u}),Q.d(be,"d",function(){return f}),Q.d(be,"e",function(){return o}),Q.d(be,"c",function(){return h});var ie=Q("8HAY"),$=Q("Vhoy"),M=Q("MI8n"),X=Q("JYp7"),F=Q("pmY6"),U=Q("24hK"),G=Q("nnTU"),W=Q("T8No"),i=Q("Cg/j"),D=Q("t9D7"),g=function(s,a,A,_){var S=arguments.length,L=S<3?a:_===null?_=Object.getOwnPropertyDescriptor(a,A):_,R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(s,a,A,_);else for(var C=s.length-1;C>=0;C--)(R=s[C])&&(L=(S<3?R(L):S>3?R(a,A,L):R(a,A))||L);return S>3&&L&&Object.defineProperty(a,A,L),L},m=function(s,a){return function(A,_){a(A,_,s)}};function p(s){return s.command!==void 0}class l{constructor(s){this.id=l._idPool++,this._debugName=s}}l._idPool=0,l.CommandPalette=new l("CommandPalette"),l.EditorContext=new l("EditorContext"),l.SimpleEditorContext=new l("SimpleEditorContext"),l.EditorContextCopy=new l("EditorContextCopy"),l.EditorContextPeek=new l("EditorContextPeek"),l.MenubarEditMenu=new l("MenubarEditMenu"),l.MenubarCopy=new l("MenubarCopy"),l.MenubarGoMenu=new l("MenubarGoMenu"),l.MenubarSelectionMenu=new l("MenubarSelectionMenu"),l.InlineCompletionsActions=new l("InlineCompletionsActions");const u=Object(i.c)("menuService"),f=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new M.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===l.CommandPalette}}addCommand(s){return this.addCommands(X.a.single(s))}addCommands(s){for(const a of s)this._commands.set(a.id,a);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(F.i)(()=>{let a=!1;for(const A of s)a=this._commands.delete(A.id)||a;a&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((a,A)=>s.set(A,a)),s}appendMenuItem(s,a){return this.appendMenuItems(X.a.single({id:s,item:a}))}appendMenuItems(s){const a=new Set,A=new U.a;for(const{id:_,item:S}of s){let L=this._menuItems.get(_);L||(L=new U.a,this._menuItems.set(_,L)),A.push(L.push(S)),a.add(_)}return this._onDidChangeMenu.fire(a),Object(F.i)(()=>{if(A.size>0){for(let _ of A)_();this._onDidChangeMenu.fire(a),A.clear()}})}getMenuItems(s){let a;return this._menuItems.has(s)?a=[...this._menuItems.get(s)]:a=[],s===l.CommandPalette&&this._appendImplicitItems(a),a}_appendImplicitItems(s){const a=new Set;for(const A of s)p(A)&&(a.add(A.command.id),A.alt&&a.add(A.alt.id));this._commands.forEach((A,_)=>{a.has(_)||s.push({command:A})})}};class o extends ie.e{constructor(s,a,A,_){super(`submenuitem.${s.submenu.id}`,typeof s.title=="string"?s.title:s.title.value,[],"submenu");this.item=s,this._menuService=a,this._contextKeyService=A,this._options=_}get actions(){const s=[],a=this._menuService.createMenu(this.item.submenu,this._contextKeyService),A=a.getActions(this._options);a.dispose();for(const[,_]of A)_.length>0&&(s.push(..._),s.push(new ie.d));return s.length&&s.pop(),s}}let h=class s{constructor(a,A,_,S,L){var R,C;if(this._commandService=L,this.id=a.id,this.label=(_==null?void 0:_.renderShortTitle)&&a.shortTitle?typeof a.shortTitle=="string"?a.shortTitle:a.shortTitle.value:typeof a.title=="string"?a.title:a.title.value,this.tooltip=(C=typeof a.tooltip=="string"?a.tooltip:(R=a.tooltip)===null||R===void 0?void 0:R.value)!==null&&C!==void 0?C:"",this.enabled=!a.precondition||S.contextMatchesRules(a.precondition),this.checked=void 0,a.toggled){const w=a.toggled.condition?a.toggled:{condition:a.toggled};this.checked=S.contextMatchesRules(w.condition),this.checked&&w.tooltip&&(this.tooltip=typeof w.tooltip=="string"?w.tooltip:w.tooltip.value),w.title&&(this.label=typeof w.title=="string"?w.title:w.title.value)}this.item=a,this.alt=A?new s(A,void 0,_,S,L):void 0,this._options=_,D.d.isThemeIcon(a.icon)&&(this.class=$.a.asClassName(a.icon))}dispose(){}run(...a){var A,_;let S=[];return((A=this._options)===null||A===void 0?void 0:A.arg)&&(S=[...S,this._options.arg]),((_=this._options)===null||_===void 0?void 0:_.shouldForwardArgs)&&(S=[...S,...a]),this._commandService.executeCommand(this.id,...S)}};h=g([m(3,W.b),m(4,G.b)],h)},gJ3r:function(st,be,Q){"use strict";Q.d(be,"a",function(){return ie});var ie=[{value:"\u5317\u4EAC",label:"\u5317\u4EAC",children:[{value:"\u4E1C\u57CE",label:"\u4E1C\u57CE"},{value:"\u897F\u57CE",label:"\u897F\u57CE"},{value:"\u671D\u9633",label:"\u671D\u9633"},{value:"\u4E30\u53F0",label:"\u4E30\u53F0"},{value:"\u77F3\u666F\u5C71",label:"\u77F3\u666F\u5C71"},{value:"\u6D77\u6DC0",label:"\u6D77\u6DC0"},{value:"\u95E8\u5934\u6C9F",label:"\u95E8\u5934\u6C9F"},{value:"\u623F\u5C71",label:"\u623F\u5C71"},{value:"\u901A\u5DDE",label:"\u901A\u5DDE"},{value:"\u987A\u4E49",label:"\u987A\u4E49"},{value:"\u660C\u5E73",label:"\u660C\u5E73"},{value:"\u5927\u5174",label:"\u5927\u5174"},{value:"\u5E73\u8C37",label:"\u5E73\u8C37"},{value:"\u6000\u67D4",label:"\u6000\u67D4"},{value:"\u5BC6\u4E91",label:"\u5BC6\u4E91"},{value:"\u5EF6\u5E86",label:"\u5EF6\u5E86"}]},{value:"\u4E0A\u6D77",label:"\u4E0A\u6D77",children:[{value:"\u5D07\u660E",label:"\u5D07\u660E"},{value:"\u9EC4\u6D66",label:"\u9EC4\u6D66"},{value:"\u5362\u6E7E",label:"\u5362\u6E7E"},{value:"\u5F90\u6C47",label:"\u5F90\u6C47"},{value:"\u957F\u5B81",label:"\u957F\u5B81"},{value:"\u9759\u5B89",label:"\u9759\u5B89"},{value:"\u666E\u9640",label:"\u666E\u9640"},{value:"\u95F8\u5317",label:"\u95F8\u5317"},{value:"\u8679\u53E3",label:"\u8679\u53E3"},{value:"\u6768\u6D66",label:"\u6768\u6D66"},{value:"\u95F5\u884C",label:"\u95F5\u884C"},{value:"\u5B9D\u5C71",label:"\u5B9D\u5C71"},{value:"\u5609\u5B9A",label:"\u5609\u5B9A"},{value:"\u6D66\u4E1C",label:"\u6D66\u4E1C"},{value:"\u91D1\u5C71",label:"\u91D1\u5C71"},{value:"\u677E\u6C5F",label:"\u677E\u6C5F"},{value:"\u9752\u6D66",label:"\u9752\u6D66"},{value:"\u5357\u6C47",label:"\u5357\u6C47"},{value:"\u5949\u8D24",label:"\u5949\u8D24"}]},{value:"\u5E7F\u4E1C",label:"\u5E7F\u4E1C",children:[{value:"\u5E7F\u5DDE",label:"\u5E7F\u5DDE"},{value:"\u6DF1\u5733",label:"\u6DF1\u5733"},{value:"\u73E0\u6D77",label:"\u73E0\u6D77"},{value:"\u4E1C\u839E",label:"\u4E1C\u839E"},{value:"\u4E2D\u5C71",label:"\u4E2D\u5C71"},{value:"\u4F5B\u5C71",label:"\u4F5B\u5C71"},{value:"\u60E0\u5DDE",label:"\u60E0\u5DDE"},{value:"\u6CB3\u6E90",label:"\u6CB3\u6E90"},{value:"\u6F6E\u5DDE",label:"\u6F6E\u5DDE"},{value:"\u6C5F\u95E8",label:"\u6C5F\u95E8"},{value:"\u63ED\u9633",label:"\u63ED\u9633"},{value:"\u8302\u540D",label:"\u8302\u540D"},{value:"\u6885\u5DDE",label:"\u6885\u5DDE"},{value:"\u6E05\u8FDC",label:"\u6E05\u8FDC"},{value:"\u6C55\u5934",label:"\u6C55\u5934"},{value:"\u6C55\u5C3E",label:"\u6C55\u5C3E"},{value:"\u97F6\u5173",label:"\u97F6\u5173"},{value:"\u987A\u5FB7",label:"\u987A\u5FB7"},{value:"\u9633\u6C5F",label:"\u9633\u6C5F"},{value:"\u4E91\u6D6E",label:"\u4E91\u6D6E"},{value:"\u6E5B\u6C5F",label:"\u6E5B\u6C5F"},{value:"\u8087\u5E86",label:"\u8087\u5E86"}]},{value:"\u6C5F\u82CF",label:"\u6C5F\u82CF",children:[{value:"\u5357\u4EAC",label:"\u5357\u4EAC"},{value:"\u5E38\u719F",label:"\u5E38\u719F"},{value:"\u5E38\u5DDE",label:"\u5E38\u5DDE"},{value:"\u6D77\u95E8",label:"\u6D77\u95E8"},{value:"\u6DEE\u5B89",label:"\u6DEE\u5B89"},{value:"\u6C5F\u90FD",label:"\u6C5F\u90FD"},{value:"\u6C5F\u9634",label:"\u6C5F\u9634"},{value:"\u6606\u5C71",label:"\u6606\u5C71"},{value:"\u8FDE\u4E91\u6E2F",label:"\u8FDE\u4E91\u6E2F"},{value:"\u5357\u901A",label:"\u5357\u901A"},{value:"\u542F\u4E1C",label:"\u542F\u4E1C"},{value:"\u6CAD\u9633",label:"\u6CAD\u9633"},{value:"\u5BBF\u8FC1",label:"\u5BBF\u8FC1"},{value:"\u82CF\u5DDE",label:"\u82CF\u5DDE"},{value:"\u592A\u4ED3",label:"\u592A\u4ED3"},{value:"\u6CF0\u5DDE",label:"\u6CF0\u5DDE"},{value:"\u540C\u91CC",label:"\u540C\u91CC"},{value:"\u65E0\u9521",label:"\u65E0\u9521"},{value:"\u5F90\u5DDE",label:"\u5F90\u5DDE"},{value:"\u76D0\u57CE",label:"\u76D0\u57CE"},{value:"\u626C\u5DDE",label:"\u626C\u5DDE"},{value:"\u5B9C\u5174",label:"\u5B9C\u5174"},{value:"\u4EEA\u5F81",label:"\u4EEA\u5F81"},{value:"\u5F20\u5BB6\u6E2F",label:"\u5F20\u5BB6\u6E2F"},{value:"\u9547\u6C5F",label:"\u9547\u6C5F"}]},{value:"\u91CD\u5E86",label:"\u91CD\u5E86",children:[{value:"\u4E07\u5DDE",label:"\u4E07\u5DDE"},{value:"\u6DAA\u9675",label:"\u6DAA\u9675"},{value:"\u6E1D\u4E2D",label:"\u6E1D\u4E2D"},{value:"\u5927\u6E21\u53E3",label:"\u5927\u6E21\u53E3"},{value:"\u6C5F\u5317",label:"\u6C5F\u5317"},{value:"\u6C99\u576A\u575D",label:"\u6C99\u576A\u575D"},{value:"\u4E5D\u9F99\u5761",label:"\u4E5D\u9F99\u5761"},{value:"\u5357\u5CB8",label:"\u5357\u5CB8"},{value:"\u5317\u789A",label:"\u5317\u789A"},{value:"\u4E07\u76DB",label:"\u4E07\u76DB"},{value:"\u53CC\u6322",label:"\u53CC\u6322"},{value:"\u6E1D\u5317",label:"\u6E1D\u5317"},{value:"\u5DF4\u5357",label:"\u5DF4\u5357"},{value:"\u9ED4\u6C5F",label:"\u9ED4\u6C5F"},{value:"\u957F\u5BFF",label:"\u957F\u5BFF"},{value:"\u7DA6\u6C5F",label:"\u7DA6\u6C5F"},{value:"\u6F7C\u5357",label:"\u6F7C\u5357"},{value:"\u94DC\u6881",label:"\u94DC\u6881"},{value:"\u5927\u8DB3",label:"\u5927\u8DB3"},{value:"\u8363\u660C",label:"\u8363\u660C"},{value:"\u58C1\u5C71",label:"\u58C1\u5C71"},{value:"\u6881\u5E73",label:"\u6881\u5E73"},{value:"\u57CE\u53E3",label:"\u57CE\u53E3"},{value:"\u4E30\u90FD",label:"\u4E30\u90FD"},{value:"\u57AB\u6C5F",label:"\u57AB\u6C5F"},{value:"\u6B66\u9686",label:"\u6B66\u9686"},{value:"\u5FE0\u53BF",label:"\u5FE0\u53BF"},{value:"\u5F00\u53BF",label:"\u5F00\u53BF"},{value:"\u4E91\u9633",label:"\u4E91\u9633"},{value:"\u5949\u8282",label:"\u5949\u8282"},{value:"\u5DEB\u5C71",label:"\u5DEB\u5C71"},{value:"\u5DEB\u6EAA",label:"\u5DEB\u6EAA"},{value:"\u77F3\u67F1",label:"\u77F3\u67F1"},{value:"\u79C0\u5C71",label:"\u79C0\u5C71"},{value:"\u9149\u9633",label:"\u9149\u9633"},{value:"\u5F6D\u6C34",label:"\u5F6D\u6C34"},{value:"\u6C5F\u6D25",label:"\u6C5F\u6D25"},{value:"\u5408\u5DDD",label:"\u5408\u5DDD"},{value:"\u6C38\u5DDD",label:"\u6C38\u5DDD"},{value:"\u5357\u5DDD",label:"\u5357\u5DDD"}]},{value:"\u5B89\u5FBD",label:"\u5B89\u5FBD",children:[{value:"\u5408\u80A5",label:"\u5408\u80A5"},{value:"\u5B89\u5E86",label:"\u5B89\u5E86"},{value:"\u868C\u57E0",label:"\u868C\u57E0"},{value:"\u4EB3\u5DDE",label:"\u4EB3\u5DDE"},{value:"\u5DE2\u6E56",label:"\u5DE2\u6E56"},{value:"\u6EC1\u5DDE",label:"\u6EC1\u5DDE"},{value:"\u961C\u9633",label:"\u961C\u9633"},{value:"\u8D35\u6C60",label:"\u8D35\u6C60"},{value:"\u6DEE\u5317",label:"\u6DEE\u5317"},{value:"\u6DEE\u5316",label:"\u6DEE\u5316"},{value:"\u6DEE\u5357",label:"\u6DEE\u5357"},{value:"\u9EC4\u5C71",label:"\u9EC4\u5C71"},{value:"\u4E5D\u534E\u5C71",label:"\u4E5D\u534E\u5C71"},{value:"\u516D\u5B89",label:"\u516D\u5B89"},{value:"\u9A6C\u978D\u5C71",label:"\u9A6C\u978D\u5C71"},{value:"\u5BBF\u5DDE",label:"\u5BBF\u5DDE"},{value:"\u94DC\u9675",label:"\u94DC\u9675"},{value:"\u5C6F\u6EAA",label:"\u5C6F\u6EAA"},{value:"\u829C\u6E56",label:"\u829C\u6E56"},{value:"\u5BA3\u57CE",label:"\u5BA3\u57CE"}]},{value:"\u798F\u5EFA",label:"\u798F\u5EFA",children:[{value:"\u798F\u5DDE",label:"\u798F\u5DDE"},{value:"\u53A6\u95E8",label:"\u53A6\u95E8"},{value:"\u6CC9\u5DDE",label:"\u6CC9\u5DDE"},{value:"\u6F33\u5DDE",label:"\u6F33\u5DDE"},{value:"\u9F99\u5CA9",label:"\u9F99\u5CA9"},{value:"\u5357\u5E73",label:"\u5357\u5E73"},{value:"\u5B81\u5FB7",label:"\u5B81\u5FB7"},{value:"\u8386\u7530",label:"\u8386\u7530"},{value:"\u4E09\u660E",label:"\u4E09\u660E"}]},{value:"\u7518\u8083",label:"\u7518\u8083",children:[{value:"\u5170\u5DDE",label:"\u5170\u5DDE"},{value:"\u5609\u5CEA\u5173",label:"\u5609\u5CEA\u5173"},{value:"\u767D\u94F6",label:"\u767D\u94F6"},{value:"\u5B9A\u897F",label:"\u5B9A\u897F"},{value:"\u6566\u714C",label:"\u6566\u714C"},{value:"\u7518\u5357",label:"\u7518\u5357"},{value:"\u91D1\u660C",label:"\u91D1\u660C"},{value:"\u9152\u6CC9",label:"\u9152\u6CC9"},{value:"\u4E34\u590F",label:"\u4E34\u590F"},{value:"\u5E73\u51C9",label:"\u5E73\u51C9"},{value:"\u5929\u6C34",label:"\u5929\u6C34"},{value:"\u9647\u5357",label:"\u9647\u5357"},{value:"\u6B66\u5A01",label:"\u6B66\u5A01"},{value:"\u897F\u5CF0",label:"\u897F\u5CF0"},{value:"\u5F20\u6396",label:"\u5F20\u6396"}]},{value:"\u5E7F\u897F",label:"\u5E7F\u897F",children:[{value:"\u5357\u5B81",label:"\u5357\u5B81"},{value:"\u6765\u5BBE",label:"\u6765\u5BBE"},{value:"\u767E\u8272",label:"\u767E\u8272"},{value:"\u5317\u6D77",label:"\u5317\u6D77"},{value:"\u6842\u6797",label:"\u6842\u6797"},{value:"\u9632\u57CE\u6E2F",label:"\u9632\u57CE\u6E2F"},{value:"\u8D35\u6E2F",label:"\u8D35\u6E2F"},{value:"\u6CB3\u6C60",label:"\u6CB3\u6C60"},{value:"\u8D3A\u5DDE",label:"\u8D3A\u5DDE"},{value:"\u67F3\u5DDE",label:"\u67F3\u5DDE"},{value:"\u94A6\u5DDE",label:"\u94A6\u5DDE"},{value:"\u68A7\u5DDE",label:"\u68A7\u5DDE"},{value:"\u7389\u6797",label:"\u7389\u6797"}]},{value:"\u8D35\u5DDE",label:"\u8D35\u5DDE",children:[{value:"\u8D35\u9633",label:"\u8D35\u9633"},{value:"\u5B89\u987A",label:"\u5B89\u987A"},{value:"\u6BD5\u8282",label:"\u6BD5\u8282"},{value:"\u90FD\u5300",label:"\u90FD\u5300"},{value:"\u51EF\u91CC",label:"\u51EF\u91CC"},{value:"\u516D\u76D8\u6C34",label:"\u516D\u76D8\u6C34"},{value:"\u94DC\u4EC1",label:"\u94DC\u4EC1"},{value:"\u5174\u4E49",label:"\u5174\u4E49"},{value:"\u7389\u5C4F",label:"\u7389\u5C4F"},{value:"\u9075\u4E49",label:"\u9075\u4E49"}]},{value:"\u6D77\u5357",label:"\u6D77\u5357",children:[{value:"\u6D77\u53E3",label:"\u6D77\u53E3"},{value:"\u510B\u53BF",label:"\u510B\u53BF"},{value:"\u9675\u6C34",label:"\u9675\u6C34"},{value:"\u743C\u6D77",label:"\u743C\u6D77"},{value:"\u4E09\u4E9A",label:"\u4E09\u4E9A"},{value:"\u901A\u4EC0",label:"\u901A\u4EC0"},{value:"\u4E07\u5B81",label:"\u4E07\u5B81"}]},{value:"\u6CB3\u5317",label:"\u6CB3\u5317",children:[{value:"\u77F3\u5BB6\u5E84",label:"\u77F3\u5BB6\u5E84"},{value:"\u4FDD\u5B9A",label:"\u4FDD\u5B9A"},{value:"\u5317\u6234\u6CB3",label:"\u5317\u6234\u6CB3"},{value:"\u6CA7\u5DDE",label:"\u6CA7\u5DDE"},{value:"\u627F\u5FB7",label:"\u627F\u5FB7"},{value:"\u4E30\u6DA6",label:"\u4E30\u6DA6"},{value:"\u90AF\u90F8",label:"\u90AF\u90F8"},{value:"\u8861\u6C34",label:"\u8861\u6C34"},{value:"\u5ECA\u574A",label:"\u5ECA\u574A"},{value:"\u5357\u6234\u6CB3",label:"\u5357\u6234\u6CB3"},{value:"\u79E6\u7687\u5C9B",label:"\u79E6\u7687\u5C9B"},{value:"\u5510\u5C71",label:"\u5510\u5C71"},{value:"\u65B0\u57CE",label:"\u65B0\u57CE"},{value:"\u90A2\u53F0",label:"\u90A2\u53F0"},{value:"\u5F20\u5BB6\u53E3",label:"\u5F20\u5BB6\u53E3"}]},{value:"\u9ED1\u9F99\u6C5F",label:"\u9ED1\u9F99\u6C5F",children:[{value:"\u54C8\u5C14\u6EE8",label:"\u54C8\u5C14\u6EE8"},{value:"\u5317\u5B89",label:"\u5317\u5B89"},{value:"\u5927\u5E86",label:"\u5927\u5E86"},{value:"\u5927\u5174\u5B89\u5CAD",label:"\u5927\u5174\u5B89\u5CAD"},{value:"\u9E64\u5C97",label:"\u9E64\u5C97"},{value:"\u9ED1\u6CB3",label:"\u9ED1\u6CB3"},{value:"\u4F73\u6728\u65AF",label:"\u4F73\u6728\u65AF"},{value:"\u9E21\u897F",label:"\u9E21\u897F"},{value:"\u7261\u4E39\u6C5F",label:"\u7261\u4E39\u6C5F"},{value:"\u9F50\u9F50\u54C8\u5C14",label:"\u9F50\u9F50\u54C8\u5C14"},{value:"\u4E03\u53F0\u6CB3",label:"\u4E03\u53F0\u6CB3"},{value:"\u53CC\u9E2D\u5C71",label:"\u53CC\u9E2D\u5C71"},{value:"\u7EE5\u5316",label:"\u7EE5\u5316"},{value:"\u4F0A\u6625",label:"\u4F0A\u6625"}]},{value:"\u6CB3\u5357",label:"\u6CB3\u5357",children:[{value:"\u90D1\u5DDE",label:"\u90D1\u5DDE"},{value:"\u5B89\u9633",label:"\u5B89\u9633"},{value:"\u9E64\u58C1",label:"\u9E64\u58C1"},{value:"\u6F62\u5DDD",label:"\u6F62\u5DDD"},{value:"\u7126\u4F5C",label:"\u7126\u4F5C"},{value:"\u6D4E\u6E90",label:"\u6D4E\u6E90"},{value:"\u5F00\u5C01",label:"\u5F00\u5C01"},{value:"\u6F2F\u6CB3",label:"\u6F2F\u6CB3"},{value:"\u6D1B\u9633",label:"\u6D1B\u9633"},{value:"\u5357\u9633",label:"\u5357\u9633"},{value:"\u5E73\u9876\u5C71",label:"\u5E73\u9876\u5C71"},{value:"\u6FEE\u9633",label:"\u6FEE\u9633"},{value:"\u4E09\u95E8\u5CE1",label:"\u4E09\u95E8\u5CE1"},{value:"\u5546\u4E18",label:"\u5546\u4E18"},{value:"\u65B0\u4E61",label:"\u65B0\u4E61"},{value:"\u4FE1\u9633",label:"\u4FE1\u9633"},{value:"\u8BB8\u660C",label:"\u8BB8\u660C"},{value:"\u5468\u53E3",label:"\u5468\u53E3"},{value:"\u9A7B\u9A6C\u5E97",label:"\u9A7B\u9A6C\u5E97"}]},{value:"\u9999\u6E2F",label:"\u9999\u6E2F",children:[{value:"\u9999\u6E2F",label:"\u9999\u6E2F"},{value:"\u4E5D\u9F99",label:"\u4E5D\u9F99"},{value:"\u65B0\u754C",label:"\u65B0\u754C"}]},{value:"\u6E56\u5317",label:"\u6E56\u5317",children:[{value:"\u6B66\u6C49",label:"\u6B66\u6C49"},{value:"\u5929\u95E8",label:"\u5929\u95E8"},{value:"\u6069\u65BD",label:"\u6069\u65BD"},{value:"\u9102\u5DDE",label:"\u9102\u5DDE"},{value:"\u9EC4\u5188",label:"\u9EC4\u5188"},{value:"\u9EC4\u77F3",label:"\u9EC4\u77F3"},{value:"\u8346\u95E8",label:"\u8346\u95E8"},{value:"\u8346\u5DDE",label:"\u8346\u5DDE"},{value:"\u6F5C\u6C5F",label:"\u6F5C\u6C5F"},{value:"\u5341\u5830",label:"\u5341\u5830"},{value:"\u968F\u5DDE",label:"\u968F\u5DDE"},{value:"\u6B66\u7A74",label:"\u6B66\u7A74"},{value:"\u4ED9\u6843",label:"\u4ED9\u6843"},{value:"\u54B8\u5B81",label:"\u54B8\u5B81"},{value:"\u8944\u9633",label:"\u8944\u9633"},{value:"\u8944\u6A0A",label:"\u8944\u6A0A"},{value:"\u5B5D\u611F",label:"\u5B5D\u611F"},{value:"\u5B9C\u660C",label:"\u5B9C\u660C"}]},{value:"\u6E56\u5357",label:"\u6E56\u5357",children:[{value:"\u957F\u6C99",label:"\u957F\u6C99"},{value:"\u5E38\u5FB7",label:"\u5E38\u5FB7"},{value:"\u90F4\u5DDE",label:"\u90F4\u5DDE"},{value:"\u8861\u9633",label:"\u8861\u9633"},{value:"\u6000\u5316",label:"\u6000\u5316"},{value:"\u5409\u9996",label:"\u5409\u9996"},{value:"\u5A04\u5E95",label:"\u5A04\u5E95"},{value:"\u90B5\u9633",label:"\u90B5\u9633"},{value:"\u6E58\u6F6D",label:"\u6E58\u6F6D"},{value:"\u76CA\u9633",label:"\u76CA\u9633"},{value:"\u5CB3\u9633",label:"\u5CB3\u9633"},{value:"\u6C38\u5DDE",label:"\u6C38\u5DDE"},{value:"\u5F20\u5BB6\u754C",label:"\u5F20\u5BB6\u754C"},{value:"\u682A\u6D32",label:"\u682A\u6D32"}]},{value:"\u6C5F\u897F",label:"\u6C5F\u897F",children:[{value:"\u5357\u660C",label:"\u5357\u660C"},{value:"\u629A\u5DDE",label:"\u629A\u5DDE"},{value:"\u8D63\u5DDE",label:"\u8D63\u5DDE"},{value:"\u5409\u5B89",label:"\u5409\u5B89"},{value:"\u666F\u5FB7\u9547",label:"\u666F\u5FB7\u9547"},{value:"\u4E95\u5188\u5C71",label:"\u4E95\u5188\u5C71"},{value:"\u4E5D\u6C5F",label:"\u4E5D\u6C5F"},{value:"\u5E90\u5C71",label:"\u5E90\u5C71"},{value:"\u840D\u4E61",label:"\u840D\u4E61"},{value:"\u4E0A\u9976",label:"\u4E0A\u9976"},{value:"\u65B0\u4F59",label:"\u65B0\u4F59"},{value:"\u5B9C\u6625",label:"\u5B9C\u6625"},{value:"\u9E70\u6F6D",label:"\u9E70\u6F6D"}]},{value:"\u5409\u6797",label:"\u5409\u6797",children:[{value:"\u957F\u6625",label:"\u957F\u6625"},{value:"\u5409\u6797",label:"\u5409\u6797"},{value:"\u767D\u57CE",label:"\u767D\u57CE"},{value:"\u767D\u5C71",label:"\u767D\u5C71"},{value:"\u73F2\u6625",label:"\u73F2\u6625"},{value:"\u8FBD\u6E90",label:"\u8FBD\u6E90"},{value:"\u6885\u6CB3",label:"\u6885\u6CB3"},{value:"\u56DB\u5E73",label:"\u56DB\u5E73"},{value:"\u677E\u539F",label:"\u677E\u539F"},{value:"\u901A\u5316",label:"\u901A\u5316"},{value:"\u5EF6\u5409",label:"\u5EF6\u5409"}]},{value:"\u8FBD\u5B81",label:"\u8FBD\u5B81",children:[{value:"\u6C88\u9633",label:"\u6C88\u9633"},{value:"\u978D\u5C71",label:"\u978D\u5C71"},{value:"\u672C\u6EAA",label:"\u672C\u6EAA"},{value:"\u671D\u9633",label:"\u671D\u9633"},{value:"\u5927\u8FDE",label:"\u5927\u8FDE"},{value:"\u4E39\u4E1C",label:"\u4E39\u4E1C"},{value:"\u629A\u987A",label:"\u629A\u987A"},{value:"\u961C\u65B0",label:"\u961C\u65B0"},{value:"\u846B\u82A6\u5C9B",label:"\u846B\u82A6\u5C9B"},{value:"\u9526\u5DDE",label:"\u9526\u5DDE"},{value:"\u8FBD\u9633",label:"\u8FBD\u9633"},{value:"\u76D8\u9526",label:"\u76D8\u9526"},{value:"\u94C1\u5CAD",label:"\u94C1\u5CAD"},{value:"\u8425\u53E3",label:"\u8425\u53E3"}]},{value:"\u6FB3\u95E8",label:"\u6FB3\u95E8",children:[{value:"\u6FB3\u95E8",label:"\u6FB3\u95E8"}]},{value:"\u5185\u8499\u53E4",label:"\u5185\u8499\u53E4",children:[{value:"\u547C\u548C\u6D69\u7279",label:"\u547C\u548C\u6D69\u7279"},{value:"\u963F\u62C9\u5584\u76DF",label:"\u963F\u62C9\u5584\u76DF"},{value:"\u5305\u5934",label:"\u5305\u5934"},{value:"\u8D64\u5CF0",label:"\u8D64\u5CF0"},{value:"\u4E1C\u80DC",label:"\u4E1C\u80DC"},{value:"\u6D77\u62C9\u5C14",label:"\u6D77\u62C9\u5C14"},{value:"\u96C6\u5B81",label:"\u96C6\u5B81"},{value:"\u4E34\u6CB3",label:"\u4E34\u6CB3"},{value:"\u901A\u8FBD",label:"\u901A\u8FBD"},{value:"\u4E4C\u6D77",label:"\u4E4C\u6D77"},{value:"\u4E4C\u5170\u6D69\u7279",label:"\u4E4C\u5170\u6D69\u7279"},{value:"\u9521\u6797\u6D69\u7279",label:"\u9521\u6797\u6D69\u7279"}]},{value:"\u5B81\u590F",label:"\u5B81\u590F",children:[{value:"\u94F6\u5DDD",label:"\u94F6\u5DDD"},{value:"\u56FA\u6E90",label:"\u56FA\u6E90"},{value:"\u77F3\u5634\u5C71",label:"\u77F3\u5634\u5C71"},{value:"\u5434\u5FE0",label:"\u5434\u5FE0"}]},{value:"\u9752\u6D77",label:"\u9752\u6D77",children:[{value:"\u897F\u5B81",label:"\u897F\u5B81"},{value:"\u5FB7\u4EE4\u54C8",label:"\u5FB7\u4EE4\u54C8"},{value:"\u683C\u5C14\u6728",label:"\u683C\u5C14\u6728"},{value:"\u5171\u548C",label:"\u5171\u548C"},{value:"\u6D77\u4E1C",label:"\u6D77\u4E1C"},{value:"\u6D77\u664F",label:"\u6D77\u664F"},{value:"\u739B\u6C81",label:"\u739B\u6C81"},{value:"\u540C\u4EC1",label:"\u540C\u4EC1"},{value:"\u7389\u6811",label:"\u7389\u6811"}]},{value:"\u5C71\u4E1C",label:"\u5C71\u4E1C",children:[{value:"\u6D4E\u5357",label:"\u6D4E\u5357"},{value:"\u6EE8\u5DDE",label:"\u6EE8\u5DDE"},{value:"\u5156\u5DDE",label:"\u5156\u5DDE"},{value:"\u5FB7\u5DDE",label:"\u5FB7\u5DDE"},{value:"\u4E1C\u8425",label:"\u4E1C\u8425"},{value:"\u83CF\u6CFD",label:"\u83CF\u6CFD"},{value:"\u6D4E\u5B81",label:"\u6D4E\u5B81"},{value:"\u83B1\u829C",label:"\u83B1\u829C"},{value:"\u804A\u57CE",label:"\u804A\u57CE"},{value:"\u4E34\u6C82",label:"\u4E34\u6C82"},{value:"\u84EC\u83B1",label:"\u84EC\u83B1"},{value:"\u9752\u5C9B",label:"\u9752\u5C9B"},{value:"\u66F2\u961C",label:"\u66F2\u961C"},{value:"\u65E5\u7167",label:"\u65E5\u7167"},{value:"\u6CF0\u5B89",label:"\u6CF0\u5B89"},{value:"\u6F4D\u574A",label:"\u6F4D\u574A"},{value:"\u5A01\u6D77",label:"\u5A01\u6D77"},{value:"\u70DF\u53F0",label:"\u70DF\u53F0"},{value:"\u67A3\u5E84",label:"\u67A3\u5E84"},{value:"\u6DC4\u535A",label:"\u6DC4\u535A"}]},{value:"\u5C71\u897F",label:"\u5C71\u897F",children:[{value:"\u592A\u539F",label:"\u592A\u539F"},{value:"\u5415\u6881",label:"\u5415\u6881"},{value:"\u957F\u6CBB",label:"\u957F\u6CBB"},{value:"\u5927\u540C",label:"\u5927\u540C"},{value:"\u5019\u9A6C",label:"\u5019\u9A6C"},{value:"\u664B\u57CE",label:"\u664B\u57CE"},{value:"\u79BB\u77F3",label:"\u79BB\u77F3"},{value:"\u4E34\u6C7E",label:"\u4E34\u6C7E"},{value:"\u5B81\u6B66",label:"\u5B81\u6B66"},{value:"\u6714\u5DDE",label:"\u6714\u5DDE"},{value:"\u5FFB\u5DDE",label:"\u5FFB\u5DDE"},{value:"\u9633\u6CC9",label:"\u9633\u6CC9"},{value:"\u6986\u6B21",label:"\u6986\u6B21"},{value:"\u664B\u4E2D",label:"\u664B\u4E2D"},{value:"\u8FD0\u57CE",label:"\u8FD0\u57CE"}]},{value:"\u9655\u897F",label:"\u9655\u897F",children:[{value:"\u897F\u5B89",label:"\u897F\u5B89"},{value:"\u5B89\u5EB7",label:"\u5B89\u5EB7"},{value:"\u5B9D\u9E21",label:"\u5B9D\u9E21"},{value:"\u6C49\u4E2D",label:"\u6C49\u4E2D"},{value:"\u6E2D\u5357",label:"\u6E2D\u5357"},{value:"\u5546\u5DDE",label:"\u5546\u5DDE"},{value:"\u7EE5\u5FB7",label:"\u7EE5\u5FB7"},{value:"\u94DC\u5DDD",label:"\u94DC\u5DDD"},{value:"\u54B8\u9633",label:"\u54B8\u9633"},{value:"\u5EF6\u5B89",label:"\u5EF6\u5B89"},{value:"\u6986\u6797",label:"\u6986\u6797"}]},{value:"\u56DB\u5DDD",label:"\u56DB\u5DDD",children:[{value:"\u6210\u90FD",label:"\u6210\u90FD"},{value:"\u5DF4\u4E2D",label:"\u5DF4\u4E2D"},{value:"\u8FBE\u5DDD",label:"\u8FBE\u5DDD"},{value:"\u5FB7\u9633",label:"\u5FB7\u9633"},{value:"\u90FD\u6C5F\u5830",label:"\u90FD\u6C5F\u5830"},{value:"\u5CE8\u7709\u5C71",label:"\u5CE8\u7709\u5C71"},{value:"\u6DAA\u9675",label:"\u6DAA\u9675"},{value:"\u5E7F\u5B89",label:"\u5E7F\u5B89"},{value:"\u5E7F\u5143",label:"\u5E7F\u5143"},{value:"\u4E5D\u5BE8\u6C9F",label:"\u4E5D\u5BE8\u6C9F"},{value:"\u5EB7\u5B9A",label:"\u5EB7\u5B9A"},{value:"\u4E50\u5C71",label:"\u4E50\u5C71"},{value:"\u6CF8\u5DDE",label:"\u6CF8\u5DDE"},{value:"\u9A6C\u5C14\u5EB7",label:"\u9A6C\u5C14\u5EB7"},{value:"\u7EF5\u9633",label:"\u7EF5\u9633"},{value:"\u7709\u5C71",label:"\u7709\u5C71"},{value:"\u5357\u5145",label:"\u5357\u5145"},{value:"\u5185\u6C5F",label:"\u5185\u6C5F"},{value:"\u6500\u679D\u82B1",label:"\u6500\u679D\u82B1"},{value:"\u9042\u5B81",label:"\u9042\u5B81"},{value:"\u6C76\u5DDD",label:"\u6C76\u5DDD"},{value:"\u897F\u660C",label:"\u897F\u660C"},{value:"\u96C5\u5B89",label:"\u96C5\u5B89"},{value:"\u5B9C\u5BBE",label:"\u5B9C\u5BBE"},{value:"\u81EA\u8D21",label:"\u81EA\u8D21"},{value:"\u8D44\u9633",label:"\u8D44\u9633"}]},{value:"\u53F0\u6E7E",label:"\u53F0\u6E7E",children:[{value:"\u53F0\u5317",label:"\u53F0\u5317"},{value:"\u57FA\u9686",label:"\u57FA\u9686"},{value:"\u53F0\u5357",label:"\u53F0\u5357"},{value:"\u53F0\u4E2D",label:"\u53F0\u4E2D"},{value:"\u9AD8\u96C4",label:"\u9AD8\u96C4"},{value:"\u5C4F\u4E1C",label:"\u5C4F\u4E1C"},{value:"\u5357\u6295",label:"\u5357\u6295"},{value:"\u4E91\u6797",label:"\u4E91\u6797"},{value:"\u65B0\u7AF9",label:"\u65B0\u7AF9"},{value:"\u5F70\u5316",label:"\u5F70\u5316"},{value:"\u82D7\u6817",label:"\u82D7\u6817"},{value:"\u5609\u4E49",label:"\u5609\u4E49"},{value:"\u6843\u56ED",label:"\u6843\u56ED"},{value:"\u5B9C\u5170",label:"\u5B9C\u5170"},{value:"\u53F0\u4E1C",label:"\u53F0\u4E1C"},{value:"\u91D1\u95E8",label:"\u91D1\u95E8"},{value:"\u9A6C\u7956",label:"\u9A6C\u7956"},{value:"\u6F8E\u6E56",label:"\u6F8E\u6E56"}]},{value:"\u5929\u6D25",label:"\u5929\u6D25",children:[{value:"\u5929\u6D25",label:"\u5929\u6D25"},{value:"\u548C\u5E73",label:"\u548C\u5E73"},{value:"\u4E1C\u4E3D",label:"\u4E1C\u4E3D"},{value:"\u6CB3\u4E1C",label:"\u6CB3\u4E1C"},{value:"\u897F\u9752",label:"\u897F\u9752"},{value:"\u6CB3\u897F",label:"\u6CB3\u897F"},{value:"\u6D25\u5357",label:"\u6D25\u5357"},{value:"\u5357\u5F00",label:"\u5357\u5F00"},{value:"\u5317\u8FB0",label:"\u5317\u8FB0"},{value:"\u6CB3\u5317",label:"\u6CB3\u5317"},{value:"\u6B66\u6E05",label:"\u6B66\u6E05"},{value:"\u7EA2\u6322",label:"\u7EA2\u6322"},{value:"\u5858\u6CBD",label:"\u5858\u6CBD"},{value:"\u6C49\u6CBD",label:"\u6C49\u6CBD"},{value:"\u5927\u6E2F",label:"\u5927\u6E2F"},{value:"\u5B81\u6CB3",label:"\u5B81\u6CB3"},{value:"\u9759\u6D77",label:"\u9759\u6D77"},{value:"\u5B9D\u577B",label:"\u5B9D\u577B"},{value:"\u84DF\u53BF",label:"\u84DF\u53BF"}]},{value:"\u65B0\u7586",label:"\u65B0\u7586",children:[{value:"\u4E4C\u9C81\u6728\u9F50",label:"\u4E4C\u9C81\u6728\u9F50"},{value:"\u963F\u514B\u82CF",label:"\u963F\u514B\u82CF"},{value:"\u963F\u52D2\u6CF0",label:"\u963F\u52D2\u6CF0"},{value:"\u963F\u56FE\u4EC0",label:"\u963F\u56FE\u4EC0"},{value:"\u535A\u4E50",label:"\u535A\u4E50"},{value:"\u660C\u5409",label:"\u660C\u5409"},{value:"\u4E1C\u5C71",label:"\u4E1C\u5C71"},{value:"\u54C8\u5BC6",label:"\u54C8\u5BC6"},{value:"\u548C\u7530",label:"\u548C\u7530"},{value:"\u5580\u4EC0",label:"\u5580\u4EC0"},{value:"\u514B\u62C9\u739B\u4F9D",label:"\u514B\u62C9\u739B\u4F9D"},{value:"\u5E93\u8F66",label:"\u5E93\u8F66"},{value:"\u5E93\u5C14\u52D2",label:"\u5E93\u5C14\u52D2"},{value:"\u594E\u5C6F",label:"\u594E\u5C6F"},{value:"\u77F3\u6CB3\u5B50",label:"\u77F3\u6CB3\u5B50"},{value:"\u5854\u57CE",label:"\u5854\u57CE"},{value:"\u5410\u9C81\u756A",label:"\u5410\u9C81\u756A"},{value:"\u4F0A\u5B81",label:"\u4F0A\u5B81"}]},{value:"\u897F\u85CF",label:"\u897F\u85CF",children:[{value:"\u62C9\u8428",label:"\u62C9\u8428"},{value:"\u963F\u91CC",label:"\u963F\u91CC"},{value:"\u660C\u90FD",label:"\u660C\u90FD"},{value:"\u6797\u829D",label:"\u6797\u829D"},{value:"\u90A3\u66F2",label:"\u90A3\u66F2"},{value:"\u65E5\u5580\u5219",label:"\u65E5\u5580\u5219"},{value:"\u5C71\u5357",label:"\u5C71\u5357"}]},{value:"\u4E91\u5357",label:"\u4E91\u5357",children:[{value:"\u6606\u660E",label:"\u6606\u660E"},{value:"\u5927\u7406",label:"\u5927\u7406"},{value:"\u4FDD\u5C71",label:"\u4FDD\u5C71"},{value:"\u695A\u96C4",label:"\u695A\u96C4"},{value:"\u5927\u7406",label:"\u5927\u7406"},{value:"\u4E1C\u5DDD",label:"\u4E1C\u5DDD"},{value:"\u4E2A\u65E7",label:"\u4E2A\u65E7"},{value:"\u666F\u6D2A",label:"\u666F\u6D2A"},{value:"\u5F00\u8FDC",label:"\u5F00\u8FDC"},{value:"\u4E34\u6CA7",label:"\u4E34\u6CA7"},{value:"\u4E3D\u6C5F",label:"\u4E3D\u6C5F"},{value:"\u516D\u5E93",label:"\u516D\u5E93"},{value:"\u6F5E\u897F",label:"\u6F5E\u897F"},{value:"\u66F2\u9756",label:"\u66F2\u9756"},{value:"\u601D\u8305",label:"\u601D\u8305"},{value:"\u6587\u5C71",label:"\u6587\u5C71"},{value:"\u897F\u53CC\u7248\u7EB3",label:"\u897F\u53CC\u7248\u7EB3"},{value:"\u7389\u6EAA",label:"\u7389\u6EAA"},{value:"\u4E2D\u7538",label:"\u4E2D\u7538"},{value:"\u662D\u901A",label:"\u662D\u901A"}]},{value:"\u6D59\u6C5F",label:"\u6D59\u6C5F",children:[{value:"\u676D\u5DDE",label:"\u676D\u5DDE"},{value:"\u6E29\u5DDE",label:"\u6E29\u5DDE"},{value:"\u5B89\u5409",label:"\u5B89\u5409"},{value:"\u6148\u6EAA",label:"\u6148\u6EAA"},{value:"\u5B9A\u6D77",label:"\u5B9A\u6D77"},{value:"\u5949\u5316",label:"\u5949\u5316"},{value:"\u6D77\u76D0",label:"\u6D77\u76D0"},{value:"\u9EC4\u5CA9",label:"\u9EC4\u5CA9"},{value:"\u6E56\u5DDE",label:"\u6E56\u5DDE"},{value:"\u5609\u5174",label:"\u5609\u5174"},{value:"\u91D1\u534E",label:"\u91D1\u534E"},{value:"\u4E34\u5B89",label:"\u4E34\u5B89"},{value:"\u4E34\u6D77",label:"\u4E34\u6D77"},{value:"\u4E3D\u6C34",label:"\u4E3D\u6C34"},{value:"\u5B81\u6CE2",label:"\u5B81\u6CE2"},{value:"\u74EF\u6D77",label:"\u74EF\u6D77"},{value:"\u5E73\u6E56",label:"\u5E73\u6E56"},{value:"\u5343\u5C9B\u6E56",label:"\u5343\u5C9B\u6E56"},{value:"\u8862\u5DDE",label:"\u8862\u5DDE"},{value:"\u6C5F\u5C71",label:"\u6C5F\u5C71"},{value:"\u745E\u5B89",label:"\u745E\u5B89"},{value:"\u7ECD\u5174",label:"\u7ECD\u5174"},{value:"\u5D4A\u5DDE",label:"\u5D4A\u5DDE"},{value:"\u53F0\u5DDE",label:"\u53F0\u5DDE"},{value:"\u6E29\u5CAD",label:"\u6E29\u5CAD"},{value:"\u4F59\u59DA",label:"\u4F59\u59DA"},{value:"\u821F\u5C71",label:"\u821F\u5C71"}]},{value:"\u6D77\u5916",label:"\u6D77\u5916",children:[{value:"\u7F8E\u56FD",label:"\u7F8E\u56FD"},{value:"\u65E5\u672C",label:"\u65E5\u672C"},{value:"\u82F1\u56FD",label:"\u82F1\u56FD"},{value:"\u6CD5\u56FD",label:"\u6CD5\u56FD"},{value:"\u5FB7\u56FD",label:"\u5FB7\u56FD"},{value:"\u5176\u4ED6",label:"\u5176\u4ED6"}]}]},ic2d:function(st,be,Q){"use strict";Q.d(be,"a",function(){return X});var ie=Q("FWmy"),$=Q("746U");class M{constructor(){this.data=new Map}add(F,U){ie.a($.l(F)),ie.a($.k(U)),ie.a(!this.data.has(F),"There is already an extension with this id"),this.data.set(F,U)}as(F){return this.data.get(F)||null}}const X=new M},kSUc:function(st,be,Q){},lZu9:function(st,be,Q){(function(ie){ie(Q("VrN/"),Q("1eCo"),Q("8EBN"))})(function(ie){"use strict";ie.defineMode("markdown",function($,M){var X=ie.getMode($,"text/html"),F=X.name=="null";function U(P){if(ie.findModeByName){var b=ie.findModeByName(P);b&&(P=b.mime||b.mimes[0])}var Y=ie.getMode($,P);return Y.name=="null"?null:Y}M.highlightFormatting===void 0&&(M.highlightFormatting=!1),M.maxBlockquoteDepth===void 0&&(M.maxBlockquoteDepth=0),M.taskLists===void 0&&(M.taskLists=!1),M.strikethrough===void 0&&(M.strikethrough=!1),M.emoji===void 0&&(M.emoji=!1),M.fencedCodeBlockHighlighting===void 0&&(M.fencedCodeBlockHighlighting=!0),M.fencedCodeBlockDefaultMode===void 0&&(M.fencedCodeBlockDefaultMode="text/plain"),M.xml===void 0&&(M.xml=!0),M.tokenTypeOverrides===void 0&&(M.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)&&M.tokenTypeOverrides[W]&&(G[W]=M.tokenTypeOverrides[W]);var i=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,m=M.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,l=/^[^#!\[\]*_\\<>` "'(~:]+/,u=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,o=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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 s(P,b,Y){return b.f=b.inline=Y,Y(P,b)}function a(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=F;if(!b){var Y=ie.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=S,P.htmlState=null)}return P.trailingSpace=0,P.trailingSpaceNewLine=!1,P.prevLine=P.thisLine,P.thisLine={stream:null},null}function S(P,b){var Y=P.column()===b.indentation,ee=A(b.prevLine.stream),le=b.indentedCode,ue=b.prevLine.hr,ke=b.list!==!1,we=(b.listStack[b.listStack.length-1]||0)+3;b.indentedCode=!1;var Ae=b.indentation;if(b.indentationDiff===null&&(b.indentationDiff=b.indentation,ke)){for(b.list=null;Ae<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=Ae-b.listStack[b.listStack.length-1])}var ce=!ee&&!ue&&!b.prevLine.header&&(!ke||!le)&&!b.prevLine.fencedCodeEnd,pe=(b.list===!1||ue||ee)&&b.indentation<=we&&P.match(i),se=null;if(b.indentationDiff>=4&&(le||b.prevLine.fencedCodeEnd||b.prevLine.header||ee))return P.skipToEnd(),b.indentedCode=!0,G.code;if(P.eatSpace())return null;if(Y&&b.indentation<=we&&(se=P.match(m))&&se[1].length<=6)return b.quote=0,b.header=se[1].length,b.thisLine.header=!0,M.highlightFormatting&&(b.formatting="header"),b.f=b.inline,C(b);if(b.indentation<=we&&P.eat(">"))return b.quote=Y?1:b.quote+1,M.highlightFormatting&&(b.formatting="quote"),P.eatSpace(),C(b);if(!pe&&!b.setext&&Y&&b.indentation<=we&&(se=P.match(D))){var ae=se[1]?"ol":"ul";return b.indentation=Ae+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,M.taskLists&&P.match(g,!1)&&(b.taskList=!0),b.f=b.inline,M.highlightFormatting&&(b.formatting=["list","list-"+ae]),C(b)}else{if(Y&&b.indentation<=we&&(se=P.match(u,!0)))return b.quote=0,b.fencedEndRE=new RegExp(se[1]+"+ *$"),b.localMode=M.fencedCodeBlockHighlighting&&U(se[2]||M.fencedCodeBlockDefaultMode),b.localMode&&(b.localState=ie.startState(b.localMode)),b.f=b.block=R,M.highlightFormatting&&(b.formatting="code-block"),b.code=-1,C(b);if(b.setext||(!ce||!ke)&&!b.quote&&b.list===!1&&!b.code&&!pe&&!f.test(P.string)&&(se=P.lookAhead(1))&&(se=se.match(p)))return b.setext?(b.header=b.setext,b.setext=0,P.skipToEnd(),M.highlightFormatting&&(b.formatting="header")):(b.header=se[0].charAt(0)=="="?1:2,b.setext=b.header),b.thisLine.header=!0,b.f=b.inline,C(b);if(pe)return P.skipToEnd(),b.hr=!0,b.thisLine.hr=!0,G.hr;if(P.peek()==="[")return s(P,b,N)}return s(P,b,b.inline)}function L(P,b){var Y=X.token(P,b.htmlState);if(!F){var ee=ie.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=S,b.htmlState=null)}return Y}function R(P,b){var Y=b.listStack[b.listStack.length-1]||0,ee=b.indentation<Y,le=Y+3;if(b.fencedEndRE&&b.indentation<=le&&(ee||P.match(b.fencedEndRE))){M.highlightFormatting&&(b.formatting="code-block");var ue;return ee||(ue=C(b)),b.localMode=b.localState=null,b.block=S,b.f=x,b.fencedEndRE=null,b.code=0,b.thisLine.fencedCodeEnd=!0,ee?a(P,b,b.block):ue}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"&&(!M.maxBlockquoteDepth||M.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),!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=P.quote?b.push(G.quote+"-"+P.quote):b.push(G.quote+"-"+M.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 w(P,b){return P.match(l,!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,M.highlightFormatting&&(b.formatting="task"),b.taskList=!1,C(b)}if(b.taskOpen=!1,b.taskClosed=!1,b.header&&P.match(/^#+$/,!0))return M.highlightFormatting&&(b.formatting="header"),C(b);var le=P.next();if(b.linkTitle){b.linkTitle=!1;var ue=le;le==="("&&(ue=")"),ue=(ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ke="^\\s*(?:[^"+ue+"\\\\]+|\\\\\\\\|\\\\.)"+ue;if(P.match(new RegExp(ke),!0))return G.linkHref}if(le==="`"){var we=b.formatting;M.highlightFormatting&&(b.formatting="code"),P.eatWhile("`");var Ae=P.current().length;if(b.code==0&&(!b.quote||Ae==1))return b.code=Ae,C(b);if(Ae==b.code){var ce=C(b);return b.code=0,ce}else return b.formatting=we,C(b)}else if(b.code)return C(b);if(le==="\\"&&(P.next(),M.highlightFormatting)){var pe=C(b),se=G.formatting+"-escape";return pe?pe+" "+se:se}if(le==="!"&&P.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.imageMarker=!0,b.image=!0,M.highlightFormatting&&(b.formatting="image"),C(b);if(le==="["&&b.imageMarker&&P.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return b.imageMarker=!1,b.imageAltText=!0,M.highlightFormatting&&(b.formatting="image"),C(b);if(le==="]"&&b.imageAltText){M.highlightFormatting&&(b.formatting="image");var pe=C(b);return b.imageAltText=!1,b.image=!1,b.inline=b.f=T,pe}if(le==="["&&!b.image)return b.linkText&&P.match(/^.*?\]/)||(b.linkText=!0,M.highlightFormatting&&(b.formatting="link")),C(b);if(le==="]"&&b.linkText){M.highlightFormatting&&(b.formatting="link");var pe=C(b);return b.linkText=!1,b.inline=b.f=P.match(/\(.*?\)| ?\[.*?\]/,!1)?T:x,pe}if(le==="<"&&P.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=c,M.highlightFormatting&&(b.formatting="link");var pe=C(b);return pe?pe+=" ":pe="",pe+G.linkInline}if(le==="<"&&P.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=c,M.highlightFormatting&&(b.formatting="link");var pe=C(b);return pe?pe+=" ":pe="",pe+G.linkEmail}if(M.xml&&le==="<"&&P.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ae=P.string.indexOf(">",P.pos);if(ae!=-1){var Oe=P.string.substring(P.start,ae);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Oe)&&(b.md_inside=!0)}return P.backUp(1),b.htmlState=ie.startState(X),a(P,b,L)}if(M.xml&&le==="<"&&P.match(/^\/\w*?>/))return b.md_inside=!1,"tag";if(le==="*"||le==="_"){for(var xe=1,Pe=P.pos==1?" ":P.string.charAt(P.pos-2);xe<3&&P.eat(le);)xe++;var De=P.peek()||" ",Ge=!/\s/.test(De)&&(!o.test(De)||/\s/.test(Pe)||o.test(Pe)),Le=!/\s/.test(Pe)&&(!o.test(Pe)||/\s/.test(De)||o.test(De)),Fe=null,We=null;if(xe%2&&(!b.em&&Ge&&(le==="*"||!Le||o.test(Pe))?Fe=!0:b.em==le&&Le&&(le==="*"||!Ge||o.test(De))&&(Fe=!1)),xe>1&&(!b.strong&&Ge&&(le==="*"||!Le||o.test(Pe))?We=!0:b.strong==le&&Le&&(le==="*"||!Ge||o.test(De))&&(We=!1)),We!=null||Fe!=null){M.highlightFormatting&&(b.formatting=Fe==null?"strong":We==null?"em":"strong em"),Fe===!0&&(b.em=le),We===!0&&(b.strong=le);var ce=C(b);return Fe===!1&&(b.em=!1),We===!1&&(b.strong=!1),ce}}else if(le===" "&&(P.eat("*")||P.eat("_"))){if(P.peek()===" ")return C(b);P.backUp(1)}if(M.strikethrough){if(le==="~"&&P.eatWhile(le)){if(b.strikethrough){M.highlightFormatting&&(b.formatting="strikethrough");var ce=C(b);return b.strikethrough=!1,ce}else if(P.match(/^[^\s]/,!1))return b.strikethrough=!0,M.highlightFormatting&&(b.formatting="strikethrough"),C(b)}else if(le===" "&&P.match(/^~~/,!0)){if(P.peek()===" ")return C(b);P.backUp(2)}}if(M.emoji&&le===":"&&P.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){b.emoji=!0,M.highlightFormatting&&(b.formatting="emoji");var oe=C(b);return b.emoji=!1,oe}return le===" "&&(P.match(/^ +$/,!1)?b.trailingSpace++:b.trailingSpace&&(b.trailingSpaceNewLine=!0)),C(b)}function c(P,b){var Y=P.next();if(Y===">"){b.f=b.inline=x,M.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=v(Y==="("?")":"]"),M.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,C(b)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function v(P){return function(b,Y){var ee=b.next();if(ee===P){Y.f=Y.inline=x,M.highlightFormatting&&(Y.formatting="link-string");var le=C(Y);return Y.linkHref=!1,le}return b.match(y[P]),Y.linkHref=!0,C(Y)}}function N(P,b){return P.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=B,P.next(),M.highlightFormatting&&(b.formatting="link"),b.linkText=!0,C(b)):s(P,b,x)}function B(P,b){if(P.match(/^\]:/,!0)){b.f=b.inline=O,M.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:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:x,text:w,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&&ie.copyState(X,P.htmlState),indentation:P.indentation,localMode:P.localMode,localState:P.localMode?ie.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):ie.Pass},blankLine:_,getType:C,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return j},"xml"),ie.defineMIME("text/markdown","markdown"),ie.defineMIME("text/x-markdown","markdown")})},m7e3:function(st,be,Q){st.exports={flex_box_center:"flex_box_center___cDhGq",flex_space_between:"flex_space_between___3OXHk",flex_box_vertical_center:"flex_box_vertical_center___3g3vC",flex_box_center_end:"flex_box_center_end___2QmKm",flex_box_column:"flex_box_column___2Id0h",bg:"bg___1JEmc",title:"title___3bVR_",titleLeft:"titleLeft___2rmGK",titleRight:"titleRight___1YZFf",btns:"btns___2IVL7"}},nEHx:function(st,be,Q){"use strict";Q.d(be,"a",function(){return ie});var ie;(function($){$.DARK="dark",$.LIGHT="light",$.HIGH_CONTRAST="hc"})(ie||(ie={}))},nnTU:function(st,be,Q){"use strict";Q.d(be,"b",function(){return G}),Q.d(be,"a",function(){return W});var ie=Q("MI8n"),$=Q("JYp7"),M=Q("pmY6"),X=Q("24hK"),F=Q("746U"),U=Q("Cg/j");const G=Object(U.c)("commandService"),W=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ie.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 u=[];for(let o of i.description.args)u.push(o.constraint);const f=i.handler;i.handler=function(o,...h){return Object(F.o)(h,u),f(o,...h)}}const{id:g}=i;let m=this._commands.get(g);m||(m=new X.a,this._commands.set(g,m));let p=m.unshift(i),l=Object(M.i)(()=>{p();const u=this._commands.get(g);(u==null?void 0:u.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),l}registerCommandAlias(i,D){return W.registerCommand(i,(g,...m)=>g.get(G).executeCommand(D,...m))}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(st,be,Q){(function(ie){ie(Q("VrN/"))})(function(ie){"use strict";var $=ie.Pos;function M(o,h){return o.line-h.line||o.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",F=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",U=new RegExp("<(/?)(["+X+"]["+F+"]*)","g");function G(o,h,s,a){this.line=h,this.ch=s,this.cm=o,this.text=o.getLine(h),this.min=a?Math.max(a.from,o.firstLine()):o.firstLine(),this.max=a?Math.min(a.to-1,o.lastLine()):o.lastLine()}function W(o,h){var s=o.cm.getTokenTypeAt($(o.line,h));return s&&/\btag\b/.test(s)}function i(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function D(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function g(o){for(;;){var h=o.text.indexOf(">",o.ch);if(h==-1){if(i(o))continue;return}if(!W(o,h+1)){o.ch=h+1;continue}var s=o.text.lastIndexOf("/",h),a=s>-1&&!/\S/.test(o.text.slice(s+1,h));return o.ch=h+1,a?"selfClose":"regular"}}function m(o){for(;;){var h=o.ch?o.text.lastIndexOf("<",o.ch-1):-1;if(h==-1){if(D(o))continue;return}if(!W(o,h+1)){o.ch=h;continue}U.lastIndex=h,o.ch=h;var s=U.exec(o.text);if(s&&s.index==h)return s}}function p(o){for(;;){U.lastIndex=o.ch;var h=U.exec(o.text);if(!h){if(i(o))continue;return}if(!W(o,h.index+1)){o.ch=h.index+1;continue}return o.ch=h.index+h[0].length,h}}function l(o){for(;;){var h=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(h==-1){if(D(o))continue;return}if(!W(o,h+1)){o.ch=h;continue}var s=o.text.lastIndexOf("/",h),a=s>-1&&!/\S/.test(o.text.slice(s+1,h));return o.ch=h+1,a?"selfClose":"regular"}}function u(o,h){for(var s=[];;){var a=p(o),A,_=o.line,S=o.ch-(a?a[0].length:0);if(!a||!(A=g(o)))return;if(A=="selfClose")continue;if(a[1]){for(var L=s.length-1;L>=0;--L)if(s[L]==a[2]){s.length=L;break}if(L<0&&(!h||h==a[2]))return{tag:a[2],from:$(_,S),to:$(o.line,o.ch)}}else s.push(a[2])}}function f(o,h){for(var s=[];;){var a=l(o);if(!a)return;if(a=="selfClose"){m(o);continue}var A=o.line,_=o.ch,S=m(o);if(!S)return;if(S[1])s.push(S[2]);else{for(var L=s.length-1;L>=0;--L)if(s[L]==S[2]){s.length=L;break}if(L<0&&(!h||h==S[2]))return{tag:S[2],from:$(o.line,o.ch),to:$(A,_)}}}}ie.registerHelper("fold","xml",function(o,h){for(var s=new G(o,h.line,0);;){var a=p(s);if(!a||s.line!=h.line)return;var A=g(s);if(!A)return;if(!a[1]&&A!="selfClose"){var _=$(s.line,s.ch),S=u(s,a[2]);return S&&M(S.from,_)>0?{from:_,to:S.from}:null}}}),ie.findMatchingTag=function(o,h,s){var a=new G(o,h.line,h.ch,s);if(a.text.indexOf(">")==-1&&a.text.indexOf("<")==-1)return;var A=g(a),_=A&&$(a.line,a.ch),S=A&&m(a);if(!A||!S||M(a,h)>0)return;var L={from:$(a.line,a.ch),to:_,tag:S[2]};return A=="selfClose"?{open:L,close:null,at:"open"}:S[1]?{open:f(a,S[2]),close:L,at:"close"}:(a=new G(o,_.line,_.ch,s),{open:L,close:u(a,S[2]),at:"open"})},ie.findEnclosingTag=function(o,h,s,a){for(var A=new G(o,h.line,h.ch,s);;){var _=f(A,a);if(!_)break;var S=new G(o,h.line,h.ch,s),L=u(S,_.tag);if(L)return{open:_,close:L}}},ie.scanForClosingTag=function(o,h,s,a){var A=new G(o,h.line,h.ch,a?{from:0,to:a}:null);return u(A,s)}})},p5ED:function(st,be,Q){"use strict";var ie=Q("+L6B"),$=Q("2/Rp"),M=Q("5Dmo"),X=Q("3S7+"),F=Q("k1fw"),U=Q("9og8"),G=Q("tJVT"),W=Q("WmNS"),i=Q.n(W),D=Q("q1tI"),g=Q.n(D),m=Q("vHTk"),p=Q.n(m),l=Q("yEEn"),u=Q("ZW9T"),f=Q("1vsH"),o=Q("V0Rq"),h=Q("m3rI");be.a=function(s){var a,A,_,S,L,R,C,w=s.editOffice,x=w===void 0?"view":w,c=s.data,T=s.theme,y=s.type,v=s.filename,N=s.monacoEditor,B=s.className,O=s.style,j=s.close,P=s.onClose,b=s.hasMask,Y=s.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"),le=Object(G.a)(ee,2),ue=le[0],ke=le[1],we=Object(D.useState)(""),Ae=Object(G.a)(we,2),ce=Ae[0],pe=Ae[1],se=Object(D.useState)(),ae=Object(G.a)(se,2),Oe=ae[0],xe=ae[1],Pe=window.ENV==="build"?"/react/build":"",De=h.a.PROXY_SERVER||location.origin,Ge,Le=1024*1024,Fe=10*Le,We=Object(D.useRef)();(a=c)!==null&&a!==void 0&&a.startsWith("/api")&&y!=="txt"&&(c=h.a.API_SERVER+c),y==="office"&&(Ge=Object(f.T)(c).filesize,Ge>Fe&&(y="other")),v&&N&&(N.filename=v),Object(D.useEffect)(function(){var Ce,je,Ve=(Ce=document.cookie)===null||Ce===void 0||((je=Ce.replace(/\s/g,""))===null||je===void 0)?void 0:je.split(";");Ve==null||Ve.map(function(Qe){var Je=Qe.split("=");Je[0]==="_educoder_session"&&pe(Je[1])})},[]),Object(D.useEffect)(function(){y==="office"&&oe()},[y,c]);var oe=function(){var Ce=Object(U.a)(i.a.mark(function je(){var Ve,Qe,Je;return i.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return console.log("data:",c),Ve=c,c.startsWith("http")||(Ve=location.origin+Ve),Qe=new URL(Ve).pathname.split("/").pop(),Xe.next=6,Object(o.V)({attachment_id:Qe});case 6:Je=Xe.sent,xe(Je);case 8:case"end":return Xe.stop()}},je)}));return function(){return Ce.apply(this,arguments)}}(),ge=function(){if(c.startsWith("http")||c.startsWith("blob:")){Se();return}Object(f.z)(v||"educoder",c,v)},Se=function(){Object(f.x)(v||"educoder",decodeURIComponent(c))};return g.a.createElement("div",{style:Object(F.a)({},O||{}),className:"".concat(b&&p.a.bgBlack," ").concat(y?p.a.wrp:"hide")},j&&g.a.createElement("div",{className:p.a.close,ref:We},!Y&&g.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return We.current}},g.a.createElement("span",{onClick:Se},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return We.current}},g.a.createElement("span",{className:"",onClick:P},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(p.a[B]," ").concat(B," ").concat(p.a.monaco," ").concat(y==="txt"?"show":"hide")},y==="txt"&&g.a.createElement(u.b,N)),y==="audio"&&g.a.createElement("audio",{src:"".concat(((A=c)===null||A===void 0?void 0:A.indexOf("http://"))>-1||((_=c)===null||_===void 0?void 0:_.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(c),autoPlay:!0}),y==="video"&&g.a.createElement(g.a.Fragment,null,((S=c)===null||S===void 0?void 0:S.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(c),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(c),autoPlay:!0})),y==="office"&&Oe&&g.a.createElement("iframe",{src:"".concat(Pe,"/office.html?key=").concat(Oe.key,"&url=").concat(De+Oe.url,"&callbackUrl=").concat(De+Oe.callbackUrl,"&fileType=").concat(Oe.fileType,"&title=").concat(Oe.title,"&model=").concat(x,"&officeServer=").concat(h.a.OFFICE_SERVER,"&disabledDownload=").concat(!!Y)}),y==="html"&&g.a.createElement("iframe",{src:c+"&disposition=inline"}),y==="pdf"&&g.a.createElement("iframe",{src:"".concat(Pe,"/js/pdfview/index.html?url=").concat(c,"&disabledDownload=").concat(!!Y)}),y==="image"&&g.a.createElement("img",{src:"".concat(((L=c)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((R=c)===null||R===void 0?void 0:R.indexOf("https://"))>-1||(C=c)!==null&&C!==void 0&&C.startsWith("/api")?"":"data:image/png;base64,").concat(c)}),y==="other"&&g.a.createElement("div",null,g.a.createElement($.a,{type:"primary",size:"large",onClick:ge},g.a.createElement(l.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),y==="download"&&g.a.createElement($.a,{type:"primary",size:"large",onClick:ge},g.a.createElement(l.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(st,be,Q){},pmY6:function(st,be,Q){"use strict";Q.d(be,"h",function(){return D}),Q.d(be,"g",function(){return m}),Q.d(be,"f",function(){return p}),Q.d(be,"e",function(){return l}),Q.d(be,"i",function(){return u}),Q.d(be,"b",function(){return f}),Q.d(be,"a",function(){return o}),Q.d(be,"d",function(){return h}),Q.d(be,"c",function(){return s});var ie=Q("C/vA"),$=Q("JYp7");const M=!1;let X=null;function F(a){X=a}if(M){const a="__is_disposable_tracked__";F(new class{trackDisposable(A){const _=new Error("Potentially leaked disposable").stack;setTimeout(()=>{A[a]||console.log(_)},3e3)}setParent(A,_){if(A&&A!==o.None)try{A[a]=!0}catch(S){}}markAsDisposed(A){if(A&&A!==o.None)try{A[a]=!0}catch(_){}}markAsSingleton(A){}})}function U(a){return X==null||X.trackDisposable(a),a}function G(a){X==null||X.markAsDisposed(a)}function W(a,A){X==null||X.setParent(a,A)}function i(a,A){if(!X)return;for(const _ of a)X.setParent(_,A)}function D(a){return X==null||X.markAsSingleton(a),a}class g extends Error{constructor(a){super(`Encountered errors while disposing of store. Errors: [${a.join(", ")}]`);this.errors=a}}function m(a){return typeof a.dispose=="function"&&a.dispose.length===0}function p(a){if($.a.is(a)){let A=[];for(const _ of a)if(_)try{_.dispose()}catch(S){A.push(S)}if(A.length===1)throw A[0];if(A.length>1)throw new g(A);return Array.isArray(a)?[]:a}else if(a)return a.dispose(),a}function l(...a){const A=u(()=>p(a));return i(a,A),A}function u(a){const A=U({dispose:Object(ie.a)(()=>{G(A),a()})});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{p(this._toDispose.values())}finally{this._toDispose.clear()}}add(a){if(!a)return a;if(a===this)throw new Error("Cannot register a disposable on itself!");return W(a,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(a),a}}f.DISABLE_DISPOSED_WARNING=!1;class o{constructor(){this._store=new f,U(this),W(this._store,this)}dispose(){G(this),this._store.dispose()}_register(a){if(a===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(a)}}o.None=Object.freeze({dispose(){}});class h{constructor(){this._isDisposed=!1,U(this)}get value(){return this._isDisposed?void 0:this._value}set value(a){var A;if(this._isDisposed||a===this._value)return;(A=this._value)===null||A===void 0||A.dispose(),a&&W(a,this),this._value=a}clear(){this.value=void 0}dispose(){var a;this._isDisposed=!0,G(this),(a=this._value)===null||a===void 0||a.dispose(),this._value=void 0}clearAndLeak(){const a=this._value;return this._value=void 0,a&&W(a,null),a}}class s{constructor(a){this.object=a}dispose(){}}},psGv:function(st,be,Q){var ie,$;(function(){var M;(function(){"use strict";var G=[,,function(g){function m(u){this.__parent=u,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=[]}m.prototype.clone_empty=function(){var u=new m(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},m.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},m.prototype.has_match=function(u){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(u))return!0;return!1},m.prototype.set_indent=function(u,f){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.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)},m.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},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(u){this.__items.push(u);var f=u.lastIndexOf(`
|
|
`);f!==-1?this.__character_count=u.length-f:this.__character_count+=u.length},m.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function p(u,f){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),f=f||"",u.indent_level>0&&(f=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}p.prototype.get_indent_size=function(u,f){var o=this.__base_string_length;return f=f||0,u<0&&(o=0),o+=u*this.__indent_size,o+=f,o},p.prototype.get_indent_string=function(u,f){var o=this.__base_string;return f=f||0,u<0&&(u=0,o=""),f+=u*this.__indent_size,this.__ensure_cache(f),o+=this.__cache[f],o},p.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var u=this.__cache.length,f=0,o="";this.__indent_size&&u>=this.__indent_size&&(f=Math.floor(u/this.__indent_size),u-=f*this.__indent_size,o=new Array(f+1).join(this.__indent_string)),u&&(o+=new Array(u+1).join(" ")),this.__cache.push(o)};function l(u,f){this.__indent_cache=new p(u,f),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}l.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},l.prototype.get_line_number=function(){return this.__lines.length},l.prototype.get_indent_string=function(u,f){return this.__indent_cache.get_indent_string(u,f)},l.prototype.get_indent_size=function(u,f){return this.__indent_cache.get_indent_size(u,f)},l.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},l.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},l.prototype.get_code=function(u){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 o=this.__lines.join(`
|
|
`);return u!==`
|
|
`&&(o=o.replace(/[\n]/g,u)),o},l.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},l.prototype.set_indent=function(u,f){return u=u||0,f=f||0,this.next_line.set_indent(u,f),this.__lines.length>1?(this.current_line.set_indent(u,f),!0):(this.current_line.set_indent(),!1)},l.prototype.add_raw_token=function(u){for(var f=0;f<u.newlines;f++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},l.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},l.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(" "))},l.prototype.remove_indent=function(u){for(var f=this.__lines.length;u<f;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},l.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&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},l.prototype.just_added_newline=function(){return this.current_line.is_empty()},l.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},l.prototype.ensure_empty_line_above=function(u,f){for(var o=this.__lines.length-2;o>=0;){var h=this.__lines[o];if(h.is_empty())break;if(h.item(0).indexOf(u)!==0&&h.item(-1)!==f){this.__lines.splice(o+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},g.exports.Output=l},function(g){function m(p,l,u,f){this.type=p,this.text=l,this.comments_before=null,this.newlines=u||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=m},,,function(g){function m(u,f){this.raw_options=p(u,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"])}m.prototype._get_array=function(u,f){var o=this.raw_options[u],h=f||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(h=o.concat()):typeof o=="string"&&(h=o.split(/[^a-zA-Z0-9_\/\-]+/)),h},m.prototype._get_boolean=function(u,f){var o=this.raw_options[u],h=o===void 0?!!f:!!o;return h},m.prototype._get_characters=function(u,f){var o=this.raw_options[u],h=f||"";return typeof o=="string"&&(h=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},m.prototype._get_number=function(u,f){var o=this.raw_options[u];f=parseInt(f,10),isNaN(f)&&(f=0);var h=parseInt(o,10);return isNaN(h)&&(h=f),h},m.prototype._get_selection=function(u,f,o){var h=this._get_selection_list(u,f,o);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[u]+"'");return h[0]},m.prototype._get_selection_list=function(u,f,o){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[f[0]],!this._is_valid_selection(o,f))throw new Error("Invalid Default Value!");var h=this._get_array(u,o);if(!this._is_valid_selection(h,f))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[u]+"'");return h},m.prototype._is_valid_selection=function(u,f){return u.length&&f.length&&!u.some(function(o){return f.indexOf(o)===-1})};function p(u,f){var o={};u=l(u);var h;for(h in u)h!==f&&(o[h]=u[h]);if(f&&u[f])for(h in u[f])o[h]=u[f][h];return o}function l(u){var f={},o;for(o in u){var h=o.replace(/-/g,"_");f[h]=u[o]}return f}g.exports.Options=m,g.exports.normalizeOpts=l,g.exports.mergeOpts=p},,function(g){var m=RegExp.prototype.hasOwnProperty("sticky");function p(l){this.__input=l||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var l=null;return this.hasNext()&&(l=this.__input.charAt(this.__position),this.__position+=1),l},p.prototype.peek=function(l){var u=null;return l=l||0,l+=this.__position,l>=0&&l<this.__input_length&&(u=this.__input.charAt(l)),u},p.prototype.__match=function(l,u){l.lastIndex=u;var f=l.exec(this.__input);return f&&!(m&&l.sticky)&&(f.index!==u&&(f=null)),f},p.prototype.test=function(l,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(l,u):!1},p.prototype.testChar=function(l,u){var f=this.peek(u);return l.lastIndex=0,f!==null&&l.test(f)},p.prototype.match=function(l){var u=this.__match(l,this.__position);return u?this.__position+=u[0].length:u=null,u},p.prototype.read=function(l,u,f){var o="",h;return l&&(h=this.match(l),h&&(o+=h[0])),u&&(h||!l)&&(o+=this.readUntil(u,f)),o},p.prototype.readUntil=function(l,u){var f="",o=this.__position;l.lastIndex=this.__position;var h=l.exec(this.__input);return h?(o=h.index,u&&(o+=h[0].length)):o=this.__input_length,f=this.__input.substring(this.__position,o),this.__position=o,f},p.prototype.readUntilAfter=function(l){return this.readUntil(l,!0)},p.prototype.get_regexp=function(l,u){var f=null,o="g";return u&&m&&(o="y"),typeof l=="string"&&l!==""?f=new RegExp(l,o):l&&(f=new RegExp(l.source,o)),f},p.prototype.get_literal_regexp=function(l){return RegExp(l.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(l){var u=this.__position,f=this.readUntilAfter(l);return this.__position=u,f},p.prototype.lookBack=function(l){var u=this.__position-1;return u>=l.length&&this.__input.substring(u-l.length,u).toLowerCase()===l},g.exports.InputScanner=p},function(g,m,p){var l=p(8).InputScanner,u=p(3).Token,f=p(10).TokenStream,o=p(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(a,A){this._input=new l(a),this._options=A||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new f,this._reset();for(var a,A=new u(h.START,""),_=null,S=[],L=new f;A.type!==h.EOF;){for(a=this._get_next_token(A,_);this._is_comment(a);)L.add(a),a=this._get_next_token(A,_);L.isEmpty()||(a.comments_before=L,L=new f),a.parent=_,this._is_opening(a)?(S.push(_),_=a):_&&this._is_closing(a,_)&&(a.opened=_,_.closed=a,_=S.pop(),a.parent=_),a.previous=A,A.next=a,this.__tokens.add(a),A=a}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(a,A){this._readWhitespace();var _=this._input.read(/.+/g);return _?this._create_token(h.RAW,_):this._create_token(h.EOF,"")},s.prototype._is_comment=function(a){return!1},s.prototype._is_opening=function(a){return!1},s.prototype._is_closing=function(a,A){return!1},s.prototype._create_token=function(a,A){var _=new u(a,A,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return _},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=s,g.exports.TOKEN=h},function(g){function m(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},m.prototype.peek=function(p){var l=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(l=this.__tokens[p]),l},m.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},g.exports.TokenStream=m},function(g,m,p){var l=p(12).Pattern;function u(f,o){l.call(this,f,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}u.prototype=new l,u.prototype.__set_whitespace_patterns=function(f,o){f+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+f+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},u.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 o=this.__split(this._newline_regexp,f);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return f},u.prototype.matching=function(f,o){var h=this._create();return h.__set_whitespace_patterns(f,o),h._update(),h},u.prototype._create=function(){return new u(this._input,this)},u.prototype.__split=function(f,o){f.lastIndex=0;for(var h=0,s=[],a=f.exec(o);a;)s.push(o.substring(h,a.index)),h=a.index+a[0].length,a=f.exec(o);return h<o.length?s.push(o.substring(h,o.length)):s.push(""),s},g.exports.WhitespacePattern=u},function(g){function m(p,l){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,l&&(this._starting_pattern=this._input.get_regexp(l._starting_pattern,!0),this._match_pattern=this._input.get_regexp(l._match_pattern,!0),this._until_pattern=this._input.get_regexp(l._until_pattern),this._until_after=l._until_after)}m.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(p){var l=this._create();return l._until_after=!0,l._until_pattern=this._input.get_regexp(p),l._update(),l},m.prototype.until=function(p){var l=this._create();return l._until_after=!1,l._until_pattern=this._input.get_regexp(p),l._update(),l},m.prototype.starting_with=function(p){var l=this._create();return l._starting_pattern=this._input.get_regexp(p,!0),l._update(),l},m.prototype.matching=function(p){var l=this._create();return l._match_pattern=this._input.get_regexp(p,!0),l._update(),l},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},g.exports.Pattern=m},function(g){function m(p,l){p=typeof p=="string"?p:p.source,l=typeof l=="string"?l:l.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+l,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+l,"g")}m.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var l={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(p);u;)l[u[1]]=u[2],u=this.__directive_pattern.exec(p);return l},m.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=m},function(g,m,p){var l=p(12).Pattern,u={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function f(o,h){l.call(this,o,h),this.__template_pattern=null,this._disabled=Object.assign({},u),this._excluded=Object.assign({},u),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 s=new l(o);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}f.prototype=new l,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(o){var h=this._create();return h._disabled[o]=!0,h._update(),h},f.prototype.read_options=function(o){var h=this._create();for(var s in u)h._disabled[s]=o.templating.indexOf(s)===-1;return h._update(),h},f.prototype.exclude=function(o){var h=this._create();return h._excluded[o]=!0,h._update(),h},f.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=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),o+=h,h=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},f.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},f.prototype._read_template=function(){var o="",h=this._input.peek();if(h==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(o=o||this.__patterns.erb.read())}else h==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},g.exports.TemplatablePattern=f},,,,function(g,m,p){var l=p(19).Beautifier,u=p(20).Options;function f(o,h,s,a){var A=new l(o,h,s,a);return A.beautify()}g.exports=f,g.exports.defaultOptions=function(){return new u}},function(g,m,p){var l=p(20).Options,u=p(2).Output,f=p(21).Tokenizer,o=p(21).TOKEN,h=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,a=function(T,y){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 u(T,y)};a.prototype.current_line_has_match=function(T){return this._output.current_line.has_match(T)},a.prototype.set_space_before_token=function(T,y){this._output.space_before_token=T,this._output.non_breaking_space=y},a.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},a.prototype.add_raw_token=function(T){this._output.add_raw_token(T)},a.prototype.print_preserved_newlines=function(T){var y=0;T.type!==o.TEXT&&T.previous.type!==o.TEXT&&(y=T.newlines?1:0),this.preserve_newlines&&(y=T.newlines<this.max_preserve_newlines+1?T.newlines:this.max_preserve_newlines+1);for(var v=0;v<y;v++)this.print_newline(v>0);return y!==0},a.prototype.traverse_whitespace=function(T){return T.whitespace_before||T.newlines?(this.print_preserved_newlines(T)||(this._output.space_before_token=!0),!0):!1},a.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},a.prototype.print_newline=function(T){this._output.add_new_line(T)},a.prototype.print_token=function(T){T.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(T.text))},a.prototype.indent=function(){this.indent_level++},a.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 y=null,v=T.next;v.type!==o.EOF&&T.closed!==v;){if(v.type===o.ATTRIBUTE&&v.text==="type"){v.next&&v.next.type===o.EQUALS&&v.next.next&&v.next.next.type===o.VALUE&&(y=v.next.next.text);break}v=v.next}return y},_=function(T,y){var v=null,N=null;return y.closed?(T==="script"?v="text/javascript":T==="style"&&(v="text/css"),v=A(y)||v,v.search("text/css")>-1?N="css":v.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":v.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":v.search(/test\/null/)>-1&&(N="null"),N):null};function S(T,y){return y.indexOf(T)!==-1}function L(T,y,v){this.parent=T||null,this.tag=y?y.tag_name:"",this.indent_level=v||0,this.parser_token=y||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 y=new L(this._current_frame,T,this._printer.indent_level);this._current_frame=y},R.prototype._try_pop_frame=function(T){var y=null;return T&&(y=T.parser_token,this._printer.indent_level=T.indent_level,this._current_frame=T.parent),y},R.prototype._get_frame=function(T,y){for(var v=this._current_frame;v&&!(T.indexOf(v.tag)!==-1);){if(y&&y.indexOf(v.tag)!==-1){v=null;break}v=v.parent}return v},R.prototype.try_pop=function(T,y){var v=this._get_frame([T],y);return this._try_pop_frame(v)},R.prototype.indent_to_tag=function(T){var y=this._get_frame(T);y&&(this._printer.indent_level=y.indent_level)};function C(T,y,v,N){this._source_text=T||"",y=y||{},this._js_beautify=v,this._css_beautify=N,this._tag_stack=null;var B=new l(y,"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,y=this._options.eol;this._options.eol==="auto"&&(y=`
|
|
`,T&&h.test(T)&&(y=T.match(h)[0])),T=T.replace(s,`
|
|
`);var v=T.match(/^[\t ]*/)[0],N={text:"",type:""},B=new w,O=new a(this._options,v),j=new f(T,this._options).tokenize();this._tag_stack=new R(O);for(var P=null,b=j.next();b.type!==o.EOF;)b.type===o.TAG_OPEN||b.type===o.COMMENT?(P=this._handle_tag_open(O,b,B,N),B=P):b.type===o.ATTRIBUTE||b.type===o.EQUALS||b.type===o.VALUE||b.type===o.TEXT&&!B.tag_complete?P=this._handle_inside_tag(O,b,B,j):b.type===o.TAG_CLOSE?P=this._handle_tag_close(O,b,B):b.type===o.TEXT?P=this._handle_text(O,b,B):O.add_raw_token(b),N=P,b=j.next();var Y=O._output.get_code(y);return Y},C.prototype._handle_tag_close=function(T,y,v){var N={text:y.text,type:y.type};return T.alignment_size=0,v.tag_complete=!0,T.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),v.is_unformatted?T.add_raw_token(y):(v.tag_start_char==="<"&&(T.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&v.has_wrapped_attrs&&T.print_newline(!1)),T.print_token(y)),v.indent_content&&!(v.is_unformatted||v.is_content_unformatted)&&(T.indent(),v.indent_content=!1),!v.is_inline_element&&!(v.is_unformatted||v.is_content_unformatted)&&T.set_wrap_point(),N},C.prototype._handle_inside_tag=function(T,y,v,N){var B=v.has_wrapped_attrs,O={text:y.text,type:y.type};if(T.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),v.is_unformatted)T.add_raw_token(y);else if(v.tag_start_char==="{"&&y.type===o.TEXT)T.print_preserved_newlines(y)?(y.newlines=0,T.add_raw_token(y)):T.print_token(y);else{if(y.type===o.ATTRIBUTE?(T.set_space_before_token(!0),v.attr_count+=1):(y.type===o.EQUALS||y.type===o.VALUE&&y.previous.type===o.EQUALS)&&T.set_space_before_token(!1),y.type===o.ATTRIBUTE&&v.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(T.traverse_whitespace(y),B=B||y.newlines!==0),this._is_wrap_attributes_force)){var j=v.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&v.attr_count===1){var P=!0,b=0,Y;do{if(Y=N.peek(b),Y.type===o.ATTRIBUTE){P=!1;break}b+=1}while(b<4&&Y.type!==o.EOF&&Y.type!==o.TAG_CLOSE);j=!P}j&&(T.print_newline(!1),B=!0)}T.print_token(y),B=B||T.previous_token_wrapped(),v.has_wrapped_attrs=B}return O},C.prototype._handle_text=function(T,y,v){var N={text:y.text,type:"TK_CONTENT"};return v.custom_beautifier_name?this._print_custom_beatifier_text(T,y,v):v.is_unformatted||v.is_content_unformatted?T.add_raw_token(y):(T.traverse_whitespace(y),T.print_token(y)),N},C.prototype._print_custom_beatifier_text=function(T,y,v){var N=this;if(y.text!==""){var B=y.text,O,j=1,P="",b="";v.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?O=this._js_beautify:v.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?O=this._css_beautify:v.custom_beautifier_name==="html"&&(O=function(we,Ae){var ce=new C(we,Ae,N._js_beautify,N._css_beautify);return ce.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]*$/,""),v.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(y);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&&(y.whitespace_before=ee[0]))}if(B)if(O){var le=function(){this.eol=`
|
|
`};le.prototype=this._options.raw_options;var ue=new le;B=O(Y+B,ue)}else{var ke=y.whitespace_before;ke&&(B=B.replace(new RegExp(`
|
|
(`+ke+")?","g"),`
|
|
`)),B=Y+B.replace(/\n/g,`
|
|
`+Y)}P&&(B?B=P+B+`
|
|
`+b:B=P+b),T.print_newline(!1),B&&(y.text=B,y.whitespace_before="",y.newlines=0,T.add_raw_token(y),T.print_newline(!0))}},C.prototype._handle_tag_open=function(T,y,v,N){var B=this._get_tag_open_token(y);return(v.is_unformatted||v.is_content_unformatted)&&!v.is_empty_element&&y.type===o.TAG_OPEN&&y.text.indexOf("</")===0?(T.add_raw_token(y),B.start_tag_token=this._tag_stack.try_pop(B.tag_name)):(T.traverse_whitespace(y),this._set_tag_position(T,y,B,v,N),B.is_inline_element||T.set_wrap_point(),T.print_token(y)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(B.alignment_size=y.text.length+1),!B.tag_complete&&!B.is_unformatted&&(T.alignment_size=B.alignment_size),B};var w=function(T,y){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="",!y)this.tag_complete=!0;else{var v;this.tag_start_char=y.text[0],this.text=y.text,this.tag_start_char==="<"?(v=y.text.match(/^<([^\s>]*)/),this.tag_check=v?v[1]:""):(v=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=v?v[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.type===o.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||y.closed&&y.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(N=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};C.prototype._get_tag_open_token=function(T){var y=new w(this._tag_stack.get_parser_token(),T);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||S(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&S(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&S(y.tag_check,this._options.content_unformatted),y.is_inline_element=S(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},C.prototype._set_tag_position=function(T,y,v,N,B){if(v.is_empty_element||(v.is_end_tag?v.start_tag_token=this._tag_stack.try_pop(v.tag_name):(this._do_optional_end_element(v)&&(v.is_inline_element||T.print_newline(!1)),this._tag_stack.record_tag(v),(v.tag_name==="script"||v.tag_name==="style")&&!(v.is_unformatted||v.is_content_unformatted)&&(v.custom_beautifier_name=_(v.tag_check,y)))),S(v.tag_check,this._options.extra_liners)&&(T.print_newline(!1),T._output.just_added_blankline()||T.print_newline(!0)),v.is_empty_element){if(v.tag_start_char==="{"&&v.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),v.indent_content=!0;var O=T.current_line_has_match(/{{#if/);O||T.print_newline(!1)}v.tag_name==="!--"&&B.type===o.TAG_CLOSE&&N.is_end_tag&&v.text.indexOf(`
|
|
`)===-1||(v.is_inline_element||v.is_unformatted||T.print_newline(!1),this._calcluate_parent_multiline(T,v))}else if(v.is_end_tag){var j=!1;j=v.start_tag_token&&v.start_tag_token.multiline_content,j=j||!v.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(B.type===o.TAG_CLOSE&&v.start_tag_token===N)&&B.type!=="TK_CONTENT",(v.is_content_unformatted||v.is_unformatted)&&(j=!1),j&&T.print_newline(!1)}else v.indent_content=!v.custom_beautifier_name,v.tag_start_char==="<"&&(v.tag_name==="html"?v.indent_content=this._options.indent_inner_html:v.tag_name==="head"?v.indent_content=this._options.indent_head_inner_html:v.tag_name==="body"&&(v.indent_content=this._options.indent_body_inner_html)),!(v.is_inline_element||v.is_unformatted)&&(B.type!=="TK_CONTENT"||v.is_content_unformatted)&&T.print_newline(!1),this._calcluate_parent_multiline(T,v)},C.prototype._calcluate_parent_multiline=function(T,y){y.parent&&T._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.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"],c=["a","audio","del","ins","map","noscript","video"];C.prototype._do_optional_end_element=function(T){var y=null;if(T.is_empty_element||!T.is_start_tag||!T.parent)return;if(T.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(T.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(T.tag_name==="dd"||T.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(T.parent.tag_name==="p"&&x.indexOf(T.tag_name)!==-1){var v=T.parent.parent;(!v||c.indexOf(v.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else T.tag_name==="rp"||T.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):T.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):T.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):T.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):T.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):T.tag_name==="tbody"||T.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):T.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(T.tag_name==="th"||T.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return T.parent=this._tag_stack.get_parser_token(),y},g.exports.Beautifier=C},function(g,m,p){var l=p(6).Options;function u(f){l.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"])}u.prototype=new l,g.exports.Options=u},function(g,m,p){var l=p(9).Tokenizer,u=p(9).TOKEN,f=p(13).Directives,o=p(14).TemplatablePattern,h=p(12).Pattern,s={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:u.START,RAW:u.RAW,EOF:u.EOF},a=new f(/<\!--/,/-->/),A=function(_,S){l.call(this,_,S),this._current_tag_name="";var L=new o(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 l,A.prototype._is_comment=function(_){return!1},A.prototype._is_opening=function(_){return _.type===s.TAG_OPEN},A.prototype._is_closing=function(_,S){return _.type===s.TAG_CLOSE&&S&&((_.text===">"||_.text==="/>")&&S.text[0]==="<"||_.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},A.prototype._reset=function(){this._current_tag_name=""},A.prototype._get_next_token=function(_,S){var L=null;this._readWhitespace();var R=this._input.peek();return R===null?this._create_token(s.EOF,""):(L=L||this._read_open_handlebars(R,S),L=L||this._read_attribute(R,_,S),L=L||this._read_close(R,S),L=L||this._read_raw_content(R,_,S),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,S),L=L||this._create_token(s.UNKNOWN,this._input.next()),L)},A.prototype._read_comment_or_cdata=function(_){var S=null,L=null,R=null;if(_==="<"){var C=this._input.peek(1);C==="!"&&(L=this.__patterns.comment.read(),L?(R=a.get_directives(L),R&&R.ignore==="start"&&(L+=a.readIgnored(this._input))):L=this.__patterns.cdata.read()),L&&(S=this._create_token(s.COMMENT,L),S.directives=R)}return S},A.prototype._read_processing=function(_){var S=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&&(S=this._create_token(s.COMMENT,L),S.directives=R)}return S},A.prototype._read_open=function(_,S){var L=null,R=null;return S||_==="<"&&(L=this._input.next(),this._input.peek()==="/"&&(L+=this._input.next()),L+=this.__patterns.element_name.read(),R=this._create_token(s.TAG_OPEN,L)),R},A.prototype._read_open_handlebars=function(_,S){var L=null,R=null;return S||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(s.COMMENT,L)):(L=this.__patterns.handlebars_open.read(),R=this._create_token(s.TAG_OPEN,L))),R},A.prototype._read_close=function(_,S){var L=null,R=null;return S&&(S.text[0]==="<"&&(_===">"||_==="/"&&this._input.peek(1)===">")?(L=this._input.next(),_==="/"&&(L+=this._input.next()),R=this._create_token(s.TAG_CLOSE,L)):S.text[0]==="{"&&_==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),R=this._create_token(s.TAG_CLOSE,"}}"))),R},A.prototype._read_attribute=function(_,S,L){var R=null,C="";if(L&&L.text[0]==="<")if(_==="=")R=this._create_token(s.EQUALS,this._input.next());else if(_==='"'||_==="'"){var w=this._input.next();_==='"'?w+=this.__patterns.double_quote.read():w+=this.__patterns.single_quote.read(),R=this._create_token(s.VALUE,w)}else C=this.__patterns.attribute.read(),C&&(S.type===s.EQUALS?R=this._create_token(s.VALUE,C):R=this._create_token(s.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(_,S,L){var R="";if(L&&L.text[0]==="{")R=this.__patterns.handlebars_raw_close.read();else if(S.type===s.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var C=S.opened.text.substr(1).toLowerCase();if(C==="script"||C==="style"){var w=this._read_comment_or_cdata(_);if(w)return w.type=s.TEXT,w;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(s.TEXT,R):null},A.prototype._read_content_word=function(_){var S="";if(this._options.unformatted_content_delimiter&&(_===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(s.TEXT,S)},g.exports.Tokenizer=A,g.exports.TOKEN=s}],W={};function i(g){var m=W[g];if(m!==void 0)return m.exports;var p=W[g]={exports:{}};return G[g](p,p.exports,i),p.exports}var D=i(18);M=D})();var X=M;if(!0)!(ie=[Q,Q("6UM0"),Q("TXwP")],$=function(G){var W=Q("6UM0"),i=Q("TXwP");return{html_beautify:function(D,g){return X(D,g,W.js_beautify,i.css_beautify)}}}.apply(be,ie),$!==void 0&&(st.exports=$));else var F,U})()},"rAM+":function(st,be,Q){"use strict";Q.d(be,"a",function(){return $});var ie=Q("Qw5x");function $(M,X){var F;if(typeof Symbol=="undefined"||M[Symbol.iterator]==null){if(Array.isArray(M)||(F=Object(ie.a)(M))||X&&M&&typeof M.length=="number"){F&&(M=F);var U=0,G=function(){};return{s:G,n:function(){return U>=M.length?{done:!0}:{done:!1,value:M[U++]}},e:function(m){throw m},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(){F=M[Symbol.iterator]()},n:function(){var m=F.next();return W=m.done,m},e:function(m){i=!0,D=m},f:function(){try{!W&&F.return!=null&&F.return()}finally{if(i)throw D}}}}},rUJ1:function(st,be){const Q=/[&<>"']/,ie=/[&<>"']/g,$=/[<>"']|&(?!#?\w+;)/,M=/[<>"']|&(?!#?\w+;)/g,X={"&":"&","<":"<",">":">",'"':""","'":"'"},F=R=>X[R];function U(R,C){if(C){if(Q.test(R))return R.replace(ie,F)}else if($.test(R))return R.replace(M,F);return R}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(R){return R.replace(G,(C,w)=>(w=w.toLowerCase(),w==="colon"?":":w.charAt(0)==="#"?w.charAt(1)==="x"?String.fromCharCode(parseInt(w.substring(2),16)):String.fromCharCode(+w.substring(1)):""))}const i=/(^|[^\[])\^/g;function D(R,C){R=R.source||R,C=C||"";const w={replace:(x,c)=>(c=c.source||c,c=c.replace(i,"$1"),R=R.replace(x,c),w),getRegex:()=>new RegExp(R,C)};return w}const g=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(R,C,w){if(R){let x;try{x=decodeURIComponent(W(w)).replace(g,"").toLowerCase()}catch(c){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}C&&!m.test(w)&&(w=h(C,w));try{w=encodeURI(w).replace(/%25/g,"%")}catch(x){return null}return w}const l={},u=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(R,C){l[" "+R]||(u.test(R)?l[" "+R]=R+"/":l[" "+R]=_(R,"/",!0)),R=l[" "+R];const w=R.indexOf(":")===-1;return C.substring(0,2)==="//"?w?C:R.replace(f,"$1")+C:C.charAt(0)==="/"?w?C:R.replace(o,"$1")+C:R+C}const s={exec:function(){}};function a(R){let C=1,w,x;for(;C<arguments.length;C++){w=arguments[C];for(x in w)Object.prototype.hasOwnProperty.call(w,x)&&(R[x]=w[x])}return R}function A(R,C){const w=R.replace(/\|/g,(T,y,v)=>{let N=!1,B=y;for(;--B>=0&&v[B]==="\\";)N=!N;return N?"|":" |"}),x=w.split(/ \|/);let c=0;if(x.length>C)x.splice(C);else for(;x.length<C;)x.push("");for(;c<x.length;c++)x[c]=x[c].trim().replace(/\\\|/g,"|");return x}function _(R,C,w){const x=R.length;if(x===0)return"";let c=0;for(;c<x;){const T=R.charAt(x-c-1);if(T===C&&!w)c++;else if(T!==C&&w)c++;else break}return R.substr(0,x-c)}function S(R,C){if(R.indexOf(C[1])===-1)return-1;const w=R.length;let x=0,c=0;for(;c<w;c++)if(R[c]==="\\")c++;else if(R[c]===C[0])x++;else if(R[c]===C[1]&&(x--,x<0))return c;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")}st.exports={escape:U,unescape:W,edit:D,cleanUrl:p,resolveUrl:h,noopTest:s,merge:a,splitCells:A,rtrim:_,findClosingBracket:S,checkSanitizeDeprecation:L}},t9D7:function(st,be,Q){"use strict";Q.d(be,"b",function(){return G}),Q.d(be,"g",function(){return i}),Q.d(be,"d",function(){return D}),Q.d(be,"e",function(){return g}),Q.d(be,"a",function(){return m}),Q.d(be,"f",function(){return u}),Q.d(be,"c",function(){return f});var ie=Q("Vhoy"),$=Q("MI8n"),M=Q("pmY6"),X=Q("Cg/j"),F=Q("ic2d"),U=Q("nEHx");const G=Object(X.c)("themeService");var W;(function(o){function h(s){return s&&typeof s=="object"&&typeof s.id=="string"}o.isThemeColor=h})(W||(W={}));function i(o){return{id:o}}var D;(function(o){function h(L){return L&&typeof L=="object"&&typeof L.id=="string"&&(typeof L.color=="undefined"||W.isThemeColor(L.color))}o.isThemeIcon=h;const s=new RegExp(`^\\$\\((${ie.a.iconNameExpression}(?:${ie.a.iconModifierExpression})?)\\)$`);function a(L){const R=s.exec(L);if(!R)return;let[,C]=R;return{id:C}}o.fromString=a;function A(L,R){let C=L.id;const w=C.lastIndexOf("~");return w!==-1&&(C=C.substring(0,w)),R&&(C=`${C}~${R}`),{id:C}}o.modify=A;function _(L,R){var C,w;return L.id===R.id&&((C=L.color)===null||C===void 0?void 0:C.id)===((w=R.color)===null||w===void 0?void 0:w.id)}o.isEqual=_;function S(L,R){return{id:L.id,color:R?i(R):void 0}}o.asThemeIcon=S,o.asClassNameArray=ie.a.asClassNameArray,o.asClassName=ie.a.asClassName,o.asCSSSelector=ie.a.asCSSSelector})(D||(D={}));function g(o){switch(o){case U.a.DARK:return"vs-dark";case U.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const m={ThemingContribution:"base.contributions.theming"};class p{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new $.b}onColorThemeChange(o){return this.themingParticipants.push(o),this.onThemingParticipantAddedEmitter.fire(o),Object(M.i)(()=>{const h=this.themingParticipants.indexOf(o);this.themingParticipants.splice(h,1)})}getThemingParticipants(){return this.themingParticipants}}let l=new p;F.a.add(m.ThemingContribution,l);function u(o){return l.onColorThemeChange(o)}class f extends M.a{constructor(o){super();this.themeService=o,this.theme=o.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(h=>this.onThemeChange(h)))}onThemeChange(o){this.theme=o,this.updateStyles()}updateStyles(){}}},uK0f:function(st,be,Q){(function(ie,$){st.exports=$()})(this,function(){"use strict";function ie($,M,X){X=X||{},X.childrenKeyName=X.childrenKeyName||"children";var F=$||[],U=[],G=0;do{var W=F.filter(function(i){return M(i,G)})[0];if(!W)break;U.push(W),F=W[X.childrenKeyName]||[],G+=1}while(F.length>0);return U}return ie})},ulZh:function(st,be,Q){typeof window!="undefined"&&function($,M){st.exports=M()}(this,function(){return function(ie){var $={};function M(X){if($[X])return $[X].exports;var F=$[X]={i:X,l:!1,exports:{}};return ie[X].call(F.exports,F,F.exports,M),F.l=!0,F.exports}return M.m=ie,M.c=$,M.d=function(X,F,U){M.o(X,F)||Object.defineProperty(X,F,{enumerable:!0,get:U})},M.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},M.t=function(X,F){if(F&1&&(X=M(X)),F&8)return X;if(F&4&&typeof X=="object"&&X&&X.__esModule)return X;var U=Object.create(null);if(M.r(U),Object.defineProperty(U,"default",{enumerable:!0,value:X}),F&2&&typeof X!="string")for(var G in X)M.d(U,G,function(W){return X[W]}.bind(null,G));return U},M.n=function(X){var F=X&&X.__esModule?function(){return X.default}:function(){return X};return M.d(F,"a",F),F},M.o=function(X,F){return Object.prototype.hasOwnProperty.call(X,F)},M.p="/dist/",M(M.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ie,$,M){"use strict";var X=Object.prototype.hasOwnProperty,F="~";function U(){}Object.create&&(U.prototype=Object.create(null),new U().__proto__||(F=!1));function G(g,m,p){this.fn=g,this.context=m,this.once=p||!1}function W(g,m,p,l,u){if(typeof p!="function")throw new TypeError("The listener must be a function");var f=new G(p,l||g,u),o=F?F+m:m;return g._events[o]?g._events[o].fn?g._events[o]=[g._events[o],f]:g._events[o].push(f):(g._events[o]=f,g._eventsCount++),g}function i(g,m){--g._eventsCount===0?g._events=new U:delete g._events[m]}function D(){this._events=new U,this._eventsCount=0}D.prototype.eventNames=function(){var m=[],p,l;if(this._eventsCount===0)return m;for(l in p=this._events)X.call(p,l)&&m.push(F?l.slice(1):l);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(p)):m},D.prototype.listeners=function(m){var p=F?F+m:m,l=this._events[p];if(!l)return[];if(l.fn)return[l.fn];for(var u=0,f=l.length,o=new Array(f);u<f;u++)o[u]=l[u].fn;return o},D.prototype.listenerCount=function(m){var p=F?F+m:m,l=this._events[p];return l?l.fn?1:l.length:0},D.prototype.emit=function(m,p,l,u,f,o){var h=F?F+m:m;if(!this._events[h])return!1;var s=this._events[h],a=arguments.length,A,_;if(s.fn){s.once&&this.removeListener(m,s.fn,void 0,!0);switch(a){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,p),!0;case 3:return s.fn.call(s.context,p,l),!0;case 4:return s.fn.call(s.context,p,l,u),!0;case 5:return s.fn.call(s.context,p,l,u,f),!0;case 6:return s.fn.call(s.context,p,l,u,f,o),!0}for(_=1,A=new Array(a-1);_<a;_++)A[_-1]=arguments[_];s.fn.apply(s.context,A)}else{var S=s.length,L;for(_=0;_<S;_++){s[_].once&&this.removeListener(m,s[_].fn,void 0,!0);switch(a){case 1:s[_].fn.call(s[_].context);break;case 2:s[_].fn.call(s[_].context,p);break;case 3:s[_].fn.call(s[_].context,p,l);break;case 4:s[_].fn.call(s[_].context,p,l,u);break;default:if(!A)for(L=1,A=new Array(a-1);L<a;L++)A[L-1]=arguments[L];s[_].fn.apply(s[_].context,A)}}}return!0},D.prototype.on=function(m,p,l){return W(this,m,p,l,!1)},D.prototype.once=function(m,p,l){return W(this,m,p,l,!0)},D.prototype.removeListener=function(m,p,l,u){var f=F?F+m:m;if(!this._events[f])return this;if(!p)return i(this,f),this;var o=this._events[f];if(o.fn)o.fn===p&&(!u||o.once)&&(!l||o.context===l)&&i(this,f);else{for(var h=0,s=[],a=o.length;h<a;h++)(o[h].fn!==p||u&&!o[h].once||l&&o[h].context!==l)&&s.push(o[h]);s.length?this._events[f]=s.length===1?s[0]:s:i(this,f)}return this},D.prototype.removeAllListeners=function(m){var p;return m?(p=F?F+m:m,this._events[p]&&i(this,p)):(this._events=new U,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=F,D.EventEmitter=D,ie.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(ie,$,M){(function(X){var F=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,U=/^([^\/?#]*)([^]*)$/,G=/(?:\/|^)\.(?=\/)/g,W=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,i={buildAbsoluteURL:function(D,g,m){if(m=m||{},D=D.trim(),g=g.trim(),!g){if(!m.alwaysNormalize)return D;var p=i.parseURL(D);if(!p)throw new Error("Error trying to parse base URL.");return p.path=i.normalizePath(p.path),i.buildURLFromParts(p)}var l=i.parseURL(g);if(!l)throw new Error("Error trying to parse relative URL.");if(l.scheme)return m.alwaysNormalize?(l.path=i.normalizePath(l.path),i.buildURLFromParts(l)):g;var u=i.parseURL(D);if(!u)throw new Error("Error trying to parse base URL.");if(!u.netLoc&&u.path&&u.path[0]!=="/"){var f=U.exec(u.path);u.netLoc=f[1],u.path=f[2]}u.netLoc&&!u.path&&(u.path="/");var o={scheme:u.scheme,netLoc:l.netLoc,path:null,params:l.params,query:l.query,fragment:l.fragment};if(!l.netLoc&&(o.netLoc=u.netLoc,l.path[0]!=="/"))if(!l.path)o.path=u.path,l.params||(o.params=u.params,l.query||(o.query=u.query));else{var h=u.path,s=h.substring(0,h.lastIndexOf("/")+1)+l.path;o.path=i.normalizePath(s)}return o.path===null&&(o.path=m.alwaysNormalize?i.normalizePath(l.path):l.path),i.buildURLFromParts(o)},parseURL:function(D){var g=F.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}};ie.exports=i})(this)},"./node_modules/webworkify-webpack/index.js":function(ie,$,M){function X(m){var p={};function l(f){if(p[f])return p[f].exports;var o=p[f]={i:f,l:!1,exports:{}};return m[f].call(o.exports,o,o.exports,l),o.l=!0,o.exports}l.m=m,l.c=p,l.i=function(f){return f},l.d=function(f,o,h){l.o(f,o)||Object.defineProperty(f,o,{configurable:!1,enumerable:!0,get:h})},l.r=function(f){Object.defineProperty(f,"__esModule",{value:!0})},l.n=function(f){var o=f&&f.__esModule?function(){return f.default}:function(){return f};return l.d(o,"a",o),o},l.o=function(f,o){return Object.prototype.hasOwnProperty.call(f,o)},l.p="/",l.oe=function(f){throw console.error(f),f};var u=l(l.s=ENTRY_MODULE);return u.default||u}var F="[\\.|\\-|\\+|\\w|/|@]+",U="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+F+").*?\\)";function G(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function W(m){return!isNaN(1*m)}function i(m,p,l){var u={};u[l]=[];var f=p.toString(),o=f.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return u;for(var h=o[1],s=new RegExp("(\\\\n|\\W)"+G(h)+U,"g"),a;a=s.exec(f);){if(a[3]==="dll-reference")continue;u[l].push(a[3])}for(s=new RegExp("\\("+G(h)+'\\("(dll-reference\\s('+F+'))"\\)\\)'+U,"g");a=s.exec(f);)m[a[2]]||(u[l].push(a[1]),m[a[2]]=M(a[1]).m),u[a[2]]=u[a[2]]||[],u[a[2]].push(a[4]);for(var A=Object.keys(u),_=0;_<A.length;_++)for(var S=0;S<u[A[_]].length;S++)W(u[A[_]][S])&&(u[A[_]][S]=1*u[A[_]][S]);return u}function D(m){var p=Object.keys(m);return p.reduce(function(l,u){return l||m[u].length>0},!1)}function g(m,p){for(var l={main:[p]},u={main:[]},f={main:{}};D(l);)for(var o=Object.keys(l),h=0;h<o.length;h++){var s=o[h],a=l[s],A=a.pop();if(f[s]=f[s]||{},f[s][A]||!m[s][A])continue;f[s][A]=!0,u[s]=u[s]||[],u[s].push(A);for(var _=i(m,m[s][A],s),S=Object.keys(_),L=0;L<S.length;L++)l[S[L]]=l[S[L]]||[],l[S[L]]=l[S[L]].concat(_[S[L]])}return u}ie.exports=function(m,p){p=p||{};var l={main:M.m},u=p.all?{main:Object.keys(l.main)}:g(l,m),f="";Object.keys(u).filter(function(A){return A!=="main"}).forEach(function(A){for(var _=0;u[A][_];)_++;u[A].push(_),l[A][_]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",f=f+"var "+A+" = ("+X.toString().replace("ENTRY_MODULE",JSON.stringify(_))+")({"+u[A].map(function(S){return""+JSON.stringify(S)+": "+l[A][S].toString()}).join(",")+`});
|
|
`}),f=f+"new (("+X.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+u.main.map(function(A){return""+JSON.stringify(A)+": "+l.main[A].toString()}).join(",")+"}))(self);";var o=new window.Blob([f],{type:"text/javascript"});if(p.bare)return o;var h=window.URL||window.webkitURL||window.mozURL||window.msURL,s=h.createObjectURL(o),a=new window.Worker(s);return a.objectURL=s,a}},"./src/config.ts":function(ie,$,M){"use strict";M.r($),M.d($,"hlsDefaultConfig",function(){return L}),M.d($,"mergeConfig",function(){return C}),M.d($,"enableStreamingMode",function(){return w});var X=M("./src/controller/abr-controller.ts"),F=M("./src/controller/audio-stream-controller.ts"),U=M("./src/controller/audio-track-controller.ts"),G=M("./src/controller/subtitle-stream-controller.ts"),W=M("./src/controller/subtitle-track-controller.ts"),i=M("./src/controller/buffer-controller.ts"),D=M("./src/controller/timeline-controller.ts"),g=M("./src/controller/cap-level-controller.ts"),m=M("./src/controller/fps-controller.ts"),p=M("./src/controller/eme-controller.ts"),l=M("./src/controller/cmcd-controller.ts"),u=M("./src/utils/xhr-loader.ts"),f=M("./src/utils/fetch-loader.ts"),o=M("./src/utils/cues.ts"),h=M("./src/utils/mediakeys-helper.ts"),s=M("./src/utils/logger.ts");function a(){return a=Object.assign||function(x){for(var c=1;c<arguments.length;c++){var T=arguments[c];for(var y in T)Object.prototype.hasOwnProperty.call(T,y)&&(x[y]=T[y])}return x},a.apply(this,arguments)}function A(x,c){var T=Object.keys(x);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(x);c&&(y=y.filter(function(v){return Object.getOwnPropertyDescriptor(x,v).enumerable})),T.push.apply(T,y)}return T}function _(x){for(var c=1;c<arguments.length;c++){var T=arguments[c]!=null?arguments[c]:{};c%2?A(Object(T),!0).forEach(function(y){S(x,y,T[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(T)):A(Object(T)).forEach(function(y){Object.defineProperty(x,y,Object.getOwnPropertyDescriptor(T,y))})}return x}function S(x,c,T){return c in x?Object.defineProperty(x,c,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[c]=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:u.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:m.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:F.default,audioTrackController:U.default,emeController:p.default,cmcdController:l.default});function R(){return{cueHandler:o.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,c){if((c.liveSyncDurationCount||c.liveMaxLatencyDurationCount)&&(c.liveSyncDuration||c.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(c.liveMaxLatencyDurationCount!==void 0&&(c.liveSyncDurationCount===void 0||c.liveMaxLatencyDurationCount<=c.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(c.liveMaxLatencyDuration!==void 0&&(c.liveSyncDuration===void 0||c.liveMaxLatencyDuration<=c.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return a({},x,c)}function w(x){var c=x.loader;if(c!==f.default&&c!==u.default)s.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,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ie,$,M){"use strict";M.r($);var X=M("./src/polyfills/number.ts"),F=M("./src/utils/ewma-bandwidth-estimator.ts"),U=M("./src/events.ts"),G=M("./src/utils/buffer-helper.ts"),W=M("./src/errors.ts"),i=M("./src/types/loader.ts"),D=M("./src/utils/logger.ts");function g(l,u){for(var f=0;f<u.length;f++){var o=u[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function m(l,u,f){return u&&g(l.prototype,u),f&&g(l,f),l}var p=function(){function l(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 o=f.config;this.bwEstimator=new F.default(o.abrEwmaSlowVoD,o.abrEwmaFastVoD,o.abrEwmaDefaultEstimate),this.registerListeners()}var u=l.prototype;return u.registerListeners=function(){var o=this.hls;o.on(U.Events.FRAG_LOADING,this.onFragLoading,this),o.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(U.Events.ERROR,this.onError,this)},u.unregisterListeners=function(){var o=this.hls;o.off(U.Events.FRAG_LOADING,this.onFragLoading,this),o.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(U.Events.ERROR,this.onError,this)},u.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},u.onFragLoading=function(o,h){var s=h.frag;if(s.type===i.PlaylistLevelType.MAIN&&!this.timer){var a;this.fragCurrent=s,this.partCurrent=(a=h.part)!=null?a:null,this.timer=self.setInterval(this.onCheck,100)}},u.onLevelLoaded=function(o,h){var s=this.hls.config;h.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},u._abandonRulesCheck=function(){var o=this.fragCurrent,h=this.partCurrent,s=this.hls,a=s.autoLevelEnabled,A=s.config,_=s.media;if(!o||!_)return;var S=h?h.stats:o.stats,L=h?h.duration:o.duration;if(S.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!a||_.paused||!_.playbackRate||!_.readyState)return;var R=performance.now()-S.loading.start,C=Math.abs(_.playbackRate);if(R<=500*L/C)return;var w=s.levels,x=s.minAutoLevel,c=w[o.level],T=S.total||Math.max(S.loaded,Math.round(L*c.maxBitrate/8)),y=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/R),v=(T-S.loaded)/y,N=_.currentTime,B=(G.BufferHelper.bufferInfo(_,N,A.maxBufferHole).end-N)/C;if(B>=2*L/C||v<=B)return;var O=Number.POSITIVE_INFINITY,j;for(j=o.level-1;j>x;j--){var P=w[j].maxBitrate;if(O=L*P/(8*.8*y),O<B)break}if(O>=v)return;var b=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+o.sn+(h?" part "+h.index:"")+" of level "+o.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: `+v.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+O.toFixed(3)+` s
|
|
Time to underbuffer: `+B.toFixed(3)+" s"),s.nextLoadLevel=j,this.bwEstimator.sample(R,S.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),s.trigger(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:h,stats:S})},u.onFragLoaded=function(o,h){var s=h.frag,a=h.part;if(s.type===i.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(s.sn)){var A=a?a.stats:s.stats,_=a?a.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[s.level],L=(S.loaded?S.loaded.bytes:0)+A.loaded,R=(S.loaded?S.loaded.duration:0)+_;S.loaded={bytes:L,duration:R},S.realBitrate=Math.round(8*L/R)}if(s.bitrateTest){var C={stats:A,frag:s,part:a,id:s.type};this.onFragBuffered(U.Events.FRAG_BUFFERED,C),s.bitrateTest=!1}}},u.onFragBuffered=function(o,h){var s=h.frag,a=h.part,A=a?a.stats:s.stats;if(A.aborted)return;if(s.type!==i.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var _=A.parsing.end-A.loading.start;this.bwEstimator.sample(_,A.loaded),A.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=_/1e3:this.bitrateTestDelay=0},u.onError=function(o,h){switch(h.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},u.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},u.getNextABRAutoLevel=function(){var o=this.fragCurrent,h=this.partCurrent,s=this.hls,a=s.maxAutoLevel,A=s.config,_=s.minAutoLevel,S=s.media,L=h?h.duration:o?o.duration:0,R=S?S.currentTime:0,C=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,w=this.bwEstimator?this.bwEstimator.getEstimate():A.abrEwmaDefaultEstimate,x=(G.BufferHelper.bufferInfo(S,R,A.maxBufferHole).end-R)/C,c=this.findBestLevel(w,_,a,x,A.abrBandWidthFactor,A.abrBandWidthUpFactor);if(c>=0)return c;D.logger.trace((x?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var T=L?Math.min(L,A.maxStarvationDelay):A.maxStarvationDelay,y=A.abrBandWidthFactor,v=A.abrBandWidthUpFactor;if(!x){var N=this.bitrateTestDelay;if(N){var B=L?Math.min(L,A.maxLoadingDelay):A.maxLoadingDelay;T=B-N,D.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*T)+" ms"),y=v=1}}return c=this.findBestLevel(w,_,a,x+T,y,v),Math.max(c,0)},u.findBestLevel=function(o,h,s,a,A,_){for(var S,L=this.fragCurrent,R=this.partCurrent,C=this.lastLoadedFragLevel,w=this.hls.levels,x=w[C],c=!!(x!=null&&(S=x.details)!==null&&S!==void 0&&S.live),T=x==null?void 0:x.codecSet,y=R?R.duration:L?L.duration:0,v=s;v>=h;v--){var N=w[v];if(!N||T&&N.codecSet!==T)continue;var B=N.details,O=(R?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||y,j=void 0;v<=C?j=A*o:j=_*o;var P=w[v].maxBitrate,b=P*O/j;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+v+"/"+Math.round(j)+"/"+P+"/"+O+"/"+a+"/"+b),j>P&&(!b||c&&!this.bitrateTestDelay||b<a))return v}return-1},m(l,[{key:"nextAutoLevel",get:function(){var o=this._nextAutoLevel,h=this.bwEstimator;if(o!==-1&&(!h||!h.canEstimate()))return o;var s=this.getNextABRAutoLevel();return o!==-1&&(s=Math.min(o,s)),s},set:function(o){this._nextAutoLevel=o}}]),l}();$.default=p},"./src/controller/audio-stream-controller.ts":function(ie,$,M){"use strict";M.r($);var X=M("./src/polyfills/number.ts"),F=M("./src/controller/base-stream-controller.ts"),U=M("./src/events.ts"),G=M("./src/utils/buffer-helper.ts"),W=M("./src/controller/fragment-tracker.ts"),i=M("./src/types/level.ts"),D=M("./src/types/loader.ts"),g=M("./src/loader/fragment.ts"),m=M("./src/demux/chunk-cache.ts"),p=M("./src/demux/transmuxer-interface.ts"),l=M("./src/types/transmuxer.ts"),u=M("./src/controller/fragment-finders.ts"),f=M("./src/utils/discontinuities.ts"),o=M("./src/errors.ts"),h=M("./src/utils/logger.ts");function s(){return s=Object.assign||function(L){for(var R=1;R<arguments.length;R++){var C=arguments[R];for(var w in C)Object.prototype.hasOwnProperty.call(C,w)&&(L[w]=C[w])}return L},s.apply(this,arguments)}function a(L,R){L.prototype=Object.create(R.prototype),L.prototype.constructor=L,A(L,R)}function A(L,R){return A=Object.setPrototypeOf||function(w,x){return w.__proto__=x,w},A(L,R)}var _=100,S=function(L){a(R,L);function R(w,x){var c;return c=L.call(this,w,x,"[audio-stream-controller]")||this,c.videoBuffer=null,c.videoTrackCC=-1,c.waitingVideoCC=-1,c.audioSwitch=!1,c.trackId=-1,c.waitingData=null,c.mainDetails=null,c.bufferFlushed=!1,c._registerListeners(),c}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,c){var T=c.frag,y=c.id,v=c.initPTS;if(y==="main"){var N=T.cc;this.initPTS[T.cc]=v,this.log("InitPTS for cc: "+N+" found from main: "+v),this.videoTrackCC=N,this.state===F.State.WAITING_INIT_PTS&&this.tick()}},C.startLoad=function(x){if(!this.levels){this.startPosition=x,this.state=F.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(_),this.fragLoadError=0,c>0&&x===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=F.State.IDLE):(this.loadedmetadata=!1,this.state=F.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()},C.doTick=function(){switch(this.state){case F.State.IDLE:this.doTickIdle();break;case F.State.WAITING_TRACK:{var x,c=this.levels,T=this.trackId,y=c==null||((x=c[T])===null||x===void 0)?void 0:x.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=F.State.WAITING_INIT_PTS}break}case F.State.FRAG_LOADING_WAITING_RETRY:{var v,N=performance.now(),B=this.retryDate;(!B||N>=B||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=F.State.IDLE);break}case F.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=F.State.FRAG_LOADING;var ee=b.flush(),le={frag:j,part:P,payload:ee,networkDetails:null};this._handleFragmentLoadProgress(le),Y&&L.prototype._handleFragmentLoadComplete.call(this,le)}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 ue=this.getLoadPosition(),ke=G.BufferHelper.bufferInfo(this.mediaBuffer,ue,this.config.maxBufferHole),we=Object(u.fragmentWithinToleranceTest)(ke.end,this.config.maxFragLookUpTolerance,j);we<0&&(h.logger.log("Waiting fragment cc ("+j.cc+") @ "+j.start+" cancelled because another fragment at "+ke.end+" is needed"),this.clearWaitingFragment())}}else this.state=F.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=F.State.IDLE)},C.onTickEnd=function(){var x=this.media;if(!x||!x.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:x,T=c.buffered;!this.loadedmetadata&&T.length&&(this.loadedmetadata=!0),this.lastCurrentTime=x.currentTime},C.doTickIdle=function(){var x,c,T=this.hls,y=this.levels,v=this.media,N=this.trackId,B=T.config;if(!y||!y[N])return;if(!v&&(this.startFragRequested||!B.startFragPrefetch))return;var O=y[N],j=O.details;if(!j||j.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(j)){this.state=F.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=F.State.ENDED;return}var le=j.fragments,ue=le[0].start,ke=P.end;if(ee){var we=this.getLoadPosition();ke=we,j.PTSKnown&&we<ue&&((P.end>ue||P.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),v.currentTime=ue+.05))}var Ae=this.getNextFragment(ke,j);if(!Ae){this.bufferFlushed=!0;return}((x=Ae.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((c=Ae.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(Ae,j):this.loadFragment(Ae,j,ke)},C.getMaxBufferLength=function(){var x=L.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return c===null?x:Math.max(x,c.len)},C.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},C.onAudioTracksUpdated=function(x,c){var T=c.audioTracks;this.resetTransmuxer(),this.levels=T.map(function(y){return new i.Level(y)})},C.onAudioTrackSwitching=function(x,c){var T=!!c.url;this.trackId=c.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),T?this.setInterval(_):this.resetTransmuxer(),T?(this.audioSwitch=!0,this.state=F.State.IDLE):this.state=F.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,c){this.mainDetails=c.details},C.onAudioTrackLoaded=function(x,c){var T,y=this.levels,v=c.details,N=c.id;if(!y){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+v.startSN+","+v.endSN+"],duration:"+v.totalduration);var B=y[N],O=0;if(v.live||(T=B.details)!==null&&T!==void 0&&T.live){var j=this.mainDetails;if(v.fragments[0]||(v.deltaUpdateFailed=!0),v.deltaUpdateFailed||!j)return;!B.details&&v.hasProgramDateTime&&j.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(v,j),O=v.fragments[0].start):O=this.alignPlaylists(v,B.details)}B.details=v,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!v.live)&&this.setStartPosition(B.details,O),this.state===F.State.WAITING_TRACK&&!this.waitForCdnTuneIn(v)&&(this.state=F.State.IDLE),this.tick()},C._handleFragmentLoadProgress=function(x){var c,T=x.frag,y=x.part,v=x.payload,N=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=N.defaultAudioCodec||j.audioCodec||"mp4a.40.2",Y=this.transmuxer;Y||(Y=this.transmuxer=new p.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ee=this.initPTS[T.cc],le=(c=T.initSegment)===null||c===void 0?void 0:c.data;if(ee!==void 0){var ue=!1,ke=y?y.index:-1,we=ke!==-1,Ae=new l.ChunkMetadata(T.level,T.sn,T.stats.chunkCount,v.byteLength,ke,we);Y.push(v,le,b,"",T,y,P.totalduration,ue,Ae,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 ce=this.waitingData=this.waitingData||{frag:T,part:y,cache:new m.default,complete:!1},pe=ce.cache;pe.push(new Uint8Array(v)),this.waitingVideoCC=this.videoTrackCC,this.state=F.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,c){var T=c.tracks.audio;T&&(this.mediaBuffer=T.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},C.onFragBuffered=function(x,c){var T=c.frag,y=c.part;if(T.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(T)){this.warn("Fragment "+T.sn+(y?" p: "+y.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,y)},C.onError=function(x,c){switch(c.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,c);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==F.State.ERROR&&this.state!==F.State.STOPPED&&(this.state=c.fatal?F.State.ERROR:F.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===F.State.PARSING||this.state===F.State.PARSED)){var T=!0,y=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);y&&y.len>.5&&(T=!this.reduceMaxBufferLength(y.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,c){var T=c.type;T===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},C._handleTransmuxComplete=function(x){var c,T="audio",y=this.hls,v=x.remuxResult,N=x.chunkMeta,B=this.getCurrentContext(N);if(!B){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var O=B.frag,j=B.part,P=v.audio,b=v.text,Y=v.id3,ee=v.initSegment;if(this.fragContextChanged(O))return;if(this.state=F.State.PARSING,this.audioSwitch&&P&&this.completeAudioSwitch(),ee!=null&&ee.tracks&&(this._bufferInitSegment(ee.tracks,O,N),y.trigger(U.Events.FRAG_PARSING_INIT_SEGMENT,{frag:O,id:T,tracks:ee.tracks})),P){var le=P.startPTS,ue=P.endPTS,ke=P.startDTS,we=P.endDTS;j&&(j.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:le,endPTS:ue,startDTS:ke,endDTS:we}),O.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,le,ue,ke,we),this.bufferFragmentData(P,O,j,N)}if(Y!=null&&(c=Y.samples)!==null&&c!==void 0&&c.length){var Ae=s({frag:O,id:T},Y);y.trigger(U.Events.FRAG_PARSING_METADATA,Ae)}if(b){var ce=s({frag:O,id:T},b);y.trigger(U.Events.FRAG_PARSING_USERDATA,ce)}},C._bufferInitSegment=function(x,c,T){if(this.state!==F.State.PARSING)return;x.video&&delete x.video;var y=x.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(U.Events.BUFFER_CODECS,x);var v=y.initSegment;if(v!=null&&v.byteLength){var N={type:"audio",frag:c,part:null,chunkMeta:T,parent:c.type,data:v};this.hls.trigger(U.Events.BUFFER_APPENDING,N)}this.tick()},C.loadFragment=function(x,c,T){var y=this.fragmentTracker.getState(x);this.fragCurrent=x,(this.audioSwitch||y===W.FragmentState.NOT_LOADED||y===W.FragmentState.PARTIAL)&&(x.sn==="initSegment"?this._loadInitSegment(x):c.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=F.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,x,c,T)))},C.completeAudioSwitch=function(){var x=this.hls,c=this.media,T=this.trackId;c&&(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}(F.default);$.default=S},"./src/controller/audio-track-controller.ts":function(ie,$,M){"use strict";M.r($);var X=M("./src/events.ts"),F=M("./src/errors.ts"),U=M("./src/controller/base-playlist-controller.ts"),G=M("./src/types/loader.ts");function W(p,l){for(var u=0;u<l.length;u++){var f=l[u];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(p,f.key,f)}}function i(p,l,u){return l&&W(p.prototype,l),u&&W(p,u),p}function D(p,l){p.prototype=Object.create(l.prototype),p.prototype.constructor=p,g(p,l)}function g(p,l){return g=Object.setPrototypeOf||function(f,o){return f.__proto__=o,f},g(p,l)}var m=function(p){D(l,p);function l(f){var o;return o=p.call(this,f,"[audio-track-controller]")||this,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.trackName="",o.selectDefaultTrack=!0,o.registerListeners(),o}var u=l.prototype;return u.registerListeners=function(){var o=this.hls;o.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(X.Events.ERROR,this.onError,this)},u.unregisterListeners=function(){var o=this.hls;o.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(X.Events.ERROR,this.onError,this)},u.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},u.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},u.onManifestParsed=function(o,h){this.tracks=h.audioTracks||[]},u.onAudioTrackLoaded=function(o,h){var s=h.id,a=h.details,A=this.tracksInGroup[s];if(!A){this.warn("Invalid audio track id "+s);return}var _=A.details;A.details=h.details,this.log("audioTrack "+s+" loaded ["+a.startSN+"-"+a.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,h,_))},u.onLevelLoading=function(o,h){this.switchLevel(h.level)},u.onLevelSwitching=function(o,h){this.switchLevel(h.level)},u.switchLevel=function(o){var h=this.hls.levels[o];if(!(h!=null&&h.audioGroupIds))return;var s=h.audioGroupIds[h.urlId];if(this.groupId!==s){this.groupId=s;var a=this.tracks.filter(function(_){return!s||_.groupId===s});this.selectDefaultTrack&&!a.some(function(_){return _.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=a;var A={audioTracks:a};this.log("Updating audio tracks, "+a.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(X.Events.AUDIO_TRACKS_UPDATED,A),this.selectInitialTrack()}},u.onError=function(o,h){if(p.prototype.onError.call(this,o,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)},u.setAudioTrack=function(o){var h=this.tracksInGroup;if(o<0||o>=h.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=h[this.trackId];this.log("Now switching to audio-track index "+o);var a=h[o],A=a.id,_=a.groupId,S=_===void 0?"":_,L=a.name,R=a.type,C=a.url;if(this.trackId=o,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:S,name:L,type:R,url:C}),a.details&&!a.details.live)return;var w=this.switchParams(a.url,s==null?void 0:s.details);this.loadPlaylist(w)},u.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.length,"Initial audio track should be selected when tracks are known");var h=this.trackName,s=this.findTrackId(h)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},u.findTrackId=function(o){for(var h=this.tracksInGroup,s=0;s<h.length;s++){var a=h[s];if((!this.selectDefaultTrack||a.default)&&(!o||o===a.name))return a.id}return-1},u.loadPlaylist=function(o){var h=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(h)){var s=h.id,a=h.groupId,A=h.url;if(o)try{A=o.addDirectives(A)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(X.Events.AUDIO_TRACK_LOADING,{url:A,id:s,groupId:a,deliveryDirectives:o||null})}},i(l,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1,this.setAudioTrack(o)}}]),l}(U.default);$.default=m},"./src/controller/base-playlist-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return i});var X=M("./src/polyfills/number.ts"),F=M("./src/types/level.ts"),U=M("./src/controller/level-helper.ts"),G=M("./src/utils/logger.ts"),W=M("./src/errors.ts"),i=function(){function D(m,p){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,p+":"),this.warn=G.logger.warn.bind(G.logger,p+":"),this.hls=m}var g=D.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(p,l){l.fatal&&l.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(p,l){var u=l==null?void 0:l.renditionReports;if(u)for(var f=0;f<u.length;f++){var o=u[f],h=""+o.URI;if(h===p.substr(-h.length)){var s=parseInt(o["LAST-MSN"]),a=parseInt(o["LAST-PART"]);if(l&&this.hls.config.lowLatencyMode){var A=Math.min(l.age-l.partTarget,l.targetduration);a!==void 0&&A>l.partTarget&&(a+=1)}if(Object(X.isFiniteNumber)(s))return new F.HlsUrlParameters(s,Object(X.isFiniteNumber)(a)?a:void 0,F.HlsSkip.No)}}},g.loadPlaylist=function(p){},g.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},g.playlistLoaded=function(p,l,u){var f=this,o=l.details,h=l.stats,s=h.loading.end?Math.max(0,self.performance.now()-h.loading.end):0;if(o.advancedDateTime=Date.now()-s,o.live||u!=null&&u.live){if(o.reloaded(u),u&&this.log("live playlist "+p+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),u&&o.fragments.length>0&&Object(U.mergeDetails)(u,o),!this.canLoad||!o.live)return;var a,A=void 0,_=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var S=this.hls.config.lowLatencyMode,L=o.lastPartSn,R=o.endSN,C=o.lastPartIndex,w=C!==-1,x=L===R,c=S?0:C;w?(A=x?R+1:L,_=x?c:C+1):A=R+1;var T=o.age,y=T+o.ageHeader,v=Math.min(y-o.partTarget,o.targetduration*1.5);if(v>0){if(u&&v>u.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+u.tuneInGoal+" to: "+v+" with playlist age: "+o.age),v=0;else{var N=Math.floor(v/o.targetduration);if(A+=N,_!==void 0){var B=Math.round(v%o.targetduration/o.partTarget);_+=B}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+T.toFixed(2)+"s goal: "+v+" skip sn "+N+" to part "+_)}o.tuneInGoal=v}if(a=this.getDeliveryDirectives(o,l.deliveryDirectives,A,_),S||!x){this.loadPlaylist(a);return}}else a=this.getDeliveryDirectives(o,l.deliveryDirectives,A,_);var O=Object(U.computeReloadInterval)(o,h);A!==void 0&&o.canBlockReload&&(O-=o.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(O)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(a)},O)}else this.clearTimer()},g.getDeliveryDirectives=function(p,l,u,f){var o=Object(F.getSkipValue)(p,u);return l!=null&&l.skip&&p.deltaUpdateFailed&&(u=l.msn,f=l.part,o=F.HlsSkip.No),new F.HlsUrlParameters(u,f,o)},g.retryLoadingOrFail=function(p){var l=this,u=this.hls.config,f=this.retryCount<u.levelLoadingMaxRetry;if(f){var o;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(o=p.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var h=Math.min(Math.pow(2,this.retryCount)*u.levelLoadingRetryDelay,u.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return l.loadPlaylist()},h),this.warn("retry playlist loading #"+this.retryCount+" in "+h+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return f},D}()},"./src/controller/base-stream-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"State",function(){return R}),M.d($,"default",function(){return C});var X=M("./src/polyfills/number.ts"),F=M("./src/task-loop.ts"),U=M("./src/controller/fragment-tracker.ts"),G=M("./src/utils/buffer-helper.ts"),W=M("./src/utils/logger.ts"),i=M("./src/events.ts"),D=M("./src/errors.ts"),g=M("./src/types/transmuxer.ts"),m=M("./src/utils/mp4-tools.ts"),p=M("./src/utils/discontinuities.ts"),l=M("./src/controller/fragment-finders.ts"),u=M("./src/controller/level-helper.ts"),f=M("./src/loader/fragment-loader.ts"),o=M("./src/crypt/decrypter.ts"),h=M("./src/utils/time-ranges.ts"),s=M("./src/types/loader.ts");function a(w,x){for(var c=0;c<x.length;c++){var T=x[c];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(w,T.key,T)}}function A(w,x,c){return x&&a(w.prototype,x),c&&a(w,c),w}function _(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function S(w,x){w.prototype=Object.create(x.prototype),w.prototype.constructor=w,L(w,x)}function L(w,x){return L=Object.setPrototypeOf||function(T,y){return T.__proto__=y,T},L(w,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(w){S(x,w);function x(T,y,v){var N;return N=w.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=R.STOPPED,N.media=void 0,N.mediaBuffer=void 0,N.config=void 0,N.bitrateTest=!1,N.lastCurrentTime=0,N.nextLoadPosition=0,N.startPosition=0,N.loadedmetadata=!1,N.fragLoadError=0,N.retryDate=0,N.levels=null,N.fragmentLoader=void 0,N.levelLastLoaded=null,N.startFragRequested=!1,N.decrypter=void 0,N.initPTS=[],N.onvseeking=null,N.onvended=null,N.logPrefix="",N.log=void 0,N.warn=void 0,N.logPrefix=v,N.log=W.logger.log.bind(W.logger,v+":"),N.warn=W.logger.warn.bind(W.logger,v+":"),N.hls=T,N.fragmentLoader=new f.default(T.config),N.fragmentTracker=y,N.config=T.config,N.decrypter=new o.default(T,T.config),T.on(i.Events.KEY_LOADED,N.onKeyLoaded,_(N)),N}var c=x.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(y){},c.stopLoad=function(){this.fragmentLoader.abort();var y=this.fragCurrent;y&&this.fragmentTracker.removeFragment(y),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=R.STOPPED},c._streamEnded=function(y,v){var N=this.fragCurrent,B=this.fragmentTracker;if(!v.live&&N&&N.sn===v.endSN&&!y.nextStart){var O=B.getState(N);return O===U.FragmentState.PARTIAL||O===U.FragmentState.OK}return!1},c.onMediaAttached=function(y,v){var N=this.media=this.mediaBuffer=v.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var B=this.config;this.levels&&B.autoStartLoad&&this.state===R.STOPPED&&this.startLoad(B.startPosition)},c.onMediaDetaching=function(){var y=this.media;y!=null&&y.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),y&&(y.removeEventListener("seeking",this.onvseeking),y.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},c.onMediaSeeking=function(){var y=this.config,v=this.fragCurrent,N=this.media,B=this.mediaBuffer,O=this.state,j=N?N.currentTime:0,P=G.BufferHelper.bufferInfo(B||N,j,y.maxBufferHole);if(this.log("media seeking to "+(Object(X.isFiniteNumber)(j)?j.toFixed(3):j)+", state: "+O),O===R.ENDED)this.resetLoadingState();else if(v&&!P.len){var b=y.maxFragLookUpTolerance,Y=v.start-b,ee=v.start+v.duration+b,le=j>ee;(j<Y||le)&&(le&&v.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),v.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=j),!this.loadedmetadata&&!P.len&&(this.nextLoadPosition=this.startPosition=j),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(y,v){if(this.state!==R.KEY_LOADING||v.frag!==this.fragCurrent||!this.levels)return;this.state=R.IDLE;var N=this.levels[v.frag.level].details;N&&this.loadFragment(v.frag,N,v.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),w.prototype.onHandlerDestroying.call(this)},c.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,w.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(y,v){this.log("Loading key for "+y.sn+" of ["+v.startSN+"-"+v.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=R.KEY_LOADING,this.fragCurrent=y,this.hls.trigger(i.Events.KEY_LOADING,{frag:y})},c.loadFragment=function(y,v,N){this._loadFragForPlayback(y,v,N)},c._loadFragForPlayback=function(y,v,N){var B=this,O=function(P){if(B.fragContextChanged(y)){B.warn("Fragment "+y.sn+(P.part?" p: "+P.part.index:"")+" of level "+y.level+" was dropped during download."),B.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,B._handleFragmentLoadProgress(P)};this._doFragLoad(y,v,N,O).then(function(j){if(!j)return;B.fragLoadError=0;var P=B.state;if(B.fragContextChanged(y)){(P===R.FRAG_LOADING||P===R.BACKTRACKING||!B.fragCurrent&&P===R.PARSING)&&(B.fragmentTracker.removeFragment(y),B.state=R.IDLE);return}if("payload"in j&&(B.log("Loaded fragment "+y.sn+" of level "+y.level),B.hls.trigger(i.Events.FRAG_LOADED,j),B.state===R.BACKTRACKING)){B.fragmentTracker.backtrack(y,j),B.resetFragmentLoading(y);return}B._handleFragmentLoadComplete(j)}).catch(function(j){B.warn(j),B.resetFragmentLoading(y)})},c.flushMainBuffer=function(y,v,N){if(N===void 0&&(N=null),!(y-v))return;var B={startOffset:y,endOffset:v,type:N};this.fragLoadError=0,this.hls.trigger(i.Events.BUFFER_FLUSHING,B)},c._loadInitSegment=function(y){var v=this;this._doFragLoad(y).then(function(N){if(!N||v.fragContextChanged(y)||!v.levels)throw new Error("init load aborted");return N}).then(function(N){var B=v.hls,O=N.payload,j=y.decryptdata;if(O&&O.byteLength>0&&j&&j.key&&j.iv&&j.method==="AES-128"){var P=self.performance.now();return v.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:y,payload:b,stats:{tstart:P,tdecrypt:Y}}),N.payload=b,N})}return N}).then(function(N){var B=v.fragCurrent,O=v.hls,j=v.levels;if(!j)throw new Error("init load aborted, missing levels");var P=j[y.level].details;console.assert(P,"Level details are defined when init segment is loaded");var b=y.stats;v.state=R.IDLE,v.fragLoadError=0,y.data=new Uint8Array(N.payload),b.parsing.start=b.buffering.start=self.performance.now(),b.parsing.end=b.buffering.end=self.performance.now(),N.frag===B&&O.trigger(i.Events.FRAG_BUFFERED,{stats:b,frag:B,part:null,id:y.type}),v.tick()}).catch(function(N){v.warn(N),v.resetFragmentLoading(y)})},c.fragContextChanged=function(y){var v=this.fragCurrent;return!y||!v||y.level!==v.level||y.sn!==v.sn||y.urlId!==v.urlId},c.fragBufferedComplete=function(y,v){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(v?" part: "+v.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+h.default.toString(G.BufferHelper.getBuffered(N))),this.state=R.IDLE,this.tick()},c._handleFragmentLoadComplete=function(y){var v=this.transmuxer;if(!v)return;var N=y.frag,B=y.part,O=y.partsLoaded,j=!O||O.length===0||O.some(function(b){return!b}),P=new g.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,B?B.index:-1,!j);v.flush(P)},c._handleFragmentLoadProgress=function(y){},c._doFragLoad=function(y,v,N,B){var O=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(y.start,N||0),this.config.lowLatencyMode&&v){var j=v.partList;if(j&&B){N>y.end&&v.fragmentHint&&(y=v.fragmentHint);var P=this.getNextPart(j,y,N);if(P>-1){var b=j[P];return this.log("Loading part sn: "+y.sn+" p: "+b.index+" cc: "+y.cc+" of playlist ["+v.startSN+"-"+v.endSN+"] parts [0-"+P+"-"+(j.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=b.start+b.duration,this.state=R.FRAG_LOADING,this.hls.trigger(i.Events.FRAG_LOADING,{frag:y,part:j[P],targetBufferTime:N}),this.doFragPartsLoad(y,j,P,B).catch(function(Y){return O.handleFragLoadError(Y)})}else if(!y.url||this.loadedEndOfParts(j,N))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(v?"of ["+v.startSN+"-"+v.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(N.toFixed(3))),Object(X.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=R.FRAG_LOADING,this.hls.trigger(i.Events.FRAG_LOADING,{frag:y,targetBufferTime:N}),this.fragmentLoader.load(y,B).catch(function(Y){return O.handleFragLoadError(Y)})},c.doFragPartsLoad=function(y,v,N,B){var O=this;return new Promise(function(j,P){var b=[],Y=function ee(le){var ue=v[le];O.fragmentLoader.loadPart(y,ue,B).then(function(ke){b[ue.index]=ke;var we=ke.part;O.hls.trigger(i.Events.FRAG_LOADED,ke);var Ae=v[le+1];if(Ae&&Ae.fragment===y)ee(le+1);else return j({frag:y,part:we,partsLoaded:b})}).catch(P)};Y(N)})},c.handleFragLoadError=function(y){var v=y.data;return v&&v.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(v.frag,v.part):this.hls.trigger(i.Events.ERROR,v),null},c._handleTransmuxerFlush=function(y){var v=this.getCurrentContext(y);if(!v||this.state!==R.PARSING){this.fragCurrent||(this.state=R.IDLE);return}var N=v.frag,B=v.part,O=v.level,j=self.performance.now();N.stats.parsing.end=j,B&&(B.stats.parsing.end=j),this.updateLevelTiming(N,B,O,y.partial)},c.getCurrentContext=function(y){var v=this.levels,N=y.level,B=y.sn,O=y.part;if(!v||!v[N])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+N+". The current chunk will not be buffered."),null;var j=v[N],P=O>-1?Object(u.getPartWith)(j,B,O):null,b=P?P.fragment:Object(u.getFragmentWithSN)(j,B,this.fragCurrent);return b?{frag:b,part:P,level:j}:null},c.bufferFragmentData=function(y,v,N,B){if(!y||this.state!==R.PARSING)return;var O=y.data1,j=y.data2,P=O;if(O&&j&&(P=Object(m.appendUint8Array)(O,j)),!P||!P.length)return;var b={type:y.type,frag:v,part:N,chunkMeta:B,parent:v.type,data:P};this.hls.trigger(i.Events.BUFFER_APPENDING,b),y.dropped&&y.independent&&!N&&this.flushBufferGap(v)},c.flushBufferGap=function(y){var v=this.media;if(!v)return;if(!G.BufferHelper.isBuffered(v,v.currentTime)){this.flushMainBuffer(0,y.start);return}var N=v.currentTime,B=G.BufferHelper.bufferInfo(v,N,0),O=y.duration,j=Math.min(this.config.maxFragLookUpTolerance*2,O*.25),P=Math.max(Math.min(y.start-j,B.end-j),N+j);y.start-P>j&&this.flushMainBuffer(P,y.start)},c.getFwdBufferInfo=function(y,v){var N=this.config,B=this.getLoadPosition();if(!Object(X.isFiniteNumber)(B))return null;var O=G.BufferHelper.bufferInfo(y,B,N.maxBufferHole);if(O.len===0&&O.nextStart!==void 0){var j=this.fragmentTracker.getBufferedFrag(B,v);if(j&&O.nextStart<j.end)return G.BufferHelper.bufferInfo(y,B,Math.max(O.nextStart,N.maxBufferHole))}return O},c.getMaxBufferLength=function(y){var v=this.config,N;return y?N=Math.max(8*v.maxBufferSize/y,v.maxBufferLength):N=v.maxBufferLength,Math.min(N,v.maxMaxBufferLength)},c.reduceMaxBufferLength=function(y){var v=this.config,N=y||v.maxBufferLength;return v.maxMaxBufferLength>=N?(v.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+v.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(y,v){var N,B,O=v.fragments,j=O.length;if(!j)return null;var P=this.config,b=O[0].start,Y;if(v.live){var ee=P.initialLiveManifestSize;if(j<ee)return this.warn("Not enough fragments to start playback (have: "+j+", need: "+ee+")"),null;!v.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(Y=this.getInitialLiveFragment(v,O),this.startPosition=Y?this.hls.liveSyncPosition||Y.start:y)}else y<=b&&(Y=O[0]);if(!Y){var le=P.lowLatencyMode?v.partEnd:v.fragmentEnd;Y=this.getFragmentAtPosition(y,le,v)}return(N=Y)!==null&&N!==void 0&&N.initSegment&&!((B=Y)!==null&&B!==void 0&&B.initSegment.data)&&!this.bitrateTest&&(Y=Y.initSegment),Y},c.getNextPart=function(y,v,N){for(var B=-1,O=!1,j=!0,P=0,b=y.length;P<b;P++){var Y=y[P];if(j=j&&!Y.independent,B>-1&&N<Y.start)break;var ee=Y.loaded;!ee&&(O||Y.independent||j)&&Y.fragment===v&&(B=P),O=ee}return B},c.loadedEndOfParts=function(y,v){var N=y[y.length-1];return N&&v>N.start&&N.loaded},c.getInitialLiveFragment=function(y,v){var N=this.fragPrevious,B=null;if(N){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),B=Object(l.findFragmentByPDT)(v,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var O=N.sn+1;if(O>=y.startSN&&O<=y.endSN){var j=v[O-y.startSN];N.cc===j.cc&&(B=j,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(l.findFragWithCC)(v,N.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?y.fragmentEnd:y.edge,y))}return B},c.getFragmentAtPosition=function(y,v,N){var B=this.config,O=this.fragPrevious,j=N.fragments,P=N.endSN,b=N.fragmentHint,Y=B.maxFragLookUpTolerance,ee=!!(B.lowLatencyMode&&N.partList&&b);ee&&b&&!this.bitrateTest&&(j=j.concat(b),P=b.sn);var le;if(y<v){var ue=y>v-Y?0:Y;le=Object(l.findFragmentByPTS)(O,j,y,ue)}else le=j[j.length-1];if(le){var ke=le.sn-N.startSN,we=O&&le.level===O.level,Ae=j[ke+1],ce=this.fragmentTracker.getState(le);if(ce===U.FragmentState.BACKTRACKED){le=null;for(var pe=ke;j[pe]&&this.fragmentTracker.getState(j[pe])===U.FragmentState.BACKTRACKED;)O?le=j[pe--]:le=j[--pe];le||(le=Ae)}else O&&le.sn===O.sn&&!ee&&(we&&(le.sn<P&&this.fragmentTracker.getState(Ae)!==U.FragmentState.OK?(this.log("SN "+le.sn+" just loaded, load next one: "+Ae.sn),le=Ae):le=null))}return le},c.synchronizeToLiveEdge=function(y){var v=this.config,N=this.media;if(!N)return;var B=this.hls.liveSyncPosition,O=N.currentTime,j=y.fragments[0].start,P=y.edge,b=O>=j-v.maxFragLookUpTolerance&&O<=P;if(B!==null&&N.duration>B&&(O<B||!b)){var Y=v.liveMaxLatencyDuration!==void 0?v.liveMaxLatencyDuration:v.liveMaxLatencyDurationCount*y.targetduration;(!b&&N.readyState<4||O<P-Y)&&(this.loadedmetadata||(this.nextLoadPosition=B),N.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)),N.currentTime=B))}},c.alignPlaylists=function(y,v){var N=this.levels,B=this.levelLastLoaded,O=this.fragPrevious,j=B!==null?N[B]:null,P=y.fragments.length;if(!P)return this.warn("No fragments in live playlist"),0;var b=y.fragments[0].start,Y=!v,ee=y.alignedSliding&&Object(X.isFiniteNumber)(b);if(Y||!ee&&!b){Object(p.alignStream)(O,j,y);var le=y.fragments[0].start;return this.log("Live playlist sliding: "+le.toFixed(2)+" start-sn: "+(v?v.startSN:"na")+"->"+y.startSN+" prev-sn: "+(O?O.sn:"na")+" fragments: "+P),le}return b},c.waitForCdnTuneIn=function(y){var v=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*v)},c.setStartPosition=function(y,v){var N=this.startPosition;if(N<v&&(N=-1),N===-1||this.lastCurrentTime===-1){var B=y.startTimeOffset;Object(X.isFiniteNumber)(B)?(N=v+B,B<0&&(N+=y.totalduration),N=Math.min(Math.max(v,N),v+y.totalduration),this.log("Start time offset "+B+" found in playlist, adjust startPosition to "+N),this.startPosition=N):y.live?N=this.hls.liveSyncPosition||v:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},c.getLoadPosition=function(){var y=this.media,v=0;return this.loadedmetadata&&y?v=y.currentTime:this.nextLoadPosition&&(v=this.nextLoadPosition),v},c.handleFragLoadAborted=function(y,v){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(v?" part"+v.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},c.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=R.IDLE)},c.onFragmentOrKeyLoadError=function(y,v){if(v.fatal)return;var N=v.frag;if(!N||N.type!==y)return;var B=this.fragCurrent;console.assert(B&&N.sn===B.sn&&N.level===B.level&&N.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(N.level))return;var j=Math.min(Math.pow(2,this.fragLoadError)*O.fragLoadingRetryDelay,O.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+y+" "+N.level+" failed to load, retrying in "+j+"ms"),this.retryDate=self.performance.now()+j,this.fragLoadError++,this.state=R.FRAG_LOADING_WAITING_RETRY}else v.levelRetry?(y===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=R.IDLE):(W.logger.error(v.details+" reaches max retry, redispatch as fatal ..."),v.fatal=!0,this.hls.stopLoad(),this.state=R.ERROR)},c.afterBufferFlushed=function(y,v,N){if(!y)return;var B=G.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(v,B,N),this.state===R.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=R.IDLE},c.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var v=this.levels?this.levels[y].details:null;if(v!=null&&v.live)return this.startPosition=-1,this.setStartPosition(v,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(y,v,N,B){var O=this,j=N.details;console.assert(!!j,"level.details must be defined");var P=Object.keys(y.elementaryStreams).reduce(function(b,Y){var ee=y.elementaryStreams[Y];if(ee){var le=ee.endPTS-ee.startPTS;if(le<=0)return O.warn("Could not parse fragment "+y.sn+" "+Y+" duration reliably ("+le+") resetting transmuxer to fallback to playlist timing"),O.resetTransmuxer(),b||!1;var ue=B?0:Object(u.updateFragPTSDTS)(j,y,ee.startPTS,ee.endPTS,ee.startDTS,ee.endDTS);return O.hls.trigger(i.Events.LEVEL_PTS_UPDATED,{details:j,level:N,drift:ue,type:Y,frag:y,start:ee.startPTS,end:ee.endPTS}),!0}return b},!1);P?(this.state=R.PARSED,this.hls.trigger(i.Events.FRAG_PARSED,{frag:y,part:v})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},A(x,[{key:"state",get:function(){return this._state},set:function(y){var v=this._state;v!==y&&(this._state=y,this.log(v+"->"+y))}}]),x}(F.default)},"./src/controller/buffer-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return l});var X=M("./src/polyfills/number.ts"),F=M("./src/events.ts"),U=M("./src/utils/logger.ts"),G=M("./src/errors.ts"),W=M("./src/utils/buffer-helper.ts"),i=M("./src/utils/mediasource-helper.ts"),D=M("./src/loader/fragment.ts"),g=M("./src/controller/buffer-operation-queue.ts"),m=Object(i.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,l=function(){function u(o){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 s=h.hls,a=h.media,A=h.mediaSource;U.logger.log("[buffer-controller]: Media source opened"),a&&(h.updateMediaElementDuration(),s.trigger(F.Events.MEDIA_ATTACHED,{media:a})),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=o,this._initSourceBuffer(),this.registerListeners()}var f=u.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(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(F.Events.BUFFER_RESET,this.onBufferReset,this),h.on(F.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.on(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.on(F.Events.BUFFER_EOS,this.onBufferEos,this),h.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.on(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.on(F.Events.FRAG_PARSED,this.onFragParsed,this),h.on(F.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var h=this.hls;h.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(F.Events.BUFFER_RESET,this.onBufferReset,this),h.off(F.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.off(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.off(F.Events.BUFFER_EOS,this.onBufferEos,this),h.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.off(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.off(F.Events.FRAG_PARSED,this.onFragParsed,this),h.off(F.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,s){var a=2;(s.audio&&!s.video||!s.altAudio)&&(a=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=a,this.details=null,U.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(h,s){var a=this.media=s.media;if(a&&m){var A=this.mediaSource=new m;A.addEventListener("sourceopen",this._onMediaSourceOpen),A.addEventListener("sourceended",this._onMediaSourceEnded),A.addEventListener("sourceclose",this._onMediaSourceClose),a.src=self.URL.createObjectURL(A),this._objectUrl=a.src}},f.onMediaDetaching=function(){var h=this.media,s=this.mediaSource,a=this._objectUrl;if(s){if(U.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(A){U.logger.warn("[buffer-controller]: onMediaDetaching: "+A.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),h&&(a&&self.URL.revokeObjectURL(a),h.src===a?(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(F.Events.MEDIA_DETACHED,void 0)},f.onBufferReset=function(){var h=this;this.getSourceBufferTypes().forEach(function(s){var a=h.sourceBuffer[s];try{a&&(h.removeBufferListeners(s),h.mediaSource&&h.mediaSource.removeSourceBuffer(a),h.sourceBuffer[s]=void 0)}catch(A){U.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",A)}}),this._initSourceBuffer()},f.onBufferCodecs=function(h,s){var a=this,A=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(_){if(A){var S=a.tracks[_];if(S&&typeof S.buffer.changeType=="function"){var L=s[_],R=L.codec,C=L.levelCodec,w=L.container,x=(S.levelCodec||S.codec).replace(p,"$1"),c=(C||R).replace(p,"$1");if(x!==c){var T=w+";codecs="+(C||R);a.appendChangeType(_,T)}}}else a.pendingTracks[_]=s[_]}),A)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(h,s){var a=this,A=this.operationQueue,_={execute:function(){var L=a.sourceBuffer[h];L&&(U.logger.log("[buffer-controller]: changing "+h+" sourceBuffer type to "+s),L.changeType(s)),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,s){var a=this,A=this.hls,_=this.operationQueue,S=this.tracks,L=s.data,R=s.type,C=s.frag,w=s.part,x=s.chunkMeta,c=x.buffering[R],T=self.performance.now();c.start=T;var y=C.stats.buffering,v=w?w.stats.buffering:null;y.start===0&&(y.start=T),v&&v.start===0&&(v.start=T);var N=S.audio,B=R==="audio"&&x.id===1&&(N==null?void 0:N.container)==="audio/mpeg",O={execute:function(){if(c.executeStart=self.performance.now(),B){var P=a.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)}}a.appendExecutor(L,R)},onStart:function(){},onComplete:function(){var P=self.performance.now();c.executeEnd=c.end=P,y.first===0&&(y.first=P),v&&v.first===0&&(v.first=P);var b=a.sourceBuffer,Y={};for(var ee in b)Y[ee]=W.BufferHelper.getBuffered(b[ee]);a.appendError=0,a.hls.trigger(F.Events.BUFFER_APPENDED,{type:R,frag:C,part:w,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:(a.appendError++,b.details=G.ErrorDetails.BUFFER_APPEND_ERROR,a.appendError>A.config.appendErrorMaxRetry&&(U.logger.error("[buffer-controller]: Failed "+A.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),b.fatal=!0)),A.trigger(F.Events.ERROR,b)}};_.append(O,R)},f.onBufferFlushing=function(h,s){var a=this,A=this.operationQueue,_=function(L){return{execute:a.removeExecutor.bind(a,L,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){a.hls.trigger(F.Events.BUFFER_FLUSHED,{type:L})},onError:function(C){U.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",C)}}};s.type?A.append(_(s.type),s.type):this.getSourceBufferTypes().forEach(function(S){A.append(_(S),S)})},f.onFragParsed=function(h,s){var a=this,A=s.frag,_=s.part,S=[],L=_?_.elementaryStreams:A.elementaryStreams;L[D.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(L[D.ElementaryStreamTypes.AUDIO]&&S.push("audio"),L[D.ElementaryStreamTypes.VIDEO]&&S.push("video"));var R=function(){var w=self.performance.now();A.stats.buffering.end=w,_&&(_.stats.buffering.end=w);var x=_?_.stats:A.stats;a.hls.trigger(F.Events.FRAG_BUFFERED,{frag:A,part:_,stats:x,id:A.type})};S.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,S)},f.onFragChanged=function(h,s){this.flushBackBuffer()},f.onBufferEos=function(h,s){var a=this,A=this.getSourceBufferTypes().reduce(function(_,S){var L=a.sourceBuffer[S];return(!s.type||s.type===S)&&(L&&!L.ended&&(L.ended=!0,U.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),_&&!!(!L||L.ended)},!0);A&&this.blockBuffers(function(){var _=a.mediaSource;if(!_||_.readyState!=="open")return;_.endOfStream()})},f.onLevelUpdated=function(h,s){var a=s.details;if(!a.fragments.length)return;this.details=a,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},f.flushBackBuffer=function(){var h=this.hls,s=this.details,a=this.media,A=this.sourceBuffer;if(!a||s===null)return;var _=this.getSourceBufferTypes();if(!_.length)return;var S=s.live&&h.config.liveBackBufferLength!==null?h.config.liveBackBufferLength:h.config.backBufferLength;if(!Object(X.isFiniteNumber)(S)||S<0)return;var L=a.currentTime,R=s.levelTargetDuration,C=Math.max(S,R),w=Math.floor(L/R)*R-C;_.forEach(function(x){var c=A[x];if(c){var T=W.BufferHelper.getBuffered(c);T.length>0&&w>T.start(0)&&(h.trigger(F.Events.BACK_BUFFER_REACHED,{bufferEnd:w}),s.live&&h.trigger(F.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:w}),h.trigger(F.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:w,type:x}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var h=this.details,s=this.hls,a=this.media,A=this.mediaSource,_=h.fragments[0].start+h.totalduration,S=a.duration,L=Object(X.isFiniteNumber)(A.duration)?A.duration:0;h.live&&s.config.liveDurationInfinity?(U.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),A.duration=Infinity,this.updateSeekableRange(h)):(_>L&&_>S||!Object(X.isFiniteNumber)(S))&&(U.logger.log("[buffer-controller]: Updating Media Source duration to "+_.toFixed(3)),A.duration=_)},f.updateSeekableRange=function(h){var s=this.mediaSource,a=h.fragments,A=a.length;if(A&&h.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var _=Math.max(0,a[0].start),S=Math.max(_,_+h.totalduration);s.setLiveSeekableRange(_,S)}},f.checkPendingTracks=function(){var h=this.bufferCodecEventsExpected,s=this.operationQueue,a=this.pendingTracks,A=Object.keys(a).length;if(A&&!h||A===2){this.createSourceBuffers(a),this.pendingTracks={};var _=this.getSourceBufferTypes();if(_.length===0){this.hls.trigger(F.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(S){s.executeNext(S)})}},f.createSourceBuffers=function(h){var s=this.sourceBuffer,a=this.mediaSource;if(!a)throw Error("createSourceBuffers called when mediaSource was null");var A=0;for(var _ in h)if(!s[_]){var S=h[_];if(!S)throw Error("source buffer exists for track "+_+", however track does not");var L=S.levelCodec||S.codec,R=S.container+";codecs="+L;U.logger.log("[buffer-controller]: creating sourceBuffer("+R+")");try{var C=s[_]=a.addSourceBuffer(R),w=_;this.addBufferListener(w,"updatestart",this._onSBUpdateStart),this.addBufferListener(w,"updateend",this._onSBUpdateEnd),this.addBufferListener(w,"error",this._onSBUpdateError),this.tracks[_]={buffer:C,codec:L,container:S.container,levelCodec:S.levelCodec,id:S.id},A++}catch(x){U.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+x.message),this.hls.trigger(F.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,mimeType:R})}}A&&this.hls.trigger(F.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(h){var s=this.operationQueue,a=s.current(h);a.onStart()},f._onSBUpdateEnd=function(h){var s=this.operationQueue,a=s.current(h);a.onComplete(),s.shiftAndExecuteNext(h)},f._onSBUpdateError=function(h,s){U.logger.error("[buffer-controller]: "+h+" SourceBuffer error",s),this.hls.trigger(F.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var a=this.operationQueue.current(h);a&&a.onError(s)},f.removeExecutor=function(h,s,a){var A=this.media,_=this.mediaSource,S=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"),S.shiftAndExecuteNext(h);return}var C=Object(X.isFiniteNumber)(A.duration)?A.duration:Infinity,w=Object(X.isFiniteNumber)(_.duration)?_.duration:Infinity,x=Math.max(0,s),c=Math.min(a,C,w);c>x?(U.logger.log("[buffer-controller]: Removing ["+x+","+c+"] from the "+h+" SourceBuffer"),console.assert(!R.updating,h+" sourceBuffer must not be updating"),R.remove(x,c)):S.shiftAndExecuteNext(h)},f.appendExecutor=function(h,s){var a=this.operationQueue,A=this.sourceBuffer,_=A[s];if(!_){U.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),a.shiftAndExecuteNext(s);return}_.ended=!1,console.assert(!_.updating,s+" sourceBuffer must not be updating"),_.appendBuffer(h)},f.blockBuffers=function(h,s){var a=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){U.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(h);return}var A=this.operationQueue,_=s.map(function(S){return A.appendBlocker(S)});Promise.all(_).then(function(){h(),s.forEach(function(S){var L=a.sourceBuffer[S];(!L||!L.updating)&&A.shiftAndExecuteNext(S)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(h,s,a){var A=this.sourceBuffer[h];if(!A)return;var _=a.bind(this,h);this.listeners[h].push({event:s,listener:_}),A.addEventListener(s,_)},f.removeBufferListeners=function(h){var s=this.sourceBuffer[h];if(!s)return;this.listeners[h].forEach(function(a){s.removeEventListener(a.event,a.listener)})},u}()},"./src/controller/buffer-operation-queue.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return F});var X=M("./src/utils/logger.ts"),F=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(p){D=p}),m={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,i),g},G.executeNext=function(i){var D=this.buffers,g=this.queues,m=D[i],p=g[i];if(p.length){var l=p[0];try{l.execute()}catch(u){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),l.onError(u),(!m||!m.updating)&&(p.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(ie,$,M){"use strict";M.r($);var X=M("./src/events.ts");function F(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&&F(W.prototype,i),D&&F(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,m){W.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},i.onMediaAttaching=function(g,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},i.onManifestParsed=function(g,m){var p=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},i.onBufferCodecs=function(g,m){var p=this.hls;p.config.capLevelToPlayerSize&&m.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 m=this.hls;m.autoLevelCapping=this.getMaxLevel(g.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},i.getMaxLevel=function(g){var m=this,p=this.hls.levels;if(!p.length)return-1;var l=p.filter(function(u,f){return W.isLevelAllowed(f,m.restrictedLevels)&&f<=g});return this.clientRect=null,W.getMaxLevelByMediaSize(l,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,m={width:0,height:0};if(g){var p=g.getBoundingClientRect();m.width=p.width,m.height=p.height,!m.width&&!m.height&&(m.width=p.right-p.left||g.width||0,m.height=p.bottom-p.top||g.height||0)}return this.clientRect=m,m},W.isLevelAllowed=function(g,m){return m===void 0&&(m=[]),m.indexOf(g)===-1},W.getMaxLevelByMediaSize=function(g,m,p){if(!g||!g.length)return-1;for(var l=function(s,a){return a?s.width!==a.width||s.height!==a.height:!0},u=g.length-1,f=0;f<g.length;f+=1){var o=g[f];if((o.width>=m||o.height>=p)&&l(o,g[f+1])){u=f;break}}return u},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(m){}return g}}]),W}();$.default=G},"./src/controller/cmcd-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return l});var X=M("./src/events.ts"),F=M("./src/types/cmcd.ts"),U=M("./src/utils/buffer-helper.ts"),G=M("./src/utils/logger.ts");function W(u,f){for(var o=0;o<f.length;o++){var h=f[o];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}function i(u,f,o){return f&&W(u.prototype,f),o&&W(u,o),u}function D(u,f){var o=typeof Symbol!="undefined"&&u[Symbol.iterator]||u["@@iterator"];if(o)return(o=o.call(u)).next.bind(o);if(Array.isArray(u)||(o=g(u))||f&&u&&typeof u.length=="number"){o&&(u=o);var h=0;return function(){return h>=u.length?{done:!0}:{done:!1,value:u[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(u,f){if(!u)return;if(typeof u=="string")return m(u,f);var o=Object.prototype.toString.call(u).slice(8,-1);if(o==="Object"&&u.constructor&&(o=u.constructor.name),o==="Map"||o==="Set")return Array.from(u);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return m(u,f)}function m(u,f){(f==null||f>u.length)&&(f=u.length);for(var o=0,h=new Array(f);o<f;o++)h[o]=u[o];return h}function p(){return p=Object.assign||function(u){for(var f=1;f<arguments.length;f++){var o=arguments[f];for(var h in o)Object.prototype.hasOwnProperty.call(o,h)&&(u[h]=o[h])}return u},p.apply(this,arguments)}var l=function(){function u(o){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:F.CMCDObjectType.MANIFEST,su:!h.initialized})}catch(_){G.logger.warn("Could not generate manifest CMCD data.",_)}},this.applyFragmentData=function(A){try{var _=A.frag,S=h.hls.levels[_.level],L=h.getObjectType(_),R={d:_.duration*1e3,ot:L};(L===F.CMCDObjectType.VIDEO||L===F.CMCDObjectType.AUDIO||L==F.CMCDObjectType.MUXED)&&(R.br=S.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=o;var s=this.config=o.config,a=s.cmcd;a!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=a.sessionId||u.uuid(),this.cid=a.contentId,this.useHeaders=a.useHeaders===!0,this.registerListeners())}var f=u.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,s){this.media=s.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,s){var a,A;this.audioBuffer=(a=s.tracks.audio)===null||a===void 0?void 0:a.buffer,this.videoBuffer=(A=s.tracks.video)===null||A===void 0?void 0:A.buffer},f.createData=function(){var h;return{v:F.CMCDVersion,sf:F.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,s){s===void 0&&(s={}),p(s,this.createData());var a=s.ot===F.CMCDObjectType.INIT||s.ot===F.CMCDObjectType.VIDEO||s.ot===F.CMCDObjectType.MUXED;if(this.starved&&a&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var A=u.toHeaders(s);if(!Object.keys(A).length)return;h.headers||(h.headers={}),p(h.headers,A)}else{var _=u.toQuery(s);if(!_)return;h.url=u.appendQueryToUri(h.url,_)}},f.getObjectType=function(h){var s=h.type;return s==="subtitle"?F.CMCDObjectType.TIMED_TEXT:h.sn==="initSegment"?F.CMCDObjectType.INIT:s==="audio"?F.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?F.CMCDObjectType.VIDEO:F.CMCDObjectType.MUXED:void 0},f.getTopBandwidth=function(h){for(var s=0,a=h===F.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,A=D(a),_;!(_=A()).done;){var S=_.value;S.bitrate>s&&(s=S.bitrate)}return s>0?s:NaN},f.getBufferLength=function(h){var s=this.hls.media,a=h===F.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!a||!s)return NaN;var A=U.BufferHelper.bufferInfo(a,s.currentTime,this.config.maxBufferHole);return A.len*1e3},f.createPlaylistLoader=function(){var h=this.config.pLoader,s=this.applyPlaylistData,a=h||this.config.loader;return function(){function A(S){this.loader=void 0,this.loader=new a(S)}var _=A.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(L,R,C){s(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,s=this.applyFragmentData,a=h||this.config.loader;return function(){function A(S){this.loader=void 0,this.loader=new a(S)}var _=A.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(L,R,C){s(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}()},u.uuid=function(){var h=URL.createObjectURL(new Blob),s=h.toString();return URL.revokeObjectURL(h),s.substr(s.lastIndexOf("/")+1)},u.serialize=function(h){for(var s=[],a=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},S=function(B){return encodeURIComponent(B)},L={br:A,d:A,bl:_,dl:_,mtp:_,nor:S,rtp:_,tb:A},R=Object.keys(h||{}).sort(),C=D(R),w;!(w=C()).done;){var x=w.value,c=h[x];if(!a(c))continue;if(x==="v"&&c===1)continue;if(x=="pr"&&c===1)continue;var T=L[x];T&&(c=T(c));var y=typeof c,v=void 0;x==="ot"||x==="sf"||x==="st"?v=x+"="+c:y==="boolean"?v=x:y==="number"?v=x+"="+c:v=x+"="+JSON.stringify(c),s.push(v)}return s.join(",")},u.toHeaders=function(h){for(var s=Object.keys(h),a={},A=["Object","Request","Session","Status"],_=[{},{},{},{}],S={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=s;L<R.length;L++){var C=R[L],w=S[C]!=null?S[C]:1;_[w][C]=h[C]}for(var x=0;x<_.length;x++){var c=u.serialize(_[x]);c&&(a["CMCD-"+A[x]]=c)}return a},u.toQuery=function(h){return"CMCD="+encodeURIComponent(u.serialize(h))},u.appendQueryToUri=function(h,s){if(!s)return h;var a=h.includes("?")?"&":"?";return""+h+a+s},u}()},"./src/controller/eme-controller.ts":function(ie,$,M){"use strict";M.r($);var X=M("./src/events.ts"),F=M("./src/errors.ts"),U=M("./src/utils/logger.ts"),G=M("./src/utils/mediakeys-helper.ts");function W(l,u){for(var f=0;f<u.length;f++){var o=u[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function i(l,u,f){return u&&W(l.prototype,u),f&&W(l,f),l}var D=3,g=function(u,f,o){var h={audioCapabilities:[],videoCapabilities:[]};return u.forEach(function(s){h.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:o.audioRobustness||""})}),f.forEach(function(s){h.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:o.videoRobustness||""})}),[h]},m=function(u,f,o,h){switch(u){case G.KeySystems.WIDEVINE:return g(f,o,h);default:throw new Error("Unknown key-system: "+u)}},p=function(){function l(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 u=l.prototype;return u.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},u._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)},u._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)},u.getLicenseServerUrl=function(o){switch(o){case G.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+o+'"')},u._attemptKeySystemAccess=function(o,h,s){var a=this,A=m(o,h,s,this._drmSystemOptions);U.logger.log("Requesting encrypted media key-system access");var _=this.requestMediaKeySystemAccess(o,A);this.mediaKeysPromise=_.then(function(S){return a._onMediaKeySystemAccessObtained(o,S)}),_.catch(function(S){U.logger.error('Failed to obtain key-system "'+o+'" access:',S)})},u._onMediaKeySystemAccessObtained=function(o,h){var s=this;U.logger.log('Access for key-system "'+o+'" obtained');var a={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:h,mediaKeySystemDomain:o};this._mediaKeysList.push(a);var A=Promise.resolve().then(function(){return h.createMediaKeys()}).then(function(_){return a.mediaKeys=_,U.logger.log('Media-keys created for key-system "'+o+'"'),s._onMediaKeysCreated(),_});return A.catch(function(_){U.logger.error("Failed to create media-keys:",_)}),A},u._onMediaKeysCreated=function(){var o=this;this._mediaKeysList.forEach(function(h){h.mediaKeysSession||(h.mediaKeysSession=h.mediaKeys.createSession(),o._onNewMediaKeySession(h.mediaKeysSession))})},u._onNewMediaKeySession=function(o){var h=this;U.logger.log("New key-system session "+o.sessionId),o.addEventListener("message",function(s){h._onKeySessionMessage(o,s.message)},!1)},u._onKeySessionMessage=function(o,h){U.logger.log("Got EME message event, creating license request"),this._requestLicense(h,function(s){U.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),o.update(s)})},u.onMediaEncrypted=function(o){var h=this;if(U.logger.log('Media is encrypted using "'+o.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:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(A){if(!h._media)return;h._attemptSetMediaKeys(A),h._generateRequestWithPreferredKeySession(o.initDataType,o.initData)};this.mediaKeysPromise.then(s).catch(s)},u._attemptSetMediaKeys=function(o){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:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}U.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(h.mediaKeys),this._hasSetMediaKeys=!0}},u._generateRequestWithPreferredKeySession=function(o,h){var s=this,a=this._mediaKeysList[0];if(!a){U.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(a.mediaKeysSessionInitialized){U.logger.warn("Key-Session already initialized but requested again");return}var A=a.mediaKeysSession;if(!A){U.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.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:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}U.logger.log('Generating key-session request for "'+o+'" init data type'),a.mediaKeysSessionInitialized=!0,A.generateRequest(o,h).then(function(){U.logger.debug("Key-session generation succeeded")}).catch(function(_){U.logger.error("Error generating key-session request:",_),s.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},u._createLicenseXhr=function(o,h,s){var a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,a,o,h,s);var A=this._licenseXhrSetup;if(A)try{A.call(this.hls,a,o),A=void 0}catch(_){U.logger.error(_)}try{a.readyState||a.open("POST",o,!0),A&&A.call(this.hls,a,o)}catch(_){throw new Error("issue setting up KeySystem license XHR "+_)}return a},u._onLicenseRequestReadyStageChange=function(o,h,s,a){switch(o.readyState){case 4:if(o.status===200){this._requestLicenseFailureCount=0,U.logger.log("License request succeeded");var A=o.response,_=this._licenseResponseCallback;if(_)try{A=_.call(this.hls,o,h)}catch(L){U.logger.error(L)}a(A)}else{if(U.logger.error("License Request XHR failed ("+h+"). Status: "+o.status+" ("+o.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=D-this._requestLicenseFailureCount+1;U.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(s,a)}break}},u._generateLicenseRequestChallenge=function(o,h){switch(o.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return h}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},u._requestLicense=function(o,h){U.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){U.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var a=this.getLicenseServerUrl(s.mediaKeySystemDomain),A=this._createLicenseXhr(a,o,h);U.logger.log("Sending license request to URL: "+a);var _=this._generateLicenseRequestChallenge(s,o);A.send(_)}catch(S){U.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},u.onMediaAttached=function(o,h){if(!this._emeEnabled)return;var s=h.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},u.onMediaDetached=function(){var o=this._media,h=this._mediaKeysList;if(!o)return;o.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(h.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return o.setMediaKeys(null)}).catch(function(){})},u.onManifestParsed=function(o,h){if(!this._emeEnabled)return;var s=h.levels.map(function(A){return A.audioCodec}).filter(function(A){return!!A}),a=h.levels.map(function(A){return A.videoCodec}).filter(function(A){return!!A});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,s,a)},i(l,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),l}();$.default=p},"./src/controller/fps-controller.ts":function(ie,$,M){"use strict";M.r($);var X=M("./src/events.ts"),F=M("./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 m=this.hls.config;if(m.capLevelOnFPSDrop){var p=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},W.checkFPS=function(D,g,m){var p=performance.now();if(g){if(this.lastTime){var l=p-this.lastTime,u=m-this.lastDroppedFrames,f=g-this.lastDecodedFrames,o=1e3*u/l,h=this.hls;if(h.trigger(X.Events.FPS_DROP,{currentDropped:u,currentDecoded:f,totalDroppedFrames:m}),o>0&&u>h.config.fpsDroppedMonitoringThreshold*f){var s=h.currentLevel;F.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(h.autoLevelCapping===-1||h.autoLevelCapping>=s)&&(s=s-1,h.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:h.currentLevel}),h.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=m,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(ie,$,M){"use strict";M.r($),M.d($,"findFragmentByPDT",function(){return U}),M.d($,"findFragmentByPTS",function(){return G}),M.d($,"fragmentWithinToleranceTest",function(){return W}),M.d($,"pdtWithinToleranceTest",function(){return i}),M.d($,"findFragWithCC",function(){return D});var X=M("./src/polyfills/number.ts"),F=M("./src/utils/binary-search.ts");function U(g,m,p){if(m===null||!Array.isArray(g)||!g.length||!Object(X.isFiniteNumber)(m))return null;var l=g[0].programDateTime;if(m<(l||0))return null;var u=g[g.length-1].endProgramDateTime;if(m>=(u||0))return null;p=p||0;for(var f=0;f<g.length;++f){var o=g[f];if(i(m,p,o))return o}return null}function G(g,m,p,l){p===void 0&&(p=0),l===void 0&&(l=0);var u=null;if(g?u=m[g.sn-m[0].sn+1]||null:p===0&&m[0].start===0&&(u=m[0]),u&&W(p,l,u)===0)return u;var f=F.default.search(m,W.bind(null,p,l));return f||u}function W(g,m,p){g===void 0&&(g=0),m===void 0&&(m=0);var l=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-l<=g?1:p.start-l>g&&p.start?-1:0}function i(g,m,p){var l=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,u=p.endProgramDateTime||0;return u-l>g}function D(g,m){return F.default.search(g,function(p){return p.cc<m?1:p.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(ie,$,M){"use strict";M.r($),M.d($,"FragmentState",function(){return U}),M.d($,"FragmentTracker",function(){return G});var X=M("./src/events.ts"),F=M("./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(m){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=m,this._registerListeners()}var g=D.prototype;return g._registerListeners=function(){var p=this.hls;p.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var p=this.hls;p.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(p,l){if(l===F.PlaylistLevelType.MAIN){var u=this.activeFragment,f=this.activeParts;if(!u)return null;if(f)for(var o=f.length;o--;){var h=f[o],s=h?h.end:u.appendedPTS;if(h.start<=p&&s!==void 0&&p<=s)return o>9&&(this.activeParts=f.slice(o-9)),h}else if(u.start<=p&&u.appendedPTS!==void 0&&p<=u.appendedPTS)return u}return this.getBufferedFrag(p,l)},g.getBufferedFrag=function(p,l){for(var u=this.fragments,f=Object.keys(u),o=f.length;o--;){var h=u[f[o]];if((h==null?void 0:h.body.type)===l&&h.buffered){var s=h.body;if(s.start<=p&&p<=s.end)return s}}return null},g.detectEvictedFragments=function(p,l,u){var f=this;Object.keys(this.fragments).forEach(function(o){var h=f.fragments[o];if(!h)return;if(!h.buffered){h.body.type===u&&f.removeFragment(h.body);return}var s=h.range[p];if(!s)return;s.time.some(function(a){var A=!f.isTimeBuffered(a.startPTS,a.endPTS,l);return A&&f.removeFragment(h.body),A})})},g.detectPartialFragments=function(p){var l=this,u=this.timeRanges,f=p.frag,o=p.part;if(!u||f.sn==="initSegment")return;var h=i(f),s=this.fragments[h];if(!s)return;Object.keys(u).forEach(function(a){var A=f.elementaryStreams[a];if(!A)return;var _=u[a],S=o!==null||A.partial===!0;s.range[a]=l.getBufferedTimes(f,o,S,_)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},g.fragBuffered=function(p){var l=i(p),u=this.fragments[l];u&&(u.backtrack=u.loaded=null,u.buffered=!0)},g.getBufferedTimes=function(p,l,u,f){for(var o={time:[],partial:u},h=l?l.start:p.start,s=l?l.end:p.end,a=p.minEndPTS||s,A=p.maxStartPTS||h,_=0;_<f.length;_++){var S=f.start(_)-this.bufferPadding,L=f.end(_)+this.bufferPadding;if(A>=S&&a<=L){o.time.push({startPTS:Math.max(h,f.start(_)),endPTS:Math.min(s,f.end(_))});break}else if(h<L&&s>S)o.partial=!0,o.time.push({startPTS:Math.max(h,f.start(_)),endPTS:Math.min(s,f.end(_))});else if(s<=S)break}return o},g.getPartialFragment=function(p){var l=null,u,f,o,h=0,s=this.bufferPadding,a=this.fragments;return Object.keys(a).forEach(function(A){var _=a[A];if(!_)return;W(_)&&(f=_.body.start-s,o=_.body.end+s,p>=f&&p<=o&&(u=Math.min(p-f,o-p),h<=u&&(l=_.body,h=u)))}),l},g.getState=function(p){var l=i(p),u=this.fragments[l];return u?u.buffered?W(u)?U.PARTIAL:U.OK:u.backtrack?U.BACKTRACKED:U.APPENDING:U.NOT_LOADED},g.backtrack=function(p,l){var u=i(p),f=this.fragments[u];if(!f||f.backtrack)return null;var o=f.backtrack=l||f.loaded;return f.loaded=null,o},g.getBacktrackData=function(p){var l=i(p),u=this.fragments[l];if(u){var f,o=u.backtrack;if(o!=null&&(f=o.payload)!==null&&f!==void 0&&f.byteLength)return o;this.removeFragment(p)}return null},g.isTimeBuffered=function(p,l,u){for(var f,o,h=0;h<u.length;h++){if(f=u.start(h)-this.bufferPadding,o=u.end(h)+this.bufferPadding,p>=f&&l<=o)return!0;if(l<=f)return!1}return!1},g.onFragLoaded=function(p,l){var u=l.frag,f=l.part;if(u.sn==="initSegment"||u.bitrateTest||f)return;var o=i(u);this.fragments[o]={body:u,loaded:l,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(p,l){var u=this,f=l.frag,o=l.part,h=l.timeRanges;if(f.type===F.PlaylistLevelType.MAIN)if(this.activeFragment=f,o){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(o)}else this.activeParts=null;this.timeRanges=h,Object.keys(h).forEach(function(a){var A=h[a];if(u.detectEvictedFragments(a,A),!o)for(var _=0;_<A.length;_++)f.appendedPTS=Math.max(A.end(_),f.appendedPTS||0)})},g.onFragBuffered=function(p,l){this.detectPartialFragments(l)},g.hasFragment=function(p){var l=i(p);return!!this.fragments[l]},g.removeFragmentsInRange=function(p,l,u){var f=this;Object.keys(this.fragments).forEach(function(o){var h=f.fragments[o];if(!h)return;if(h.buffered){var s=h.body;s.type===u&&s.start<l&&s.end>p&&f.removeFragment(s)}})},g.removeFragment=function(p){var l=i(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[l]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function W(D){var g,m;return D.buffered&&(((g=D.range.video)===null||g===void 0?void 0:g.partial)||((m=D.range.audio)===null||m===void 0?void 0:m.partial))}function i(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"STALL_MINIMUM_DURATION_MS",function(){return W}),M.d($,"MAX_START_GAP_JUMP",function(){return i}),M.d($,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),M.d($,"SKIP_BUFFER_RANGE_START",function(){return g}),M.d($,"default",function(){return m});var X=M("./src/utils/buffer-helper.ts"),F=M("./src/errors.ts"),U=M("./src/events.ts"),G=M("./src/utils/logger.ts"),W=250,i=2,D=.1,g=.05,m=function(){function p(u,f,o,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=u,this.media=f,this.fragmentTracker=o,this.hls=h}var l=p.prototype;return l.destroy=function(){this.hls=this.fragmentTracker=this.media=null},l.poll=function(f){var o=this.config,h=this.media,s=this.stalled,a=h.currentTime,A=h.seeking,_=this.seeking&&!A,S=!this.seeking&&A;if(this.seeking=A,a!==f){if(this.moved=!0,s!==null){if(this.stallReported){var L=self.performance.now()-s;G.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||_)&&(this.stalled=null),h.paused||h.ended||h.playbackRate===0||!X.BufferHelper.getBuffered(h).length)return;var R=X.BufferHelper.bufferInfo(h,a,0),C=R.len>0,w=R.nextStart||0;if(!C&&!w)return;if(A){var x=R.len>i,c=!w||w-a>i&&!this.fragmentTracker.getPartialFragment(a);if(x||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var T,y=Math.max(w,R.start||0)-a,v=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=v==null||((T=v.details)===null||T===void 0)?void 0:T.live,B=N?v.details.targetduration*2:i;if(y>0&&y<=B){this._trySkipBufferHole(null);return}}var O=self.performance.now();if(s===null){this.stalled=O;return}var j=O-s;!A&&j>=W&&this._reportStall(R.len);var P=X.BufferHelper.bufferInfo(h,a,o.maxBufferHole);this._tryFixBufferStall(P,j)},l._tryFixBufferStall=function(f,o){var h=this.config,s=this.fragmentTracker,a=this.media,A=a.currentTime,_=s.getPartialFragment(A);if(_){var S=this._trySkipBufferHole(_);if(S)return}f.len>h.maxBufferHole&&o>h.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},l._reportStall=function(f){var o=this.hls,h=this.media,s=this.stallReported;s||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+h.currentTime+" due to low buffer (buffer="+f+")"),o.trigger(U.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},l._trySkipBufferHole=function(f){for(var o=this.config,h=this.hls,s=this.media,a=s.currentTime,A=0,_=X.BufferHelper.getBuffered(s),S=0;S<_.length;S++){var L=_.start(S);if(a+o.maxBufferHole>=A&&a<L){var R=Math.max(L+g,s.currentTime+D);return G.logger.warn("skipping hole, adjusting currentTime from "+a+" to "+R),this.moved=!0,this.stalled=null,s.currentTime=R,f&&h.trigger(U.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+a+" to "+R,frag:f}),R}A=_.end(S)}return 0},l._tryNudgeBuffer=function(){var f=this.config,o=this.hls,h=this.media,s=h.currentTime,a=(this.nudgeRetry||0)+1;if(this.nudgeRetry=a,a<f.nudgeMaxRetry){var A=s+a*f.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+s+" to "+A),h.currentTime=A,o.trigger(U.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else G.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+f.nudgeMaxRetry+" nudges"),o.trigger(U.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(ie,$,M){"use strict";M.r($);var X=M("./src/events.ts"),F=M("./src/utils/texttrack-utils.ts"),U=M("./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 m=this.hls;m.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var m=this.hls;m.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(m,p){this.media=p.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(F.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(m){if(!this.media)return;for(var p=0;p<m.length;p++){var l=m[p];if(l.kind==="metadata"&&l.label==="id3")return Object(F.sendAddTrackEvent)(l,this.media),l}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(m,p){if(!this.media)return;var l=p.frag,u=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var f=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<u.length;o++){var h=U.getID3Frames(u[o].data);if(h){var s=u[o].pts,a=o<u.length-1?u[o+1].pts:l.end,A=a-s;A<=0&&(a=s+G);for(var _=0;_<h.length;_++){var S=h[_];if(!U.isTimeStampFrame(S)){var L=new f(s,a,"");L.value=S,this.id3Track.addCue(L)}}}}},D.onBufferFlushing=function(m,p){var l=p.startOffset,u=p.endOffset,f=p.type;if(!f||f==="audio"){var o=this.id3Track;o&&Object(F.removeCuesInRange)(o,l,u)}},i}();$.default=W},"./src/controller/latency-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return i});var X=M("./src/errors.ts"),F=M("./src/events.ts"),U=M("./src/utils/logger.ts");function G(D,g){for(var m=0;m<g.length;m++){var p=g[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(D,p.key,p)}}function W(D,g,m){return g&&G(D.prototype,g),m&&G(D,m),D}var i=function(){function D(m){var p=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 p.timeupdate()},this.hls=m,this.config=m.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(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(F.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(F.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(F.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(F.Events.ERROR,this.onError)},g.onMediaAttached=function(p,l){this.media=l.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(p,l){var u=l.details;this.levelDetails=u,u.advanced&&this.timeupdate(),!u.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(p,l){if(l.details!==X.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,U.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var p=this.media,l=this.levelDetails;if(!p||!l)return;this.currentTime=p.currentTime;var u=this.computeLatency();if(u===null)return;this._latency=u;var f=this.config,o=f.lowLatencyMode,h=f.maxLiveSyncPlaybackRate;if(!o||h===1)return;var s=this.targetLatency;if(s===null)return;var a=u-s,A=Math.min(this.maxLatency,s+l.targetduration),_=a<A;if(l.live&&_&&a>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,h)),L=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;p.playbackRate=Math.min(S,Math.max(1,L))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},g.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},g.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},W(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,l=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:l?p.liveMaxLatencyDurationCount*l.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var l=p.holdBack,u=p.partHoldBack,f=p.targetduration,o=this.config,h=o.liveSyncDuration,s=o.liveSyncDurationCount,a=o.lowLatencyMode,A=this.hls.userConfig,_=a&&u||l;(A.liveSyncDuration||A.liveSyncDurationCount||_===0)&&(_=h!==void 0?h:s*f);var S=f,L=1;return _+Math.min(this.stallCount*L,S)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),l=this.targetLatency,u=this.levelDetails;if(p===null||l===null||u===null)return null;var f=u.edge,o=p-l-this.edgeStalled,h=f-u.totalduration,s=f-(this.config.lowLatencyMode&&u.partTarget||u.targetduration);return Math.min(Math.max(h,o),s)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var l=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-l,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,l=this.levelDetails;if(!p||!l)return 0;var u=p.buffered.length;return u?p.buffered.end(u-1):l.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return o});var X=M("./src/types/level.ts"),F=M("./src/events.ts"),U=M("./src/errors.ts"),G=M("./src/utils/codecs.ts"),W=M("./src/controller/level-helper.ts"),i=M("./src/controller/base-playlist-controller.ts"),D=M("./src/types/loader.ts");function g(){return g=Object.assign||function(h){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var A in a)Object.prototype.hasOwnProperty.call(a,A)&&(h[A]=a[A])}return h},g.apply(this,arguments)}function m(h,s){for(var a=0;a<s.length;a++){var A=s[a];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}function p(h,s,a){return s&&m(h.prototype,s),a&&m(h,a),h}function l(h,s){h.prototype=Object.create(s.prototype),h.prototype.constructor=h,u(h,s)}function u(h,s){return u=Object.setPrototypeOf||function(A,_){return A.__proto__=_,A},u(h,s)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),o=function(h){l(s,h);function s(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 a=s.prototype;return a._registerListeners=function(){var _=this.hls;_.on(F.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on(F.Events.FRAG_LOADED,this.onFragLoaded,this),_.on(F.Events.ERROR,this.onError,this)},a._unregisterListeners=function(){var _=this.hls;_.off(F.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off(F.Events.FRAG_LOADED,this.onFragLoaded,this),_.off(F.Events.ERROR,this.onError,this)},a.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,h.prototype.destroy.call(this)},a.startLoad=function(){var _=this._levels;_.forEach(function(S){S.loadError=0}),h.prototype.startLoad.call(this)},a.onManifestLoaded=function(_,S){var L=[],R=[],C=[],w,x={},c,T=!1,y=!1,v=!1;if(S.levels.forEach(function(j){var P=j.attrs;T=T||!!(j.width&&j.height),y=y||!!j.videoCodec,v=v||!!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;c=x[b],c?c.url.push(j.url):(c=new X.Level(j),x[b]=c,L.push(c)),P&&(P.AUDIO&&Object(W.addGroupId)(c,"audio",P.AUDIO),P.SUBTITLES&&Object(W.addGroupId)(c,"text",P.SUBTITLES))}),(T||y)&&v&&(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"))}),S.audioTracks&&(R=S.audioTracks.filter(function(j){return!j.audioCodec||Object(G.isCodecSupportedInMp4)(j.audioCodec,"audio")}),Object(W.assignTrackIdsByGroup)(R)),S.subtitles&&(C=S.subtitles,Object(W.assignTrackIdsByGroup)(C)),L.length>0){w=L[0].bitrate,L.sort(function(j,P){return j.bitrate-P.bitrate}),this._levels=L;for(var N=0;N<L.length;N++)if(L[N].bitrate===w){this._firstLevel=N,this.log("manifest loaded, "+L.length+" level(s) found, first bitrate: "+w);break}var B=v&&!y,O={levels:L,audioTracks:R,subtitleTracks:C,firstLevel:this._firstLevel,stats:S.stats,audio:v,video:y,altAudio:!B&&R.some(function(j){return!!j.url})};this.hls.trigger(F.Events.MANIFEST_PARSED,O),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(F.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},a.onError=function(_,S){if(h.prototype.onError.call(this,_,S),S.fatal)return;var L=S.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,w=!0,x;switch(S.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(S.frag){var c=this._levels[S.frag.level];c?(c.fragmentError++,c.fragmentError>this.hls.config.fragLoadingMaxRetry&&(x=S.frag.level)):x=S.frag.level}break;case U.ErrorDetails.LEVEL_LOAD_ERROR:case U.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(w=!1),x=L.level),C=!0;break;case U.ErrorDetails.REMUX_ALLOC_ERROR:x=S.level,C=!0;break}x!==void 0&&this.recoverLevel(S,x,C,w)},a.recoverLevel=function(_,S,L,R){var C=_.details,w=this._levels[S];if(w.loadError++,L){var x=this.retryLoadingOrFail(_);if(x)_.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(R){var c=w.url.length;if(c>1&&w.loadError<c)_.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var T=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==T&&this._levels[T].loadError===0&&(this.warn(C+": switch to "+T),_.levelRetry=!0,this.hls.nextAutoLevel=T)}}},a.redundantFailover=function(_){var S=this._levels[_],L=S.url.length;if(L>1){var R=(S.urlId+1)%L;this.warn("Switching to redundant URL-id "+R),this._levels.forEach(function(C){C.urlId=R}),this.level=_}},a.onFragLoaded=function(_,S){var L=S.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)}},a.onLevelLoaded=function(_,S){var L,R=S.level,C=S.details,w=this._levels[R];if(!w){var x;this.warn("Invalid level index "+R),(x=S.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(C.deltaUpdateFailed=!0);return}R===this.currentLevelIndex?(w.fragmentError===0&&(w.loadError=0,this.retryCount=0),this.playlistLoaded(R,S,w.details)):(L=S.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(C.deltaUpdateFailed=!0)},a.onAudioTrackSwitched=function(_,S){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var R=-1,C=this.hls.audioTracks[S.id].groupId,w=0;w<L.audioGroupIds.length;w++)if(L.audioGroupIds[w]===C){R=w;break}R!==L.urlId&&(L.urlId=R,this.startLoad())}},a.loadPlaylist=function(_){var S=this.currentLevelIndex,L=this._levels[S];if(this.canLoad&&L&&L.url.length>0){var R=L.urlId,C=L.url[R];if(_)try{C=_.addDirectives(C)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("Attempt loading level index "+S+(_?" at sn "+_.msn+" part "+_.part:"")+" with URL-id "+R+" "+C),this.clearTimer(),this.hls.trigger(F.Events.LEVEL_LOADING,{url:C,level:S,id:R,deliveryDirectives:_||null})}},a.removeLevel=function(_,S){var L=function(w,x){return x!==S},R=this._levels.filter(function(C,w){return w!==_?!0:C.url.length>1&&S!==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,w){var x=C.details;return x!=null&&x.fragments&&x.fragments.forEach(function(c){c.level=w}),C});this._levels=R,this.hls.trigger(F.Events.LEVELS_UPDATED,{levels:R})},p(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(_){var S,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===_&&(S=L[_])!==null&&S!==void 0&&S.details)return;if(_<0||_>=L.length){var R=_<0;if(this.hls.trigger(F.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,w=L[C],x=L[_];this.log("switching to level "+_+" from "+C),this.currentLevelIndex=_;var c=g({},x,{level:_,maxBitrate:x.maxBitrate,uri:x.uri,urlId:x.urlId});delete c._urlId,this.hls.trigger(F.Events.LEVEL_SWITCHING,c);var T=x.details;if(!T||T.live){var y=this.switchParams(x.uri,w==null?void 0:w.details);this.loadPlaylist(y)}}},{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=_)}}]),s}(i.default)},"./src/controller/level-helper.ts":function(ie,$,M){"use strict";M.r($),M.d($,"addGroupId",function(){return U}),M.d($,"assignTrackIdsByGroup",function(){return G}),M.d($,"updatePTS",function(){return W}),M.d($,"updateFragPTSDTS",function(){return D}),M.d($,"mergeDetails",function(){return g}),M.d($,"mapPartIntersection",function(){return m}),M.d($,"mapFragmentIntersection",function(){return p}),M.d($,"adjustSliding",function(){return l}),M.d($,"addSliding",function(){return u}),M.d($,"computeReloadInterval",function(){return f}),M.d($,"getFragmentWithSN",function(){return o}),M.d($,"getPartWith",function(){return h});var X=M("./src/polyfills/number.ts"),F=M("./src/utils/logger.ts");function U(s,a,A){switch(a){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(A);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(A);break}}function G(s){var a={};s.forEach(function(A){var _=A.groupId||"";A.id=a[_]=a[_]||0,a[_]++})}function W(s,a,A){var _=s[a],S=s[A];i(_,S)}function i(s,a){var A=a.startPTS;if(Object(X.isFiniteNumber)(A)){var _=0,S;a.sn>s.sn?(_=A-s.start,S=s):(_=s.start-A,S=a),S.duration!==_&&(S.duration=_)}else if(a.sn>s.sn){var L=s.cc===a.cc;L&&s.minEndPTS?a.start=s.start+(s.minEndPTS-s.start):a.start=s.start+s.duration}else a.start=Math.max(s.start-a.duration,0)}function D(s,a,A,_,S,L){var R=_-A;R<=0&&(F.logger.warn("Fragment should have a positive duration",a),_=A+a.duration,L=S+a.duration);var C=A,w=_,x=a.startPTS,c=a.endPTS;if(Object(X.isFiniteNumber)(x)){var T=Math.abs(x-A);Object(X.isFiniteNumber)(a.deltaPTS)?a.deltaPTS=Math.max(T,a.deltaPTS):a.deltaPTS=T,C=Math.max(A,x),A=Math.min(A,x),S=Math.min(S,a.startDTS),w=Math.min(_,c),_=Math.max(_,c),L=Math.max(L,a.endDTS)}a.duration=_-A;var y=A-a.start;a.appendedPTS=_,a.start=a.startPTS=A,a.maxStartPTS=C,a.startDTS=S,a.endPTS=_,a.minEndPTS=w,a.endDTS=L;var v=a.sn;if(!s||v<s.startSN||v>s.endSN)return 0;var N,B=v-s.startSN,O=s.fragments;for(O[B]=a,N=B;N>0;N--)i(O[N],O[N-1]);for(N=B;N<O.length-1;N++)i(O[N],O[N+1]);return s.fragmentHint&&i(O[O.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,y}function g(s,a){for(var A=null,_=s.fragments,S=_.length-1;S>=0;S--){var L=_[S].initSegment;if(L){A=L;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var R=0,C;if(p(s,a,function(N,B){N.relurl&&(R=N.cc-B.cc),Object(X.isFiniteNumber)(N.startPTS)&&Object(X.isFiniteNumber)(N.endPTS)&&(B.start=B.startPTS=N.startPTS,B.startDTS=N.startDTS,B.appendedPTS=N.appendedPTS,B.maxStartPTS=N.maxStartPTS,B.endPTS=N.endPTS,B.endDTS=N.endDTS,B.minEndPTS=N.minEndPTS,B.duration=N.endPTS-N.startPTS,B.duration&&(C=B),a.PTSKnown=a.alignedSliding=!0),B.elementaryStreams=N.elementaryStreams,B.loader=N.loader,B.stats=N.stats,B.urlId=N.urlId,N.initSegment&&(B.initSegment=N.initSegment,A=N.initSegment)}),A){var w=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;w.forEach(function(N){var B;(!N.initSegment||N.initSegment.relurl===((B=A)===null||B===void 0?void 0:B.relurl))&&(N.initSegment=A)})}if(a.skippedSegments&&(a.deltaUpdateFailed=a.fragments.some(function(N){return!N}),a.deltaUpdateFailed)){F.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var x=a.skippedSegments;x--;)a.fragments.shift();a.startSN=a.fragments[0].sn,a.startCC=a.fragments[0].cc}var c=a.fragments;if(R){F.logger.warn("discontinuity sliding from playlist, take drift into account");for(var T=0;T<c.length;T++)c[T].cc+=R}a.skippedSegments&&(a.startCC=a.fragments[0].cc),m(s.partList,a.partList,function(N,B){B.elementaryStreams=N.elementaryStreams,B.stats=N.stats}),C?D(a,C,C.startPTS,C.endPTS,C.startDTS,C.endDTS):l(s,a),c.length&&(a.totalduration=a.edge-c[0].start),a.driftStartTime=s.driftStartTime,a.driftStart=s.driftStart;var y=a.advancedDateTime;if(a.advanced&&y){var v=a.edge;a.driftStart||(a.driftStartTime=y,a.driftStart=v),a.driftEndTime=y,a.driftEnd=v}else a.driftEndTime=s.driftEndTime,a.driftEnd=s.driftEnd,a.advancedDateTime=s.advancedDateTime}function m(s,a,A){if(s&&a)for(var _=0,S=0,L=s.length;S<=L;S++){var R=s[S],C=a[S+_];R&&C&&R.index===C.index&&R.fragment.sn===C.fragment.sn?A(R,C):_--}}function p(s,a,A){for(var _=a.skippedSegments,S=Math.max(s.startSN,a.startSN)-a.startSN,L=(s.fragmentHint?1:0)+(_?a.endSN:Math.min(s.endSN,a.endSN))-a.startSN,R=a.startSN-s.startSN,C=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,w=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,x=S;x<=L;x++){var c=w[R+x],T=C[x];_&&!T&&x<_&&(T=a.fragments[x]=c),c&&T&&A(c,T)}}function l(s,a){var A=a.startSN+a.skippedSegments-s.startSN,_=s.fragments;if(A<0||A>=_.length)return;u(a,_[A].start)}function u(s,a){if(a){for(var A=s.fragments,_=s.skippedSegments;_<A.length;_++)A[_].start+=a;s.fragmentHint&&(s.fragmentHint.start+=a)}}function f(s,a){var A=1e3*s.levelTargetDuration,_=A/2,S=s.age,L=S>0&&S<A*3,R=a.loading.end-a.loading.start,C,w=s.availabilityDelay;if(s.updated===!1)if(L){var x=333*s.misses;C=Math.max(Math.min(_,R*2),x),s.availabilityDelay=(s.availabilityDelay||0)+C}else C=_;else L?(w=Math.min(w||A/2,S),s.availabilityDelay=w,C=w+A-S):C=A-R;return Math.round(C)}function o(s,a,A){if(!s||!s.details)return null;var _=s.details,S=_.fragments[a-_.startSN];return S||(S=_.fragmentHint,S&&S.sn===a?S:a<_.startSN&&A&&A.sn===a?A:null)}function h(s,a,A){if(!s||!s.details)return null;var _=s.details.partList;if(_)for(var S=_.length;S--;){var L=_[S];if(L.index===A&&L.fragment.sn===a)return L}return null}},"./src/controller/stream-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return _});var X=M("./src/polyfills/number.ts"),F=M("./src/controller/base-stream-controller.ts"),U=M("./src/is-supported.ts"),G=M("./src/events.ts"),W=M("./src/utils/buffer-helper.ts"),i=M("./src/controller/fragment-tracker.ts"),D=M("./src/types/loader.ts"),g=M("./src/loader/fragment.ts"),m=M("./src/demux/transmuxer-interface.ts"),p=M("./src/types/transmuxer.ts"),l=M("./src/controller/gap-controller.ts"),u=M("./src/errors.ts"),f=M("./src/utils/logger.ts");function o(S,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(S,C.key,C)}}function h(S,L,R){return L&&o(S.prototype,L),R&&o(S,R),S}function s(S,L){S.prototype=Object.create(L.prototype),S.prototype.constructor=S,a(S,L)}function a(S,L){return a=Object.setPrototypeOf||function(C,w){return C.__proto__=w,C},a(S,L)}var A=100,_=function(S){s(L,S);function L(C,w){var x;return x=S.call(this,C,w,"[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 w=this.hls;w.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),w.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),w.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),w.on(G.Events.ERROR,this.onError,this),w.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),w.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),w.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),w.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),w.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R._unregisterListeners=function(){var w=this.hls;w.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),w.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),w.off(G.Events.ERROR,this.onError,this),w.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),w.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),w.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),w.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),w.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},R.startLoad=function(w){if(this.levels){var x=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(A),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var T=c.startLevel;T===-1&&(c.config.testBandwidth?(T=0,this.bitrateTest=!0):T=c.nextAutoLevel),this.level=c.nextLoadLevel=T,this.loadedmetadata=!1}x>0&&w===-1&&(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),w=x),this.state=F.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=w,this.tick()}else this._forceStartLoad=!0,this.state=F.State.STOPPED},R.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},R.doTick=function(){switch(this.state){case F.State.IDLE:this.doTickIdle();break;case F.State.WAITING_LEVEL:{var w,x=this.levels,c=this.level,T=x==null||((w=x[c])===null||w===void 0)?void 0:w.details;if(T&&(!T.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(T))break;this.state=F.State.IDLE;break}break}case F.State.FRAG_LOADING_WAITING_RETRY:{var y,v=self.performance.now(),N=this.retryDate;(!N||v>=N||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=F.State.IDLE)}break;default:break}this.onTickEnd()},R.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},R.doTickIdle=function(){var w,x,c=this.hls,T=this.levelLastLoaded,y=this.levels,v=this.media,N=c.config,B=c.nextLoadLevel;if(T===null||!v&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[B])return;var O=y[B];this.level=c.nextLoadLevel=B;var j=O.details;if(!j||this.state===F.State.WAITING_LEVEL||j.live&&this.levelLastLoaded!==B){this.state=F.State.WAITING_LEVEL;return}var P=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:v,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=F.State.ENDED;return}var le=P.end,ue=this.getNextFragment(le,j);if(this.couldBacktrack&&!this.fragPrevious&&ue&&ue.sn!=="initSegment"){var ke=ue.sn-j.startSN;ke>1&&(ue=j.fragments[ke-1],this.fragmentTracker.removeFragment(ue))}if(ue&&this.fragmentTracker.getState(ue)===i.FragmentState.OK&&this.nextLoadPosition>le){var we=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(v,we,D.PlaylistLevelType.MAIN),ue=this.getNextFragment(this.nextLoadPosition,j)}if(!ue)return;ue.initSegment&&!ue.initSegment.data&&!this.bitrateTest&&(ue=ue.initSegment),((w=ue.decryptdata)===null||w===void 0?void 0:w.keyFormat)==="identity"&&!((x=ue.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(ue,j):this.loadFragment(ue,j,le)},R.loadFragment=function(w,x,c){var T,y=this.fragmentTracker.getState(w);if(this.fragCurrent=w,y===i.FragmentState.BACKTRACKED){var v=this.fragmentTracker.getBacktrackData(w);if(v){this._handleFragmentLoadProgress(v),this._handleFragmentLoadComplete(v);return}else y=i.FragmentState.NOT_LOADED}y===i.FragmentState.NOT_LOADED||y===i.FragmentState.PARTIAL?w.sn==="initSegment"?this._loadInitSegment(w):this.bitrateTest?(w.bitrateTest=!0,this.log("Fragment "+w.sn+" of level "+w.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(w)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,w,x,c)):y===i.FragmentState.APPENDING?this.reduceMaxBufferLength(w.duration)&&this.fragmentTracker.removeFragment(w):((T=this.media)===null||T===void 0?void 0:T.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},R.getAppendedFrag=function(w){var x=this.fragmentTracker.getAppendedFrag(w,D.PlaylistLevelType.MAIN);return x&&"fragment"in x?x.fragment:x},R.getBufferedFrag=function(w){return this.fragmentTracker.getBufferedFrag(w,D.PlaylistLevelType.MAIN)},R.followingBufferedFrag=function(w){return w?this.getBufferedFrag(w.end+.5):null},R.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},R.nextLevelSwitch=function(){var w=this.levels,x=this.media;if(x!=null&&x.readyState){var c,T=this.getAppendedFrag(x.currentTime);if(T&&T.start>1&&this.flushMainBuffer(0,T.start-1),!x.paused&&w){var y=this.hls.nextLoadLevel,v=w[y],N=this.fragLastKbps;N&&this.fragCurrent?c=this.fragCurrent.duration*v.maxBitrate/(1e3*N)+1:c=0}else c=0;var B=this.getBufferedFrag(x.currentTime+c);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 w=this.fragCurrent;this.fragCurrent=null,w!=null&&w.loader&&w.loader.abort(),this.state===F.State.KEY_LOADING&&(this.state=F.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},R.flushMainBuffer=function(w,x){S.prototype.flushMainBuffer.call(this,w,x,this.altAudio?"video":null)},R.onMediaAttached=function(w,x){S.prototype.onMediaAttached.call(this,w,x);var c=x.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new l.default(this.config,c,this.fragmentTracker,this.hls)},R.onMediaDetaching=function(){var w=this.media;w&&(w.removeEventListener("playing",this.onvplaying),w.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},R.onMediaPlaying=function(){this.tick()},R.onMediaSeeked=function(){var w=this.media,x=w?w.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(w,x){var c=!1,T=!1,y;x.levels.forEach(function(v){y=v.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(c=!0),y.indexOf("mp4a.40.5")!==-1&&(T=!0))}),this.audioCodecSwitch=c&&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(w,x){var c=this.levels;if(!c||this.state!==F.State.IDLE)return;var T=c[x.level];(!T.details||T.details.live&&this.levelLastLoaded!==x.level||this.waitForCdnTuneIn(T.details))&&(this.state=F.State.WAITING_LEVEL)},R.onLevelLoaded=function(w,x){var c,T=this.levels,y=x.level,v=x.details,N=v.totalduration;if(!T){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+v.startSN+","+v.endSN+"], cc ["+v.startCC+", "+v.endCC+"] duration:"+N);var B=this.fragCurrent;B&&(this.state===F.State.FRAG_LOADING||this.state===F.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==x.level&&B.loader&&(this.state=F.State.IDLE,B.loader.abort()));var O=T[y],j=0;if(v.live||(c=O.details)!==null&&c!==void 0&&c.live){if(v.fragments[0]||(v.deltaUpdateFailed=!0),v.deltaUpdateFailed)return;j=this.alignPlaylists(v,O.details)}if(O.details=v,this.levelLastLoaded=y,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:v,level:y}),this.state===F.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(v))return;this.state=F.State.IDLE}this.startFragRequested?v.live&&this.synchronizeToLiveEdge(v):this.setStartPosition(v,j),this.tick()},R._handleFragmentLoadProgress=function(w){var x,c=w.frag,T=w.part,y=w.payload,v=this.levels;if(!v){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var N=v[c.level],B=N.details;if(!B){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var O=N.videoCodec,j=B.PTSKnown||!B.live,P=(x=c.initSegment)===null||x===void 0?void 0:x.data,b=this._getAudioCodec(N),Y=this.transmuxer=this.transmuxer||new m.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ee=T?T.index:-1,le=ee!==-1,ue=new p.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,y.byteLength,ee,le),ke=this.initPTS[c.cc];Y.push(y,P,b,O,c,T,B.totalduration,j,ue,ke)},R.onAudioTrackSwitching=function(w,x){var c=this.altAudio,T=!!x.url,y=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 v=this.fragCurrent;v!=null&&v.loader&&(this.log("Switching to main audio track, cancel main fragment load"),v.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;c&&N.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:y})}},R.onAudioTrackSwitched=function(w,x){var c=x.id,T=!!this.hls.audioTracks[c].url;if(T){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=T,this.tick()},R.onBufferCreated=function(w,x){var c=x.tracks,T,y,v=!1;for(var N in c){var B=c[N];if(B.id==="main"){if(y=N,T=B,N==="video"){var O=c[N];O&&(this.videoBuffer=O.buffer)}}else v=!0}v&&T?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=T.buffer):this.mediaBuffer=this.media},R.onFragBuffered=function(w,x){var c=x.frag,T=x.part;if(c&&c.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(T?" p: "+T.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===F.State.PARSED&&(this.state=F.State.IDLE);return}var y=T?T.stats:c.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,T)},R.onError=function(w,x){switch(x.details){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:case u.ErrorDetails.KEY_LOAD_ERROR:case u.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,x);break;case u.ErrorDetails.LEVEL_LOAD_ERROR:case u.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==F.State.ERROR&&(x.fatal?(this.warn(""+x.details),this.state=F.State.ERROR):!x.levelRetry&&this.state===F.State.WAITING_LEVEL&&(this.state=F.State.IDLE));break;case u.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="main"&&(this.state===F.State.PARSING||this.state===F.State.PARSED)){var c=!0,T=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);T&&T.len>.5&&(c=!this.reduceMaxBufferLength(T.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},R.checkBuffer=function(){var w=this.media,x=this.gapController;if(!w||!x||!w.readyState)return;var c=W.BufferHelper.getBuffered(w);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):x.poll(this.lastCurrentTime),this.lastCurrentTime=w.currentTime},R.onFragLoadEmergencyAborted=function(){this.state=F.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},R.onBufferFlushed=function(w,x){var c=x.type;if(c!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var T=(c===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(T,c,D.PlaylistLevelType.MAIN)}},R.onLevelsUpdated=function(w,x){this.levels=x.levels},R.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},R.seekToStartPos=function(){var w=this.media,x=w.currentTime,c=this.startPosition;if(c>=0&&x<c){if(w.seeking){f.logger.log("could not seek to "+c+", already seeking at "+x);return}var T=W.BufferHelper.getBuffered(w),y=T.length?T.start(0):0,v=y-c;v>0&&(v<this.config.maxBufferHole||v<this.config.maxFragLookUpTolerance)&&(f.logger.log("adjusting start position by "+v+" to match buffer start"),c+=v,this.startPosition=c),this.log("seek to target start position "+c+" from current time "+x),w.currentTime=c}},R._getAudioCodec=function(w){var x=this.config.defaultAudioCodec||w.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(w){var x=this;this._doFragLoad(w).then(function(c){var T=x.hls;if(!c||T.nextLoadLevel||x.fragContextChanged(w))return;x.fragLoadError=0,x.state=F.State.IDLE,x.startFragRequested=!1,x.bitrateTest=!1;var y=w.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),T.trigger(G.Events.FRAG_LOADED,c)})},R._handleTransmuxComplete=function(w){var x,c="main",T=this.hls,y=w.remuxResult,v=w.chunkMeta,N=this.getCurrentContext(v);if(!N){this.warn("The loading context changed while buffering fragment "+v.sn+" of level "+v.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(v.level);return}var B=N.frag,O=N.part,j=N.level,P=y.video,b=y.text,Y=y.id3,ee=y.initSegment,le=this.altAudio?void 0:y.audio;if(this.fragContextChanged(B))return;if(this.state=F.State.PARSING,ee){ee.tracks&&(this._bufferInitSegment(j,ee.tracks,B,v),T.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:c,tracks:ee.tracks}));var ue=ee.initPTS,ke=ee.timescale;Object(X.isFiniteNumber)(ue)&&(this.initPTS[B.cc]=ue,T.trigger(G.Events.INIT_PTS_FOUND,{frag:B,id:c,initPTS:ue,timescale:ke}))}if(P&&y.independent!==!1){if(j.details){var we=P.startPTS,Ae=P.endPTS,ce=P.startDTS,pe=P.endDTS;if(O)O.elementaryStreams[P.type]={startPTS:we,endPTS:Ae,startDTS:ce,endDTS:pe};else if(P.firstKeyFrame&&P.independent&&(this.couldBacktrack=!0),P.dropped&&P.independent){var se=this.getLoadPosition()+this.config.maxBufferHole;if(se<we){this.backtrack(B);return}B.setElementaryStreamInfo(P.type,B.start,Ae,B.start,pe,!0)}B.setElementaryStreamInfo(P.type,we,Ae,ce,pe),this.bufferFragmentData(P,B,O,v)}}else if(y.independent===!1){this.backtrack(B);return}if(le){var ae=le.startPTS,Oe=le.endPTS,xe=le.startDTS,Pe=le.endDTS;O&&(O.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:Oe,startDTS:xe,endDTS:Pe}),B.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ae,Oe,xe,Pe),this.bufferFragmentData(le,B,O,v)}if(Y!=null&&(x=Y.samples)!==null&&x!==void 0&&x.length){var De={frag:B,id:c,samples:Y.samples};T.trigger(G.Events.FRAG_PARSING_METADATA,De)}if(b){var Ge={frag:B,id:c,samples:b.samples};T.trigger(G.Events.FRAG_PARSING_USERDATA,Ge)}},R._bufferInitSegment=function(w,x,c,T){var y=this;if(this.state!==F.State.PARSING)return;this.audioOnly=!!x.audio&&!x.video,this.altAudio&&!this.audioOnly&&delete x.audio;var v=x.audio,N=x.video,B=x.audiovideo;if(v){var O=w.audioCodec,j=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(O&&(O.indexOf("mp4a.40.5")!==-1?O="mp4a.40.2":O="mp4a.40.5"),v.metadata.channelCount!==1&&j.indexOf("firefox")===-1&&(O="mp4a.40.5")),j.indexOf("android")!==-1&&v.container!=="audio/mpeg"&&(O="mp4a.40.2",this.log("Android: force audio codec to "+O)),w.audioCodec&&w.audioCodec!==O&&this.log('Swapping manifest audio codec "'+w.audioCodec+'" for "'+O+'"'),v.levelCodec=O,v.id="main",this.log("Init audio buffer, container:"+v.container+", codecs[selected/level/parsed]=["+(O||"")+"/"+(w.audioCodec||"")+"/"+v.codec+"]")}N&&(N.levelCodec=w.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(w.videoCodec||"")+"/"+N.codec+"]")),B&&this.log("Init audiovideo buffer, container:"+B.container+", codecs[level/parsed]=["+(w.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&&y.hls.trigger(G.Events.BUFFER_APPENDING,{type:P,data:Y,frag:c,part:null,chunkMeta:T,parent:c.type})}),this.tick()},R.backtrack=function(w){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(w);var x=this.fragmentTracker.backtrack(w);this.fragPrevious=null,this.nextLoadPosition=w.start,x?this.resetFragmentLoading(w):this.state=F.State.BACKTRACKING},R.checkFragmentChanged=function(){var w=this.media,x=null;if(w&&w.readyState>1&&w.seeking===!1){var c=w.currentTime;if(W.BufferHelper.isBuffered(w,c)?x=this.getAppendedFrag(c):W.BufferHelper.isBuffered(w,c+.1)&&(x=this.getAppendedFrag(c+.1)),x){var T=this.fragPlaying,y=x.level;(!T||x.sn!==T.sn||T.level!==y||x.urlId!==T.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:x}),(!T||T.level!==y)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=x)}}},h(L,[{key:"nextLevel",get:function(){var w=this.nextBufferedFrag;return w?w.level:-1}},{key:"currentLevel",get:function(){var w=this.media;if(w){var x=this.getAppendedFrag(w.currentTime);if(x)return x.level}return-1}},{key:"nextBufferedFrag",get:function(){var w=this.media;if(w){var x=this.getAppendedFrag(w.currentTime);return this.followingBufferedFrag(x)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(F.default)},"./src/controller/subtitle-stream-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"SubtitleStreamController",function(){return s});var X=M("./src/events.ts"),F=M("./src/utils/logger.ts"),U=M("./src/utils/buffer-helper.ts"),G=M("./src/controller/fragment-finders.ts"),W=M("./src/utils/discontinuities.ts"),i=M("./src/controller/level-helper.ts"),D=M("./src/controller/fragment-tracker.ts"),g=M("./src/controller/base-stream-controller.ts"),m=M("./src/types/loader.ts"),p=M("./src/types/level.ts");function l(a,A){for(var _=0;_<A.length;_++){var S=A[_];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function u(a,A,_){return A&&l(a.prototype,A),_&&l(a,_),a}function f(a,A){a.prototype=Object.create(A.prototype),a.prototype.constructor=a,o(a,A)}function o(a,A){return o=Object.setPrototypeOf||function(S,L){return S.__proto__=L,S},o(a,A)}var h=500,s=function(a){f(A,a);function A(S,L){var R;return R=a.call(this,S,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,w=R.success;if(this.fragPrevious=C,this.state=g.State.IDLE,!w)return;var x=this.tracksBuffered[this.currentTrackId];if(!x)return;for(var c,T=C.start,y=0;y<x.length;y++)if(T>=x[y].start&&T<=x[y].end){c=x[y];break}var v=C.start+C.duration;c?c.end=v:(c={start:T,end:v},x.push(c)),this.fragmentTracker.fragBuffered(C)},_.onBufferFlushing=function(L,R){var C=R.startOffset,w=R.endOffset;if(C===0&&w!==Number.POSITIVE_INFINITY){var x=this.currentTrackId,c=this.levels;if(!c.length||!c[x]||!c[x].details)return;var T=c[x].details,y=T.targetduration,v=w-y;if(v<=0)return;R.endOffsetSubtitles=Math.max(0,v),this.tracksBuffered.forEach(function(N){for(var B=0;B<N.length;){if(N[B].end<=v){N.shift();continue}else if(N[B].start<v)N[B].start=v;else break;B++}}),this.fragmentTracker.removeFragmentsInRange(C,v,m.PlaylistLevelType.SUBTITLE)}},_.onError=function(L,R){var C,w=R.frag;if(!w||w.type!==m.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,w=R.subtitleTracks;this.tracksBuffered=[],this.levels=w.map(function(x){return new p.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,w=R.details,x=R.id,c=this.currentTrackId,T=this.levels;if(!T.length)return;var y=T[c];if(x>=T.length||x!==c||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,w.live||(C=y.details)!==null&&C!==void 0&&C.live){var v=this.mainDetails;if(w.deltaUpdateFailed||!v)return;var N=v.fragments[0];if(!y.details)w.hasProgramDateTime&&v.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(w,v):N&&Object(i.addSliding)(w,N.start);else{var B=this.alignPlaylists(w,y.details);B===0&&N&&Object(i.addSliding)(w,N.start)}}if(y.details=w,this.levelLastLoaded=x,this.tick(),w.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var O=Object(G.findFragmentByPTS)(null,w.fragments,this.media.currentTime,0);O||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},_._handleFragmentLoadComplete=function(L){var R=L.frag,C=L.payload,w=R.decryptdata,x=this.hls;if(this.fragContextChanged(R))return;if(C&&C.byteLength>0&&w&&w.key&&w.iv&&w.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(C),w.key.buffer,w.iv.buffer).then(function(T){var y=performance.now();x.trigger(X.Events.FRAG_DECRYPTED,{frag:R,payload:T,stats:{tstart:c,tdecrypt:y}})})}},_.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 w=C[R].details,x=w.targetduration,c=this.config,T=this.media,y=U.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,T.currentTime-x,c.maxBufferHole),v=y.end,N=y.len,B=this.getMaxBufferLength()+x;if(N>B)return;console.assert(w,"Subtitle track details are defined on idle subtitle stream controller tick");var O=w.fragments,j=O.length,P=w.edge,b,Y=this.fragPrevious;if(v<P){var ee=c.maxFragLookUpTolerance;Y&&w.hasProgramDateTime&&(b=Object(G.findFragmentByPDT)(O,Y.endProgramDateTime,ee)),b||(b=Object(G.findFragmentByPTS)(Y,O,v,ee),!b&&Y&&Y.start<O[0].start&&(b=O[0]))}else b=O[j-1];(L=b)!==null&&L!==void 0&&L.encrypted?(F.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,w,v)}},_.loadFragment=function(L,R,C){this.fragCurrent=L,a.prototype.loadFragment.call(this,L,R,C)},u(A,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),A}(g.default)},"./src/controller/subtitle-track-controller.ts":function(ie,$,M){"use strict";M.r($);var X=M("./src/events.ts"),F=M("./src/utils/texttrack-utils.ts"),U=M("./src/controller/base-playlist-controller.ts"),G=M("./src/types/loader.ts");function W(l,u){for(var f=0;f<u.length;f++){var o=u[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function i(l,u,f){return u&&W(l.prototype,u),f&&W(l,f),l}function D(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,g(l,u)}function g(l,u){return g=Object.setPrototypeOf||function(o,h){return o.__proto__=h,o},g(l,u)}var m=function(l){D(u,l);function u(o){var h;return h=l.call(this,o,"[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=u.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,l.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,s){if(this.media=s.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},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=p(this.media.textTracks);h.forEach(function(s){Object(F.clearCurrentCues)(s)}),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,s){this.tracks=s.subtitleTracks},f.onSubtitleTrackLoaded=function(h,s){var a=s.id,A=s.details,_=this.trackId,S=this.tracksInGroup[_];if(!S){this.warn("Invalid subtitle track id "+a);return}var L=S.details;S.details=s.details,this.log("subtitle track "+a+" loaded ["+A.startSN+"-"+A.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,s,L))},f.onLevelLoading=function(h,s){this.switchLevel(s.level)},f.onLevelSwitching=function(h,s){this.switchLevel(s.level)},f.switchLevel=function(h){var s=this.hls.levels[h];if(!(s!=null&&s.textGroupIds))return;var a=s.textGroupIds[s.urlId];if(this.groupId!==a){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,_=this.tracks.filter(function(R){return!a||R.groupId===a});this.tracksInGroup=_;var S=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=a;var L={subtitleTracks:_};this.log("Updating subtitle tracks, "+_.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,L),S!==-1&&this.setSubtitleTrack(S,A)}},f.findTrackId=function(h){for(var s=this.tracksInGroup,a=0;a<s.length;a++){var A=s[a];if((!this.selectDefaultTrack||A.default)&&(!h||h===A.name))return A.id}return-1},f.onError=function(h,s){if(l.prototype.onError.call(this,h,s),s.fatal||!s.context)return;s.context.type===G.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},f.loadPlaylist=function(h){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var a=s.id,A=s.groupId,_=s.url;if(h)try{_=h.addDirectives(_)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+a),this.hls.trigger(X.Events.SUBTITLE_TRACK_LOADING,{url:_,id:a,groupId:A,deliveryDirectives:h||null})}},f.toggleTrackModes=function(h){var s=this,a=this.media,A=this.subtitleDisplay,_=this.trackId;if(!a)return;var S=p(a.textTracks),L=S.filter(function(w){return w.groupId===s.groupId});if(h===-1)[].slice.call(S).forEach(function(w){w.mode="disabled"});else{var R=L[_];R&&(R.mode="disabled")}var C=L[h];C&&(C.mode=A?"showing":"hidden")},f.setSubtitleTrack=function(h,s){var a,A=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=h;return}if(this.trackId!==h&&this.toggleTrackModes(h),this.trackId===h&&(h===-1||(a=A[h])!==null&&a!==void 0&&a.details)||h<-1||h>=A.length)return;this.clearTimer();var _=A[h];if(this.log("Switching to subtitle track "+h),this.trackId=h,_){var S=_.id,L=_.groupId,R=L===void 0?"":L,C=_.name,w=_.type,x=_.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:R,name:C,type:w,url:x});var c=this.switchParams(_.url,s==null?void 0:s.details);this.loadPlaylist(c)}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,s=p(this.media.textTracks),a=0;a<s.length;a++)if(s[a].mode==="hidden")h=a;else if(s[a].mode==="showing"){h=a;break}this.subtitleTrack!==h&&(this.subtitleTrack=h)},i(u,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(h){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(h,s)}}]),u}(U.default);function p(l){for(var u=[],f=0;f<l.length;f++){var o=l[f];o.kind==="subtitles"&&o.label&&u.push(l[f])}return u}$.default=m},"./src/controller/timeline-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"TimelineController",function(){return p});var X=M("./src/polyfills/number.ts"),F=M("./src/events.ts"),U=M("./src/utils/cea-608-parser.ts"),G=M("./src/utils/output-filter.ts"),W=M("./src/utils/webvtt-parser.ts"),i=M("./src/utils/texttrack-utils.ts"),D=M("./src/utils/imsc1-ttml-parser.ts"),g=M("./src/types/loader.ts"),m=M("./src/utils/logger.ts"),p=function(){function o(s){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var a=new G.default(this,"textTrack1"),A=new G.default(this,"textTrack2"),_=new G.default(this,"textTrack3"),S=new G.default(this,"textTrack4");this.cea608Parser1=new U.default(1,a,A),this.cea608Parser2=new U.default(3,_,S)}s.on(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(F.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(F.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(F.Events.FRAG_LOADING,this.onFragLoading,this),s.on(F.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(F.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(F.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(F.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var h=o.prototype;return h.destroy=function(){var a=this.hls;a.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(F.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.off(F.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.off(F.Events.FRAG_LOADING,this.onFragLoading,this),a.off(F.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(F.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.off(F.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.off(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(F.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},h.addCues=function(a,A,_,S,L){for(var R=!1,C=L.length;C--;){var w=L[C],x=u(w[0],w[1],A,_);if(x>=0&&(w[0]=Math.min(w[0],A),w[1]=Math.max(w[1],_),R=!0,x/(_-A)>.5))return}if(R||L.push([A,_]),this.config.renderTextTracksNatively){var c=this.captionsTracks[a];this.Cues.newCue(c,A,_,S)}else{var T=this.Cues.newCue(null,A,_,S);this.hls.trigger(F.Events.CUES_PARSED,{type:"captions",cues:T,track:a})}},h.onInitPtsFound=function(a,A){var _=this,S=A.frag,L=A.id,R=A.initPTS,C=A.timescale,w=this.unparsedVttFrags;L==="main"&&(this.initPTS[S.cc]=R,this.timescale[S.cc]=C),w.length&&(this.unparsedVttFrags=[],w.forEach(function(x){_.onFragLoaded(F.Events.FRAG_LOADED,x)}))},h.getExistingTrack=function(a){var A=this.media;if(A)for(var _=0;_<A.textTracks.length;_++){var S=A.textTracks[_];if(S[a])return S}return null},h.createCaptionsTrack=function(a){this.config.renderTextTracksNatively?this.createNativeTrack(a):this.createNonNativeTrack(a)},h.createNativeTrack=function(a){if(this.captionsTracks[a])return;var A=this.captionsProperties,_=this.captionsTracks,S=this.media,L=A[a],R=L.label,C=L.languageCode,w=this.getExistingTrack(a);if(w)_[a]=w,Object(i.clearCurrentCues)(_[a]),Object(i.sendAddTrackEvent)(_[a],S);else{var x=this.createTextTrack("captions",R,C);x&&(x[a]=!0,_[a]=x)}},h.createNonNativeTrack=function(a){if(this.nonNativeCaptionsTracks[a])return;var A=this.captionsProperties[a];if(!A)return;var _=A.label,S={_id:a,label:_,kind:"captions",default:A.media?!!A.media.default:!1,closedCaptions:A.media};this.nonNativeCaptionsTracks[a]=S,this.hls.trigger(F.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},h.createTextTrack=function(a,A,_){var S=this.media;return S?S.addTextTrack(a,A,_):void 0},h.onMediaAttaching=function(a,A){this.media=A.media,this._cleanTracks()},h.onMediaDetaching=function(){var a=this.captionsTracks;Object.keys(a).forEach(function(A){Object(i.clearCurrentCues)(a[A]),delete a[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 a=this.media;if(!a)return;var A=a.textTracks;if(A)for(var _=0;_<A.length;_++)Object(i.clearCurrentCues)(A[_])},h.onSubtitleTracksUpdated=function(a,A){var _=this;this.textTracks=[];var S=A.subtitleTracks||[],L=S.some(function(x){return x.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var R=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var C=this.media?this.media.textTracks:[];this.tracks.forEach(function(x,c){var T;if(c<C.length){for(var y=null,v=0;v<C.length;v++)if(l(C[v],x)){y=C[v];break}y&&(T=y)}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 w=this.tracks.map(function(x){return{label:x.name,kind:x.type.toLowerCase(),default:x.default,subtitleTrack:x}});this.hls.trigger(F.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:w})}}},h.onManifestLoaded=function(a,A){var _=this;this.config.enableCEA708Captions&&A.captions&&A.captions.forEach(function(S){var L=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!L)return;var R="textTrack"+L[1],C=_.captionsProperties[R];if(!C)return;C.label=S.name,S.lang&&(C.languageCode=S.lang),C.media=S})},h.onFragLoading=function(a,A){var _=this.cea608Parser1,S=this.cea608Parser2,L=this.lastSn,R=this.lastPartIndex;if(!this.enabled||!(_&&S))return;if(A.frag.type===g.PlaylistLevelType.MAIN){var C,w,x=A.frag.sn,c=(C=A==null||((w=A.part)===null||w===void 0)?void 0:w.index)!=null?C:-1;x===L+1||x===L&&c===R+1||(_.reset(),S.reset()),this.lastSn=x,this.lastPartIndex=c}},h.onFragLoaded=function(a,A){var _=A.frag,S=A.payload,L=this.initPTS,R=this.unparsedVttFrags;if(_.type===g.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(X.isFiniteNumber)(L[_.cc])){R.push(A),L.length&&this.hls.trigger(F.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 w=this.tracks[_.level],x=this.vttCCs;x[_.cc]||(x[_.cc]={start:_.start,prevCC:this.prevCC,new:!0},this.prevCC=_.cc),w&&w.textCodec===D.IMSC1_CODEC?this._parseIMSC1(_,S):this._parseVTTs(_,S,x)}}else this.hls.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Empty subtitle payload")})},h._parseIMSC1=function(a,A){var _=this,S=this.hls;Object(D.parseIMSC1)(A,this.initPTS[a.cc],this.timescale[a.cc],function(L){_._appendCues(L,a.level),S.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(L){m.logger.log("Failed to parse IMSC1: "+L),S.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:L})})},h._parseVTTs=function(a,A,_){var S=this,L=this.hls;Object(W.parseWebVTT)(A,this.initPTS[a.cc],this.timescale[a.cc],_,a.cc,a.start,function(R){S._appendCues(R,a.level),L.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(R){S._fallbackToIMSC1(a,A),m.logger.log("Failed to parse VTT cue: "+R),L.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:R})})},h._fallbackToIMSC1=function(a,A){var _=this,S=this.tracks[a.level];S.textCodec||Object(D.parseIMSC1)(A,this.initPTS[a.cc],this.timescale[a.cc],function(){S.textCodec=D.IMSC1_CODEC,_._parseIMSC1(a,A)},function(){S.textCodec="wvtt"})},h._appendCues=function(a,A){var _=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[A];if(S.mode==="disabled")return;a.forEach(function(C){return Object(i.addCueToTrack)(S,C)})}else{var L=this.tracks[A],R=L.default?"default":"subtitles"+A;_.trigger(F.Events.CUES_PARSED,{type:"subtitles",cues:a,track:R})}},h.onFragDecrypted=function(a,A){var _=A.frag;if(_.type===g.PlaylistLevelType.SUBTITLE){if(!Object(X.isFiniteNumber)(this.initPTS[_.cc])){this.unparsedVttFrags.push(A);return}this.onFragLoaded(F.Events.FRAG_LOADED,A)}},h.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},h.onFragParsingUserdata=function(a,A){var _=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(_&&S))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]),S.addData(A.samples[L].pts,C[1])}}},h.onBufferFlushing=function(a,A){var _=A.startOffset,S=A.endOffset,L=A.endOffsetSubtitles,R=A.type,C=this.media;if(!C||C.currentTime<S)return;if(!R||R==="video"){var w=this.captionsTracks;Object.keys(w).forEach(function(c){return Object(i.removeCuesInRange)(w[c],_,S)})}if(this.config.renderTextTracksNatively&&(_===0&&L!==void 0)){var x=this.textTracks;Object.keys(x).forEach(function(c){return Object(i.removeCuesInRange)(x[c],_,L)})}},h.extractCea608Data=function(a){for(var A=a[0]&31,_=2,S=[[],[]],L=0;L<A;L++){var R=a[_++],C=127&a[_++],w=127&a[_++],x=(4&R)!==0,c=3&R;if(C===0&&w===0)continue;x&&((c===0||c===1)&&(S[c].push(C),S[c].push(w)))}return S},o}();function l(o,h){return o&&o.label===h.name&&!(o.textTrack1||o.textTrack2)}function u(o,h,s,a){return Math.min(h,a)-Math.max(o,s)}function f(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return X});var X=function(){function F(G,W){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=W}var U=F.prototype;return U.decrypt=function(W,i){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},i,W)},F}()},"./src/crypt/aes-decryptor.ts":function(ie,$,M){"use strict";M.r($),M.d($,"removePadding",function(){return F}),M.d($,"default",function(){return U});var X=M("./src/utils/typed-array.ts");function F(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),m=new Uint32Array(4),p=0;p<4;p++)m[p]=g.getUint32(p*4);return m},W.initTable=function(){var D=this.sBox,g=this.invSBox,m=this.subMix,p=m[0],l=m[1],u=m[2],f=m[3],o=this.invSubMix,h=o[0],s=o[1],a=o[2],A=o[3],_=new Uint32Array(256),S=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[S]=C,g[C]=S;var w=_[S],x=_[w],c=_[x],T=_[C]*257^C*16843008;p[S]=T<<24|T>>>8,l[S]=T<<16|T>>>16,u[S]=T<<8|T>>>24,f[S]=T,T=c*16843009^x*65537^w*257^S*16843008,h[C]=T<<24|T>>>8,s[C]=T<<16|T>>>16,a[C]=T<<8|T>>>24,A[C]=T,S?(S=w^_[_[_[c^w]]],L^=_[_[L]]):S=L=1}},W.expandKey=function(D){for(var g=this.uint8ArrayToUint32Array_(D),m=!0,p=0;p<g.length&&m;)m=g[p]===this.key[p],p++;if(m)return;this.key=g;var l=this.keySize=g.length;if(l!==4&&l!==6&&l!==8)throw new Error("Invalid aes key size="+l);var u=this.ksRows=(l+6+1)*4,f,o,h=this.keySchedule=new Uint32Array(u),s=this.invKeySchedule=new Uint32Array(u),a=this.sBox,A=this.rcon,_=this.invSubMix,S=_[0],L=_[1],R=_[2],C=_[3],w,x;for(f=0;f<u;f++){if(f<l){w=h[f]=g[f];continue}x=w,f%l===0?(x=x<<8|x>>>24,x=a[x>>>24]<<24|a[x>>>16&255]<<16|a[x>>>8&255]<<8|a[x&255],x^=A[f/l|0]<<24):l>6&&f%l===4&&(x=a[x>>>24]<<24|a[x>>>16&255]<<16|a[x>>>8&255]<<8|a[x&255]),h[f]=w=(h[f-l]^x)>>>0}for(o=0;o<u;o++)f=u-o,o&3?x=h[f]:x=h[f-4],o<4||f<=4?s[o]=x:s[o]=S[a[x>>>24]]^L[a[x>>>16&255]]^R[a[x>>>8&255]]^C[a[x&255]],s[o]=s[o]>>>0},W.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},W.decrypt=function(D,g,m){for(var p=this.keySize+6,l=this.invKeySchedule,u=this.invSBox,f=this.invSubMix,o=f[0],h=f[1],s=f[2],a=f[3],A=this.uint8ArrayToUint32Array_(m),_=A[0],S=A[1],L=A[2],R=A[3],C=new Int32Array(D),w=new Int32Array(C.length),x,c,T,y,v,N,B,O,j,P,b,Y,ee,le,ue=this.networkToHostOrderSwap;g<C.length;){for(j=ue(C[g]),P=ue(C[g+1]),b=ue(C[g+2]),Y=ue(C[g+3]),v=j^l[0],N=Y^l[1],B=b^l[2],O=P^l[3],ee=4,le=1;le<p;le++)x=o[v>>>24]^h[N>>16&255]^s[B>>8&255]^a[O&255]^l[ee],c=o[N>>>24]^h[B>>16&255]^s[O>>8&255]^a[v&255]^l[ee+1],T=o[B>>>24]^h[O>>16&255]^s[v>>8&255]^a[N&255]^l[ee+2],y=o[O>>>24]^h[v>>16&255]^s[N>>8&255]^a[B&255]^l[ee+3],v=x,N=c,B=T,O=y,ee=ee+4;x=u[v>>>24]<<24^u[N>>16&255]<<16^u[B>>8&255]<<8^u[O&255]^l[ee],c=u[N>>>24]<<24^u[B>>16&255]<<16^u[O>>8&255]<<8^u[v&255]^l[ee+1],T=u[B>>>24]<<24^u[O>>16&255]<<16^u[v>>8&255]<<8^u[N&255]^l[ee+2],y=u[O>>>24]<<24^u[v>>16&255]<<16^u[N>>8&255]<<8^u[B&255]^l[ee+3],w[g]=ue(x^_),w[g+1]=ue(y^S),w[g+2]=ue(T^L),w[g+3]=ue(c^R),_=j,S=P,L=b,R=Y,g=g+4}return w.buffer},G}()},"./src/crypt/decrypter.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return g});var X=M("./src/crypt/aes-crypto.ts"),F=M("./src/crypt/fast-aes-key.ts"),U=M("./src/crypt/aes-decryptor.ts"),G=M("./src/utils/logger.ts"),W=M("./src/utils/mp4-tools.ts"),i=M("./src/utils/typed-array.ts"),D=16,g=function(){function m(l,u,f){var o=f===void 0?{}:f,h=o.removePKCS7Padding,s=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=l,this.config=u,this.removePKCS7Padding=s,s)try{var a=self.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(A){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=m.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var u=this.currentResult;if(!u){this.reset();return}var f=new Uint8Array(u);return this.reset(),this.removePKCS7Padding?Object(U.removePadding)(f):f},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(u,f,o,h){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(u),f,o);var s=this.flush();s&&h(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(u),f,o).then(h)},p.softwareDecrypt=function(u,f,o){var h=this.currentIV,s=this.currentResult,a=this.remainderData;this.logOnce("JS AES decrypt"),a&&(u=Object(W.appendUint8Array)(a,u),this.remainderData=null);var A=this.getValidChunk(u);if(!A.length)return null;h&&(o=h);var _=this.softwareDecrypter;_||(_=this.softwareDecrypter=new U.default),_.expandKey(f);var S=s;return this.currentResult=_.decrypt(A.buffer,0,o),this.currentIV=Object(i.sliceUint8)(A,-16).buffer,S||null},p.webCryptoDecrypt=function(u,f,o){var h=this,s=this.subtle;return(this.key!==f||!this.fastAesKey)&&(this.key=f,this.fastAesKey=new F.default(s,f)),this.fastAesKey.expandKey().then(function(a){if(!s)return Promise.reject(new Error("web crypto not initialized"));var A=new X.default(s,o);return A.decrypt(u.buffer,a)}).catch(function(a){return h.onWebCryptoError(a,u,f,o)})},p.onWebCryptoError=function(u,f,o,h){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",u),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(f,o,h)},p.getValidChunk=function(u){var f=u,o=u.length-u.length%D;return o!==u.length&&(f=Object(i.sliceUint8)(u,0,o),this.remainderData=Object(i.sliceUint8)(u,o)),f},p.logOnce=function(u){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+u),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return X});var X=function(){function F(G,W){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=W}var U=F.prototype;return U.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},F}()},"./src/demux/aacdemuxer.ts":function(ie,$,M){"use strict";M.r($);var X=M("./src/demux/base-audio-demuxer.ts"),F=M("./src/demux/adts.ts"),U=M("./src/utils/logger.ts"),G=M("./src/demux/id3.ts");function W(g,m){g.prototype=Object.create(m.prototype),g.prototype.constructor=g,i(g,m)}function i(g,m){return i=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},i(g,m)}var D=function(g){W(m,g);function m(l,u){var f;return f=g.call(this)||this,f.observer=void 0,f.config=void 0,f.observer=l,f.config=u,f}var p=m.prototype;return p.resetInitSegment=function(u,f,o){g.prototype.resetInitSegment.call(this,u,f,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:u,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(u){if(!u)return!1;for(var f=G.getID3Data(u,0)||[],o=f.length,h=u.length;o<h;o++)if(F.probe(u,o))return U.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(u,f){return F.canParse(u,f)},p.appendFrame=function(u,f,o){F.initTrackConfig(u,this.observer,f,o,u.manifestCodec);var h=F.appendFrame(u,f,o,this.initPTS,this.frameIndex);if(h&&h.missing===0)return h},m}(X.default);D.minProbeByteLength=9,$.default=D},"./src/demux/adts.ts":function(ie,$,M){"use strict";M.r($),M.d($,"getAudioConfig",function(){return G}),M.d($,"isHeaderPattern",function(){return W}),M.d($,"getHeaderLength",function(){return i}),M.d($,"getFullFrameLength",function(){return D}),M.d($,"canGetFrameLength",function(){return g}),M.d($,"isHeader",function(){return m}),M.d($,"canParse",function(){return p}),M.d($,"probe",function(){return l}),M.d($,"initTrackConfig",function(){return u}),M.d($,"getFrameDuration",function(){return f}),M.d($,"parseFrameHeader",function(){return o}),M.d($,"appendFrame",function(){return h});var X=M("./src/utils/logger.ts"),F=M("./src/errors.ts"),U=M("./src/events.ts");function G(s,a,A,_){var S,L,R,C,w=navigator.userAgent.toLowerCase(),x=_,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((a[A+2]&192)>>>6)+1;var T=(a[A+2]&60)>>>2;if(T>c.length-1){s.trigger(U.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+T});return}return R=(a[A+2]&1)<<2,R|=(a[A+3]&192)>>>6,X.logger.log("manifest codec:"+_+", ADTS type:"+S+", samplingIndex:"+T),/firefox/i.test(w)?T>=6?(S=5,C=new Array(4),L=T-3):(S=2,C=new Array(2),L=T):w.indexOf("android")!==-1?(S=2,C=new Array(2),L=T):(S=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(w))||!_&&R===1)&&(S=2,C=new Array(2)),L=T)),C[0]=S<<3,C[0]|=(T&14)>>1,C[1]|=(T&1)<<7,C[1]|=R<<3,S===5&&(C[1]|=(L&14)>>1,C[2]=(L&1)<<7,C[2]|=2<<2,C[3]=0),{config:C,samplerate:c[T],channelCount:R,codec:"mp4a.40."+S,manifestCodec:x}}function W(s,a){return s[a]===255&&(s[a+1]&246)===240}function i(s,a){return s[a+1]&1?7:9}function D(s,a){return(s[a+3]&3)<<11|s[a+4]<<3|(s[a+5]&224)>>>5}function g(s,a){return a+5<s.length}function m(s,a){return a+1<s.length&&W(s,a)}function p(s,a){return g(s,a)&&W(s,a)&&D(s,a)<=s.length-a}function l(s,a){if(m(s,a)){var A=i(s,a);if(a+A>=s.length)return!1;var _=D(s,a);if(_<=A)return!1;var S=a+_;return S===s.length||m(s,S)}return!1}function u(s,a,A,_,S){if(!s.samplerate){var L=G(a,A,_,S);if(!L)return;s.config=L.config,s.samplerate=L.samplerate,s.channelCount=L.channelCount,s.codec=L.codec,s.manifestCodec=L.manifestCodec,X.logger.log("parsed codec:"+s.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function f(s){return 1024*9e4/s}function o(s,a,A,_,S){var L=i(s,a),R=D(s,a);if(R-=L,R>0){var C=A+_*S;return{headerLength:L,frameLength:R,stamp:C}}}function h(s,a,A,_,S){var L=f(s.samplerate),R=o(a,A,_,S,L);if(R){var C=R.frameLength,w=R.headerLength,x=R.stamp,c=w+C,T=Math.max(0,A+c-a.length),y;T?(y=new Uint8Array(c-w),y.set(a.subarray(A+w,a.length),0)):y=a.subarray(A+w,A+c);var v={unit:y,pts:x};return T||s.samples.push(v),{sample:v,length:c,missing:T}}}},"./src/demux/base-audio-demuxer.ts":function(ie,$,M){"use strict";M.r($),M.d($,"initPTSFn",function(){return D});var X=M("./src/polyfills/number.ts"),F=M("./src/demux/id3.ts"),U=M("./src/demux/dummy-demuxed-track.ts"),G=M("./src/utils/mp4-tools.ts"),W=M("./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 m=g.prototype;return m.resetInitSegment=function(l,u,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(l,u){return!1},m.appendFrame=function(l,u,f){},m.demux=function(l,u){this.cachedData&&(l=Object(G.appendUint8Array)(this.cachedData,l),this.cachedData=null);var f=F.getID3Data(l,0),o=f?f.length:0,h,s,a=this._audioTrack,A=this._id3Track,_=f?F.getTimeStamp(f):void 0,S=l.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(_,u)),f&&f.length>0&&A.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),s=this.initPTS;o<S;){if(this.canParse(l,o)){var L=this.appendFrame(a,l,o);L?(this.frameIndex++,s=L.sample.pts,o+=L.length,h=o):o=S}else F.canParse(l,o)?(f=F.getID3Data(l,o),A.samples.push({pts:s,dts:s,data:f}),o+=f.length,h=o):o++;if(o===S&&h!==S){var R=Object(W.sliceUint8)(l,h);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,R):this.cachedData=R}}return{audioTrack:a,avcTrack:Object(U.dummyTrack)(),id3Track:A,textTrack:Object(U.dummyTrack)()}},m.demuxSampleAes=function(l,u,f){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(l){var u=this.cachedData;return u&&(this.cachedData=null,this.demux(u,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(U.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(U.dummyTrack)()}},m.destroy=function(){},g}(),D=function(m,p){return Object(X.isFiniteNumber)(m)?m*90:p*9e4};$.default=i},"./src/demux/chunk-cache.ts":function(ie,$,M){"use strict";M.r($),M.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=F(i,D);else return new Uint8Array(0);return this.reset(),g},G.reset=function(){this.chunks.length=0,this.dataLength=0},U}();function F(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(ie,$,M){"use strict";M.r($),M.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(ie,$,M){"use strict";M.r($);var X=M("./src/utils/logger.ts"),F=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,m=new Uint8Array(4),p=Math.min(4,D);if(p===0)throw new Error("no bytes available");m.set(i.subarray(g,g+p)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},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,m,p=0;p<i;p++)g!==0&&(m=this.readEG(),g=(D+m+256)%256),D=g===0?D:g},G.readSPS=function(){var i=0,D=0,g=0,m=0,p,l,u,f=this.readUByte.bind(this),o=this.readBits.bind(this),h=this.readUEG.bind(this),s=this.readBoolean.bind(this),a=this.skipBits.bind(this),A=this.skipEG.bind(this),_=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);f();var L=f();if(o(5),a(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&&a(1),_(),_(),a(1),s())for(l=R!==3?8:12,u=0;u<l;u++)s()&&(u<6?S(16):S(64))}_();var C=h();if(C===0)h();else if(C===1)for(a(1),A(),A(),p=h(),u=0;u<p;u++)A();_(),a(1);var w=h(),x=h(),c=o(1);c===0&&a(1),a(1),s()&&(i=h(),D=h(),g=h(),m=h());var T=[1,1];if(s()&&s()){var y=f();switch(y){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((w+1)*16-i*2-D*2),height:(2-c)*(x+1)*16-(c?2:4)*(g+m),pixelRatio:T}},G.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},U}();$.default=F},"./src/demux/id3.ts":function(ie,$,M){"use strict";M.r($),M.d($,"isHeader",function(){return X}),M.d($,"isFooter",function(){return F}),M.d($,"getID3Data",function(){return U}),M.d($,"canParse",function(){return W}),M.d($,"getTimeStamp",function(){return i}),M.d($,"isTimeStampFrame",function(){return D}),M.d($,"getID3Frames",function(){return m}),M.d($,"decodeFrame",function(){return p}),M.d($,"utf8ArrayToStr",function(){return h}),M.d($,"testables",function(){return s});var X=function(S,L){return L+10<=S.length&&(S[L]===73&&S[L+1]===68&&S[L+2]===51&&(S[L+3]<255&&S[L+4]<255&&(S[L+6]<128&&S[L+7]<128&&S[L+8]<128&&S[L+9]<128)))},F=function(S,L){return L+10<=S.length&&(S[L]===51&&S[L+1]===68&&S[L+2]===73&&(S[L+3]<255&&S[L+4]<255&&(S[L+6]<128&&S[L+7]<128&&S[L+8]<128&&S[L+9]<128)))},U=function(S,L){for(var R=L,C=0;X(S,L);){C+=10;var w=G(S,L+6);C+=w,F(S,L+10)&&(C+=10),L+=C}return C>0?S.subarray(R,R+C):void 0},G=function(S,L){var R=0;return R=(S[L]&127)<<21,R|=(S[L+1]&127)<<14,R|=(S[L+2]&127)<<7,R|=S[L+3]&127,R},W=function(S,L){return X(S,L)&&G(S,L+6)+10<=S.length-L},i=function(S){for(var L=m(S),R=0;R<L.length;R++){var C=L[R];if(D(C))return o(C)}return},D=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},g=function(S){var L=String.fromCharCode(S[0],S[1],S[2],S[3]),R=G(S,4),C=10;return{type:L,size:R,data:S.subarray(C,C+R)}},m=function(S){for(var L=0,R=[];X(S,L);){var C=G(S,L+6);L+=10;for(var w=L+C;L+8<w;){var x=g(S.subarray(L)),c=p(x);c&&R.push(c),L+=x.size+10}F(S,L)&&(L+=10)}return R},p=function(S){return S.type==="PRIV"?l(S):S.type[0]==="W"?f(S):u(S)},l=function(S){if(S.size<2)return;var L=h(S.data,!0),R=new Uint8Array(S.data.subarray(L.length+1));return{key:S.type,info:L,data:R.buffer}},u=function(S){if(S.size<2)return;if(S.type==="TXXX"){var L=1,R=h(S.data.subarray(L),!0);L+=R.length+1;var C=h(S.data.subarray(L));return{key:S.type,info:R,data:C}}var w=h(S.data.subarray(1));return{key:S.type,data:w}},f=function(S){if(S.type==="WXXX"){if(S.size<2)return;var L=1,R=h(S.data.subarray(L),!0);L+=R.length+1;var C=h(S.data.subarray(L));return{key:S.type,info:R,data:C}}var w=h(S.data);return{key:S.type,data:w}},o=function(S){if(S.data.byteLength===8){var L=new Uint8Array(S.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(S,L){L===void 0&&(L=!1);var R=A();if(R){var C=R.decode(S);if(L){var w=C.indexOf("\0");return w!==-1?C.substring(0,w):C}return C.replace(/\0/g,"")}for(var x=S.length,c,T,y,v="",N=0;N<x;){if(c=S[N++],c===0&&L)return v;if(c===0||c===3)continue;switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:v+=String.fromCharCode(c);break;case 12:case 13:T=S[N++],v+=String.fromCharCode((c&31)<<6|T&63);break;case 14:T=S[N++],y=S[N++],v+=String.fromCharCode((c&15)<<12|(T&63)<<6|(y&63)<<0);break;default:}}return v},s={decodeTextFrame:u},a;function A(){return!a&&typeof self.TextDecoder!="undefined"&&(a=new self.TextDecoder("utf-8")),a}},"./src/demux/mp3demuxer.ts":function(ie,$,M){"use strict";M.r($);var X=M("./src/demux/base-audio-demuxer.ts"),F=M("./src/demux/id3.ts"),U=M("./src/utils/logger.ts"),G=M("./src/demux/mpegaudio.ts");function W(g,m){g.prototype=Object.create(m.prototype),g.prototype.constructor=g,i(g,m)}function i(g,m){return i=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},i(g,m)}var D=function(g){W(m,g);function m(){return g.apply(this,arguments)||this}var p=m.prototype;return p.resetInitSegment=function(u,f,o){g.prototype.resetInitSegment.call(this,u,f,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:u,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(u){if(!u)return!1;for(var f=F.getID3Data(u,0)||[],o=f.length,h=u.length;o<h;o++)if(G.probe(u,o))return U.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(u,f){return G.canParse(u,f)},p.appendFrame=function(u,f,o){return this.initPTS===null?void 0:G.appendFrame(u,f,o,this.initPTS,this.frameIndex)},m}(X.default);D.minProbeByteLength=4,$.default=D},"./src/demux/mp4demuxer.ts":function(ie,$,M){"use strict";M.r($);var X=M("./src/utils/mp4-tools.ts"),F=M("./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,m=Object(F.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(X.appendUint8Array)(this.remainderData,D));var p=Object(X.segmentValidRange)(g);this.remainderData=p.remainder,m.samples=p.valid||new Uint8Array}else m.samples=g;return{audioTrack:Object(F.dummyTrack)(),avcTrack:m,id3Track:Object(F.dummyTrack)(),textTrack:Object(F.dummyTrack)()}},W.flush=function(){var D=Object(F.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(F.dummyTrack)(),avcTrack:D,id3Track:Object(F.dummyTrack)(),textTrack:Object(F.dummyTrack)()}},W.demuxSampleAes=function(D,g,m){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(ie,$,M){"use strict";M.r($),M.d($,"appendFrame",function(){return i}),M.d($,"parseHeader",function(){return D}),M.d($,"isHeaderPattern",function(){return g}),M.d($,"isHeader",function(){return m}),M.d($,"canParse",function(){return p}),M.d($,"probe",function(){return l});var X=null,F=[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(u,f,o,h,s){if(o+24>f.length)return;var a=D(f,o);if(a&&o+a.frameLength<=f.length){var A=a.samplesPerFrame*9e4/a.sampleRate,_=h+s*A,S={unit:f.subarray(o,o+a.frameLength),pts:_,dts:_};return u.config=[],u.channelCount=a.channelCount,u.samplerate=a.sampleRate,u.samples.push(S),{sample:S,length:a.frameLength,missing:0}}}function D(u,f){var o=u[f+1]>>3&3,h=u[f+1]>>1&3,s=u[f+2]>>4&15,a=u[f+2]>>2&3;if(o!==1&&s!==0&&s!==15&&a!==3){var A=u[f+2]>>1&1,_=u[f+3]>>6,S=o===3?3-h:h===3?3:4,L=F[S*14+s-1]*1e3,R=o===3?0:o===2?1:2,C=U[R*3+a],w=_===3?1:2,x=G[o][h],c=W[h],T=x*8*c,y=Math.floor(x*L/C+A)*c;if(X===null){var v=navigator.userAgent||"",N=v.match(/Chrome\/(\d+)/i);X=N?parseInt(N[1]):0}var B=!!X&&X<=87;return B&&h===2&&L>=224e3&&_===0&&(u[f+3]=u[f+3]|128),{sampleRate:C,channelCount:w,frameLength:y,samplesPerFrame:T}}}function g(u,f){return u[f]===255&&(u[f+1]&224)===224&&(u[f+1]&6)!==0}function m(u,f){return f+1<u.length&&g(u,f)}function p(u,f){var o=4;return g(u,f)&&o<=u.length-f}function l(u,f){if(f+1<u.length&&g(u,f)){var o=4,h=D(u,f),s=o;h!=null&&h.frameLength&&(s=h.frameLength);var a=f+s;return a===u.length||m(u,a)}return!1}},"./src/demux/sample-aes.ts":function(ie,$,M){"use strict";M.r($);var X=M("./src/crypt/decrypter.ts"),F=M("./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,m,p){var l=D[g].unit,u=l.subarray(16,l.length-l.length%16),f=u.buffer.slice(u.byteOffset,u.byteOffset+u.length),o=this;this.decryptBuffer(f,function(h){var s=new Uint8Array(h);l.set(s,16),p||o.decryptAacSamples(D,g+1,m)})},W.decryptAacSamples=function(D,g,m){for(;;g++){if(g>=D.length){m();return}if(D[g].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(D,g,m,p),!p)return}},W.getAvcEncryptedData=function(D){for(var g=Math.floor((D.length-48)/160)*16+16,m=new Int8Array(g),p=0,l=32;l<=D.length-16;l+=160,p+=16)m.set(D.subarray(l,l+16),p);return m},W.getAvcDecryptedUnit=function(D,g){for(var m=new Uint8Array(g),p=0,l=32;l<=D.length-16;l+=160,p+=16)D.set(m.subarray(p,p+16),l);return D},W.decryptAvcSample=function(D,g,m,p,l,u){var f=Object(F.discardEPB)(l.data),o=this.getAvcEncryptedData(f),h=this;this.decryptBuffer(o.buffer,function(s){l.data=h.getAvcDecryptedUnit(f,s),u||h.decryptAvcSamples(D,g,m+1,p)})},W.decryptAvcSamples=function(D,g,m,p){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,m=0){if(g>=D.length){p();return}for(var l=D[g].units;!(m>=l.length);m++){var u=l[m];if(u.data.length<=48||u.type!==1&&u.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(D,g,m,p,u,f),!f)return}}},G}();$.default=U},"./src/demux/transmuxer-interface.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return l});var X=M("./node_modules/webworkify-webpack/index.js"),F=M.n(X),U=M("./src/events.ts"),G=M("./src/demux/transmuxer.ts"),W=M("./src/utils/logger.ts"),i=M("./src/errors.ts"),D=M("./src/utils/mediasource-helper.ts"),g=M("./node_modules/eventemitter3/index.js"),m=M.n(g),p=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},l=function(){function u(o,h,s,a){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=o,this.id=h,this.onTransmuxComplete=s,this.onFlush=a;var _=o.config,S=function(x,c){c=c||{},c.frag=A.frag,c.id=A.id,o.trigger(x,c)};this.observer=new g.EventEmitter,this.observer.on(U.Events.FRAG_DECRYPTED,S),this.observer.on(U.Events.ERROR,S);var L={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.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(w){o.trigger(U.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(w.message+" ("+w.filename+":"+w.lineno+")")})},C.postMessage({cmd:"init",typeSupported:L,vendor:R,id:h,config:JSON.stringify(_)})}catch(w){W.logger.warn("Error in worker:",w),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=u.prototype;return f.destroy=function(){var h=this.worker;if(h)h.removeEventListener("message",this.onwmsg),h.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var a=this.observer;a&&a.removeAllListeners(),this.observer=null},f.push=function(h,s,a,A,_,S,L,R,C,w){var x=this;C.transmuxing.start=self.performance.now();var c=this.transmuxer,T=this.worker,y=S?S.start:_.start,v=_.decryptdata,N=this.frag,B=!(N&&_.cc===N.cc),O=!(N&&C.level===N.level),j=N?C.sn-N.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),S&&(P||!b)&&(S.stats.parsing.start=Y);var ee=new G.TransmuxState(B,b,R,O,y);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: `+y);var le=new G.TransmuxConfig(a,A,s,L,w);this.configureTransmuxer(le)}if(this.frag=_,this.part=S,T)T.postMessage({cmd:"demux",data:h,decryptdata:v,chunkMeta:C,state:ee},h instanceof ArrayBuffer?[h]:[]);else if(c){var ue=c.push(h,v,C,ee);Object(G.isPromise)(ue)?ue.then(function(ke){x.handleTransmuxComplete(ke)}):this.handleTransmuxComplete(ue)}},f.flush=function(h){var s=this;h.transmuxing.start=self.performance.now();var a=this.transmuxer,A=this.worker;if(A)A.postMessage({cmd:"flush",chunkMeta:h});else if(a){var _=a.flush(h);Object(G.isPromise)(_)?_.then(function(S){s.handleFlushResult(S,h)}):this.handleFlushResult(_,h)}},f.handleFlushResult=function(h,s){var a=this;h.forEach(function(A){a.handleTransmuxComplete(A)}),this.onFlush(s)},f.onWorkerMessage=function(h){var s=h.data,a=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,a.trigger(s.event,s.data);break}}},f.configureTransmuxer=function(h){var s=this.worker,a=this.transmuxer;s?s.postMessage({cmd:"configure",config:h}):a&&a.configure(h)},f.handleTransmuxComplete=function(h){h.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(h)},u}()},"./src/demux/transmuxer-worker.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return i});var X=M("./src/demux/transmuxer.ts"),F=M("./src/events.ts"),U=M("./src/utils/logger.ts"),G=M("./node_modules/eventemitter3/index.js"),W=M.n(G);function i(l){var u=new G.EventEmitter,f=function(h,s){l.postMessage({event:h,data:s})};u.on(F.Events.FRAG_DECRYPTED,f),u.on(F.Events.ERROR,f),l.addEventListener("message",function(o){var h=o.data;switch(h.cmd){case"init":{var s=JSON.parse(h.config);l.transmuxer=new X.default(u,h.typeSupported,s,h.vendor,h.id),Object(U.enableLogs)(s.debug),f("init",null);break}case"configure":{l.transmuxer.configure(h.config);break}case"demux":{var a=l.transmuxer.push(h.data,h.decryptdata,h.chunkMeta,h.state);Object(X.isPromise)(a)?a.then(function(S){D(l,S)}):D(l,a);break}case"flush":{var A=h.chunkMeta,_=l.transmuxer.flush(A);Object(X.isPromise)(_)?_.then(function(S){m(l,S,A)}):m(l,_,A);break}default:break}})}function D(l,u){if(p(u.remuxResult))return;var f=[],o=u.remuxResult,h=o.audio,s=o.video;h&&g(f,h),s&&g(f,s),l.postMessage({event:"transmuxComplete",data:u},f)}function g(l,u){u.data1&&l.push(u.data1.buffer),u.data2&&l.push(u.data2.buffer)}function m(l,u,f){u.forEach(function(o){D(l,o)}),l.postMessage({event:"flush",data:f})}function p(l){return!l.audio&&!l.video&&!l.text&&!l.id3&&!l.initSegment}},"./src/demux/transmuxer.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return s}),M.d($,"isPromise",function(){return _}),M.d($,"TransmuxConfig",function(){return S}),M.d($,"TransmuxState",function(){return L});var X=M("./src/events.ts"),F=M("./src/errors.ts"),U=M("./src/crypt/decrypter.ts"),G=M("./src/demux/aacdemuxer.ts"),W=M("./src/demux/mp4demuxer.ts"),i=M("./src/demux/tsdemuxer.ts"),D=M("./src/demux/mp3demuxer.ts"),g=M("./src/remux/mp4-remuxer.ts"),m=M("./src/remux/passthrough-remuxer.ts"),p=M("./src/demux/chunk-cache.ts"),l=M("./src/utils/mp4-tools.ts"),u=M("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(R){u.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var o=[{demux:i.default,remux:g.default},{demux:W.default,remux:m.default},{demux:G.default,remux:g.default},{demux:D.default,remux:g.default}],h=1024;o.forEach(function(R){var C=R.demux;h=Math.max(h,C.minProbeByteLength)});var s=function(){function R(w,x,c,T,y){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 p.default,this.observer=w,this.typeSupported=x,this.config=c,this.vendor=T,this.id=y}var C=R.prototype;return C.configure=function(x){this.transmuxConfig=x,this.decrypter&&this.decrypter.reset()},C.push=function(x,c,T,y){var v=this,N=T.transmuxing;N.executeStart=f();var B=new Uint8Array(x),O=this.cache,j=this.config,P=this.currentTransmuxState,b=this.transmuxConfig;y&&(this.currentTransmuxState=y);var Y=a(B,c);if(Y&&Y.method==="AES-128"){var ee=this.getDecrypter();if(j.enableSoftwareAES){var le=ee.softwareDecrypt(B,Y.key.buffer,Y.iv.buffer);if(!le)return N.executeEnd=f(),A(T);B=new Uint8Array(le)}else return this.decryptionPromise=ee.webCryptoDecrypt(B,Y.key.buffer,Y.iv.buffer).then(function(Fe){var We=v.push(Fe,null,T);return v.decryptionPromise=null,We}),this.decryptionPromise}var ue=y||P,ke=ue.contiguous,we=ue.discontinuity,Ae=ue.trackSwitch,ce=ue.accurateTimeOffset,pe=ue.timeOffset,se=b.audioCodec,ae=b.videoCodec,Oe=b.defaultInitPts,xe=b.duration,Pe=b.initSegmentData;if((we||Ae)&&this.resetInitSegment(Pe,se,ae,xe),we&&this.resetInitialTimestamp(Oe),ke||this.resetContiguity(),this.needsProbing(B,we,Ae)){if(O.dataLength){var De=O.flush();B=Object(l.appendUint8Array)(De,B)}this.configureTransmuxer(B,b)}var Ge=this.transmux(B,Y,pe,ce,T),Le=this.currentTransmuxState;return Le.contiguous=!0,Le.discontinuity=!1,Le.trackSwitch=!1,N.executeEnd=f(),Ge},C.flush=function(x){var c=this,T=x.transmuxing;T.executeStart=f();var y=this.decrypter,v=this.cache,N=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return c.flush(x)});var O=[],j=N.timeOffset;if(y){var P=y.flush();P&&O.push(this.push(P,null,x))}var b=v.dataLength;v.reset();var Y=this.demuxer,ee=this.remuxer;if(!Y||!ee)return b>=h&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),T.executeEnd=f(),[A(x)];var le=Y.flush(j);return _(le)?le.then(function(ue){return c.flushRemux(O,ue,x),O}):(this.flushRemux(O,le,x),O)},C.flushRemux=function(x,c,T){var y=c.audioTrack,v=c.avcTrack,N=c.id3Track,B=c.textTrack,O=this.currentTransmuxState,j=O.accurateTimeOffset,P=O.timeOffset;u.logger.log("[transmuxer.ts]: Flushed fragment "+T.sn+(T.part>-1?" p: "+T.part:"")+" of level "+T.level);var b=this.remuxer.remux(y,v,N,B,P,j,!0,this.id);x.push({remuxResult:b,chunkMeta:T}),T.transmuxing.executeEnd=f()},C.resetInitialTimestamp=function(x){var c=this.demuxer,T=this.remuxer;if(!c||!T)return;c.resetTimeStamp(x),T.resetTimeStamp(x)},C.resetContiguity=function(){var x=this.demuxer,c=this.remuxer;if(!x||!c)return;x.resetContiguity(),c.resetNextTimestamp()},C.resetInitSegment=function(x,c,T,y){var v=this.demuxer,N=this.remuxer;if(!v||!N)return;v.resetInitSegment(c,T,y),N.resetInitSegment(x,c,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,c,T,y,v){var N;return c&&c.method==="SAMPLE-AES"?N=this.transmuxSampleAes(x,c,T,y,v):N=this.transmuxUnencrypted(x,T,y,v),N},C.transmuxUnencrypted=function(x,c,T,y){var v=this.demuxer.demux(x,c,!1,!this.config.progressive),N=v.audioTrack,B=v.avcTrack,O=v.id3Track,j=v.textTrack,P=this.remuxer.remux(N,B,O,j,c,T,!1,this.id);return{remuxResult:P,chunkMeta:y}},C.transmuxSampleAes=function(x,c,T,y,v){var N=this;return this.demuxer.demuxSampleAes(x,c,T).then(function(B){var O=N.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,T,y,!1,N.id);return{remuxResult:O,chunkMeta:v}})},C.configureTransmuxer=function(x,c){for(var T=this.config,y=this.observer,v=this.typeSupported,N=this.vendor,B=c.audioCodec,O=c.defaultInitPts,j=c.duration,P=c.initSegmentData,b=c.videoCodec,Y,ee=0,le=o.length;ee<le;ee++)if(o[ee].demux.probe(x)){Y=o[ee];break}Y||(u.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),Y={demux:W.default,remux:m.default});var ue=this.demuxer,ke=this.remuxer,we=Y.remux,Ae=Y.demux;(!ke||!(ke instanceof we))&&(this.remuxer=new we(y,T,v,N)),(!ue||!(ue instanceof Ae))&&(this.demuxer=new Ae(y,T,v),this.probe=Ae.probe),this.resetInitSegment(P,B,b,j),this.resetInitialTimestamp(O)},C.needsProbing=function(x,c,T){return!this.demuxer||!this.remuxer||c||T},C.getDecrypter=function(){var x=this.decrypter;return x||(x=this.decrypter=new U.default(this.observer,this.config)),x},R}();function a(R,C){var w=null;return R.byteLength>0&&C!=null&&C.key!=null&&C.iv!==null&&C.method!=null&&(w=C),w}var A=function(C){return{remuxResult:{},chunkMeta:C}};function _(R){return"then"in R&&R.then instanceof Function}var S=function(C,w,x,c,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=w,this.initSegmentData=x,this.duration=c,this.defaultInitPts=T},L=function(C,w,x,c,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=w,this.accurateTimeOffset=x,this.trackSwitch=c,this.timeOffset=T}},"./src/demux/tsdemuxer.ts":function(ie,$,M){"use strict";M.r($),M.d($,"discardEPB",function(){return A});var X=M("./src/demux/adts.ts"),F=M("./src/demux/mpegaudio.ts"),U=M("./src/demux/exp-golomb.ts"),G=M("./src/demux/id3.ts"),W=M("./src/demux/sample-aes.ts"),i=M("./src/events.ts"),D=M("./src/utils/mp4-tools.ts"),g=M("./src/utils/logger.ts"),m=M("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},l=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),w=0;w<C;){if(R[w]===71&&R[w+188]===71&&R[w+2*188]===71)return w;w++}return-1},_.createTrack=function(R,C){return{container:R==="video"||R==="audio"?"video/mp2t":void 0,type:R,id:p[R],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:R==="audio"?C:void 0}};var S=_.prototype;return S.resetInitSegment=function(R,C,w){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=_.createTrack("video",w),this._audioTrack=_.createTrack("audio",w),this._id3Track=_.createTrack("id3",w),this._txtTrack=_.createTrack("text",w),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=R,this.videoCodec=C,this._duration=w},S.resetTimeStamp=function(){},S.resetContiguity=function(){var R=this._audioTrack,C=this._avcTrack,w=this._id3Track;R&&(R.pesData=null),C&&(C.pesData=null),w&&(w.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(R,C,w,x){w===void 0&&(w=!1),x===void 0&&(x=!1),w||(this.sampleAes=null);var c,T=this._avcTrack,y=this._audioTrack,v=this._id3Track,N=T.pid,B=T.pesData,O=y.pid,j=v.pid,P=y.pesData,b=v.pesData,Y=!1,ee=this.pmtParsed,le=this._pmtId,ue=R.length;if(this.remainderData&&(R=Object(D.appendUint8Array)(this.remainderData,R),ue=R.length,this.remainderData=null),ue<188&&!x)return this.remainderData=R,{audioTrack:y,avcTrack:T,id3Track:v,textTrack:this._txtTrack};var ke=Math.max(0,_.syncOffset(R));ue-=(ue+ke)%188,ue<R.byteLength&&!x&&(this.remainderData=new Uint8Array(R.buffer,ue,R.buffer.byteLength-ue));for(var we=ke;we<ue;we+=188)if(R[we]===71){var Ae=!!(R[we+1]&64),ce=((R[we+1]&31)<<8)+R[we+2],pe=(R[we+3]&48)>>4,se=void 0;if(pe>1){if(se=we+5+R[we+4],se===we+188)continue}else se=we+4;switch(ce){case N:Ae&&(B&&(c=h(B))&&this.parseAVCPES(c,!1),B={data:[],size:0}),B&&(B.data.push(R.subarray(se,we+188)),B.size+=we+188-se);break;case O:Ae&&(P&&(c=h(P))&&(y.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),P={data:[],size:0}),P&&(P.data.push(R.subarray(se,we+188)),P.size+=we+188-se);break;case j:Ae&&(b&&(c=h(b))&&this.parseID3PES(c),b={data:[],size:0}),b&&(b.data.push(R.subarray(se,we+188)),b.size+=we+188-se);break;case 0:Ae&&(se+=R[se]+1),le=this._pmtId=f(R,se);break;case le:{Ae&&(se+=R[se]+1);var ae=o(R,se,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,w);N=ae.avc,N>0&&(T.pid=N),O=ae.audio,O>0&&(y.pid=O,y.isAAC=ae.isAAC),j=ae.id3,j>0&&(v.pid=j),Y&&!ee&&(g.logger.log("reparse from beginning"),Y=!1,we=ke-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:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T.pesData=B,y.pesData=P,v.pesData=b;var Oe={audioTrack:y,avcTrack:T,id3Track:v,textTrack:this._txtTrack};return x&&this.extractRemainingSamples(Oe),Oe},S.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},S.extractRemainingSamples=function(R){var C=R.audioTrack,w=R.avcTrack,x=R.id3Track,c=w.pesData,T=C.pesData,y=x.pesData,v;c&&(v=h(c))?(this.parseAVCPES(v,!0),w.pesData=null):w.pesData=c,T&&(v=h(T))?(C.isAAC?this.parseAACPES(v):this.parseMPEGPES(v),C.pesData=null):(T!=null&&T.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),C.pesData=T),y&&(v=h(y))?(this.parseID3PES(v),x.pesData=null):x.pesData=y},S.demuxSampleAes=function(R,C,w){var x=this.demux(R,w,!0,!this.config.progressive),c=this.sampleAes=new W.default(this.observer,this.config,C);return this.decrypt(x,c)},S.decrypt=function(R,C){return new Promise(function(w){var x=R.audioTrack,c=R.avcTrack;x.samples&&x.isAAC?C.decryptAacSamples(x.samples,0,function(){c.samples?C.decryptAvcSamples(c.samples,0,0,function(){w(R)}):w(R)}):c.samples&&C.decryptAvcSamples(c.samples,0,0,function(){w(R)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(R,C){var w=this,x=this._avcTrack,c=this.parseAVCNALu(R.data),T=!1,y=this.avcSample,v,N=!1;R.data=null,y&&c.length&&!x.audFound&&(s(y,x),y=this.avcSample=u(!1,R.pts,R.dts,"")),c.forEach(function(B){switch(B.type){case 1:{v=!0,y||(y=w.avcSample=u(!0,R.pts,R.dts,"")),T&&(y.debug+="NDR "),y.frame=!0;var O=B.data;if(N&&O.length>4){var j=new U.default(O).readSliceType();(j===2||j===4||j===7||j===9)&&(y.key=!0)}break}case 5:v=!0,y||(y=w.avcSample=u(!0,R.pts,R.dts,"")),T&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{v=!0,T&&y&&(y.debug+="SEI ");var P=new U.default(A(B.data));P.readUByte();for(var b=0,Y=0,ee=!1,le=0;!ee&&P.bytesAvailable>1;){b=0;do le=P.readUByte(),b+=le;while(le===255);Y=0;do le=P.readUByte(),Y+=le;while(le===255);if(b===4&&P.bytesAvailable!==0){ee=!0;var ue=P.readUByte();if(ue===181){var ke=P.readUShort();if(ke===49){var we=P.readUInt();if(we===1195456820){var Ae=P.readUByte();if(Ae===3){for(var ce=P.readUByte(),pe=P.readUByte(),se=31&ce,ae=[ce,pe],Oe=0;Oe<se;Oe++)ae.push(P.readUByte()),ae.push(P.readUByte()),ae.push(P.readUByte());a(w._txtTrack.samples,{type:3,pts:R.pts,bytes:ae})}}}}}else if(b===5&&P.bytesAvailable!==0){if(ee=!0,Y>16){for(var xe=[],Pe=0;Pe<16;Pe++)xe.push(P.readUByte().toString(16)),(Pe===3||Pe===5||Pe===7||Pe===9)&&xe.push("-");for(var De=Y-16,Ge=new Uint8Array(De),Le=0;Le<De;Le++)Ge[Le]=P.readUByte();a(w._txtTrack.samples,{pts:R.pts,payloadType:b,uuid:xe.join(""),userData:Object(G.utf8ArrayToStr)(Ge),userDataBytes:Ge})}}else if(Y<P.bytesAvailable)for(var Fe=0;Fe<Y;Fe++)P.readUByte()}break}case 7:if(v=!0,N=!0,T&&y&&(y.debug+="SPS "),!x.sps){var We=new U.default(B.data),oe=We.readSPS();x.width=oe.width,x.height=oe.height,x.pixelRatio=oe.pixelRatio,x.sps=[B.data],x.duration=w._duration;for(var ge=B.data.subarray(1,4),Se="avc1.",Ce=0;Ce<3;Ce++){var je=ge[Ce].toString(16);je.length<2&&(je="0"+je),Se+=je}x.codec=Se}break;case 8:v=!0,T&&y&&(y.debug+="PPS "),x.pps||(x.pps=[B.data]);break;case 9:v=!1,x.audFound=!0,y&&s(y,x),y=w.avcSample=u(!1,R.pts,R.dts,T?"AUD ":"");break;case 12:v=!1;break;default:v=!1,y&&(y.debug+="unknown NAL "+B.type+" ");break}if(y&&v){var Ve=y.units;Ve.push(B)}}),C&&y&&(s(y,x),this.avcSample=null)},S.getLastNalUnit=function(){var R,C=this.avcSample,w;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 c=C.units;w=c[c.length-1]}return w},S.parseAVCNALu=function(R){var C=R.byteLength,w=this._avcTrack,x=w.naluState||0,c=x,T=[],y=0,v,N,B,O=-1,j=0;for(x===-1&&(O=0,j=R[0]&31,x=0,y=1);y<C;){if(v=R[y++],!x){x=v?0:1;continue}if(x===1){x=v?0:2;continue}if(!v)x=3;else if(v===1){if(O>=0){var P={data:R.subarray(O,y-x-1),type:j};T.push(P)}else{var b=this.getLastNalUnit();if(b&&(c&&y<=4-c&&(b.state&&(b.data=b.data.subarray(0,b.data.byteLength-c))),N=y-x-1,N>0)){var Y=new Uint8Array(b.data.byteLength+N);Y.set(b.data,0),Y.set(R.subarray(0,N),b.data.byteLength),b.data=Y,b.state=0}}y<C?(B=R[y]&31,O=y,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 le=this.getLastNalUnit();if(le){var ue=new Uint8Array(le.data.byteLength+R.byteLength);ue.set(le.data,0),ue.set(R,le.data.byteLength),le.data=ue}}return w.naluState=x,T},S.parseAACPES=function(R){var C=0,w=this._audioTrack,x=this.aacOverFlow,c=R.data;if(x){this.aacOverFlow=null;var T=x.sample.unit.byteLength,y=Math.min(x.missing,T),v=T-y;x.sample.unit.set(c.subarray(0,y),v),w.samples.push(x.sample),C=x.missing}var N,B;for(N=C,B=c.length;N<B-1&&!X.isHeader(c,N);N++);if(N!==C){var O,j;if(N<B-1?(O="AAC PES did not start with ADTS header,offset:"+N,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:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:j,reason:O}),j)return}X.initTrackConfig(w,this.observer,c,N,this.audioCodec);var P;if(R.pts!==void 0)P=R.pts;else if(x){var b=X.getFrameDuration(w.samplerate);P=x.sample.pts+b}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var Y=0;N<B;)if(X.isHeader(c,N)){if(N+5<B){var ee=X.appendFrame(w,c,N,P,Y);if(ee)if(ee.missing)this.aacOverFlow=ee;else{N+=ee.length,Y++;continue}}break}else N++},S.parseMPEGPES=function(R){var C=R.data,w=C.length,x=0,c=0,T=R.pts;if(T===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<w;)if(F.isHeader(C,c)){var y=F.appendFrame(this._audioTrack,C,c,T,x);if(y)c+=y.length,x++;else break}else c++},S.parseID3PES=function(R){if(R.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(R)},_}();l.minProbeByteLength=188;function u(_,S,L,R){return{key:_,frame:!1,pts:S,dts:L,units:[],debug:R,length:0}}function f(_,S){return(_[S+10]&31)<<8|_[S+11]}function o(_,S,L,R){var C={audio:-1,avc:-1,id3:-1,isAAC:!0},w=(_[S+1]&15)<<8|_[S+2],x=S+3+w-4,c=(_[S+10]&15)<<8|_[S+11];for(S+=12+c;S<x;){var T=(_[S+1]&31)<<8|_[S+2];switch(_[S]){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}S+=((_[S+3]&15)<<8|_[S+4])+5}return C}function h(_){var S=0,L,R,C,w,x,c=_.data;if(!_||_.size===0)return null;for(;c[0].length<19&&c.length>1;){var T=new Uint8Array(c[0].length+c[1].length);T.set(c[0]),T.set(c[1],c[0].length),c[0]=T,c.splice(1,1)}L=c[0];var y=(L[0]<<16)+(L[1]<<8)+L[2];if(y===1){if(R=(L[4]<<8)+L[5],R&&R>_.size-6)return null;var v=L[7];v&192&&(w=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,v&64?(x=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,w-x>60*9e4&&(g.logger.warn(Math.round((w-x)/9e4)+"s delta between PTS and DTS, align them"),w=x)):x=w),C=L[8];var N=C+9;if(_.size<=N)return null;_.size-=N;for(var B=new Uint8Array(_.size),O=0,j=c.length;O<j;O++){L=c[O];var P=L.byteLength;if(N)if(N>P){N-=P;continue}else L=L.subarray(N),P-=N,N=0;B.set(L,S),S+=P}return R&&(R-=C+3),{data:B,pts:w,dts:x,len:R}}return null}function s(_,S){if(_.units.length&&_.frame){if(_.pts===void 0){var L=S.samples,R=L.length;if(R){var C=L[R-1];_.pts=C.pts,_.dts=C.dts}else{S.dropped++;return}}S.samples.push(_)}_.debug.length&&g.logger.log(_.pts+"/"+_.dts+":"+_.debug)}function a(_,S){var L=_.length;if(L>0){if(S.pts>=_[L-1].pts)_.push(S);else for(var R=L-1;R>=0;R--)if(S.pts<_[R].pts){_.splice(R,0,S);break}}else _.push(S)}function A(_){for(var S=_.byteLength,L=[],R=1;R<S-2;)_[R]===0&&_[R+1]===0&&_[R+2]===3?(L.push(R+2),R+=2):R++;if(L.length===0)return _;var C=S-L.length,w=new Uint8Array(C),x=0;for(R=0;R<C;x++,R++)x===L[0]&&(x++,L.shift()),w[R]=_[x];return w}$.default=l},"./src/errors.ts":function(ie,$,M){"use strict";M.r($),M.d($,"ErrorTypes",function(){return X}),M.d($,"ErrorDetails",function(){return F});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 F;(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"})(F||(F={}))},"./src/events.ts":function(ie,$,M){"use strict";M.r($),M.d($,"Events",function(){return X});var X;(function(F){F.MEDIA_ATTACHING="hlsMediaAttaching",F.MEDIA_ATTACHED="hlsMediaAttached",F.MEDIA_DETACHING="hlsMediaDetaching",F.MEDIA_DETACHED="hlsMediaDetached",F.BUFFER_RESET="hlsBufferReset",F.BUFFER_CODECS="hlsBufferCodecs",F.BUFFER_CREATED="hlsBufferCreated",F.BUFFER_APPENDING="hlsBufferAppending",F.BUFFER_APPENDED="hlsBufferAppended",F.BUFFER_EOS="hlsBufferEos",F.BUFFER_FLUSHING="hlsBufferFlushing",F.BUFFER_FLUSHED="hlsBufferFlushed",F.MANIFEST_LOADING="hlsManifestLoading",F.MANIFEST_LOADED="hlsManifestLoaded",F.MANIFEST_PARSED="hlsManifestParsed",F.LEVEL_SWITCHING="hlsLevelSwitching",F.LEVEL_SWITCHED="hlsLevelSwitched",F.LEVEL_LOADING="hlsLevelLoading",F.LEVEL_LOADED="hlsLevelLoaded",F.LEVEL_UPDATED="hlsLevelUpdated",F.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",F.LEVELS_UPDATED="hlsLevelsUpdated",F.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",F.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",F.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",F.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",F.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",F.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",F.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",F.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",F.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",F.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",F.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",F.CUES_PARSED="hlsCuesParsed",F.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",F.INIT_PTS_FOUND="hlsInitPtsFound",F.FRAG_LOADING="hlsFragLoading",F.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",F.FRAG_LOADED="hlsFragLoaded",F.FRAG_DECRYPTED="hlsFragDecrypted",F.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",F.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",F.FRAG_PARSING_METADATA="hlsFragParsingMetadata",F.FRAG_PARSED="hlsFragParsed",F.FRAG_BUFFERED="hlsFragBuffered",F.FRAG_CHANGED="hlsFragChanged",F.FPS_DROP="hlsFpsDrop",F.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",F.ERROR="hlsError",F.DESTROYING="hlsDestroying",F.KEY_LOADING="hlsKeyLoading",F.KEY_LOADED="hlsKeyLoaded",F.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",F.BACK_BUFFER_REACHED="hlsBackBufferReached"})(X||(X={}))},"./src/hls.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return _});var X=M("./node_modules/url-toolkit/src/url-toolkit.js"),F=M.n(X),U=M("./src/loader/playlist-loader.ts"),G=M("./src/loader/key-loader.ts"),W=M("./src/controller/id3-track-controller.ts"),i=M("./src/controller/latency-controller.ts"),D=M("./src/controller/level-controller.ts"),g=M("./src/controller/fragment-tracker.ts"),m=M("./src/controller/stream-controller.ts"),p=M("./src/is-supported.ts"),l=M("./src/utils/logger.ts"),u=M("./src/config.ts"),f=M("./node_modules/eventemitter3/index.js"),o=M.n(f),h=M("./src/events.ts"),s=M("./src/errors.ts");function a(S,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(S,C.key,C)}}function A(S,L,R){return L&&a(S.prototype,L),R&&a(S,R),S}var _=function(){S.isSupported=function(){return Object(p.isSupported)()};function S(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(u.mergeConfig)(S.DefaultConfig,R);this.userConfig=R,Object(l.enableLogs)(C.debug),this._autoLevelCapping=-1,C.progressive&&Object(u.enableStreamingMode)(C);var w=C.abrController,x=C.bufferController,c=C.capLevelController,T=C.fpsController,y=this.abrController=new w(this),v=this.bufferController=new x(this),N=this.capLevelController=new c(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 m.default(this,Y);N.setStreamController(ee),B.setStreamController(ee);var le=[b,ee];this.networkControllers=le;var ue=[O,j,y,v,N,B,P,Y];this.audioTrackController=this.createController(C.audioTrackController,null,le),this.createController(C.audioStreamController,Y,le),this.subtitleTrackController=this.createController(C.subtitleTrackController,null,le),this.createController(C.subtitleStreamController,Y,le),this.createController(C.timelineController,null,ue),this.emeController=this.createController(C.emeController,null,ue),this.cmcdController=this.createController(C.cmcdController,null,ue),this.latencyController=this.createController(i.default,null,ue),this.coreComponents=ue}var L=S.prototype;return L.createController=function(C,w,x){if(C){var c=w?new C(this,w):new C(this);return x&&x.push(c),c}return null},L.on=function(C,w,x){x===void 0&&(x=this),this._emitter.on(C,w,x)},L.once=function(C,w,x){x===void 0&&(x=this),this._emitter.once(C,w,x)},L.removeAllListeners=function(C){this._emitter.removeAllListeners(C)},L.off=function(C,w,x,c){x===void 0&&(x=this),this._emitter.off(C,w,x,c)},L.listeners=function(C){return this._emitter.listeners(C)},L.emit=function(C,w,x){return this._emitter.emit(C,w,x)},L.trigger=function(C,w){if(this.config.debug)return this.emit(C,C,w);try{return this.emit(C,C,w)}catch(x){l.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:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:C,error:x})}return!1},L.listenerCount=function(C){return this._emitter.listenerCount(C)},L.destroy=function(){l.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){l.logger.log("attachMedia"),this._media=C,this.trigger(h.Events.MEDIA_ATTACHING,{media:C})},L.detachMedia=function(){l.logger.log("detachMedia"),this.trigger(h.Events.MEDIA_DETACHING,void 0),this._media=null},L.loadSource=function(C){this.stopLoad();var w=this.media,x=this.url,c=this.url=X.buildAbsoluteURL(self.location.href,C,{alwaysNormalize:!0});l.logger.log("loadSource:"+c),w&&x&&x!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(w)),this.trigger(h.Events.MANIFEST_LOADING,{url:C})},L.startLoad=function(C){C===void 0&&(C=-1),l.logger.log("startLoad("+C+")"),this.networkControllers.forEach(function(w){w.startLoad(C)})},L.stopLoad=function(){l.logger.log("stopLoad"),this.networkControllers.forEach(function(C){C.stopLoad()})},L.swapAudioCodec=function(){l.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},L.recoverMediaError=function(){l.logger.log("recoverMediaError");var C=this._media;this.detachMedia(),C&&this.attachMedia(C)},L.removeLevel=function(C,w){w===void 0&&(w=0),this.levelController.removeLevel(C,w)},A(S,[{key:"levels",get:function(){var C=this.levelController.levels;return C||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(C){l.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){l.logger.log("set nextLevel:"+C),this.levelController.manualLevel=C,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(C){l.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){l.logger.log("set firstLevel:"+C),this.levelController.firstLevel=C}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(C){l.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 w=!!C;w!==this.config.capLevelToPlayerSize&&(w?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=w)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(C){this._autoLevelCapping!==C&&(l.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,w=this.config.minAutoBitrate;if(!C)return 0;for(var x=C.length,c=0;c<x;c++)if(C[c].maxBitrate>w)return c;return 0}},{key:"maxAutoLevel",get:function(){var C=this.levels,w=this.autoLevelCapping,x;return w===-1&&C&&C.length?x=C.length-1:x=w,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 w=this.audioTrackController;w&&(w.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 w=this.subtitleTrackController;w&&(w.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 w=this.subtitleTrackController;w&&(w.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 s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:u.hlsDefaultConfig},set:function(C){S.defaultConfig=C}}]),S}();_.defaultConfig=void 0},"./src/is-supported.ts":function(ie,$,M){"use strict";M.r($),M.d($,"isSupported",function(){return U}),M.d($,"changeTypeSupported",function(){return G});var X=M("./src/utils/mediasource-helper.ts");function F(){return self.SourceBuffer||self.WebKitSourceBuffer}function U(){var W=Object(X.getMediaSource)();if(!W)return!1;var i=F(),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=F();return typeof(i==null||((W=i.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return l}),M.d($,"LoadError",function(){return f});var X=M("./src/polyfills/number.ts"),F=M("./src/errors.ts");function U(o,h){o.prototype=Object.create(h.prototype),o.prototype.constructor=o,g(o,h)}function G(o){var h=typeof Map=="function"?new Map:void 0;return G=function(a){if(a===null||!D(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h!="undefined"){if(h.has(a))return h.get(a);h.set(a,A)}function A(){return W(a,arguments,m(this).constructor)}return A.prototype=Object.create(a.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),g(A,a)},G(o)}function W(o,h,s){return i()?W=Reflect.construct:W=function(A,_,S){var L=[null];L.push.apply(L,_);var R=Function.bind.apply(A,L),C=new R;return S&&g(C,S.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(o){return!1}}function D(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function g(o,h){return g=Object.setPrototypeOf||function(a,A){return a.__proto__=A,a},g(o,h)}function m(o){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},m(o)}var p=Math.pow(2,17),l=function(){function o(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var h=o.prototype;return h.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},h.abort=function(){this.loader&&this.loader.abort()},h.load=function(a,A){var _=this,S=a.url;if(!S)return Promise.reject(new f({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var L=this.config,R=L.fLoader,C=L.loader;return new Promise(function(w,x){_.loader&&_.loader.destroy();var c=_.loader=a.loader=R?new R(L):new C(L),T=u(a),y={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:p};a.stats=c.stats,c.load(T,y,{onSuccess:function(N,B,O,j){_.resetLoader(a,c),w({frag:a,part:null,payload:N.data,networkDetails:j})},onError:function(N,B,O){_.resetLoader(a,c),x(new f({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,response:N,networkDetails:O}))},onAbort:function(N,B,O){_.resetLoader(a,c),x(new f({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,networkDetails:O}))},onTimeout:function(N,B,O){_.resetLoader(a,c),x(new f({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,networkDetails:O}))},onProgress:function(N,B,O,j){A&&A({frag:a,part:null,payload:O,networkDetails:j})}})})},h.loadPart=function(a,A,_){var S=this;this.abort();var L=this.config,R=L.fLoader,C=L.loader;return new Promise(function(w,x){S.loader&&S.loader.destroy();var c=S.loader=a.loader=R?new R(L):new C(L),T=u(a,A),y={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:p};A.stats=c.stats,c.load(T,y,{onSuccess:function(N,B,O,j){S.resetLoader(a,c),S.updateStatsFromPart(a,A);var P={frag:a,part:A,payload:N.data,networkDetails:j};_(P),w(P)},onError:function(N,B,O){S.resetLoader(a,c),x(new f({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,part:A,response:N,networkDetails:O}))},onAbort:function(N,B,O){a.stats.aborted=A.stats.aborted,S.resetLoader(a,c),x(new f({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,part:A,networkDetails:O}))},onTimeout:function(N,B,O){S.resetLoader(a,c),x(new f({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,part:A,networkDetails:O}))}})})},h.updateStatsFromPart=function(a,A){var _=a.stats,S=A.stats,L=S.total;if(_.loaded+=S.loaded,L){var R=Math.round(a.duration/A.duration),C=Math.min(Math.round(_.loaded/L),R),w=R-C,x=w*Math.round(_.loaded/C);_.total=_.loaded+x}else _.total=Math.max(_.loaded,_.total);var c=_.loading,T=S.loading;c.start?c.first+=T.first-T.start:(c.start=T.start,c.first=T.first),c.end=T.end},h.resetLoader=function(a,A){a.loader=null,this.loader===A&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),A.destroy()},o}();function u(o,h){h===void 0&&(h=null);var s=h||o,a={frag:o,part:h,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},A=s.byteRangeStartOffset,_=s.byteRangeEndOffset;return Object(X.isFiniteNumber)(A)&&Object(X.isFiniteNumber)(_)&&(a.rangeStart=A,a.rangeEnd=_),a}var f=function(o){U(h,o);function h(s){for(var a,A=arguments.length,_=new Array(A>1?A-1:0),S=1;S<A;S++)_[S-1]=arguments[S];return a=o.call.apply(o,[this].concat(_))||this,a.data=void 0,a.data=s,a}return h}(G(Error))},"./src/loader/fragment.ts":function(ie,$,M){"use strict";M.r($),M.d($,"ElementaryStreamTypes",function(){return l}),M.d($,"BaseSegment",function(){return u}),M.d($,"Fragment",function(){return f}),M.d($,"Part",function(){return o});var X=M("./src/polyfills/number.ts"),F=M("./node_modules/url-toolkit/src/url-toolkit.js"),U=M.n(F),G=M("./src/utils/logger.ts"),W=M("./src/loader/level-key.ts"),i=M("./src/loader/load-stats.ts");function D(h,s){h.prototype=Object.create(s.prototype),h.prototype.constructor=h,g(h,s)}function g(h,s){return g=Object.setPrototypeOf||function(A,_){return A.__proto__=_,A},g(h,s)}function m(h,s){for(var a=0;a<s.length;a++){var A=s[a];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}function p(h,s,a){return s&&m(h.prototype,s),a&&m(h,a),h}var l;(function(h){h.AUDIO="audio",h.VIDEO="video",h.AUDIOVIDEO="audiovideo"})(l||(l={}));var u=function(){function h(a){var A;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(A={},A[l.AUDIO]=null,A[l.VIDEO]=null,A[l.AUDIOVIDEO]=null,A),this.baseurl=a}var s=h.prototype;return s.setByteRange=function(A,_){var S=A.split("@",2),L=[];S.length===1?L[0]=_?_.byteRangeEndOffset:0:L[0]=parseInt(S[1]),L[1]=parseInt(S[0])+L[0],this._byteRange=L},p(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(F.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(A){this._url=A}}]),h}(),f=function(h){D(s,h);function s(A,_){var S;return S=h.call(this,_)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new i.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=A,S}var a=s.prototype;return a.createInitializationVector=function(_){for(var S=new Uint8Array(16),L=12;L<16;L++)S[L]=_>>8*(15-L)&255;return S},a.setDecryptDataFromLevelKey=function(_,S){var L=_;return(_==null?void 0:_.method)==="AES-128"&&_.uri&&!_.iv&&(L=W.LevelKey.fromURI(_.uri),L.method=_.method,L.iv=this.createInitializationVector(S),L.keyFormat="identity"),L},a.setElementaryStreamInfo=function(_,S,L,R,C,w){w===void 0&&(w=!1);var x=this.elementaryStreams,c=x[_];if(!c){x[_]={startPTS:S,endPTS:L,startDTS:R,endDTS:C,partial:w};return}c.startPTS=Math.min(c.startPTS,S),c.endPTS=Math.max(c.endPTS,L),c.startDTS=Math.min(c.startDTS,R),c.endDTS=Math.max(c.endDTS,C)},a.clearElementaryStreamInfo=function(){var _=this.elementaryStreams;_[l.AUDIO]=null,_[l.VIDEO]=null,_[l.AUDIOVIDEO]=null},p(s,[{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)}}]),s}(u),o=function(h){D(s,h);function s(a,A,_,S,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=a.decimalFloatingPoint("DURATION"),R.gap=a.bool("GAP"),R.independent=a.bool("INDEPENDENT"),R.relurl=a.enumeratedString("URI"),R.fragment=A,R.index=S;var C=a.enumeratedString("BYTERANGE");return C&&R.setByteRange(C,L),L&&(R.fragOffset=L.fragOffset+L.duration),R}return p(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var A=this.elementaryStreams;return!!(A.audio||A.video||A.audiovideo)}}]),s}(u)},"./src/loader/key-loader.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return G});var X=M("./src/events.ts"),F=M("./src/errors.ts"),U=M("./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 m=this.loaders[g];m&&m.destroy()}this.loaders={}},i.onKeyLoading=function(g,m){var p=m.frag,l=p.type,u=this.loaders[l];if(!p.decryptdata){U.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=p.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(u&&(U.logger.warn("abort previous key loader for type:"+l),u.abort()),!f){U.logger.warn("key uri is falsy");return}var h=o.loader,s=p.loader=this.loaders[l]=new h(o);this.decrypturl=f,this.decryptkey=null;var a={url:f,frag:p,responseType:"arraybuffer"},A={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},_={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(a,A,_)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:p}))},i.loadsuccess=function(g,m,p){var l=p.frag;if(!l.decryptdata){U.logger.error("after key load, decryptdata unset");return}this.decryptkey=l.decryptdata.key=new Uint8Array(g.data),l.loader=null,delete this.loaders[l.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:l})},i.loaderror=function(g,m){var p=m.frag,l=p.loader;l&&l.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:g})},i.loadtimeout=function(g,m){var p=m.frag,l=p.loader;l&&l.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},W}()},"./src/loader/level-details.ts":function(ie,$,M){"use strict";M.r($),M.d($,"LevelDetails",function(){return W});var X=M("./src/polyfills/number.ts");function F(i,D){for(var g=0;g<D.length;g++){var m=D[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(i,m.key,m)}}function U(i,D,g){return D&&F(i.prototype,D),g&&F(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(m){if(!m){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-m.lastPartSn,l=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!l||!!p,this.advanced=this.endSN>m.endSN||p>0||p===0&&l>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.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 m=this.driftEndTime-this.driftStartTime;if(m>0){var p=this.driftEnd-this.driftStart;return p*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.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 m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),i}()},"./src/loader/level-key.ts":function(ie,$,M){"use strict";M.r($),M.d($,"LevelKey",function(){return W});var X=M("./node_modules/url-toolkit/src/url-toolkit.js"),F=M.n(X);function U(i,D){for(var g=0;g<D.length;g++){var m=D[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(i,m.key,m)}}function G(i,D,g){return D&&U(i.prototype,D),g&&U(i,g),i}var W=function(){i.fromURL=function(g,m){return new i(g,m)},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(ie,$,M){"use strict";M.r($),M.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(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return s});var X=M("./src/polyfills/number.ts"),F=M("./node_modules/url-toolkit/src/url-toolkit.js"),U=M.n(F),G=M("./src/loader/fragment.ts"),W=M("./src/loader/level-details.ts"),i=M("./src/loader/level-key.ts"),D=M("./src/utils/attr-list.ts"),g=M("./src/utils/logger.ts"),m=M("./src/utils/codecs.ts"),p=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,l=/#EXT-X-MEDIA:(.*)/g,u=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("|")),o=/\.(mp4|m4s|m4v|m4a)$/i;function h(L){var R,C;return o.test((R=(C=F.parseURL(L))===null||C===void 0?void 0:C.path)!=null?R:"")}var s=function(){function L(){}return L.findGroup=function(C,w){for(var x=0;x<C.length;x++){var c=C[x];if(c.id===w)return c}},L.convertAVC1ToAVCOTI=function(C){var w=C.split(".");if(w.length>2){var x=w.shift()+".";return x+=parseInt(w.shift()).toString(16),x+=("000"+parseInt(w.shift()).toString(16)).substr(-4),x}return C},L.resolve=function(C,w){return F.buildAbsoluteURL(w,C,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(C,w){var x=[],c={},T=!1;p.lastIndex=0;for(var y;(y=p.exec(C))!=null;)if(y[1]){var v=new D.AttrList(y[1]),N={attrs:v,bitrate:v.decimalInteger("AVERAGE-BANDWIDTH")||v.decimalInteger("BANDWIDTH"),name:v.NAME,url:L.resolve(y[2],w)},B=v.decimalResolution("RESOLUTION");B&&(N.width=B.width,N.height=B.height),a((v.CODECS||"").split(/[ ,]+/).filter(function(j){return j}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=L.convertAVC1ToAVCOTI(N.videoCodec)),x.push(N)}else if(y[3]){var O=new D.AttrList(y[3]);O["DATA-ID"]&&(T=!0,c[O["DATA-ID"]]=O)}return{levels:x,sessionData:T?c:null}},L.parseMasterPlaylistMedia=function(C,w,x,c){c===void 0&&(c=[]);var T,y=[],v=0;for(l.lastIndex=0;(T=l.exec(C))!==null;){var N=new D.AttrList(T[1]);if(N.TYPE===x){var B={attrs:N,bitrate:0,id:v++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:x,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?L.resolve(N.URI,w):""};if(c.length){var O=L.findGroup(c,B.groupId)||c[0];A(B,O,"audioCodec"),A(B,O,"textCodec")}y.push(B)}}return y},L.parseLevelPlaylist=function(C,w,x,c,T){var y=new W.LevelDetails(w),v=y.fragments,N=null,B=0,O=0,j=0,P=0,b=null,Y=new G.Fragment(c,w),ee,le,ue,ke=-1,we=!1;for(u.lastIndex=0,y.m3u8=C;(ee=u.exec(C))!==null;){we&&(we=!1,Y=new G.Fragment(c,w),Y.start=j,Y.sn=B,Y.cc=P,Y.level=x,N&&(Y.initSegment=N,Y.rawProgramDateTime=N.rawProgramDateTime));var Ae=ee[1];if(Ae){Y.duration=parseFloat(Ae);var ce=(" "+ee[2]).slice(1);Y.title=ce||null,Y.tagList.push(ce?["INF",Ae,ce]:["INF",Ae])}else if(ee[3])Object(X.isFiniteNumber)(Y.duration)&&(Y.start=j,ue&&(Y.levelkey=ue),Y.sn=B,Y.level=x,Y.cc=P,Y.urlId=T,v.push(Y),Y.relurl=(" "+ee[3]).slice(1),S(Y,b),b=Y,j+=Y.duration,B++,O=0,we=!0);else if(ee[4]){var pe=(" "+ee[4]).slice(1);b?Y.setByteRange(pe,b):Y.setByteRange(pe)}else if(ee[5])Y.rawProgramDateTime=(" "+ee[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),ke===-1&&(ke=v.length);else{if(ee=ee[0].match(f),!ee){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(le=1;le<ee.length&&!(typeof ee[le]!="undefined");le++);var se=(" "+ee[le]).slice(1),ae=(" "+ee[le+1]).slice(1),Oe=ee[le+2]?(" "+ee[le+2]).slice(1):"";switch(se){case"PLAYLIST-TYPE":y.type=ae.toUpperCase();break;case"MEDIA-SEQUENCE":B=y.startSN=parseInt(ae);break;case"SKIP":{var xe=new D.AttrList(ae),Pe=xe.decimalInteger("SKIPPED-SEGMENTS");if(Object(X.isFiniteNumber)(Pe)){y.skippedSegments=Pe;for(var De=Pe;De--;)v.unshift(null);B+=Pe}var Ge=xe.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ge&&(y.recentlyRemovedDateranges=Ge.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(ae);break;case"VERSION":y.version=parseInt(ae);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(ae||Oe)&&Y.tagList.push(Oe?[ae,Oe]:[ae]);break;case"DIS":P++;case"GAP":Y.tagList.push([se]);break;case"BITRATE":Y.tagList.push([se,ae]);break;case"DISCONTINUITY-SEQ":P=parseInt(ae);break;case"KEY":{var Le,Fe=new D.AttrList(ae),We=Fe.enumeratedString("METHOD"),oe=Fe.URI,ge=Fe.hexadecimalInteger("IV"),Se=Fe.enumeratedString("KEYFORMATVERSIONS"),Ce=Fe.enumeratedString("KEYID"),je=(Le=Fe.enumeratedString("KEYFORMAT"))!=null?Le:"identity",Ve=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ve.indexOf(je)>-1){g.logger.warn("Keyformat "+je+" is not supported from the manifest");continue}else if(je!=="identity")continue;We&&(ue=i.LevelKey.fromURL(w,oe),oe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(We)>=0&&(ue.method=We,ue.keyFormat=je,Ce&&(ue.keyID=Ce),Se&&(ue.keyFormatVersions=Se),ue.iv=ge));break}case"START":{var Qe=new D.AttrList(ae),Je=Qe.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(Je)&&(y.startTimeOffset=Je);break}case"MAP":{var at=new D.AttrList(ae);Y.relurl=at.URI,at.BYTERANGE&&Y.setByteRange(at.BYTERANGE),Y.level=x,Y.sn="initSegment",ue&&(Y.levelkey=ue),Y.initSegment=null,N=Y,we=!0;break}case"SERVER-CONTROL":{var Xe=new D.AttrList(ae);y.canBlockReload=Xe.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=Xe.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&Xe.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=Xe.optionalFloat("PART-HOLD-BACK",0),y.holdBack=Xe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var qe=new D.AttrList(ae);y.partTarget=qe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ne=y.partList;Ne||(Ne=y.partList=[]);var lt=O>0?Ne[Ne.length-1]:void 0,nt=O++,Be=new G.Part(new D.AttrList(ae),Y,w,nt,lt);Ne.push(Be),Y.duration+=Be.duration;break}case"PRELOAD-HINT":{var Ue=new D.AttrList(ae);y.preloadHint=Ue;break}case"RENDITION-REPORT":{var Te=new D.AttrList(ae);y.renditionReports=y.renditionReports||[],y.renditionReports.push(Te);break}default:g.logger.warn("line parsed but not handled: "+ee);break}}}b&&!b.relurl?(v.pop(),j-=b.duration,y.partList&&(y.fragmentHint=b)):y.partList&&(S(Y,b),Y.cc=P,y.fragmentHint=Y);var ve=v.length,_e=v[0],re=v[ve-1];if(j+=y.skippedSegments*y.targetduration,j>0&&ve&&re){y.averagetargetduration=j/ve;var ne=re.sn;y.endSN=ne!=="initSegment"?ne:0,_e&&(y.startCC=_e.cc,_e.initSegment||y.fragments.every(function(he){return he.relurl&&h(he.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),Y=new G.Fragment(c,w),Y.relurl=re.relurl,Y.level=x,Y.sn="initSegment",_e.initSegment=Y,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(j+=y.fragmentHint.duration),y.totalduration=j,y.endCC=P,ke>0&&_(v,ke),y},L}();function a(L,R){["video","audio","text"].forEach(function(C){var w=L.filter(function(c){return Object(m.isCodecType)(c,C)});if(w.length){var x=w.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});R[C+"Codec"]=x.length>0?x[0]:w[0],L=L.filter(function(c){return w.indexOf(c)===-1})}}),R.unknownCodecs=L}function A(L,R,C){var w=R[C];w&&(L[C]=w)}function _(L,R){for(var C=L[R],w=R;w--;){var x=L[w];if(!x)return;x.programDateTime=C.programDateTime-x.duration*1e3,C=x}}function S(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(ie,$,M){"use strict";M.r($);var X=M("./src/polyfills/number.ts"),F=M("./src/events.ts"),U=M("./src/errors.ts"),G=M("./src/utils/logger.ts"),W=M("./src/utils/mp4-tools.ts"),i=M("./src/loader/m3u8-parser.ts"),D=M("./src/types/loader.ts"),g=M("./src/utils/attr-list.ts");function m(u){var f=u.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 p(u,f){var o=u.url;return(o===void 0||o.indexOf("data:")===0)&&(o=f.url),o}var l=function(){function u(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var f=u.prototype;return f.registerListeners=function(){var h=this.hls;h.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(F.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.on(F.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var h=this.hls;h.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(F.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(F.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.off(F.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(h){var s=this.hls.config,a=s.pLoader,A=s.loader,_=a||A,S=new _(s);return h.loader=S,this.loaders[h.type]=S,S},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 s=this.loaders[h];s&&s.destroy(),this.resetInternalLoader(h)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(h,s){var a=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:a,deliveryDirectives:null})},f.onLevelLoading=function(h,s){var a=s.id,A=s.level,_=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:null,level:A,responseType:"text",type:D.PlaylistContextType.LEVEL,url:_,deliveryDirectives:S})},f.onAudioTrackLoading=function(h,s){var a=s.id,A=s.groupId,_=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:A,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:_,deliveryDirectives:S})},f.onSubtitleTrackLoading=function(h,s){var a=s.id,A=s.groupId,_=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:A,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:_,deliveryDirectives:S})},f.load=function(h){var s,a=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 S,L,R,C;switch(h.type){case D.PlaylistContextType.MANIFEST:S=a.manifestLoadingMaxRetry,L=a.manifestLoadingTimeOut,R=a.manifestLoadingRetryDelay,C=a.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:S=0,L=a.levelLoadingTimeOut;break;default:S=a.levelLoadingMaxRetry,L=a.levelLoadingTimeOut,R=a.levelLoadingRetryDelay,C=a.levelLoadingMaxRetryTimeout;break}if(A=this.createInternalLoader(h),(s=h.deliveryDirectives)!==null&&s!==void 0&&s.part){var w;if(h.type===D.PlaylistContextType.LEVEL&&h.level!==null?w=this.hls.levels[h.level].details:h.type===D.PlaylistContextType.AUDIO_TRACK&&h.id!==null?w=this.hls.audioTracks[h.id].details:h.type===D.PlaylistContextType.SUBTITLE_TRACK&&h.id!==null&&(w=this.hls.subtitleTracks[h.id].details),w){var x=w.partTarget,c=w.targetduration;x&&c&&(L=Math.min(Math.max(x*3,c*.8)*1e3,L))}}var T={timeout:L,maxRetry:S,retryDelay:R,maxRetryDelay:C,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};A.load(h,T,y)},f.loadsuccess=function(h,s,a,A){if(A===void 0&&(A=null),a.isSidxRequest){this.handleSidxRequest(h,a),this.handlePlaylistLoaded(h,s,a,A);return}this.resetInternalLoader(a.type);var _=h.data;if(_.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(h,a,"no EXTM3U delimiter",A);return}s.parsing.start=performance.now(),_.indexOf("#EXTINF:")>0||_.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(h,s,a,A):this.handleMasterPlaylist(h,s,a,A)},f.loaderror=function(h,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!1,h)},f.loadtimeout=function(h,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!0)},f.handleMasterPlaylist=function(h,s,a,A){var _=this.hls,S=h.data,L=p(h,a),R=i.default.parseMasterPlaylist(S,L),C=R.levels,w=R.sessionData;if(!C.length){this.handleManifestParsingError(h,a,"no level found in manifest",A);return}var x=C.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),c=C.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),T=i.default.parseMasterPlaylistMedia(S,L,"AUDIO",x),y=i.default.parseMasterPlaylistMedia(S,L,"SUBTITLES",c),v=i.default.parseMasterPlaylistMedia(S,L,"CLOSED-CAPTIONS");if(T.length){var N=T.some(function(B){return!B.url});!N&&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(F.Events.MANIFEST_LOADED,{levels:C,audioTracks:T,subtitles:y,captions:v,url:L,stats:s,networkDetails:A,sessionData:w})},f.handleTrackOrLevelPlaylist=function(h,s,a,A){var _=this.hls,S=a.id,L=a.level,R=a.type,C=p(h,a),w=Object(X.isFiniteNumber)(S)?S:0,x=Object(X.isFiniteNumber)(L)?L:w,c=m(a),T=i.default.parseLevelPlaylist(h.data,C,x,c,w);if(!T.fragments.length){_.trigger(F.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 a.level=="number"?a.level:void 0});return}if(R===D.PlaylistContextType.MANIFEST){var y={attrs:new g.AttrList({}),bitrate:0,details:T,name:"",url:C};_.trigger(F.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:C,stats:s,networkDetails:A,sessionData:null})}if(s.parsing.end=performance.now(),T.needSidxRanges){var v,N=(v=T.fragments[0].initSegment)===null||v===void 0?void 0:v.url;this.load({url:N,isSidxRequest:!0,type:R,level:L,levelDetails:T,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}a.levelDetails=T,this.handlePlaylistLoaded(h,s,a,A)},f.handleSidxRequest=function(h,s){var a=Object(W.parseSegmentIndex)(new Uint8Array(h.data));if(!a)return;var A=a.references,_=s.levelDetails;A.forEach(function(S,L){var R=S.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(a.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(h,s,a,A){this.hls.trigger(F.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===D.PlaylistContextType.MANIFEST,url:h.url,reason:a,response:h,context:s,networkDetails:A})},f.handleNetworkError=function(h,s,a,A){a===void 0&&(a=!1),G.logger.warn("[playlist-loader]: A network "+(a?"timeout":"error")+" occurred while loading "+h.type+" level: "+h.level+" id: "+h.id+' group-id: "'+h.groupId+'"');var _=U.ErrorDetails.UNKNOWN,S=!1,L=this.getInternalLoader(h);switch(h.type){case D.PlaylistContextType.MANIFEST:_=a?U.ErrorDetails.MANIFEST_LOAD_TIMEOUT:U.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case D.PlaylistContextType.LEVEL:_=a?U.ErrorDetails.LEVEL_LOAD_TIMEOUT:U.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case D.PlaylistContextType.AUDIO_TRACK:_=a?U.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:U.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:_=a?U.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:U.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}L&&this.resetInternalLoader(h.type);var R={type:U.ErrorTypes.NETWORK_ERROR,details:_,fatal:S,url:h.url,loader:L,context:h,networkDetails:s};A&&(R.response=A),this.hls.trigger(F.Events.ERROR,R)},f.handlePlaylistLoaded=function(h,s,a,A){var _=a.type,S=a.level,L=a.id,R=a.groupId,C=a.loader,w=a.levelDetails,x=a.deliveryDirectives;if(!(w!=null&&w.targetduration)){this.handleManifestParsingError(h,a,"invalid target duration",A);return}if(!C)return;w.live&&(C.getCacheAge&&(w.ageHeader=C.getCacheAge()||0),(!C.getCacheAge||isNaN(w.ageHeader))&&(w.ageHeader=0));switch(_){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(F.Events.LEVEL_LOADED,{details:w,level:S||0,id:L||0,stats:s,networkDetails:A,deliveryDirectives:x});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(F.Events.AUDIO_TRACK_LOADED,{details:w,id:L||0,groupId:R||"",stats:s,networkDetails:A,deliveryDirectives:x});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(F.Events.SUBTITLE_TRACK_LOADED,{details:w,id:L||0,groupId:R||"",stats:s,networkDetails:A,deliveryDirectives:x});break}},u}();$.default=l},"./src/polyfills/number.ts":function(ie,$,M){"use strict";M.r($),M.d($,"isFiniteNumber",function(){return X}),M.d($,"MAX_SAFE_INTEGER",function(){return F});var X=Number.isFinite||function(U){return typeof U=="number"&&isFinite(U)},F=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ie,$,M){"use strict";M.r($);var X=function(){function F(){}return F.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},F}();$.default=X},"./src/remux/mp4-generator.ts":function(ie,$,M){"use strict";M.r($);var X=Math.pow(2,32)-1,F=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]),m=new Uint8Array([0,0,0,0,0,0,0,0]);U.STTS=U.STSC=U.STCO=m,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 p=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),u=new Uint8Array([0,0,0,1]);U.FTYP=U.box(U.types.ftyp,p,u,p,l),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),m=1;m<D;m++)g[m-1]=arguments[m];for(var p=g.length,l=p;p--;)i+=g[p].byteLength;var u=new Uint8Array(i);for(u[0]=i>>24&255,u[1]=i>>16&255,u[2]=i>>8&255,u[3]=i&255,u.set(W,4),p=0,i=8;p<l;p++)u.set(g[p],i),i+=g[p].byteLength;return u},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)),m=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,m)},U.sdtp=function(W){var i=W.samples||[],D=new Uint8Array(4+i.length),g,m;for(g=0;g<i.length;g++)m=i[g].flags,D[g+4]=m.dependsOn<<4|m.isDependedOn<<2|m.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,m,p;for(g=0;g<W.sps.length;g++)m=W.sps[g],p=m.byteLength,i.push(p>>>8&255),i.push(p&255),i=i.concat(Array.prototype.slice.call(m));for(g=0;g<W.pps.length;g++)m=W.pps[g],p=m.byteLength,D.push(p>>>8&255),D.push(p&255),D=D.concat(Array.prototype.slice.call(m));var l=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))),u=W.width,f=W.height,o=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,u>>8&255,u&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]),l,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([o>>24,o>>16&255,o>>8&255,o&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,m=W.height,p=Math.floor(D/(X+1)),l=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,p>>24,p>>16&255,p>>8&255,p&255,l>>24,l>>16&255,l>>8&255,l&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,m>>8&255,m&255,0,0]))},U.traf=function(W,i){var D=U.sdtp(W),g=W.id,m=Math.floor(i/(X+1)),p=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,m>>24,m>>16&255,m>>8&255,m&255,p>>24,p>>16&255,p>>8&255,p&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,m=12+16*g,p=new Uint8Array(m),l,u,f,o,h,s;for(i+=8+m,p.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),l=0;l<g;l++)u=D[l],f=u.duration,o=u.size,h=u.flags,s=u.cts,p.set([f>>>24&255,f>>>16&255,f>>>8&255,f&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,h.degradPrio&240<<8,h.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*l);return U.box(U.types.trun,p)},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}();F.types=void 0,F.HDLR_TYPES=void 0,F.STTS=void 0,F.STSC=void 0,F.STCO=void 0,F.STSZ=void 0,F.VMHD=void 0,F.SMHD=void 0,F.STSD=void 0,F.FTYP=void 0,F.DINF=void 0,$.default=F},"./src/remux/mp4-remuxer.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return s}),M.d($,"normalizePts",function(){return a});var X=M("./src/polyfills/number.ts"),F=M("./src/remux/aac-helper.ts"),U=M("./src/remux/mp4-generator.ts"),G=M("./src/events.ts"),W=M("./src/errors.ts"),i=M("./src/utils/logger.ts"),D=M("./src/types/loader.ts"),g=M("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(L){for(var R=1;R<arguments.length;R++){var C=arguments[R];for(var w in C)Object.prototype.hasOwnProperty.call(C,w)&&(L[w]=C[w])}return L},m.apply(this,arguments)}var p=10*1e3,l=1024,u=1152,f=null,o=null,h=!1,s=function(){function L(C,w,x,c){if(c===void 0&&(c=""),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=w,this.typeSupported=x,this.ISGenerated=!1,f===null){var T=navigator.userAgent||"",y=T.match(/Chrome\/(\d+)/i);f=y?parseInt(y[1]):0}if(o===null){var v=navigator.userAgent.match(/Safari\/(\d+)/i);o=v?parseInt(v[1]):0}h=!!f&&f<75||!!o&&o<600}var R=L.prototype;return R.destroy=function(){},R.resetTimeStamp=function(w){i.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=w},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(w){var x=!1,c=w.reduce(function(T,y){var v=y.pts-T;return v<-4294967296?(x=!0,a(T,y.pts)):v>0?T:y.pts},w[0].pts);return x&&i.logger.debug("PTS rollover detected"),c},R.remux=function(w,x,c,T,y,v,N,B){var O,j,P,b,Y,ee,le=y,ue=y,ke=w.pid>-1,we=x.pid>-1,Ae=x.samples.length,ce=w.samples.length>0,pe=Ae>1,se=(!ke||ce)&&(!we||pe)||this.ISGenerated||N;if(se){this.ISGenerated||(P=this.generateIS(w,x,y));var ae=this.isVideoContiguous,Oe=-1;if(pe&&(Oe=A(x.samples),!ae&&this.config.forceKeyFrameOnDiscontinuity))if(ee=!0,Oe>0){i.logger.warn("[mp4-remuxer]: Dropped "+Oe+" out of "+Ae+" video samples due to a missing keyframe");var xe=this.getVideoStartPts(x.samples);x.samples=x.samples.slice(Oe),x.dropped+=Oe,ue+=(x.samples[0].pts-xe)/(x.timescale||9e4)}else Oe===-1&&(i.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ae+" video samples"),ee=!1);if(this.ISGenerated){if(ce&&pe){var Pe=this.getVideoStartPts(x.samples),De=a(w.samples[0].pts,Pe)-Pe,Ge=De/x.inputTimeScale;le+=Math.max(0,Ge),ue+=Math.max(0,-Ge)}if(ce){if(w.samplerate||(i.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),P=this.generateIS(w,x,y)),j=this.remuxAudio(w,le,this.isAudioContiguous,v,we||pe||B===D.PlaylistLevelType.AUDIO?ue:void 0),pe){var Le=j?j.endPTS-j.startPTS:0;x.inputTimeScale||(i.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),P=this.generateIS(w,x,y)),O=this.remuxVideo(x,ue,ae,Le)}}else pe&&(O=this.remuxVideo(x,ue,ae,0));O&&(O.firstKeyFrame=Oe,O.independent=Oe!==-1)}}return this.ISGenerated&&(c.samples.length&&(Y=this.remuxID3(c,y)),T.samples.length&&(b=this.remuxText(T,y))),{audio:j,video:O,initSegment:P,independent:ee,text:b,id3:Y}},R.generateIS=function(w,x,c){var T=w.samples,y=x.samples,v=this.typeSupported,N={},B=!Object(X.isFiniteNumber)(this._initPTS),O="audio/mp4",j,P,b;if(B&&(j=P=Infinity),w.config&&T.length&&(w.timescale=w.samplerate,w.isAAC||(v.mpeg?(O="audio/mpeg",w.codec=""):v.mp3&&(w.codec="mp3")),N.audio={id:"audio",container:O,codec:w.codec,initSegment:!w.isAAC&&v.mpeg?new Uint8Array(0):U.default.initSegment([w]),metadata:{channelCount:w.channelCount}},B&&(b=w.inputTimeScale,j=P=T[0].pts-Math.round(b*c))),x.sps&&x.pps&&y.length&&(x.timescale=x.inputTimeScale,N.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(y),ee=Math.round(b*c);P=Math.min(P,a(y[0].dts,Y)-ee),j=Math.min(j,Y-ee)}if(Object.keys(N).length)return this.ISGenerated=!0,B&&(this._initPTS=j,this._initDTS=P),{tracks:N,initPTS:j,timescale:b}},R.remuxVideo=function(w,x,c,T){var y=w.inputTimeScale,v=w.samples,N=[],B=v.length,O=this._initPTS,j=this.nextAvcDts,P=8,b,Y,ee,le=Number.POSITIVE_INFINITY,ue=Number.NEGATIVE_INFINITY,ke=0,we=!1;if(!c||j===null){var Ae=x*y,ce=v[0].pts-a(v[0].dts,v[0].pts);j=Ae-ce}for(var pe=0;pe<B;pe++){var se=v[pe];if(se.pts=a(se.pts-O,j),se.dts=a(se.dts-O,j),se.dts>se.pts){var ae=9e4*.2;ke=Math.max(Math.min(ke,se.pts-se.dts),-1*ae)}se.dts<v[pe>0?pe-1:pe].dts&&(we=!0)}we&&v.sort(function(wt,St){var dt=wt.dts-St.dts,Ut=wt.pts-St.pts;return dt||Ut}),Y=v[0].dts,ee=v[v.length-1].dts;var Oe=Math.round((ee-Y)/(B-1));if(ke<0){if(ke<Oe*-2){i.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-Oe,!0)+" ms");for(var xe=ke,Pe=0;Pe<B;Pe++)v[Pe].dts=xe=Math.max(xe,v[Pe].pts-Oe),v[Pe].pts=Math.max(xe,v[Pe].pts)}else{i.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(ke,!0)+" ms to overcome this issue");for(var De=0;De<B;De++)v[De].dts=v[De].dts+ke}Y=v[0].dts}if(c){var Ge=Y-j,Le=Ge>Oe,Fe=Ge<-1;if(Le||Fe){Le?i.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(Ge,!0)+" ms ("+Ge+"dts) hole between fragments detected, filling it"):i.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-Ge,!0)+" ms ("+Ge+"dts) overlapping between fragments detected"),Y=j;var We=v[0].pts-Ge;v[0].dts=Y,v[0].pts=We,i.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(We,!0)+"/"+Object(g.toMsFromMpegTsClock)(Y,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(Ge,!0)+" ms")}}h&&(Y=Math.max(0,Y));for(var oe=0,ge=0,Se=0;Se<B;Se++){for(var Ce=v[Se],je=Ce.units,Ve=je.length,Qe=0,Je=0;Je<Ve;Je++)Qe+=je[Je].data.length;ge+=Qe,oe+=Ve,Ce.length=Qe,Ce.dts=Math.max(Ce.dts,Y),Ce.pts=Math.max(Ce.pts,Ce.dts,0),le=Math.min(Ce.pts,le),ue=Math.max(Ce.pts,ue)}ee=v[B-1].dts;var at=ge+4*oe+8,Xe;try{Xe=new Uint8Array(at)}catch(wt){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:at,reason:"fail allocating video mdat "+at});return}var qe=new DataView(Xe.buffer);qe.setUint32(0,at),Xe.set(U.default.types.mdat,4);for(var Ne=0;Ne<B;Ne++){for(var lt=v[Ne],nt=lt.units,Be=0,Ue=0,Te=nt.length;Ue<Te;Ue++){var ve=nt[Ue],_e=ve.data,re=ve.data.byteLength;qe.setUint32(P,re),P+=4,Xe.set(_e,P),P+=re,Be+=4+re}if(Ne<B-1)b=v[Ne+1].dts-lt.dts;else{var ne=this.config,he=lt.dts-v[Ne>0?Ne-1:Ne].dts;if(ne.stretchShortVideoTrack&&this.nextAudioPts!==null){var fe=Math.floor(ne.maxBufferHole*y),Ee=(T?le+T*y:this.nextAudioPts)-lt.pts;Ee>fe?(b=Ee-he,b<0&&(b=he),i.logger.log("[mp4-remuxer]: It is approximately "+Ee/90+" ms to the next segment; using duration "+b/90+" ms for the last video frame.")):b=he}else b=he}var Me=Math.round(lt.pts-lt.dts);N.push(new _(lt.key,b,Be,Me))}if(N.length&&f&&f<70){var ze=N[0].flags;ze.dependsOn=2,ze.isNonSync=0}console.assert(b!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=j=ee+b,this.isVideoContiguous=!0;var ot=U.default.moof(w.sequenceNumber++,Y,m({},w,{samples:N})),mt="video",ft={data1:ot,data2:Xe,startPTS:le/y,endPTS:(ue+b)/y,startDTS:Y/y,endDTS:j/y,type:mt,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:w.dropped};return w.samples=[],w.dropped=0,console.assert(Xe.length,"MDAT length must not be zero"),ft},R.remuxAudio=function(w,x,c,T,y){var v=w.inputTimeScale,N=w.samplerate?w.samplerate:v,B=v/N,O=w.isAAC?l:u,j=O*B,P=this._initPTS,b=!w.isAAC&&this.typeSupported.mpeg,Y=[],ee=w.samples,le=b?0:8,ue=this.nextAudioPts||-1,ke=x*v;if(this.isAudioContiguous=c=c||ee.length&&ue>0&&(T&&Math.abs(ke-ue)<9e3||Math.abs(a(ee[0].pts-P,ke)-ue)<20*j),ee.forEach(function(_e){_e.pts=a(_e.pts-P,ke)}),!c||ue<0){if(ee=ee.filter(function(_e){return _e.pts>=0}),!ee.length)return;y===0?ue=0:T?ue=Math.max(0,ke):ue=ee[0].pts}if(w.isAAC)for(var we=y!==void 0,Ae=this.config.maxAudioFramesDrift,ce=0,pe=ue;ce<ee.length;ce++){var se=ee[ce],ae=se.pts,Oe=ae-pe,xe=Math.abs(1e3*Oe/v);if(Oe<=-Ae*j&&we)ce===0&&(i.logger.warn("Audio frame @ "+(ae/v).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Oe/v)+" ms."),this.nextAudioPts=ue=pe=ae);else if(Oe>=Ae*j&&xe<p&&we){var Pe=Math.round(Oe/j);pe=ae-Pe*j,pe<0&&(Pe--,pe+=j),ce===0&&(this.nextAudioPts=ue=pe),i.logger.warn("[mp4-remuxer]: Injecting "+Pe+" audio frame @ "+(pe/v).toFixed(3)+"s due to "+Math.round(1e3*Oe/v)+" ms gap.");for(var De=0;De<Pe;De++){var Ge=Math.max(pe,0),Le=F.default.getSilentFrame(w.manifestCodec||w.codec,w.channelCount);Le||(i.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Le=se.unit.subarray()),ee.splice(ce,0,{unit:Le,pts:Ge}),pe+=j,ce++}}se.pts=pe,pe+=j}for(var Fe=null,We=null,oe,ge=0,Se=ee.length;Se--;)ge+=ee[Se].unit.byteLength;for(var Ce=0,je=ee.length;Ce<je;Ce++){var Ve=ee[Ce],Qe=Ve.unit,Je=Ve.pts;if(We!==null){var at=Y[Ce-1];at.duration=Math.round((Je-We)/B)}else if(c&&w.isAAC&&(Je=ue),Fe=Je,ge>0){ge+=le;try{oe=new Uint8Array(ge)}catch(_e){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ge,reason:"fail allocating audio mdat "+ge});return}if(!b){var Xe=new DataView(oe.buffer);Xe.setUint32(0,ge),oe.set(U.default.types.mdat,4)}}else return;oe.set(Qe,le);var qe=Qe.byteLength;le+=qe,Y.push(new _(!0,O,qe,0)),We=Je}var Ne=Y.length;if(!Ne)return;var lt=Y[Y.length-1];this.nextAudioPts=ue=We+B*lt.duration;var nt=b?new Uint8Array(0):U.default.moof(w.sequenceNumber++,Fe/B,m({},w,{samples:Y}));w.samples=[];var Be=Fe/v,Ue=ue/v,Te="audio",ve={data1:nt,data2:oe,startPTS:Be,endPTS:Ue,startDTS:Be,endDTS:Ue,type:Te,hasAudio:!0,hasVideo:!1,nb:Ne};return this.isAudioContiguous=!0,console.assert(oe.length,"MDAT length must not be zero"),ve},R.remuxEmptyAudio=function(w,x,c,T){var y=w.inputTimeScale,v=w.samplerate?w.samplerate:y,N=y/v,B=this.nextAudioPts,O=(B!==null?B:T.startDTS*y)+this._initDTS,j=T.endDTS*y+this._initDTS,P=N*l,b=Math.ceil((j-O)/P),Y=F.default.getSilentFrame(w.manifestCodec||w.codec,w.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=[],le=0;le<b;le++){var ue=O+le*P;ee.push({unit:Y,pts:ue,dts:ue})}return w.samples=ee,this.remuxAudio(w,x,c,!1)},R.remuxID3=function(w,x){var c=w.samples.length;if(!c)return;for(var T=w.inputTimeScale,y=this._initPTS,v=this._initDTS,N=0;N<c;N++){var B=w.samples[N];B.pts=a(B.pts-y,x*T)/T,B.dts=a(B.dts-v,x*T)/T}var O=w.samples;return w.samples=[],{samples:O}},R.remuxText=function(w,x){var c=w.samples.length;if(!c)return;for(var T=w.inputTimeScale,y=this._initPTS,v=0;v<c;v++){var N=w.samples[v];N.pts=a(N.pts-y,x*T)/T}w.samples.sort(function(O,j){return O.pts-j.pts});var B=w.samples;return w.samples=[],{samples:B}},L}();function a(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,w,x){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=C,this.size=w,this.cts=x,this.flags=new S(R)},S=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(ie,$,M){"use strict";M.r($);var X=M("./src/polyfills/number.ts"),F=M("./src/utils/mp4-tools.ts"),U=M("./src/loader/fragment.ts"),G=M("./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 m=g.prototype;return m.destroy=function(){},m.resetTimeStamp=function(l){this.initPTS=l,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(l,u,f){this.audioCodec=u,this.videoCodec=f,this.generateInitSegment(l),this.emitInitSegment=!0},m.generateInitSegment=function(l){var u=this.audioCodec,f=this.videoCodec;if(!l||!l.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=Object(F.parseInitSegment)(l);u||(u=D(o.audio,U.ElementaryStreamTypes.AUDIO)),f||(f=D(o.video,U.ElementaryStreamTypes.VIDEO));var h={};o.audio&&o.video?h.audiovideo={container:"video/mp4",codec:u+","+f,initSegment:l,id:"main"}:o.audio?h.audio={container:"audio/mp4",codec:u,initSegment:l,id:"audio"}:o.video?h.video={container:"video/mp4",codec:f,initSegment:l,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=h},m.remux=function(l,u,f,o,h){var s=this.initPTS,a=this.lastEndDTS,A={audio:void 0,video:void 0,text:o,id3:f,initSegment:void 0};Object(X.isFiniteNumber)(a)||(a=this.lastEndDTS=h||0);var _=u.samples;if(!_||!_.length)return A;var S={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&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(X.isFiniteNumber)(s)||(this.initPTS=S.initPTS=s=i(L,_,a));var R=Object(F.getDuration)(_,L),C=a,w=R+C;Object(F.offsetStartDTS)(L,_,s),R>0?this.lastEndDTS=w:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var x=!!L.audio,c=!!L.video,T="";x&&(T+="audio"),c&&(T+="video");var y={data1:_,startPTS:C,startDTS:C,endPTS:w,endDTS:w,type:T,hasAudio:x,hasVideo:c,nb:1,dropped:0};return A.audio=y.type==="audio"?y:void 0,A.video=y.type!=="audio"?y:void 0,A.text=o,A.id3=f,A.initSegment=S,A},g}(),i=function(m,p,l){return Object(F.getStartDTS)(m,p)-l};function D(g,m){var p=g==null?void 0:g.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||m===U.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}$.default=W},"./src/task-loop.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return X});var X=function(){function F(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var U=F.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(){},F}()},"./src/types/cmcd.ts":function(ie,$,M){"use strict";M.r($),M.d($,"CMCDVersion",function(){return X}),M.d($,"CMCDObjectType",function(){return F}),M.d($,"CMCDStreamingFormat",function(){return U}),M.d($,"CMCDStreamType",function(){return G});var X=1,F;(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"})(F||(F={}));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(ie,$,M){"use strict";M.r($),M.d($,"HlsSkip",function(){return U}),M.d($,"getSkipValue",function(){return G}),M.d($,"HlsUrlParameters",function(){return W}),M.d($,"Level",function(){return i});function X(D,g){for(var m=0;m<g.length;m++){var p=g[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(D,p.key,p)}}function F(D,g,m){return g&&X(D.prototype,g),m&&X(D,m),D}var U;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(U||(U={}));function G(D,g){var m=D.canSkipUntil,p=D.canSkipDateRanges,l=D.endSN,u=g!==void 0?g-l:0;return m&&u<m?p?U.v2:U.Yes:U.No}var W=function(){function D(m,p,l){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=p,this.skip=l}var g=D.prototype;return g.addDirectives=function(p){var l=new self.URL(p);return this.msn!==void 0&&l.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&l.searchParams.set("_HLS_part",this.part.toString()),this.skip&&l.searchParams.set("_HLS_skip",this.skip),l.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(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return F(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(m){var p=m%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),D}()},"./src/types/loader.ts":function(ie,$,M){"use strict";M.r($),M.d($,"PlaylistContextType",function(){return X}),M.d($,"PlaylistLevelType",function(){return F});var X;(function(U){U.MANIFEST="manifest",U.LEVEL="level",U.AUDIO_TRACK="audioTrack",U.SUBTITLE_TRACK="subtitleTrack"})(X||(X={}));var F;(function(U){U.MAIN="main",U.AUDIO="audio",U.SUBTITLE="subtitle"})(F||(F={}))},"./src/types/transmuxer.ts":function(ie,$,M){"use strict";M.r($),M.d($,"ChunkMetadata",function(){return X});var X=function(G,W,i,D,g,m){D===void 0&&(D=0),g===void 0&&(g=-1),m===void 0&&(m=!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=F(),this.buffering={audio:F(),video:F(),audiovideo:F()},this.level=G,this.sn=W,this.id=i,this.size=D,this.part=g,this.partial=m};function F(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ie,$,M){"use strict";M.r($),M.d($,"AttrList",function(){return U});var X=/^(\d+)x(\d+)$/,F=/\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 m=new Uint8Array(g.length/2),p=0;p<g.length/2;p++)m[p]=parseInt(g.slice(p*2,p*2+2),16);return m}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 m=this[D];return m?parseFloat(m):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,m={},p='"';for(F.lastIndex=0;(g=F.exec(D))!==null;){var l=g[2];l.indexOf(p)===0&&l.lastIndexOf(p)===l.length-1&&(l=l.slice(1,-1)),m[g[1]]=l}return m},G}()},"./src/utils/binary-search.ts":function(ie,$,M){"use strict";M.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 m=G(g);if(m>0)W=D+1;else if(m<0)i=D-1;else return g}return null}};$.default=X},"./src/utils/buffer-helper.ts":function(ie,$,M){"use strict";M.r($),M.d($,"BufferHelper",function(){return U});var X=M("./src/utils/logger.ts"),F={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),m=0;m<g.length;m++)if(D>=g.start(m)&&D<=g.end(m))return!0}}catch(p){}return!1},G.bufferInfo=function(i,D,g){try{if(i){var m=G.getBuffered(i),p=[],l;for(l=0;l<m.length;l++)p.push({start:m.start(l),end:m.end(l)});return this.bufferedInfo(p,D,g)}}catch(u){}return{len:0,start:D,end:D,nextStart:void 0}},G.bufferedInfo=function(i,D,g){D=Math.max(0,D),i.sort(function(S,L){var R=S.start-L.start;return R||L.end-S.end});var m=[];if(g)for(var p=0;p<i.length;p++){var l=m.length;if(l){var u=m[l-1].end;i[p].start-u<g?i[p].end>u&&(m[l-1].end=i[p].end):m.push(i[p])}else m.push(i[p])}else m=i;for(var f=0,o,h=D,s=D,a=0;a<m.length;a++){var A=m[a].start,_=m[a].end;if(D+g>=A&&D<_)h=A,s=_,f=s-D;else if(D+g<A){o=A;break}}return{len:f,start:h||0,end:s||0,nextStart:o}},G.getBuffered=function(i){try{return i.buffered}catch(D){return X.logger.log("failed to get media.buffered",D),F}},G}()},"./src/utils/cea-608-parser.ts":function(ie,$,M){"use strict";M.r($),M.d($,"Row",function(){return s}),M.d($,"CaptionScreen",function(){return a});var X=M("./src/utils/logger.ts"),F={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(w){var x=w;return F.hasOwnProperty(w)&&(x=F[w]),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},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],l;(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"})(l||(l={}));var u=function(){function C(){this.time=null,this.verboseLevel=l.ERROR}var w=C.prototype;return w.log=function(c,T){this.verboseLevel>=c&&X.logger.log(this.time+" ["+c+"] "+T)},C}(),f=function(w){for(var x=[],c=0;c<w.length;c++)x.push(w[c].toString(16));return x},o=function(){function C(x,c,T,y,v){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=c||!1,this.italics=T||!1,this.background=y||"black",this.flash=v||!1}var w=C.prototype;return w.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},w.setStyles=function(c){for(var T=["foreground","underline","italics","background","flash"],y=0;y<T.length;y++){var v=T[y];c.hasOwnProperty(v)&&(this[v]=c[v])}},w.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},w.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},w.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},w.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},C}(),h=function(){function C(x,c,T,y,v,N){this.uchar=void 0,this.penState=void 0,this.uchar=x||" ",this.penState=new o(c,T,y,v,N)}var w=C.prototype;return w.reset=function(){this.uchar=" ",this.penState.reset()},w.setChar=function(c,T){this.uchar=c,this.penState.copy(T)},w.setPenState=function(c){this.penState.copy(c)},w.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},w.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},w.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},C}(),s=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 c=0;c<W;c++)this.chars.push(new h);this.logger=x,this.pos=0,this.currPenState=new o}var w=C.prototype;return w.equals=function(c){for(var T=!0,y=0;y<W;y++)if(!this.chars[y].equals(c.chars[y])){T=!1;break}return T},w.copy=function(c){for(var T=0;T<W;T++)this.chars[T].copy(c.chars[T])},w.isEmpty=function(){for(var c=!0,T=0;T<W;T++)if(!this.chars[T].isEmpty()){c=!1;break}return c},w.setCursor=function(c){this.pos!==c&&(this.pos=c),this.pos<0?(this.logger.log(l.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>W&&(this.logger.log(l.DEBUG,"Too large cursor position "+this.pos),this.pos=W)},w.moveCursor=function(c){var T=this.pos+c;if(c>1)for(var y=this.pos+1;y<T+1;y++)this.chars[y].setPenState(this.currPenState);this.setCursor(T)},w.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},w.insertChar=function(c){c>=144&&this.backSpace();var T=U(c);if(this.pos>=W){this.logger.log(l.ERROR,"Cannot insert "+c.toString(16)+" ("+T+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(T,this.currPenState),this.moveCursor(1)},w.clearFromPos=function(c){var T;for(T=c;T<W;T++)this.chars[T].reset()},w.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},w.clearToEndOfRow=function(){this.clearFromPos(this.pos)},w.getTextString=function(){for(var c=[],T=!0,y=0;y<W;y++){var v=this.chars[y].uchar;v!==" "&&(T=!1),c.push(v)}return T?"":c.join("")},w.setPenStyles=function(c){this.currPenState.setStyles(c);var T=this.chars[this.pos];T.setPenState(this.currPenState)},C}(),a=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 c=0;c<G;c++)this.rows.push(new s(x));this.logger=x,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var w=C.prototype;return w.reset=function(){for(var c=0;c<G;c++)this.rows[c].clear();this.currRow=G-1},w.equals=function(c){for(var T=!0,y=0;y<G;y++)if(!this.rows[y].equals(c.rows[y])){T=!1;break}return T},w.copy=function(c){for(var T=0;T<G;T++)this.rows[T].copy(c.rows[T])},w.isEmpty=function(){for(var c=!0,T=0;T<G;T++)if(!this.rows[T].isEmpty()){c=!1;break}return c},w.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},w.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},w.insertChar=function(c){var T=this.rows[this.currRow];T.insertChar(c)},w.setPen=function(c){var T=this.rows[this.currRow];T.setPenStyles(c)},w.moveCursor=function(c){var T=this.rows[this.currRow];T.moveCursor(c)},w.setCursor=function(c){this.logger.log(l.INFO,"setCursor: "+c);var T=this.rows[this.currRow];T.setCursor(c)},w.setPAC=function(c){this.logger.log(l.INFO,"pacData = "+JSON.stringify(c));var T=c.row-1;if(this.nrRollUpRows&&T<this.nrRollUpRows-1&&(T=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==T){for(var y=0;y<G;y++)this.rows[y].clear();var v=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var B=N.rows[v].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(N.rows[v+j])}}this.currRow=T;var P=this.rows[this.currRow];if(c.indent!==null){var b=c.indent,Y=Math.max(b-1,0);P.setCursor(c.indent),c.color=P.chars[Y].penState.foreground}var ee={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen(ee)},w.setBkgData=function(c){this.logger.log(l.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},w.setRollUpRows=function(c){this.nrRollUpRows=c},w.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(l.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(l.TEXT,this.getDisplayText());var c=this.currRow+1-this.nrRollUpRows,T=this.rows.splice(c,1)[0];T.clear(),this.rows.splice(this.currRow,0,T),this.logger.log(l.INFO,"Rolling up")},w.getDisplayText=function(c){c=c||!1;for(var T=[],y="",v=-1,N=0;N<G;N++){var B=this.rows[N].getTextString();B&&(v=N+1,c?T.push("Row "+v+": '"+B+"'"):T.push(B.trim()))}return T.length>0&&(c?y="["+T.join(" | ")+"]":y=T.join(`
|
|
`)),y},w.getTextAndFormat=function(){return this.rows},C}(),A=function(){function C(x,c,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=c,this.mode=null,this.verbose=0,this.displayedMemory=new a(T),this.nonDisplayedMemory=new a(T),this.lastOutputScreen=new a(T),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=T}var w=C.prototype;return w.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},w.getHandler=function(){return this.outputFilter},w.setHandler=function(c){this.outputFilter=c},w.setPAC=function(c){this.writeScreen.setPAC(c)},w.setBkgData=function(c){this.writeScreen.setBkgData(c)},w.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(l.INFO,"MODE="+c),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=c},w.insertChars=function(c){for(var T=0;T<c.length;T++)this.writeScreen.insertChar(c[T]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(l.INFO,y+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(l.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},w.ccRCL=function(){this.logger.log(l.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},w.ccBS=function(){if(this.logger.log(l.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},w.ccAOF=function(){},w.ccAON=function(){},w.ccDER=function(){this.logger.log(l.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},w.ccRU=function(c){this.logger.log(l.INFO,"RU("+c+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(c)},w.ccFON=function(){this.logger.log(l.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},w.ccRDC=function(){this.logger.log(l.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},w.ccTR=function(){this.logger.log(l.INFO,"TR"),this.setMode("MODE_TEXT")},w.ccRTD=function(){this.logger.log(l.INFO,"RTD"),this.setMode("MODE_TEXT")},w.ccEDM=function(){this.logger.log(l.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},w.ccCR=function(){this.logger.log(l.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},w.ccENM=function(){this.logger.log(l.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},w.ccEOC=function(){if(this.logger.log(l.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var c=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=c,this.writeScreen=this.nonDisplayedMemory,this.logger.log(l.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},w.ccTO=function(c){this.logger.log(l.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},w.ccMIDROW=function(c){var T={flash:!1};if(T.underline=c%2===1,T.italics=c>=46,T.italics)T.foreground="white";else{var y=Math.floor(c/2)-16,v=["white","green","blue","cyan","red","yellow","magenta"];T.foreground=v[y]}this.logger.log(l.INFO,"MIDROW: "+JSON.stringify(T)),this.writeScreen.setPen(T)},w.outputDataUpdate=function(c){c===void 0&&(c=!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),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:T),this.lastOutputScreen.copy(this.displayedMemory))},w.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},C}(),_=function(){function C(x,c,T){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new u;this.channels=[null,new A(x,c,y),new A(x+1,T,y)],this.cmdHistory=R(),this.logger=y}var w=C.prototype;return w.getHandler=function(c){return this.channels[c].getHandler()},w.setHandler=function(c,T){this.channels[c].setHandler(T)},w.addData=function(c,T){var y,v,N,B=!1;this.logger.time=c;for(var O=0;O<T.length;O+=2){if(v=T[O]&127,N=T[O+1]&127,v===0&&N===0)continue;if(this.logger.log(l.DATA,"["+f([T[O],T[O+1]])+"] -> ("+f([v,N])+")"),y=this.parseCmd(v,N),y||(y=this.parseMidrow(v,N)),y||(y=this.parsePAC(v,N)),y||(y=this.parseBackgroundAttributes(v,N)),!y&&(B=this.parseChars(v,N),B)){var j=this.currentChannel;if(j&&j>0){var P=this.channels[j];P.insertChars(B)}else this.logger.log(l.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!B&&this.logger.log(l.WARNING,"Couldn't parse cleaned data "+f([v,N])+" orig: "+f([T[O],T[O+1]]))}},w.parseCmd=function(c,T){var y=this.cmdHistory,v=(c===20||c===28||c===21||c===29)&&T>=32&&T<=47,N=(c===23||c===31)&&T>=33&&T<=35;if(!(v||N))return!1;if(L(c,T,y))return S(null,null,y),this.logger.log(l.DEBUG,"Repeated command ("+f([c,T])+") is dropped"),!0;var B=c===20||c===21||c===23?1:2,O=this.channels[B];return c===20||c===21||c===28||c===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),S(c,T,y),this.currentChannel=B,!0},w.parseMidrow=function(c,T){var y=0;if((c===17||c===25)&&T>=32&&T<=47){if(c===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(l.ERROR,"Mismatch channel in midrow parsing"),!1;var v=this.channels[y];return v?(v.ccMIDROW(T),this.logger.log(l.DEBUG,"MIDROW ("+f([c,T])+")"),!0):!1}return!1},w.parsePAC=function(c,T){var y,v=this.cmdHistory,N=(c>=17&&c<=23||c>=25&&c<=31)&&T>=64&&T<=127,B=(c===16||c===24)&&T>=64&&T<=95;if(!(N||B))return!1;if(L(c,T,v))return S(null,null,v),!0;var O=c<=23?1:2;T>=64&&T<=95?y=O===1?i[c]:g[c]:y=O===1?D[c]:m[c];var j=this.channels[O];return j?(j.setPAC(this.interpretPAC(y,T)),S(c,T,v),this.currentChannel=O,!0):!1},w.interpretPAC=function(c,T){var y,v={color:null,italics:!1,indent:null,underline:!1,row:c};return T>95?y=T-96:y=T-64,v.underline=(y&1)===1,y<=13?v.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(v.italics=!0,v.color="white"):v.indent=Math.floor((y-16)/2)*4,v},w.parseChars=function(c,T){var y,v=null,N=null;if(c>=25?(y=2,N=c-8):(y=1,N=c),N>=17&&N<=19){var B;N===17?B=T+80:N===18?B=T+112:B=T+144,this.logger.log(l.INFO,"Special char '"+U(B)+"' in channel "+y),v=[B]}else c>=32&&c<=127&&(v=T===0?[c]:[c,T]);if(v){var O=f(v);this.logger.log(l.DEBUG,"Char codes = "+O.join(",")),S(c,T,this.cmdHistory)}return v},w.parseBackgroundAttributes=function(c,T){var y=(c===16||c===24)&&T>=32&&T<=47,v=(c===23||c===31)&&T>=45&&T<=47;if(!(y||v))return!1;var N,B={};c===16||c===24?(N=Math.floor((T-32)/2),B.background=p[N],T%2===1&&(B.background=B.background+"_semi")):T===45?B.background="transparent":(B.foreground="black",T===47&&(B.underline=!0));var O=c<=23?1:2,j=this.channels[O];return j.setBkgData(B),S(c,T,this.cmdHistory),!0},w.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var T=this.channels[c];T&&T.reset()}this.cmdHistory=R()},w.cueSplitAtTime=function(c){for(var T=0;T<this.channels.length;T++){var y=this.channels[T];y&&y.cueSplitAtTime(c)}},C}();function S(C,w,x){x.a=C,x.b=w}function L(C,w,x){return x.a===C&&x.b===w}function R(){return{a:null,b:null}}$.default=_},"./src/utils/codecs.ts":function(ie,$,M){"use strict";M.r($),M.d($,"isCodecType",function(){return F}),M.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 F(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(ie,$,M){"use strict";M.r($);var X=M("./src/utils/vttparser.ts"),F=M("./src/utils/webvtt-parser.ts"),U=M("./src/utils/texttrack-utils.ts"),G=/\s/,W={newCue:function(D,g,m,p){for(var l=[],u,f,o,h,s,a=self.VTTCue||self.TextTrackCue,A=0;A<p.rows.length;A++)if(u=p.rows[A],o=!0,h=0,s="",!u.isEmpty()){for(var _=0;_<u.chars.length;_++)G.test(u.chars[_].uchar)&&o?h++:(s+=u.chars[_].uchar,o=!1);u.cueStartTime=g,g===m&&(m+=1e-4),h>=16?h--:h++;var S=Object(X.fixLineBreaks)(s.trim()),L=Object(F.generateCueId)(g,m,S);(!D||!D.cues||!D.cues.getCueById(L))&&(f=new a(g,m,S),f.id=L,f.line=A+1,f.align="left",f.position=10+Math.min(80,Math.floor(h*8/32)*10),l.push(f))}return D&&l.length&&(l.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}),l.forEach(function(R){return Object(U.addCueToTrack)(D,R)})),l}};$.default=W},"./src/utils/discontinuities.ts":function(ie,$,M){"use strict";M.r($),M.d($,"findFirstFragWithCC",function(){return G}),M.d($,"shouldAlignOnDiscontinuities",function(){return W}),M.d($,"findDiscontinuousReferenceFrag",function(){return i}),M.d($,"adjustSlidingStart",function(){return g}),M.d($,"alignStream",function(){return m}),M.d($,"alignPDT",function(){return l}),M.d($,"alignFragmentByPDTDelta",function(){return u}),M.d($,"alignMediaPlaylistByPDT",function(){return f});var X=M("./src/polyfills/number.ts"),F=M("./src/utils/logger.ts"),U=M("./src/controller/level-helper.ts");function G(o,h){for(var s=null,a=0,A=o.length;a<A;a++){var _=o[a];if(_&&_.cc===h){s=_;break}}return s}function W(o,h,s){return!!(h.details&&(s.endCC>s.startCC||o&&o.cc<s.startCC))}function i(o,h){var s=o.fragments,a=h.fragments;if(!a.length||!s.length){F.logger.log("No fragments to align");return}var A=G(s,a[0].cc);if(!A||A&&!A.startPTS){F.logger.log("No frag in previous level to align on");return}return A}function D(o,h){if(o){var s=o.start+h;o.start=o.startPTS=s,o.endPTS=s+o.duration}}function g(o,h){for(var s=h.fragments,a=0,A=s.length;a<A;a++)D(s[a],o);h.fragmentHint&&D(h.fragmentHint,o),h.alignedSliding=!0}function m(o,h,s){if(!h)return;p(o,s,h),!s.alignedSliding&&h.details&&l(s,h.details),!s.alignedSliding&&h.details&&!s.skippedSegments&&Object(U.adjustSliding)(h.details,s)}function p(o,h,s){if(W(o,s,h)){var a=i(s.details,h);a&&Object(X.isFiniteNumber)(a.start)&&(F.logger.log("Adjusting PTS using last level due to CC increase within current level "+h.url),g(a.start,h))}}function l(o,h){if(!h.fragments.length||!o.hasProgramDateTime||!h.hasProgramDateTime)return;var s=h.fragments[0].programDateTime,a=o.fragments[0].programDateTime,A=(a-s)/1e3+h.fragments[0].start;A&&Object(X.isFiniteNumber)(A)&&(F.logger.log("Adjusting PTS using programDateTime delta "+(a-s)+"ms, sliding:"+A.toFixed(3)+" "+o.url+" "),g(A,o))}function u(o,h){var s=o.programDateTime;if(!s)return;var a=(s-h)/1e3;o.start=o.startPTS=a,o.endPTS=a+o.duration}function f(o,h){if(!h.fragments.length||!o.hasProgramDateTime||!h.hasProgramDateTime)return;var s=h.fragments[0].programDateTime,a=h.fragments[0].start,A=s-a*1e3;o.fragments.forEach(function(_){u(_,A)}),o.fragmentHint&&u(o.fragmentHint,A),o.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ie,$,M){"use strict";M.r($);var X=M("./src/utils/ewma.ts"),F=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_,m=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,m.getEstimate(),m.getTotalWeight()))},G.sample=function(i,D){i=Math.max(i,this.minDelayMs_);var g=8*D,m=i/1e3,p=g/m;this.fast_.sample(m,p),this.slow_.sample(m,p)},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=F},"./src/utils/ewma.ts":function(ie,$,M){"use strict";M.r($);var X=function(){function F(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=F.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_},F}();$.default=X},"./src/utils/fetch-loader.ts":function(ie,$,M){"use strict";M.r($),M.d($,"fetchSupported",function(){return u});var X=M("./src/polyfills/number.ts"),F=M("./src/loader/load-stats.ts"),U=M("./src/demux/chunk-cache.ts");function G(a,A){a.prototype=Object.create(A.prototype),a.prototype.constructor=a,m(a,A)}function W(a){var A=typeof Map=="function"?new Map:void 0;return W=function(S){if(S===null||!g(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A!="undefined"){if(A.has(S))return A.get(S);A.set(S,L)}function L(){return i(S,arguments,p(this).constructor)}return L.prototype=Object.create(S.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),m(L,S)},W(a)}function i(a,A,_){return D()?i=Reflect.construct:i=function(L,R,C){var w=[null];w.push.apply(w,R);var x=Function.bind.apply(L,w),c=new x;return C&&m(c,C.prototype),c},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(a){return!1}}function g(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function m(a,A){return m=Object.setPrototypeOf||function(S,L){return S.__proto__=L,S},m(a,A)}function p(a){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},p(a)}function l(){return l=Object.assign||function(a){for(var A=1;A<arguments.length;A++){var _=arguments[A];for(var S in _)Object.prototype.hasOwnProperty.call(_,S)&&(a[S]=_[S])}return a},l.apply(this,arguments)}function u(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}var f=function(){function a(_){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 F.LoadStats}var A=a.prototype;return A.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},A.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},A.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},A.load=function(S,L,R){var C=this,w=this.stats;if(w.loading.start)throw new Error("Loader can only be used once.");w.loading.start=self.performance.now();var x=o(S,this.controller.signal),c=R.onProgress,T=S.responseType==="arraybuffer",y=T?"byteLength":"length";this.context=S,this.config=L,this.callbacks=R,this.request=this.fetchSetup(S,x),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){C.abortInternal(),R.onTimeout(w,S,C.response)},L.timeout),self.fetch(this.request).then(function(v){if(C.response=C.loader=v,!v.ok){var N=v.status,B=v.statusText;throw new s(B||"fetch, bad network response",N,v)}return w.loading.first=Math.max(self.performance.now(),w.loading.start),w.total=parseInt(v.headers.get("Content-Length")||"0"),c&&Object(X.isFiniteNumber)(L.highWaterMark)?C.loadProgressively(v,w,S,L.highWaterMark,c):T?v.arrayBuffer():v.text()}).then(function(v){var N=C.response;self.clearTimeout(C.requestTimeout),w.loading.end=Math.max(self.performance.now(),w.loading.first),w.loaded=w.total=v[y];var B={url:N.url,data:v};c&&!Object(X.isFiniteNumber)(L.highWaterMark)&&c(w,S,v,N),R.onSuccess(B,w,S,N)}).catch(function(v){if(self.clearTimeout(C.requestTimeout),w.aborted)return;var N=v.code||0;R.onError({code:N,text:v.message},S,v.details)})},A.getCacheAge=function(){var S=null;if(this.response){var L=this.response.headers.get("age");S=L?parseFloat(L):null}return S},A.loadProgressively=function(S,L,R,C,w){C===void 0&&(C=0);var x=new U.default,c=S.body.getReader(),T=function y(){return c.read().then(function(v){if(v.done)return x.dataLength&&w(L,R,x.flush(),S),Promise.resolve(new ArrayBuffer(0));var N=v.value,B=N.length;return L.loaded+=B,B<C||x.dataLength?(x.push(N),x.dataLength>=C&&w(L,R,x.flush(),S)):w(L,R,N,S),y()}).catch(function(){return Promise.reject()})};return T()},a}();function o(a,A){var _={method:"GET",mode:"cors",credentials:"same-origin",signal:A,headers:new self.Headers(l({},a.headers))};return a.rangeEnd&&_.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),_}function h(a,A){return new self.Request(a.url,A)}var s=function(a){G(A,a);function A(_,S,L){var R;return R=a.call(this,_)||this,R.code=void 0,R.details=void 0,R.code=S,R.details=L,R}return A}(W(Error));$.default=f},"./src/utils/imsc1-ttml-parser.ts":function(ie,$,M){"use strict";M.r($),M.d($,"IMSC1_CODEC",function(){return g}),M.d($,"parseIMSC1",function(){return u});var X=M("./src/utils/mp4-tools.ts"),F=M("./src/utils/vttparser.ts"),U=M("./src/utils/vttcue.ts"),G=M("./src/demux/id3.ts"),W=M("./src/utils/timescale-conversion.ts"),i=M("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(C){for(var w=1;w<arguments.length;w++){var x=arguments[w];for(var c in x)Object.prototype.hasOwnProperty.call(x,c)&&(C[c]=x[c])}return C},D.apply(this,arguments)}var g="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,l={left:"start",center:"center",right:"end",start:"start",end:"end"};function u(C,w,x,c,T){var y=Object(X.findBox)(new Uint8Array(C),["mdat"]);if(y.length===0){T(new Error("Could not parse IMSC1 mdat"));return}var v=y[0],N=Object(G.utf8ArrayToStr)(new Uint8Array(C,v.start,v.end-v.start)),B=Object(W.toTimescaleFromScale)(w,1,x);try{c(f(N,B))}catch(O){T(O)}}function f(C,w){var x=new DOMParser,c=x.parseFromString(C,"text/xml"),T=c.getElementsByTagName("tt")[0];if(!T)throw new Error("Invalid ttml");var y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},v=Object.keys(y).reduce(function(P,b){return P[b]=T.getAttribute("ttp:"+b)||y[b],P},{}),N=T.getAttribute("xml:space")!=="preserve",B=h(o(T,"styling","style")),O=h(o(T,"layout","region")),j=o(T,"body","[begin]");return[].map.call(j,function(P){var b=s(P,N);if(!b||!P.hasAttribute("begin"))return null;var Y=S(P.getAttribute("begin"),v),ee=S(P.getAttribute("dur"),v),le=S(P.getAttribute("end"),v);if(Y===null)throw _(P);if(le===null){if(ee===null)throw _(P);le=Y+ee}var ue=new U.default(Y-w,le-w,b);ue.id=Object(i.generateCueId)(ue.startTime,ue.endTime,ue.text);var ke=O[P.getAttribute("region")],we=B[P.getAttribute("style")];ue.position=10,ue.size=80;var Ae=a(ke,we),ce=Ae.textAlign;if(ce){var pe=l[ce];pe&&(ue.lineAlign=pe),ue.align=ce}return D(ue,Ae),ue}).filter(function(P){return P!==null})}function o(C,w,x){var c=C.getElementsByTagName(w)[0];return c?[].slice.call(c.querySelectorAll(x)):[]}function h(C){return C.reduce(function(w,x){var c=x.getAttribute("xml:id");return c&&(w[c]=x),w},{})}function s(C,w){return[].slice.call(C.childNodes).reduce(function(x,c,T){var y;return c.nodeName==="br"&&T?x+`
|
|
`:(y=c.childNodes)!==null&&y!==void 0&&y.length?s(c,w):w?x+c.textContent.trim().replace(/\s+/g," "):x+c.textContent},"")}function a(C,w){var x="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(T,y){var v=A(w,x,y)||A(C,x,y);return v&&(T[y]=v),T},{})}function A(C,w,x){return C.hasAttributeNS(w,x)?C.getAttributeNS(w,x):null}function _(C){return new Error("Could not parse ttml timestamp "+C)}function S(C,w){if(!C)return null;var x=Object(F.parseTimeStamp)(C);return x===null&&(m.test(C)?x=L(C,w):p.test(C)&&(x=R(C,w))),x}function L(C,w){var x=m.exec(C),c=(x[4]|0)+(x[5]|0)/w.subFrameRate;return(x[1]|0)*3600+(x[2]|0)*60+(x[3]|0)+c/w.frameRate}function R(C,w){var x=p.exec(C),c=Number(x[1]),T=x[2];switch(T){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/w.frameRate;case"t":return c/w.tickRate}return c}},"./src/utils/logger.ts":function(ie,$,M){"use strict";M.r($),M.d($,"enableLogs",function(){return i}),M.d($,"logger",function(){return D});var X=function(){},F={trace:X,debug:X,log:X,warn:X,info:X,error:X},U=F;function G(g){var m=self.console[g];return m?m.bind(self.console,"["+g+"] >"):X}function W(g){for(var m=arguments.length,p=new Array(m>1?m-1:0),l=1;l<m;l++)p[l-1]=arguments[l];p.forEach(function(u){U[u]=g[u]?g[u].bind(g):G(u)})}function i(g){if(self.console&&g===!0||typeof g=="object"){W(g,"debug","log","info","warn","error");try{U.log()}catch(m){U=F}}else U=F}var D=U},"./src/utils/mediakeys-helper.ts":function(ie,$,M){"use strict";M.r($),M.d($,"KeySystems",function(){return X}),M.d($,"requestMediaKeySystemAccess",function(){return F});var X;(function(U){U.WIDEVINE="com.widevine.alpha",U.PLAYREADY="com.microsoft.playready"})(X||(X={}));var F=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ie,$,M){"use strict";M.r($),M.d($,"getMediaSource",function(){return X});function X(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ie,$,M){"use strict";M.r($),M.d($,"bin2str",function(){return W}),M.d($,"readUint16",function(){return i}),M.d($,"readUint32",function(){return D}),M.d($,"writeUint32",function(){return g}),M.d($,"findBox",function(){return m}),M.d($,"parseSegmentIndex",function(){return p}),M.d($,"parseInitSegment",function(){return l}),M.d($,"getStartDTS",function(){return u}),M.d($,"getDuration",function(){return f}),M.d($,"computeRawDurationFromSamples",function(){return o}),M.d($,"offsetStartDTS",function(){return h}),M.d($,"segmentValidRange",function(){return s}),M.d($,"appendUint8Array",function(){return a});var X=M("./src/utils/typed-array.ts"),F=M("./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 S=A[_]<<8|A[_+1];return S<0?65536+S:S}function D(A,_){"data"in A&&(_+=A.start,A=A.data);var S=A[_]<<24|A[_+1]<<16|A[_+2]<<8|A[_+3];return S<0?4294967296+S:S}function g(A,_,S){"data"in A&&(_+=A.start,A=A.data),A[_]=S>>24,A[_+1]=S>>16&255,A[_+2]=S>>8&255,A[_+3]=S&255}function m(A,_){var S=[];if(!_.length)return S;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 w=R;w<C;){var x=D(L,w),c=W(L.subarray(w+4,w+8)),T=x>1?w+x:C;if(c===_[0])if(_.length===1)S.push({data:L,start:w+8,end:T});else{var y=m({data:L,start:w+8,end:T},_.slice(1));y.length&&G.apply(S,y)}w=T}return S}function p(A){var _=m(A,["moov"]),S=_[0],L=S?S.end:null,R=m(A,["sidx"]);if(!R||!R[0])return null;var C=[],w=R[0],x=w.data[0],c=x===0?8:16,T=D(w,c);c+=4;var y=0,v=0;x===0?c+=8:c+=16,c+=2;var N=w.end+v,B=i(w,c);c+=2;for(var O=0;O<B;O++){var j=c,P=D(w,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(w,j);j+=4,C.push({referenceSize:b,subsegmentDuration:ee,info:{duration:ee/T,start:N,end:N+b-1}}),N+=b,j+=4,c=j}return{earliestPresentationTime:y,timescale:T,version:x,referencesCount:B,references:C,moovEndOffset:L}}function l(A){for(var _=[],S=m(A,["moov","trak"]),L=0;L<S.length;L++){var R=S[L],C=m(R,["tkhd"])[0];if(C){var w=C.data[C.start],x=w===0?12:20,c=D(C,x),T=m(R,["mdia","mdhd"])[0];if(T){w=T.data[T.start],x=w===0?12:20;var y=D(T,x),v=m(R,["mdia","hdlr"])[0];if(v){var N=W(v.data.subarray(v.start+8,v.start+12)),B={soun:F.ElementaryStreamTypes.AUDIO,vide:F.ElementaryStreamTypes.VIDEO}[N];if(B){var O=m(R,["mdia","minf","stbl","stsd"])[0],j=void 0;O&&(j=W(O.data.subarray(O.start+12,O.start+16))),_[c]={timescale:y,type:B},_[B]={timescale:y,id:c,codec:j}}}}}}var P=m(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 u(A,_){return m(_,["moof","traf"]).reduce(function(S,L){var R=m(L,["tfdt"])[0],C=R.data[R.start],w=m(L,["tfhd"]).reduce(function(x,c){var T=D(c,4),y=A[T];if(y){var v=D(R,4);C===1&&(v*=Math.pow(2,32),v+=D(R,8));var N=y.timescale||9e4,B=v/N;if(isFinite(B)&&(x===null||B<x))return B}return x},null);return w!==null&&isFinite(w)&&(S===null||w<S)?w:S},null)||0}function f(A,_){for(var S=0,L=0,R=0,C=m(A,["moof","traf"]),w=0;w<C.length;w++){var x=C[w],c=m(x,["tfhd"])[0],T=D(c,4),y=_[T];if(!y)continue;var v=y.default,N=D(c,0)|(v==null?void 0:v.flags),B=v==null?void 0:v.duration;N&8&&(N&2?B=D(c,12):B=D(c,8));for(var O=y.timescale||9e4,j=m(x,["trun"]),P=0;P<j.length;P++){if(B){var b=D(j[P],4);S=B*b}else S=o(j[P]);y.type===F.ElementaryStreamTypes.VIDEO?L+=S/O:y.type===F.ElementaryStreamTypes.AUDIO&&(R+=S/O)}}if(L===0&&R===0){var Y=p(A);if(Y!=null&&Y.references)return Y.references.reduce(function(ee,le){return ee+le.info.duration||0},0)}return L||R}function o(A){var _=D(A,0),S=8;_&1&&(S+=4),_&4&&(S+=4);for(var L=0,R=D(A,4),C=0;C<R;C++){if(_&256){var w=D(A,S);L+=w,S+=4}_&512&&(S+=4),_&1024&&(S+=4),_&2048&&(S+=4)}return L}function h(A,_,S){m(_,["moof","traf"]).forEach(function(L){m(L,["tfhd"]).forEach(function(R){var C=D(R,4),w=A[C];if(!w)return;var x=w.timescale||9e4;m(L,["tfdt"]).forEach(function(c){var T=c.data[c.start],y=D(c,4);if(T===0)g(c,4,y-S*x);else{y*=Math.pow(2,32),y+=D(c,8),y-=S*x,y=Math.max(y,0);var v=Math.floor(y/(U+1)),N=Math.floor(y%(U+1));g(c,4,v),g(c,8,N)}})})})}function s(A){var _={valid:null,remainder:null},S=m(A,["moof"]);if(S){if(S.length<2)return _.remainder=A,_}else return _;var L=S[S.length-1];return _.valid=Object(X.sliceUint8)(A,0,L.start-8),_.remainder=Object(X.sliceUint8)(A,L.start-8),_}function a(A,_){var S=new Uint8Array(A.length+_.length);return S.set(A),S.set(_,A.length),S}},"./src/utils/output-filter.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return X});var X=function(){function F(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=F.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=[]},F}()},"./src/utils/texttrack-utils.ts":function(ie,$,M){"use strict";M.r($),M.d($,"sendAddTrackEvent",function(){return F}),M.d($,"addCueToTrack",function(){return U}),M.d($,"clearCurrentCues",function(){return G}),M.d($,"removeCuesInRange",function(){return W}),M.d($,"getCuesInRange",function(){return D});var X=M("./src/utils/logger.ts");function F(g,m){var p;try{p=new Event("addtrack")}catch(l){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=g,m.dispatchEvent(p)}function U(g,m){var p=g.mode;if(p==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(m.id))try{if(g.addCue(m),!g.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(u){X.logger.debug("[texttrack-utils]: "+u);var l=new self.TextTrackCue(m.startTime,m.endTime,m.text);l.id=m.id,g.addCue(l)}p==="disabled"&&(g.mode=p)}function G(g){var m=g.mode;if(m==="disabled"&&(g.mode="hidden"),g.cues)for(var p=g.cues.length;p--;)g.removeCue(g.cues[p]);m==="disabled"&&(g.mode=m)}function W(g,m,p){var l=g.mode;if(l==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var u=D(g.cues,m,p),f=0;f<u.length;f++)g.removeCue(u[f]);l==="disabled"&&(g.mode=l)}function i(g,m){if(m<g[0].startTime)return 0;var p=g.length-1;if(m>g[p].endTime)return-1;for(var l=0,u=p;l<=u;){var f=Math.floor((u+l)/2);if(m<g[f].startTime)u=f-1;else if(m>g[f].startTime&&l<p)l=f+1;else return f}return g[l].startTime-m<m-g[u].startTime?l:u}function D(g,m,p){var l=[],u=i(g,m);if(u>-1)for(var f=u,o=g.length;f<o;f++){var h=g[f];if(h.startTime>=m&&h.endTime<=p)l.push(h);else if(h.startTime>p)return l}return l}},"./src/utils/time-ranges.ts":function(ie,$,M){"use strict";M.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(ie,$,M){"use strict";M.r($),M.d($,"toTimescaleFromBase",function(){return F}),M.d($,"toTimescaleFromScale",function(){return U}),M.d($,"toMsFromMpegTsClock",function(){return G}),M.d($,"toMpegTsClockFromTimescale",function(){return W});var X=9e4;function F(i,D,g,m){g===void 0&&(g=1),m===void 0&&(m=!1);var p=i*D*g;return m?Math.round(p):p}function U(i,D,g,m){return g===void 0&&(g=1),m===void 0&&(m=!1),F(i,D,1/g,m)}function G(i,D){return D===void 0&&(D=!1),F(i,1e3,1/X,D)}function W(i,D){return D===void 0&&(D=1),F(i,X,1/D)}},"./src/utils/typed-array.ts":function(ie,$,M){"use strict";M.r($),M.d($,"sliceUint8",function(){return X});function X(F,U,G){return Uint8Array.prototype.slice?F.slice(U,G):new Uint8Array(Array.prototype.slice.call(F,U,G))}},"./src/utils/vttcue.ts":function(ie,$,M){"use strict";M.r($),$.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var X=["","lr","rl"],F=["start","middle","end","left","right"];function U(g,m){if(typeof m!="string")return!1;if(!Array.isArray(g))return!1;var p=m.toLowerCase();return~g.indexOf(p)?p:!1}function G(g){return U(X,g)}function W(g){return U(F,g)}function i(g){for(var m=arguments.length,p=new Array(m>1?m-1:0),l=1;l<m;l++)p[l-1]=arguments[l];for(var u=1;u<arguments.length;u++){var f=arguments[u];for(var o in f)g[o]=f[o]}return g}function D(g,m,p){var l=this,u={enumerable:!0};l.hasBeenReset=!1;var f="",o=!1,h=g,s=m,a=p,A=null,_="",S=!0,L="auto",R="start",C=50,w="middle",x=50,c="middle";Object.defineProperty(l,"id",i({},u,{get:function(){return f},set:function(y){f=""+y}})),Object.defineProperty(l,"pauseOnExit",i({},u,{get:function(){return o},set:function(y){o=!!y}})),Object.defineProperty(l,"startTime",i({},u,{get:function(){return h},set:function(y){if(typeof y!="number")throw new TypeError("Start time must be set to a number.");h=y,this.hasBeenReset=!0}})),Object.defineProperty(l,"endTime",i({},u,{get:function(){return s},set:function(y){if(typeof y!="number")throw new TypeError("End time must be set to a number.");s=y,this.hasBeenReset=!0}})),Object.defineProperty(l,"text",i({},u,{get:function(){return a},set:function(y){a=""+y,this.hasBeenReset=!0}})),Object.defineProperty(l,"region",i({},u,{get:function(){return A},set:function(y){A=y,this.hasBeenReset=!0}})),Object.defineProperty(l,"vertical",i({},u,{get:function(){return _},set:function(y){var v=G(y);if(v===!1)throw new SyntaxError("An invalid or illegal string was specified.");_=v,this.hasBeenReset=!0}})),Object.defineProperty(l,"snapToLines",i({},u,{get:function(){return S},set:function(y){S=!!y,this.hasBeenReset=!0}})),Object.defineProperty(l,"line",i({},u,{get:function(){return L},set:function(y){if(typeof y!="number"&&y!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");L=y,this.hasBeenReset=!0}})),Object.defineProperty(l,"lineAlign",i({},u,{get:function(){return R},set:function(y){var v=W(y);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");R=v,this.hasBeenReset=!0}})),Object.defineProperty(l,"position",i({},u,{get:function(){return C},set:function(y){if(y<0||y>100)throw new Error("Position must be between 0 and 100.");C=y,this.hasBeenReset=!0}})),Object.defineProperty(l,"positionAlign",i({},u,{get:function(){return w},set:function(y){var v=W(y);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");w=v,this.hasBeenReset=!0}})),Object.defineProperty(l,"size",i({},u,{get:function(){return x},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");x=y,this.hasBeenReset=!0}})),Object.defineProperty(l,"align",i({},u,{get:function(){return c},set:function(y){var v=W(y);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");c=v,this.hasBeenReset=!0}})),l.displayState=void 0}return D.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(ie,$,M){"use strict";M.r($),M.d($,"parseTimeStamp",function(){return U}),M.d($,"fixLineBreaks",function(){return m}),M.d($,"VTTParser",function(){return p});var X=M("./src/utils/vttcue.ts"),F=function(){function l(){}var u=l.prototype;return u.decode=function(o,h){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},l}();function U(l){function u(o,h,s,a){return(o|0)*3600+(h|0)*60+(s|0)+parseFloat(a||0)}var f=l.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?u(f[2],f[3],0,f[4]):u(f[1],f[2],f[3],f[4]):null}var G=function(){function l(){this.values=Object.create(null)}var u=l.prototype;return u.set=function(o,h){!this.get(o)&&h!==""&&(this.values[o]=h)},u.get=function(o,h,s){return s?this.has(o)?this.values[o]:h[s]:this.has(o)?this.values[o]:h},u.has=function(o){return o in this.values},u.alt=function(o,h,s){for(var a=0;a<s.length;++a)if(h===s[a]){this.set(o,h);break}},u.integer=function(o,h){/^-?\d+$/.test(h)&&this.set(o,parseInt(h,10))},u.percent=function(o,h){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(h)){var s=parseFloat(h);if(s>=0&&s<=100)return this.set(o,s),!0}return!1},l}();function W(l,u,f,o){var h=o?l.split(o):[l];for(var s in h){if(typeof h[s]!="string")continue;var a=h[s].split(f);if(a.length!==2)continue;var A=a[0],_=a[1];u(A,_)}}var i=new X.default(0,0,""),D=i.align==="middle"?"middle":"center";function g(l,u,f){var o=l;function h(){var A=U(l);if(A===null)throw new Error("Malformed timestamp: "+o);return l=l.replace(/^[^\sa-zA-Z-]+/,""),A}function s(A,_){var S=new G;W(A,function(C,w){var x;switch(C){case"region":for(var c=f.length-1;c>=0;c--)if(f[c].id===w){S.set(C,f[c].region);break}break;case"vertical":S.alt(C,w,["rl","lr"]);break;case"line":x=w.split(","),S.integer(C,x[0]),S.percent(C,x[0])&&S.set("snapToLines",!1),S.alt(C,x[0],["auto"]),x.length===2&&S.alt("lineAlign",x[1],["start",D,"end"]);break;case"position":x=w.split(","),S.percent(C,x[0]),x.length===2&&S.alt("positionAlign",x[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":S.percent(C,w);break;case"align":S.alt(C,w,["start",D,"end","left","right"]);break}},/:/,/\s/),_.region=S.get("region",null),_.vertical=S.get("vertical","");var L=S.get("line","auto");L==="auto"&&i.line===-1&&(L=-1),_.line=L,_.lineAlign=S.get("lineAlign","start"),_.snapToLines=S.get("snapToLines",!0),_.size=S.get("size",100),_.align=S.get("align",D);var R=S.get("position","auto");R==="auto"&&i.position===50&&(R=_.align==="start"||_.align==="left"?0:_.align==="end"||_.align==="right"?100:50),_.position=R}function a(){l=l.replace(/^\s+/,"")}if(a(),u.startTime=h(),a(),l.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);l=l.substr(3),a(),u.endTime=h(),a(),s(l,u)}function m(l){return l.replace(/<br(?: \/)?>/gi,`
|
|
`)}var p=function(){function l(){this.state="INITIAL",this.buffer="",this.decoder=new F,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var u=l.prototype;return u.parse=function(o){var h=this;o&&(h.buffer+=h.decoder.decode(o,{stream:!0}));function s(){var R=h.buffer,C=0;for(R=m(R);C<R.length&&R[C]!=="\r"&&R[C]!==`
|
|
`;)++C;var w=R.substr(0,C);return R[C]==="\r"&&++C,R[C]===`
|
|
`&&++C,h.buffer=R.substr(C),w}function a(R){W(R,function(C,w){},/:/)}try{var A="";if(h.state==="INITIAL"){if(!/\r\n|\n/.test(h.buffer))return this;A=s();var _=A.match(/^()?WEBVTT([ \t].*)?$/);if(!_||!_[0])throw new Error("Malformed WebVTT signature.");h.state="HEADER"}for(var S=!1;h.buffer;){if(!/\r\n|\n/.test(h.buffer))return this;S?S=!1:A=s();switch(h.state){case"HEADER":/:/.test(A)?a(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&&(S=!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},u.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=`
|
|
|
|
`,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(h){o.onparsingerror&&o.onparsingerror(h)}return o.onflush&&o.onflush(),this},l}()},"./src/utils/webvtt-parser.ts":function(ie,$,M){"use strict";M.r($),M.d($,"generateCueId",function(){return p}),M.d($,"parseWebVTT",function(){return u});var X=M("./src/polyfills/number.ts"),F=M("./src/utils/vttparser.ts"),U=M("./src/demux/id3.ts"),G=M("./src/utils/timescale-conversion.ts"),W=M("./src/remux/mp4-remuxer.ts"),i=/\r\n|\n\r|\n|\r/g,D=function(o,h,s){return s===void 0&&(s=0),o.substr(s,h.length)===h},g=function(o){var h=parseInt(o.substr(-3)),s=parseInt(o.substr(-6,2)),a=parseInt(o.substr(-9,2)),A=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(h)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(a)||!Object(X.isFiniteNumber)(A))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return h+=1e3*s,h+=60*1e3*a,h+=60*60*1e3*A,h},m=function(o){for(var h=5381,s=o.length;s;)h=h*33^o.charCodeAt(--s);return(h>>>0).toString()};function p(f,o,h){return m(f.toString())+m(o.toString())+m(h)}var l=function(o,h,s){var a=o[h],A=o[a.prevCC];if(!A||!A.new&&a.new){o.ccOffset=o.presentationOffset=a.start,a.new=!1;return}for(;(_=A)!==null&&_!==void 0&&_.new;){var _;o.ccOffset+=a.start-A.start,a.new=!1,a=A,A=o[a.prevCC]}o.presentationOffset=s};function u(f,o,h,s,a,A,_,S){var L=new F.VTTParser,R=Object(U.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(i,`
|
|
`).split(`
|
|
`),C=[],w=Object(G.toMpegTsClockFromTimescale)(o,h),x="00:00.000",c=0,T=0,y,v=!0,N=!1;L.oncue=function(B){var O=s[a],j=s.ccOffset,P=(c-w)/9e4;if(O!=null&&O.new&&(T!==void 0?j=s.ccOffset=O.start:l(s,a,P)),P&&(j=P-s.presentationOffset),N){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=p(B.startTime,B.endTime,ee)),B.endTime>0&&C.push(B)},L.onparsingerror=function(B){y=B},L.onflush=function(){if(y){S(y);return}_(C)},R.forEach(function(B){if(v)if(D(B,"X-TIMESTAMP-MAP=")){v=!1,N=!0,B.substr(16).split(",").forEach(function(O){D(O,"LOCAL:")?x=O.substr(6):D(O,"MPEGTS:")&&(c=parseInt(O.substr(7)))});try{T=g(x)/1e3}catch(O){N=!1,y=O}return}else B===""&&(v=!1);L.parse(B+`
|
|
`)}),L.flush()}},"./src/utils/xhr-loader.ts":function(ie,$,M){"use strict";M.r($);var X=M("./src/utils/logger.ts"),F=M("./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 F.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,m,p){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=m,this.callbacks=p,this.retryDelay=m.retryDelay,this.loadInternal()},i.loadInternal=function(){var g=this.config,m=this.context;if(!g)return;var p=this.loader=new self.XMLHttpRequest,l=this.stats;l.loading.first=0,l.loaded=0;var u=this.xhrSetup;try{if(u)try{u(p,m.url)}catch(h){p.open("GET",m.url,!0),u(p,m.url)}p.readyState||p.open("GET",m.url,!0);var f=this.context.headers;if(f)for(var o in f)p.setRequestHeader(o,f[o])}catch(h){this.callbacks.onError({code:p.status,text:h.message},m,p);return}m.rangeEnd&&p.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),p.send()},i.readystatechange=function(){var g=this.context,m=this.loader,p=this.stats;if(!g||!m)return;var l=m.readyState,u=this.config;if(p.aborted)return;if(l>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),l===4){m.onreadystatechange=null,m.onprogress=null;var f=m.status;if(f>=200&&f<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var o,h;if(g.responseType==="arraybuffer"?(o=m.response,h=o.byteLength):(o=m.responseText,h=o.length),p.loaded=p.total=h,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(p,g,o,m),!this.callbacks)return;var a={url:m.responseURL,data:o};this.callbacks.onSuccess(a,p,g,m)}else p.retry>=u.maxRetry||f>=400&&f<499?(X.logger.error(f+" while loading "+g.url),this.callbacks.onError({code:f,text:m.statusText},g,m)):(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,u.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),u.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 m=this.stats;m.loaded=g.loaded,g.lengthComputable&&(m.total=g.total)},i.getCacheAge=function(){var g=null;if(this.loader&&U.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");g=m?parseFloat(m):null}return g},W}();$.default=G}}).default})},vHTk:function(st,be,Q){st.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|