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

445 lines
1.2 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[74,5,6,7],{"+NIl":function(tt,be,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function(J,P){"use strict";function X(u,h){u.cmdState.push(h)}function j(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function B(u){var h=u.cmdState.pop();h&&h.closeBracket()}function K(u){for(var h=u.cmdState,d=h.length-1;d>=0;d--){var o=h[d];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function H(u,h,d){return function(){this.name=u,this.bracketNo=0,this.style=h,this.styles=d,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=H("importmodule","tag",["string","builtin"]),r.documentclass=H("documentclass","tag",["","atom"]),r.usepackage=H("usepackage","tag",["atom"]),r.begin=H("begin","tag",["atom"]),r.end=H("end","tag",["atom"]),r.label=H("label","tag",["atom"]),r.ref=H("ref","tag",["atom"]),r.eqref=H("eqref","tag",["atom"]),r.cite=H("cite","tag",["atom"]),r.bibitem=H("bibitem","tag",["atom"]),r.Bibitem=H("Bibitem","tag",["atom"]),r.RBibitem=H("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(u,h){u.f=h}function v(u,h){var d;if(u.match(/^\\[a-zA-Z@]+/)){var o=u.current().slice(1);return d=r.hasOwnProperty(o)?r[o]:r.DEFAULT,d=new d,X(h,d),L(h,p),d.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return L(h,function(s,a){return m(s,a,"\\]")}),"keyword";if(u.match("\\("))return L(h,function(s,a){return m(s,a,"\\)")}),"keyword";if(u.match("$$"))return L(h,function(s,a){return m(s,a,"$$")}),"keyword";if(u.match("$"))return L(h,function(s,a){return m(s,a,"$")}),"keyword";var l=u.next();if(l=="%")return u.skipToEnd(),"comment";if(l=="}"||l=="]"){if(d=j(h),d)d.closeBracket(l),L(h,p);else return"error";return"bracket"}else return l=="{"||l=="["?(d=r.DEFAULT,d=new d,X(h,d),"bracket"):/\d/.test(l)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),d=K(h),d.name=="begin"&&(d.argument=u.current()),d.styleIdentifier())}function m(u,h,d){if(u.eatSpace())return null;if(d&&u.match(d))return L(h,v),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=u.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(u.skipToEnd(),"comment"):"error"}function p(u,h){var d=u.peek(),o;return d=="{"||d=="["?(o=j(h),o.openBracket(d),u.eat(d),L(h,v),"bracket"):/[ \t\r]/.test(d)?(u.eat(d),null):(L(h,v),B(h),v(u,h))}return{startState:function(){var u=P.inMathMode?function(h,d){return m(h,d)}:v;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,h){return h.f(u,h)},blankLine:function(u){u.f=v,u.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"+ua5":function(tt,be,Z){},"/P1P":function(tt,be,Z){"use strict";Z.r(be);var ie=Z("+L6B"),J=Z("2/Rp"),P=Z("/zsF"),X=Z("PArb"),j=Z("5NDa"),B=Z("5rEg"),K=Z("OaEy"),H=Z("2fM7"),r=Z("14J3"),L=Z("BMrR"),v=Z("jCWc"),m=Z("kPKH"),p=Z("sPJy"),u=Z("bE4q"),h=Z("miYZ"),d=Z("tsqr"),o=Z("k1fw"),l=Z("9og8"),s=Z("y8nQ"),a=Z("Vl3Y"),R=Z("tJVT"),E=Z("WmNS"),w=Z.n(E),D=Z("q1tI"),O=Z.n(D),A=Z("Ot1p"),C=Z("Ty5D"),T=Z("9kvl"),f=Z("55Ip"),S=Z("lYpw"),y=Z.n(S),b=Z("B3m4"),U=Z("500L"),F=function(M){var I,g=M.graduation,W=M.globalSetting,$=M.loading,ne=M.user,oe=M.dispatch,we=Object(C.i)(),ge=Object(C.h)(),xe=ne.userInfo,Re=a.a.useForm(),Le=Object(R.a)(Re,1),ce=Le[0],he=g.addTopicData,re=function(){var de=Object(l.a)(w.a.mark(function se(){var De,Ne,Se,Pe;return w.a.wrap(function(le){for(;;)switch(le.prev=le.next){case 0:return De=ce.getFieldsValue(),Ne=Object(o.a)({},De),Ne!=null&&Ne.attachment_ids&&(Ne.attachment_ids=(Se=Ne.attachment_ids)===null||Se===void 0?void 0:Se.map(function(ve){return ve.id||ve.response.id})),le.next=5,Object(b.a)(Object(o.a)({coursesId:we.coursesId,attachment_ids:[]},Ne));case 5:Pe=le.sent,Pe.status?d.b.error(Pe.message):T.d.push("/classrooms/".concat(we.coursesId,"/graduation_tasks/").concat(we.categoryId));case 7:case"end":return le.stop()}},se)}));return function(){return de.apply(this,arguments)}}();return Object(D.useEffect)(function(){oe({type:"graduation/addTopicDefaultData",payload:Object(o.a)({},we)})},[we.coursesId]),O.a.createElement("section",{className:"edu-container"},O.a.createElement("section",{className:"animated fadeIn"},O.a.createElement("aside",{className:"mt10"},xe&&O.a.createElement(u.a,{separator:">"},O.a.createElement(u.a.Item,null,O.a.createElement(f.a,{to:"".concat(xe.first_category_url)},xe==null||((I=xe.course)===null||I===void 0)?void 0:I.course_name)),O.a.createElement(u.a.Item,null,O.a.createElement(f.a,{to:"/classrooms/".concat(we.coursesId,"/graduation_tasks/").concat(we.categoryId)},"\u6BD5\u8BBE\u4EFB\u52A1")),O.a.createElement(u.a.Item,null,"\u65B0\u5EFA"))),O.a.createElement("aside",{className:[y.a.title,"mt20"].join(" ")},O.a.createElement(L.a,{style:{width:"100%"}},O.a.createElement(m.a,{flex:"1"},O.a.createElement("strong",{className:"font20 ml5"},"\u65B0\u5EFA\u6BD5\u8BBE\u4EFB\u52A1")),O.a.createElement(m.a,null,O.a.createElement(f.a,{className:"font16 c-light-black",to:"/classrooms/".concat(we.coursesId,"/exercise")},"\u8FD4\u56DE"))))),O.a.createElement("section",{className:[y.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},O.a.createElement(a.a,{layout:"vertical",form:ce,scrollToFirstError:!0,onFinish:function(){var de=Object(l.a)(w.a.mark(function se(De){return w.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:re();case 1:case"end":return Se.stop()}},se)}));return function(se){return de.apply(this,arguments)}}()},O.a.createElement(a.a.Item,{name:"task_type",label:"\u7C7B\u578B\uFF1A",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4EFB\u52A1\u7C7B\u578B"}]},O.a.createElement(H.a,{size:"large",placeholder:"\u8BF7\u9009\u62E9\u4EFB\u52A1\u7C7B\u578B",style:{width:200}},O.a.createElement(H.a.Option,{value:1},"\u666E\u901A"),O.a.createElement(H.a.Option,{value:2},"\u5206\u7EC4"))),O.a.createElement(a.a.Item,{name:"name",label:"\u9009\u9898\u540D\u79F0\uFF1A",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u6807\u9898"}]},O.a.createElement(B.a,{maxLength:60,size:"large",suffix:"0/60",placeholder:"\u4EFB\u52A1\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),O.a.createElement(X.a,null),O.a.createElement(a.a.Item,{label:"\u5185\u5BB9",name:"description",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5185\u5BB9"}]},O.a.createElement(A.a,{watch:!0,placeholder:"\u8BF7\u4EFB\u52A1\u5185\u5BB9\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"})),O.a.createElement(L.a,null,O.a.createElement(m.a,null,O.a.createElement(a.a.Item,{name:"attachment_ids"},O.a.createElement(U.b,null)))))),O.a.createElement("aside",{className:y.a.btns},O.a.createElement(J.a,{type:"primary",onClick:function(){ce.submit()}},"\u4FDD\u5B58"),O.a.createElement(f.a,{to:"/classrooms/".concat(we.coursesId,"/graduation_tasks/").concat(we.categoryId)},"\u53D6\u6D88")))};be.default=Object(T.a)(function(_){var M=_.graduation,I=_.loading,g=_.user,W=_.globalSetting;return{graduation:M,globalSetting:W,user:g,loading:I.effects}})(F)},"/cxE":function(tt,be,Z){"use strict";Z.d(be,"f",function(){return P}),Z.d(be,"g",function(){return X}),Z.d(be,"h",function(){return j}),Z.d(be,"e",function(){return K}),Z.d(be,"b",function(){return H}),Z.d(be,"c",function(){return r}),Z.d(be,"d",function(){return L}),Z.d(be,"a",function(){return v});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 J=new ie;function P(m){K(m)||J.onUnexpectedError(m);return}function X(m){K(m)||J.onUnexpectedExternalError(m);return}function j(m){if(m instanceof Error){let{name:p,message:u}=m;const h=m.stacktrace||m.stack;return{$isError:!0,name:p,message:u,stack:h}}return m}const B="Canceled";function K(m){return m instanceof Error&&m.name===B&&m.message===B}function H(){const m=new Error(B);return m.name=m.message,m}function r(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function L(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class v extends Error{constructor(m){super("NotSupported");m&&(this.message=m)}}},"19Vz":function(tt,be,Z){(function(ie){ie(Z("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(H,r,L){var v=L&&L!=ie.Init;if(r&&!v)H.on("blur",j),H.on("change",B),H.on("swapDoc",B),ie.on(H.getInputField(),"compositionupdate",H.state.placeholderCompose=function(){X(H)}),B(H);else if(!r&&v){H.off("blur",j),H.off("change",B),H.off("swapDoc",B),ie.off(H.getInputField(),"compositionupdate",H.state.placeholderCompose),J(H);var m=H.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}r&&!H.hasFocus()&&j(H)});function J(H){H.state.placeholder&&(H.state.placeholder.parentNode.removeChild(H.state.placeholder),H.state.placeholder=null)}function P(H){J(H);var r=H.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=H.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var L=H.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),r.appendChild(L),H.display.lineSpace.insertBefore(r,H.display.lineSpace.firstChild)}function X(H){setTimeout(function(){var r=!1,L=H.getInputField();L.nodeName=="TEXTAREA"?r=!L.value:H.lineCount()==1&&(r=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),r?P(H):J(H)},20)}function j(H){K(H)&&P(H)}function B(H){var r=H.getWrapperElement(),L=K(H);r.className=r.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?P(H):J(H)}function K(H){return H.lineCount()===1&&H.getLine(0)===""}})},"1eCo":function(tt,be,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";var J={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},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(X,j){var B=X.indentUnit,K={},H=j.htmlMode?J:P;for(var r in H)K[r]=H[r];for(var r in j)K[r]=j[r];var L,v;function m(f,S){function y(F){return S.tokenize=F,F(f,S)}var b=f.next();if(b=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?y(h("atom","]]>")):null:f.match("--")?y(h("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),y(d(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),S.tokenize=h("meta","?>"),"meta"):(L=f.eat("/")?"closeTag":"openTag",S.tokenize=p,"tag bracket");if(b=="&"){var U;return f.eat("#")?f.eat("x")?U=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):U=f.eatWhile(/[\d]/)&&f.eat(";"):U=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),U?"atom":"error"}else return f.eatWhile(/[^&<]/),null}m.isInText=!0;function p(f,S){var y=f.next();if(y==">"||y=="/"&&f.eat(">"))return S.tokenize=m,L=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return L="equals",null;if(y=="<"){S.tokenize=m,S.state=a,S.tagName=S.tagStart=null;var b=S.tokenize(f,S);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(y)?(S.tokenize=u(y),S.stringStartCol=f.column(),S.tokenize(f,S)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(f){var S=function(y,b){for(;!y.eol();)if(y.next()==f){b.tokenize=p;break}return"string"};return S.isInAttribute=!0,S}function h(f,S){return function(y,b){for(;!y.eol();){if(y.match(S)){b.tokenize=m;break}y.next()}return f}}function d(f){return function(S,y){for(var b;(b=S.next())!=null;){if(b=="<")return y.tokenize=d(f+1),y.tokenize(S,y);if(b==">")if(f==1){y.tokenize=m;break}else return y.tokenize=d(f-1),y.tokenize(S,y)}return"meta"}}function o(f,S,y){this.prev=f.context,this.tagName=S,this.indent=f.indented,this.startOfLine=y,(K.doNotIndent.hasOwnProperty(S)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function l(f){f.context&&(f.context=f.context.prev)}function s(f,S){for(var y;;){if(!f.context)return;if(y=f.context.tagName,!K.contextGrabbers.hasOwnProperty(y)||!K.contextGrabbers[y].hasOwnProperty(S))return;l(f)}}function a(f,S,y){return f=="openTag"?(y.tagStart=S.column(),R):f=="closeTag"?E:a}function R(f,S,y){return f=="word"?(y.tagName=S.current(),v="tag",O):K.allowMissingTagName&&f=="endTag"?(v="tag bracket",O(f,S,y)):(v="error",R)}function E(f,S,y){if(f=="word"){var b=S.current();return y.context&&y.context.tagName!=b&&K.implicitlyClosed.hasOwnProperty(y.context.tagName)&&l(y),y.context&&y.context.tagName==b||K.matchClosing===!1?(v="tag",w):(v="tag error",D)}else return K.allowMissingTagName&&f=="endTag"?(v="tag bracket",w(f,S,y)):(v="error",D)}function w(f,S,y){return f!="endTag"?(v="error",w):(l(y),a)}function D(f,S,y){return v="error",w(f,S,y)}function O(f,S,y){if(f=="word")return v="attribute",A;if(f=="endTag"||f=="selfcloseTag"){var b=y.tagName,U=y.tagStart;return y.tagName=y.tagStart=null,f=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(b)?s(y,b):(s(y,b),y.context=new o(y,b,U==y.indented)),a}return v="error",O}function A(f,S,y){return f=="equals"?C:(K.allowMissing||(v="error"),O(f,S,y))}function C(f,S,y){return f=="string"?T:f=="word"&&K.allowUnquoted?(v="string",O):(v="error",O(f,S,y))}function T(f,S,y){return f=="string"?T:O(f,S,y)}return{startState:function(f){var S={tokenize:m,state:a,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(S.baseIndent=f),S},token:function(f,S){if(!S.tagName&&f.sol()&&(S.indented=f.indentation()),f.eatSpace())return null;L=null;var y=S.tokenize(f,S);return(y||L)&&y!="comment"&&(v=null,S.state=S.state(L||y,f,S),v&&(y=v=="error"?y+" error":v)),y},indent:function(f,S,y){var b=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+B;if(b&&b.noIndent)return ie.Pass;if(f.tokenize!=p&&f.tokenize!=m)return y?y.match(/^(\s*)/)[0].length:0;if(f.tagName)return K.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+B*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(S))return 0;var U=S&&/^<(\/)?([\w_:\.-]*)/.exec(S);if(U&&U[1])for(;b;)if(b.tagName==U[2]){b=b.prev;break}else if(K.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(U)for(;b;){var F=K.contextGrabbers[b.tagName];if(F&&F.hasOwnProperty(U[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+B:f.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(f){f.state==C&&(f.state=O)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var S=[],y=f.context;y;y=y.prev)y.tagName&&S.push(y.tagName);return S.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(tt,be,Z){"use strict";Z.d(be,"a",function(){return J});class ie{constructor(P){this.element=P,this.next=ie.Undefined,this.prev=ie.Undefined}}ie.Undefined=new ie(void 0);class J{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 P=this._first;for(;P!==ie.Undefined;){const X=P.next;P.prev=ie.Undefined,P.next=ie.Undefined,P=X}this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,X){const j=new ie(P);if(this._first===ie.Undefined)this._first=j,this._last=j;else if(X){const K=this._last;this._last=j,j.prev=K,K.next=j}else{const K=this._first;this._first=j,j.next=K,K.prev=j}this._size+=1;let B=!1;return()=>{B||(B=!0,this._remove(j))}}shift(){if(this._first===ie.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===ie.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==ie.Undefined&&P.next!==ie.Undefined){const X=P.prev;X.next=P.next,P.next.prev=X}else P.prev===ie.Undefined&&P.next===ie.Undefined?(this._first=ie.Undefined,this._last=ie.Undefined):P.next===ie.Undefined?(this._last=this._last.prev,this._last.next=ie.Undefined):P.prev===ie.Undefined&&(this._first=this._first.next,this._first.prev=ie.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==ie.Undefined;)yield P.element,P=P.next}}},"3/fG":function(tt,be,Z){"use strict";Z.d(be,"a",function(){return J});function ie(P,X){let j;return X.length===0?j=P:j=P.replace(/\{(\d+)\}/g,function(B,K){const H=K[0];return typeof X[H]!="undefined"?X[H]:B}),j}function J(P,X,...j){return ie(X,j)}},"500L":function(tt,be,Z){"use strict";Z.d(be,"a",function(){return E});var ie=Z("+L6B"),J=Z("2/Rp"),P=Z("2qtc"),X=Z("kLXV"),j=Z("9og8"),B=Z("k1fw"),K=Z("miYZ"),H=Z("tsqr"),r=Z("oBTY"),L=Z("tJVT"),v=Z("DZo9"),m=Z("8z0m"),p=Z("WmNS"),u=Z.n(p),h=Z("q1tI"),d=Z.n(h),o=Z("m3rI"),l=Z("wzkS"),s=Z("y5JW"),a=Z("LtfV"),R=m.a.Dragger;function E(w){var D=[];return w&&w.length>0&&(D=w.map(function(O){return{uid:O.id,id:O.id,name:O.title+s.c+O.filesize,url:O.url,filesize:O.filesize,status:"done",response:{id:O.id}}})),D}be.b=function(w){var D=w.value,O=w.onChange,A=w.action,C=w.className,T=w.maxSize,f=T===void 0?150:T,S=w.title,y=S===void 0?"\u4E0A\u4F20\u9644\u4EF6":S,b=w.showRemoveModal,U=b===void 0?!1:b,F=w.accept,_=F===void 0?"":F,M=w.additionalText,I=w.isDragger,g=w.number,W=g===void 0?1e3:g,$=w.aloneClear,ne=$===void 0?!1:$,oe=Object(h.useState)(!1),we=Object(L.a)(oe,2),ge=we[0],xe=we[1],Re=Object(h.useState)(D||[]),Le=Object(L.a)(Re,2),ce=Le[0],he=Le[1];Object(h.useEffect)(function(){D&&(he(Object(r.a)(D)),W===(D==null?void 0:D.length)&&xe(!0))},[D]);var re=function(){setTimeout(function(){ce.pop(),he(Object(r.a)(ce))},500)},de={multiple:!0,disabled:ge,accept:_,withCredentials:!0,fileList:ce,beforeUpload:function(Ne,Se){var Pe=Ne.size/1024/1024;return ce.concat(Se).length>W?(ce.pop(),he(Object(r.a)(ce)),H.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(W,"\u4E2A\u6587\u4EF6")),ne?Promise.reject():(re(),!1)):!0},action:A||"".concat(o.a.API_SERVER,"/api/attachments.json"),onChange:function(Ne){var Se,Pe,Ue=Object(r.a)(Ne.fileList);if(Ne.file.status==="done"&&((Se=Ne.file)===null||Se===void 0||((Pe=Se.response)===null||Pe===void 0)?void 0:Pe.status)===-1){var le,ve;H.b.error((le=Ne.file)===null||le===void 0||((ve=le.response)===null||ve===void 0)?void 0:ve.message);return}Ue.length>=W?xe(!0):xe(!1),he(Object(r.a)(Ue)),Ue=Ue.map(function(Ae){var Ie;if(Ae!=null&&(Ie=Ae.response)!==null&&Ie!==void 0&&Ie.id){var Ge;Ae.url="/api/attachments/".concat(Ae==null||((Ge=Ae.response)===null||Ge===void 0)?void 0:Ge.id)}return Ae.name.indexOf(s.c)===-1&&(Ae.name="".concat(Ae.name).concat(s.c).concat(Object(s.a)(Ae.size))),Object(B.a)({},Ae)}),console.log("info:",Ne),O(Ue)},onRemove:function(){var De=Object(j.a)(u.a.mark(function Se(Pe){var Ue;return u.a.wrap(function(ve){for(;;)switch(ve.prev=ve.next){case 0:if(Ue=function(){var Ae=Object(j.a)(u.a.mark(function Ie(){var Ge,$e;return u.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:if(Ge=Pe.response?Pe.response.id:Pe.id,!Ge){Je.next=8;break}return Je.next=4,Object(l.d)(Pe.response?Pe.response.id:Pe.uid);case 4:return $e=Je.sent,Je.abrupt("return",$e);case 8:return Je.abrupt("return",!0);case 9:case"end":return Je.stop()}},Ie)}));return function(){return Ae.apply(this,arguments)}}(),!U){ve.next=5;break}return ve.abrupt("return",new Promise(function(Ae,Ie){X.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:d.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var Ge=Object(j.a)(u.a.mark(function Ze(){var Je;return u.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:return qe.next=2,Ue();case 2:Je=qe.sent,H.b.success("\u5220\u9664\u6210\u529F"),Ae(!0);case 5:case"end":return qe.stop()}},Ze)}));function $e(){return Ge.apply(this,arguments)}return $e}(),onCancel:function(){return Ae(!1)}})}));case 5:return ve.next=7,Ue();case 7:return ve.abrupt("return",ve.sent);case 8:case"end":return ve.stop()}},Se)}));function Ne(Se){return De.apply(this,arguments)}return Ne}()};function se(De){De.preventDefault(),De.stopPropagation()}return d.a.createElement("div",{className:"multi-upload ".concat(C||"")},I&&d.a.createElement(R,de,d.a.createElement("p",{className:"ant-upload-drag-icon"},d.a.createElement(a.a,null)),d.a.createElement("p",{className:"ant-upload-text"},"\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64",d.a.createElement("br",null),"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",f,"MB)"," "),M),!I&&d.a.createElement(m.a,de,d.a.createElement(J.a,{style:{width:"108px",height:"32px",background:"#F6F7F9 linear-gradient(180deg, #FFFFFF 0%, #F6F7F9 100%)",boxShadow:"0px 2px 4px 0px #E0DFE1, inset 0px 1px 3px 0px rgba(255,255,255,0.5)",borderRadius:"2px",border:"1px solid #BACFFE",color:"#3061D0"},icon:d.a.createElement("i",{className:"iconfont icon-shangchuan3",style:{marginRight:"6px"}}),disabled:ge},y),d.a.createElement("span",{onClick:se,style:{marginLeft:10,color:"#FA6400"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",f,"MB)"," ")))}},"55Ip":function(tt,be,Z){"use strict";Z.d(be,"a",function(){return s});var ie=Z("Ty5D"),J=Z("dI71"),P=Z("q1tI"),X=Z.n(P),j=Z("YS25"),B=Z("17x9"),K=Z.n(B),H=Z("wx14"),r=Z("zLVn"),L=Z("9R94"),v=function(C){Object(J.a)(T,C);function T(){for(var S,y=arguments.length,b=new Array(y),U=0;U<y;U++)b[U]=arguments[U];return S=C.call.apply(C,[this].concat(b))||this,S.history=Object(j.a)(S.props),S}var f=T.prototype;return f.render=function(){return X.a.createElement(ie.c,{history:this.history,children:this.props.children})},T}(X.a.Component),m=function(C){Object(J.a)(T,C);function T(){for(var S,y=arguments.length,b=new Array(y),U=0;U<y;U++)b[U]=arguments[U];return S=C.call.apply(C,[this].concat(b))||this,S.history=Object(j.b)(S.props),S}var f=T.prototype;return f.render=function(){return X.a.createElement(ie.c,{history:this.history,children:this.props.children})},T}(X.a.Component),p=function(T,f){return typeof T=="function"?T(f):T},u=function(T,f){return typeof T=="string"?Object(j.c)(T,null,null,f):T},h=function(T){return T},d=X.a.forwardRef;typeof d=="undefined"&&(d=h);function o(C){return!!(C.metaKey||C.altKey||C.ctrlKey||C.shiftKey)}var l=d(function(C,T){var f=C.innerRef,S=C.navigate,y=C.onClick,b=Object(r.a)(C,["innerRef","navigate","onClick"]),U=b.target,F=Object(H.a)({},b,{onClick:function(M){try{y&&y(M)}catch(I){throw M.preventDefault(),I}!M.defaultPrevented&&M.button===0&&(!U||U==="_self")&&!o(M)&&(M.preventDefault(),S())}});return h!==d?F.ref=T||f:F.ref=f,X.a.createElement("a",F)}),s=d(function(C,T){var f=C.component,S=f===void 0?l:f,y=C.replace,b=C.to,U=C.innerRef,F=Object(r.a)(C,["component","replace","to","innerRef"]);return X.a.createElement(ie.e.Consumer,null,function(_){_||Object(L.a)(!1);var M=_.history,I=u(p(b,_.location),_.location),g=I?M.createHref(I):"",W=Object(H.a)({},F,{href:g,navigate:function(){var ne=p(b,_.location),oe=y?M.replace:M.push;oe(ne)}});return h!==d?W.ref=T||U:W.innerRef=U,X.a.createElement(S,W)})});if(!1)var a,R;var E=function(T){return T},w=X.a.forwardRef;typeof w=="undefined"&&(w=E);function D(){for(var C=arguments.length,T=new Array(C),f=0;f<C;f++)T[f]=arguments[f];return T.filter(function(S){return S}).join(" ")}var O=w(function(C,T){var f=C["aria-current"],S=f===void 0?"page":f,y=C.activeClassName,b=y===void 0?"active":y,U=C.activeStyle,F=C.className,_=C.exact,M=C.isActive,I=C.location,g=C.sensitive,W=C.strict,$=C.style,ne=C.to,oe=C.innerRef,we=Object(r.a)(C,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return X.a.createElement(ie.e.Consumer,null,function(ge){ge||Object(L.a)(!1);var xe=I||ge.location,Re=u(p(ne,xe),xe),Le=Re.pathname,ce=Le&&Le.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),he=ce?Object(ie.f)(xe.pathname,{path:ce,exact:_,sensitive:g,strict:W}):null,re=!!(M?M(he,xe):he),de=re?D(F,b):F,se=re?Object(H.a)({},$,{},U):$,De=Object(H.a)({"aria-current":re&&S||null,className:de,style:se,to:Re},we);return E!==w?De.ref=T||oe:De.innerRef=oe,X.a.createElement(s,De)})});if(!1)var A},"5VLF":function(tt,be,Z){"use strict";var ie,J;function P(X,j,B){var K=function(H,r){return X.js_beautify(H,r)};return K.js=X.js_beautify,K.css=j.css_beautify,K.html=B.html_beautify,K.js_beautify=X.js_beautify,K.css_beautify=j.css_beautify,K.html_beautify=B.html_beautify,K}!(ie=[Z("6UM0"),Z("TXwP"),Z("psGv")],J=function(X,j,B){return P(X,j,B)}.apply(be,ie),J!==void 0&&(tt.exports=J))},"5Y4S":function(tt,be,Z){"use strict";Z.d(be,"a",function(){return P});var ie=Z("MNsG");const J=ie.b.performance&&typeof ie.b.performance.now=="function";class P{constructor(X){this._highResolution=J&&X,this._startTime=this._now(),this._stopTime=-1}static create(X=!0){return new P(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(tt,be,Z){var ie,J;(function(){var P;(function(){"use strict";var j=[function(r,L,v){var m=v(1).Beautifier,p=v(5).Options;function u(h,d){var o=new m(h,d);return o.beautify()}r.exports=u,r.exports.defaultOptions=function(){return new p}},function(r,L,v){var m=v(2).Output,p=v(3).Token,u=v(4),h=v(5).Options,d=v(7).Tokenizer,o=v(7).line_starters,l=v(7).positionable_operators,s=v(7).TOKEN;function a(g,W){return W.indexOf(g)!==-1}function R(g){return g.replace(/^\s+/g,"")}function E(g){for(var W={},$=0;$<g.length;$++)W[g[$].replace(/-/g,"_")]=g[$];return W}function w(g,W){return g&&g.type===s.RESERVED&&g.text===W}function D(g,W){return g&&g.type===s.RESERVED&&a(g.text,W)}var O=["case","return","do","if","throw","else","await","break","continue","async"],A=["before-newline","after-newline","preserve-newline"],C=E(A),T=[C.before_newline,C.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function S(g,W){if(W.multiline_frame||W.mode===f.ForInitializer||W.mode===f.Conditional)return;g.remove_indent(W.start_line_index)}function y(g){g=g.replace(u.allLineBreaks,`
`);for(var W=[],$=g.indexOf(`
`);$!==-1;)W.push(g.substring(0,$)),g=g.substring($+1),$=g.indexOf(`
`);return g.length&&W.push(g),W}function b(g){return g===f.ArrayLiteral}function U(g){return a(g,[f.Expression,f.ForInitializer,f.Conditional])}function F(g,W){for(var $=0;$<g.length;$++){var ne=g[$].trim();if(ne.charAt(0)!==W)return!1}return!0}function _(g,W){for(var $=0,ne=g.length,oe;$<ne;$++)if(oe=g[$],oe&&oe.indexOf(W)!==0)return!1;return!0}function M(g,W){W=W||{},this._source_text=g||"",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 h(W)}M.prototype.create_flags=function(g,W){var $=0;g&&($=g.indentation_level,!this._output.just_added_newline()&&g.line_indent_level>$&&($=g.line_indent_level));var ne={mode:W,parent:g,last_token:g?g.last_token:new p(s.START_BLOCK,""),last_word:g?g.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:$,alignment:0,line_indent_level:g?g.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return ne},M.prototype._reset=function(g){var W=g.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,W),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var $=new d(g,this._options);return this._tokens=$.tokenize(),g},M.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g,W=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=`
`,W&&u.lineBreak.test(W||"")&&($=W.match(u.lineBreak)[0]));for(var ne=this._tokens.next();ne;)this.handle_token(ne),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ne,ne=this._tokens.next();return g=this._output.get_code($),g},M.prototype.handle_token=function(g,W){g.type===s.START_EXPR?this.handle_start_expr(g):g.type===s.END_EXPR?this.handle_end_expr(g):g.type===s.START_BLOCK?this.handle_start_block(g):g.type===s.END_BLOCK?this.handle_end_block(g):g.type===s.WORD?this.handle_word(g):g.type===s.RESERVED?this.handle_word(g):g.type===s.SEMICOLON?this.handle_semicolon(g):g.type===s.STRING?this.handle_string(g):g.type===s.EQUALS?this.handle_equals(g):g.type===s.OPERATOR?this.handle_operator(g):g.type===s.COMMA?this.handle_comma(g):g.type===s.BLOCK_COMMENT?this.handle_block_comment(g,W):g.type===s.COMMENT?this.handle_comment(g,W):g.type===s.DOT?this.handle_dot(g):g.type===s.EOF?this.handle_eof(g):g.type===s.UNKNOWN?this.handle_unknown(g,W):this.handle_unknown(g,W)},M.prototype.handle_whitespace_and_comments=function(g,W){var $=g.newlines,ne=this._options.keep_array_indentation&&b(this._flags.mode);if(g.comments_before)for(var oe=g.comments_before.next();oe;)this.handle_whitespace_and_comments(oe,W),this.handle_token(oe,W),oe=g.comments_before.next();if(ne)for(var we=0;we<$;we+=1)this.print_newline(we>0,W);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,W);for(var ge=1;ge<$;ge+=1)this.print_newline(!0,W)}};var I=["async","break","continue","return","throw","yield"];M.prototype.allow_wrap_or_preserved_newline=function(g,W){if(W=W===void 0?!1:W,this._output.just_added_newline())return;var $=this._options.preserve_newlines&&g.newlines||W,ne=a(this._flags.last_token.text,l)||a(g.text,l);if(ne){var oe=a(this._flags.last_token.text,l)&&a(this._options.operator_position,T)||a(g.text,l);$=$&&oe}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(D(this._flags.last_token,I))return;this._output.set_wrap_point()}},M.prototype.print_newline=function(g,W){if(!W&&(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 $=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&w($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(g)&&(this._flags.multiline_frame=!0)},M.prototype.print_token_line_indentation=function(g){this._output.just_added_newline()&&(this._options.keep_array_indentation&&g.newlines&&(g.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(g.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))},M.prototype.print_token=function(g){if(this._output.raw){this._output.add_raw_token(g);return}if(this._options.comma_first&&g.previous&&g.previous.type===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var W=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(W),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(g),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(g),this._output.non_breaking_space=!0,this._output.add_token(g.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},M.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.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))},M.prototype.set_mode=function(g){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,g),this._flags=this.create_flags(this._previous_flags,g),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===f.Statement&&S(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},M.prototype.start_of_object_property=function(){return this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"]))},M.prototype.start_of_statement=function(g){var W=!1;return W=W||D(this._flags.last_token,["var","let","const"])&&g.type===s.WORD,W=W||w(this._flags.last_token,"do"),W=W||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&D(this._flags.last_token,I)&&!g.newlines,W=W||w(this._flags.last_token,"else")&&!(w(g,"if")&&!g.comments_before),W=W||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),W=W||this._flags.last_token.type===s.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(g.text==="--"||g.text==="++")&&this._last_last_text!=="function"&&g.type!==s.WORD&&g.type!==s.RESERVED,W=W||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"])),W?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(g,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g,D(g,["do","for","if","while"])),!0):!1},M.prototype.handle_start_expr=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g);var W=f.Expression;if(g.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){D(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(g),this.set_mode(W),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}W=f.ArrayLiteral,b(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,W=f.ForInitializer):a(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,W=f.Conditional):a(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&g.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(g);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var ne=this._tokens.peek(-4);D($,["async","function"])||$.text==="*"&&D(ne,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(ne.text==="{"||ne.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(g);(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===f.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(g,g.newlines),this.print_token(g),this.set_mode(W),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},M.prototype.handle_end_expr=function(g){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(g,g.text==="]"&&b(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(g),this.restore_mode(),S(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},M.prototype.handle_start_block=function(g){this.handle_whitespace_and_comments(g);var W=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):$&&(a($.text,[":",","])&&a(W.type,[s.STRING,s.WORD,s.RESERVED])||a(W.text,["get","set","..."])&&a($.type,[s.WORD,s.RESERVED]))?a(this._last_last_text,["class","interface"])&&!a($.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):a(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||D(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(D(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ne=!W.comments_before&&W.text==="}",oe=ne&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var we=0,ge=null;this._flags.inline_frame=!0;do if(we+=1,ge=this._tokens.peek(we-1),ge.newlines){this._flags.inline_frame=!1;break}while(ge.type!==s.EOF&&!(ge.type===s.END_BLOCK&&ge.opened===g))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(oe||this._flags.last_token.type===s.EQUALS||D(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(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(g),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(g),this.indent(),!ne&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},M.prototype.handle_end_block=function(g){for(this.handle_whitespace_and_comments(g);this._flags.mode===f.Statement;)this.restore_mode();var W=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!W?this._output.space_before_token=!0:this._options.brace_style==="expand"?W||this.print_newline():W||(b(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(g)},M.prototype.handle_word=function(g){if(g.type===s.RESERVED){if(a(g.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)g.type=s.WORD;else if(g.text==="import"&&a(this._tokens.peek().text,["(","."]))g.type=s.WORD;else if(a(g.text,["as","from"])&&!this._flags.import_block)g.type=s.WORD;else if(this._flags.mode===f.ObjectLiteral){var W=this._tokens.peek();W.text===":"&&(g.type=s.WORD)}}if(this.start_of_statement(g)?D(this._flags.last_token,["var","let","const"])&&g.type===s.WORD&&(this._flags.declaration_statement=!0):g.newlines&&!U(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||!D(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(g),this.print_newline()):this.handle_whitespace_and_comments(g),this._flags.do_block&&!this._flags.do_while)if(w(g,"while")){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&w(g,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&D(g,["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(g),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(g)),w(g,"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()&&!g.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?D(this._flags.last_token,["get","set","new","export"])||D(this._flags.last_token,I)?this._output.space_before_token=!0:w(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(U(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(g),this._flags.last_word=g.text;return}var $="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":D(g,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===f.BlockStatement?$="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&U(this._flags.mode)?$="SPACE":this._flags.last_token.type===s.STRING?$="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===f.ObjectLiteral&&a(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),D(g,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),D(g,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ne=this._output.current_line;ne.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?D(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&D(g,["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||!D(g,["var","let","const"]))&&this._flags.last_token.text!==":"&&(w(g,"if")&&w(g.previous,"else")?this._output.space_before_token=!0:this.print_newline()):D(g,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);g.previous&&(g.previous.type===s.WORD||g.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(g),this._flags.last_word=g.text,g.type===s.RESERVED&&(g.text==="do"?this._flags.do_block=!0:g.text==="if"?this._flags.if_block=!0:g.text==="import"?this._flags.import_block=!0:this._flags.import_block&&w(g,"from")&&(this._flags.import_block=!1))},M.prototype.handle_semicolon=function(g){this.start_of_statement(g)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(g);for(var W=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&w(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(g)},M.prototype.handle_string=function(g){g.text.startsWith("`")&&g.newlines===0&&g.whitespace_before===""&&(g.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(g)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(g),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(g):g.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(g.previous.text==="]"||g.previous.text===")")&&g.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(g)},M.prototype.handle_equals=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0},M.prototype.handle_comma=function(g){this.handle_whitespace_and_comments(g,!0),this.print_token(g),this._output.space_before_token=!0,this._flags.declaration_statement?(U(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(g)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)},M.prototype.handle_operator=function(g){var W=g.text==="*"&&(D(this._flags.last_token,["function","yield"])||a(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),$=a(g.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(g)){var ne=!W;this.handle_whitespace_and_comments(g,ne)}if(g.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(g);return}if(g.text==="::"){this.print_token(g);return}if(this._flags.last_token.type===s.OPERATOR&&a(this._options.operator_position,T)&&this.allow_wrap_or_preserved_newline(g),g.text===":"&&this._flags.in_case){this.print_token(g),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 oe=!0,we=!0,ge=!1;if(g.text===":"?this._flags.ternary_depth===0?oe=!1:(this._flags.ternary_depth-=1,ge=!0):g.text==="?"&&(this._flags.ternary_depth+=1),!$&&!W&&this._options.preserve_newlines&&a(g.text,l)){var xe=g.text===":",Re=xe&&ge,Le=xe&&!ge;switch(this._options.operator_position){case C.before_newline:this._output.space_before_token=!Le,this.print_token(g),(!xe||Re)&&this.allow_wrap_or_preserved_newline(g),this._output.space_before_token=!0;return;case C.after_newline:this._output.space_before_token=!0,!xe||Re?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(g):this._output.space_before_token=!1,this.print_token(g),this._output.space_before_token=!0;return;case C.preserve_newline:Le||this.allow_wrap_or_preserved_newline(g),oe=!(this._output.just_added_newline()||Le),this._output.space_before_token=oe,this.print_token(g),this._output.space_before_token=!0;return}}if(W){this.allow_wrap_or_preserved_newline(g),oe=!1;var ce=this._tokens.peek();we=ce&&a(ce.type,[s.WORD,s.RESERVED])}else if(g.text==="...")this.allow_wrap_or_preserved_newline(g),oe=this._flags.last_token.type===s.START_BLOCK,we=!1;else if(a(g.text,["--","++","!","~"])||$){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(g),oe=!1,we=!1,g.newlines&&(g.text==="--"||g.text==="++"||g.text==="~")){var he=D(this._flags.last_token,O)&&g.newlines;he&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(he,!0)}this._flags.last_token.text===";"&&U(this._flags.mode)&&(oe=!0),this._flags.last_token.type===s.RESERVED?oe=!0:this._flags.last_token.type===s.END_EXPR?oe=!(this._flags.last_token.text==="]"&&(g.text==="--"||g.text==="++")):this._flags.last_token.type===s.OPERATOR&&(oe=a(g.text,["--","-","++","+"])&&a(this._flags.last_token.text,["--","-","++","+"]),a(g.text,["+","-"])&&a(this._flags.last_token.text,["--","++"])&&(we=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||oe,this.print_token(g),this._output.space_before_token=we},M.prototype.handle_block_comment=function(g,W){if(this._output.raw){this._output.add_raw_token(g),g.directives&&g.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(g.directives){this.print_newline(!1,W),this.print_token(g),g.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(g.text)&&!g.newlines){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0;return}else this.print_block_commment(g,W)},M.prototype.print_block_commment=function(g,W){var $=y(g.text),ne,oe=!1,we=!1,ge=g.whitespace_before,xe=ge.length;if(this.print_newline(!1,W),this.print_token_line_indentation(g),this._output.add_token($[0]),this.print_newline(!1,W),$.length>1){for($=$.slice(1),oe=F($,"*"),we=_($,ge),oe&&(this._flags.alignment=1),ne=0;ne<$.length;ne++)oe?(this.print_token_line_indentation(g),this._output.add_token(R($[ne]))):we&&$[ne]?(this.print_token_line_indentation(g),this._output.add_token($[ne].substring(xe))):(this._output.current_line.set_indent(-1),this._output.add_token($[ne])),this.print_newline(!1,W);this._flags.alignment=0}},M.prototype.handle_comment=function(g,W){g.newlines?this.print_newline(!1,W):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(g),this.print_newline(!1,W)},M.prototype.handle_dot=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),D(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(g,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(g)},M.prototype.handle_unknown=function(g,W){this.print_token(g),g.text[g.text.length-1]===`
`&&this.print_newline(!1,W)},M.prototype.handle_eof=function(g){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g)},r.exports.Beautifier=M},function(r){function L(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=[]}L.prototype.clone_empty=function(){var p=new L(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},L.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},L.prototype.has_match=function(p){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(p))return!0;return!1},L.prototype.set_indent=function(p,u){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},L.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)},L.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},L.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},L.prototype.is_empty=function(){return this.__items.length===0},L.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},L.prototype.push=function(p){this.__items.push(p);var u=p.lastIndexOf(`
`);u!==-1?this.__character_count=p.length-u:this.__character_count+=p.length},L.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},L.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},L.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},L.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},L.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 v(p,u){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)),u=u||"",p.indent_level>0&&(u=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}v.prototype.get_indent_size=function(p,u){var h=this.__base_string_length;return u=u||0,p<0&&(h=0),h+=p*this.__indent_size,h+=u,h},v.prototype.get_indent_string=function(p,u){var h=this.__base_string;return u=u||0,p<0&&(p=0,h=""),u+=p*this.__indent_size,this.__ensure_cache(u),h+=this.__cache[u],h},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,u=0,h="";this.__indent_size&&p>=this.__indent_size&&(u=Math.floor(p/this.__indent_size),p-=u*this.__indent_size,h=new Array(u+1).join(this.__indent_string)),p&&(h+=new Array(p+1).join(" ")),this.__cache.push(h)};function m(p,u){this.__indent_cache=new v(p,u),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 L(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,u){return this.__indent_cache.get_indent_string(p,u)},m.prototype.get_indent_size=function(p,u){return this.__indent_cache.get_indent_size(p,u)},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 u=this.current_line.pop();u&&(u[u.length-1]===`
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var h=this.__lines.join(`
`);return p!==`
`&&(h=h.replace(/[\n]/g,p)),h},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,u){return p=p||0,u=u||0,this.next_line.set_indent(p,u),this.__lines.length>1?(this.current_line.set_indent(p,u),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var u=0;u<p.newlines;u++)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 u=this.__lines.length;p<u;)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,u){for(var h=this.__lines.length-2;h>=0;){var d=this.__lines[h];if(d.is_empty())break;if(d.item(0).indexOf(p)!==0&&d.item(-1)!==u){this.__lines.splice(h+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}h--}},r.exports.Output=m},function(r){function L(v,m,p,u){this.type=v,this.text=m,this.comments_before=null,this.newlines=p||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=L},function(r,L){var v="\\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",u="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",h="(?:\\\\u[0-9a-fA-F]{4}|["+v+p+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+u+"])*";L.identifier=new RegExp(h+d,"g"),L.identifierStart=new RegExp(h),L.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+p+u+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;L.newline=/[\n\r\u2028\u2029]/,L.lineBreak=new RegExp(`\r
|`+L.newline.source),L.allLineBreaks=new RegExp(L.lineBreak.source,"g")},function(r,L,v){var m=v(6).Options,p=["before-newline","after-newline","preserve-newline"];function u(h){m.call(this,h,"js");var d=this.raw_options.brace_style||null;d==="expand-strict"?this.raw_options.brace_style="expand":d==="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 l=0;l<o.length;l++)o[l]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=o[l];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)}u.prototype=new m,r.exports.Options=u},function(r){function L(p,u){this.raw_options=v(p,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}L.prototype._get_array=function(p,u){var h=this.raw_options[p],d=u||[];return typeof h=="object"?h!==null&&typeof h.concat=="function"&&(d=h.concat()):typeof h=="string"&&(d=h.split(/[^a-zA-Z0-9_\/\-]+/)),d},L.prototype._get_boolean=function(p,u){var h=this.raw_options[p],d=h===void 0?!!u:!!h;return d},L.prototype._get_characters=function(p,u){var h=this.raw_options[p],d=u||"";return typeof h=="string"&&(d=h.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),d},L.prototype._get_number=function(p,u){var h=this.raw_options[p];u=parseInt(u,10),isNaN(u)&&(u=0);var d=parseInt(h,10);return isNaN(d)&&(d=u),d},L.prototype._get_selection=function(p,u,h){var d=this._get_selection_list(p,u,h);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+u+`
You passed in: '`+this.raw_options[p]+"'");return d[0]},L.prototype._get_selection_list=function(p,u,h){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(h=h||[u[0]],!this._is_valid_selection(h,u))throw new Error("Invalid Default Value!");var d=this._get_array(p,h);if(!this._is_valid_selection(d,u))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+u+`
You passed in: '`+this.raw_options[p]+"'");return d},L.prototype._is_valid_selection=function(p,u){return p.length&&u.length&&!p.some(function(h){return u.indexOf(h)===-1})};function v(p,u){var h={};p=m(p);var d;for(d in p)d!==u&&(h[d]=p[d]);if(u&&p[u])for(d in p[u])h[d]=p[u][d];return h}function m(p){var u={},h;for(h in p){var d=h.replace(/-/g,"_");u[d]=p[h]}return u}r.exports.Options=L,r.exports.normalizeOpts=m,r.exports.mergeOpts=v},function(r,L,v){var m=v(8).InputScanner,p=v(9).Tokenizer,u=v(9).TOKEN,h=v(13).Directives,d=v(4),o=v(12).Pattern,l=v(14).TemplatablePattern;function s(F,_){return _.indexOf(F)!==-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:u.START,RAW:u.RAW,EOF:u.EOF},R=new h(/\/\*/,/\*\//),E=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,w=/[0-9]/,D=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),A=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";A=A.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),A="\\?\\.(?!\\d) "+A,A=A.replace(/ /g,"|");var C=new RegExp(A),T="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=T.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),S=new RegExp("^(?:"+f.join("|")+")$"),y,b=function(F,_){p.call(this,F,_),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var M=new o(this._input),I=new l(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(d.identifier).matching(d.identifierMatch),number:M.matching(E),punct:M.matching(C),comment:M.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:M.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:M.matching(/<!--/),html_comment_end:M.matching(/-->/),include:M.starting_with(/#include/).until_after(d.lineBreak),shebang:M.starting_with(/#!/).until_after(d.lineBreak),xml:M.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:I.until(/['\\\n\r\u2028\u2029]/),double_quote:I.until(/["\\\n\r\u2028\u2029]/),template_text:I.until(/[`\\$]/),template_expression:I.until(/[`}\\]/)}};b.prototype=new p,b.prototype._is_comment=function(F){return F.type===a.COMMENT||F.type===a.BLOCK_COMMENT||F.type===a.UNKNOWN},b.prototype._is_opening=function(F){return F.type===a.START_BLOCK||F.type===a.START_EXPR},b.prototype._is_closing=function(F,_){return(F.type===a.END_BLOCK||F.type===a.END_EXPR)&&_&&(F.text==="]"&&_.text==="["||F.text===")"&&_.text==="("||F.text==="}"&&_.text==="{")},b.prototype._reset=function(){y=!1},b.prototype._get_next_token=function(F,_){var M=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(a.EOF,""):(M=M||this._read_non_javascript(I),M=M||this._read_string(I),M=M||this._read_word(F),M=M||this._read_singles(I),M=M||this._read_comment(I),M=M||this._read_regexp(I,F),M=M||this._read_xml(I,F),M=M||this._read_punctuation(),M=M||this._create_token(a.UNKNOWN,this._input.next()),M)},b.prototype._read_word=function(F){var _;if(_=this.__patterns.identifier.read(),_!=="")return _=_.replace(d.allLineBreaks,`
`),!(F.type===a.DOT||F.type===a.RESERVED&&(F.text==="set"||F.text==="get"))&&S.test(_)?(_==="in"||_==="of")&&(F.type===a.WORD||F.type===a.STRING)?this._create_token(a.OPERATOR,_):this._create_token(a.RESERVED,_):this._create_token(a.WORD,_);if(_=this.__patterns.number.read(),_!=="")return this._create_token(a.WORD,_)},b.prototype._read_singles=function(F){var _=null;return F==="("||F==="["?_=this._create_token(a.START_EXPR,F):F===")"||F==="]"?_=this._create_token(a.END_EXPR,F):F==="{"?_=this._create_token(a.START_BLOCK,F):F==="}"?_=this._create_token(a.END_BLOCK,F):F===";"?_=this._create_token(a.SEMICOLON,F):F==="."&&D.test(this._input.peek(1))?_=this._create_token(a.DOT,F):F===","&&(_=this._create_token(a.COMMA,F)),_&&this._input.next(),_},b.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(a.EQUALS,F):F==="?."?this._create_token(a.DOT,F):this._create_token(a.OPERATOR,F)},b.prototype._read_non_javascript=function(F){var _="";if(F==="#"){if(this._is_first_token()&&(_=this.__patterns.shebang.read(),_))return this._create_token(a.UNKNOWN,_.trim()+`
`);if(_=this.__patterns.include.read(),_)return this._create_token(a.UNKNOWN,_.trim()+`
`);F=this._input.next();var M="#";if(this._input.hasNext()&&this._input.testChar(w)){do F=this._input.next(),M+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(M+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(M+="{}",this._input.next(),this._input.next())),this._create_token(a.WORD,M)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(_=this.__patterns.html_comment_start.read(),_){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)_+=this._input.next();return y=!0,this._create_token(a.COMMENT,_)}}else if(y&&F==="-"&&(_=this.__patterns.html_comment_end.read(),_))return y=!1,this._create_token(a.COMMENT,_);return null},b.prototype._read_comment=function(F){var _=null;if(F==="/"){var M="";if(this._input.peek(1)==="*"){M=this.__patterns.block_comment.read();var I=R.get_directives(M);I&&I.ignore==="start"&&(M+=R.readIgnored(this._input)),M=M.replace(d.allLineBreaks,`
`),_=this._create_token(a.BLOCK_COMMENT,M),_.directives=I}else this._input.peek(1)==="/"&&(M=this.__patterns.comment.read(),_=this._create_token(a.COMMENT,M))}return _},b.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var _=this._input.next();return this.has_char_escapes=!1,F==="`"?_+=this._read_string_recursive("`",!0,"${"):_+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(_=U(_)),this._input.peek()===F&&(_+=this._input.next()),_=_.replace(d.allLineBreaks,`
`),this._create_token(a.STRING,_)}return null},b.prototype._allow_regexp_or_xml=function(F){return F.type===a.RESERVED&&s(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===a.END_EXPR&&F.text===")"&&F.opened.previous.type===a.RESERVED&&s(F.opened.previous.text,["if","while","for"])||s(F.type,[a.COMMENT,a.START_EXPR,a.START_BLOCK,a.START,a.END_BLOCK,a.OPERATOR,a.EQUALS,a.EOF,a.SEMICOLON,a.COMMA])},b.prototype._read_regexp=function(F,_){if(F==="/"&&this._allow_regexp_or_xml(_)){for(var M=this._input.next(),I=!1,g=!1;this._input.hasNext()&&(I||g||this._input.peek()!==F)&&!this._input.testChar(d.newline);)M+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?g=!0:this._input.peek()==="]"&&(g=!1)),this._input.next();return this._input.peek()===F&&(M+=this._input.next(),M+=this._input.read(d.identifier)),this._create_token(a.STRING,M)}return null},b.prototype._read_xml=function(F,_){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(_)){var M="",I=this.__patterns.xml.read_match();if(I){for(var g=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),W=g.indexOf("{")===0,$=0;I;){var ne=!!I[1],oe=I[2],we=!!I[I.length-1]||oe.slice(0,8)==="![CDATA[";if(!we&&(oe===g||W&&oe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ne?--$:++$),M+=I[0],$<=0)break;I=this.__patterns.xml.read_match()}return I||(M+=this._input.match(/[\s\S]*/g)[0]),M=M.replace(d.allLineBreaks,`
`),this._create_token(a.STRING,M)}}return null};function U(F){for(var _="",M=0,I=new m(F),g=null;I.hasNext();)if(g=I.match(/([\s]|[^\\]|\\\\)+/g),g&&(_+=g[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")g=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")g=I.match(/u([0-9A-Fa-f]{4})/g);else{_+="\\",I.hasNext()&&(_+=I.next());continue}if(!g)return F;if(M=parseInt(g[1],16),M>126&&M<=255&&g[0].indexOf("x")===0)return F;if(M>=0&&M<32){_+="\\"+g[0];continue}else M===34||M===39||M===92?_+="\\"+String.fromCharCode(M):_+=String.fromCharCode(M)}return _}b.prototype._read_string_recursive=function(F,_,M){var I,g;F==="'"?g=this.__patterns.single_quote:F==='"'?g=this.__patterns.double_quote:F==="`"?g=this.__patterns.template_text:F==="}"&&(g=this.__patterns.template_expression);for(var W=g.read(),$="";this._input.hasNext();){if($=this._input.next(),$===F||!_&&d.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(I=this._input.peek(),I==="x"||I==="u"?this.has_char_escapes=!0:I==="\r"&&this._input.peek(1)===`
`&&this._input.next(),$+=this._input.next()):M&&(M==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),M===$&&(F==="`"?$+=this._read_string_recursive("}",_,"`"):$+=this._read_string_recursive("`",_,"${"),this._input.hasNext()&&($+=this._input.next())));$+=g.read(),W+=$}return W},r.exports.Tokenizer=b,r.exports.TOKEN=a,r.exports.positionable_operators=O.slice(),r.exports.line_starters=T.slice()},function(r){var L=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},v.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},v.prototype.__match=function(m,p){m.lastIndex=p;var u=m.exec(this.__input);return u&&!(L&&m.sticky)&&(u.index!==p&&(u=null)),u},v.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},v.prototype.testChar=function(m,p){var u=this.peek(p);return m.lastIndex=0,u!==null&&m.test(u)},v.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(m,p,u){var h="",d;return m&&(d=this.match(m),d&&(h+=d[0])),p&&(d||!m)&&(h+=this.readUntil(p,u)),h},v.prototype.readUntil=function(m,p){var u="",h=this.__position;m.lastIndex=this.__position;var d=m.exec(this.__input);return d?(h=d.index,p&&(h+=d[0].length)):h=this.__input_length,u=this.__input.substring(this.__position,h),this.__position=h,u},v.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},v.prototype.get_regexp=function(m,p){var u=null,h="g";return p&&L&&(h="y"),typeof m=="string"&&m!==""?u=new RegExp(m,h):m&&(u=new RegExp(m.source,h)),u},v.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(m){var p=this.__position,u=this.readUntilAfter(m);return this.__position=p,u},v.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},r.exports.InputScanner=v},function(r,L,v){var m=v(8).InputScanner,p=v(3).Token,u=v(10).TokenStream,h=v(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(l,s){this._input=new m(l),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new h(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var l,s=new p(d.START,""),a=null,R=[],E=new u;s.type!==d.EOF;){for(l=this._get_next_token(s,a);this._is_comment(l);)E.add(l),l=this._get_next_token(s,a);E.isEmpty()||(l.comments_before=E,E=new u),l.parent=a,this._is_opening(l)?(R.push(a),a=l):a&&this._is_closing(l,a)&&(l.opened=a,a.closed=l,a=R.pop(),l.parent=a),l.previous=s,s.next=l,this.__tokens.add(l),s=l}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(l,s){this._readWhitespace();var a=this._input.read(/.+/g);return a?this._create_token(d.RAW,a):this._create_token(d.EOF,"")},o.prototype._is_comment=function(l){return!1},o.prototype._is_opening=function(l){return!1},o.prototype._is_closing=function(l,s){return!1},o.prototype._create_token=function(l,s){var a=new p(l,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return a},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=o,r.exports.TOKEN=d},function(r){function L(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}L.prototype.restart=function(){this.__position=0},L.prototype.isEmpty=function(){return this.__tokens_length===0},L.prototype.hasNext=function(){return this.__position<this.__tokens_length},L.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__tokens[this.__position],this.__position+=1),v},L.prototype.peek=function(v){var m=null;return v=v||0,v+=this.__position,v>=0&&v<this.__tokens_length&&(m=this.__tokens[v]),m},L.prototype.add=function(v){this.__parent_token&&(v.parent=this.__parent_token),this.__tokens.push(v),this.__tokens_length+=1},r.exports.TokenStream=L},function(r,L,v){var m=v(12).Pattern;function p(u,h){m.call(this,u,h),h?this._line_regexp=this._input.get_regexp(h._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new m,p.prototype.__set_whitespace_patterns=function(u,h){u+="\\t ",h+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+h+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+h+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var h=this.__split(this._newline_regexp,u);this.newline_count=h.length-1,this.whitespace_before_token=h[this.newline_count]}return u},p.prototype.matching=function(u,h){var d=this._create();return d.__set_whitespace_patterns(u,h),d._update(),d},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(u,h){u.lastIndex=0;for(var d=0,o=[],l=u.exec(h);l;)o.push(h.substring(d,l.index)),d=l.index+l[0].length,l=u.exec(h);return d<h.length?o.push(h.substring(d,h.length)):o.push(""),o},r.exports.WhitespacePattern=p},function(r){function L(v,m){this._input=v,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)}L.prototype.read=function(){var v=this._input.read(this._starting_pattern);return(!this._starting_pattern||v)&&(v+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),v},L.prototype.read_match=function(){return this._input.match(this._match_pattern)},L.prototype.until_after=function(v){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(v),m._update(),m},L.prototype.until=function(v){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(v),m._update(),m},L.prototype.starting_with=function(v){var m=this._create();return m._starting_pattern=this._input.get_regexp(v,!0),m._update(),m},L.prototype.matching=function(v){var m=this._create();return m._match_pattern=this._input.get_regexp(v,!0),m._update(),m},L.prototype._create=function(){return new L(this._input,this)},L.prototype._update=function(){},r.exports.Pattern=L},function(r){function L(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}L.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(v);return m},L.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=L},function(r,L,v){var m=v(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function u(h,d){m.call(this,h,d),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),d&&(this.__template_pattern=this._input.get_regexp(d.__template_pattern),this._excluded=Object.assign(this._excluded,d._excluded),this._disabled=Object.assign(this._disabled,d._disabled));var o=new m(h);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}/)}}u.prototype=new m,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(h){var d=this._create();return d._disabled[h]=!0,d._update(),d},u.prototype.read_options=function(h){var d=this._create();for(var o in p)d._disabled[o]=h.templating.indexOf(o)===-1;return d._update(),d},u.prototype.exclude=function(h){var d=this._create();return d._excluded[h]=!0,d._update(),d},u.prototype.read=function(){var h="";this._match_pattern?h=this._input.read(this._starting_pattern):h=this._input.read(this._starting_pattern,this.__template_pattern);for(var d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),h+=d,d=this._read_template();return this._until_after&&(h+=this._input.readUntilAfter(this._until_pattern)),h},u.prototype.__set_templated_pattern=function(){var h=[];this._disabled.php||h.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||h.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||h.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(h.push(this.__patterns.django._starting_pattern.source),h.push(this.__patterns.django_value._starting_pattern.source),h.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||h.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&h.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+h.join("|")+")")},u.prototype._read_template=function(){var h="",d=this._input.peek();if(d==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(h=h||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(h=h||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(h=h||this.__patterns.handlebars_comment.read(),h=h||this.__patterns.handlebars_unescaped.read(),h=h||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(h=h||this.__patterns.django_value.read()),this._excluded.django||(h=h||this.__patterns.django_comment.read(),h=h||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(h=h||this.__patterns.smarty_comment.read(),h=h||this.__patterns.smarty_literal.read(),h=h||this.__patterns.smarty.read()));return h},r.exports.TemplatablePattern=u}],B={};function K(r){var L=B[r];if(L!==void 0)return L.exports;var v=B[r]={exports:{}};return j[r](v,v.exports,K),v.exports}var H=K(0);P=H})();var X=P;!(ie=[],J=function(){return{js_beautify:X}}.apply(be,ie),J!==void 0&&(tt.exports=J))})()},"746U":function(tt,be,Z){"use strict";Z.d(be,"f",function(){return ie}),Z.d(be,"l",function(){return J}),Z.d(be,"k",function(){return P}),Z.d(be,"j",function(){return X}),Z.d(be,"g",function(){return j}),Z.d(be,"m",function(){return B}),Z.d(be,"h",function(){return K}),Z.d(be,"n",function(){return H}),Z.d(be,"c",function(){return r}),Z.d(be,"a",function(){return L}),Z.d(be,"i",function(){return v}),Z.d(be,"o",function(){return m}),Z.d(be,"e",function(){return h}),Z.d(be,"d",function(){return d}),Z.d(be,"p",function(){return o}),Z.d(be,"b",function(){return l});function ie(s){return Array.isArray(s)}function J(s){return typeof s=="string"}function P(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 j(s){return s===!0||s===!1}function B(s){return typeof s=="undefined"}function K(s){return!H(s)}function H(s){return B(s)||s===null}function r(s,a){if(!s)throw new Error(a?`Unexpected type, expected '${a}'`:"Unexpected type")}function L(s){if(H(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function v(s){return typeof s=="function"}function m(s,a){const R=Math.min(s.length,a.length);for(let E=0;E<R;E++)p(s[E],a[E])}function p(s,a){if(J(a)){if(typeof s!==a)throw new Error(`argument does not match constraint: typeof ${a}`)}else if(v(a)){try{if(s instanceof a)return}catch(R){}if(!H(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 u(s){let a=[],R=Object.getPrototypeOf(s);for(;Object.prototype!==R;)a=a.concat(Object.getOwnPropertyNames(R)),R=Object.getPrototypeOf(R);return a}function h(s){const a=[];for(const R of u(s))typeof s[R]=="function"&&a.push(R);return a}function d(s,a){const R=w=>function(){const D=Array.prototype.slice.call(arguments,0);return a(w,D)};let E={};for(const w of s)E[w]=R(w);return E}function o(s){return s===null?void 0:s}function l(s,a="Unreachable"){throw new Error(a)}},"7Cbv":function(tt,be,Z){"use strict";var ie=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),J=new Uint8Array(16);function P(){if(!ie)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ie(J)}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 j(p){return typeof p=="string"&&X.test(p)}for(var B=j,K=[],H=0;H<256;++H)K.push((H+256).toString(16).substr(1));function r(p){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,h=(K[p[u+0]]+K[p[u+1]]+K[p[u+2]]+K[p[u+3]]+"-"+K[p[u+4]]+K[p[u+5]]+"-"+K[p[u+6]]+K[p[u+7]]+"-"+K[p[u+8]]+K[p[u+9]]+"-"+K[p[u+10]]+K[p[u+11]]+K[p[u+12]]+K[p[u+13]]+K[p[u+14]]+K[p[u+15]]).toLowerCase();if(!B(h))throw TypeError("Stringified UUID is invalid");return h}var L=r;function v(p,u,h){p=p||{};var d=p.random||(p.rng||P)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,u){h=h||0;for(var o=0;o<16;++o)u[h+o]=d[o];return u}return L(d)}var m=be.a=v},"7ahc":function(tt,be,Z){"use strict";Z.d(be,"a",function(){return R});var ie=Z("k1fw"),J=Z("0Owb"),P=Z("+L6B"),X=Z("2/Rp"),j=Z("y8nQ"),B=Z("Vl3Y"),K=Z("tJVT"),H=Z("OaEy"),r=Z("2fM7"),L=Z("q1tI"),v=Z.n(L),m=Z("VrN/"),p=Z.n(m),u=Z("p77/"),h=Z.n(u),d=Z("c5Ni"),o=Z.n(d),l=r.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(E){var w=E.callback,D=E.onCancel,O=Object(L.useState)("python"),A=Object(K.a)(O,2),C=A[0],T=A[1];function f(y){T(a[y][1])}function S(y){w(y)}return v.a.createElement(B.a,Object(J.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:S}),v.a.createElement(B.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(r.a,{onChange:f},Object.keys(a).map(function(y){return v.a.createElement(l,{key:y,value:y},a[y][0])}))),v.a.createElement(B.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(R,{mode:C})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(X.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function R(E){var w=E.value,D=E.onChange,O=E.mode,A=E.options,C=A===void 0?{}:A,T=Object(L.useRef)(),f=Object(L.useState)(),S=Object(K.a)(f,2),y=S[0],b=S[1];return Object(L.useEffect)(function(){if(y){function U(F){var _=F.getValue();D&&D(_)}return y.on("change",U),function(){y.off("change",U)}}},[y,D]),Object(L.useEffect)(function(){y&&y.setOption("mode",O)},[y,O]),Object(L.useEffect)(function(){y&&((w!==y.getValue()||w==="")&&setTimeout(function(){y.setValue(w||" ")},300))},[y,w]),Object(L.useEffect)(function(){if(T.current&&!y){var U=p.a.fromTextArea(T.current,Object(ie.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},C));b(U)}},[T.current,y]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:T}))}},"8EBN":function(tt,be,Z){(function(ie){ie(Z("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 J=0;J<ie.modeInfo.length;J++){var P=ie.modeInfo[J];P.mimes&&(P.mime=P.mimes[0])}ie.findModeByMIME=function(X){X=X.toLowerCase();for(var j=0;j<ie.modeInfo.length;j++){var B=ie.modeInfo[j];if(B.mime==X)return B;if(B.mimes){for(var K=0;K<B.mimes.length;K++)if(B.mimes[K]==X)return B}}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 j=0;j<ie.modeInfo.length;j++){var B=ie.modeInfo[j];if(B.ext){for(var K=0;K<B.ext.length;K++)if(B.ext[K]==X)return B}}},ie.findModeByFileName=function(X){for(var j=0;j<ie.modeInfo.length;j++){var B=ie.modeInfo[j];if(B.file&&B.file.test(X))return B}var K=X.lastIndexOf("."),H=K>-1&&X.substring(K+1,X.length);if(H)return ie.findModeByExtension(H)},ie.findModeByName=function(X){X=X.toLowerCase();for(var j=0;j<ie.modeInfo.length;j++){var B=ie.modeInfo[j];if(B.name.toLowerCase()==X)return B;if(B.alias){for(var K=0;K<B.alias.length;K++)if(B.alias[K].toLowerCase()==X)return B}}}})},"8HAY":function(tt,be,Z){"use strict";Z.d(be,"a",function(){return j}),Z.d(be,"b",function(){return B}),Z.d(be,"d",function(){return K}),Z.d(be,"e",function(){return H}),Z.d(be,"c",function(){return r});var ie=Z("MI8n"),J=Z("pmY6"),P=Z("3/fG"),X=function(L,v,m,p){function u(h){return h instanceof m?h:new m(function(d){d(h)})}return new(m||(m=Promise))(function(h,d){function o(a){try{s(p.next(a))}catch(R){d(R)}}function l(a){try{s(p.throw(a))}catch(R){d(R)}}function s(a){a.done?h(a.value):u(a.value).then(o,l)}s((p=p.apply(L,v||[])).next())})};class j extends J.a{constructor(L,v="",m="",p=!0,u){super();this._onDidChange=this._register(new ie.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=L,this._label=v,this._cssClass=m,this._enabled=p,this._actionCallback=u}get id(){return this._id}get label(){return this._label}set label(L){this._setLabel(L)}_setLabel(L){this._label!==L&&(this._label=L,this._onDidChange.fire({label:L}))}get tooltip(){return this._tooltip||""}set tooltip(L){this._setTooltip(L)}_setTooltip(L){this._tooltip!==L&&(this._tooltip=L,this._onDidChange.fire({tooltip:L}))}get class(){return this._cssClass}set class(L){this._setClass(L)}_setClass(L){this._cssClass!==L&&(this._cssClass=L,this._onDidChange.fire({class:L}))}get enabled(){return this._enabled}set enabled(L){this._setEnabled(L)}_setEnabled(L){this._enabled!==L&&(this._enabled=L,this._onDidChange.fire({enabled:L}))}get checked(){return this._checked}set checked(L){this._setChecked(L)}_setChecked(L){this._checked!==L&&(this._checked=L,this._onDidChange.fire({checked:L}))}run(L,v){return X(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(L))})}}class B extends J.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(L,v){return X(this,void 0,void 0,function*(){if(!L.enabled)return;this._onBeforeRun.fire({action:L});let m;try{yield this.runAction(L,v)}catch(p){m=p}this._onDidRun.fire({action:L,error:m})})}runAction(L,v){return X(this,void 0,void 0,function*(){yield L.run(v)})}}class K extends j{constructor(L){super(K.ID,L,L?"separator text":"separator");this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class H{constructor(L,v,m,p){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=L,this.label=v,this.class=p,this._actions=m}get actions(){return this._actions}dispose(){}run(){return X(this,void 0,void 0,function*(){})}}class r extends j{constructor(){super(r.ID,P.a("submenu.empty","(empty)"),void 0,!1)}}r.ID="vs.actions.empty"},"8hTe":function(tt,be,Z){tt.exports={button:"button___1wy9m"}},"9Bee":function(tt,be,Z){"use strict";var ie=Z("DYRE"),J=Z("zeV3"),P=Z("+L6B"),X=Z("2/Rp"),j=Z("k1fw"),B=Z("9og8"),K=Z("tJVT"),H=Z("WmNS"),r=Z.n(H),L=Z("q1tI"),v=Z.n(L),m=Z("vg9a"),p=Z("DlQD"),u=Z.n(p),h=Z("rUJ1");function d(Y,x){var k=Y.match(/^(\s+)(?:```)/);if(k===null)return x;var G=k[1];return x.split(`
`).map(function(ee){var V=ee.match(/^\s+/);if(V===null)return ee;var Ee=Object(K.a)(V,1),Ke=Ee[0];return Ke.length>=G.length?ee.slice(G.length):ee}).join(`
`)}var o=[],l=["<ul>"],s=new u.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){o.length=0,l=["<ul>"]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function w(Y,x,k,G){if(x>=Y.length||Y[x].level<=k)return x;var ee=Y[x];G.push("<li><a href='#"+ee.anchor+"'>"+ee.text+"</a>"),x++;var V=[];return x=w(Y,x,ee.level,V),V.length>0&&(G.push("<ul>"),V.forEach(function(Ee){G.push(Ee)}),G.push("</ul>")),G.push("</li>"),x=w(Y,x,k,G),x}function D(){return w(o,0,0,l),l.push("</ul>"),l.join("")}var O={heading:function(x){var k=a.exec(x);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(x){var k=this.rules.block.fences.exec(x);if(k){var G=k[0],ee=d(G,k[3]||""),V=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(V)>=0){var Ee=T(),Ke=ee;ee=Ee,f[Ee]={type:"block",expression:Ke}}return{type:"code",raw:G,lang:V,text:ee}}}},A=/(?:\${2})([^\n`]+?)(?:\${2})/gi,C=0,T=function(){return"__special_katext_id_".concat(C++,"__")},f={};function S(){return f}function y(){C=0,f={}}function b(Y){return Y=Y.replace(A,function(x,k){var G=T();return f[G]={type:"inline",expression:k},G}),Y}var U=s.listitem;s.listitem=function(Y){return U(b(Y))};var F=s.paragraph;s.paragraph=function(Y){return F(b(Y))};var _=s.tablecell;s.tablecell=function(Y,x){return _(b(Y),x)},s.code=function(Y,x,k){var G=(x||"").match(/\S*/)[0];return G?["latex","katex","math"].indexOf(G)>=0?"<p class='editormd-tex'>".concat(Y,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(x,'">').concat(k?Y:Object(h.escape)(Y,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(k?Y:Object(h.escape)(Y,!0))+"</code></pre>"},s.heading=function(Y,x,k){var G=this.options.headerPrefix+k.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:G,level:x,text:Y}),"<h"+x+' id="'+G+'">'+Y+"</h"+x+">"},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:O,renderer:s});var M=u.a,I=Z("SJMd"),g=Z("ulZh"),W=Z.n(g),$=Z("m3rI"),ne=Z("Oy/b"),oe=Z("p5ED"),we=Z("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 ge=function(Y,x){return(ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,G){k.__proto__=G}||function(k,G){for(var ee in G)Object.prototype.hasOwnProperty.call(G,ee)&&(k[ee]=G[ee])})(Y,x)};function xe(Y,x){function k(){this.constructor=Y}ge(Y,x),Y.prototype=x===null?Object.create(x):(k.prototype=x.prototype,new k)}function Re(Y,x,k,G){return new(k||(k=Promise))(function(ee,V){function Ee(pt){try{et(G.next(pt))}catch(Ve){V(Ve)}}function Ke(pt){try{et(G.throw(pt))}catch(Ve){V(Ve)}}function et(pt){var Ve;pt.done?ee(pt.value):(Ve=pt.value,Ve instanceof k?Ve:new k(function(_t){_t(Ve)})).then(Ee,Ke)}et((G=G.apply(Y,x||[])).next())})}function Le(Y,x){var k,G,ee,V,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(et){return function(pt){return function(Ve){if(k)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(k=1,G&&(ee=2&Ve[0]?G.return:Ve[0]?G.throw||((ee=G.return)&&ee.call(G),0):G.next)&&!(ee=ee.call(G,Ve[1])).done)return ee;switch(G=0,ee&&(Ve=[2&Ve[0],ee.value]),Ve[0]){case 0:case 1:ee=Ve;break;case 4:return Ee.label++,{value:Ve[1],done:!1};case 5:Ee.label++,G=Ve[1],Ve=[0];continue;case 7:Ve=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||Ve[0]!==6&&Ve[0]!==2)){Ee=0;continue}if(Ve[0]===3&&(!ee||Ve[1]>ee[0]&&Ve[1]<ee[3])){Ee.label=Ve[1];break}if(Ve[0]===6&&Ee.label<ee[1]){Ee.label=ee[1],ee=Ve;break}if(ee&&Ee.label<ee[2]){Ee.label=ee[2],Ee.ops.push(Ve);break}ee[2]&&Ee.ops.pop(),Ee.trys.pop();continue}Ve=x.call(Y,Ee)}catch(_t){Ve=[6,_t],G=0}finally{k=ee=0}if(5&Ve[0])throw Ve[1];return{value:Ve[0]?Ve[1]:void 0,done:!0}}([et,pt])}}}function ce(){for(var Y=0,x=0,k=arguments.length;x<k;x++)Y+=arguments[x].length;var G=Array(Y),ee=0;for(x=0;x<k;x++)for(var V=arguments[x],Ee=0,Ke=V.length;Ee<Ke;Ee++,ee++)G[ee]=V[Ee];return G}var he=function(){function Y(){}return Y.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Y.setAttributes=function(x,k){for(var G=0,ee=k;G<ee.length;G++){var V=ee[G],Ee=V[0],Ke=V[1];x.setAttribute(Ee,Ke)}},Y.createRect=function(x,k,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",x.toString()),ee.setAttribute("height",k.toString()),G&&Y.setAttributes(ee,G),ee},Y.createLine=function(x,k,G,ee,V){var Ee=document.createElementNS("http://www.w3.org/2000/svg","line");return Ee.setAttribute("x1",x.toString()),Ee.setAttribute("y1",k.toString()),Ee.setAttribute("x2",G.toString()),Ee.setAttribute("y2",ee.toString()),V&&Y.setAttributes(Ee,V),Ee},Y.createPolygon=function(x,k){var G=document.createElementNS("http://www.w3.org/2000/svg","polygon");return G.setAttribute("points",x),k&&Y.setAttributes(G,k),G},Y.createCircle=function(x,k){var G=document.createElementNS("http://www.w3.org/2000/svg","circle");return G.setAttribute("cx",(x/2).toString()),G.setAttribute("cy",(x/2).toString()),G.setAttribute("r",x.toString()),k&&Y.setAttributes(G,k),G},Y.createEllipse=function(x,k,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(x/2).toString()),ee.setAttribute("cy",(k/2).toString()),ee.setAttribute("rx",(x/2).toString()),ee.setAttribute("ry",(k/2).toString()),G&&Y.setAttributes(ee,G),ee},Y.createGroup=function(x){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return x&&Y.setAttributes(k,x),k},Y.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Y.createMarker=function(x,k,G,ee,V,Ee,Ke){var et=document.createElementNS("http://www.w3.org/2000/svg","marker");return Y.setAttributes(et,[["id",x],["orient",k],["markerWidth",G.toString()],["markerHeight",ee.toString()],["refX",V.toString()],["refY",Ee.toString()]]),et.appendChild(Ke),et},Y.createText=function(x){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),x&&Y.setAttributes(k,x),k},Y.createTSpan=function(x,k){var G=document.createElementNS("http://www.w3.org/2000/svg","tspan");return G.textContent=x,k&&Y.setAttributes(G,k),G},Y.createImage=function(x){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return x&&Y.setAttributes(k,x),k},Y.createPoint=function(x,k){var G=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return G.x=x,G.y=k,G},Y.createPath=function(x,k){var G=document.createElementNS("http://www.w3.org/2000/svg","path");return G.setAttribute("d",x),k&&Y.setAttributes(G,k),G},Y}(),re=function(){function Y(){}return Y.addKey=function(x){Y.key=x},Object.defineProperty(Y,"isLicensed",{get:function(){return!!Y.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Y.key)},enumerable:!1,configurable:!0}),Y}(),de=function(){function Y(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Y.prototype.rasterize=function(x,k,G){var ee=this;return new Promise(function(V){var Ee=G!==void 0?G:document.createElement("canvas");x===null&&(ee.markersOnly=!0,ee.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",k.width.baseVal.valueAsString),Ke.setAttribute("height",k.height.baseVal.valueAsString),Ke.setAttribute("viewBox","0 0 "+k.viewBox.baseVal.width.toString()+" "+k.viewBox.baseVal.height.toString()),Ke.innerHTML=k.innerHTML,ee.naturalSize===!0?(Ke.width.baseVal.value=x.naturalWidth,Ke.height.baseVal.value=x.naturalHeight):ee.width!==void 0&&ee.height!==void 0&&(Ke.width.baseVal.value=ee.width,Ke.height.baseVal.value=ee.height),Ee.width=Ke.width.baseVal.value,Ee.height=Ke.height.baseVal.value;var et=Ke.outerHTML,pt=Ee.getContext("2d");ee.markersOnly!==!0&&pt.drawImage(x,0,0,Ee.width,Ee.height);var Ve=window.URL,_t=new Image(Ee.width,Ee.height);_t.setAttribute("crossOrigin","anonymous");var jt=new Blob([et],{type:"image/svg+xml"}),$t=Ve.createObjectURL(jt);_t.onload=function(){pt.drawImage(_t,0,0),Ve.revokeObjectURL($t);var jr=Ee.toDataURL(ee.imageType,ee.imageQuality);V(jr)},_t.src=$t})},Y}(),se=function(){},De=function(){function Y(x){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+x+"_"}return Object.defineProperty(Y.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Y.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(Y.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Y.prototype.addClass=function(x){return this.styleSheet===void 0&&this.addStyleSheet(),x.name=""+this.classNamePrefix+x.localName,this.classes.push(x),this.styleSheet.sheet.insertRule("."+x.name+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length),x},Y.prototype.addRule=function(x){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(x),this.styleSheet.sheet.insertRule(x.selector+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length)},Y.prototype.addStyleSheet=function(){var x;this.styleSheet=document.createElement("style"),((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).appendChild(this.styleSheet),this.addRule(new Ne("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ne("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ne("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Se("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Se("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Y.prototype.removeStyleSheet=function(){var x;this.styleSheet&&(((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Y}(),Ne=function(Y,x){this.selector=Y,this.style=x},Se=function(Y,x){this.localName=Y,this.style=x},Pe=function(){function Y(x,k,G,ee,V){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=x,this.displayMode=k,this.markerItems=G,this.uiStyleSettings=ee,this.styles=V,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Y.prototype.show=function(x){var k=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=x,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var G=document.createElement("div");G.className=this.toolbarBlockStyleClass.name,G.style.whiteSpace="nowrap",this.uiContainer.appendChild(G),this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(V){var Ee=document.createElement("div");Ee.className=""+k.toolbarButtonStyleClass.name,Ee.setAttribute("data-type-name",V.typeName),Ee.innerHTML=V.icon,Ee.addEventListener("click",function(){k.markerToolbarButtonClicked(Ee,V)}),k.buttons.push(Ee),k.markerButtons.push(Ee)}),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 ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'<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(ee,'<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()},Y.prototype.addButtonClickListener=function(x){this.buttonClickListeners.push(x)},Y.prototype.removeButtonClickListener=function(x){this.buttonClickListeners.indexOf(x)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(x),1)},Y.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Y.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var x=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var k=0;k<this.markerButtons.length;k++)k<x||k===x&&this.markerButtons.length-1===x?this.markerButtonBlock.appendChild(this.markerButtons[k]):(k===x&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[k]))}},Y.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")},Y.prototype.resetButtonStyles=function(){var x=this;this.buttons.forEach(function(k){k.className=k.className.replace(x.uiStyleSettings.toolbarButtonStyleColorsClassName?x.uiStyleSettings.toolbarButtonStyleColorsClassName:x.toolbarButtonStyleColorsClass.name,"").trim(),k.className=k.className.replace(x.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?x.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:x.toolbarActiveButtonStyleColorsClass.name,"").trim(),k.className+=" "+(x.uiStyleSettings.toolbarButtonStyleColorsClassName?x.uiStyleSettings.toolbarButtonStyleColorsClassName:x.toolbarButtonStyleColorsClass.name)})},Y.prototype.addActionButton=function(x,k,G){var ee=this,V=document.createElement("div");switch(V.className=""+this.toolbarButtonStyleClass.name,V.innerHTML=k,V.setAttribute("data-action",G),V.addEventListener("click",function(){ee.actionToolbarButtonClicked(V,G)}),G){case"select":V.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":V.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":V.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":V.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":V.style.fill=this.uiStyleSettings.closeButtonColor}x.appendChild(V),this.buttons.push(V)},Y.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Se("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 Se("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Se("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Se("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 Se("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var x=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Se("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
padding: `+x+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Se("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Se("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ne("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ne("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},Y.prototype.markerToolbarButtonClicked=function(x,k){this.setActiveButton(x),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},Y.prototype.actionToolbarButtonClicked=function(x,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Y.prototype.setActiveButton=function(x){this.resetButtonStyles(),x.className=x.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),x.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Y.prototype.setActiveMarkerButton=function(x){var k=this.markerButtons.find(function(G){return G.getAttribute("data-type-name")===x});k&&this.setActiveButton(k)},Y.prototype.setCurrentMarker=function(x){var k=this;this.currentMarker=x,this.buttons.filter(function(G){return/delete|notes/.test(G.getAttribute("data-action"))}).forEach(function(G){k.currentMarker===void 0?(G.style.fillOpacity="0.4",G.style.pointerEvents="none"):(G.style.fillOpacity="1",G.style.pointerEvents="all")})},Y}(),Ue=function(){function Y(x,k,G,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=x,this.displayMode=k,this.uiStyleSettings=G,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Y.prototype.addStyles=function(){var x;this.toolboxStyleClass=this.styles.addClass(new Se("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 Se("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Se("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Se("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Se("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 Se("toolbox-panel-row_colors",`
background-color: `+((x=this.uiStyleSettings.toolboxBackgroundColor)!==null&&x!==void 0?x:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Se("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
padding: `+k+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Se("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Se("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},Y.prototype.show=function(x){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=x,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Y.prototype.setPanelButtons=function(x){var k,G,ee=this;this.panels=x,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((G=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&G!==void 0?G:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(V){var Ee;V.uiStyleSettings=ee.uiStyleSettings;var Ke=document.createElement("div");Ke.className=ee.toolboxButtonStyleClass.name+" "+((Ee=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:ee.toolboxButtonStyleColorsClass.name),Ke.innerHTML=V.icon,Ke.title=V.title,Ke.addEventListener("click",function(){ee.panelButtonClick(V)}),ee.panelButtons.push(Ke),ee.buttonRow.appendChild(Ke)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Y.prototype.panelButtonClick=function(x){var k=this,G=-1;if(x!==this.activePanel){G=this.panels.indexOf(x),this.panelRow.innerHTML="";var ee=x.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),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=x}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){k.displayMode==="inline"?k.panelRow.style.display="none":k.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(V,Ee){var Ke,et;V.className=k.toolboxButtonStyleClass.name+" "+(Ee===G?""+((Ke=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:k.toolboxActiveButtonStyleColorsClass.name):""+((et=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&et!==void 0?et:k.toolboxButtonStyleColorsClass.name))})},Y}(),le=function(Y,x){this.title=Y,this.icon=x},ve=function(Y){function x(k,G,ee,V){var Ee=Y.call(this,k,V||'<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 Ee.colors=[],Ee.addTransparent=!1,Ee.colorBoxes=[],Ee.colors=G,Ee.currentColor=ee,Ee.setCurrentColor=Ee.setCurrentColor.bind(Ee),Ee.getColorBox=Ee.getColorBox.bind(Ee),Ee}return xe(x,Y),x.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var V=k.getColorBox(ee);G.appendChild(V),k.colorBoxes.push(V)}),G},x.prototype.getColorBox=function(k){var G=this,ee=this.uiStyleSettings.toolbarHeight/4,V=this.uiStyleSettings.toolbarHeight-ee,Ee=document.createElement("div");Ee.style.display="inline-block",Ee.style.boxSizing="content-box",Ee.style.width=V-2+"px",Ee.style.height=V-2+"px",Ee.style.padding="1px",Ee.style.marginRight="2px",Ee.style.marginBottom="2px",Ee.style.borderWidth="2px",Ee.style.borderStyle="solid",Ee.style.borderRadius=(V+2)/2+"px",Ee.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ee.addEventListener("click",function(){G.setCurrentColor(k,Ee)});var Ke=document.createElement("div");return Ke.style.display="inline-block",Ke.style.width=V-2+"px",Ke.style.height=V-2+"px",Ke.style.backgroundColor=k,Ke.style.borderRadius=V/2+"px",k==="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>`),Ee.appendChild(Ke),Ee},x.prototype.setCurrentColor=function(k,G){var ee=this;this.currentColor=k,this.colorBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},x}(le),Ae=function(){function Y(x,k,G){this._state="new",this._isSelected=!1,this._container=x,this._overlayContainer=k,this.globalSettings=G,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Y.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Y.prototype.ownsTarget=function(x){return!1},Object.defineProperty(Y.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Y.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Y.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Y.prototype.pointerDown=function(x,k){},Y.prototype.dblClick=function(x,k){},Y.prototype.manipulate=function(x){},Y.prototype.pointerUp=function(x){this.stateChanged()},Y.prototype.dispose=function(){},Y.prototype.addMarkerVisualToContainer=function(x){this.container.childNodes.length>0?this.container.insertBefore(x,this.container.childNodes[0]):this.container.appendChild(x)},Y.prototype.getState=function(){return{typeName:Y.typeName,state:this.state,notes:this.notes}},Y.prototype.restoreState=function(x){this._state=x.state,this.notes=x.notes},Y.prototype.scale=function(x,k){},Y.prototype.colorChanged=function(x){this.onColorChanged&&this.onColorChanged(x),this.stateChanged()},Y.prototype.fillColorChanged=function(x){this.onFillColorChanged&&this.onFillColorChanged(x),this.stateChanged()},Y.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var x=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),x.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(x)&&this.onStateChanged(this)}},Y.typeName="MarkerBase",Y}(),Ie=function(){function Y(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Y.prototype.findGripByVisual=function(x){return this.topLeft.ownsTarget(x)?this.topLeft:this.topCenter.ownsTarget(x)?this.topCenter:this.topRight.ownsTarget(x)?this.topRight:this.centerLeft.ownsTarget(x)?this.centerLeft:this.centerRight.ownsTarget(x)?this.centerRight:this.bottomLeft.ownsTarget(x)?this.bottomLeft:this.bottomCenter.ownsTarget(x)?this.bottomCenter:this.bottomRight.ownsTarget(x)?this.bottomRight:void 0},Y}(),Ge=function(){function Y(){this.GRIP_SIZE=10,this.visual=he.createGroup(),this.visual.appendChild(he.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(he.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(x){return x===this.visual||x===this.visual.childNodes[0]||x===this.visual.childNodes[1]},Y}(),$e=function(){function Y(){}return Y.toITransformMatrix=function(x){return{a:x.a,b:x.b,c:x.c,d:x.d,e:x.e,f:x.f}},Y.toSVGMatrix=function(x,k){return x.a=k.a,x.b=k.b,x.c=k.c,x.d=k.d,x.e=k.e,x.f=k.f,x},Y}(),Ze=function(Y){function x(k,G,ee){var V=Y.call(this,k,G,ee)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(he.createTransform()),V.setupControlBox(),V}return xe(x,Y),Object.defineProperty(x.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var G=he.createTransform();this._visual.transform.baseVal.appendItem(G)},enumerable:!1,configurable:!0}),x.prototype.ownsTarget=function(k){return!!Y.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},x.prototype.pointerDown=function(k,G){Y.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.left=k.x,this.top=k.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(k);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(G),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(G)){this.activeGrip=this.rotatorGrip;var V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ee=this.container.transform.baseVal.getItem(0);Ee.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ee,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},x.prototype.pointerUp=function(k){var G=this.state;Y.prototype.pointerUp.call(this,k),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(k),this._state="select",G==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},x.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},x.prototype.manipulate=function(k){var G=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(G.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(G.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(G):this.state==="rotate"&&this.rotate(k)},x.prototype.resize=function(k){var G=this.manipulationStartLeft,ee=this.manipulationStartWidth,V=this.manipulationStartTop,Ee=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:G=this.manipulationStartLeft+k.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-G;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+k.y-this.manipulationStartY,Ee=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ee=this.manipulationStartHeight+k.y-this.manipulationStartY}ee>=0?(this.left=G,this.width=ee):(this.left=G+ee,this.width=-ee),Ee>=0?(this.top=V,this.height=Ee):(this.top=V+Ee,this.height=-Ee),this.setSize()},x.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},x.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var G=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*G,this.applyRotation()}},x.prototype.applyRotation=function(){var k=this.container.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(k,0)},x.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var G=this.container.getCTM(),ee=he.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(G)).x,y:ee.y}},x.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var G=this.container.getCTM();G=G.inverse();var ee=he.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(G)).x,y:ee.y}},x.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},x.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},x.prototype.setupControlBox=function(){this.controlBox=he.createGroup();var k=he.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=he.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=he.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 Ie,this.addControlGrips(),this.controlBox.style.display="none"},x.prototype.adjustControlBox=function(){var k=this.controlBox.transform.baseVal.getItem(0);k.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(k,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},x.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()},x.prototype.createGrip=function(){var k=new Ge;return k.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(k.visual),k},x.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,G=-k/2,ee=G,V=(this.width+this.CB_DISTANCE)/2-k/2,Ee=(this.height+this.CB_DISTANCE)/2-k/2,Ke=this.height+this.CB_DISTANCE-k/2,et=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,G,ee),this.positionGrip(this.controlGrips.topCenter.visual,V,ee),this.positionGrip(this.controlGrips.topRight.visual,et,ee),this.positionGrip(this.controlGrips.centerLeft.visual,G,Ee),this.positionGrip(this.controlGrips.centerRight.visual,et,Ee),this.positionGrip(this.controlGrips.bottomLeft.visual,G,Ke),this.positionGrip(this.controlGrips.bottomCenter.visual,V,Ke),this.positionGrip(this.controlGrips.bottomRight.visual,et,Ke),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,ee-3*this.CB_DISTANCE)},x.prototype.positionGrip=function(k,G,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(G,ee),k.transform.baseVal.replaceItem(V,0)},x.prototype.hideControlBox=function(){this.controlBox.style.display="none"},x.prototype.showControlBox=function(){this.controlBox.style.display=""},x.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:$e.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:$e.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Y.prototype.getState.call(this))},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var G=k;this.left=G.left,this.top=G.top,this.width=G.width,this.height=G.height,this.rotationAngle=G.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix($e.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,G.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix($e.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,G.containerTransformMatrix))},x.prototype.scale=function(k,G){Y.prototype.scale.call(this,k,G);var ee=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:ee.x*k,y:ee.y*G});this.left=V.x,this.top=V.y,this.width=this.width*k,this.height=this.height*G,this.adjustControlBox()},x}(Ae),Je=function(Y){function x(k,G,ee){var V=Y.call(this,k,G,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return xe(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual)},x.prototype.createVisual=function(){this.visual=he.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)},x.prototype.pointerDown=function(k,G){Y.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},x.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k)},x.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.setSize()},x.prototype.setSize=function(){Y.prototype.setSize.call(this),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},x.prototype.pointerUp=function(k){Y.prototype.pointerUp.call(this,k),this.setSize()},x.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},x.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},x.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},x.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},x.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this))},x.prototype.restoreState=function(k){var G=k;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},x.prototype.scale=function(k,G){Y.prototype.scale.call(this,k,G),this.setSize()},x.title="Rectangle marker",x}(Ze),at=function(Y){function x(k,G,ee,V){var Ee=Y.call(this,k,V||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ee.widths=[],Ee.widthBoxes=[],Ee.widths=G,Ee.currentWidth=ee,Ee.setCurrentWidth=Ee.setCurrentWidth.bind(Ee),Ee}return xe(x,Y),x.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.widths.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentWidth(ee,V)}),G.appendChild(V);var Ee=document.createElement("div");Ee.innerText=ee.toString(),Ee.style.marginRight="5px",V.appendChild(Ee);var Ke=document.createElement("div");Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.display="flex",Ke.style.alignItems="center";var et=document.createElement("hr");et.style.minWidth="20px",et.style.border="0px",et.style.borderTop=ee+"px solid "+k.uiStyleSettings.toolboxColor,et.style.flexGrow="2",Ke.appendChild(et),V.appendChild(Ke),k.widthBoxes.push(V)}),G},x.prototype.setCurrentWidth=function(k,G){var ee=this;this.currentWidth=k,this.widthBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},x}(le),qe=function(Y){function x(k,G,ee,V){var Ee=Y.call(this,k,V||'<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 Ee.styles=[],Ee.styleBoxes=[],Ee.styles=G,Ee.currentStyle=ee,Ee.setCurrentStyle=Ee.setCurrentStyle.bind(Ee),Ee}return xe(x,Y),x.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.styles.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.styles.length-5+"%",V.style.borderColor=ee===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentStyle(ee,V)}),G.appendChild(V);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.overflow="hidden";var Ke=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+k.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ee!==""?'stroke-dasharray="'+ee+'"':"")+` />
</svg>`;Ee.innerHTML=Ke,V.appendChild(Ee),k.styleBoxes.push(V)}),G},x.prototype.setCurrentStyle=function(k,G){var ee=this;this.currentStyle=k,this.styleBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},x}(le),it=function(Y){function x(k,G,ee){var V=Y.call(this,k,G,ee)||this;return V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ve("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new at("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return xe(x,Y),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.typeName="FrameMarker",x.title="Frame marker",x.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',x}(Je),Be=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},ct=function(Y){function x(k,G,ee){var V=Y.call(this,k,G,ee)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return xe(x,Y),x.prototype.ownsTarget=function(k){return!!Y.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},x.prototype.pointerDown=function(k,G){Y.prototype.pointerDown.call(this,k,G),this.manipulationStartX=k.x,this.manipulationStartY=k.y,this.state==="new"&&(this.x1=k.x,this.y1=k.y,this.x2=k.x,this.y2=k.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(G)?this.activeGrip=this.grip1:this.grip2.ownsTarget(G)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},x.prototype.pointerUp=function(k){var G=this.state;Y.prototype.pointerUp.call(this,k),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(k),this._state="select",G==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},x.prototype.adjustVisual=function(){},x.prototype.manipulate=function(k){this.state==="creating"?this.resize(k):this.state==="move"?(this.x1=this.manipulationStartX1+k.x-this.manipulationStartX,this.y1=this.manipulationStartY1+k.y-this.manipulationStartY,this.x2=this.manipulationStartX2+k.x-this.manipulationStartX,this.y2=this.manipulationStartY2+k.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(k)},x.prototype.resize=function(k){switch(this.activeGrip){case this.grip1:this.x1=k.x,this.y1=k.y;break;case this.grip2:case void 0:this.x2=k.x,this.y2=k.y}this.adjustVisual(),this.adjustControlBox()},x.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},x.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},x.prototype.setupControlBox=function(){this.controlBox=he.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},x.prototype.adjustControlBox=function(){this.positionGrips()},x.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},x.prototype.createGrip=function(){var k=new Ge;return k.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(k.visual),k},x.prototype.positionGrips=function(){var k=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-k/2,this.y1-k/2),this.positionGrip(this.grip2.visual,this.x2-k/2,this.y2-k/2)},x.prototype.positionGrip=function(k,G,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(G,ee),k.transform.baseVal.replaceItem(V,0)},x.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Y.prototype.getState.call(this))},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var G=k;this.x1=G.x1,this.y1=G.y1,this.x2=G.x2,this.y2=G.y2},x.prototype.scale=function(k,G){Y.prototype.scale.call(this,k,G),this.x1=this.x1*k,this.y1=this.y1*G,this.x2=this.x2*k,this.y2=this.y2*G,this.adjustVisual(),this.adjustControlBox()},x}(Ae),ot=function(Y){function x(k,G,ee){var V=Y.call(this,k,G,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ve("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new at("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return xe(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},x.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorLine=he.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=he.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)},x.prototype.pointerDown=function(k,G){Y.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},x.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()),he.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},x.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},x.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},x.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var G=k;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.createVisual(),this.adjustVisual()},x.typeName="LineMarker",x.title="Line marker",x.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',x}(ct),je=function(Y){function x(k,G,ee,V){var Ee=Y.call(this,k,V||'<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 Ee.fonts=[],Ee.fontBoxes=[],Ee.fonts=G,Ee.currentFont=ee,Ee.setCurrentFont=Ee.setCurrentFont.bind(Ee),Ee}return xe(x,Y),x.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.flexGrow="2",this.fonts.forEach(function(ee){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.fonts.length-5+"%",V.style.borderColor=ee===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentFont(ee,V)}),G.appendChild(V);var Ee=document.createElement("div");Ee.style.display="flex",Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.fontFamily=ee,Ee.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",Ee.appendChild(Ke),V.appendChild(Ee),k.fontBoxes.push(V)}),G},x.prototype.setCurrentFont=function(k,G){var ee=this;this.currentFont=k,this.fontBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},x}(le),We=function(Y){function x(k,G,ee){var V=Y.call(this,k,G,ee)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=ee.defaultColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new ve("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new je("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return xe(x,Y),x.prototype.ownsTarget=function(k){if(Y.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var G=!1;return this.textElement.childNodes.forEach(function(ee){ee===k&&(G=!0)}),G},x.prototype.createVisual=function(){this.visual=he.createGroup(),this.bgRectangle=he.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=he.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},x.prototype.pointerDown=function(k,G){Y.prototype.pointerDown.call(this,k,G),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},x.prototype.renderText=function(){var k=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(G){k.textElement.appendChild(he.createTSpan(G.trim()===""?" ":G.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},x.prototype.getTextScale=function(){var k=this.textElement.getBBox(),G=1;if(k.width>0&&k.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/k.width,V=(1*this.height-this.height*this.padding*2/100)/k.height;G=Math.min(ee,V)}return G},x.prototype.getTextPosition=function(k){var G=this.textElement.getBBox(),ee=0,V=0;return G.width>0&&G.height>0&&(ee=(this.width-G.width*k)/2,V=this.height/2-G.height*k/2),{x:ee,y:V}},x.prototype.sizeText=function(){var k=this.textElement.getBBox(),G=this.getTextScale(),ee=this.getTextPosition(G);ee.y-=k.y*G,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+G+", "+G+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(G,G))},x.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(k.x-this.pointerDownPoint.x)>5||Math.abs(k.y-this.pointerDownPoint.y)>5)},x.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},x.prototype.setSize=function(){Y.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},x.prototype.pointerUp=function(k){var G=this.state;G==="creating"&&(this._suppressMarkerCreateEvent=!0),Y.prototype.pointerUp.call(this,k),this.setSize(),(G==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},x.prototype.showTextEditor=function(){var k=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(G){G.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var G=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&G>.9;)G-=.1,k.textEditor.style.fontSize=Math.max(G,.9)+"em"}),this.textEditor.addEventListener("keyup",function(G){G.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(G){if(G.clipboardData){var ee=G.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode(ee)),G.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){k.textEditDivClicked(k.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},x.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),G=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),V={x:ee.width*k,y:ee.height*k};G.x-=V.x/2,G.y-=V.y/2,this.textEditor.style.top=G.y+"px",this.textEditor.style.left=G.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-G.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},x.prototype.textEditDivClicked=function(k){this.text=k.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},x.prototype.select=function(){Y.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},x.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Y.prototype.deselect.call(this)},x.prototype.dblClick=function(k,G){Y.prototype.dblClick.call(this,k,G),this.showTextEditor()},x.prototype.setColor=function(k){this.textElement&&he.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},x.prototype.setFont=function(k){this.textElement&&he.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},x.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},x.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){var G=k;this.color=G.color,this.fontFamily=G.fontFamily,this.padding=G.padding,this.text=G.text,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},x.prototype.scale=function(k,G){Y.prototype.scale.call(this,k,G),this.setSize(),this.sizeText(),this.positionTextEditor()},x.typeName="TextMarker",x.title="Text marker",x.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>',x}(Ze),Oe=function(Y){function x(k,G,ee){var V=Y.call(this,k,G,ee)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=ee.defaultColor,V.lineWidth=ee.defaultStrokeWidth,V.pixelRatio=ee.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new ve("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new at("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return xe(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},x.prototype.createVisual=function(){this.visual=he.createGroup(),this.drawingImage=he.createImage(),this.visual.appendChild(this.drawingImage);var k=he.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},x.prototype.pointerDown=function(k,G){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(k.x,k.y),this.drawing=!0):Y.prototype.pointerDown.call(this,k,G)},x.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):Y.prototype.manipulate.call(this,k)},x.prototype.resize=function(k){Y.prototype.resize.call(this,k),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},x.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Y.prototype.pointerUp.call(this,k)},x.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)},x.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.select.call(this)},x.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.deselect.call(this)},x.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),G=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=G[0],V=G[1],Ee=G[2],Ke=G[3],et=!1,pt=0;pt<this.canvasElement.height;pt++)for(var Ve=0;Ve<this.canvasElement.width;Ve++)k.data[pt*this.canvasElement.width*4+4*Ve+3]>0&&(et=!0,pt<V&&(V=pt),Ve<ee&&(ee=Ve),pt>Ke&&(Ke=pt),Ve>Ee&&(Ee=Ve));if(et){this.left=ee/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(Ee-ee)/this.pixelRatio,this.height=(Ke-V)/this.pixelRatio;var _t=document.createElement("canvas");_t.width=Ee-ee,_t.height=Ke-V,_t.getContext("2d").putImageData(this.canvasContext.getImageData(ee,V,Ee-ee,Ke-V),0,0),this.drawingImgUrl=_t.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},x.prototype.setDrawingImage=function(){he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},x.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},x.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){this.createVisual(),Y.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},x.prototype.scale=function(k,G){Y.prototype.scale.call(this,k,G),this.setDrawingImage()},x.typeName="FreehandMarker",x.title="Freehand marker",x.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>',x}(Ze),_e=function(Y){function x(k,G,ee){var V=Y.call(this,k,ee||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return V.typeBoxes=[],V.currentType=G,V.setCurrentType=V.setCurrentType.bind(V),V}return xe(x,Y),x.prototype.getUi=function(){var k=this,G=document.createElement("div");G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2";for(var ee=function(Ke){var et="both";switch(Ke){case 0:et="both";break;case 1:et="start";break;case 2:et="end";break;case 3:et="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=et===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",pt.addEventListener("click",function(){k.setCurrentType(et,pt)}),G.appendChild(pt),et==="both"||et==="start"){var Ve=document.createElement("div");Ve.style.display="flex",Ve.style.alignItems="center",Ve.style.minHeight="20px",Ve.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="`+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Ve.style.marginLeft="5px",pt.appendChild(Ve)}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 "+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee"),jt.style.flexGrow="2",_t.appendChild(jt),pt.appendChild(_t),et==="both"||et==="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="`+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,$t.style.marginRight="5px",pt.appendChild($t)}V.typeBoxes.push(pt)},V=this,Ee=0;Ee<4;Ee++)ee(Ee);return G},x.prototype.setCurrentType=function(k,G){var ee=this;this.currentType=k,this.typeBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},x}(le),Te=function(Y){function x(k,G,ee){var V=Y.call(this,k,G,ee)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new _e("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return xe(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},x.prototype.getArrowPoints=function(k,G){var ee=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return k-ee/2+","+(G+V/2)+" "+k+","+(G-V/2)+" "+(k+ee/2)+","+(G+V/2)},x.prototype.createTips=function(){this.arrow1=he.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=he.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow2)},x.prototype.pointerDown=function(k,G){Y.prototype.pointerDown.call(this,k,G),this.state==="creating"&&this.createTips()},x.prototype.adjustVisual=function(){if(Y.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",he.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),he.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.arrow1.transform.baseVal.getItem(0);G.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(G,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},x.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var G=k;this.arrowType=G.arrowType,this.createTips(),this.adjustVisual()},x.typeName="ArrowMarker",x.title="Arrow marker",x.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',x}(ot),ae=function(Y){function x(k,G,ee){var V=Y.call(this,k,G,ee)||this;return V.fillColor=ee.defaultFillColor,V.strokeWidth=0,V.fillPanel=new ve("Color",ee.defaultColorSet,ee.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return xe(x,Y),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.typeName="CoverMarker",x.title="Cover marker",x.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',x}(Je),ue=function(Y){function x(k,G,ee,V){var Ee=Y.call(this,k,V||'<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 Ee.opacities=[],Ee.opacityBoxes=[],Ee.opacities=G,Ee.currentOpacity=ee,Ee.setCurrentOpacity=Ee.setCurrentOpacity.bind(Ee),Ee}return xe(x,Y),x.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",G.style.justifyContent="space-between",this.opacities.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentOpacity(ee,V)}),G.appendChild(V);var Ee=document.createElement("div");Ee.innerText=100*ee+"%",V.appendChild(Ee),k.opacityBoxes.push(V)}),G},x.prototype.setCurrentOpacity=function(k,G){var ee=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},x}(le),fe=function(Y){function x(k,G,ee){var V=Y.call(this,k,G,ee)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=ee.defaultHighlightColor,V.strokeWidth=0,V.opacity=ee.defaultHighlightOpacity,V.fillPanel=new ve("Color",ee.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new ue("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return xe(x,Y),x.prototype.setOpacity=function(k){this.opacity=k,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.typeName="HighlightMarker",x.title="Highlight marker",x.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>',x}(ae),me='<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>',Ce=function(Y){function x(k,G,ee){var V=Y.call(this,k,G,ee)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=ee.defaultStrokeColor,V.bgColor=ee.defaultFillColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new ve("Text color",ee.defaultColorSet,V.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>'),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new ve("Fill color",ee.defaultColorSet,V.bgColor,me),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new je("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new Ge,V.tipGrip.visual.transform.baseVal.appendItem(he.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return xe(x,Y),x.prototype.ownsTarget=function(k){return Y.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},x.prototype.createTip=function(){he.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=he.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},x.prototype.pointerDown=function(k,G){this.state==="new"&&Y.prototype.pointerDown.call(this,k,G),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(G)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Y.prototype.pointerDown.call(this,k,G)},x.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Y.prototype.pointerUp.call(this,k);else{var G=this.state==="creating";Y.prototype.pointerUp.call(this,k),this.setTipPoints(G),this.positionTip()}},x.prototype.manipulate=function(k){if(this.tipMoving){var G=this.unrotatePoint(k);this.tipPosition={x:G.x-this.manipulationStartLeft,y:G.y-this.manipulationStartTop},this.positionTip()}else Y.prototype.manipulate.call(this,k)},x.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(he.setAttributes(this.bgRectangle,[["fill",k]]),he.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},x.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},x.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var G=Math.min(this.height/2,15),ee=this.height/5;k&&(this.tipPosition={x:G+ee/2,y:this.height+20});var V=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?V<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:G,y:0},this.tipBase2Position={x:G+ee,y:0}):(this.tipBase1Position={x:0,y:G},this.tipBase2Position={x:0,y:G+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?V<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-G-ee,y:0},this.tipBase2Position={x:this.width-G,y:0}):(this.tipBase1Position={x:this.width,y:G},this.tipBase2Position={x:this.width,y:G+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?V<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-G-ee,y:this.height},this.tipBase2Position={x:this.width-G,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-G-ee},this.tipBase2Position={x:this.width,y:this.height-G}):V<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:G,y:this.height},this.tipBase2Position={x:G+ee,y:this.height}):(this.tipBase1Position={x:0,y:this.height-G},this.tipBase2Position={x:0,y:this.height-G-ee})},x.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.positionTip()},x.prototype.positionTip=function(){he.setAttributes(this.tip,[["points",this.getTipPoints()]]);var k=this.tipGrip.visual.transform.baseVal.getItem(0);k.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(k,0)},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),x.prototype.select=function(){this.positionTip(),Y.prototype.select.call(this)},x.prototype.getState=function(){var k=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){var G=k;this.bgColor=G.bgColor,this.tipPosition=G.tipPosition,Y.prototype.restoreState.call(this,k),this.createTip(),this.setTipPoints()},x.prototype.scale=function(k,G){Y.prototype.scale.call(this,k,G),this.tipPosition={x:this.tipPosition.x*k,y:this.tipPosition.y*G},this.positionTip()},x.typeName="CalloutMarker",x.title="Callout marker",x.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>',x}(We),Fe=function(Y){function x(k,G,ee){var V=Y.call(this,k,G,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.fillColor=ee.defaultFillColor,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.setOpacity=V.setOpacity.bind(V),V.createVisual=V.createVisual.bind(V),V.strokePanel=new ve("Line color",ce(ee.defaultColorSet,["transparent"]),ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.fillPanel=new ve("Fill color",ce(ee.defaultColorSet,["transparent"]),V.fillColor,me),V.fillPanel.onColorChanged=V.setFillColor,V.strokeWidthPanel=new at("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V.opacityPanel=new ue("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return xe(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual)},x.prototype.createVisual=function(){this.visual=he.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)},x.prototype.pointerDown=function(k,G){Y.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},x.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k)},x.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.setSize()},x.prototype.setSize=function(){Y.prototype.setSize.call(this),he.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},x.prototype.pointerUp=function(k){Y.prototype.pointerUp.call(this,k),this.setSize()},x.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},x.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},x.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},x.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},x.prototype.setOpacity=function(k){this.opacity=k,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){var G=k;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},x.prototype.scale=function(k,G){Y.prototype.scale.call(this,k,G),this.setSize()},x.typeName="EllipseMarker",x.title="Ellipse marker",x.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>',x}(Ze),ze=function(Y){function x(k,G,ee){return Y.call(this,k,G,ee)||this}return xe(x,Y),Object.defineProperty(x.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},x.prototype.createTips=function(){this.tip1=he.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(he.createTransform()),this.visual.appendChild(this.tip1),this.tip2=he.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(he.createTransform()),this.visual.appendChild(this.tip2)},x.prototype.pointerDown=function(k,G){Y.prototype.pointerDown.call(this,k,G),this.state==="creating"&&this.createTips()},x.prototype.adjustVisual=function(){if(Y.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(he.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()]]),he.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.tip1.transform.baseVal.getItem(0);G.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(G,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},x.typeName="MeasurementMarker",x.title="Measurement marker",x.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>',x}(ot),st=function(Y){function x(k,G,ee){var V=Y.call(this,k,G,ee)||this;return V.strokePanel.colors=ee.defaultColorSet,V.fillColor="transparent",V}return xe(x,Y),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.typeName="EllipseFrameMarker",x.title="Ellipse frame marker",x.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>',x}(Fe),mt=function(){function Y(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Y.prototype.addUndoStep=function(x){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(x)||(this.undoStack.push(x),JSON.stringify(this.lastRedoStep)!==JSON.stringify(x)&&this.redoStack.splice(0,this.redoStack.length))},Y.prototype.replaceLastUndoStep=function(x){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=x)},Y.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Y.prototype.undo=function(){if(this.undoStack.length>1){var x=this.undoStack.pop();return x!==void 0&&this.redoStack.push(x),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Y.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Y}(),ft=function(Y){function x(k,G,ee){var V=Y.call(this,k,G,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ve("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new at("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return xe(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},x.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},x.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorCurve=he.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=he.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)},x.prototype.pointerDown=function(k,G){Y.prototype.pointerDown.call(this,k,G),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=k.x,this.curveY=k.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(G)&&(this.activeGrip=this.curveGrip,this._state="resize")},x.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),he.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},x.prototype.setupControlBox=function(){Y.prototype.setupControlBox.call(this),this.curveControlLine1=he.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=he.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)},x.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Y.prototype.addControlGrips.call(this)},x.prototype.positionGrips=function(){Y.prototype.positionGrips.call(this);var k=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-k/2,this.curveY-k/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},x.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),Y.prototype.manipulate.call(this,k)},x.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),Y.prototype.resize.call(this,k),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},x.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},x.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},x.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},x.prototype.scale=function(k,G){this.curveX=this.curveX*k,this.curveY=this.curveY*G,Y.prototype.scale.call(this,k,G)},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var G=k;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.curveX=G.curveX,this.curveY=G.curveY,this.createVisual(),this.adjustVisual()},x.typeName="CurveMarker",x.title="Curve marker",x.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>',x}(ct),wt=function(){function Y(x,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=x,this.cancelable=k}return Object.defineProperty(Y.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Y.prototype.preventDefault=function(){this._defaultPrevented=!0},Y}(),St=function(Y){function x(k,G,ee){var V=Y.call(this,k,!1)||this;return V.dataUrl=G,V.state=ee,V}return xe(x,Y),x}(wt),ht=function(Y){function x(k,G,ee){ee===void 0&&(ee=!1);var V=Y.call(this,k,ee)||this;return V.marker=G,V}return xe(x,Y),x}(wt),Ut=function(){function Y(){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 Y.prototype.addEventListener=function(x,k){this[x].push(k)},Y.prototype.removeEventListener=function(x,k){var G=this[x].indexOf(k);G>-1&&this[x].splice(G,1)},Y}(),Lt=function(){function Y(x){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Be,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=Y.instanceCounter++,this.styles=new De(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=x,this.targetRoot=document.body,this.width=x.clientWidth,this.height=x.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(Y.prototype,"ALL_MARKER_TYPES",{get:function(){return[it,Oe,Te,We,st,Fe,fe,Ce,ze,ae,ot,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[it,Oe,Te,We,Fe,fe,Ce]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"BASIC_MARKER_TYPES",{get:function(){return[it,Oe,Te,We,fe]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(x){var k=this;this._availableMarkerTypes.splice(0),x.forEach(function(G){if(typeof G=="string"){var ee=k.ALL_MARKER_TYPES.find(function(V){return V.typeName===G});ee!==void 0&&k._availableMarkerTypes.push(ee)}else k._availableMarkerTypes.push(G)})},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(x){this._zoomLevel=x,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(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Y.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Y.prototype.show=function(){var x=this;this.styles.styleSheetRoot===void 0&&se.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=se.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new wt(x))})},Y.prototype.render=function(){return Re(this,void 0,void 0,function(){var x;return Le(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(x=new de).naturalSize=this.renderAtNaturalSize,x.imageType=this.renderImageType,x.imageQuality=this.renderImageQuality,x.markersOnly=this.renderMarkersOnly,x.width=this.renderWidth,x.height=this.renderHeight,[4,x.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,x.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},Y.prototype.close=function(x){var k=this;if(x===void 0&&(x=!1),this.isOpen){var G=!1;x||this.eventListeners.beforeclose.forEach(function(ee){var V=new wt(k,!0);ee(V),V.defaultPrevented&&(G=!0)}),G||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ee){return ee(new wt(k))}),this.detachEvents(),this._isOpen=!1)}},Y.prototype.addMarkersToToolbar=function(){for(var x,k=[],G=0;G<arguments.length;G++)k[G]=arguments[G];(x=this._availableMarkerTypes).push.apply(x,k)},Y.prototype.addRenderEventListener=function(x){this.addEventListener("render",function(k){x(k.dataUrl,k.state)})},Y.prototype.removeRenderEventListener=function(x){},Y.prototype.addCloseEventListener=function(x){this.addEventListener("close",function(){x()})},Y.prototype.removeCloseEventListener=function(x){},Y.prototype.setupResizeObserver=function(){var x=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){x.resize(x.target.clientWidth,x.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return x.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Y.prototype.onPopupTargetResize=function(){var x=1*this.target.clientWidth/this.target.clientHeight,k=this.editorCanvas.clientWidth/x>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*x:this.editorCanvas.clientWidth,G=k<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/x;this.resize(k,G)},Y.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Y.prototype.resize=function(x,k){this._isResizing=!0;var G=x/this.imageWidth,ee=k/this.imageHeight;this.imageWidth=Math.round(x),this.imageHeight=Math.round(k),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(G,ee),this._isResizing=!1},Y.prototype.scaleMarkers=function(x,k){var G,ee=this;this._currentMarker&&this._currentMarker instanceof We?this._currentMarker.scale(x,k):(G=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(V){V!==ee._currentMarker&&V.scale(x,k)}),G!==void 0&&this.setCurrentMarker(G)},Y.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"},Y.prototype.setTopLeft=function(){var x=this.editingTarget.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=x.left-k.left,this.top=x.top-k.top},Y.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)},Y.prototype.addDefs=function(){for(var x,k=[],G=0;G<arguments.length;G++)k[G]=arguments[G];this.defs=he.createDefs(),this.addDefsToImage(),(x=this.defs).append.apply(x,k)},Y.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Y.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)},Y.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Y.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Y.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)},Y.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Y.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)},Y.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 x=document.createElement("a");x.href="https://markerjs.com/",x.target="_blank",x.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>',x.title="Powered by marker.js",x.style.display="grid",x.style.alignItems="center",x.style.justifyItems="center",x.style.padding="3px",x.style.width="20px",x.style.height="20px",this.logoUI.appendChild(x),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Y.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")},Y.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"},Y.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Y.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 x=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=x+"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 Pe(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 Ue(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Y.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Y.prototype.removeMarker=function(x){this.markerImage.removeChild(x.container),this.markers.indexOf(x)>-1&&this.markers.splice(this.markers.indexOf(x),1),x.dispose()},Y.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())},Y.prototype.toolbarButtonClicked=function(x,k){if(x==="marker"&&k!==void 0)this.createNewMarker(k);else if(x==="action")switch(k){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Y.prototype.deleteSelectedMarker=function(){var x=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var V=new ht(x,x._currentMarker,!0);ee(V),V.defaultPrevented&&(k=!0)}),!k){var G=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ee){return ee(new ht(x,G))})}}},Y.prototype.clear=function(){var x=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ee){var Ke=new ht(x,void 0,!0);Ee(Ke),Ke.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var G=function(Ee){var Ke=ee.markers[Ee];ee.setCurrentMarker(ee.markers[Ee]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(et){return et(new ht(x,Ke))})},ee=this,V=this.markers.length-1;V>=0;V--)G(V);this.addUndoStep()}},Object.defineProperty(Y.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Y.prototype.showNotesEditor=function(){var x;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=(x=this._currentMarker.notes)!==null&&x!==void 0?x:"",this.overlayContainer.appendChild(this.notesArea))},Y.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)},Y.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Y.prototype.addUndoStep=function(){var x=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),G=this.undoRedoManager.getLastUndoStep();if(!G||G.width===k.width&&G.height===k.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),ee<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(V){return V(new wt(x))})}else this.undoRedoManager.replaceLastUndoStep(k),this.eventListeners.statechange.forEach(function(V){return V(new wt(x))})}},Y.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Y.prototype.undoStep=function(){var x=this,k=this.undoRedoManager.undo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(G){return G(new wt(x))}))},Y.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Y.prototype.redoStep=function(){var x=this,k=this.undoRedoManager.redo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(G){return G(new wt(x))}))},Y.prototype.stepZoom=function(){var x=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=x<this.zoomSteps.length-1?this.zoomSteps[x+1]:this.zoomSteps[0]},Y.prototype.panTo=function(x){this.contentDiv.scrollBy({left:this.prevPanPoint.x-x.x,top:this.prevPanPoint.y-x.y}),this.prevPanPoint=x},Y.prototype.startRenderAndClose=function(){return Re(this,void 0,void 0,function(){var x,k,G=this;return Le(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return x=ee.sent(),k=this.getState(),this.eventListeners.render.forEach(function(V){return V(new St(G,x,k))}),this.close(!0),[2]}})})},Y.prototype.getState=function(x){x===!0&&this.setCurrentMarker();var k={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(G){return k.markers.push(G.getState())}),k},Y.prototype.restoreState=function(x){var k=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);x.markers.forEach(function(G){var ee=k._availableMarkerTypes.find(function(Ee){return Ee.typeName===G.typeName});if(ee!==void 0){var V=k.addNewMarker(ee);V.restoreState(G),k.markers.push(V)}}),x.width&&x.height&&(x.width!==this.imageWidth||x.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/x.width,this.imageHeight/x.height),this.eventListeners.restorestate.forEach(function(G){return G(new wt(k))})},Y.prototype.addNewMarker=function(x){var k=he.createGroup();return this.markerImage.appendChild(k),new x(k,this.overlayContainer,this.settings)},Y.prototype.createNewMarker=function(x){var k,G=this;(k=typeof x=="string"?this._availableMarkerTypes.find(function(ee){return ee.typeName===x}):x)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(k),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(k.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ee){return ee(new ht(G,G._currentMarker))}))},Y.prototype.markerCreated=function(x){var k=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(x),this.setCurrentMarker(x),x instanceof Oe&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Oe):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(G){return G(new ht(k,k._currentMarker))})},Y.prototype.colorChanged=function(x){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=x,this.settings.defaultStrokeColor=x)},Y.prototype.fillColorChanged=function(x){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=x)},Y.prototype.markerStateChanged=function(x){var k=this;this.eventListeners.markerchange.forEach(function(G){return G(new ht(k,x))})},Y.prototype.setCurrentMarker=function(x){var k=this;this._currentMarker!==x&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(G){return G(new ht(k,k._currentMarker))})),this._currentMarker=x,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(G){return G(new ht(k,k._currentMarker))}))},Y.prototype.onPointerDown=function(x){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||x.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var k=this.markers.find(function(G){return G.ownsTarget(x.target)});k!==void 0?(this.setCurrentMarker(k),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(x.clientX,x.clientY),x.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:x.clientX,y:x.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(x.clientX,x.clientY))},Y.prototype.onDblClick=function(x){if(this._isFocused||this.focus(),this.mode==="select"){var k=this.markers.find(function(G){return G.ownsTarget(x.target)});k!==void 0&&k!==this._currentMarker&&this.setCurrentMarker(k),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(x.clientX,x.clientY),x.target):this.setCurrentMarker()}},Y.prototype.onPointerMove=function(x){this.touchPoints!==1&&x.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||x.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(x.clientX,x.clientY)):this.zoomLevel>1&&this.panTo({x:x.clientX,y:x.clientY}))},Y.prototype.onPointerUp=function(x){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(x.clientX,x.clientY)),this.isDragging=!1,this.addUndoStep()},Y.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Y.prototype.onKeyUp=function(x){this._currentMarker===void 0||this.notesArea!==void 0||x.key!=="Delete"&&x.key!=="Backspace"||this.deleteSelectedMarker()},Y.prototype.clientToLocalCoordinates=function(x,k){var G=this.markerImage.getBoundingClientRect();return{x:(x-G.left)/this.zoomLevel,y:(k-G.top)/this.zoomLevel}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var x=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=x+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},Y.prototype.addLicenseKey=function(x){re.addKey(x)},Y.prototype.addEventListener=function(x,k){this.eventListeners.addEventListener(x,k)},Y.prototype.removeEventListener=function(x,k){this.eventListeners.removeEventListener(x,k)},Y.prototype.renderState=function(x){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(x),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Y.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Y.prototype.focus=function(){var x=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(k){return k(new wt(x))}))},Y.prototype.blur=function(){var x=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new wt(x))}))},Y.instanceCounter=0,Y}();/* **********************************
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(Y,x){return(qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,G){k.__proto__=G}||function(k,G){for(var ee in G)Object.prototype.hasOwnProperty.call(G,ee)&&(k[ee]=G[ee])})(Y,x)};function Zt(Y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");function k(){this.constructor=Y}qt(Y,x),Y.prototype=x===null?Object.create(x):(k.prototype=x.prototype,new k)}function It(Y,x,k,G){return new(k||(k=Promise))(function(ee,V){function Ee(pt){try{et(G.next(pt))}catch(Ve){V(Ve)}}function Ke(pt){try{et(G.throw(pt))}catch(Ve){V(Ve)}}function et(pt){var Ve;pt.done?ee(pt.value):(Ve=pt.value,Ve instanceof k?Ve:new k(function(_t){_t(Ve)})).then(Ee,Ke)}et((G=G.apply(Y,x||[])).next())})}function Cr(Y,x){var k,G,ee,V,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(et){return function(pt){return function(Ve){if(k)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(k=1,G&&(ee=2&Ve[0]?G.return:Ve[0]?G.throw||((ee=G.return)&&ee.call(G),0):G.next)&&!(ee=ee.call(G,Ve[1])).done)return ee;switch(G=0,ee&&(Ve=[2&Ve[0],ee.value]),Ve[0]){case 0:case 1:ee=Ve;break;case 4:return Ee.label++,{value:Ve[1],done:!1};case 5:Ee.label++,G=Ve[1],Ve=[0];continue;case 7:Ve=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||Ve[0]!==6&&Ve[0]!==2)){Ee=0;continue}if(Ve[0]===3&&(!ee||Ve[1]>ee[0]&&Ve[1]<ee[3])){Ee.label=Ve[1];break}if(Ve[0]===6&&Ee.label<ee[1]){Ee.label=ee[1],ee=Ve;break}if(ee&&Ee.label<ee[2]){Ee.label=ee[2],Ee.ops.push(Ve);break}ee[2]&&Ee.ops.pop(),Ee.trys.pop();continue}Ve=x.call(Y,Ee)}catch(_t){Ve=[6,_t],G=0}finally{k=ee=0}if(5&Ve[0])throw Ve[1];return{value:Ve[0]?Ve[1]:void 0,done:!0}}([et,pt])}}}var Kr=function(){function Y(){}return Y.addKey=function(x){Y.key=x},Object.defineProperty(Y,"isLicensed",{get:function(){return!!Y.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Y.key)},enumerable:!1,configurable:!0}),Y}(),yt=function(){function Y(){}return Y.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Y.setAttributes=function(x,k){for(var G=0,ee=k;G<ee.length;G++){var V=ee[G],Ee=V[0],Ke=V[1];x.setAttribute(Ee,Ke)}},Y.createRect=function(x,k,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",x.toString()),ee.setAttribute("height",k.toString()),G&&Y.setAttributes(ee,G),ee},Y.createLine=function(x,k,G,ee,V){var Ee=document.createElementNS("http://www.w3.org/2000/svg","line");return Ee.setAttribute("x1",x.toString()),Ee.setAttribute("y1",k.toString()),Ee.setAttribute("x2",G.toString()),Ee.setAttribute("y2",ee.toString()),V&&Y.setAttributes(Ee,V),Ee},Y.createPolygon=function(x,k){var G=document.createElementNS("http://www.w3.org/2000/svg","polygon");return G.setAttribute("points",x),k&&Y.setAttributes(G,k),G},Y.createCircle=function(x,k){var G=document.createElementNS("http://www.w3.org/2000/svg","circle");return G.setAttribute("cx",(x/2).toString()),G.setAttribute("cy",(x/2).toString()),G.setAttribute("r",x.toString()),k&&Y.setAttributes(G,k),G},Y.createEllipse=function(x,k,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(x/2).toString()),ee.setAttribute("cy",(k/2).toString()),ee.setAttribute("rx",(x/2).toString()),ee.setAttribute("ry",(k/2).toString()),G&&Y.setAttributes(ee,G),ee},Y.createGroup=function(x){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return x&&Y.setAttributes(k,x),k},Y.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Y.createMarker=function(x,k,G,ee,V,Ee,Ke){var et=document.createElementNS("http://www.w3.org/2000/svg","marker");return Y.setAttributes(et,[["id",x],["orient",k],["markerWidth",G.toString()],["markerHeight",ee.toString()],["refX",V.toString()],["refY",Ee.toString()]]),et.appendChild(Ke),et},Y.createText=function(x){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),x&&Y.setAttributes(k,x),k},Y.createTSpan=function(x,k){var G=document.createElementNS("http://www.w3.org/2000/svg","tspan");return G.textContent=x,k&&Y.setAttributes(G,k),G},Y.createImage=function(x){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return x&&Y.setAttributes(k,x),k},Y.createPoint=function(x,k){var G=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return G.x=x,G.y=k,G},Y.createPath=function(x,k){var G=document.createElementNS("http://www.w3.org/2000/svg","path");return G.setAttribute("d",x),k&&Y.setAttributes(G,k),G},Y.createElement=function(x,k){var G=document.createElementNS("http://www.w3.org/2000/svg",x);return k&&Y.setAttributes(G,k),G},Y.getHollowRectanglePath=function(x,k,G,ee,V,Ee,Ke,et){return"M"+x+","+k+"V"+(k+ee)+"H"+(x+G)+"V"+k+"H"+V+"V"+Ee+"H"+(V+Ke)+"V"+(Ee+et)+"H"+V+"V"+k+"Z"},Y}(),Lr=function(){function Y(x){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+x+"_"}return Object.defineProperty(Y.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Y.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(Y.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),Y.prototype.addClass=function(x){return this.styleSheet===void 0&&this.addStyleSheet(),x.name=""+this.classNamePrefix+x.localName,this.classes.push(x),this.styleSheet.sheet.insertRule("."+x.name+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length),x},Y.prototype.addRule=function(x){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(x),this.styleSheet.sheet.insertRule(x.selector+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length)},Y.prototype.addStyleSheet=function(){var x;this.styleSheet=document.createElement("style"),((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).appendChild(this.styleSheet),this.addRule(new 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;
`))},Y.prototype.removeStyleSheet=function(){var x;this.styleSheet&&(((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Y}(),bt=function(Y,x){this.selector=Y,this.style=x},xt=function(Y,x){this.localName=Y,this.style=x},Ft=function(){function Y(){this.blocks=[],this.display=""}return Y.prototype.addButtonBlock=function(x){x.className=this.blockClassName,x.buttonClassName=this.buttonClassName,x.buttonColorsClassName=this.buttonColorsClassName,x.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(x)},Y.prototype.addElementBlock=function(x){x.className===void 0&&(x.className=this.blockClassName),this.blocks.push(x)},Y.prototype.getUI=function(){var x=document.createElement("div");return x.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,x.style.display=this.display,this.blocks.forEach(function(k){return x.appendChild(k.getUI())}),x},Y}(),tr=function(){function Y(){}return Y.prototype.getUI=function(){var x=document.createElement("div");if(x.className=this.className,this.minWidth!==void 0&&(x.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":x.style.justifyContent="flex-start";break;case"center":x.style.justifyContent="center";break;case"end":x.style.justifyContent="flex-end"}return x.style.whiteSpace="nowrap",x},Y}(),cr=function(Y){function x(){var k=Y!==null&&Y.apply(this,arguments)||this;return k.buttons=[],k}return Zt(x,Y),x.prototype.addButton=function(k){k.className=this.buttonClassName,k.colorsClassName=this.buttonColorsClassName,k.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(k)},x.prototype.getUI=function(){var k=Y.prototype.getUI.call(this);return this.buttons.forEach(function(G){return k.appendChild(G.getUI())}),k},x}(tr),Pt=function(){function Y(x,k){this._isActive=!1,this._isHidden=!1,this._icon=x,this.title=k,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(Y.prototype,"icon",{get:function(){return this._icon},set:function(x){this._icon=x,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isActive",{get:function(){return this._isActive},set:function(x){this._isActive=x,this.adjustClassName()},enumerable:!1,configurable:!0}),Y.prototype.getUI=function(){var x=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return x.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},Y.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,"")))},Y.prototype.hide=function(){this._isHidden=!0},Y}(),dt=function(Y){function x(){var k=Y!==null&&Y.apply(this,arguments)||this;return k.elements=[],k}return Zt(x,Y),x.prototype.addElement=function(k){this.elements.push(k)},x.prototype.getUI=function(){var k=Y.prototype.getUI.call(this);return this.elements.forEach(function(G){return k.appendChild(G)}),k},x}(tr),Ur=function(){function Y(x,k){this.horizontal=x,this.vertical=k}return Object.defineProperty(Y.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),Y.prototype.getVerticalLength=function(x){return x/this.ratio},Y.prototype.getHorizontalLength=function(x){return x*this.ratio},Y}(),Vt=function(){function Y(){}return Y.getIcon=function(x,k){if(x>0&&k>0){var G=new Ur(x,k),ee=G.ratio>=1?20:G.getHorizontalLength(20),V=G.ratio<1?20:G.getVerticalLength(20),Ee=document.createElementNS("http://www.w3.org/2000/svg","svg");Ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ee.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ee);var Ke=yt.createDefs();Ee.appendChild(Ke);var et=yt.createElement("clipPath",[["id","text-bg-clip"]]);Ke.appendChild(et);var pt=yt.createPath(yt.getHollowRectanglePath((24-ee)/2,(24-V)/2,ee,V,(24-ee)/2+2,(24-V)/2+2,ee-4,V-4));Ee.appendChild(pt);var Ve=yt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ve.appendChild(yt.createTSpan(x+":"+k)),Ee.appendChild(Ve);var _t=Ve.getBBox();yt.setAttributes(Ve,[["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 et.appendChild(jt),yt.setAttributes(pt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ee),Ee.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>'},Y}(),Jt=function(Y){function x(k,G,ee){var V=Y.call(this,k,G)||this;return V.isDropdownOpen=!1,V.onClick=V.dropdownButtonClicked,V.dropdownButtons=ee,V}return Zt(x,Y),x.prototype.setupDropdown=function(){var k=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(G){G.className=k.className,G.colorsClassName=k.colorsClassName,k.dropdownBlock.appendChild(G.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},x.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},x.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},x.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},x.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},x.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},x}(Pt),Ot=function(){function Y(x,k){this.GRIP_SIZE=10,this.color=x,this.fillColor=k,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 Y.prototype.ownsTarget=function(x){return x===this.visual||x===this.visual.childNodes[0]||x===this.visual.childNodes[1]},Y.prototype.setCenter=function(x,k){this.visual.childNodes.forEach(function(G){return yt.setAttributes(G,[["cx",x.toString()],["cy",k.toString()]])})},Y}(),lr=function(){function Y(x,k,G,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=x,this.canvasHeight=k,this.margin=G,this.container=ee,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(Y.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(x){this._aspectRatio=x,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(x){this._isGridVisible=x,this.gridContainer&&yt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(x){this._zoomFactor=x,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Y.prototype.open=function(){var x=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 k=0;k<this.numberOfGridLines;k++)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(G){return x.gridContainer.appendChild(G)}),this.verticalGridLines.forEach(function(G){return x.gridContainer.appendChild(G)}),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()},Y.prototype.setCropRectangle=function(x){this.cropRect=x;var k=Object.assign({},this.cropRect);this.zoomFactor!==1&&(k.width=this.cropRect.width*this.zoomFactor,k.height=this.cropRect.height*this.zoomFactor,k.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-k.width/2,k.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-k.height/2),yt.setAttributes(this.cropRectElement,[["x",k.x.toString()],["y",k.y.toString()],["width",k.width.toString()],["height",k.height.toString()]]);var G=k.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(V,Ee){var Ke=k.y+G*(Ee+1);yt.setAttributes(V,[["x1",""+k.x],["y1",""+Ke],["x2",""+(k.x+k.width)],["y2",""+Ke]])});var ee=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(V,Ee){var Ke=k.x+ee*(Ee+1);yt.setAttributes(V,[["x1",""+Ke],["y1",""+k.y],["x2",""+Ke],["y2",""+(k.y+k.height)]])}),yt.setAttributes(this.cropShadeElement,[["d",yt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,k.x,k.y,k.width,k.height)]]),this.topLeftGrip.setCenter(k.x,k.y),this.topRightGrip.setCenter(k.x+k.width,k.y),this.bottomLeftGrip.setCenter(k.x,k.y+k.height),this.bottomRightGrip.setCenter(k.x+k.width,k.y+k.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},Y.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)},Y.prototype.clientToLocalCoordinates=function(x,k){var G=this.container.getBoundingClientRect();return{x:x-G.left+this.margin,y:k-G.top+this.margin}},Y.prototype.onPointerDown=function(x){this.container.setPointerCapture(x.pointerId),this.previousPoint=this.clientToLocalCoordinates(x.clientX,x.clientY),this.cropRectElement===x.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(x.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(x.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(x.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(x.target)&&(this.activeGrip=this.bottomRightGrip)},Y.prototype.onPointerMove=function(x){if(this.isMoving)this.move(this.clientToLocalCoordinates(x.clientX,x.clientY));else if(this.activeGrip){var k=this.clientToLocalCoordinates(x.clientX,x.clientY);this.resize(k)}x.preventDefault()},Y.prototype.onPointerUp=function(x){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(x.pointerId)},Y.prototype.move=function(x){var k=x.x-this.previousPoint.x,G=x.y-this.previousPoint.y;this.zoomFactor!==1&&(k=-k/this.zoomFactor,G=-G/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+k),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+G),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=x},Y.prototype.resize=function(x){var k=Object.assign({},this.cropRect),G=x.x-this.previousPoint.x,ee=x.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:k.x+G<this.margin&&(G=this.margin-k.x),k.x+=G,k.width=this.cropRect.x+this.cropRect.width-k.x;break;case this.bottomRightGrip:case this.topRightGrip:k.width+G>this.canvasWidth*this.zoomFactor&&(G=this.canvasWidth*this.zoomFactor-k.width),k.width+=G}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(k.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(G),k.height=this.aspectRatio.getVerticalLength(k.width)):(k.y+=ee,k.height=this.cropRect.y+this.cropRect.height-k.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?k.height=this.aspectRatio.getVerticalLength(k.width):k.height+=ee}k.width<10&&(k.x=this.cropRect.x,k.width=10),k.height<10&&(k.y=this.cropRect.y,k.height=10),this.previousPoint=x,k.x>=this.margin&&k.y>=this.margin&&k.x-this.margin+k.width<=this.canvasWidth&&k.y-this.margin+k.height<=this.canvasHeight&&(this.cropRect=k,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},Y.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var x=this.cropRect.x+this.cropRect.width/2,k=this.cropRect.y+this.cropRect.height/2,G=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);G/this.canvasWidth<ee/this.canvasHeight?this.cropRect.width=G:this.cropRect.height=ee,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=x-this.cropRect.width/2,this.cropRect.y=k-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)}},Y.prototype.getRescaledRect=function(x,k,G,ee,V,Ee){var Ke=G/x,et=ee/k;return{x:(V.x-Ee)*Ke+Ee,y:(V.y-Ee)*et+Ee,width:V.width*Ke,height:V.height*et}},Y.prototype.scaleCanvas=function(x,k){var G=this.getRescaledRect(this.canvasWidth,this.canvasHeight,x,k,this.cropRect,this.margin);this.canvasWidth=x,this.canvasHeight=k,this.onCropChange&&this.onCropChange(G),this.setCropRectangle(G)},Y}(),Ir=function(){function Y(x){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=x,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(Y.prototype,"angle",{get:function(){return this._angle},set:function(x){this._angle=x,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),Y.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},Y.prototype.onPointerDown=function(x){this.controlContainer.setPointerCapture(x.pointerId),this.isDragging=!0,this.previousPoint={x:x.clientX,y:x.clientY}},Y.prototype.onPointerMove=function(x){this.isDragging&&(this.onAngleChange&&this.onAngleChange((x.clientX-this.previousPoint.x)/5),this.previousPoint.x=x.clientX)},Y.prototype.onPointerUp=function(x){this.isDragging&&this.onAngleChange&&this.onAngleChange((x.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(x.pointerId)},Y.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var x=this.angleLabelText.getBBox();yt.setAttributes(this.angleLabelElement,[["x",((this.width-x.width)/2).toString()],["y",(this.height/2).toString()]])}},Y.prototype.positionScaleShape=function(){if(this.scaleShape){var x=this.scaleShape.transform.baseVal.getItem(0);x.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(x,0)}},Y.prototype.getVisual=function(){var x=document.createElementNS("http://www.w3.org/2000/svg","svg");x.setAttribute("xmlns","http://www.w3.org/2000/svg"),x.setAttribute("width",this.width+"px"),x.setAttribute("height",this.height+"px"),x.setAttribute("viewBox","0 0 "+this.width+" "+this.height),x.style.flexShrink="0",document.body.appendChild(x);for(var k="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,G=1;G<=this.width/5+10;G++){var ee=G%5==0?this.height/3:this.height/6;k+="h4v"+-ee+"h1v"+ee}k+="v1H0Z",this.scaleShape=yt.createPath(k);var V=yt.createTransform();this.scaleShape.transform.baseVal.appendItem(V),x.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 Ee=yt.createTSpan("");return Ee.innerHTML="&deg;",this.angleLabelElement.appendChild(Ee),x.appendChild(this.angleLabelElement),document.body.removeChild(x),x},Y}(),Xr=function(){function Y(){this.naturalSize=!1,this.imageType="image/png"}return Y.prototype.rasterize=function(x,k,G,ee,V,Ee,Ke){var et=this;return new Promise(function(pt){var Ve=document.createElement("canvas");Ve.width=x.width.baseVal.value-2*ee,Ve.height=x.height.baseVal.value-2*ee;var _t=1,jt=1;et.naturalSize===!0?(_t=k.naturalWidth/(x.width.baseVal.value-2*ee)/Ee,jt=k.naturalHeight/(x.height.baseVal.value-2*ee)/Ke,Ve.width=k.naturalWidth/Ee,Ve.height=k.naturalHeight/Ke):et.width!==void 0&&et.height!==void 0&&(_t=et.width/G.width,jt=et.height/G.height,Ve.width*=_t,Ve.height*=jt);var $t=Ve.getContext("2d");$t.translate(Ve.width/2,Ve.height/2),$t.rotate(V*Math.PI/180),$t.scale(Ee,Ke),$t.translate(-Ve.width/2,-Ve.height/2),$t.drawImage(k,0,0,Ve.width,Ve.height);var jr=document.createElement("canvas");jr.width=G.width*_t,jr.height=G.height*jt,jr.getContext("2d").putImageData($t.getImageData((G.x-ee)*_t,(G.y-ee)*jt,G.width*_t,G.height*jt),0,0),pt(jr.toDataURL(et.imageType,et.imageQuality))})},Y}(),Xe=function(){function Y(x){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=Y.instanceCounter++,this.styles=new Lr(this.instanceNo),this.target=x,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(x){this._zoomToCropEnabled=x,x?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(x){this._isGridVisible=x,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"gridLines",{get:function(){return this._gridLines},set:function(x){this._gridLines=x,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(x){this._rotationAngle=x,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"aspectRatio",{get:function(){var x;return(x=this._aspectRatio)!==null&&x!==void 0?x:this.aspectRatios[0]},set:function(x){this._aspectRatio=x},enumerable:!1,configurable:!0}),Y.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},Y.prototype.show=function(){this.showUI(),this.open()},Y.prototype.close=function(x){x===void 0&&(x=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),x||this.closeEventListeners.forEach(function(k){return k()}),this._isOpen=!1)},Y.prototype.addRenderEventListener=function(x){this.renderEventListeners.push(x)},Y.prototype.removeRenderEventListener=function(x){this.renderEventListeners.indexOf(x)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(x),1)},Y.prototype.addCloseEventListener=function(x){this.closeEventListeners.push(x)},Y.prototype.removeCloseEventListener=function(x){this.closeEventListeners.indexOf(x)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(x),1)},Y.prototype.setupResizeObserver=function(){var x=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){x.resize(x.target.clientWidth,x.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},Y.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var x=1*this.target.clientWidth/this.target.clientHeight,k=this.contentDiv.clientWidth/x>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*x:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,G=k+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/x;this.resize(k,G)}},Y.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Y.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"},Y.prototype.resize=function(x,k){this.imageWidth=Math.round(x),this.imageHeight=Math.round(k),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()},Y.prototype.setEditingTarget=function(){var x=document.createElement("canvas");x.width=this.target.naturalWidth,x.height=this.target.naturalHeight,x.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var k=x.toDataURL();yt.setAttributes(this.editingTarget,[["href",k]]),this.setEditingTargetSize()},Y.prototype.setTopLeft=function(){var x=this.target.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=x.left-k.left-this.CANVAS_MARGIN,this.top=x.top-k.top-this.CANVAS_MARGIN},Y.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 x=yt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(x);var k=yt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(k),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)},Y.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},Y.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 lr(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()},Y.prototype.zoomToCrop=function(){if(this.cropRect){var x=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,k=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=x+"px "+k+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-x+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-k+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},Y.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)},Y.prototype.cropRectChanged=function(x){this.cropRect=x,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},Y.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},Y.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"},Y.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Y.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var x=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,k=this.target.offsetTop>x+this.CANVAS_MARGIN?this.target.offsetTop-(x+this.CANVAS_MARGIN):0;this.coverDiv.style.top=k+"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},Y.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},Y.prototype.addTopToolbar=function(){var x=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 k=new cr;k.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(k);var G=[];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 x.ratioButtonClicked(jt)},G.push($t)}),this.aspectRatioButton=new Jt(Vt.getIcon(0,0),"Aspect ratio",G),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,k.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=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");ee.isActive=this.isGridVisible,ee.onClick=function(){x.isGridVisible=!x.isGridVisible,ee.isActive=x.isGridVisible},k.addButton(ee);var V=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(V.isActive=this.zoomToCropEnabled,V.onClick=function(){x.zoomToCropEnabled=!x.zoomToCropEnabled,V.isActive=x.zoomToCropEnabled},k.addButton(V),!Kr.isLicensed){var Ee=new dt;this.topToolbar.addElementBlock(Ee);var Ke=document.createElement("div");Ke.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var et=document.createElement("a");et.style.color="currentColor",et.href="https://markerjs.com/products/cropro",et.target="_blank",et.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(et),Ee.addElement(Ke)}var pt=new cr;pt.minWidth=3*this.toolbarHeight+"px",pt.contentAlign="end",this.topToolbar.addButtonBlock(pt);var Ve=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");Ve.onClick=this.startRenderAndClose,pt.addButton(Ve),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ve.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)},Y.prototype.addBottomToolbar=function(){var x=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 k=new cr;k.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(k);var G=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");G.onClick=this.rotateLeftButtonClicked,k.addButton(G);var ee=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");ee.onClick=this.rotateRightButtonClicked,k.addButton(ee);var V=new dt;V.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(V),this.straightener=new Ir("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){x.rotateBy(pt),x.straightener.angle=x.rotationAngle},V.addElement(this.straightener.getUI());var Ee=new cr;Ee.minWidth=2*this.toolbarHeight+"px",Ee.contentAlign="end",this.bottomToolbar.addButtonBlock(Ee);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,Ee.addButton(Ke);var et=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");et.onClick=this.flipVerticallyButtonClicked,Ee.addButton(et)},Y.prototype.ratioButtonClicked=function(x){this.aspectRatio=x,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},Y.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Vt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},Y.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ur(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},Y.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Y.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},Y.prototype.restoreState=function(x){if(x){var k=this.cropLayer.getRescaledRect(x.width,x.height,this.imageWidth,this.imageHeight,x.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(k),this.cropRectChanged(k),this.flippedHorizontally=x.flippedHorizontally,this.flippedVertically=x.flippedVertically,this.applyFlip(),this.rotationAngle=x.rotationAngle,this.applyRotation()}},Y.prototype.clientToLocalCoordinates=function(x,k){var G=this.cropImage.getBoundingClientRect();return{x:x-G.left,y:k-G.top}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var x=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=x+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},Y.prototype.rotateLeftButtonClicked=function(){var x=this.rotationAngle-90;this.rotationAngle%90!=0&&(x+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(x)},Y.prototype.rotateRightButtonClicked=function(){var x=this.rotationAngle+90;this.rotationAngle%90!=0&&(x-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(x)},Y.prototype.rotateTo=function(x){x=(x=x>180?x-360:x)<=-180?x+360:x,this.rotationAngle=x,this.applyRotation()},Y.prototype.rotateBy=function(x){this.rotateTo((this.rotationAngle+x)%360)},Y.prototype.applyRotation=function(){var x=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var k=this.editingTargetRotationContainer.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(k,0);var G=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/G.width,this.imageHeight/G.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=x},Y.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},Y.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},Y.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},Y.prototype.startRenderAndClose=function(){return It(this,void 0,void 0,function(){var x,k;return Cr(this,function(G){switch(G.label){case 0:return[4,this.render()];case 1:return x=G.sent(),k=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(x,k)}),this.close(!0),[2]}})})},Y.prototype.render=function(){return It(this,void 0,void 0,function(){var x;return Cr(this,function(k){switch(k.label){case 0:return(x=new Xr).naturalSize=this.renderAtNaturalSize,x.imageType=this.renderImageType,x.imageQuality=this.renderImageQuality,x.width=this.renderWidth,x.height=this.renderHeight,this.unzoomFromCrop(),yt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,x.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return k.sent(),[4,x.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,k.sent()]}})})},Y.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 x=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*x)+`px;
height: `+(this.toolbarHeight-2*x)+`px;
padding: `+x+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new 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*x)+`px;
padding: `+x+`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;
`))},Y.instanceCounter=0,Y}(),Ct=Z("8hTe"),mn=Z.n(Ct),gn=/<pre[^>]*>/g;function vn(Y){var x=document.createElement("div");return x.innerHTML=Y,x.childNodes.length===0?"":x.childNodes[0].nodeValue}var yn=be.a=function(Y){var x=Y.value,k=x===void 0?"":x,G=Y.edit,ee=G===void 0?!1:G,V=Y.className,Ee=Y.showTextOnly,Ke=Y.showLines,et=Y.replaces,pt=Y.zoomImg,Ve=Y.hasMask,_t=Y.style,jt=_t===void 0?{}:_t,$t=Y.stylesPrev,jr=$t===void 0?{}:$t,Er=String(k),xr=Object(L.useRef)(),Zr=Object(L.useRef)(),Dn=Object(L.useState)(""),dr=Object(K.a)(Dn,2),zr=dr[0],un=dr[1],hn=Object(L.useState)("office"),Hr=Object(K.a)(hn,2),kn=Hr[0],bn=Hr[1],zn=function(){var Ht=new Xe(Zr.current);Ht.displayMode="popup",Ht.addRenderEventListener(function(){var yr=Object(B.a)(r.a.mark(function kt(ar){var Kt;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:return xr.current.style.display="none",fr.next=3,Object(we.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ar}});case 3:Kt=fr.sent,Kt!=null&&Kt.id&&et(Zr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 5:case"end":return fr.stop()}},kt)}));return function(kt){return yr.apply(this,arguments)}}()),Ht.show()},Vn=function(){var Ht=new Lt(Zr.current);Ht.settings.displayMode="popup",Ht.addEventListener("render",function(){var yr=Object(B.a)(r.a.mark(function kt(ar){var Kt;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:if(xr.current.style.display="none",!Zr.current){fr.next=6;break}return fr.next=4,Object(we.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ar.dataUrl}});case 4:Kt=fr.sent,Kt!=null&&Kt.id&&et(Zr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 6:case"end":return fr.stop()}},kt)}));return function(kt){return yr.apply(this,arguments)}}()),Ht.show(),window.markerArea=Ht},Qr=Object(L.useMemo)(function(){xr.current&&(xr.current.style.zIndex=-1);try{var nr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ht=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Er=Er.replace(nr,"("+$.a.API_SERVER+"/api/attachments/").replace(Ht,'"'+$.a.API_SERVER+"/api/attachments/").replace(yr,'"'+$.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(nn){}var kt=M(Er),ar=S();if(Er.match(/\[TOC\]/)&&(kt=kt.replace("<p>[TOC]</p>",D()),R()),kt=kt.replace(/(__special_katext_id_\d+__)/g,function(nn,fr){var Ar=ar[fr],Yn=Ar.type,xn=Ar.expression;return Object(ne.renderToString)(vn(xn)||"",{displayMode:Yn==="block",throwOnError:!1,output:"html"})}),kt=kt.replace(/▁/g,"\u2581\u2581\u2581"),y(),Ee){var Kt=document.createElement("div");return Kt.innerHTML=kt,Kt.innerText}return setTimeout(function(){return ci()},500),kt},[Er]),$r=Object(L.useRef)();E.WebkitLineClamp=Ke,Ke&&(jt=Object(j.a)(Object(j.a)({},jt),E));function _n(nr){var Ht=nr.target;if(Ht.tagName.toUpperCase()==="IMG"){if(pt){var yr=Ht.getAttribute("src");un(yr),bn("image")}}else if(Ht.tagName.toUpperCase()==="A"){var kt=Ht.getAttribute("href");if(kt.indexOf("office")>-1)nr.preventDefault(),un(kt),bn("office");else if(kt.indexOf("application/pdf")>-1)nr.preventDefault(),un(kt),bn("pdf");else if(kt.indexOf("text/html")>-1)nr.preventDefault(),un(kt),bn("html");else if(kt.startsWith("#")){nr.preventDefault();var ar=document.getElementById(kt.replace("#",""));ar&&ar.scrollIntoView(!0)}}}var ci=function(){var Ht,yr=(Ht=$r.current)===null||Ht===void 0?void 0:Ht.querySelectorAll("video");yr==null||yr.forEach(function(kt){if(kt.oncontextmenu=function(){return!1},kt.src.indexOf(".m3u8")>-1&&!kt.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var ar=new W.a;ar.loadSource(kt.src),ar.attachMedia(kt)}}})};Object(L.useEffect)(function(){if($r.current&&Qr&&(Qr.match(gn)&&window.PR.prettyPrint()),$r.current)return $r.current.addEventListener("click",_n),function(){$r.current.removeEventListener("click",_n),y(),R()}},[Qr,$r.current,_n]);var En=function(Ht){if(!ee)return;Ht.target.nodeName==="IMG"?(xr.current.style.zIndex=1,xr.current.style.display="flex",xr.current.style.width=Ht.target.clientWidth+"px",xr.current.style.height=Ht.target.clientHeight+"px",xr.current.style.top=Ht.target.offsetTop+"px",xr.current.style.left=Ht.target.offsetLeft+"px",Zr.current.src=Ht.target.getAttribute("src")):xr.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:$r,style:Object(j.a)({},jt),className:"".concat(V||""," markdown-body ").concat(mn.a.mdBody),onMouseOver:En,dangerouslySetInnerHTML:{__html:Qr}}),v.a.createElement("div",{ref:xr,className:mn.a.button},v.a.createElement(J.a,null,v.a.createElement(X.a,{onClick:function(){return zn()}},"\u88C1\u526A"),v.a.createElement(X.a,{onClick:function(){return Vn()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:Zr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(oe.a,{close:!0,data:zr,type:zr!=null&&zr.length?kn:"",style:Object(j.a)({},jr),onClose:function(){return un("")}}))}},"9VGf":function(tt,be,Z){"use strict";Z.d(be,"a",function(){return P});var ie=Z("q1tI"),J=Z.n(ie);function P(X,j){var B=Object(ie.useRef)();Object(ie.useEffect)(function(){B.current=X}),Object(ie.useEffect)(function(){function K(){B.current()}if(j!==null){var H=setInterval(K,j);return function(){return clearInterval(H)}}},[j])}},BU3w:function(tt,be,Z){"use strict";Z.d(be,"a",function(){return B});var ie=Z("MNnm"),J="rc-util-key";function P(K){if(K.attachTo)return K.attachTo;var H=document.querySelector("head");return H||document.body}function X(K){var H,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ie.a)())return null;var L=document.createElement("style");if((H=r.csp)===null||H===void 0?void 0:H.nonce){var v;L.nonce=(v=r.csp)===null||v===void 0?void 0:v.nonce}L.innerHTML=K;var m=P(r),p=m.firstChild;return r.prepend&&m.prepend?m.prepend(L):r.prepend&&p?m.insertBefore(L,p):m.appendChild(L),L}var j=new Map;function B(K,H){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=P(r);if(!j.has(L)){var v=X("",r),m=v.parentNode;j.set(L,m),m.removeChild(v)}var p=Array.from(j.get(L).children).find(function(l){return l.tagName==="STYLE"&&l[J]===H});if(p){var u,h;if(((u=r.csp)===null||u===void 0?void 0:u.nonce)&&p.nonce!==((h=r.csp)===null||h===void 0?void 0:h.nonce)){var d;p.nonce=(d=r.csp)===null||d===void 0?void 0:d.nonce}return p.innerHTML!==K&&(p.innerHTML=K),p}var o=X(K,r);return o[J]=H,o}},Bd2K:function(tt,be,Z){(function(ie){ie(Z("VrN/"),Z("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(r,L,v){if(v!=ie.Init&&v&&r.removeKeyMap("autoCloseTags"),!L)return;var m={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(m["'/'"]=function(p){return B(p)}),(typeof L!="object"||L.whenOpening!==!1)&&(m["'>'"]=function(p){return X(p)}),r.addKeyMap(m)});var J=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["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(r){if(r.getOption("disableInput"))return ie.Pass;for(var L=r.listSelections(),v=[],m=r.getOption("autoCloseTags"),p=0;p<L.length;p++){if(!L[p].empty())return ie.Pass;var u=L[p].head,h=r.getTokenAt(u),d=ie.innerMode(r.getMode(),h.state),o=d.state,l=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(o),s=l&&l.name;if(!s)return ie.Pass;var a=d.mode.configuration=="html",R=typeof m=="object"&&m.dontCloseTags||a&&J,E=typeof m=="object"&&m.indentTags||a&&P;h.end>u.ch&&(s=s.slice(0,s.length-h.end+u.ch));var w=s.toLowerCase();if(!s||h.type=="string"&&(h.end!=u.ch||!/[\"\']/.test(h.string.charAt(h.string.length-1))||h.string.length==1)||h.type=="tag"&&l.close||h.string.indexOf("/")==u.ch-h.start-1||R&&K(R,w)>-1||H(r,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(o)||[],s,u,!0))return ie.Pass;var D=typeof m=="object"&&m.emptyTags;if(D&&K(D,s)>-1){v[p]={text:"/>",newPos:ie.Pos(u.line,u.ch+2)};continue}var O=E&&K(E,w)>-1;v[p]={indent:O,text:">"+(O?`
`:"")+"</"+s+">",newPos:O?ie.Pos(u.line+1,0):ie.Pos(u.line,u.ch+1)}}for(var A=typeof m=="object"&&m.dontIndentOnAutoClose,p=L.length-1;p>=0;p--){var C=v[p];r.replaceRange(C.text,L[p].head,L[p].anchor,"+insert");var T=r.listSelections().slice(0);T[p]={head:C.newPos,anchor:C.newPos},r.setSelections(T),!A&&C.indent&&(r.indentLine(C.newPos.line,null,!0),r.indentLine(C.newPos.line+1,null,!0))}}function j(r,L){for(var v=r.listSelections(),m=[],p=L?"/":"</",u=r.getOption("autoCloseTags"),h=typeof u=="object"&&u.dontIndentOnSlash,d=0;d<v.length;d++){if(!v[d].empty())return ie.Pass;var o=v[d].head,l=r.getTokenAt(o),s=ie.innerMode(r.getMode(),l.state),a=s.state;if(L&&(l.type=="string"||l.string.charAt(0)!="<"||l.start!=o.ch-1))return ie.Pass;var R,E=s.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(E&&s.mode.name=="javascript")R=p+"script";else if(E&&s.mode.name=="css")R=p+"style";else{var w=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(a);if(!w||w.length&&H(r,w,w[w.length-1],o))return ie.Pass;R=p+w[w.length-1]}r.getLine(o.line).charAt(l.end)!=">"&&(R+=">"),m[d]=R}if(r.replaceSelections(m),v=r.listSelections(),!h)for(var d=0;d<v.length;d++)(d==v.length-1||v[d].head.line<v[d+1].head.line)&&r.indentLine(v[d].head.line)}function B(r){return r.getOption("disableInput")?ie.Pass:j(r,!0)}ie.commands.closeTag=function(r){return j(r)};function K(r,L){if(r.indexOf)return r.indexOf(L);for(var v=0,m=r.length;v<m;++v)if(r[v]==L)return v;return-1}function H(r,L,v,m,p){if(!ie.scanForClosingTag)return!1;var u=Math.min(r.lastLine()+1,m.line+500),h=ie.scanForClosingTag(r,m,null,u);if(!h||h.tag!=v)return!1;for(var d=p?1:0,o=L.length-1;o>=0&&L[o]==v;o--)++d;m=h.to;for(var o=1;o<d;o++){var l=ie.scanForClosingTag(r,m,null,u);if(!l||l.tag!=v)return!1;m=l.to}return!0}})},BjJ7:function(tt,be,Z){"use strict";Z.d(be,"d",function(){return J}),Z.d(be,"c",function(){return P}),Z.d(be,"e",function(){return X}),Z.d(be,"b",function(){return j}),Z.d(be,"a",function(){return K});var ie=Z("m3rI");function J(H){var r=!0;if(H.length>0){for(var L=0;L<H.length;L++)if(H[L].compile_success==0||!H[L].compile_success){r=!1;break}}else r=!1;return r}function P(H){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",L=[],v=0;v<H.length;v++){var m=H[v],p=r?"".concat(r,"/").concat(m.name):"".concat(m.name);L.push({title:m.name,isLeaf:!(m.type==="tree"),key:p})}return L}function X(H,r,L){for(var v=0;v<H.length;v++){var m=H[v];if(m.key===r){m.children=L;break}m.children&&X(m.children,r,L)}return H}function j(H,r,L){var v;return function(){var m=this,p=arguments,u=function(){v=null,L||H.apply(m,p)},h=L&&!v;clearTimeout(v),v=setTimeout(u,r),h&&H.apply(m,p)}}var B=!0,K=ie.a.API_SERVER},"C+DQ":function(tt,be,Z){},"C/vA":function(tt,be,Z){"use strict";Z.d(be,"a",function(){return ie});function ie(J){const P=this;let X=!1,j;return function(){return X||(X=!0,j=J.apply(P,arguments)),j}}},"Cg/j":function(tt,be,Z){"use strict";Z.d(be,"b",function(){return ie}),Z.d(be,"a",function(){return J}),Z.d(be,"c",function(){return X}),Z.d(be,"d",function(){return j});var ie;(function(B){B.serviceIds=new Map,B.DI_TARGET="$di$target",B.DI_DEPENDENCIES="$di$dependencies";function K(H){return H[B.DI_DEPENDENCIES]||[]}B.getServiceDependencies=K})(ie||(ie={}));const J=X("instantiationService");function P(B,K,H,r){K[ie.DI_TARGET]===K?K[ie.DI_DEPENDENCIES].push({id:B,index:H,optional:r}):(K[ie.DI_DEPENDENCIES]=[{id:B,index:H,optional:r}],K[ie.DI_TARGET]=K)}function X(B){if(ie.serviceIds.has(B))return ie.serviceIds.get(B);const K=function(H,r,L){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");P(K,H,L,!1)};return K.toString=()=>B,ie.serviceIds.set(B,K),K}function j(B){return function(K,H,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(B,K,r,!0)}}},DlQD:function(tt,be,Z){(function(ie,J){tt.exports=J()})(this,function(){"use strict";function ie(Oe,_e){for(var Te=0;Te<_e.length;Te++){var ae=_e[Te];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(Oe,ae.key,ae)}}function J(Oe,_e,Te){return _e&&ie(Oe.prototype,_e),Te&&ie(Oe,Te),Oe}function P(Oe,_e){if(!Oe)return;if(typeof Oe=="string")return X(Oe,_e);var Te=Object.prototype.toString.call(Oe).slice(8,-1);if(Te==="Object"&&Oe.constructor&&(Te=Oe.constructor.name),Te==="Map"||Te==="Set")return Array.from(Oe);if(Te==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Te))return X(Oe,_e)}function X(Oe,_e){(_e==null||_e>Oe.length)&&(_e=Oe.length);for(var Te=0,ae=new Array(_e);Te<_e;Te++)ae[Te]=Oe[Te];return ae}function j(Oe,_e){var Te;if(typeof Symbol=="undefined"||Oe[Symbol.iterator]==null){if(Array.isArray(Oe)||(Te=P(Oe))||_e&&Oe&&typeof Oe.length=="number"){Te&&(Oe=Te);var ae=0;return function(){return ae>=Oe.length?{done:!0}:{done:!1,value:Oe[ae++]}}}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 Te=Oe[Symbol.iterator](),Te.next.bind(Te)}function B(Oe,_e){return _e={exports:{}},Oe(_e,_e.exports),_e.exports}var K=B(function(Oe){function _e(){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 Te(ae){Oe.exports.defaults=ae}Oe.exports={defaults:_e(),getDefaults:_e,changeDefaults:Te}}),H=K.defaults,r=K.getDefaults,L=K.changeDefaults,v=/[&<>"']/,m=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},d=function(_e){return h[_e]};function o(Oe,_e){if(_e){if(v.test(Oe))return Oe.replace(m,d)}else if(p.test(Oe))return Oe.replace(u,d);return Oe}var l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(Oe){return Oe.replace(l,function(_e,Te){return Te=Te.toLowerCase(),Te==="colon"?":":Te.charAt(0)==="#"?Te.charAt(1)==="x"?String.fromCharCode(parseInt(Te.substring(2),16)):String.fromCharCode(+Te.substring(1)):""})}var a=/(^|[^\[])\^/g;function R(Oe,_e){Oe=Oe.source||Oe,_e=_e||"";var Te={replace:function(ue,fe){return fe=fe.source||fe,fe=fe.replace(a,"$1"),Oe=Oe.replace(ue,fe),Te},getRegex:function(){return new RegExp(Oe,_e)}};return Te}var E=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(Oe,_e,Te){if(Oe){var ae;try{ae=decodeURIComponent(s(Te)).replace(E,"").toLowerCase()}catch(ue){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}_e&&!w.test(Te)&&(Te=f(_e,Te));try{Te=encodeURI(Te).replace(/%25/g,"%")}catch(ue){return null}return Te}var O={},A=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,T=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(Oe,_e){O[" "+Oe]||(A.test(Oe)?O[" "+Oe]=Oe+"/":O[" "+Oe]=U(Oe,"/",!0)),Oe=O[" "+Oe];var Te=Oe.indexOf(":")===-1;return _e.substring(0,2)==="//"?Te?_e:Oe.replace(C,"$1")+_e:_e.charAt(0)==="/"?Te?_e:Oe.replace(T,"$1")+_e:Oe+_e}var S={exec:function(){}};function y(Oe){for(var _e=1,Te,ae;_e<arguments.length;_e++){Te=arguments[_e];for(ae in Te)Object.prototype.hasOwnProperty.call(Te,ae)&&(Oe[ae]=Te[ae])}return Oe}function b(Oe,_e){var Te=Oe.replace(/\|/g,function(fe,me,Ce){for(var Fe=!1,ze=me;--ze>=0&&Ce[ze]==="\\";)Fe=!Fe;return Fe?"|":" |"}),ae=Te.split(/ \|/),ue=0;if(ae.length>_e)ae.splice(_e);else for(;ae.length<_e;)ae.push("");for(;ue<ae.length;ue++)ae[ue]=ae[ue].trim().replace(/\\\|/g,"|");return ae}function U(Oe,_e,Te){var ae=Oe.length;if(ae===0)return"";for(var ue=0;ue<ae;){var fe=Oe.charAt(ae-ue-1);if(fe===_e&&!Te)ue++;else if(fe!==_e&&Te)ue++;else break}return Oe.substr(0,ae-ue)}function F(Oe,_e){if(Oe.indexOf(_e[1])===-1)return-1;for(var Te=Oe.length,ae=0,ue=0;ue<Te;ue++)if(Oe[ue]==="\\")ue++;else if(Oe[ue]===_e[0])ae++;else if(Oe[ue]===_e[1]&&(ae--,ae<0))return ue;return-1}function _(Oe){Oe&&Oe.sanitize&&!Oe.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 M={escape:o,unescape:s,edit:R,cleanUrl:D,resolveUrl:f,noopTest:S,merge:y,splitCells:b,rtrim:U,findClosingBracket:F,checkSanitizeDeprecation:_},I=K.defaults,g=M.rtrim,W=M.splitCells,$=M.escape,ne=M.findClosingBracket;function oe(Oe,_e,Te){var ae=_e.href,ue=_e.title?$(_e.title):null,fe=Oe[1].replace(/\\([\[\]])/g,"$1");return Oe[0].charAt(0)!=="!"?{type:"link",raw:Te,href:ae,title:ue,text:fe}:{type:"image",raw:Te,href:ae,title:ue,text:$(fe)}}function we(Oe,_e){var Te=Oe.match(/^(\s+)(?:```)/);if(Te===null)return _e;var ae=Te[1];return _e.split(`
`).map(function(ue){var fe=ue.match(/^\s+/);if(fe===null)return ue;var me=fe[0];return me.length>=ae.length?ue.slice(ae.length):ue}).join(`
`)}var ge=function(){function Oe(Te){this.options=Te||I}var _e=Oe.prototype;return _e.space=function(ae){var ue=this.rules.block.newline.exec(ae);if(ue)return ue[0].length>1?{type:"space",raw:ue[0]}:{raw:`
`}},_e.code=function(ae,ue){var fe=this.rules.block.code.exec(ae);if(fe){var me=ue[ue.length-1];if(me&&me.type==="paragraph")return{raw:fe[0],text:fe[0].trimRight()};var Ce=fe[0].replace(/^ {4}/gm,"");return{type:"code",raw:fe[0],codeBlockStyle:"indented",text:this.options.pedantic?Ce:g(Ce,`
`)}}},_e.fences=function(ae){var ue=this.rules.block.fences.exec(ae);if(ue){var fe=ue[0],me=we(fe,ue[3]||"");return{type:"code",raw:fe,lang:ue[2]?ue[2].trim():ue[2],text:me}}},_e.heading=function(ae){var ue=this.rules.block.heading.exec(ae);if(ue)return{type:"heading",raw:ue[0],depth:ue[1].length,text:ue[2]}},_e.nptable=function(ae){var ue=this.rules.block.nptable.exec(ae);if(ue){var fe={type:"table",header:W(ue[1].replace(/^ *| *\| *$/g,"")),align:ue[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ue[3]?ue[3].replace(/\n$/,"").split(`
`):[],raw:ue[0]};if(fe.header.length===fe.align.length){var me=fe.align.length,Ce;for(Ce=0;Ce<me;Ce++)/^ *-+: *$/.test(fe.align[Ce])?fe.align[Ce]="right":/^ *:-+: *$/.test(fe.align[Ce])?fe.align[Ce]="center":/^ *:-+ *$/.test(fe.align[Ce])?fe.align[Ce]="left":fe.align[Ce]=null;for(me=fe.cells.length,Ce=0;Ce<me;Ce++)fe.cells[Ce]=W(fe.cells[Ce],fe.header.length);return fe}}},_e.hr=function(ae){var ue=this.rules.block.hr.exec(ae);if(ue)return{type:"hr",raw:ue[0]}},_e.blockquote=function(ae){var ue=this.rules.block.blockquote.exec(ae);if(ue){var fe=ue[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ue[0],text:fe}}},_e.list=function(ae){var ue=this.rules.block.list.exec(ae);if(ue){for(var fe=ue[0],me=ue[2],Ce=me.length>1,Fe=me[me.length-1]===")",ze={type:"list",raw:fe,ordered:Ce,start:Ce?+me.slice(0,-1):"",loose:!1,items:[]},st=ue[0].match(this.rules.block.item),mt=!1,ft,wt,St,ht,Ut,Lt,qt,Zt=st.length,It=0;It<Zt;It++)ft=st[It],fe=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!==Zt-1&&(St=this.rules.block.bullet.exec(st[It+1])[0],(Ce?St.length===1||!Fe&&St[St.length-1]===")":St.length>1||this.options.smartLists&&St!==me)&&(ht=st.slice(It+1).join(`
`),ze.raw=ze.raw.substring(0,ze.raw.length-ht.length),It=Zt-1)),Ut=mt||/\n\n(?!\s*$)/.test(ft),It!==Zt-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:fe,task:Lt,checked:qt,loose:Ut,text:ft});return ze}},_e.html=function(ae){var ue=this.rules.block.html.exec(ae);if(ue)return{type:this.options.sanitize?"paragraph":"html",raw:ue[0],pre:!this.options.sanitizer&&(ue[1]==="pre"||ue[1]==="script"||ue[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):$(ue[0]):ue[0]}},_e.def=function(ae){var ue=this.rules.block.def.exec(ae);if(ue){ue[3]&&(ue[3]=ue[3].substring(1,ue[3].length-1));var fe=ue[1].toLowerCase().replace(/\s+/g," ");return{tag:fe,raw:ue[0],href:ue[2],title:ue[3]}}},_e.table=function(ae){var ue=this.rules.block.table.exec(ae);if(ue){var fe={type:"table",header:W(ue[1].replace(/^ *| *\| *$/g,"")),align:ue[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ue[3]?ue[3].replace(/\n$/,"").split(`
`):[]};if(fe.header.length===fe.align.length){fe.raw=ue[0];var me=fe.align.length,Ce;for(Ce=0;Ce<me;Ce++)/^ *-+: *$/.test(fe.align[Ce])?fe.align[Ce]="right":/^ *:-+: *$/.test(fe.align[Ce])?fe.align[Ce]="center":/^ *:-+ *$/.test(fe.align[Ce])?fe.align[Ce]="left":fe.align[Ce]=null;for(me=fe.cells.length,Ce=0;Ce<me;Ce++)fe.cells[Ce]=W(fe.cells[Ce].replace(/^ *\| *| *\| *$/g,""),fe.header.length);return fe}}},_e.lheading=function(ae){var ue=this.rules.block.lheading.exec(ae);if(ue)return{type:"heading",raw:ue[0],depth:ue[2].charAt(0)==="="?1:2,text:ue[1]}},_e.paragraph=function(ae){var ue=this.rules.block.paragraph.exec(ae);if(ue)return{type:"paragraph",raw:ue[0],text:ue[1].charAt(ue[1].length-1)===`
`?ue[1].slice(0,-1):ue[1]}},_e.text=function(ae,ue){var fe=this.rules.block.text.exec(ae);if(fe){var me=ue[ue.length-1];return me&&me.type==="text"?{raw:fe[0],text:fe[0]}:{type:"text",raw:fe[0],text:fe[0]}}},_e.escape=function(ae){var ue=this.rules.inline.escape.exec(ae);if(ue)return{type:"escape",raw:ue[0],text:$(ue[1])}},_e.tag=function(ae,ue,fe){var me=this.rules.inline.tag.exec(ae);if(me)return!ue&&/^<a /i.test(me[0])?ue=!0:ue&&/^<\/a>/i.test(me[0])&&(ue=!1),!fe&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?fe=!0:fe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(fe=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:ue,inRawBlock:fe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):$(me[0]):me[0]}},_e.link=function(ae){var ue=this.rules.inline.link.exec(ae);if(ue){var fe=ne(ue[2],"()");if(fe>-1){var me=ue[0].indexOf("!")===0?5:4,Ce=me+ue[1].length+fe;ue[2]=ue[2].substring(0,fe),ue[0]=ue[0].substring(0,Ce).trim(),ue[3]=""}var Fe=ue[2],ze="";if(this.options.pedantic){var st=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Fe);st?(Fe=st[1],ze=st[3]):ze=""}else ze=ue[3]?ue[3].slice(1,-1):"";Fe=Fe.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=oe(ue,{href:Fe&&Fe.replace(this.rules.inline._escapes,"$1"),title:ze&&ze.replace(this.rules.inline._escapes,"$1")},ue[0]);return mt}},_e.reflink=function(ae,ue){var fe;if((fe=this.rules.inline.reflink.exec(ae))||(fe=this.rules.inline.nolink.exec(ae))){var me=(fe[2]||fe[1]).replace(/\s+/g," ");if(me=ue[me.toLowerCase()],!me||!me.href){var Ce=fe[0].charAt(0);return{type:"text",raw:Ce,text:Ce}}var Fe=oe(fe,me,fe[0]);return Fe}},_e.strong=function(ae,ue,fe){fe===void 0&&(fe="");var me=this.rules.inline.strong.start.exec(ae);if(me&&(!me[1]||me[1]&&(fe===""||this.rules.inline.punctuation.exec(fe)))){ue=ue.slice(-1*ae.length);var Ce=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ce.lastIndex=0;for(var Fe;(me=Ce.exec(ue))!=null;)if(Fe=this.rules.inline.strong.middle.exec(ue.slice(0,me.index+3)),Fe)return{type:"strong",raw:ae.slice(0,Fe[0].length),text:ae.slice(2,Fe[0].length-2)}}},_e.em=function(ae,ue,fe){fe===void 0&&(fe="");var me=this.rules.inline.em.start.exec(ae);if(me&&(!me[1]||me[1]&&(fe===""||this.rules.inline.punctuation.exec(fe)))){ue=ue.slice(-1*ae.length);var Ce=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ce.lastIndex=0;for(var Fe;(me=Ce.exec(ue))!=null;)if(Fe=this.rules.inline.em.middle.exec(ue.slice(0,me.index+2)),Fe)return{type:"em",raw:ae.slice(0,Fe[0].length),text:ae.slice(1,Fe[0].length-1)}}},_e.codespan=function(ae){var ue=this.rules.inline.code.exec(ae);if(ue){var fe=ue[2].replace(/\n/g," "),me=/[^ ]/.test(fe),Ce=fe.startsWith(" ")&&fe.endsWith(" ");return me&&Ce&&(fe=fe.substring(1,fe.length-1)),fe=$(fe,!0),{type:"codespan",raw:ue[0],text:fe}}},_e.br=function(ae){var ue=this.rules.inline.br.exec(ae);if(ue)return{type:"br",raw:ue[0]}},_e.del=function(ae){var ue=this.rules.inline.del.exec(ae);if(ue)return{type:"del",raw:ue[0],text:ue[1]}},_e.autolink=function(ae,ue){var fe=this.rules.inline.autolink.exec(ae);if(fe){var me,Ce;return fe[2]==="@"?(me=$(this.options.mangle?ue(fe[1]):fe[1]),Ce="mailto:"+me):(me=$(fe[1]),Ce=me),{type:"link",raw:fe[0],text:me,href:Ce,tokens:[{type:"text",raw:me,text:me}]}}},_e.url=function(ae,ue){var fe;if(fe=this.rules.inline.url.exec(ae)){var me,Ce;if(fe[2]==="@")me=$(this.options.mangle?ue(fe[0]):fe[0]),Ce="mailto:"+me;else{var Fe;do Fe=fe[0],fe[0]=this.rules.inline._backpedal.exec(fe[0])[0];while(Fe!==fe[0]);me=$(fe[0]),fe[1]==="www."?Ce="http://"+me:Ce=me}return{type:"link",raw:fe[0],text:me,href:Ce,tokens:[{type:"text",raw:me,text:me}]}}},_e.inlineText=function(ae,ue,fe){var me=this.rules.inline.text.exec(ae);if(me){var Ce;return ue?Ce=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):$(me[0]):me[0]:Ce=$(this.options.smartypants?fe(me[0]):me[0]),{type:"text",raw:me[0],text:Ce}}},Oe}(),xe=M.noopTest,Re=M.edit,Le=M.merge,ce={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:xe,table:xe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ce._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ce.def=Re(ce.def).replace("label",ce._label).replace("title",ce._title).getRegex(),ce.bullet=/(?:[*+-]|\d{1,9}[.)])/,ce.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ce.item=Re(ce.item,"gm").replace(/bull/g,ce.bullet).getRegex(),ce.list=Re(ce.list).replace(/bull/g,ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ce.def.source+")").getRegex(),ce._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ce._comment=/<!--(?!-?>)[\s\S]*?-->/,ce.html=Re(ce.html,"i").replace("comment",ce._comment).replace("tag",ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ce.paragraph=Re(ce._paragraph).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ce._tag).getRegex(),ce.blockquote=Re(ce.blockquote).replace("paragraph",ce.paragraph).getRegex(),ce.normal=Le({},ce),ce.gfm=Le({},ce.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ce.gfm.nptable=Re(ce.gfm.nptable).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ce._tag).getRegex(),ce.gfm.table=Re(ce.gfm.table).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ce._tag).getRegex(),ce.pedantic=Le({},ce.normal,{html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ce._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:xe,paragraph:Re(ce.normal._paragraph).replace("hr",ce.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var he={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:xe,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:xe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};he._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",he.punctuation=Re(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",he._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",he.em.start=Re(he.em.start).replace(/punctuation/g,he._punctuation).getRegex(),he.em.middle=Re(he.em.middle).replace(/punctuation/g,he._punctuation).replace(/overlapSkip/g,he._overlapSkip).getRegex(),he.em.endAst=Re(he.em.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.em.endUnd=Re(he.em.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.start=Re(he.strong.start).replace(/punctuation/g,he._punctuation).getRegex(),he.strong.middle=Re(he.strong.middle).replace(/punctuation/g,he._punctuation).replace(/blockSkip/g,he._blockSkip).getRegex(),he.strong.endAst=Re(he.strong.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.endUnd=Re(he.strong.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=Re(he._blockSkip,"g").getRegex(),he.overlapSkip=Re(he._overlapSkip,"g").getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._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])?)+(?![-_])/,he.autolink=Re(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=Re(he.tag).replace("comment",ce._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=Re(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=Re(he.reflink).replace("label",he._label).getRegex(),he.reflinkSearch=Re(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=Le({},he),he.pedantic=Le({},he.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:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=Le({},he.normal,{escape:Re(he.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),he.gfm.url=Re(he.gfm.url,"i").replace("email",he.gfm._extended_email).getRegex(),he.breaks=Le({},he.gfm,{br:Re(he.br).replace("{2,}","*").getRegex(),text:Re(he.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var re={block:ce,inline:he},de=K.defaults,se=re.block,De=re.inline;function Ne(Oe){return Oe.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 Se(Oe){var _e="",Te,ae,ue=Oe.length;for(Te=0;Te<ue;Te++)ae=Oe.charCodeAt(Te),Math.random()>.5&&(ae="x"+ae.toString(16)),_e+="&#"+ae+";";return _e}var Pe=function(){function Oe(Te){this.tokens=[],this.tokens.links=Object.create(null),this.options=Te||de,this.options.tokenizer=this.options.tokenizer||new ge,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ae={block:se.normal,inline:De.normal};this.options.pedantic?(ae.block=se.pedantic,ae.inline=De.pedantic):this.options.gfm&&(ae.block=se.gfm,this.options.breaks?ae.inline=De.breaks:ae.inline=De.gfm),this.tokenizer.rules=ae}Oe.lex=function(ae,ue){var fe=new Oe(ue);return fe.lex(ae)};var _e=Oe.prototype;return _e.lex=function(ae){return ae=ae.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ae,this.tokens,!0),this.inline(this.tokens),this.tokens},_e.blockTokens=function(ae,ue,fe){ue===void 0&&(ue=[]),fe===void 0&&(fe=!0),ae=ae.replace(/^ +$/gm,"");for(var me,Ce,Fe,ze;ae;){if(me=this.tokenizer.space(ae)){ae=ae.substring(me.raw.length),me.type&&ue.push(me);continue}if(me=this.tokenizer.code(ae,ue)){ae=ae.substring(me.raw.length),me.type?ue.push(me):(ze=ue[ue.length-1],ze.raw+=`
`+me.raw,ze.text+=`
`+me.text);continue}if(me=this.tokenizer.fences(ae)){ae=ae.substring(me.raw.length),ue.push(me);continue}if(me=this.tokenizer.heading(ae)){ae=ae.substring(me.raw.length),ue.push(me);continue}if(me=this.tokenizer.nptable(ae)){ae=ae.substring(me.raw.length),ue.push(me);continue}if(me=this.tokenizer.hr(ae)){ae=ae.substring(me.raw.length),ue.push(me);continue}if(me=this.tokenizer.blockquote(ae)){ae=ae.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],fe),ue.push(me);continue}if(me=this.tokenizer.list(ae)){for(ae=ae.substring(me.raw.length),Fe=me.items.length,Ce=0;Ce<Fe;Ce++)me.items[Ce].tokens=this.blockTokens(me.items[Ce].text,[],!1);ue.push(me);continue}if(me=this.tokenizer.html(ae)){ae=ae.substring(me.raw.length),ue.push(me);continue}if(fe&&(me=this.tokenizer.def(ae))){ae=ae.substring(me.raw.length),this.tokens.links[me.tag]||(this.tokens.links[me.tag]={href:me.href,title:me.title});continue}if(me=this.tokenizer.table(ae)){ae=ae.substring(me.raw.length),ue.push(me);continue}if(me=this.tokenizer.lheading(ae)){ae=ae.substring(me.raw.length),ue.push(me);continue}if(fe&&(me=this.tokenizer.paragraph(ae))){ae=ae.substring(me.raw.length),ue.push(me);continue}if(me=this.tokenizer.text(ae,ue)){ae=ae.substring(me.raw.length),me.type?ue.push(me):(ze=ue[ue.length-1],ze.raw+=`
`+me.raw,ze.text+=`
`+me.text);continue}if(ae){var st="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(st);break}else throw new Error(st)}}return ue},_e.inline=function(ae){var ue,fe,me,Ce,Fe,ze,st=ae.length;for(ue=0;ue<st;ue++){ze=ae[ue];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:[]},Ce=ze.header.length,fe=0;fe<Ce;fe++)ze.tokens.header[fe]=[],this.inlineTokens(ze.header[fe],ze.tokens.header[fe]);for(Ce=ze.cells.length,fe=0;fe<Ce;fe++)for(Fe=ze.cells[fe],ze.tokens.cells[fe]=[],me=0;me<Fe.length;me++)ze.tokens.cells[fe][me]=[],this.inlineTokens(Fe[me],ze.tokens.cells[fe][me]);break}case"blockquote":{this.inline(ze.tokens);break}case"list":{for(Ce=ze.items.length,fe=0;fe<Ce;fe++)this.inline(ze.items[fe].tokens);break}}}return ae},_e.inlineTokens=function(ae,ue,fe,me,Ce){ue===void 0&&(ue=[]),fe===void 0&&(fe=!1),me===void 0&&(me=!1),Ce===void 0&&(Ce="");var Fe,ze=ae,st;if(this.tokens.links){var mt=Object.keys(this.tokens.links);if(mt.length>0)for(;(st=this.tokenizer.rules.inline.reflinkSearch.exec(ze))!=null;)mt.includes(st[0].slice(st[0].lastIndexOf("[")+1,-1))&&(ze=ze.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(st=this.tokenizer.rules.inline.blockSkip.exec(ze))!=null;)ze=ze.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ae;){if(Fe=this.tokenizer.escape(ae)){ae=ae.substring(Fe.raw.length),ue.push(Fe);continue}if(Fe=this.tokenizer.tag(ae,fe,me)){ae=ae.substring(Fe.raw.length),fe=Fe.inLink,me=Fe.inRawBlock,ue.push(Fe);continue}if(Fe=this.tokenizer.link(ae)){ae=ae.substring(Fe.raw.length),Fe.type==="link"&&(Fe.tokens=this.inlineTokens(Fe.text,[],!0,me)),ue.push(Fe);continue}if(Fe=this.tokenizer.reflink(ae,this.tokens.links)){ae=ae.substring(Fe.raw.length),Fe.type==="link"&&(Fe.tokens=this.inlineTokens(Fe.text,[],!0,me)),ue.push(Fe);continue}if(Fe=this.tokenizer.strong(ae,ze,Ce)){ae=ae.substring(Fe.raw.length),Fe.tokens=this.inlineTokens(Fe.text,[],fe,me),ue.push(Fe);continue}if(Fe=this.tokenizer.em(ae,ze,Ce)){ae=ae.substring(Fe.raw.length),Fe.tokens=this.inlineTokens(Fe.text,[],fe,me),ue.push(Fe);continue}if(Fe=this.tokenizer.codespan(ae)){ae=ae.substring(Fe.raw.length),ue.push(Fe);continue}if(Fe=this.tokenizer.br(ae)){ae=ae.substring(Fe.raw.length),ue.push(Fe);continue}if(Fe=this.tokenizer.del(ae)){ae=ae.substring(Fe.raw.length),Fe.tokens=this.inlineTokens(Fe.text,[],fe,me),ue.push(Fe);continue}if(Fe=this.tokenizer.autolink(ae,Se)){ae=ae.substring(Fe.raw.length),ue.push(Fe);continue}if(!fe&&(Fe=this.tokenizer.url(ae,Se))){ae=ae.substring(Fe.raw.length),ue.push(Fe);continue}if(Fe=this.tokenizer.inlineText(ae,me,Ne)){ae=ae.substring(Fe.raw.length),Ce=Fe.raw.slice(-1),ue.push(Fe);continue}if(ae){var ft="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return ue},J(Oe,null,[{key:"rules",get:function(){return{block:se,inline:De}}}]),Oe}(),Ue=K.defaults,le=M.cleanUrl,ve=M.escape,Ae=function(){function Oe(Te){this.options=Te||Ue}var _e=Oe.prototype;return _e.code=function(ae,ue,fe){var me=(ue||"").match(/\S*/)[0];if(this.options.highlight){var Ce=this.options.highlight(ae,me);Ce!=null&&Ce!==ae&&(fe=!0,ae=Ce)}return me?'<pre><code class="'+this.options.langPrefix+ve(me,!0)+'">'+(fe?ae:ve(ae,!0))+`</code></pre>
`:"<pre><code>"+(fe?ae:ve(ae,!0))+`</code></pre>
`},_e.blockquote=function(ae){return`<blockquote>
`+ae+`</blockquote>
`},_e.html=function(ae){return ae},_e.heading=function(ae,ue,fe,me){return this.options.headerIds?"<h"+ue+' id="'+this.options.headerPrefix+me.slug(fe)+'">'+ae+"</h"+ue+`>
`:"<h"+ue+">"+ae+"</h"+ue+`>
`},_e.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},_e.list=function(ae,ue,fe){var me=ue?"ol":"ul",Ce=ue&&fe!==1?' start="'+fe+'"':"";return"<"+me+Ce+`>
`+ae+"</"+me+`>
`},_e.listitem=function(ae){return"<li>"+ae+`</li>
`},_e.checkbox=function(ae){return"<input "+(ae?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},_e.paragraph=function(ae){return"<p>"+ae+`</p>
`},_e.table=function(ae,ue){return ue&&(ue="<tbody>"+ue+"</tbody>"),`<table>
<thead>
`+ae+`</thead>
`+ue+`</table>
`},_e.tablerow=function(ae){return`<tr>
`+ae+`</tr>
`},_e.tablecell=function(ae,ue){var fe=ue.header?"th":"td",me=ue.align?"<"+fe+' align="'+ue.align+'">':"<"+fe+">";return me+ae+"</"+fe+`>
`},_e.strong=function(ae){return"<strong>"+ae+"</strong>"},_e.em=function(ae){return"<em>"+ae+"</em>"},_e.codespan=function(ae){return"<code>"+ae+"</code>"},_e.br=function(){return this.options.xhtml?"<br/>":"<br>"},_e.del=function(ae){return"<del>"+ae+"</del>"},_e.link=function(ae,ue,fe){if(ae=le(this.options.sanitize,this.options.baseUrl,ae),ae===null)return fe;var me='<a href="'+ve(ae)+'"';return ue&&(me+=' title="'+ue+'"'),me+=">"+fe+"</a>",me},_e.image=function(ae,ue,fe){if(ae=le(this.options.sanitize,this.options.baseUrl,ae),ae===null)return fe;var me='<img src="'+ae+'" alt="'+fe+'"';return ue&&(me+=' title="'+ue+'"'),me+=this.options.xhtml?"/>":">",me},_e.text=function(ae){return ae},Oe}(),Ie=function(){function Oe(){}var _e=Oe.prototype;return _e.strong=function(ae){return ae},_e.em=function(ae){return ae},_e.codespan=function(ae){return ae},_e.del=function(ae){return ae},_e.html=function(ae){return ae},_e.text=function(ae){return ae},_e.link=function(ae,ue,fe){return""+fe},_e.image=function(ae,ue,fe){return""+fe},_e.br=function(){return""},Oe}(),Ge=function(){function Oe(){this.seen={}}var _e=Oe.prototype;return _e.slug=function(ae){var ue=ae.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ue)){var fe=ue;do this.seen[fe]++,ue=fe+"-"+this.seen[fe];while(this.seen.hasOwnProperty(ue))}return this.seen[ue]=0,ue},Oe}(),$e=K.defaults,Ze=M.unescape,Je=function(){function Oe(Te){this.options=Te||$e,this.options.renderer=this.options.renderer||new Ae,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ie,this.slugger=new Ge}Oe.parse=function(ae,ue){var fe=new Oe(ue);return fe.parse(ae)};var _e=Oe.prototype;return _e.parse=function(ae,ue){ue===void 0&&(ue=!0);var fe="",me,Ce,Fe,ze,st,mt,ft,wt,St,ht,Ut,Lt,qt,Zt,It,Cr,Kr,yt,Lr=ae.length;for(me=0;me<Lr;me++){ht=ae[me];switch(ht.type){case"space":continue;case"hr":{fe+=this.renderer.hr();continue}case"heading":{fe+=this.renderer.heading(this.parseInline(ht.tokens),ht.depth,Ze(this.parseInline(ht.tokens,this.textRenderer)),this.slugger);continue}case"code":{fe+=this.renderer.code(ht.text,ht.lang,ht.escaped);continue}case"table":{for(wt="",ft="",ze=ht.header.length,Ce=0;Ce<ze;Ce++)ft+=this.renderer.tablecell(this.parseInline(ht.tokens.header[Ce]),{header:!0,align:ht.align[Ce]});for(wt+=this.renderer.tablerow(ft),St="",ze=ht.cells.length,Ce=0;Ce<ze;Ce++){for(mt=ht.tokens.cells[Ce],ft="",st=mt.length,Fe=0;Fe<st;Fe++)ft+=this.renderer.tablecell(this.parseInline(mt[Fe]),{header:!1,align:ht.align[Fe]});St+=this.renderer.tablerow(ft)}fe+=this.renderer.table(wt,St);continue}case"blockquote":{St=this.parse(ht.tokens),fe+=this.renderer.blockquote(St);continue}case"list":{for(Ut=ht.ordered,Lt=ht.start,qt=ht.loose,ze=ht.items.length,St="",Ce=0;Ce<ze;Ce++)It=ht.items[Ce],Cr=It.checked,Kr=It.task,Zt="",It.task&&(yt=this.renderer.checkbox(Cr),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}):Zt+=yt),Zt+=this.parse(It.tokens,qt),St+=this.renderer.listitem(Zt,Kr,Cr);fe+=this.renderer.list(St,Ut,Lt);continue}case"html":{fe+=this.renderer.html(ht.text);continue}case"paragraph":{fe+=this.renderer.paragraph(this.parseInline(ht.tokens));continue}case"text":{for(St=ht.tokens?this.parseInline(ht.tokens):ht.text;me+1<Lr&&ae[me+1].type==="text";)ht=ae[++me],St+=`
`+(ht.tokens?this.parseInline(ht.tokens):ht.text);fe+=ue?this.renderer.paragraph(St):St;continue}default:{var bt='Token with "'+ht.type+'" type was not found.';if(this.options.silent){console.error(bt);return}else throw new Error(bt)}}}return fe},_e.parseInline=function(ae,ue){ue=ue||this.renderer;var fe="",me,Ce,Fe=ae.length;for(me=0;me<Fe;me++){Ce=ae[me];switch(Ce.type){case"escape":{fe+=ue.text(Ce.text);break}case"html":{fe+=ue.html(Ce.text);break}case"link":{fe+=ue.link(Ce.href,Ce.title,this.parseInline(Ce.tokens,ue));break}case"image":{fe+=ue.image(Ce.href,Ce.title,Ce.text);break}case"strong":{fe+=ue.strong(this.parseInline(Ce.tokens,ue));break}case"em":{fe+=ue.em(this.parseInline(Ce.tokens,ue));break}case"codespan":{fe+=ue.codespan(Ce.text);break}case"br":{fe+=ue.br();break}case"del":{fe+=ue.del(this.parseInline(Ce.tokens,ue));break}case"text":{fe+=ue.text(Ce.text);break}default:{var ze='Token with "'+Ce.type+'" type was not found.';if(this.options.silent){console.error(ze);return}else throw new Error(ze)}}}return fe},Oe}(),at=M.merge,qe=M.checkSanitizeDeprecation,it=M.escape,Be=K.getDefaults,ct=K.changeDefaults,ot=K.defaults;function je(Oe,_e,Te){if(typeof Oe=="undefined"||Oe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Oe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Oe)+", string expected");if(typeof _e=="function"&&(Te=_e,_e=null),_e=at({},je.defaults,_e||{}),qe(_e),Te){var ae=_e.highlight,ue;try{ue=Pe.lex(Oe,_e)}catch(Fe){return Te(Fe)}var fe=function(ze){var st;if(!ze)try{st=Je.parse(ue,_e)}catch(mt){ze=mt}return _e.highlight=ae,ze?Te(ze):Te(null,st)};if(!ae||ae.length<3)return fe();if(delete _e.highlight,!ue.length)return fe();var me=0;je.walkTokens(ue,function(Fe){Fe.type==="code"&&(me++,setTimeout(function(){ae(Fe.text,Fe.lang,function(ze,st){if(ze)return fe(ze);st!=null&&st!==Fe.text&&(Fe.text=st,Fe.escaped=!0),me--,me===0&&fe()})},0))}),me===0&&fe();return}try{var Ce=Pe.lex(Oe,_e);return _e.walkTokens&&je.walkTokens(Ce,_e.walkTokens),Je.parse(Ce,_e)}catch(Fe){if(Fe.message+=`
Please report this to https://github.com/markedjs/marked.`,_e.silent)return"<p>An error occurred:</p><pre>"+it(Fe.message+"",!0)+"</pre>";throw Fe}}je.options=je.setOptions=function(Oe){return at(je.defaults,Oe),ct(je.defaults),je},je.getDefaults=Be,je.defaults=ot,je.use=function(Oe){var _e=at({},Oe);if(Oe.renderer&&function(){var ae=je.defaults.renderer||new Ae,ue=function(Ce){var Fe=ae[Ce];ae[Ce]=function(){for(var ze=arguments.length,st=new Array(ze),mt=0;mt<ze;mt++)st[mt]=arguments[mt];var ft=Oe.renderer[Ce].apply(ae,st);return ft===!1&&(ft=Fe.apply(ae,st)),ft}};for(var fe in Oe.renderer)ue(fe);_e.renderer=ae}(),Oe.tokenizer&&function(){var ae=je.defaults.tokenizer||new ge,ue=function(Ce){var Fe=ae[Ce];ae[Ce]=function(){for(var ze=arguments.length,st=new Array(ze),mt=0;mt<ze;mt++)st[mt]=arguments[mt];var ft=Oe.tokenizer[Ce].apply(ae,st);return ft===!1&&(ft=Fe.apply(ae,st)),ft}};for(var fe in Oe.tokenizer)ue(fe);_e.tokenizer=ae}(),Oe.walkTokens){var Te=je.defaults.walkTokens;_e.walkTokens=function(ae){Oe.walkTokens(ae),Te&&Te(ae)}}je.setOptions(_e)},je.walkTokens=function(Oe,_e){for(var Te=j(Oe),ae;!(ae=Te()).done;){var ue=ae.value;_e(ue);switch(ue.type){case"table":{for(var fe=j(ue.tokens.header),me;!(me=fe()).done;){var Ce=me.value;je.walkTokens(Ce,_e)}for(var Fe=j(ue.tokens.cells),ze;!(ze=Fe()).done;)for(var st=ze.value,mt=j(st),ft;!(ft=mt()).done;){var wt=ft.value;je.walkTokens(wt,_e)}break}case"list":{je.walkTokens(ue.items,_e);break}default:ue.tokens&&je.walkTokens(ue.tokens,_e)}}},je.Parser=Je,je.parser=Je.parse,je.Renderer=Ae,je.TextRenderer=Ie,je.Lexer=Pe,je.lexer=Pe.lex,je.Tokenizer=ge,je.Slugger=Ge,je.parse=je;var We=je;return We})},ELLl:function(tt,be,Z){(function(ie){ie(Z("VrN/"))})(function(ie){var J={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(h,d,o){o&&o!=ie.Init&&(h.removeKeyMap(j),h.state.closeBrackets=null),d&&(B(X(d,"pairs")),h.state.closeBrackets=d,h.addKeyMap(j))});function X(h,d){return d=="pairs"&&typeof h=="string"?h:typeof h=="object"&&h[d]!=null?h[d]:J[d]}var j={Backspace:r,Enter:L};function B(h){for(var d=0;d<h.length;d++){var o=h.charAt(d),l="'"+o+"'";j[l]||(j[l]=K(o))}}B(J.pairs+"`");function K(h){return function(d){return m(d,h)}}function H(h){var d=h.state.closeBrackets;if(!d||d.override)return d;var o=h.getModeAt(h.getCursor());return o.closeBrackets||d}function r(h){var d=H(h);if(!d||h.getOption("disableInput"))return ie.Pass;for(var o=X(d,"pairs"),l=h.listSelections(),s=0;s<l.length;s++){if(!l[s].empty())return ie.Pass;var a=p(h,l[s].head);if(!a||o.indexOf(a)%2!=0)return ie.Pass}for(var s=l.length-1;s>=0;s--){var R=l[s].head;h.replaceRange("",P(R.line,R.ch-1),P(R.line,R.ch+1),"+delete")}}function L(h){var d=H(h),o=d&&X(d,"explode");if(!o||h.getOption("disableInput"))return ie.Pass;for(var l=h.listSelections(),s=0;s<l.length;s++){if(!l[s].empty())return ie.Pass;var a=p(h,l[s].head);if(!a||o.indexOf(a)%2!=0)return ie.Pass}h.operation(function(){var R=h.lineSeparator()||`
`;h.replaceSelection(R+R,null),h.execCommand("goCharLeft"),l=h.listSelections();for(var E=0;E<l.length;E++){var w=l[E].head.line;h.indentLine(w,null,!0),h.indentLine(w+1,null,!0)}})}function v(h){var d=ie.cmpPos(h.anchor,h.head)>0;return{anchor:new P(h.anchor.line,h.anchor.ch+(d?-1:1)),head:new P(h.head.line,h.head.ch+(d?1:-1))}}function m(h,d){var o=H(h);if(!o||h.getOption("disableInput"))return ie.Pass;var l=X(o,"pairs"),s=l.indexOf(d);if(s==-1)return ie.Pass;for(var a=X(o,"closeBefore"),R=X(o,"triples"),E=l.charAt(s+1)==d,w=h.listSelections(),D=s%2==0,O,A=0;A<w.length;A++){var C=w[A],T=C.head,f,S=h.getRange(T,P(T.line,T.ch+1));if(D&&!C.empty())f="surround";else if((E||!D)&&S==d)E&&u(h,T)?f="both":R.indexOf(d)>=0&&h.getRange(T,P(T.line,T.ch+3))==d+d+d?f="skipThree":f="skip";else if(E&&T.ch>1&&R.indexOf(d)>=0&&h.getRange(P(T.line,T.ch-2),T)==d+d){if(T.ch>2&&/\bstring/.test(h.getTokenTypeAt(P(T.line,T.ch-2))))return ie.Pass;f="addFour"}else if(E){var y=T.ch==0?" ":h.getRange(P(T.line,T.ch-1),T);if(!ie.isWordChar(S)&&y!=d&&!ie.isWordChar(y))f="both";else return ie.Pass}else if(D&&(S.length===0||/\s/.test(S)||a.indexOf(S)>-1))f="both";else return ie.Pass;if(!O)O=f;else if(O!=f)return ie.Pass}var b=s%2?l.charAt(s-1):d,U=s%2?d:l.charAt(s+1);h.operation(function(){if(O=="skip")h.execCommand("goCharRight");else if(O=="skipThree")for(var F=0;F<3;F++)h.execCommand("goCharRight");else if(O=="surround"){for(var _=h.getSelections(),F=0;F<_.length;F++)_[F]=b+_[F]+U;h.replaceSelections(_,"around"),_=h.listSelections().slice();for(var F=0;F<_.length;F++)_[F]=v(_[F]);h.setSelections(_)}else O=="both"?(h.replaceSelection(b+U,null),h.triggerElectric(b+U),h.execCommand("goCharLeft")):O=="addFour"&&(h.replaceSelection(b+b+b+b,"before"),h.execCommand("goCharRight"))})}function p(h,d){var o=h.getRange(P(d.line,d.ch-1),P(d.line,d.ch+1));return o.length==2?o:null}function u(h,d){var o=h.getTokenAt(P(d.line,d.ch+1));return/\bstring/.test(o.type)&&o.start==d.ch&&(d.ch==0||!/\bstring/.test(h.getTokenTypeAt(d)))}})},FWmy:function(tt,be,Z){"use strict";Z.d(be,"a",function(){return ie});function ie(J,P){if(!J)throw new Error(P?`Assertion failed (${P})`:"Assertion Failed")}},GfqC:function(tt,be,Z){"use strict";var ie=Z("q1tI"),J=Z.n(ie),P=Z("TSYQ"),X=Z.n(P);function j(M,I){var g="cannot "+M.method+" "+M.action+" "+I.status+"'",W=new Error(g);return W.status=I.status,W.method=M.method,W.url=M.action,W}function B(M){var I=M.responseText||M.response;if(!I)return I;try{return JSON.parse(I)}catch(g){return I}}function K(M){var I=new XMLHttpRequest;M.onProgress&&I.upload&&(I.upload.onprogress=function(ne){ne.total>0&&(ne.percent=ne.loaded/ne.total*100),M.onProgress(ne)});var g=new FormData;M.data&&Object.keys(M.data).forEach(function($){var ne=M.data[$];if(Array.isArray(ne)){ne.forEach(function(oe){g.append($+"[]",oe)});return}g.append($,M.data[$])}),M.file instanceof Blob?g.append(M.filename,M.file,M.file.name):g.append(M.filename,M.file),I.onerror=function(ne){M.onError(ne)},I.onload=function(){return I.status<200||I.status>=300?M.onError(j(M,I),B(I)):M.onSuccess(B(I),I)},I.open(M.method,M.action,!0),M.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var W=M.headers||{};return W["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(W).forEach(function($){W[$]!==null&&I.setRequestHeader($,W[$])}),I.send(g),{abort:function(){I.abort()}}}var H=+new Date,r=0;function L(){return"rc-upload-"+H+"-"+ ++r}function v(M,I){return M.indexOf(I,M.length-I.length)!==-1}var m=function(M,I){if(M&&I){var g=Array.isArray(I)?I:I.split(","),W=M.name||"",$=M.type||"",ne=$.replace(/\/.*$/,"");return g.some(function(oe){var we=oe.trim();return we.charAt(0)==="."?v(W.toLowerCase(),we.toLowerCase()):/\/\*$/.test(we)?ne===we.replace(/\/.*$/,""):$===we})}return!0};function p(M,I){var g=M.createReader(),W=[];function $(){g.readEntries(function(ne){var oe=Array.prototype.slice.apply(ne);W=W.concat(oe);var we=!oe.length;we?I(W):$()})}$()}var u=function(I,g,W){var $=function ne(oe,we){we=we||"",oe.isFile?oe.file(function(ge){W(ge)&&(oe.fullPath&&!ge.webkitRelativePath&&(Object.defineProperties(ge,{webkitRelativePath:{writable:!0}}),ge.webkitRelativePath=oe.fullPath.replace(/^\//,""),Object.defineProperties(ge,{webkitRelativePath:{writable:!1}})),g([ge]))}):oe.isDirectory&&p(oe,function(ge){ge.forEach(function(xe){ne(xe,""+we+oe.name+"/")})})};I.forEach(function(ne){$(ne.webkitGetAsEntry())})},h=u,d=Object.assign||function(M){for(var I=1;I<arguments.length;I++){var g=arguments[I];for(var W in g)Object.prototype.hasOwnProperty.call(g,W)&&(M[W]=g[W])}return M},o=function(){function M(I,g){var W=[],$=!0,ne=!1,oe=void 0;try{for(var we=I[Symbol.iterator](),ge;!($=(ge=we.next()).done)&&!(W.push(ge.value),g&&W.length===g);$=!0);}catch(xe){ne=!0,oe=xe}finally{try{!$&&we.return&&we.return()}finally{if(ne)throw oe}}return W}return function(I,g){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return M(I,g);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function M(I,g){for(var W=0;W<g.length;W++){var $=g[W];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(I,$.key,$)}}return function(I,g,W){return g&&M(I.prototype,g),W&&M(I,W),I}}();function s(M,I,g){return I in M?Object.defineProperty(M,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):M[I]=g,M}function a(M,I){var g={};for(var W in M){if(I.indexOf(W)>=0)continue;if(!Object.prototype.hasOwnProperty.call(M,W))continue;g[W]=M[W]}return g}function R(M,I){if(!(M instanceof I))throw new TypeError("Cannot call a class as a function")}function E(M,I){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:M}function w(M,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);M.prototype=Object.create(I&&I.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(M,I):M.__proto__=I)}var D=function(I){return Object.keys(I).reduce(function(g,W){return(W.substr(0,5)==="data-"||W.substr(0,5)==="aria-"||W==="role")&&(g[W]=I[W]),g},{})},O=function(M){w(I,M);function I(){var g,W,$,ne;R(this,I);for(var oe=arguments.length,we=Array(oe),ge=0;ge<oe;ge++)we[ge]=arguments[ge];return ne=(W=($=E(this,(g=I.__proto__||Object.getPrototypeOf(I)).call.apply(g,[this].concat(we))),$),$.state={uid:L()},$.reqs={},$.onChange=function(xe){var Re=xe.target.files;$.uploadFiles(Re),$.reset()},$.onClick=function(xe){var Re=$.fileInput;if(!Re)return;var Le=$.props,ce=Le.children,he=Le.onClick;ce&&ce.type==="button"&&(Re.parentNode.focus(),Re.parentNode.querySelector("button").blur()),Re.click(),he&&he(xe)},$.onKeyDown=function(xe){xe.key==="Enter"&&$.onClick()},$.onFileDrop=function(xe){var Re=$.props.multiple;if(xe.preventDefault(),xe.type==="dragover")return;if($.props.directory)h(Array.prototype.slice.call(xe.dataTransfer.items),$.uploadFiles,function(ce){return m(ce,$.props.accept)});else{var Le=Array.prototype.slice.call(xe.dataTransfer.files).filter(function(ce){return m(ce,$.props.accept)});Re===!1&&(Le=Le.slice(0,1)),$.uploadFiles(Le)}},$.uploadFiles=function(xe){var Re=Array.prototype.slice.call(xe);Re.map(function(Le){return Le.uid=L(),Le}).forEach(function(Le){$.upload(Le,Re)})},$.saveFileInput=function(xe){$.fileInput=xe},W),E($,ne)}return l(I,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(W,$){var ne=this,oe=this.props;if(!oe.beforeUpload)return setTimeout(function(){return ne.post(W)},0);var we=oe.beforeUpload(W,$);we&&we.then?we.then(function(ge){var xe=Object.prototype.toString.call(ge);return xe==="[object File]"||xe==="[object Blob]"?ne.post(ge):ne.post(W)}).catch(function(ge){console.log(ge)}):we!==!1&&setTimeout(function(){return ne.post(W)},0);return}},{key:"post",value:function(W){var $=this;if(!this._isMounted)return;var ne=this.props,oe=ne.onStart,we=ne.onProgress,ge=ne.transformFile,xe=ge===void 0?function(Re){return Re}:ge;new Promise(function(Re){var Le=ne.action;return typeof Le=="function"&&(Le=Le(W)),Re(Le)}).then(function(Re){var Le=W.uid,ce=ne.customRequest||K,he=Promise.resolve(xe(W)).then(function(re){var de=ne.data;return typeof de=="function"&&(de=de(re)),Promise.all([re,de])}).catch(function(re){console.error(re)});he.then(function(re){var de=o(re,2),se=de[0],De=de[1],Ne={action:Re,filename:ne.name,data:De,file:se,headers:ne.headers,withCredentials:ne.withCredentials,method:ne.method||"post",onProgress:we?function(Se){we(Se,W)}:null,onSuccess:function(Pe,Ue){delete $.reqs[Le],ne.onSuccess(Pe,W,Ue)},onError:function(Pe,Ue){delete $.reqs[Le],ne.onError(Pe,Ue,W)}};oe(W),$.reqs[Le]=ce(Ne)})})}},{key:"reset",value:function(){this.setState({uid:L()})}},{key:"abort",value:function(W){var $=this.reqs;if(W){var ne=W;W&&W.uid&&(ne=W.uid),$[ne]&&$[ne].abort&&$[ne].abort(),delete $[ne]}else Object.keys($).forEach(function(oe){$[oe]&&$[oe].abort&&$[oe].abort(),delete $[oe]})}},{key:"render",value:function(){var W,$=this.props,ne=$.component,oe=$.prefixCls,we=$.className,ge=$.disabled,xe=$.id,Re=$.style,Le=$.multiple,ce=$.accept,he=$.children,re=$.directory,de=$.openFileDialogOnClick,se=$.onMouseEnter,De=$.onMouseLeave,Ne=a($,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),Se=X()((W={},s(W,oe,!0),s(W,oe+"-disabled",ge),s(W,we,we),W)),Pe=ge?{}:{onClick:de?this.onClick:function(){},onKeyDown:de?this.onKeyDown:function(){},onMouseEnter:se,onMouseLeave:De,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return J.a.createElement(ne,d({},Pe,{className:Se,role:"button",style:Re}),J.a.createElement("input",d({},D(Ne),{id:xe,type:"file",ref:this.saveFileInput,onClick:function(le){return le.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:ce,directory:re?"directory":null,webkitdirectory:re?"webkitdirectory":null,multiple:Le,onChange:this.onChange})),he)}}]),I}(ie.Component),A=O,C=Object.assign||function(M){for(var I=1;I<arguments.length;I++){var g=arguments[I];for(var W in g)Object.prototype.hasOwnProperty.call(g,W)&&(M[W]=g[W])}return M},T=function(){function M(I,g){for(var W=0;W<g.length;W++){var $=g[W];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(I,$.key,$)}}return function(I,g,W){return g&&M(I.prototype,g),W&&M(I,W),I}}();function f(M,I){if(!(M instanceof I))throw new TypeError("Cannot call a class as a function")}function S(M,I){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:M}function y(M,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);M.prototype=Object.create(I&&I.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(M,I):M.__proto__=I)}function b(){}var U=function(M){y(I,M);function I(){var g,W,$,ne;f(this,I);for(var oe=arguments.length,we=Array(oe),ge=0;ge<oe;ge++)we[ge]=arguments[ge];return ne=(W=($=S(this,(g=I.__proto__||Object.getPrototypeOf(I)).call.apply(g,[this].concat(we))),$),$.saveUploader=function(xe){$.uploader=xe},W),S($,ne)}return T(I,[{key:"abort",value:function(W){this.uploader.abort(W)}},{key:"render",value:function(){return J.a.createElement(A,C({},this.props,{ref:this.saveUploader}))}}]),I}(ie.Component);U.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:b,onError:b,onSuccess:b,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var F=U,_=be.a=F},HmJG:function(tt,be,Z){},JYp7:function(tt,be,Z){"use strict";Z.d(be,"a",function(){return ie});var ie;(function(J){function P(a){return a&&typeof a=="object"&&typeof a[Symbol.iterator]=="function"}J.is=P;const X=Object.freeze([]);function j(){return X}J.empty=j;function*B(a){yield a}J.single=B;function K(a){return a||X}J.from=K;function H(a){return!a||a[Symbol.iterator]().next().done===!0}J.isEmpty=H;function r(a){return a[Symbol.iterator]().next().value}J.first=r;function L(a,R){for(const E of a)if(R(E))return!0;return!1}J.some=L;function v(a,R){for(const E of a)if(R(E))return E;return}J.find=v;function*m(a,R){for(const E of a)R(E)&&(yield E)}J.filter=m;function*p(a,R){let E=0;for(const w of a)yield R(w,E++)}J.map=p;function*u(...a){for(const R of a)for(const E of R)yield E}J.concat=u;function*h(a){for(const R of a)for(const E of R)yield E}J.concatNested=h;function d(a,R,E){let w=E;for(const D of a)w=R(w,D);return w}J.reduce=d;function*o(a,R,E=a.length){for(R<0&&(R+=a.length),E<0?E+=a.length:E>a.length&&(E=a.length);R<E;R++)yield a[R]}J.slice=o;function l(a,R=Number.POSITIVE_INFINITY){const E=[];if(R===0)return[E,a];const w=a[Symbol.iterator]();for(let D=0;D<R;D++){const O=w.next();if(O.done)return[E,J.empty()];E.push(O.value)}return[E,{[Symbol.iterator](){return w}}]}J.consume=l;function s(a,R,E=(w,D)=>w===D){const w=a[Symbol.iterator](),D=R[Symbol.iterator]();for(;;){const O=w.next(),A=D.next();if(O.done!==A.done)return!1;if(O.done)return!0;if(!E(O.value,A.value))return!1}}J.equals=s})(ie||(ie={}))},LdHM:function(tt,be,Z){"use strict";Z.d(be,"b",function(){return a}),Z.d(be,"a",function(){return E});var ie=Z("1OyB"),J=Z("vuIU"),P=Z("Ji7U"),X=Z("LK+K"),j=Z("q1tI"),B=Z("rePB"),K=Z("Ff2n"),H=Z("ODXe"),r=Z("4IlW"),L=Z("bX4T"),v=Z("YrtM"),m=Z("TSYQ"),p=Z.n(m),u=Z("+nKL"),h=Z("8OUc"),d=function(W,$){var ne=W.prefixCls,oe=W.id,we=W.flattenOptions,ge=W.childrenAsData,xe=W.values,Re=W.searchValue,Le=W.multiple,ce=W.defaultActiveFirstOption,he=W.height,re=W.itemHeight,de=W.notFoundContent,se=W.open,De=W.menuItemSelectedIcon,Ne=W.virtual,Se=W.onSelect,Pe=W.onToggleOpen,Ue=W.onActiveValue,le=W.onScroll,ve=W.onMouseEnter,Ae="".concat(ne,"-item"),Ie=Object(v.a)(function(){return we},[se,we],function(We,Oe){return Oe[0]&&We[1]!==Oe[1]}),Ge=j.useRef(null),$e=function(Oe){Oe.preventDefault()},Ze=function(Oe){Ge.current&&Ge.current.scrollTo({index:Oe})},Je=function(Oe){for(var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Te=Ie.length,ae=0;ae<Te;ae+=1){var ue=(Oe+ae*_e+Te)%Te,fe=Ie[ue],me=fe.group,Ce=fe.data;if(!me&&!Ce.disabled)return ue}return-1},at=j.useState(function(){return Je(0)}),qe=Object(H.a)(at,2),it=qe[0],Be=qe[1],ct=function(Oe){Be(Oe);var _e=Ie[Oe];if(!_e){Ue(null,-1);return}Ue(_e.data.value,Oe)};j.useEffect(function(){ct(ce!==!1?Je(0):-1)},[Ie.length,Re]),j.useEffect(function(){var We=setTimeout(function(){if(!Le&&se&&xe.size===1){var Oe=Array.from(xe)[0],_e=Ie.findIndex(function(Te){var ae=Te.data;return ae.value===Oe});ct(_e),Ze(_e)}});return function(){return clearTimeout(We)}},[se]);var ot=function(Oe){Oe!==void 0&&Se(Oe,{selected:!xe.has(Oe)}),Le||Pe(!1)};if(j.useImperativeHandle($,function(){return{onKeyDown:function(Oe){var _e=Oe.which;switch(_e){case r.a.UP:case r.a.DOWN:{var Te=0;if(_e===r.a.UP?Te=-1:_e===r.a.DOWN&&(Te=1),Te!==0){var ae=Je(it+Te,Te);Ze(ae),ct(ae)}break}case r.a.ENTER:{var ue=Ie[it];ue&&!ue.data.disabled?ot(ue.data.value):ot(void 0),se&&Oe.preventDefault();break}case r.a.ESC:Pe(!1)}},onKeyUp:function(){},scrollTo:function(Oe){Ze(Oe)}}}),Ie.length===0)return j.createElement("div",{role:"listbox",id:"".concat(oe,"_list"),className:"".concat(Ae,"-empty"),onMouseDown:$e},de);function je(We){var Oe=Ie[We];if(!Oe)return null;var _e=Oe.data||{},Te=_e.value,ae=_e.label,ue=_e.children,fe=Object(L.a)(_e,!0),me=ge?ue:ae;return Oe?j.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},fe,{key:We,role:"option",id:"".concat(oe,"_list_").concat(We),"aria-selected":xe.has(Te)}),Te):null}return j.createElement(j.Fragment,null,j.createElement("div",{role:"listbox",id:"".concat(oe,"_list"),style:{height:0,width:0,overflow:"hidden"}},je(it-1),je(it),je(it+1)),j.createElement(u.a,{itemKey:"key",ref:Ge,data:Ie,height:he,itemHeight:re,fullHeight:!1,onMouseDown:$e,onScroll:le,virtual:Ne,onMouseEnter:ve},function(We,Oe){var _e,Te=We.group,ae=We.groupOption,ue=We.data,fe=ue.label,me=ue.key;if(Te)return j.createElement("div",{className:p()(Ae,"".concat(Ae,"-group"))},fe!==void 0?fe:me);var Ce=ue.disabled,Fe=ue.value,ze=ue.title,st=ue.children,mt=ue.style,ft=ue.className,wt=Object(K.a)(ue,["disabled","value","title","children","style","className"]),St=xe.has(Fe),ht="".concat(Ae,"-option"),Ut=p()(Ae,ht,ft,(_e={},Object(B.a)(_e,"".concat(ht,"-grouped"),ae),Object(B.a)(_e,"".concat(ht,"-active"),it===Oe&&!Ce),Object(B.a)(_e,"".concat(ht,"-disabled"),Ce),Object(B.a)(_e,"".concat(ht,"-selected"),St),_e)),Lt=ge?st:fe,qt=!De||typeof De=="function"||St;return j.createElement("div",Object.assign({},wt,{"aria-selected":St,className:Ut,title:ze,onMouseMove:function(){if(it===Oe||Ce)return;ct(Oe)},onClick:function(){Ce||ot(Fe)},style:mt}),j.createElement("div",{className:"".concat(ht,"-content")},Lt||Fe),j.isValidElement(De)||St,qt&&j.createElement(h.a,{className:"".concat(Ae,"-option-state"),customizeIcon:De,customizeIconProps:{isSelected:St}},St?"\u2713":null))}))},o=j.forwardRef(d);o.displayName="OptionList";var l=o,s=function(){return null};s.isSelectOption=!0;var a=s,R=function(){return null};R.isSelectOptGroup=!0;var E=R,w=Z("VTBJ"),D=Z("Zm9Q");function O(g){var W=g.key,$=g.props,ne=$.children,oe=$.value,we=Object(K.a)($,["children","value"]);return Object(w.a)({key:W,value:oe!==void 0?oe:W,children:ne},we)}function A(g){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(g).map(function($,ne){if(!j.isValidElement($)||!$.type)return null;var oe=$.type.isSelectOptGroup,we=$.key,ge=$.props,xe=ge.children,Re=Object(K.a)(ge,["children"]);return W||!oe?O($):Object(w.a)(Object(w.a)({key:"__RC_SELECT_GRP__".concat(we===null?ne:we,"__"),label:we},Re),{},{options:A(xe)})}).filter(function($){return $})}var C=Z("2Qr1"),T=Z("qNPg"),f=Z("U8pU"),S=Z("Kwbf"),y=Z("WKfj");function b(g){var W=g.mode,$=g.options,ne=g.children,oe=g.backfill,we=g.allowClear,ge=g.placeholder,xe=g.getInputElement,Re=g.showSearch,Le=g.onSearch,ce=g.defaultOpen,he=g.autoFocus,re=g.labelInValue,de=g.value,se=g.inputValue,De=g.optionLabelProp,Ne=W==="multiple"||W==="tags",Se=Re!==void 0?Re:Ne||W==="combobox",Pe=$||A(ne);if(Object(S.a)(W!=="tags"||Pe.every(function(Ae){return!Ae.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var Ue=Pe.some(function(Ae){return Ae.options?Ae.options.some(function(Ie){return typeof("value"in Ie?Ie.value:Ie.key)=="number"}):typeof("value"in Ae?Ae.value:Ae.key)=="number"});Object(S.a)(!Ue,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(S.a)(W!=="combobox"||!De,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(S.a)(W==="combobox"||!oe,"`backfill` only works with `combobox` mode."),Object(S.a)(W==="combobox"||!xe,"`getInputElement` only work with `combobox` mode."),Object(S.b)(W!=="combobox"||!xe||!we||!ge,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Le&&!Se&&W!=="combobox"&&W!=="tags"&&Object(S.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(S.b)(!ce||he,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),de!=null){var le=Object(y.d)(de);Object(S.a)(!re||le.every(function(Ae){return Object(f.a)(Ae)==="object"&&("key"in Ae||"value"in Ae)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(S.a)(!Ne||Array.isArray(de),"`value` should be array when `mode` is `multiple` or `tags`")}if(ne){var ve=null;Object(D.a)(ne).some(function(Ae){if(!j.isValidElement(Ae)||!Ae.type)return!1;var Ie=Ae.type;if(Ie.isSelectOption)return!1;if(Ie.isSelectOptGroup){var Ge=Object(D.a)(Ae.props.children).every(function($e){return!j.isValidElement($e)||!Ae.type||$e.type.isSelectOption?!0:(ve=$e.type,!1)});return!Ge}return ve=Ie,!0}),ve&&Object(S.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ve.displayName||ve.name||ve,"`.")),Object(S.a)(se===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var U=b,F=Object(T.a)({prefixCls:"rc-select",components:{optionList:l},convertChildrenToData:A,flattenOptions:C.d,getLabeledValue:C.e,filterOptions:C.b,isValueDisabled:C.g,findValueOption:C.c,warningProps:U,fillOptionsWithMissingValue:C.a}),_=function(g){Object(P.a)($,g);var W=Object(X.a)($);function $(){var ne;return Object(ie.a)(this,$),ne=W.apply(this,arguments),ne.selectRef=j.createRef(),ne.focus=function(){ne.selectRef.current.focus()},ne.blur=function(){ne.selectRef.current.blur()},ne}return Object(J.a)($,[{key:"render",value:function(){return j.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),$}(j.Component);_.Option=a,_.OptGroup=E;var M=_,I=be.c=M},M8RZ:function(tt,be,Z){"use strict";Z.d(be,"a",function(){return r});var ie=Z("fWQN"),J=Z("mtLc"),P=Z("yKVA"),X=Z("879j"),j=Z("q1tI"),B=Z.n(j),K=Z("i8i4"),H=Z.n(K),r=function(L){Object(P.a)(m,L);var v=Object(X.a)(m);function m(p){var u;Object(ie.a)(this,m),u=v.call(this,p);var h=window.document;return u.node=h.createElement("div"),h.body.appendChild(u.node),u}return Object(J.a)(m,[{key:"render",value:function(){var u=this.props.children;return Object(K.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(B.a.Component)},MI8n:function(tt,be,Z){"use strict";Z.d(be,"c",function(){return j}),Z.d(be,"b",function(){return r}),Z.d(be,"e",function(){return L}),Z.d(be,"a",function(){return v}),Z.d(be,"d",function(){return m}),Z.d(be,"f",function(){return p});var ie=Z("/cxE"),J=Z("pmY6"),P=Z("24hK"),X=Z("5Y4S"),j;(function(u){u.None=()=>J.a.None;function h(b){return(U,F=null,_)=>{let M=!1,I;return I=b(g=>M?void 0:(I?I.dispose():M=!0,U.call(F,g)),null,_),M&&I.dispose(),I}}u.once=h;function d(b,U){return E((F,_=null,M)=>b(I=>F.call(_,U(I)),null,M))}u.map=d;function o(b,U){return E((F,_=null,M)=>b(I=>{U(I),F.call(_,I)},null,M))}u.forEach=o;function l(b,U){return E((F,_=null,M)=>b(I=>U(I)&&F.call(_,I),null,M))}u.filter=l;function s(b){return b}u.signal=s;function a(...b){return(U,F=null,_)=>Object(J.e)(...b.map(M=>M(I=>U.call(F,I),null,_)))}u.any=a;function R(b,U,F){let _=F;return d(b,M=>(_=U(_,M),_))}u.reduce=R;function E(b){let U;const F=new r({onFirstListenerAdd(){U=b(F.fire,F)},onLastListenerRemove(){U.dispose()}});return F.event}function w(b,U,F=100,_=!1,M){let I,g,W,$=0;const ne=new r({leakWarningThreshold:M,onFirstListenerAdd(){I=b(oe=>{$++,g=U(g,oe),_&&!W&&(ne.fire(g),g=void 0),clearTimeout(W),W=setTimeout(()=>{const we=g;g=void 0,W=void 0,(!_||$>1)&&ne.fire(we),$=0},F)})},onLastListenerRemove(){I.dispose()}});return ne.event}u.debounce=w;function D(b,U=(F,_)=>F===_){let F=!0,_;return l(b,M=>{const I=F||!U(M,_);return F=!1,_=M,I})}u.latch=D;function O(b,U){return[u.filter(b,U),u.filter(b,F=>!U(F))]}u.split=O;function A(b,U=!1,F=[]){let _=F.slice(),M=b(W=>{_?_.push(W):g.fire(W)});const I=()=>{_&&_.forEach(W=>g.fire(W)),_=null},g=new r({onFirstListenerAdd(){M||(M=b(W=>g.fire(W)))},onFirstListenerDidAdd(){_&&(U?setTimeout(I):I())},onLastListenerRemove(){M&&M.dispose(),M=null}});return g.event}u.buffer=A;class C{constructor(b){this.event=b}map(b){return new C(d(this.event,b))}forEach(b){return new C(o(this.event,b))}filter(b){return new C(l(this.event,b))}reduce(b,U){return new C(R(this.event,b,U))}latch(){return new C(D(this.event))}debounce(b,U=100,F=!1,_){return new C(w(this.event,b,U,F,_))}on(b,U,F){return this.event(b,U,F)}once(b,U,F){return h(this.event)(b,U,F)}}function T(b){return new C(b)}u.chain=T;function f(b,U,F=_=>_){const _=(...W)=>g.fire(F(...W)),M=()=>b.on(U,_),I=()=>b.removeListener(U,_),g=new r({onFirstListenerAdd:M,onLastListenerRemove:I});return g.event}u.fromNodeEventEmitter=f;function S(b,U,F=_=>_){const _=(...W)=>g.fire(F(...W)),M=()=>b.addEventListener(U,_),I=()=>b.removeEventListener(U,_),g=new r({onFirstListenerAdd:M,onLastListenerRemove:I});return g.event}u.fromDOMEventEmitter=S;function y(b){return new Promise(U=>h(b)(U))}u.toPromise=y})(j||(j={}));class B{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${B._idPool++}`}start(u){this._stopWatch=new X.a(!0),this._listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this._elapsedOverall+=u,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${u.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}B._idPool=0;let K=-1;class H{constructor(u,h=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=h,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let h=K;if(typeof this.customThreshold=="number"&&(h=this.customThreshold),h<=0||u<h)return;this._stacks||(this._stacks=new Map);const d=new Error().stack.split(`
`).slice(3).join(`
`),o=this._stacks.get(d)||0;if(this._stacks.set(d,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=h*.5;let l,s=0;for(const[a,R]of this._stacks)(!l||s<R)&&(l=a,s=R);console.warn(`[${this.name}] potential listener LEAK detected, having ${u} listeners already. MOST frequent listener (${s}):`),console.warn(l)}return()=>{const l=this._stacks.get(d)||0;this._stacks.set(d,l-1)}}}class r{constructor(u){var h;this._disposed=!1,this._options=u,this._leakageMon=K>0?new H(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((h=this._options)===null||h===void 0?void 0:h._profName)?new B(this._options._profName):void 0}get event(){return this._event||(this._event=(u,h,d)=>{var o;this._listeners||(this._listeners=new P.a);const l=this._listeners.isEmpty();l&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(h?[u,h]:u);l&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,h);const a=(o=this._leakageMon)===null||o===void 0?void 0:o.check(this._listeners.size),R=Object(J.i)(()=>{if(a&&a(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const E=this._listeners&&!this._listeners.isEmpty();E||this._options.onLastListenerRemove(this)}});return d instanceof J.b?d.add(R):Array.isArray(d)&&d.push(R),R}),this._event}fire(u){var h,d;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let o of this._listeners)this._deliveryQueue.push([o,u]);for((h=this._perfMon)===null||h===void 0||h.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[o,l]=this._deliveryQueue.shift();try{typeof o=="function"?o.call(void 0,l):o[0].call(o[1],l)}catch(s){Object(ie.f)(s)}}(d=this._perfMon)===null||d===void 0||d.stop()}}dispose(){var u,h,d,o,l;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(h=this._deliveryQueue)===null||h===void 0||h.clear(),(o=(d=this._options)===null||d===void 0?void 0:d.onLastListenerRemove)===null||o===void 0||o.call(d),(l=this._leakageMon)===null||l===void 0||l.dispose())}}class L extends r{constructor(u){super(u);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=u==null?void 0:u.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._listeners&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}class v extends L{constructor(u){var h;super(u);this._delay=(h=u.delay)!==null&&h!==void 0?h:100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}class m{constructor(){this.buffers=[]}wrapEvent(u){return(h,d,o)=>u(l=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>h.call(d,l)):h.call(d,l)},void 0,o)}bufferEvents(u){const h=[];this.buffers.push(h);const d=u();return this.buffers.pop(),h.forEach(o=>o()),d}}class p{constructor(){this.listening=!1,this.inputEvent=j.None,this.inputEventListener=J.a.None,this.emitter=new r({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(tt,be,Z){"use strict";(function(ie,J){Z.d(be,"b",function(){return d}),Z.d(be,"i",function(){return a}),Z.d(be,"f",function(){return R}),Z.d(be,"d",function(){return E}),Z.d(be,"g",function(){return w}),Z.d(be,"h",function(){return D}),Z.d(be,"c",function(){return O}),Z.d(be,"k",function(){return A}),Z.d(be,"j",function(){return C}),Z.d(be,"a",function(){return T}),Z.d(be,"e",function(){return y});var P;const X="en";let j=!1,B=!1,K=!1,H=!1,r=!1,L=!1,v=!1,m,p=X,u,h;const d=typeof self=="object"?self:typeof ie=="object"?ie:{};let o;typeof d.vscode!="undefined"&&typeof d.vscode.process!="undefined"?o=d.vscode.process:typeof J!="undefined"&&(o=J);const l=typeof((P=o==null?void 0:o.versions)===null||P===void 0?void 0:P.electron)=="string"&&o.type==="renderer";if(typeof navigator=="object"&&!l)h=navigator.userAgent,j=h.indexOf("Windows")>=0,B=h.indexOf("Macintosh")>=0,v=(h.indexOf("Macintosh")>=0||h.indexOf("iPad")>=0||h.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=h.indexOf("Linux")>=0,L=!0,m=navigator.language,p=m;else if(typeof o=="object"){j=o.platform==="win32",B=o.platform==="darwin",K=o.platform==="linux",H=K&&!!o.env.SNAP&&!!o.env.SNAP_REVISION,m=X,p=X;const b=o.env.VSCODE_NLS_CONFIG;if(b)try{const U=JSON.parse(b),F=U.availableLanguages["*"];m=U.locale,p=F||X,u=U._translationsConfigFile}catch(U){}r=!0}else console.error("Unable to resolve platform.");let s=0;B?s=1:j?s=3:K&&(s=2);const a=j,R=B,E=K,w=r,D=L,O=v,A=h,C=function(){if(d.setImmediate)return d.setImmediate.bind(d);if(typeof d.postMessage=="function"&&!d.importScripts){let F=[];d.addEventListener("message",M=>{if(M.data&&M.data.vscodeSetImmediateId)for(let I=0,g=F.length;I<g;I++){const W=F[I];if(W.id===M.data.vscodeSetImmediateId){F.splice(I,1),W.callback();return}}});let _=0;return M=>{const I=++_;F.push({id:I,callback:M}),d.postMessage({vscodeSetImmediateId:I},"*")}}if(typeof(o==null?void 0:o.nextTick)=="function")return o.nextTick.bind(o);const U=Promise.resolve();return F=>U.then(F)}(),T=B||v?2:j?1:3;let f=!0,S=!1;function y(){if(!S){S=!0;const b=new Uint8Array(2);b[0]=1,b[1]=2;const U=new Uint16Array(b.buffer);f=U[0]===(2<<8)+1}return f}}).call(this,Z("IyRk"),Z("Q2Ig"))},N0LK:function(tt,be,Z){"use strict";Z.d(be,"C",function(){return ie}),Z.d(be,"v",function(){return P}),Z.d(be,"s",function(){return X}),Z.d(be,"t",function(){return j}),Z.d(be,"U",function(){return B}),Z.d(be,"J",function(){return K}),Z.d(be,"O",function(){return H}),Z.d(be,"p",function(){return r}),Z.d(be,"T",function(){return L}),Z.d(be,"q",function(){return v}),Z.d(be,"N",function(){return m}),Z.d(be,"M",function(){return p}),Z.d(be,"Q",function(){return u}),Z.d(be,"u",function(){return h}),Z.d(be,"x",function(){return d}),Z.d(be,"I",function(){return o}),Z.d(be,"f",function(){return l}),Z.d(be,"h",function(){return s}),Z.d(be,"g",function(){return a}),Z.d(be,"i",function(){return R}),Z.d(be,"G",function(){return E}),Z.d(be,"H",function(){return w}),Z.d(be,"r",function(){return D}),Z.d(be,"R",function(){return O}),Z.d(be,"d",function(){return A}),Z.d(be,"e",function(){return C}),Z.d(be,"E",function(){return T}),Z.d(be,"F",function(){return f}),Z.d(be,"j",function(){return S}),Z.d(be,"z",function(){return y}),Z.d(be,"K",function(){return U}),Z.d(be,"L",function(){return F}),Z.d(be,"m",function(){return M}),Z.d(be,"k",function(){return g}),Z.d(be,"A",function(){return $}),Z.d(be,"a",function(){return ne}),Z.d(be,"n",function(){return oe}),Z.d(be,"l",function(){return we}),Z.d(be,"D",function(){return ge}),Z.d(be,"B",function(){return xe}),Z.d(be,"b",function(){return Re}),Z.d(be,"S",function(){return Le}),Z.d(be,"o",function(){return ce}),Z.d(be,"P",function(){return he}),Z.d(be,"w",function(){return re}),Z.d(be,"c",function(){return de}),Z.d(be,"y",function(){return Ne});function ie(le){return!le||typeof le!="string"?!0:le.trim().length===0}const J=/{(\d+)}/g;function P(le,...ve){return ve.length===0?le:le.replace(J,function(Ae,Ie){const Ge=parseInt(Ie,10);return isNaN(Ge)||Ge<0||Ge>=ve.length?Ae:ve[Ge]})}function X(le){return le.replace(/[<>&]/g,function(ve){switch(ve){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return ve}})}function j(le){return le.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function B(le,ve=" "){const Ae=K(le,ve);return H(Ae,ve)}function K(le,ve){if(!le||!ve)return le;const Ae=ve.length;if(Ae===0||le.length===0)return le;let Ie=0;for(;le.indexOf(ve,Ie)===Ie;)Ie=Ie+Ae;return le.substring(Ie)}function H(le,ve){if(!le||!ve)return le;const Ae=ve.length,Ie=le.length;if(Ae===0||Ie===0)return le;let Ge=Ie,$e=-1;for(;!($e=le.lastIndexOf(ve,Ge-1),$e===-1||$e+Ae!==Ge);){if($e===0)return"";Ge=$e}return le.substring(0,Ge)}function r(le){return le.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function L(le){return le.replace(/\*/g,"")}function v(le,ve,Ae={}){if(!le)throw new Error("Cannot create regex from empty string");ve||(le=j(le)),Ae.wholeWord&&(/\B/.test(le.charAt(0))||(le="\\b"+le),/\B/.test(le.charAt(le.length-1))||(le=le+"\\b"));let Ie="";return Ae.global&&(Ie+="g"),Ae.matchCase||(Ie+="i"),Ae.multiline&&(Ie+="m"),Ae.unicode&&(Ie+="u"),new RegExp(le,Ie)}function m(le){if(le.source==="^"||le.source==="^$"||le.source==="$"||le.source==="^\\s*$")return!1;const ve=le.exec("");return!!(ve&&le.lastIndex===0)}function p(le){return(le.global?"g":"")+(le.ignoreCase?"i":"")+(le.multiline?"m":"")+(le.unicode?"u":"")}function u(le){return le.split(/\r\n|\r|\n/)}function h(le){for(let ve=0,Ae=le.length;ve<Ae;ve++){const Ie=le.charCodeAt(ve);if(Ie!==32&&Ie!==9)return ve}return-1}function d(le,ve=0,Ae=le.length){for(let Ie=ve;Ie<Ae;Ie++){const Ge=le.charCodeAt(Ie);if(Ge!==32&&Ge!==9)return le.substring(ve,Ie)}return le.substring(ve,Ae)}function o(le,ve=le.length-1){for(let Ae=ve;Ae>=0;Ae--){const Ie=le.charCodeAt(Ae);if(Ie!==32&&Ie!==9)return Ae}return-1}function l(le,ve){return le<ve?-1:le>ve?1:0}function s(le,ve,Ae=0,Ie=le.length,Ge=0,$e=ve.length){for(;Ae<Ie&&Ge<$e;Ae++,Ge++){let at=le.charCodeAt(Ae),qe=ve.charCodeAt(Ge);if(at<qe)return-1;if(at>qe)return 1}const Ze=Ie-Ae,Je=$e-Ge;return Ze<Je?-1:Ze>Je?1:0}function a(le,ve){return R(le,ve,0,le.length,0,ve.length)}function R(le,ve,Ae=0,Ie=le.length,Ge=0,$e=ve.length){for(;Ae<Ie&&Ge<$e;Ae++,Ge++){let at=le.charCodeAt(Ae),qe=ve.charCodeAt(Ge);if(at===qe)continue;if(at>=128||qe>=128)return s(le.toLowerCase(),ve.toLowerCase(),Ae,Ie,Ge,$e);E(at)&&(at-=32),E(qe)&&(qe-=32);const it=at-qe;if(it===0)continue;return it}const Ze=Ie-Ae,Je=$e-Ge;return Ze<Je?-1:Ze>Je?1:0}function E(le){return le>=97&&le<=122}function w(le){return le>=65&&le<=90}function D(le,ve){return le.length===ve.length&&R(le,ve)===0}function O(le,ve){const Ae=ve.length;return ve.length>le.length?!1:R(le,ve,0,Ae)===0}function A(le,ve){let Ae,Ie=Math.min(le.length,ve.length);for(Ae=0;Ae<Ie;Ae++)if(le.charCodeAt(Ae)!==ve.charCodeAt(Ae))return Ae;return Ie}function C(le,ve){let Ae,Ie=Math.min(le.length,ve.length);const Ge=le.length-1,$e=ve.length-1;for(Ae=0;Ae<Ie;Ae++)if(le.charCodeAt(Ge-Ae)!==ve.charCodeAt($e-Ae))return Ae;return Ie}function T(le){return 55296<=le&&le<=56319}function f(le){return 56320<=le&&le<=57343}function S(le,ve){return(le-55296<<10)+(ve-56320)+65536}function y(le,ve,Ae){const Ie=le.charCodeAt(Ae);if(T(Ie)&&Ae+1<ve){const Ge=le.charCodeAt(Ae+1);if(f(Ge))return S(Ie,Ge)}return Ie}function b(le,ve){const Ae=le.charCodeAt(ve-1);if(f(Ae)&&ve>1){const Ie=le.charCodeAt(ve-2);if(T(Ie))return S(Ie,Ae)}return Ae}function U(le,ve){const Ae=se.getInstance(),Ie=ve,Ge=le.length,$e=y(le,Ge,ve);ve+=$e>=65536?2:1;let Ze=Ae.getGraphemeBreakType($e);for(;ve<Ge;){const Je=y(le,Ge,ve),at=Ae.getGraphemeBreakType(Je);if(de(Ze,at))break;ve+=Je>=65536?2:1,Ze=at}return ve-Ie}function F(le,ve){const Ae=se.getInstance(),Ie=ve,Ge=b(le,ve);ve-=Ge>=65536?2:1;let $e=Ae.getGraphemeBreakType(Ge);for(;ve>0;){const Ze=b(le,ve),Je=Ae.getGraphemeBreakType(Ze);if(de(Je,$e))break;ve-=Ze>=65536?2:1,$e=Je}return Ie-ve}const _=/(?:[\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 M(le){return _.test(le)}const I=/(?:[\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 g(le){return I.test(le)}const W=/^[\t\n\r\x20-\x7E]*$/;function $(le){return W.test(le)}const ne=/[\u2028\u2029]/;function oe(le){return ne.test(le)}function we(le){for(let ve=0,Ae=le.length;ve<Ae;ve++)if(ge(le.charCodeAt(ve)))return!0;return!1}function ge(le){return le=+le,le>=11904&&le<=55215||le>=63744&&le<=64255||le>=65281&&le<=65374}function xe(le){return le>=127462&&le<=127487||le===8986||le===8987||le===9200||le===9203||le>=9728&&le<=10175||le===11088||le===11093||le>=127744&&le<=128591||le>=128640&&le<=128764||le>=128992&&le<=129003||le>=129280&&le<=129535||le>=129648&&le<=129750}const Re=String.fromCharCode(65279);function Le(le){return!!(le&&le.length>0&&le.charCodeAt(0)===65279)}function ce(le,ve=!1){return le?(ve&&(le=le.replace(/\\./g,"")),le.toLowerCase()!==le):!1}function he(le){const ve=90-65+1;return le=le%(2*ve),le<ve?String.fromCharCode(97+le):String.fromCharCode(65+le-ve)}function re(le){const ve=se.getInstance();return ve.getGraphemeBreakType(le)}function de(le,ve){return le===0?ve!==5&&ve!==7:le===2&&ve===3?!1:le===4||le===2||le===3||(ve===4||ve===2||ve===3)?!0:le===8&&(ve===8||ve===9||ve===11||ve===12)||((le===11||le===9)&&(ve===9||ve===10)||((le===12||le===10)&&ve===10||(ve===5||ve===13||(ve===7||(le===1||le===13&&ve===14)))))?!1:!(le===6&&ve===6)}class se{constructor(){this._data=De()}static getInstance(){return se._INSTANCE||(se._INSTANCE=new se),se._INSTANCE}getGraphemeBreakType(le){if(le<32)return le===10?3:le===13?2:4;if(le<127)return 0;const ve=this._data,Ae=ve.length/3;let Ie=1;for(;Ie<=Ae;)if(le<ve[3*Ie])Ie=2*Ie;else if(le>ve[3*Ie+1])Ie=2*Ie+1;else return ve[3*Ie+2];return 0}}se._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 Ne(le,ve){if(le===0)return 0;const Ae=Se(le,ve);if(Ae!==void 0)return Ae;const Ie=b(ve,le);return le-=Pe(Ie),le}function Se(le,ve){let Ae=b(ve,le);for(le-=Pe(Ae);Ue(Ae)||Ae===65039||Ae===8419;){if(le===0)return;Ae=b(ve,le),le-=Pe(Ae)}if(!xe(Ae))return;if(le>=0){const Ie=b(ve,le);Ie===8205&&(le-=Pe(Ie))}return le}function Pe(le){return le>=65536?2:1}function Ue(le){return 127995<=le&&le<=127999}},Ot1p:function(tt,be,Z){"use strict";var ie=Z("2qtc"),J=Z("kLXV"),P=Z("rAM+"),X=Z("miYZ"),j=Z("tsqr"),B=Z("9og8"),K=Z("tJVT"),H=Z("jrin"),r=Z("WmNS"),L=Z.n(r),v=Z("q1tI"),m=Z.n(v),p=Z("VrN/"),u=Z.n(p),h=Z("bdgK"),d=Z("p77/"),o=Z("Bd2K"),l=Z("ELLl"),s=Z("19Vz"),a=Z("lZu9"),R=Z("+NIl"),E=Z("kSUc"),w=Z("9Bee"),D=function(Ce){var Fe=Ce.value,ze=Fe===void 0?"":Fe,st=Ce.className,mt=Ce.showTextOnly,ft=Ce.showLines,wt=Ce.style,St=wt===void 0?{}:wt,ht=Object(v.useMemo)(function(){return""},[ze]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:ht}}))},O=Z("0Owb"),A=Z("dejd"),C=Z("C+DQ"),T=Z("1vsH"),f=Z("m3rI"),S=[{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(Ce){var Fe=Ce.onActionCallback,ze=Ce.title,st=Ce.icon,mt=Ce.actionName,ft=Ce.className,wt=ft===void 0?"":ft,St=Ce.children;function ht(){Fe(mt)}return m.a.createElement("a",{title:ze,className:wt,onClick:ht},m.a.createElement("i",{className:"md-iconfont ".concat(st)}),St)}var b=function(Ce){var Fe=Ce.watch,ze=Ce.showNullButton,st=Ce.onActionCallback,mt=Ce.fullScreen,ft=Ce.insertTemp,wt=Ce.hidetoolBar,St=Ce.uuid,ht=Ce.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(T.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(T.F)("_educoder_session"),"&key=").concat(St,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var Ut=[].concat(S,[{title:"".concat(Fe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Fe?"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(O.a)({},Lt,{onActionCallback:st})):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:st},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:st},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:st})))},U=Z("M8RZ"),F=Z("+L6B"),_=Z("2/Rp"),M=Z("y8nQ"),I=Z("Vl3Y"),g=Z("5NDa"),W=Z("5rEg"),$={labelCol:{span:4},wrapperCol:{span:20}},ne=function(Ce){var Fe=Ce.callback,ze=Ce.onCancel;function st(mt){Fe(mt)}return m.a.createElement(I.a,Object(O.a)({},$,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:st}),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(W.a,null)),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(W.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(_.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},oe=Z("7ahc"),we=Z("HmJG"),ge=Z("BjJ7"),xe=I.a.useForm,Re={width:280,marginRight:10},Le={labelCol:{span:5},wrapperCol:{span:19}},ce=function(Ce){var Fe=Ce.callback,ze=Ce.onCancel,st=xe(),mt=Object(K.a)(st,1),ft=mt[0];function wt(Ut){Fe(Ut)}function St(Ut,Lt){if(Ut.status===-1){j.b.error(Ut.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Ut.id),type:Lt.type})}function ht(Ut){var Lt=Ut.target.files[0];re(Lt,St)}return m.a.createElement(I.a,Object(O.a)({form:ft},Le,{className:"upload-image-panel",onFinish:wt}),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(W.a,{style:Re})),m.a.createElement(he,{onFileChange:ht}))),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(W.a,{style:{width:264}})),m.a.createElement(I.a.Item,{style:{textAlign:"right"}},m.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(_.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))};function he(Ce){var Fe=Ce.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Fe}))}function re(Ce,Fe){if(!Ce)throw new String("\u6CA1\u6709\u6587\u4EF6");var ze=new FormData;ze.append("editormd-image-file",Ce),ze.append("file_param_name","editormd-image-file"),ze.append("byxhr","true");var st=new window.XMLHttpRequest;st.withCredentials=!0,st.addEventListener("load",function(mt){Fe(JSON.parse(mt.target.responseText),Ce)},!1),st.addEventListener("error",function(mt){console.error(mt)},!1),st.open("POST","".concat(ge.a,"/api/attachments.json")),st.send(ze)}var de=Z("giR+"),se=Z("fyUT"),De=Z("7Kak"),Ne=Z("9yH6"),Se=Ne.a.Group,Pe={margin:"0 8px"},Ue=function(Ce){var Fe=Ce.callback,ze=Ce.onCancel;function st(mt){Fe(mt)}return m.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:st},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:Pe},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:Pe},"\u884C\u6570"),m.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(se.a,null)),m.a.createElement("span",{style:Pe},"\u5217\u6570"),m.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(se.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:Pe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(I.a.Item,{name:"align"},m.a.createElement(Se,null,m.a.createElement(Ne.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(Ne.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(Ne.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(Ne.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(_.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},le=Z("ErOA"),ve=Z("7Cbv"),Ae="link",Ie="upload-image",Ge="code-block",$e="add-table",Ze="------------",Je={default:Ze,left:":".concat(Ze),center:":".concat(Ze,":"),right:"".concat(Ze,":")},at=Z("9VGf"),qe,it;function Be(){}var ct=0,ot=1e4,je="\u2581",We=`
**\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 Oe(Ce){return/^\d+$/.test(Ce)?"".concat(Ce,"px"):Ce}var _e=navigator.platform.toUpperCase().indexOf("MAC")>=0,Te=_e?"Cmd":"Ctrl",ae=["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"],ue=(qe={},Object(H.a)(qe,Te+"-B","bold"),Object(H.a)(qe,Te+"-I","italic"),qe),fe=(it={},Object(H.a)(it,Ae,"\u6DFB\u52A0\u94FE\u63A5"),Object(H.a)(it,Ge,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(H.a)(it,Ie,"\u6DFB\u52A0\u6587\u4EF6"),Object(H.a)(it,$e,"\u6DFB\u52A0\u8868\u683C"),it),me=be.a=function(Ce){var Fe=Ce.defaultValue,ze=Fe===void 0?"":Fe,st=Ce.onChange,mt=Ce.width,ft=mt===void 0?"100%":mt,wt=Ce.height,St=wt===void 0?400:wt,ht=Ce.miniToolbar,Ut=ht===void 0?!1:ht,Lt=Ce.isFocus,qt=Lt===void 0?!1:Lt,Zt=Ce.watch,It=Ce.insertTemp,Cr=Ce.mode,Kr=Cr===void 0?"markdown":Cr,yt=Ce.id,Lr=yt===void 0?"markdown-editor-id":yt,bt=Ce.showResizeBar,xt=bt===void 0?!1:bt,Ft=Ce.noStorage,tr=Ft===void 0?!1:Ft,cr=Ce.showNullButton,Pt=cr===void 0?!1:cr,dt=Ce.hidetoolBar,Ur=dt===void 0?!1:dt,Vt=Ce.fullScreen,Jt=Vt===void 0?!1:Vt,Ot=Ce.onBlur,lr=Ce.onCMBeforeChange,Ir=Ce.onFullScreen,Xr=Ce.className,Xe=Xr===void 0?"":Xr,Ct=Ce.disablePaste,mn=Ct===void 0?!1:Ct,gn=Ce.placeholder,vn=gn===void 0?"":gn,yn=Ce.values,Y=yn===void 0?"":yn,x=Object(v.useState)(null),k=Object(K.a)(x,2),G=k[0],ee=k[1],V=Object(v.useState)(ze),Ee=Object(K.a)(V,2),Ke=Ee[0],et=Ee[1],pt=Object(v.useState)(Zt),Ve=Object(K.a)(pt,2),_t=Ve[0],jt=Ve[1],$t=Object(v.useState)(Jt),jr=Object(K.a)($t,2),Er=jr[0],xr=jr[1],Zr=Object(v.useState)(""),Dn=Object(K.a)(Zr,2),dr=Dn[0],zr=Dn[1],un=Object(v.useState)(0),hn=Object(K.a)(un,2),Hr=hn[0],kn=hn[1],bn=Object(v.useState)(St),zn=Object(K.a)(bn,2),Vn=zn[0],Qr=zn[1],$r=Object(v.useState)(!1),_n=Object(K.a)($r,2),ci=_n[0],En=_n[1],nr=Object(v.useRef)(Object(ve.a)()),Ht=Object(v.useRef)(!1),yr=Object(v.useRef)(),kt=Object(v.useRef)(),ar=Object(v.useRef)(),Kt=Object(v.useRef)(),nn=Object(v.useRef)(),fr=function(){var gt=Object(B.a)(L.a.mark(function At(){var Et,Dt;return L.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,Object(le.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:nr.current}});case 2:Dt=Yt.sent,Dt!=null&&(Et=Dt.attachments)!==null&&Et!==void 0&&Et.length&&(console.log("cm:",G,kt),Dt.attachments.map(function(Nt){Nt.content_type.indexOf("image")>-1?G.replaceSelection("![,](/api/attachments/".concat(Nt.id,"?type=").concat(Nt.content_type,")")):Nt.content_type.indexOf("video")>-1?G.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Nt.content_type.indexOf("pdf")>-1?G.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):G.replaceSelection("[".concat(Nt.name,"](").concat(f.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(v.useEffect)(function(){et(Y),G==null||G.setValue(Y)},[Y]),Object(v.useEffect)(function(){Ir==null||Ir(Er)},[Er]),Object(v.useEffect)(function(){if(kt.current){var gt=u.a.fromTextArea(kt.current,{mode:Kr,lineNumbers:!Ut,lineWrapping:!0,value:ze,autoCloseTags:!0,autoCloseBrackets:!0});qt&&gt.focus();function At(Et,Dt){if(mn){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(),Kr=="stex")return;try{var ur,Dr=Nt[1];((ur=Nt[0])===null||ur===void 0?void 0:ur.kind)==="file"&&(Dr=Nt[0]);var Mt=Dr.getAsFile(),cn=Mt.name.split(".").pop();re(Mt,function(Wt){if(Wt.id){var kr,Tr,Jr;(Mt==null||((kr=Mt.type)===null||kr===void 0)?void 0:kr.indexOf("image"))>-1?gt.replaceSelection("![,](/api/attachments/".concat(Wt.id,"?type=").concat(Wt.content_type,")")):(Mt==null||((Tr=Mt.type)===null||Tr===void 0)?void 0:Tr.indexOf("video"))>-1?gt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Wt.id,'"></video>')):(Mt==null||((Jr=Mt.type)===null||Jr===void 0)?void 0:Jr.indexOf("pdf"))>-1?gt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Mt.type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):ae.includes(cn)?gt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Wt.id,'?type=office&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):gt.replaceSelection("[".concat(Mt.name,"](").concat(f.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){j.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){ar.current.classList.remove("mouse-hover-md")}),gt.on("dragover",function(Et,Dt){ar.current.classList.add("mouse-hover-md")}),gt.on("drop",function(Et,Dt){ar.current.classList.add("mouse-hover-md");var Bt;if(Bt=Dt.dataTransfer.files,Bt.length>0){Dt.preventDefault(),Dt.stopPropagation();for(var Yt=function(Dr){var Mt=Bt[Dr],cn=Mt.name.split(".").pop();re(Mt,function(Wt){if(Wt.id){var kr,Tr,Jr;(Mt==null||((kr=Mt.type)===null||kr===void 0)?void 0:kr.indexOf("image"))>-1?gt.replaceSelection("![,](/api/attachments/".concat(Wt.id,"?type=").concat(Wt.content_type,")")):(Mt==null||((Tr=Mt.type)===null||Tr===void 0)?void 0:Tr.indexOf("video"))>-1?gt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Wt.id,'"></video>')):(Mt==null||((Jr=Mt.type)===null||Jr===void 0)?void 0:Jr.indexOf("pdf"))>-1?gt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Mt.type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):ae.includes(cn)?gt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Wt.id,'?type=office&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):gt.replaceSelection("[".concat(Mt.name,"](").concat(f.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)}}),ee(gt),function(){gt.off("paste",At)}}},[]);var Ar=Object(v.useCallback)(function(){if(ar.current)try{}catch(gt){console.log(gt,"---- to set md editor body height")}},[Vn,ar,Er]);Object(v.useEffect)(function(){function gt(){var Et=new h.default(function(Dt){var Bt=Object(P.a)(Dt),Yt;try{for(Bt.s();!(Yt=Bt.n()).done;){var Nt=Yt.value;(Nt.target.offsetHeight>0||Nt.target.offsetWidth>0)&&(Ar(),G.setSize("100%","100%"),G.refresh())}}catch(ur){Bt.e(ur)}finally{Bt.f()}});return Et.observe(kt.current.parentElement),Et}if(G){var At=gt();return function(){At.unobserve(kt.current.parentElement)}}},[G,Ar]),Object(v.useEffect)(function(){if(G){for(var gt=[],At=function(){var Nt=Dt[Et];Bt=Object(K.a)(Nt,2);var ur=Bt[0],Dr=Bt[1],Mt=Object(H.a)({},ur,function(){Yn(Dr)});gt.push(Mt),G.addKeyMap(Mt)},Et=0,Dt=Object.entries(ue);Et<Dt.length;Et++){var Bt;At()}return yr.current=setInterval(function(){Ht.current&&fr()},4e3),function(){clearInterval(yr.current);var Yt=Object(P.a)(gt),Nt;try{for(Yt.s();!(Nt=Yt.n()).done;){var ur=Nt.value;G.removeKeyMap(ur)}}catch(Dr){Yt.e(Dr)}finally{Yt.f()}}}},[G]),Object(v.useEffect)(function(){Jt!==Er&&xr(Jt)},[Jt]),Object(at.a)(function(){if(!tr&&Hr>0){var gt=new Date().getTime(),At=window.sessionStorage.getItem(Lr);gt>=Hr+ot&&(!At||At!==Ke)&&(window.sessionStorage.setItem(Lr,Ke),En(!0))}},ot),Object(v.useEffect)(function(){jt(Zt)},[G,Zt]),Object(v.useEffect)(function(){G&&(qt&&G.focus())},[G,qt]),Object(v.useEffect)(function(){if(_t&&G){var gt=G.getScrollerElement();function At(Et){var Dt=Et.target;if(nn.current){var Bt=Dt.scrollTop/Dt.scrollHeight;nn.current.scrollTop=nn.current.scrollHeight*Bt}}return gt.addEventListener("scroll",At),function(){gt.removeEventListener("scroll",At)}}},[G,_t]),Object(v.useEffect)(function(){if(G&&lr){function gt(At,Et){lr(At,Et)}return G.on("beforeChange",gt),function(){G.off("beforeChange",gt)}}},[G,lr]),Object(v.useEffect)(function(){if(G&&Ot){function gt(){Ot(G.getValue())}return G.on("blur",gt),function(){G.off("blur",gt)}}},[G,Ot]),Object(v.useEffect)(function(){if(G){function gt(At){var Et=At.getValue();et(Et),kn(new Date().getTime()),At.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),st&&st(Et)}return G.on("change",gt),function(){G.off("change",gt)}}},[G,st]),Object(v.useEffect)(function(){G&&(ze==null?(G.setValue(""),et("")):ze!==G.getValue()&&(G.setValue(ze),et(ze),G.setCursor(G.lineCount(),0)))},[G,ze]);var Yn=Object(v.useCallback)(function(gt){var At=G.getCursor(),Et=G.getSelection(),Dt=Et.split(`
`);switch(gt){case"bold":return G.replaceSelection("**"+Et+"**"),Et===""&&G.setCursor(At.line,At.ch+2),G.focus();case"italic":return G.replaceSelection("*"+Et+"*"),Et===""&&G.setCursor(At.line,At.ch+1),G.focus();case"code":return G.replaceSelection("`"+Et+"`"),Et===""&&G.setCursor(At.line,At.ch+1),G.focus();case"inline-latex":return G.replaceSelection("`$$"+Et+"$$`"),Et===""&&G.setCursor(At.line,At.ch+3),G.focus();case"latex":return G.replaceSelection("```latex\n"+Et+"\n```"),G.setCursor(At.line+1,Et.length+1),G.focus();case"line-break":return G.replaceSelection(`<br/>
`),G.focus();case"list-ul":return Et===""?G.replaceSelection("- "+Et):G.replaceSelection(Dt.map(function(Bt){return Bt===""?"":"- ".concat(Bt)}).join(`
`)),G.focus();case"list-ol":return Et===""?G.replaceSelection("1. "+Et):G.replaceSelection(Dt.map(function(Bt,Yt){return Bt===""?"":"".concat(Yt+1,". ").concat(Bt)}).join(`
`)),G.focus();case"add-null-ch":return Et===""&&G.setCursor(At.line,At.ch+1),G.replaceSelection(je),G.focus();case"inster-template-1":return Et===""&&G.setCursor(At.line,At.ch),G.replaceSelection(We),G.focus();case"eraser":return G.setValue(""),G.focus();case"trigger-watch":return jt(!_t),G.focus();case"trigger-full-screen":return xr(!Er),G.focus();case Ae:zr(Ae);return;case Ge:zr(Ge);return;case Ie:zr(Ie);return;case $e:zr($e);return;default:throw new Error}},[G,_t,Er]),xn=Object(v.useCallback)(function(gt){zr("");switch(dr){case Ae:var At=gt.title,Et=gt.link;return G.replaceSelection("[".concat(At,"](").concat(Et,")")),G.focus();case Ge:var Dt=gt.language,Bt=gt.content;return G.replaceSelection(["```"+Dt,Bt,"```"].join(`
`)),G.focus();case Ie:var Yt=gt.src,Nt=gt.alt;return Nt?G.replaceSelection("![ ".concat(Nt," ]( ").concat(Yt,' "').concat(Nt,'" )')):G.replaceSelection("![,](".concat(Yt,")")),G.focus();case $e:for(var ur=gt.row,Dr=gt.col,Mt=gt.align,cn=`
`,Wt=0;Wt<ur;Wt++){for(var kr=[],Tr=[],Jr=0;Jr<Dr;Jr++)Wt===1&&Tr.push(Je[Mt]),kr.push(" ");Wt===1&&(cn+="| ".concat(Tr.join(" | "),` |
`)),cn+="| ".concat(kr.join(Dr===1?"":" | "),` |
`)}return G.replaceSelection(cn+`
`),G.focus();default:throw new Error}},[G,dr]),di=Object(v.useMemo)(function(){switch(dr){case Ae:return m.a.createElement(ne,{callback:xn,onCancel:Tn});case Ge:return m.a.createElement(oe.b,{callback:xn,onCancel:Tn});case Ie:return m.a.createElement(ce,{callback:xn,onCancel:Tn});case $e:return m.a.createElement(Ue,{callback:xn,onCancel:Tn});default:return null}},[dr]);function Tn(){zr("")}Object(v.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 ur=Nt.pageY-Et;ur<0&&(ur=0),ur>300&&(ur=300);var Dr=St+ur+"px";Qr(Dr)}}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)}}},[G,Kt]),Object(v.useEffect)(function(){Qr(St)},[St]);var an=Oe(ft),fi=Oe(Vn),qr={width:an,height:fi},pi=Object(v.useMemo)(function(){if(Hr){var gt=new Date(Hr),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},[Hr]);function ji(){window.sessionStorage.removeItem(Lr),En(!1),kn(0)}function Mn(){En(!1),kn(0),G.setValue(window.sessionStorage.getItem(Lr))}function ua(gt,At){var Et=G.getValue();Et=Et.replace(gt,At),et(Et),G==null||G.setValue(Et)}return m.a.createElement(v.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:ar},m.a.createElement("div",{className:"markdown-editor-container ".concat(Xe," ").concat(_t?"on-preview":""," ").concat(Ut?"mini":""," ").concat(Er?"full-screen":""),style:qr},m.a.createElement(b,{insertTemp:It,watch:_t,fullScreen:Er,showNullButton:Pt,onActionCallback:Yn,hidetoolBar:Ur,uuid:nr.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:vn})),_t?m.a.createElement("div",{ref:nn,className:"preview-container"},Kr==="stex"&&m.a.createElement(D,{value:Ke}),Kr!=="stex"&&m.a.createElement(w.a,{edit:!0,value:Ke,replaces:ua})):null))),xt?m.a.createElement("a",{ref:Kt,className:"editor-resize"}):null,m.a.createElement(U.a,null,fe[dr]?m.a.createElement(J.a,{centered:!0,title:fe[dr],visible:!0,onCancel:Tn,footer:null,className:"markdown-popup-form"},di):null))}},SJMd:function(tt,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 Z,ie,J,P=!1,X,j;window.PR_SHOULD_USE_CONTINUATION=!0;var B,K;(function(){var H=window,r=["break,continue,do,else,for,if,return,while"],L=[r,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],v=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[v,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],p=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[v,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],h="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",d=[v,"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",l=[r,"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=[r,"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=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[m,u,p,d,o,l,s,a],E=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,w="str",D="kwd",O="com",A="typ",C="lit",T="pun",f="pln",S="tag",y="dec",b="src",U="atn",F="atv",_="nocode",M="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(Se){for(var Pe=0,Ue=!1,le=!1,ve=0,Ae=Se.length;ve<Ae;++ve){var Ie=Se[ve];if(Ie.ignoreCase)le=!0;else if(/[a-z]/i.test(Ie.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ue=!0,le=!1;break}}var Ge={b:8,t:9,n:10,v:11,f:12,r:13};function $e(it){var Be=it.charCodeAt(0);if(Be!==92)return Be;var ct=it.charAt(1);return Be=Ge[ct],Be||("0"<=ct&&ct<="7"?parseInt(it.substring(1),8):ct==="u"||ct==="x"?parseInt(it.substring(2),16):it.charCodeAt(1))}function Ze(it){if(it<32)return(it<16?"\\x0":"\\x")+it.toString(16);var Be=String.fromCharCode(it);return Be==="\\"||Be==="-"||Be==="]"||Be==="^"?"\\"+Be:Be}function Je(it){var Be=it.substring(1,it.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),ct=[],ot=Be[0]==="^",je=["["];ot&&je.push("^");for(var We=ot?1:0,Oe=Be.length;We<Oe;++We){var _e=Be[We];if(/\\[bdsw]/i.test(_e))je.push(_e);else{var Te=$e(_e),ae;We+2<Oe&&Be[We+1]==="-"?(ae=$e(Be[We+2]),We+=2):ae=Te,ct.push([Te,ae]),ae<65||Te>122||(ae<65||Te>90||ct.push([Math.max(65,Te)|32,Math.min(ae,90)|32]),ae<97||Te>122||ct.push([Math.max(97,Te)&~32,Math.min(ae,122)&~32]))}}ct.sort(function(Ce,Fe){return Ce[0]-Fe[0]||Fe[1]-Ce[1]});for(var ue=[],fe=[],We=0;We<ct.length;++We){var me=ct[We];me[0]<=fe[1]+1?fe[1]=Math.max(fe[1],me[1]):ue.push(fe=me)}for(var We=0;We<ue.length;++We){var me=ue[We];je.push(Ze(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&je.push("-"),je.push(Ze(me[1])))}return je.push("]"),je.join("")}function at(it){for(var Be=it.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),ct=Be.length,ot=[],je=0,We=0;je<ct;++je){var Oe=Be[je];if(Oe==="(")++We;else if(Oe.charAt(0)==="\\"){var _e=+Oe.substring(1);_e&&(_e<=We?ot[_e]=-1:Be[je]=Ze(_e))}}for(var je=1;je<ot.length;++je)ot[je]===-1&&(ot[je]=++Pe);for(var je=0,We=0;je<ct;++je){var Oe=Be[je];if(Oe==="(")++We,ot[We]||(Be[je]="(?:");else if(Oe.charAt(0)==="\\"){var _e=+Oe.substring(1);_e&&_e<=We&&(Be[je]="\\"+ot[_e])}}for(var je=0;je<ct;++je)Be[je]==="^"&&Be[je+1]!=="^"&&(Be[je]="");if(it.ignoreCase&&Ue)for(var je=0;je<ct;++je){var Oe=Be[je],Te=Oe.charAt(0);Oe.length>=2&&Te==="["?Be[je]=Je(Oe):Te!=="\\"&&(Be[je]=Oe.replace(/[a-zA-Z]/g,function(fe){var me=fe.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return Be.join("")}for(var qe=[],ve=0,Ae=Se.length;ve<Ae;++ve){var Ie=Se[ve];if(Ie.global||Ie.multiline)throw new Error(""+Ie);qe.push("(?:"+at(Ie)+")")}return new RegExp(qe.join("|"),le?"gi":"g")}function g(Se,Pe){var Ue=/(?:^|\s)nocode(?:\s|$)/,le=[],ve=0,Ae=[],Ie=0;function Ge($e){var Ze=$e.nodeType;if(Ze==1){if(Ue.test($e.className))return;for(var Je=$e.firstChild;Je;Je=Je.nextSibling)Ge(Je);var at=$e.nodeName.toLowerCase();(at==="br"||at==="li")&&(le[Ie]=`
`,Ae[Ie<<1]=ve++,Ae[Ie++<<1|1]=$e)}else if(Ze==3||Ze==4){var qe=$e.nodeValue;qe.length&&(Pe?qe=qe.replace(/\r\n?/g,`
`):qe=qe.replace(/[ \t\r\n]+/g," "),le[Ie]=qe,Ae[Ie<<1]=ve,ve+=qe.length,Ae[Ie++<<1|1]=$e)}}return Ge(Se),{sourceCode:le.join("").replace(/\n$/,""),spans:Ae}}function W(Se,Pe,Ue,le,ve){if(!Ue)return;var Ae={sourceNode:Se,pre:1,langExtension:null,numberLines:null,sourceCode:Ue,spans:null,basePos:Pe,decorations:null};le(Ae),ve.push.apply(ve,Ae.decorations)}var $=/\S/;function ne(Se){for(var Pe=void 0,Ue=Se.firstChild;Ue;Ue=Ue.nextSibling){var le=Ue.nodeType;Pe=le===1?Pe?Se:Ue:le===3&&$.test(Ue.nodeValue)?Se:Pe}return Pe===Se?void 0:Pe}function oe(Se,Pe){var Ue={},le;(function(){for(var Ie=Se.concat(Pe),Ge=[],$e={},Ze=0,Je=Ie.length;Ze<Je;++Ze){var at=Ie[Ze],qe=at[3];if(qe)for(var it=qe.length;--it>=0;)Ue[qe.charAt(it)]=at;var Be=at[1],ct=""+Be;$e.hasOwnProperty(ct)||(Ge.push(Be),$e[ct]=null)}Ge.push(/[\0-\uffff]/),le=I(Ge)})();var ve=Pe.length,Ae=function(Ie){for(var Ge=Ie.sourceCode,$e=Ie.basePos,Ze=Ie.sourceNode,Je=[$e,f],at=0,qe=Ge.match(le)||[],it={},Be=0,ct=qe.length;Be<ct;++Be){var ot=qe[Be],je=it[ot],We=void 0,Oe;if(typeof je=="string")Oe=!1;else{var _e=Ue[ot.charAt(0)];if(_e)We=ot.match(_e[1]),je=_e[0];else{for(var Te=0;Te<ve;++Te)if(_e=Pe[Te],We=ot.match(_e[1]),We){je=_e[0];break}We||(je=f)}Oe=je.length>=5&&je.substring(0,5)==="lang-",Oe&&!(We&&typeof We[1]=="string")&&(Oe=!1,je=b),Oe||(it[ot]=je)}var ae=at;if(at+=ot.length,!Oe)Je.push($e+ae,je);else{var ue=We[1],fe=ot.indexOf(ue),me=fe+ue.length;We[2]&&(me=ot.length-We[2].length,fe=me-ue.length);var Ce=je.substring(5);W(Ze,$e+ae,ot.substring(0,fe),Ae,Je),W(Ze,$e+ae+fe,ue,he(Ce,ue),Je),W(Ze,$e+ae+me,ot.substring(me),Ae,Je)}}Ie.decorations=Je};return Ae}function we(Se){var Pe=[],Ue=[];Se.tripleQuotedStrings?Pe.push([w,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Se.multiLineStrings?Pe.push([w,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Pe.push([w,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Se.verbatimStrings&&Ue.push([w,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var le=Se.hashComments;le&&(Se.cStyleComments?(le>1?Pe.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Pe.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ue.push([w,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Pe.push([O,/^#[^\r\n]*/,null,"#"])),Se.cStyleComments&&(Ue.push([O,/^\/\/[^\r\n]*/,null]),Ue.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ve=Se.regexLiterals;if(ve){var Ae=ve>1?"":`
\r`,Ie=Ae?".":"[\\S\\s]",Ge="/(?=[^/*"+Ae+"])(?:[^/\\x5B\\x5C"+Ae+"]|\\x5C"+Ie+"|\\x5B(?:[^\\x5C\\x5D"+Ae+"]|\\x5C"+Ie+")*(?:\\x5D|$))+/";Ue.push(["lang-regex",RegExp("^"+M+"("+Ge+")")])}var $e=Se.types;$e&&Ue.push([A,$e]);var Ze=(""+Se.keywords).replace(/^ | $/g,"");Ze.length&&Ue.push([D,new RegExp("^(?:"+Ze.replace(/[\s,]+/g,"|")+")\\b"),null]),Pe.push([f,/^\s+/,null,` \r
\xA0`]);var Je="^.[^\\s\\w.$@'\"`/\\\\]*";return Se.regexLiterals&&(Je+="(?!s*/)"),Ue.push([C,/^@[a-z_$][a-z_$@0-9]*/i,null],[A,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[C,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[T,new RegExp(Je),null]),oe(Pe,Ue)}var ge=we({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function xe(Se,Pe,Ue){for(var le=/(?:^|\s)nocode(?:\s|$)/,ve=/\r\n?|\n/,Ae=Se.ownerDocument,Ie=Ae.createElement("li");Se.firstChild;)Ie.appendChild(Se.firstChild);var Ge=[Ie];function $e(Be){var ct=Be.nodeType;if(ct==1&&!le.test(Be.className))if(Be.nodeName==="br")Ze(Be),Be.parentNode&&Be.parentNode.removeChild(Be);else for(var ot=Be.firstChild;ot;ot=ot.nextSibling)$e(ot);else if((ct==3||ct==4)&&Ue){var je=Be.nodeValue,We=je.match(ve);if(We){var Oe=je.substring(0,We.index);Be.nodeValue=Oe;var _e=je.substring(We.index+We[0].length);if(_e){var Te=Be.parentNode;Te.insertBefore(Ae.createTextNode(_e),Be.nextSibling)}Ze(Be),Oe||Be.parentNode.removeChild(Be)}}}function Ze(Be){for(;!Be.nextSibling;)if(Be=Be.parentNode,!Be)return;function ct(We,Oe){var _e=Oe?We.cloneNode(!1):We,Te=We.parentNode;if(Te){var ae=ct(Te,1),ue=We.nextSibling;ae.appendChild(_e);for(var fe=ue;fe;fe=ue)ue=fe.nextSibling,ae.appendChild(fe)}return _e}for(var ot=ct(Be.nextSibling,0),je;(je=ot.parentNode)&&je.nodeType===1;)ot=je;Ge.push(ot)}for(var Je=0;Je<Ge.length;++Je)$e(Ge[Je]);Pe===(Pe|0)&&Ge[0].setAttribute("value",Pe);var at=Ae.createElement("ol");at.className="linenums";for(var qe=Math.max(0,Pe-1|0)||0,Je=0,it=Ge.length;Je<it;++Je)Ie=Ge[Je],Ie.className="L"+(Je+qe)%10,Ie.firstChild||Ie.appendChild(Ae.createTextNode("\xA0")),at.appendChild(Ie);Se.appendChild(at)}function Re(Se){var Pe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Pe=Pe&&+Pe[1]<=8;var Ue=/\n/g,le=Se.sourceCode,ve=le.length,Ae=0,Ie=Se.spans,Ge=Ie.length,$e=0,Ze=Se.decorations,Je=Ze.length,at=0;Ze[Je]=ve;var qe,it;for(it=qe=0;it<Je;)Ze[it]!==Ze[it+2]?(Ze[qe++]=Ze[it++],Ze[qe++]=Ze[it++]):it+=2;for(Je=qe,it=qe=0;it<Je;){for(var Be=Ze[it],ct=Ze[it+1],ot=it+2;ot+2<=Je&&Ze[ot+1]===ct;)ot+=2;Ze[qe++]=Be,Ze[qe++]=ct,it=ot}Je=Ze.length=qe;var je=Se.sourceNode,We="";je&&(We=je.style.display,je.style.display="none");try{for(var Oe=null;$e<Ge;){var _e=Ie[$e],Te=Ie[$e+2]||ve,ae=Ze[at+2]||ve,ot=Math.min(Te,ae),ue=Ie[$e+1],fe;if(ue.nodeType!==1&&(fe=le.substring(Ae,ot))){Pe&&(fe=fe.replace(Ue,"\r")),ue.nodeValue=fe;var me=ue.ownerDocument,Ce=me.createElement("span");Ce.className=Ze[at+1];var Fe=ue.parentNode;Fe.replaceChild(Ce,ue),Ce.appendChild(ue),Ae<Te&&(Ie[$e+1]=ue=me.createTextNode(le.substring(ot,Te)),Fe.insertBefore(ue,Ce.nextSibling))}Ae=ot,Ae>=Te&&($e+=2),Ae>=ae&&(at+=2)}}finally{je&&(je.style.display=We)}}var Le={};function ce(Se,Pe){for(var Ue=Pe.length;--Ue>=0;){var le=Pe[Ue];Le.hasOwnProperty(le)?H.console&&console.warn("cannot override language handler %s",le):Le[le]=Se}}function he(Se,Pe){return Se&&Le.hasOwnProperty(Se)||(Se=/^\s*</.test(Pe)?"default-markup":"default-code"),Le[Se]}ce(ge,["default-code"]),ce(oe([],[[f,/^[^<?]+/],[y,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[T,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ce(oe([[f,/^[\s]+/,null,` \r
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[S,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[U,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[T,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ce(oe([],[[F,/^[\s\S]+/]]),["uq.val"]),ce(we({keywords:m,hashComments:!0,cStyleComments:!0,types:E}),["c","cc","cpp","cxx","cyc","m"]),ce(we({keywords:"null,true,false"}),["json"]),ce(we({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:E}),["cs"]),ce(we({keywords:p,cStyleComments:!0}),["java"]),ce(we({keywords:a,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ce(we({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ce(we({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ce(we({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ce(we({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ce(we({keywords:h,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ce(oe([],[[w,/^[\s\S]+/]]),["regex"]);function re(Se){var Pe=Se.langExtension;try{var Ue=g(Se.sourceNode,Se.pre),le=Ue.sourceCode;Se.sourceCode=le,Se.spans=Ue.spans,Se.basePos=0,he(Pe,le)(Se),Re(Se)}catch(ve){H.console&&console.log(ve&&ve.stack||ve)}}function de(Se,Pe,Ue){var le=Ue||!1,ve=Pe||null,Ae=document.createElement("div");Ae.innerHTML="<pre>"+Se+"</pre>",Ae=Ae.firstChild,le&&xe(Ae,le,!0);var Ie={langExtension:ve,numberLines:le,sourceNode:Ae,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return re(Ie),Ae.innerHTML}function se(Se,Pe){var Ue=Pe||document.body,le=Ue.ownerDocument||document;function ve(_e){return Ue.getElementsByTagName(_e)}for(var Ae=[ve("pre"),ve("code"),ve("xmp")],Ie=[],Ge=0;Ge<Ae.length;++Ge)for(var $e=0,Ze=Ae[Ge].length;$e<Ze;++$e)Ie.push(Ae[Ge][$e]);Ae=null;var Je=Date;Je.now||(Je={now:function(){return+new Date}});var at=0,qe=/\blang(?:uage)?-([\w.]+)(?!\S)/,it=/\bprettyprint\b/,Be=/\bprettyprinted\b/,ct=/pre|xmp/i,ot=/^code$/i,je=/^(?:pre|code|xmp)$/i,We={};function Oe(){for(var _e=H.PR_SHOULD_USE_CONTINUATION?Je.now()+250:Infinity;at<Ie.length&&Je.now()<_e;at++){for(var Te=Ie[at],ae=We,ue=Te;ue=ue.previousSibling;){var fe=ue.nodeType,me=(fe===7||fe===8)&&ue.nodeValue;if(me?!/^\??prettify\b/.test(me):fe!==3||/\S/.test(ue.nodeValue))break;if(me){ae={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Zt,It,Cr){ae[It]=Cr});break}}var Ce=Te.className;if((ae!==We||it.test(Ce))&&!Be.test(Ce)){for(var Fe=!1,ze=Te.parentNode;ze;ze=ze.parentNode){var st=ze.tagName;if(je.test(st)&&ze.className&&it.test(ze.className)){Fe=!0;break}}if(!Fe){Te.className+=" prettyprinted";var mt=ae.lang;if(!mt){mt=Ce.match(qe);var ft;!mt&&(ft=ne(Te))&&ot.test(ft.tagName)&&(mt=ft.className.match(qe)),mt&&(mt=mt[1])}var wt;if(ct.test(Te.tagName))wt=1;else{var St=Te.currentStyle,ht=le.defaultView,Ut=St?St.whiteSpace:ht&&ht.getComputedStyle?ht.getComputedStyle(Te,null).getPropertyValue("white-space"):0;wt=Ut&&Ut.substring(0,3)==="pre"}var Lt=ae.linenums;(Lt=Lt==="true"||+Lt)||(Lt=Ce.match(/\blinenums\b(?::(\d+))?/),Lt=Lt?Lt[1]&&Lt[1].length?+Lt[1]:!0:!1),Lt&&xe(Te,Lt,wt);var qt={langExtension:mt,sourceNode:Te,numberLines:Lt,pre:wt,sourceCode:null,basePos:null,spans:null,decorations:null};re(qt)}}}at<Ie.length?H.setTimeout(Oe,250):typeof Se=="function"&&Se()}Oe()}var De=H.PR={createSimpleLexer:oe,registerLangHandler:ce,sourceDecorator:we,PR_ATTRIB_NAME:U,PR_ATTRIB_VALUE:F,PR_COMMENT:O,PR_DECLARATION:y,PR_KEYWORD:D,PR_LITERAL:C,PR_NOCODE:_,PR_PLAIN:f,PR_PUNCTUATION:T,PR_SOURCE:b,PR_STRING:w,PR_TAG:S,PR_TYPE:A,prettyPrintOne:P?H.prettyPrintOne=de:B=de,prettyPrint:K=P?H.prettyPrint=se:K=se},Ne=H.define;typeof Ne=="function"&&Ne.amd&&Ne("google-code-prettify",[],function(){return De})})()},T8No:function(tt,be,Z){"use strict";Z.d(be,"a",function(){return K}),Z.d(be,"e",function(){return H}),Z.d(be,"c",function(){return T}),Z.d(be,"b",function(){return f}),Z.d(be,"d",function(){return S}),Z.d(be,"f",function(){return U});var ie=Z("MNsG"),J=Z("N0LK"),P=Z("Cg/j");let X=ie.k||"";const j=new Map;j.set("false",!1),j.set("true",!0),j.set("isMac",ie.f),j.set("isLinux",ie.d),j.set("isWindows",ie.i),j.set("isWeb",ie.h),j.set("isMacNative",ie.f&&!ie.h),j.set("isEdge",X.indexOf("Edg/")>=0),j.set("isFirefox",X.indexOf("Firefox")>=0),j.set("isChrome",X.indexOf("Chrome")>=0),j.set("isSafari",X.indexOf("Safari")>=0);const B=Object.prototype.hasOwnProperty;class K{static has(_){return m.create(_)}static equals(_,M){return p.create(_,M)}static regex(_,M){return w.create(_,M)}static not(_){return o.create(_)}static and(..._){return A.create(_,null)}static or(..._){return C.create(_,null,!0)}static deserialize(_,M=!1){return _?this._deserializeOrExpression(_,M):void 0}static _deserializeOrExpression(_,M){let I=_.split("||");return C.create(I.map(g=>this._deserializeAndExpression(g,M)),null,!0)}static _deserializeAndExpression(_,M){let I=_.split("&&");return A.create(I.map(g=>this._deserializeOne(g,M)),null)}static _deserializeOne(_,M){if(_=_.trim(),_.indexOf("!=")>=0){let I=_.split("!=");return d.create(I[0].trim(),this._deserializeValue(I[1],M))}if(_.indexOf("==")>=0){let I=_.split("==");return p.create(I[0].trim(),this._deserializeValue(I[1],M))}if(_.indexOf("=~")>=0){let I=_.split("=~");return w.create(I[0].trim(),this._deserializeRegexValue(I[1],M))}if(_.indexOf(" in ")>=0){let I=_.split(" in ");return u.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(_)){const I=_.split(">=");return a.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(_)){const I=_.split(">");return s.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(_)){const I=_.split("<=");return E.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(_)){const I=_.split("<");return R.create(I[0].trim(),I[1].trim())}return/^\!\s*/.test(_)?o.create(_.substr(1).trim()):m.create(_)}static _deserializeValue(_,M){if(_=_.trim(),_==="true")return!0;if(_==="false")return!1;let I=/^'([^']*)'$/.exec(_);return I?I[1].trim():_}static _deserializeRegexValue(_,M){if(Object(J.C)(_)){if(M)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let I=_.indexOf("/"),g=_.lastIndexOf("/");if(I===g||I<0){if(M)throw new Error(`bad regexp-value '${_}', missing /-enclosure`);return console.warn(`bad regexp-value '${_}', missing /-enclosure`),null}let W=_.slice(I+1,g),$=_[g+1]==="i"?"i":"";try{return new RegExp(W,$)}catch(ne){if(M)throw new Error(`bad regexp-value '${_}', parse error: ${ne}`);return console.warn(`bad regexp-value '${_}', parse error: ${ne}`),null}}}function H(_,M){const I=_?_.substituteConstants():void 0,g=M?M.substituteConstants():void 0;return!I&&!g?!0:!I||!g?!1:I.equals(g)}function r(_,M){return _.cmp(M)}class L{constructor(){this.type=0}cmp(_){return this.type-_.type}equals(_){return _.type===this.type}substituteConstants(){return this}evaluate(_){return!1}serialize(){return"false"}keys(){return[]}negate(){return v.INSTANCE}}L.INSTANCE=new L;class v{constructor(){this.type=1}cmp(_){return this.type-_.type}equals(_){return _.type===this.type}substituteConstants(){return this}evaluate(_){return!0}serialize(){return"true"}keys(){return[]}negate(){return L.INSTANCE}}v.INSTANCE=new v;class m{constructor(_,M){this.key=_,this.negated=M,this.type=2}static create(_,M=null){const I=j.get(_);return typeof I=="boolean"?I?v.INSTANCE:L.INSTANCE:new m(_,M)}cmp(_){return _.type!==this.type?this.type-_.type:y(this.key,_.key)}equals(_){return _.type===this.type?this.key===_.key:!1}substituteConstants(){const _=j.get(this.key);return typeof _=="boolean"?_?v.INSTANCE:L.INSTANCE:this}evaluate(_){return!!_.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(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=4}static create(_,M,I=null){if(typeof M=="boolean")return M?m.create(_,I):o.create(_,I);const g=j.get(_);if(typeof g=="boolean"){const W=g?"true":"false";return M===W?v.INSTANCE:L.INSTANCE}return new p(_,M,I)}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){const _=j.get(this.key);if(typeof _=="boolean"){const M=_?"true":"false";return this.value===M?v.INSTANCE:L.INSTANCE}return this}evaluate(_){return _.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class u{constructor(_,M){this.key=_,this.valueKey=M,this.type=10,this.negated=null}static create(_,M){return new u(_,M)}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.valueKey,_.key,_.valueKey)}equals(_){return _.type===this.type?this.key===_.key&&this.valueKey===_.valueKey:!1}substituteConstants(){return this}evaluate(_){const M=_.getValue(this.valueKey),I=_.getValue(this.key);return Array.isArray(M)?M.indexOf(I)>=0:typeof I=="string"&&typeof M=="object"&&M!==null?B.call(M,I):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=h.create(this)),this.negated}}class h{constructor(_){this._actual=_,this.type=11}static create(_){return new h(_)}cmp(_){return _.type!==this.type?this.type-_.type:this._actual.cmp(_._actual)}equals(_){return _.type===this.type?this._actual.equals(_._actual):!1}substituteConstants(){return this}evaluate(_){return!this._actual.evaluate(_)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class d{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=5}static create(_,M,I=null){if(typeof M=="boolean")return M?o.create(_,I):m.create(_,I);const g=j.get(_);if(typeof g=="boolean"){const W=g?"true":"false";return M===W?L.INSTANCE:v.INSTANCE}return new d(_,M,I)}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){const _=j.get(this.key);if(typeof _=="boolean"){const M=_?"true":"false";return this.value===M?L.INSTANCE:v.INSTANCE}return this}evaluate(_){return _.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(_,M){this.key=_,this.negated=M,this.type=3}static create(_,M=null){const I=j.get(_);return typeof I=="boolean"?I?L.INSTANCE:v.INSTANCE:new o(_,M)}cmp(_){return _.type!==this.type?this.type-_.type:y(this.key,_.key)}equals(_){return _.type===this.type?this.key===_.key:!1}substituteConstants(){const _=j.get(this.key);return typeof _=="boolean"?_?L.INSTANCE:v.INSTANCE:this}evaluate(_){return!_.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 l(_,M){if(typeof _=="string"){const I=parseFloat(_);isNaN(I)||(_=I)}return typeof _=="string"||typeof _=="number"?M(_):L.INSTANCE}class s{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=12}static create(_,M,I=null){return l(M,g=>new s(_,g,I))}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class a{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=13}static create(_,M,I=null){return l(M,g=>new a(_,g,I))}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this.key,this.value,this)),this.negated}}class R{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=14}static create(_,M,I=null){return l(M,g=>new R(_,g,I))}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.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 E{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=15}static create(_,M,I=null){return l(M,g=>new E(_,g,I))}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.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 w{constructor(_,M){this.key=_,this.regexp=M,this.type=7,this.negated=null}static create(_,M){return new w(_,M)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.key<_.key)return-1;if(this.key>_.key)return 1;const M=this.regexp?this.regexp.source:"",I=_.regexp?_.regexp.source:"";return M<I?-1:M>I?1:0}equals(_){if(_.type===this.type){const M=this.regexp?this.regexp.source:"",I=_.regexp?_.regexp.source:"";return this.key===_.key&&M===I}return!1}substituteConstants(){return this}evaluate(_){let M=_.getValue(this.key);return this.regexp?this.regexp.test(M):!1}serialize(){const _=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${_}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this)),this.negated}}class D{constructor(_){this._actual=_,this.type=8}static create(_){return new D(_)}cmp(_){return _.type!==this.type?this.type-_.type:this._actual.cmp(_._actual)}equals(_){return _.type===this.type?this._actual.equals(_._actual):!1}substituteConstants(){return this}evaluate(_){return!this._actual.evaluate(_)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(_){let M=null;for(let I=0,g=_.length;I<g;I++){const W=_[I].substituteConstants();if(_[I]!==W&&M===null){M=[];for(let $=0;$<I;$++)M[$]=_[$]}M!==null&&(M[I]=W)}return M===null?_:M}class A{constructor(_,M){this.expr=_,this.negated=M,this.type=6}static create(_,M){return A._normalizeArr(_,M)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.expr.length<_.expr.length)return-1;if(this.expr.length>_.expr.length)return 1;for(let M=0,I=this.expr.length;M<I;M++){const g=r(this.expr[M],_.expr[M]);if(g!==0)return g}return 0}equals(_){if(_.type===this.type){if(this.expr.length!==_.expr.length)return!1;for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].equals(_.expr[M]))return!1;return!0}return!1}substituteConstants(){const _=O(this.expr);return _===this.expr?this:A.create(_,this.negated)}evaluate(_){for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].evaluate(_))return!1;return!0}static _normalizeArr(_,M){const I=[];let g=!1;for(const W of _){if(!W)continue;if(W.type===1){g=!0;continue}if(W.type===0)return L.INSTANCE;if(W.type===6){I.push(...W.expr);continue}I.push(W)}if(I.length===0&&g)return v.INSTANCE;if(I.length===0)return;if(I.length===1)return I[0];I.sort(r);for(let W=1;W<I.length;W++)I[W-1].equals(I[W])&&(I.splice(W,1),W--);if(I.length===1)return I[0];for(;I.length>1;){const W=I[I.length-1];if(W.type!==9)break;I.pop();const $=I.pop(),ne=I.length===0,oe=C.create(W.expr.map(we=>A.create([we,$],null)),null,ne);oe&&(I.push(oe),I.sort(r))}return I.length===1?I[0]:new A(I,M)}serialize(){return this.expr.map(_=>_.serialize()).join(" && ")}keys(){const _=[];for(let M of this.expr)_.push(...M.keys());return _}negate(){if(!this.negated){const _=[];for(let M of this.expr)_.push(M.negate());this.negated=C.create(_,this,!0)}return this.negated}}class C{constructor(_,M){this.expr=_,this.negated=M,this.type=9}static create(_,M,I){return C._normalizeArr(_,M,I)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.expr.length<_.expr.length)return-1;if(this.expr.length>_.expr.length)return 1;for(let M=0,I=this.expr.length;M<I;M++){const g=r(this.expr[M],_.expr[M]);if(g!==0)return g}return 0}equals(_){if(_.type===this.type){if(this.expr.length!==_.expr.length)return!1;for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].equals(_.expr[M]))return!1;return!0}return!1}substituteConstants(){const _=O(this.expr);return _===this.expr?this:C.create(_,this.negated,!1)}evaluate(_){for(let M=0,I=this.expr.length;M<I;M++)if(this.expr[M].evaluate(_))return!0;return!1}static _normalizeArr(_,M,I){let g=[],W=!1;if(_){for(let $=0,ne=_.length;$<ne;$++){const oe=_[$];if(!oe)continue;if(oe.type===0){W=!0;continue}if(oe.type===1)return v.INSTANCE;if(oe.type===9){g=g.concat(oe.expr);continue}g.push(oe)}if(g.length===0&&W)return L.INSTANCE;g.sort(r)}if(g.length===0)return;if(g.length===1)return g[0];for(let $=1;$<g.length;$++)g[$-1].equals(g[$])&&(g.splice($,1),$--);if(g.length===1)return g[0];if(I){for(let $=0;$<g.length;$++)for(let ne=$+1;ne<g.length;ne++)U(g[$],g[ne])&&(g.splice(ne,1),ne--);if(g.length===1)return g[0]}return new C(g,M)}serialize(){return this.expr.map(_=>_.serialize()).join(" || ")}keys(){const _=[];for(let M of this.expr)_.push(...M.keys());return _}negate(){if(!this.negated){let _=[];for(let M of this.expr)_.push(M.negate());for(;_.length>1;){const M=_.shift(),I=_.shift(),g=[];for(const $ of F(M))for(const ne of F(I))g.push(A.create([$,ne],null));const W=_.length===0;_.unshift(C.create(g,null,W))}this.negated=_[0]}return this.negated}}class T extends m{constructor(_,M,I){super(_,null);this._defaultValue=M,typeof I=="object"?T._info.push(Object.assign(Object.assign({},I),{key:_})):I!==!0&&T._info.push({key:_,description:I,type:M!=null?typeof M:void 0})}static all(){return T._info.values()}bindTo(_){return _.createKey(this.key,this._defaultValue)}getValue(_){return _.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(_){return p.create(this.key,_)}}T._info=[];const f=Object(P.c)("contextKeyService"),S="setContext";function y(_,M){return _<M?-1:_>M?1:0}function b(_,M,I,g){return _<I?-1:_>I?1:M<g?-1:M>g?1:0}function U(_,M){if(M.type===6&&_.type!==9&&_.type!==6){for(const W of M.expr)if(_.equals(W))return!0}const I=_.negate(),g=F(I).concat(F(M));g.sort(r);for(let W=0;W<g.length;W++){const $=g[W],ne=$.negate();for(let oe=W+1;oe<g.length;oe++){const we=g[oe];if(ne.equals(we))return!0}}return!1}function F(_){return _.type===9?_.expr:[_]}},TXwP:function(tt,be,Z){var ie,J;(function(){var P;(function(){"use strict";var j=[,,function(r){function L(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=[]}L.prototype.clone_empty=function(){var p=new L(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},L.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},L.prototype.has_match=function(p){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(p))return!0;return!1},L.prototype.set_indent=function(p,u){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},L.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)},L.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},L.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},L.prototype.is_empty=function(){return this.__items.length===0},L.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},L.prototype.push=function(p){this.__items.push(p);var u=p.lastIndexOf(`
`);u!==-1?this.__character_count=p.length-u:this.__character_count+=p.length},L.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},L.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},L.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},L.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},L.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 v(p,u){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)),u=u||"",p.indent_level>0&&(u=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}v.prototype.get_indent_size=function(p,u){var h=this.__base_string_length;return u=u||0,p<0&&(h=0),h+=p*this.__indent_size,h+=u,h},v.prototype.get_indent_string=function(p,u){var h=this.__base_string;return u=u||0,p<0&&(p=0,h=""),u+=p*this.__indent_size,this.__ensure_cache(u),h+=this.__cache[u],h},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,u=0,h="";this.__indent_size&&p>=this.__indent_size&&(u=Math.floor(p/this.__indent_size),p-=u*this.__indent_size,h=new Array(u+1).join(this.__indent_string)),p&&(h+=new Array(p+1).join(" ")),this.__cache.push(h)};function m(p,u){this.__indent_cache=new v(p,u),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 L(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,u){return this.__indent_cache.get_indent_string(p,u)},m.prototype.get_indent_size=function(p,u){return this.__indent_cache.get_indent_size(p,u)},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 u=this.current_line.pop();u&&(u[u.length-1]===`
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var h=this.__lines.join(`
`);return p!==`
`&&(h=h.replace(/[\n]/g,p)),h},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,u){return p=p||0,u=u||0,this.next_line.set_indent(p,u),this.__lines.length>1?(this.current_line.set_indent(p,u),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var u=0;u<p.newlines;u++)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 u=this.__lines.length;p<u;)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,u){for(var h=this.__lines.length-2;h>=0;){var d=this.__lines[h];if(d.is_empty())break;if(d.item(0).indexOf(p)!==0&&d.item(-1)!==u){this.__lines.splice(h+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}h--}},r.exports.Output=m},,,,function(r){function L(p,u){this.raw_options=v(p,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}L.prototype._get_array=function(p,u){var h=this.raw_options[p],d=u||[];return typeof h=="object"?h!==null&&typeof h.concat=="function"&&(d=h.concat()):typeof h=="string"&&(d=h.split(/[^a-zA-Z0-9_\/\-]+/)),d},L.prototype._get_boolean=function(p,u){var h=this.raw_options[p],d=h===void 0?!!u:!!h;return d},L.prototype._get_characters=function(p,u){var h=this.raw_options[p],d=u||"";return typeof h=="string"&&(d=h.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),d},L.prototype._get_number=function(p,u){var h=this.raw_options[p];u=parseInt(u,10),isNaN(u)&&(u=0);var d=parseInt(h,10);return isNaN(d)&&(d=u),d},L.prototype._get_selection=function(p,u,h){var d=this._get_selection_list(p,u,h);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+u+`
You passed in: '`+this.raw_options[p]+"'");return d[0]},L.prototype._get_selection_list=function(p,u,h){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(h=h||[u[0]],!this._is_valid_selection(h,u))throw new Error("Invalid Default Value!");var d=this._get_array(p,h);if(!this._is_valid_selection(d,u))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+u+`
You passed in: '`+this.raw_options[p]+"'");return d},L.prototype._is_valid_selection=function(p,u){return p.length&&u.length&&!p.some(function(h){return u.indexOf(h)===-1})};function v(p,u){var h={};p=m(p);var d;for(d in p)d!==u&&(h[d]=p[d]);if(u&&p[u])for(d in p[u])h[d]=p[u][d];return h}function m(p){var u={},h;for(h in p){var d=h.replace(/-/g,"_");u[d]=p[h]}return u}r.exports.Options=L,r.exports.normalizeOpts=m,r.exports.mergeOpts=v},,function(r){var L=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},v.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},v.prototype.__match=function(m,p){m.lastIndex=p;var u=m.exec(this.__input);return u&&!(L&&m.sticky)&&(u.index!==p&&(u=null)),u},v.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},v.prototype.testChar=function(m,p){var u=this.peek(p);return m.lastIndex=0,u!==null&&m.test(u)},v.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(m,p,u){var h="",d;return m&&(d=this.match(m),d&&(h+=d[0])),p&&(d||!m)&&(h+=this.readUntil(p,u)),h},v.prototype.readUntil=function(m,p){var u="",h=this.__position;m.lastIndex=this.__position;var d=m.exec(this.__input);return d?(h=d.index,p&&(h+=d[0].length)):h=this.__input_length,u=this.__input.substring(this.__position,h),this.__position=h,u},v.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},v.prototype.get_regexp=function(m,p){var u=null,h="g";return p&&L&&(h="y"),typeof m=="string"&&m!==""?u=new RegExp(m,h):m&&(u=new RegExp(m.source,h)),u},v.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(m){var p=this.__position,u=this.readUntilAfter(m);return this.__position=p,u},v.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},r.exports.InputScanner=v},,,,,function(r){function L(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}L.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(v);return m},L.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=L},,function(r,L,v){var m=v(16).Beautifier,p=v(17).Options;function u(h,d){var o=new m(h,d);return o.beautify()}r.exports=u,r.exports.defaultOptions=function(){return new p}},function(r,L,v){var m=v(17).Options,p=v(2).Output,u=v(8).InputScanner,h=v(13).Directives,d=new h(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,s=/\s/,a=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,E=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function w(D,O){this._source_text=D||"",this._options=new m(O),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}w.prototype.eatString=function(D){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(D.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return O},w.prototype.eatWhitespace=function(D){for(var O=s.test(this._input.peek()),A=0;s.test(this._input.peek());)this._ch=this._input.next(),D&&this._ch===`
`&&((A===0||A<this._options.max_preserve_newlines)&&(A++,this._output.add_new_line(!0)));return O},w.prototype.foundNestedPseudoClass=function(){for(var D=0,O=1,A=this._input.peek(O);A;){if(A==="{")return!0;if(A==="(")D+=1;else if(A===")"){if(D===0)return!1;D-=1}else if(A===";"||A==="}")return!1;O++,A=this._input.peek(O)}return!1},w.prototype.print_string=function(D){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(D)},w.prototype.preserveSingleSpace=function(D){D&&(this._output.space_before_token=!0)},w.prototype.indent=function(){this._indentLevel++},w.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var D=this._source_text,O=this._options.eol;O==="auto"&&(O=`
`,D&&o.test(D||"")&&(O=D.match(o)[0])),D=D.replace(l,`
`);var A=D.match(/^[\t ]*/)[0];this._output=new p(this._options,A),this._input=new u(D),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var C=0,T=!1,f=!1,S=!1,y=!1,b=!1,U=!1,F=this._ch,_=!1,M,I,g;M=this._input.read(a),I=M!=="",g=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var W=this._input.read(R),$=d.get_directives(W);$&&$.ignore==="start"&&(W+=d.readIgnored(this._input)),this.print_string(W),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(E)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(I),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ne=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ne.match(/[ :]$/)&&(ne=this.eatString(": ").replace(/\s$/,""),this.print_string(ne),this._output.space_before_token=!0),ne=ne.replace(/\s$/,""),ne==="extend"?y=!0:ne==="import"&&(b=!0),ne in this.NESTED_AT_RULE?(this._nestedLevel+=1,ne in this.CONDITIONAL_GROUP_RULE&&(S=!0)):!T&&C===0&&ne.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(I),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),S?(S=!1,T=this._indentLevel>=this._nestedLevel):T=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&T&&(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)):(g==="("?this._output.space_before_token=!1:g!==","&&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(),g==="{"&&this._output.trim(!0),b=!1,y=!1,f&&(this.outdent(),f=!1),this.print_string(this._ch),T=!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 oe=0;oe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;oe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[oe])){_=!0;break}(T||S)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!y&&C===0?(this.print_string(":"),f||(f=!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 we=g==='"'||g==="'";this.preserveSingleSpace(we||I),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")_=!1,C===0?(f&&(this.outdent(),f=!1),y=!1,b=!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(),C++,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(")")),C&&(C--,this.outdent()));else{var ge=!1;this._input.lookBack("with")&&(ge=!0),this.preserveSingleSpace(I||ge),this.print_string(this._ch),f&&g==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),U=!0):(this.eatWhitespace(),C++,this.indent())}else if(this._ch===")")C&&(C--,this.outdent()),U&&this._input.peek()===";"&&this._options.selector_separator_newline&&(U=!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&&(!f||U)&&C===0&&!b&&!y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&C===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(I),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 xe=g==='"'||g==="'";this.preserveSingleSpace(xe||I),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&_&&this._output.add_new_line()}var Re=this._output.get_code(O);return Re},r.exports.Beautifier=w},function(r,L,v){var m=v(6).Options;function p(u){m.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var h=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||h;var d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o<d.length;o++)d[o]!=="expand"?this.brace_style="collapse":this.brace_style=d[o]}p.prototype=new m,r.exports.Options=p}],B={};function K(r){var L=B[r];if(L!==void 0)return L.exports;var v=B[r]={exports:{}};return j[r](v,v.exports,K),v.exports}var H=K(15);P=H})();var X=P;!(ie=[],J=function(){return{css_beautify:X}}.apply(be,ie),J!==void 0&&(tt.exports=J))})()},Vhoy:function(tt,be,Z){"use strict";Z.d(be,"d",function(){return X}),Z.d(be,"e",function(){return j}),Z.d(be,"c",function(){return B}),Z.d(be,"b",function(){return K}),Z.d(be,"a",function(){return H});var ie=Z("MI8n");class J{constructor(){this._icons=new Map,this._onDidRegister=new ie.b}add(r){const L=this._icons.get(r.id);L?r.description?L.description=r.description:console.error(`Duplicate registration of codicon ${r.id}`):(this._icons.set(r.id,r),this._onDidRegister.fire(r))}get(r){return this._icons.get(r)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const P=new J,X=P;function j(r,L){return new K(r,L)}function B(r){return r?r.replace(/\$\((.*?)\)/g,(L,v)=>` ${v} `).trim():""}class K{constructor(r,L,v){this.id=r,this.definition=L,this.description=v,P.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var H;(function(r){r.iconNameSegment="[A-Za-z0-9]+",r.iconNameExpression="[A-Za-z0-9\\-]+",r.iconModifierExpression="~[A-Za-z]+";const L=new RegExp(`^(${r.iconNameExpression})(${r.iconModifierExpression})?$`);function v(u){if(u instanceof K)return["codicon","codicon-"+u.id];const h=L.exec(u.id);if(!h)return v(K.error);let[,d,o]=h;const l=["codicon","codicon-"+d];return o&&l.push("codicon-modifier-"+o.substr(1)),l}r.asClassNameArray=v;function m(u){return v(u).join(" ")}r.asClassName=m;function p(u){return"."+v(u).join(".")}r.asCSSSelector=p})(H||(H={})),function(r){r.add=new r("add",{fontCharacter:"\\ea60"}),r.plus=new r("plus",r.add.definition),r.gistNew=new r("gist-new",r.add.definition),r.repoCreate=new r("repo-create",r.add.definition),r.lightbulb=new r("lightbulb",{fontCharacter:"\\ea61"}),r.lightBulb=new r("light-bulb",{fontCharacter:"\\ea61"}),r.repo=new r("repo",{fontCharacter:"\\ea62"}),r.repoDelete=new r("repo-delete",{fontCharacter:"\\ea62"}),r.gistFork=new r("gist-fork",{fontCharacter:"\\ea63"}),r.repoForked=new r("repo-forked",{fontCharacter:"\\ea63"}),r.gitPullRequest=new r("git-pull-request",{fontCharacter:"\\ea64"}),r.gitPullRequestAbandoned=new r("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),r.recordKeys=new r("record-keys",{fontCharacter:"\\ea65"}),r.keyboard=new r("keyboard",{fontCharacter:"\\ea65"}),r.tag=new r("tag",{fontCharacter:"\\ea66"}),r.tagAdd=new r("tag-add",{fontCharacter:"\\ea66"}),r.tagRemove=new r("tag-remove",{fontCharacter:"\\ea66"}),r.person=new r("person",{fontCharacter:"\\ea67"}),r.personFollow=new r("person-follow",{fontCharacter:"\\ea67"}),r.personOutline=new r("person-outline",{fontCharacter:"\\ea67"}),r.personFilled=new r("person-filled",{fontCharacter:"\\ea67"}),r.gitBranch=new r("git-branch",{fontCharacter:"\\ea68"}),r.gitBranchCreate=new r("git-branch-create",{fontCharacter:"\\ea68"}),r.gitBranchDelete=new r("git-branch-delete",{fontCharacter:"\\ea68"}),r.sourceControl=new r("source-control",{fontCharacter:"\\ea68"}),r.mirror=new r("mirror",{fontCharacter:"\\ea69"}),r.mirrorPublic=new r("mirror-public",{fontCharacter:"\\ea69"}),r.star=new r("star",{fontCharacter:"\\ea6a"}),r.starAdd=new r("star-add",{fontCharacter:"\\ea6a"}),r.starDelete=new r("star-delete",{fontCharacter:"\\ea6a"}),r.starEmpty=new r("star-empty",{fontCharacter:"\\ea6a"}),r.comment=new r("comment",{fontCharacter:"\\ea6b"}),r.commentAdd=new r("comment-add",{fontCharacter:"\\ea6b"}),r.alert=new r("alert",{fontCharacter:"\\ea6c"}),r.warning=new r("warning",{fontCharacter:"\\ea6c"}),r.search=new r("search",{fontCharacter:"\\ea6d"}),r.searchSave=new r("search-save",{fontCharacter:"\\ea6d"}),r.logOut=new r("log-out",{fontCharacter:"\\ea6e"}),r.signOut=new r("sign-out",{fontCharacter:"\\ea6e"}),r.logIn=new r("log-in",{fontCharacter:"\\ea6f"}),r.signIn=new r("sign-in",{fontCharacter:"\\ea6f"}),r.eye=new r("eye",{fontCharacter:"\\ea70"}),r.eyeUnwatch=new r("eye-unwatch",{fontCharacter:"\\ea70"}),r.eyeWatch=new r("eye-watch",{fontCharacter:"\\ea70"}),r.circleFilled=new r("circle-filled",{fontCharacter:"\\ea71"}),r.primitiveDot=new r("primitive-dot",{fontCharacter:"\\ea71"}),r.closeDirty=new r("close-dirty",{fontCharacter:"\\ea71"}),r.debugBreakpoint=new r("debug-breakpoint",{fontCharacter:"\\ea71"}),r.debugBreakpointDisabled=new r("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),r.debugHint=new r("debug-hint",{fontCharacter:"\\ea71"}),r.primitiveSquare=new r("primitive-square",{fontCharacter:"\\ea72"}),r.edit=new r("edit",{fontCharacter:"\\ea73"}),r.pencil=new r("pencil",{fontCharacter:"\\ea73"}),r.info=new r("info",{fontCharacter:"\\ea74"}),r.issueOpened=new r("issue-opened",{fontCharacter:"\\ea74"}),r.gistPrivate=new r("gist-private",{fontCharacter:"\\ea75"}),r.gitForkPrivate=new r("git-fork-private",{fontCharacter:"\\ea75"}),r.lock=new r("lock",{fontCharacter:"\\ea75"}),r.mirrorPrivate=new r("mirror-private",{fontCharacter:"\\ea75"}),r.close=new r("close",{fontCharacter:"\\ea76"}),r.removeClose=new r("remove-close",{fontCharacter:"\\ea76"}),r.x=new r("x",{fontCharacter:"\\ea76"}),r.repoSync=new r("repo-sync",{fontCharacter:"\\ea77"}),r.sync=new r("sync",{fontCharacter:"\\ea77"}),r.clone=new r("clone",{fontCharacter:"\\ea78"}),r.desktopDownload=new r("desktop-download",{fontCharacter:"\\ea78"}),r.beaker=new r("beaker",{fontCharacter:"\\ea79"}),r.microscope=new r("microscope",{fontCharacter:"\\ea79"}),r.vm=new r("vm",{fontCharacter:"\\ea7a"}),r.deviceDesktop=new r("device-desktop",{fontCharacter:"\\ea7a"}),r.file=new r("file",{fontCharacter:"\\ea7b"}),r.fileText=new r("file-text",{fontCharacter:"\\ea7b"}),r.more=new r("more",{fontCharacter:"\\ea7c"}),r.ellipsis=new r("ellipsis",{fontCharacter:"\\ea7c"}),r.kebabHorizontal=new r("kebab-horizontal",{fontCharacter:"\\ea7c"}),r.mailReply=new r("mail-reply",{fontCharacter:"\\ea7d"}),r.reply=new r("reply",{fontCharacter:"\\ea7d"}),r.organization=new r("organization",{fontCharacter:"\\ea7e"}),r.organizationFilled=new r("organization-filled",{fontCharacter:"\\ea7e"}),r.organizationOutline=new r("organization-outline",{fontCharacter:"\\ea7e"}),r.newFile=new r("new-file",{fontCharacter:"\\ea7f"}),r.fileAdd=new r("file-add",{fontCharacter:"\\ea7f"}),r.newFolder=new r("new-folder",{fontCharacter:"\\ea80"}),r.fileDirectoryCreate=new r("file-directory-create",{fontCharacter:"\\ea80"}),r.trash=new r("trash",{fontCharacter:"\\ea81"}),r.trashcan=new r("trashcan",{fontCharacter:"\\ea81"}),r.history=new r("history",{fontCharacter:"\\ea82"}),r.clock=new r("clock",{fontCharacter:"\\ea82"}),r.folder=new r("folder",{fontCharacter:"\\ea83"}),r.fileDirectory=new r("file-directory",{fontCharacter:"\\ea83"}),r.symbolFolder=new r("symbol-folder",{fontCharacter:"\\ea83"}),r.logoGithub=new r("logo-github",{fontCharacter:"\\ea84"}),r.markGithub=new r("mark-github",{fontCharacter:"\\ea84"}),r.github=new r("github",{fontCharacter:"\\ea84"}),r.terminal=new r("terminal",{fontCharacter:"\\ea85"}),r.console=new r("console",{fontCharacter:"\\ea85"}),r.repl=new r("repl",{fontCharacter:"\\ea85"}),r.zap=new r("zap",{fontCharacter:"\\ea86"}),r.symbolEvent=new r("symbol-event",{fontCharacter:"\\ea86"}),r.error=new r("error",{fontCharacter:"\\ea87"}),r.stop=new r("stop",{fontCharacter:"\\ea87"}),r.variable=new r("variable",{fontCharacter:"\\ea88"}),r.symbolVariable=new r("symbol-variable",{fontCharacter:"\\ea88"}),r.array=new r("array",{fontCharacter:"\\ea8a"}),r.symbolArray=new r("symbol-array",{fontCharacter:"\\ea8a"}),r.symbolModule=new r("symbol-module",{fontCharacter:"\\ea8b"}),r.symbolPackage=new r("symbol-package",{fontCharacter:"\\ea8b"}),r.symbolNamespace=new r("symbol-namespace",{fontCharacter:"\\ea8b"}),r.symbolObject=new r("symbol-object",{fontCharacter:"\\ea8b"}),r.symbolMethod=new r("symbol-method",{fontCharacter:"\\ea8c"}),r.symbolFunction=new r("symbol-function",{fontCharacter:"\\ea8c"}),r.symbolConstructor=new r("symbol-constructor",{fontCharacter:"\\ea8c"}),r.symbolBoolean=new r("symbol-boolean",{fontCharacter:"\\ea8f"}),r.symbolNull=new r("symbol-null",{fontCharacter:"\\ea8f"}),r.symbolNumeric=new r("symbol-numeric",{fontCharacter:"\\ea90"}),r.symbolNumber=new r("symbol-number",{fontCharacter:"\\ea90"}),r.symbolStructure=new r("symbol-structure",{fontCharacter:"\\ea91"}),r.symbolStruct=new r("symbol-struct",{fontCharacter:"\\ea91"}),r.symbolParameter=new r("symbol-parameter",{fontCharacter:"\\ea92"}),r.symbolTypeParameter=new r("symbol-type-parameter",{fontCharacter:"\\ea92"}),r.symbolKey=new r("symbol-key",{fontCharacter:"\\ea93"}),r.symbolText=new r("symbol-text",{fontCharacter:"\\ea93"}),r.symbolReference=new r("symbol-reference",{fontCharacter:"\\ea94"}),r.goToFile=new r("go-to-file",{fontCharacter:"\\ea94"}),r.symbolEnum=new r("symbol-enum",{fontCharacter:"\\ea95"}),r.symbolValue=new r("symbol-value",{fontCharacter:"\\ea95"}),r.symbolRuler=new r("symbol-ruler",{fontCharacter:"\\ea96"}),r.symbolUnit=new r("symbol-unit",{fontCharacter:"\\ea96"}),r.activateBreakpoints=new r("activate-breakpoints",{fontCharacter:"\\ea97"}),r.archive=new r("archive",{fontCharacter:"\\ea98"}),r.arrowBoth=new r("arrow-both",{fontCharacter:"\\ea99"}),r.arrowDown=new r("arrow-down",{fontCharacter:"\\ea9a"}),r.arrowLeft=new r("arrow-left",{fontCharacter:"\\ea9b"}),r.arrowRight=new r("arrow-right",{fontCharacter:"\\ea9c"}),r.arrowSmallDown=new r("arrow-small-down",{fontCharacter:"\\ea9d"}),r.arrowSmallLeft=new r("arrow-small-left",{fontCharacter:"\\ea9e"}),r.arrowSmallRight=new r("arrow-small-right",{fontCharacter:"\\ea9f"}),r.arrowSmallUp=new r("arrow-small-up",{fontCharacter:"\\eaa0"}),r.arrowUp=new r("arrow-up",{fontCharacter:"\\eaa1"}),r.bell=new r("bell",{fontCharacter:"\\eaa2"}),r.bold=new r("bold",{fontCharacter:"\\eaa3"}),r.book=new r("book",{fontCharacter:"\\eaa4"}),r.bookmark=new r("bookmark",{fontCharacter:"\\eaa5"}),r.debugBreakpointConditionalUnverified=new r("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),r.debugBreakpointConditional=new r("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),r.debugBreakpointConditionalDisabled=new r("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),r.debugBreakpointDataUnverified=new r("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),r.debugBreakpointData=new r("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),r.debugBreakpointDataDisabled=new r("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),r.debugBreakpointLogUnverified=new r("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),r.debugBreakpointLog=new r("debug-breakpoint-log",{fontCharacter:"\\eaab"}),r.debugBreakpointLogDisabled=new r("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),r.briefcase=new r("briefcase",{fontCharacter:"\\eaac"}),r.broadcast=new r("broadcast",{fontCharacter:"\\eaad"}),r.browser=new r("browser",{fontCharacter:"\\eaae"}),r.bug=new r("bug",{fontCharacter:"\\eaaf"}),r.calendar=new r("calendar",{fontCharacter:"\\eab0"}),r.caseSensitive=new r("case-sensitive",{fontCharacter:"\\eab1"}),r.check=new r("check",{fontCharacter:"\\eab2"}),r.checklist=new r("checklist",{fontCharacter:"\\eab3"}),r.chevronDown=new r("chevron-down",{fontCharacter:"\\eab4"}),r.dropDownButton=new r("drop-down-button",r.chevronDown.definition),r.chevronLeft=new r("chevron-left",{fontCharacter:"\\eab5"}),r.chevronRight=new r("chevron-right",{fontCharacter:"\\eab6"}),r.chevronUp=new r("chevron-up",{fontCharacter:"\\eab7"}),r.chromeClose=new r("chrome-close",{fontCharacter:"\\eab8"}),r.chromeMaximize=new r("chrome-maximize",{fontCharacter:"\\eab9"}),r.chromeMinimize=new r("chrome-minimize",{fontCharacter:"\\eaba"}),r.chromeRestore=new r("chrome-restore",{fontCharacter:"\\eabb"}),r.circleOutline=new r("circle-outline",{fontCharacter:"\\eabc"}),r.debugBreakpointUnverified=new r("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),r.circleSlash=new r("circle-slash",{fontCharacter:"\\eabd"}),r.circuitBoard=new r("circuit-board",{fontCharacter:"\\eabe"}),r.clearAll=new r("clear-all",{fontCharacter:"\\eabf"}),r.clippy=new r("clippy",{fontCharacter:"\\eac0"}),r.closeAll=new r("close-all",{fontCharacter:"\\eac1"}),r.cloudDownload=new r("cloud-download",{fontCharacter:"\\eac2"}),r.cloudUpload=new r("cloud-upload",{fontCharacter:"\\eac3"}),r.code=new r("code",{fontCharacter:"\\eac4"}),r.collapseAll=new r("collapse-all",{fontCharacter:"\\eac5"}),r.colorMode=new r("color-mode",{fontCharacter:"\\eac6"}),r.commentDiscussion=new r("comment-discussion",{fontCharacter:"\\eac7"}),r.compareChanges=new r("compare-changes",{fontCharacter:"\\eafd"}),r.creditCard=new r("credit-card",{fontCharacter:"\\eac9"}),r.dash=new r("dash",{fontCharacter:"\\eacc"}),r.dashboard=new r("dashboard",{fontCharacter:"\\eacd"}),r.database=new r("database",{fontCharacter:"\\eace"}),r.debugContinue=new r("debug-continue",{fontCharacter:"\\eacf"}),r.debugDisconnect=new r("debug-disconnect",{fontCharacter:"\\ead0"}),r.debugPause=new r("debug-pause",{fontCharacter:"\\ead1"}),r.debugRestart=new r("debug-restart",{fontCharacter:"\\ead2"}),r.debugStart=new r("debug-start",{fontCharacter:"\\ead3"}),r.debugStepInto=new r("debug-step-into",{fontCharacter:"\\ead4"}),r.debugStepOut=new r("debug-step-out",{fontCharacter:"\\ead5"}),r.debugStepOver=new r("debug-step-over",{fontCharacter:"\\ead6"}),r.debugStop=new r("debug-stop",{fontCharacter:"\\ead7"}),r.debug=new r("debug",{fontCharacter:"\\ead8"}),r.deviceCameraVideo=new r("device-camera-video",{fontCharacter:"\\ead9"}),r.deviceCamera=new r("device-camera",{fontCharacter:"\\eada"}),r.deviceMobile=new r("device-mobile",{fontCharacter:"\\eadb"}),r.diffAdded=new r("diff-added",{fontCharacter:"\\eadc"}),r.diffIgnored=new r("diff-ignored",{fontCharacter:"\\eadd"}),r.diffModified=new r("diff-modified",{fontCharacter:"\\eade"}),r.diffRemoved=new r("diff-removed",{fontCharacter:"\\eadf"}),r.diffRenamed=new r("diff-renamed",{fontCharacter:"\\eae0"}),r.diff=new r("diff",{fontCharacter:"\\eae1"}),r.discard=new r("discard",{fontCharacter:"\\eae2"}),r.editorLayout=new r("editor-layout",{fontCharacter:"\\eae3"}),r.emptyWindow=new r("empty-window",{fontCharacter:"\\eae4"}),r.exclude=new r("exclude",{fontCharacter:"\\eae5"}),r.extensions=new r("extensions",{fontCharacter:"\\eae6"}),r.eyeClosed=new r("eye-closed",{fontCharacter:"\\eae7"}),r.fileBinary=new r("file-binary",{fontCharacter:"\\eae8"}),r.fileCode=new r("file-code",{fontCharacter:"\\eae9"}),r.fileMedia=new r("file-media",{fontCharacter:"\\eaea"}),r.filePdf=new r("file-pdf",{fontCharacter:"\\eaeb"}),r.fileSubmodule=new r("file-submodule",{fontCharacter:"\\eaec"}),r.fileSymlinkDirectory=new r("file-symlink-directory",{fontCharacter:"\\eaed"}),r.fileSymlinkFile=new r("file-symlink-file",{fontCharacter:"\\eaee"}),r.fileZip=new r("file-zip",{fontCharacter:"\\eaef"}),r.files=new r("files",{fontCharacter:"\\eaf0"}),r.filter=new r("filter",{fontCharacter:"\\eaf1"}),r.flame=new r("flame",{fontCharacter:"\\eaf2"}),r.foldDown=new r("fold-down",{fontCharacter:"\\eaf3"}),r.foldUp=new r("fold-up",{fontCharacter:"\\eaf4"}),r.fold=new r("fold",{fontCharacter:"\\eaf5"}),r.folderActive=new r("folder-active",{fontCharacter:"\\eaf6"}),r.folderOpened=new r("folder-opened",{fontCharacter:"\\eaf7"}),r.gear=new r("gear",{fontCharacter:"\\eaf8"}),r.gift=new r("gift",{fontCharacter:"\\eaf9"}),r.gistSecret=new r("gist-secret",{fontCharacter:"\\eafa"}),r.gist=new r("gist",{fontCharacter:"\\eafb"}),r.gitCommit=new r("git-commit",{fontCharacter:"\\eafc"}),r.gitCompare=new r("git-compare",{fontCharacter:"\\eafd"}),r.gitMerge=new r("git-merge",{fontCharacter:"\\eafe"}),r.githubAction=new r("github-action",{fontCharacter:"\\eaff"}),r.githubAlt=new r("github-alt",{fontCharacter:"\\eb00"}),r.globe=new r("globe",{fontCharacter:"\\eb01"}),r.grabber=new r("grabber",{fontCharacter:"\\eb02"}),r.graph=new r("graph",{fontCharacter:"\\eb03"}),r.gripper=new r("gripper",{fontCharacter:"\\eb04"}),r.heart=new r("heart",{fontCharacter:"\\eb05"}),r.home=new r("home",{fontCharacter:"\\eb06"}),r.horizontalRule=new r("horizontal-rule",{fontCharacter:"\\eb07"}),r.hubot=new r("hubot",{fontCharacter:"\\eb08"}),r.inbox=new r("inbox",{fontCharacter:"\\eb09"}),r.issueClosed=new r("issue-closed",{fontCharacter:"\\eba4"}),r.issueReopened=new r("issue-reopened",{fontCharacter:"\\eb0b"}),r.issues=new r("issues",{fontCharacter:"\\eb0c"}),r.italic=new r("italic",{fontCharacter:"\\eb0d"}),r.jersey=new r("jersey",{fontCharacter:"\\eb0e"}),r.json=new r("json",{fontCharacter:"\\eb0f"}),r.kebabVertical=new r("kebab-vertical",{fontCharacter:"\\eb10"}),r.key=new r("key",{fontCharacter:"\\eb11"}),r.law=new r("law",{fontCharacter:"\\eb12"}),r.lightbulbAutofix=new r("lightbulb-autofix",{fontCharacter:"\\eb13"}),r.linkExternal=new r("link-external",{fontCharacter:"\\eb14"}),r.link=new r("link",{fontCharacter:"\\eb15"}),r.listOrdered=new r("list-ordered",{fontCharacter:"\\eb16"}),r.listUnordered=new r("list-unordered",{fontCharacter:"\\eb17"}),r.liveShare=new r("live-share",{fontCharacter:"\\eb18"}),r.loading=new r("loading",{fontCharacter:"\\eb19"}),r.location=new r("location",{fontCharacter:"\\eb1a"}),r.mailRead=new r("mail-read",{fontCharacter:"\\eb1b"}),r.mail=new r("mail",{fontCharacter:"\\eb1c"}),r.markdown=new r("markdown",{fontCharacter:"\\eb1d"}),r.megaphone=new r("megaphone",{fontCharacter:"\\eb1e"}),r.mention=new r("mention",{fontCharacter:"\\eb1f"}),r.milestone=new r("milestone",{fontCharacter:"\\eb20"}),r.mortarBoard=new r("mortar-board",{fontCharacter:"\\eb21"}),r.move=new r("move",{fontCharacter:"\\eb22"}),r.multipleWindows=new r("multiple-windows",{fontCharacter:"\\eb23"}),r.mute=new r("mute",{fontCharacter:"\\eb24"}),r.noNewline=new r("no-newline",{fontCharacter:"\\eb25"}),r.note=new r("note",{fontCharacter:"\\eb26"}),r.octoface=new r("octoface",{fontCharacter:"\\eb27"}),r.openPreview=new r("open-preview",{fontCharacter:"\\eb28"}),r.package_=new r("package",{fontCharacter:"\\eb29"}),r.paintcan=new r("paintcan",{fontCharacter:"\\eb2a"}),r.pin=new r("pin",{fontCharacter:"\\eb2b"}),r.play=new r("play",{fontCharacter:"\\eb2c"}),r.run=new r("run",{fontCharacter:"\\eb2c"}),r.plug=new r("plug",{fontCharacter:"\\eb2d"}),r.preserveCase=new r("preserve-case",{fontCharacter:"\\eb2e"}),r.preview=new r("preview",{fontCharacter:"\\eb2f"}),r.project=new r("project",{fontCharacter:"\\eb30"}),r.pulse=new r("pulse",{fontCharacter:"\\eb31"}),r.question=new r("question",{fontCharacter:"\\eb32"}),r.quote=new r("quote",{fontCharacter:"\\eb33"}),r.radioTower=new r("radio-tower",{fontCharacter:"\\eb34"}),r.reactions=new r("reactions",{fontCharacter:"\\eb35"}),r.references=new r("references",{fontCharacter:"\\eb36"}),r.refresh=new r("refresh",{fontCharacter:"\\eb37"}),r.regex=new r("regex",{fontCharacter:"\\eb38"}),r.remoteExplorer=new r("remote-explorer",{fontCharacter:"\\eb39"}),r.remote=new r("remote",{fontCharacter:"\\eb3a"}),r.remove=new r("remove",{fontCharacter:"\\eb3b"}),r.replaceAll=new r("replace-all",{fontCharacter:"\\eb3c"}),r.replace=new r("replace",{fontCharacter:"\\eb3d"}),r.repoClone=new r("repo-clone",{fontCharacter:"\\eb3e"}),r.repoForcePush=new r("repo-force-push",{fontCharacter:"\\eb3f"}),r.repoPull=new r("repo-pull",{fontCharacter:"\\eb40"}),r.repoPush=new r("repo-push",{fontCharacter:"\\eb41"}),r.report=new r("report",{fontCharacter:"\\eb42"}),r.requestChanges=new r("request-changes",{fontCharacter:"\\eb43"}),r.rocket=new r("rocket",{fontCharacter:"\\eb44"}),r.rootFolderOpened=new r("root-folder-opened",{fontCharacter:"\\eb45"}),r.rootFolder=new r("root-folder",{fontCharacter:"\\eb46"}),r.rss=new r("rss",{fontCharacter:"\\eb47"}),r.ruby=new r("ruby",{fontCharacter:"\\eb48"}),r.saveAll=new r("save-all",{fontCharacter:"\\eb49"}),r.saveAs=new r("save-as",{fontCharacter:"\\eb4a"}),r.save=new r("save",{fontCharacter:"\\eb4b"}),r.screenFull=new r("screen-full",{fontCharacter:"\\eb4c"}),r.screenNormal=new r("screen-normal",{fontCharacter:"\\eb4d"}),r.searchStop=new r("search-stop",{fontCharacter:"\\eb4e"}),r.server=new r("server",{fontCharacter:"\\eb50"}),r.settingsGear=new r("settings-gear",{fontCharacter:"\\eb51"}),r.settings=new r("settings",{fontCharacter:"\\eb52"}),r.shield=new r("shield",{fontCharacter:"\\eb53"}),r.smiley=new r("smiley",{fontCharacter:"\\eb54"}),r.sortPrecedence=new r("sort-precedence",{fontCharacter:"\\eb55"}),r.splitHorizontal=new r("split-horizontal",{fontCharacter:"\\eb56"}),r.splitVertical=new r("split-vertical",{fontCharacter:"\\eb57"}),r.squirrel=new r("squirrel",{fontCharacter:"\\eb58"}),r.starFull=new r("star-full",{fontCharacter:"\\eb59"}),r.starHalf=new r("star-half",{fontCharacter:"\\eb5a"}),r.symbolClass=new r("symbol-class",{fontCharacter:"\\eb5b"}),r.symbolColor=new r("symbol-color",{fontCharacter:"\\eb5c"}),r.symbolConstant=new r("symbol-constant",{fontCharacter:"\\eb5d"}),r.symbolEnumMember=new r("symbol-enum-member",{fontCharacter:"\\eb5e"}),r.symbolField=new r("symbol-field",{fontCharacter:"\\eb5f"}),r.symbolFile=new r("symbol-file",{fontCharacter:"\\eb60"}),r.symbolInterface=new r("symbol-interface",{fontCharacter:"\\eb61"}),r.symbolKeyword=new r("symbol-keyword",{fontCharacter:"\\eb62"}),r.symbolMisc=new r("symbol-misc",{fontCharacter:"\\eb63"}),r.symbolOperator=new r("symbol-operator",{fontCharacter:"\\eb64"}),r.symbolProperty=new r("symbol-property",{fontCharacter:"\\eb65"}),r.wrench=new r("wrench",{fontCharacter:"\\eb65"}),r.wrenchSubaction=new r("wrench-subaction",{fontCharacter:"\\eb65"}),r.symbolSnippet=new r("symbol-snippet",{fontCharacter:"\\eb66"}),r.tasklist=new r("tasklist",{fontCharacter:"\\eb67"}),r.telescope=new r("telescope",{fontCharacter:"\\eb68"}),r.textSize=new r("text-size",{fontCharacter:"\\eb69"}),r.threeBars=new r("three-bars",{fontCharacter:"\\eb6a"}),r.thumbsdown=new r("thumbsdown",{fontCharacter:"\\eb6b"}),r.thumbsup=new r("thumbsup",{fontCharacter:"\\eb6c"}),r.tools=new r("tools",{fontCharacter:"\\eb6d"}),r.triangleDown=new r("triangle-down",{fontCharacter:"\\eb6e"}),r.triangleLeft=new r("triangle-left",{fontCharacter:"\\eb6f"}),r.triangleRight=new r("triangle-right",{fontCharacter:"\\eb70"}),r.triangleUp=new r("triangle-up",{fontCharacter:"\\eb71"}),r.twitter=new r("twitter",{fontCharacter:"\\eb72"}),r.unfold=new r("unfold",{fontCharacter:"\\eb73"}),r.unlock=new r("unlock",{fontCharacter:"\\eb74"}),r.unmute=new r("unmute",{fontCharacter:"\\eb75"}),r.unverified=new r("unverified",{fontCharacter:"\\eb76"}),r.verified=new r("verified",{fontCharacter:"\\eb77"}),r.versions=new r("versions",{fontCharacter:"\\eb78"}),r.vmActive=new r("vm-active",{fontCharacter:"\\eb79"}),r.vmOutline=new r("vm-outline",{fontCharacter:"\\eb7a"}),r.vmRunning=new r("vm-running",{fontCharacter:"\\eb7b"}),r.watch=new r("watch",{fontCharacter:"\\eb7c"}),r.whitespace=new r("whitespace",{fontCharacter:"\\eb7d"}),r.wholeWord=new r("whole-word",{fontCharacter:"\\eb7e"}),r.window=new r("window",{fontCharacter:"\\eb7f"}),r.wordWrap=new r("word-wrap",{fontCharacter:"\\eb80"}),r.zoomIn=new r("zoom-in",{fontCharacter:"\\eb81"}),r.zoomOut=new r("zoom-out",{fontCharacter:"\\eb82"}),r.listFilter=new r("list-filter",{fontCharacter:"\\eb83"}),r.listFlat=new r("list-flat",{fontCharacter:"\\eb84"}),r.listSelection=new r("list-selection",{fontCharacter:"\\eb85"}),r.selection=new r("selection",{fontCharacter:"\\eb85"}),r.listTree=new r("list-tree",{fontCharacter:"\\eb86"}),r.debugBreakpointFunctionUnverified=new r("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),r.debugBreakpointFunction=new r("debug-breakpoint-function",{fontCharacter:"\\eb88"}),r.debugBreakpointFunctionDisabled=new r("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),r.debugStackframeActive=new r("debug-stackframe-active",{fontCharacter:"\\eb89"}),r.debugStackframeDot=new r("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),r.debugStackframe=new r("debug-stackframe",{fontCharacter:"\\eb8b"}),r.debugStackframeFocused=new r("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),r.debugBreakpointUnsupported=new r("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),r.symbolString=new r("symbol-string",{fontCharacter:"\\eb8d"}),r.debugReverseContinue=new r("debug-reverse-continue",{fontCharacter:"\\eb8e"}),r.debugStepBack=new r("debug-step-back",{fontCharacter:"\\eb8f"}),r.debugRestartFrame=new r("debug-restart-frame",{fontCharacter:"\\eb90"}),r.callIncoming=new r("call-incoming",{fontCharacter:"\\eb92"}),r.callOutgoing=new r("call-outgoing",{fontCharacter:"\\eb93"}),r.menu=new r("menu",{fontCharacter:"\\eb94"}),r.expandAll=new r("expand-all",{fontCharacter:"\\eb95"}),r.feedback=new r("feedback",{fontCharacter:"\\eb96"}),r.groupByRefType=new r("group-by-ref-type",{fontCharacter:"\\eb97"}),r.ungroupByRefType=new r("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),r.account=new r("account",{fontCharacter:"\\eb99"}),r.bellDot=new r("bell-dot",{fontCharacter:"\\eb9a"}),r.debugConsole=new r("debug-console",{fontCharacter:"\\eb9b"}),r.library=new r("library",{fontCharacter:"\\eb9c"}),r.output=new r("output",{fontCharacter:"\\eb9d"}),r.runAll=new r("run-all",{fontCharacter:"\\eb9e"}),r.syncIgnored=new r("sync-ignored",{fontCharacter:"\\eb9f"}),r.pinned=new r("pinned",{fontCharacter:"\\eba0"}),r.githubInverted=new r("github-inverted",{fontCharacter:"\\eba1"}),r.debugAlt=new r("debug-alt",{fontCharacter:"\\eb91"}),r.serverProcess=new r("server-process",{fontCharacter:"\\eba2"}),r.serverEnvironment=new r("server-environment",{fontCharacter:"\\eba3"}),r.pass=new r("pass",{fontCharacter:"\\eba4"}),r.stopCircle=new r("stop-circle",{fontCharacter:"\\eba5"}),r.playCircle=new r("play-circle",{fontCharacter:"\\eba6"}),r.record=new r("record",{fontCharacter:"\\eba7"}),r.debugAltSmall=new r("debug-alt-small",{fontCharacter:"\\eba8"}),r.vmConnect=new r("vm-connect",{fontCharacter:"\\eba9"}),r.cloud=new r("cloud",{fontCharacter:"\\ebaa"}),r.merge=new r("merge",{fontCharacter:"\\ebab"}),r.exportIcon=new r("export",{fontCharacter:"\\ebac"}),r.graphLeft=new r("graph-left",{fontCharacter:"\\ebad"}),r.magnet=new r("magnet",{fontCharacter:"\\ebae"}),r.notebook=new r("notebook",{fontCharacter:"\\ebaf"}),r.redo=new r("redo",{fontCharacter:"\\ebb0"}),r.checkAll=new r("check-all",{fontCharacter:"\\ebb1"}),r.pinnedDirty=new r("pinned-dirty",{fontCharacter:"\\ebb2"}),r.passFilled=new r("pass-filled",{fontCharacter:"\\ebb3"}),r.circleLargeFilled=new r("circle-large-filled",{fontCharacter:"\\ebb4"}),r.circleLargeOutline=new r("circle-large-outline",{fontCharacter:"\\ebb5"}),r.combine=new r("combine",{fontCharacter:"\\ebb6"}),r.gather=new r("gather",{fontCharacter:"\\ebb6"}),r.table=new r("table",{fontCharacter:"\\ebb7"}),r.variableGroup=new r("variable-group",{fontCharacter:"\\ebb8"}),r.typeHierarchy=new r("type-hierarchy",{fontCharacter:"\\ebb9"}),r.typeHierarchySub=new r("type-hierarchy-sub",{fontCharacter:"\\ebba"}),r.typeHierarchySuper=new r("type-hierarchy-super",{fontCharacter:"\\ebbb"}),r.gitPullRequestCreate=new r("git-pull-request-create",{fontCharacter:"\\ebbc"}),r.runAbove=new r("run-above",{fontCharacter:"\\ebbd"}),r.runBelow=new r("run-below",{fontCharacter:"\\ebbe"}),r.notebookTemplate=new r("notebook-template",{fontCharacter:"\\ebbf"}),r.debugRerun=new r("debug-rerun",{fontCharacter:"\\ebc0"}),r.workspaceTrusted=new r("workspace-trusted",{fontCharacter:"\\ebc1"}),r.workspaceUntrusted=new r("workspace-untrusted",{fontCharacter:"\\ebc2"}),r.workspaceUnspecified=new r("workspace-unspecified",{fontCharacter:"\\ebc3"}),r.terminalCmd=new r("terminal-cmd",{fontCharacter:"\\ebc4"}),r.terminalDebian=new r("terminal-debian",{fontCharacter:"\\ebc5"}),r.terminalLinux=new r("terminal-linux",{fontCharacter:"\\ebc6"}),r.terminalPowershell=new r("terminal-powershell",{fontCharacter:"\\ebc7"}),r.terminalTmux=new r("terminal-tmux",{fontCharacter:"\\ebc8"}),r.terminalUbuntu=new r("terminal-ubuntu",{fontCharacter:"\\ebc9"}),r.terminalBash=new r("terminal-bash",{fontCharacter:"\\ebca"}),r.arrowSwap=new r("arrow-swap",{fontCharacter:"\\ebcb"}),r.copy=new r("copy",{fontCharacter:"\\ebcc"}),r.personAdd=new r("person-add",{fontCharacter:"\\ebcd"}),r.filterFilled=new r("filter-filled",{fontCharacter:"\\ebce"}),r.wand=new r("wand",{fontCharacter:"\\ebcf"}),r.debugLineByLine=new r("debug-line-by-line",{fontCharacter:"\\ebd0"}),r.inspect=new r("inspect",{fontCharacter:"\\ebd1"}),r.layers=new r("layers",{fontCharacter:"\\ebd2"}),r.layersDot=new r("layers-dot",{fontCharacter:"\\ebd3"}),r.layersActive=new r("layers-active",{fontCharacter:"\\ebd4"}),r.compass=new r("compass",{fontCharacter:"\\ebd5"}),r.compassDot=new r("compass-dot",{fontCharacter:"\\ebd6"}),r.compassActive=new r("compass-active",{fontCharacter:"\\ebd7"}),r.azure=new r("azure",{fontCharacter:"\\ebd8"}),r.issueDraft=new r("issue-draft",{fontCharacter:"\\ebd9"}),r.gitPullRequestClosed=new r("git-pull-request-closed",{fontCharacter:"\\ebda"}),r.gitPullRequestDraft=new r("git-pull-request-draft",{fontCharacter:"\\ebdb"}),r.debugAll=new r("debug-all",{fontCharacter:"\\ebdc"}),r.debugCoverage=new r("debug-coverage",{fontCharacter:"\\ebdd"}),r.runErrors=new r("run-errors",{fontCharacter:"\\ebde"}),r.folderLibrary=new r("folder-library",{fontCharacter:"\\ebdf"}),r.debugContinueSmall=new r("debug-continue-small",{fontCharacter:"\\ebe0"}),r.beakerStop=new r("beaker-stop",{fontCharacter:"\\ebe1"}),r.graphLine=new r("graph-line",{fontCharacter:"\\ebe2"}),r.graphScatter=new r("graph-scatter",{fontCharacter:"\\ebe3"}),r.pieChart=new r("pie-chart",{fontCharacter:"\\ebe4"}),r.bracket=new r("bracket",r.json.definition),r.bracketDot=new r("bracket-dot",{fontCharacter:"\\ebe5"}),r.bracketError=new r("bracket-error",{fontCharacter:"\\ebe6"}),r.lockSmall=new r("lock-small",{fontCharacter:"\\ebe7"}),r.azureDevops=new r("azure-devops",{fontCharacter:"\\ebe8"}),r.verifiedFilled=new r("verified-filled",{fontCharacter:"\\ebe9"})}(K||(K={}))},"VrN/":function(tt,be,Z){(function(ie,J){tt.exports=J()})(this,function(){"use strict";var ie=navigator.userAgent,J=navigator.platform,P=/gecko\/\d/i.test(ie),X=/MSIE \d/.test(ie),j=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ie),B=/Edge\/(\d+)/.exec(ie),K=X||j||B,H=K&&(X?document.documentMode||6:+(B||j)[1]),r=!B&&/WebKit\//.test(ie),L=r&&/Qt\/\d+\.\d+/.test(ie),v=!B&&/Chrome\//.test(ie),m=/Opera\//.test(ie),p=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ie),h=/PhantomJS/.test(ie),d=!B&&/AppleWebKit/.test(ie)&&/Mobile\/\w+/.test(ie),o=/Android/.test(ie),l=d||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ie),s=d||/Mac/.test(J),a=/\bCrOS\b/.test(ie),R=/win/i.test(J),E=m&&ie.match(/Version\/(\d*\.\d*)/);E&&(E=Number(E[1])),E&&E>=15&&(m=!1,r=!0);var w=s&&(L||m&&(E==null||E<12.11)),D=P||K&&H>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var A=function(e,t){var i=e.className,n=O(t).exec(i);if(n){var c=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(c?n[1]+c:"")}};function C(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return C(e).appendChild(t)}function f(e,t,i,n){var c=document.createElement(e);if(i&&(c.className=i),n&&(c.style.cssText=n),typeof t=="string")c.appendChild(document.createTextNode(t));else if(t)for(var N=0;N<t.length;++N)c.appendChild(t[N]);return c}function S(e,t,i,n){var c=f(e,t,i,n);return c.setAttribute("role","presentation"),c}var y;document.createRange?y=function(e,t,i,n){var c=document.createRange();return c.setEnd(n||e,i),c.setStart(e,t),c}:y=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(c){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function b(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function U(){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 F(e,t){var i=e.className;O(t).test(i)||(e.className+=(i?" ":"")+t)}function _(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!O(i[n]).test(t)&&(t+=" "+i[n]);return t}var M=function(e){e.select()};d?M=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:K&&(M=function(e){try{e.select()}catch(t){}});function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function g(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function W(e,t,i,n,c){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var N=n||0,z=c||0;;){var Q=e.indexOf(" ",N);if(Q<0||Q>=t)return z+(t-N);z+=Q-N,z+=i-z%i,N=Q+1}}var $=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};$.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function ne(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var oe=50,we={toString:function(){return"CodeMirror.Pass"}},ge={scroll:!1},xe={origin:"*mouse"},Re={origin:"+move"};function Le(e,t,i){for(var n=0,c=0;;){var N=e.indexOf(" ",n);N==-1&&(N=e.length);var z=N-n;if(N==e.length||c+z>=t)return n+Math.min(z,t-c);if(c+=N-n,c+=i-c%i,n=N+1,c>=t)return n}}var ce=[""];function he(e){for(;ce.length<=e;)ce.push(re(ce)+" ");return ce[e]}function re(e){return e[e.length-1]}function de(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function se(e,t,i){for(var n=0,c=i(t);n<e.length&&i(e[n])<=c;)n++;e.splice(n,0,t)}function De(){}function Ne(e,t){var i;return Object.create?i=Object.create(e):(De.prototype=e,i=new De),t&&g(t,i),i}var Se=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Pe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Se.test(e))}function Ue(e,t){return t?t.source.indexOf("\\w")>-1&&Pe(e)?!0:t.test(e):Pe(e)}function le(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ve=/[\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 Ae(e){return e.charCodeAt(0)>=768&&ve.test(e)}function Ie(e,t,i){for(;(i<0?t>0:t<e.length)&&Ae(e.charAt(t));)t+=i;return t}function Ge(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var c=(t+i)/2,N=n<0?Math.ceil(c):Math.floor(c);if(N==t)return e(N)?t:i;e(N)?i=N:t=N+n}}function $e(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var c=!1,N=0;N<e.length;++N){var z=e[N];(z.from<i&&z.to>t||t==i&&z.to==t)&&(n(Math.max(z.from,t),Math.min(z.to,i),z.level==1?"rtl":"ltr",N),c=!0)}c||n(t,i,"ltr")}var Ze=null;function Je(e,t,i){var n;Ze=null;for(var c=0;c<e.length;++c){var N=e[c];if(N.from<t&&N.to>t)return c;N.to==t&&(N.from!=N.to&&i=="before"?n=c:Ze=c),N.from==t&&(N.from!=N.to&&i!="before"?n=c:Ze=c)}return n!=null?n:Ze}var at=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,c=/[stwN]/,N=/[LRr]/,z=/[Lb1n]/,Q=/[1n]/;function q(te,pe,ye){this.level=te,this.from=pe,this.to=ye}return function(te,pe){var ye=pe=="ltr"?"L":"R";if(te.length==0||pe=="ltr"&&!n.test(te))return!1;for(var Me=te.length,ke=[],He=0;He<Me;++He)ke.push(i(te.charCodeAt(He)));for(var Ye=0,Qe=ye;Ye<Me;++Ye){var rt=ke[Ye];rt=="m"?ke[Ye]=Qe:Qe=rt}for(var lt=0,nt=ye;lt<Me;++lt){var ut=ke[lt];ut=="1"&&nt=="r"?ke[lt]="n":N.test(ut)&&(nt=ut,ut=="r"&&(ke[lt]="R"))}for(var Tt=1,vt=ke[0];Tt<Me-1;++Tt){var Rt=ke[Tt];Rt=="+"&&vt=="1"&&ke[Tt+1]=="1"?ke[Tt]="1":Rt==","&&vt==ke[Tt+1]&&(vt=="1"||vt=="n")&&(ke[Tt]=vt),vt=Rt}for(var Xt=0;Xt<Me;++Xt){var gr=ke[Xt];if(gr==",")ke[Xt]="N";else if(gr=="%"){var er=void 0;for(er=Xt+1;er<Me&&ke[er]=="%";++er);for(var Gr=Xt&&ke[Xt-1]=="!"||er<Me&&ke[er]=="1"?"1":"N",Nr=Xt;Nr<er;++Nr)ke[Nr]=Gr;Xt=er-1}}for(var sr=0,Fr=ye;sr<Me;++sr){var _r=ke[sr];Fr=="L"&&_r=="1"?ke[sr]="L":N.test(_r)&&(Fr=_r)}for(var hr=0;hr<Me;++hr)if(c.test(ke[hr])){var or=void 0;for(or=hr+1;or<Me&&c.test(ke[or]);++or);for(var rr=(hr?ke[hr-1]:ye)=="L",Br=(or<Me?ke[or]:ye)=="L",ui=rr==Br?rr?"L":"R":ye,In=hr;In<or;++In)ke[In]=ui;hr=or-1}for(var Sr=[],ln,vr=0;vr<Me;)if(z.test(ke[vr])){var Va=vr;for(++vr;vr<Me&&z.test(ke[vr]);++vr);Sr.push(new q(0,Va,vr))}else{var pn=vr,Gn=Sr.length,Kn=pe=="rtl"?1:0;for(++vr;vr<Me&&ke[vr]!="L";++vr);for(var Rr=pn;Rr<vr;)if(Q.test(ke[Rr])){pn<Rr&&(Sr.splice(Gn,0,new q(1,pn,Rr)),Gn+=Kn);var hi=Rr;for(++Rr;Rr<vr&&Q.test(ke[Rr]);++Rr);Sr.splice(Gn,0,new q(2,hi,Rr)),Gn+=Kn,pn=Rr}else++Rr;pn<vr&&Sr.splice(Gn,0,new q(1,pn,vr))}return pe=="ltr"&&(Sr[0].level==1&&(ln=te.match(/^\s+/))&&(Sr[0].from=ln[0].length,Sr.unshift(new q(0,0,ln[0].length))),re(Sr).level==1&&(ln=te.match(/\s+$/))&&(re(Sr).to-=ln[0].length,Sr.push(new q(0,Me-ln[0].length,Me)))),pe=="rtl"?Sr.reverse():Sr}}();function qe(e,t){var i=e.order;return i==null&&(i=e.order=at(e.text,t)),i}var it=[],Be=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||it).concat(i)}};function ct(e,t){return e._handlers&&e._handlers[t]||it}function ot(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,c=n&&n[t];if(c){var N=ne(c,i);N>-1&&(n[t]=c.slice(0,N).concat(c.slice(N+1)))}}}function je(e,t){var i=ct(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),c=0;c<i.length;++c)i[c].apply(null,n)}function We(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),je(e,i||t.type,e,t),fe(t)||t.codemirrorIgnore}function Oe(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)ne(i,t[n])==-1&&i.push(t[n])}function _e(e,t){return ct(e,t).length>0}function Te(e){e.prototype.on=function(t,i){Be(this,t,i)},e.prototype.off=function(t,i){ot(this,t,i)}}function ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ue(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function fe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function me(e){ae(e),ue(e)}function Ce(e){return e.target||e.srcElement}function Fe(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(K&&H<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),st;function mt(e){if(st==null){var t=f("span","\u200B");T(e,f("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(st=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&H<8))}var i=st?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var ft;function wt(e){if(ft!=null)return ft;var t=T(e,document.createTextNode("A\u062EA")),i=y(t,0,1).getBoundingClientRect(),n=y(t,1,2).getBoundingClientRect();return C(e),!i||i.left==i.right?!1:ft=n.right-i.right<3}var St=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var c=e.indexOf(`
`,t);c==-1&&(c=e.length);var N=e.slice(t,e.charAt(c-1)=="\r"?c-1:c),z=N.indexOf("\r");z!=-1?(i.push(N.slice(0,z)),t+=z+1):(i.push(N),t=c+1)}return i}:function(e){return e.split(/\r\n?|\n/)},ht=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ut=function(){var e=f("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=T(e,f("span","x")),i=t.getBoundingClientRect(),n=y(t,0,1).getBoundingClientRect();return Lt=Math.abs(i.left-n.left)>1}var Zt={},It={};function Cr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Zt[e]=t}function Kr(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=Ne(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 Lr(e,t){t=yt(t);var i=Zt[t.name];if(!i)return Lr(e,"text/plain");var n=i(e,t);if(bt.hasOwnProperty(t.name)){var c=bt[t.name];for(var N in c){if(!c.hasOwnProperty(N))continue;n.hasOwnProperty(N)&&(n["_"+N]=n[N]),n[N]=c[N]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var z in t.modeProps)n[z]=t.modeProps[z];return n}var bt={};function xt(e,t){var i=bt.hasOwnProperty(e)?bt[e]:bt[e]={};g(t,i)}function Ft(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var c=t[n];c instanceof Array&&(c=c.concat([])),i[n]=c}return i}function tr(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function cr(e,t,i){return e.startState?e.startState(t,i):!0}var Pt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};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),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)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=W(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.indentation=function(){return W(this.string,null,this.tabSize)-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(z){return i?z.toLowerCase():z},c=this.string.substr(this.pos,e.length);if(n(c)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var N=this.string.slice(this.pos).match(e);return N&&N.index>0?null:(N&&t!==!1&&(this.pos+=N[0].length),N)}},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 dt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var c=i.children[n],N=c.chunkSize();if(t<N){i=c;break}t-=N}return i.lines[t]}function Ur(e,t,i){var n=[],c=t.line;return e.iter(t.line,i.line+1,function(N){var z=N.text;c==i.line&&(z=z.slice(0,i.ch)),c==t.line&&(z=z.slice(t.ch)),n.push(z),++c}),n}function Vt(e,t,i){var n=[];return e.iter(t,i,function(c){n.push(c.text)}),n}function Jt(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Ot(e){if(e.parent==null)return null;for(var t=e.parent,i=ne(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var c=0;!(n.children[c]==t);++c)i+=n.children[c].chunkSize();return i+t.first}function lr(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var c=e.children[n],N=c.height;if(t<N){e=c;continue e}t-=N,i+=c.chunkSize()}return i}while(!e.lines);for(var z=0;z<e.lines.length;++z){var Q=e.lines[z],q=Q.height;if(t<q)break;t-=q}return i+z}function Ir(e,t){return t>=e.first&&t<e.first+e.size}function Xr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Xe(e,t,i){if(i===void 0&&(i=null),!(this instanceof Xe))return new Xe(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Ct(e,t){return e.line-t.line||e.ch-t.ch}function mn(e,t){return e.sticky==t.sticky&&Ct(e,t)==0}function gn(e){return Xe(e.line,e.ch)}function vn(e,t){return Ct(e,t)<0?t:e}function yn(e,t){return Ct(e,t)<0?e:t}function Y(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function x(e,t){if(t.line<e.first)return Xe(e.first,0);var i=e.first+e.size-1;return t.line>i?Xe(i,dt(e,i).text.length):k(t,dt(e,t.line).text.length)}function k(e,t){var i=e.ch;return i==null||i>t?Xe(e.line,t):i<0?Xe(e.line,0):e}function G(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=x(e,t[n]);return i}var ee=function(e,t){this.state=e,this.lookAhead=t},V=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};V.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},V.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}},V.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},V.fromSaved=function(e,t,i){return t instanceof ee?new V(e,Ft(e.mode,t.state),i,t.lookAhead):new V(e,Ft(e.mode,t),i)},V.prototype.save=function(e){var t=e!==!1?Ft(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ee(t,this.maxLookAhead):t};function Ee(e,t,i,n){var c=[e.state.modeGen],N={};Er(e,t.text,e.doc.mode,i,function(te,pe){return c.push(te,pe)},N,n);for(var z=i.state,Q=function(te){i.baseTokens=c;var pe=e.state.overlays[te],ye=1,Me=0;i.state=!0,Er(e,t.text,pe.mode,i,function(ke,He){for(var Ye=ye;Me<ke;){var Qe=c[ye];Qe>ke&&c.splice(ye,1,ke,c[ye+1],Qe),ye+=2,Me=Math.min(ke,Qe)}if(!He)return;if(pe.opaque)c.splice(Ye,ye-Ye,ke,"overlay "+He),ye=Ye+2;else for(;Ye<ye;Ye+=2){var rt=c[Ye+1];c[Ye+1]=(rt?rt+" ":"")+"overlay "+He}},N),i.state=z,i.baseTokens=null,i.baseTokenPos=1},q=0;q<e.state.overlays.length;++q)Q(q);return{styles:c,classes:N.bgClass||N.textClass?N:null}}function Ke(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=et(e,Ot(t)),c=t.text.length>e.options.maxHighlightLength&&Ft(e.doc.mode,n.state),N=Ee(e,t,n);c&&(n.state=c),t.stateAfter=n.save(!c),t.styles=N.styles,N.classes?t.styleClasses=N.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function et(e,t,i){var n=e.doc,c=e.display;if(!n.mode.startState)return new V(n,!0,t);var N=xr(e,t,i),z=N>n.first&&dt(n,N-1).stateAfter,Q=z?V.fromSaved(n,z,N):new V(n,cr(n.mode),N);return n.iter(N,t,function(q){pt(e,q.text,Q);var te=Q.line;q.stateAfter=te==t-1||te%5==0||te>=c.viewFrom&&te<c.viewTo?Q.save():null,Q.nextLine()}),i&&(n.modeFrontier=Q.line),Q}function pt(e,t,i,n){var c=e.doc.mode,N=new Pt(t,e.options.tabSize,i);for(N.start=N.pos=n||0,t==""&&Ve(c,i.state);!N.eol();)_t(c,N,i.state),N.start=N.pos}function Ve(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=tr(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function _t(e,t,i,n){for(var c=0;c<10;c++){n&&(n[0]=tr(e,i).mode);var N=e.token(t,i);if(t.pos>t.start)return N}throw new Error("Mode "+e.name+" failed to advance stream.")}var jt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function $t(e,t,i,n){var c=e.doc,N=c.mode,z;t=x(c,t);var Q=dt(c,t.line),q=et(e,t.line,i),te=new Pt(Q.text,e.options.tabSize,q),pe;for(n&&(pe=[]);(n||te.pos<t.ch)&&!te.eol();)te.start=te.pos,z=_t(N,te,q.state),n&&pe.push(new jt(te,z,Ft(c.mode,q.state)));return n?pe:new jt(te,z,q.state)}function jr(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function Er(e,t,i,n,c,N,z){var Q=i.flattenSpans;Q==null&&(Q=e.options.flattenSpans);var q=0,te=null,pe=new Pt(t,e.options.tabSize,n),ye,Me=e.options.addModeClass&&[null];for(t==""&&jr(Ve(i,n.state),N);!pe.eol();){if(pe.pos>e.options.maxHighlightLength?(Q=!1,z&&pt(e,t,n,pe.pos),pe.pos=t.length,ye=null):ye=jr(_t(i,pe,n.state,Me),N),Me){var ke=Me[0].name;ke&&(ye="m-"+(ye?ke+" "+ye:ke))}if(!Q||te!=ye){for(;q<pe.start;)q=Math.min(pe.start,q+5e3),c(q,te);te=ye}pe.start=pe.pos}for(;q<pe.pos;){var He=Math.min(pe.pos,q+5e3);c(He,te),q=He}}function xr(e,t,i){for(var n,c,N=e.doc,z=i?-1:t-(e.doc.mode.innerMode?1e3:100),Q=t;Q>z;--Q){if(Q<=N.first)return N.first;var q=dt(N,Q-1),te=q.stateAfter;if(te&&(!i||Q+(te instanceof ee?te.lookAhead:0)<=N.modeFrontier))return Q;var pe=W(q.text,null,e.options.tabSize);(c==null||n>pe)&&(c=Q-1,n=pe)}return c}function Zr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var c=dt(e,n).stateAfter;if(c&&(!(c instanceof ee)||n+c.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Dn=!1,dr=!1;function zr(){Dn=!0}function un(){dr=!0}function hn(e,t,i){this.marker=e,this.from=t,this.to=i}function Hr(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function kn(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function bn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function zn(e,t,i){var n;if(e)for(var c=0;c<e.length;++c){var N=e[c],z=N.marker,Q=N.from==null||(z.inclusiveLeft?N.from<=t:N.from<t);if(Q||N.from==t&&z.type=="bookmark"&&(!i||!N.marker.insertLeft)){var q=N.to==null||(z.inclusiveRight?N.to>=t:N.to>t);(n||(n=[])).push(new hn(z,N.from,q?null:N.to))}}return n}function Vn(e,t,i){var n;if(e)for(var c=0;c<e.length;++c){var N=e[c],z=N.marker,Q=N.to==null||(z.inclusiveRight?N.to>=t:N.to>t);if(Q||N.from==t&&z.type=="bookmark"&&(!i||N.marker.insertLeft)){var q=N.from==null||(z.inclusiveLeft?N.from<=t:N.from<t);(n||(n=[])).push(new hn(z,q?null:N.from-t,N.to==null?null:N.to-t))}}return n}function Qr(e,t){if(t.full)return null;var i=Ir(e,t.from.line)&&dt(e,t.from.line).markedSpans,n=Ir(e,t.to.line)&&dt(e,t.to.line).markedSpans;if(!i&&!n)return null;var c=t.from.ch,N=t.to.ch,z=Ct(t.from,t.to)==0,Q=zn(i,c,z),q=Vn(n,N,z),te=t.text.length==1,pe=re(t.text).length+(te?c:0);if(Q)for(var ye=0;ye<Q.length;++ye){var Me=Q[ye];if(Me.to==null){var ke=Hr(q,Me.marker);ke?te&&(Me.to=ke.to==null?null:ke.to+pe):Me.to=c}}if(q)for(var He=0;He<q.length;++He){var Ye=q[He];if(Ye.to!=null&&(Ye.to+=pe),Ye.from==null){var Qe=Hr(Q,Ye.marker);Qe||(Ye.from=pe,te&&(Q||(Q=[])).push(Ye))}else Ye.from+=pe,te&&(Q||(Q=[])).push(Ye)}Q&&(Q=$r(Q)),q&&q!=Q&&(q=$r(q));var rt=[Q];if(!te){var lt=t.text.length-2,nt;if(lt>0&&Q)for(var ut=0;ut<Q.length;++ut)Q[ut].to==null&&(nt||(nt=[])).push(new hn(Q[ut].marker,null,null));for(var Tt=0;Tt<lt;++Tt)rt.push(nt);rt.push(q)}return rt}function $r(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function _n(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(ke){if(ke.markedSpans)for(var He=0;He<ke.markedSpans.length;++He){var Ye=ke.markedSpans[He].marker;Ye.readOnly&&(!n||ne(n,Ye)==-1)&&(n||(n=[])).push(Ye)}}),!n)return null;for(var c=[{from:t,to:i}],N=0;N<n.length;++N)for(var z=n[N],Q=z.find(0),q=0;q<c.length;++q){var te=c[q];if(Ct(te.to,Q.from)<0||Ct(te.from,Q.to)>0)continue;var pe=[q,1],ye=Ct(te.from,Q.from),Me=Ct(te.to,Q.to);(ye<0||!z.inclusiveLeft&&!ye)&&pe.push({from:te.from,to:Q.from}),(Me>0||!z.inclusiveRight&&!Me)&&pe.push({from:Q.to,to:te.to}),c.splice.apply(c,pe),q+=pe.length-3}return c}function ci(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function En(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function nr(e){return e.inclusiveLeft?-1:0}function Ht(e){return e.inclusiveRight?1:0}function yr(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),c=t.find(),N=Ct(n.from,c.from)||nr(e)-nr(t);if(N)return-N;var z=Ct(n.to,c.to)||Ht(e)-Ht(t);return z||t.id-e.id}function kt(e,t){var i=dr&&e.markedSpans,n;if(i)for(var c=void 0,N=0;N<i.length;++N)c=i[N],c.marker.collapsed&&(t?c.from:c.to)==null&&(!n||yr(n,c.marker)<0)&&(n=c.marker);return n}function ar(e){return kt(e,!0)}function Kt(e){return kt(e,!1)}function nn(e,t){var i=dr&&e.markedSpans,n;if(i)for(var c=0;c<i.length;++c){var N=i[c];N.marker.collapsed&&(N.from==null||N.from<t)&&(N.to==null||N.to>t)&&(!n||yr(n,N.marker)<0)&&(n=N.marker)}return n}function fr(e,t,i,n,c){var N=dt(e,t),z=dr&&N.markedSpans;if(z)for(var Q=0;Q<z.length;++Q){var q=z[Q];if(!q.marker.collapsed)continue;var te=q.marker.find(0),pe=Ct(te.from,i)||nr(q.marker)-nr(c),ye=Ct(te.to,n)||Ht(q.marker)-Ht(c);if(pe>=0&&ye<=0||pe<=0&&ye>=0)continue;if(pe<=0&&(q.marker.inclusiveRight&&c.inclusiveLeft?Ct(te.to,i)>=0:Ct(te.to,i)>0)||pe>=0&&(q.marker.inclusiveRight&&c.inclusiveLeft?Ct(te.from,n)<=0:Ct(te.from,n)<0))return!0}}function Ar(e){for(var t;t=ar(e);)e=t.find(-1,!0).line;return e}function Yn(e){for(var t;t=Kt(e);)e=t.find(1,!0).line;return e}function xn(e){for(var t,i;t=Kt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function di(e,t){var i=dt(e,t),n=Ar(i);return i==n?t:Ot(n)}function Tn(e,t){if(t>e.lastLine())return t;var i=dt(e,t),n;if(!an(e,i))return t;for(;n=Kt(i);)i=n.find(1,!0).line;return Ot(i)+1}function an(e,t){var i=dr&&t.markedSpans;if(i)for(var n=void 0,c=0;c<i.length;++c){if(n=i[c],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&fi(e,t,n))return!0}}function fi(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return fi(e,n.line,Hr(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var c=void 0,N=0;N<t.markedSpans.length;++N)if(c=t.markedSpans[N],c.marker.collapsed&&!c.marker.widgetNode&&c.from==i.to&&(c.to==null||c.to!=i.from)&&(c.marker.inclusiveLeft||i.marker.inclusiveRight)&&fi(e,t,c))return!0}function qr(e){e=Ar(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var c=i.lines[n];if(c==e)break;t+=c.height}for(var N=i.parent;N;i=N,N=i.parent)for(var z=0;z<N.children.length;++z){var Q=N.children[z];if(Q==i)break;t+=Q.height}return t}function pi(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=ar(n);){var c=i.find(0,!0);n=c.from.line,t+=c.from.ch-c.to.ch}for(n=e;i=Kt(n);){var N=i.find(0,!0);t-=n.text.length-N.from.ch,n=N.to.line,t+=n.text.length-N.to.ch}return t}function ji(e){var t=e.display,i=e.doc;t.maxLine=dt(i,i.first),t.maxLineLength=pi(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var c=pi(n);c>t.maxLineLength&&(t.maxLineLength=c,t.maxLine=n)})}var Mn=function(e,t,i){this.text=e,En(this,t),this.height=i?i(this):1};Mn.prototype.lineNo=function(){return Ot(this)},Te(Mn);function ua(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),ci(e),En(e,i);var c=n?n(e):1;c!=e.height&&Jt(e,c)}function gt(e){e.parent=null,ci(e)}var At={},Et={};function Dt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Et:At;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Bt(e,t){var i=S("span",null,null,r?"padding-right: .1px":null),n={pre:S("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var c=0;c<=(t.rest?t.rest.length:0);c++){var N=c?t.rest[c-1]:t.line,z=void 0;n.pos=0,n.addToken=Nt,wt(e.display.measure)&&(z=qe(N,e.doc.direction))&&(n.addToken=Dr(n.addToken,z)),n.map=[];var Q=t!=e.display.externalMeasured&&Ot(N);cn(N,n,Ke(e,N,Q)),N.styleClasses&&(N.styleClasses.bgClass&&(n.bgClass=_(N.styleClasses.bgClass,n.bgClass||"")),N.styleClasses.textClass&&(n.textClass=_(N.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(mt(e.display.measure))),c==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(r){var q=n.content.lastChild;(/\bcm-tab\b/.test(q.className)||q.querySelector&&q.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return je(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=_(n.pre.className,n.textClass||"")),n}function Yt(e){var t=f("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Nt(e,t,i,n,c,N,z){if(!t)return;var Q=e.splitSpaces?ur(t,e.trailingSpace):t,q=e.cm.state.specialChars,te=!1,pe;if(!q.test(t))e.col+=t.length,pe=document.createTextNode(Q),e.map.push(e.pos,e.pos+t.length,pe),K&&H<9&&(te=!0),e.pos+=t.length;else{pe=document.createDocumentFragment();for(var ye=0;;){q.lastIndex=ye;var Me=q.exec(t),ke=Me?Me.index-ye:t.length-ye;if(ke){var He=document.createTextNode(Q.slice(ye,ye+ke));K&&H<9?pe.appendChild(f("span",[He])):pe.appendChild(He),e.map.push(e.pos,e.pos+ke,He),e.col+=ke,e.pos+=ke}if(!Me)break;ye+=ke+1;var Ye=void 0;if(Me[0]==" "){var Qe=e.cm.options.tabSize,rt=Qe-e.col%Qe;Ye=pe.appendChild(f("span",he(rt),"cm-tab")),Ye.setAttribute("role","presentation"),Ye.setAttribute("cm-text"," "),e.col+=rt}else Me[0]=="\r"||Me[0]==`
`?(Ye=pe.appendChild(f("span",Me[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ye.setAttribute("cm-text",Me[0]),e.col+=1):(Ye=e.cm.options.specialCharPlaceholder(Me[0]),Ye.setAttribute("cm-text",Me[0]),K&&H<9?pe.appendChild(f("span",[Ye])):pe.appendChild(Ye),e.col+=1);e.map.push(e.pos,e.pos+1,Ye),e.pos++}}if(e.trailingSpace=Q.charCodeAt(t.length-1)==32,i||n||c||te||N||z){var lt=i||"";n&&(lt+=n),c&&(lt+=c);var nt=f("span",[pe],lt,N);if(z)for(var ut in z)z.hasOwnProperty(ut)&&ut!="style"&&ut!="class"&&nt.setAttribute(ut,z[ut]);return e.content.appendChild(nt)}e.content.appendChild(pe)}function ur(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",c=0;c<e.length;c++){var N=e.charAt(c);N==" "&&i&&(c==e.length-1||e.charCodeAt(c+1)==32)&&(N="\xA0"),n+=N,i=N==" "}return n}function Dr(e,t){return function(i,n,c,N,z,Q,q){c=c?c+" cm-force-border":"cm-force-border";for(var te=i.pos,pe=te+n.length;;){for(var ye=void 0,Me=0;Me<t.length&&!(ye=t[Me],ye.to>te&&ye.from<=te);Me++);if(ye.to>=pe)return e(i,n,c,N,z,Q,q);e(i,n.slice(0,ye.to-te),c,N,null,Q,q),N=null,n=n.slice(ye.to-te),te=ye.to}}}function Mt(e,t,i,n){var c=!n&&i.widgetNode;c&&e.map.push(e.pos,e.pos+t,c),!n&&e.cm.display.input.needsContentAttribute&&(c||(c=e.content.appendChild(document.createElement("span"))),c.setAttribute("cm-marker",i.id)),c&&(e.cm.display.input.setUneditable(c),e.content.appendChild(c)),e.pos+=t,e.trailingSpace=!1}function cn(e,t,i){var n=e.markedSpans,c=e.text,N=0;if(!n){for(var z=1;z<i.length;z+=2)t.addToken(t,c.slice(N,N=i[z]),Dt(i[z+1],t.cm.options));return}for(var Q=c.length,q=0,te=1,pe="",ye,Me,ke=0,He,Ye,Qe,rt,lt;;){if(ke==q){He=Ye=Qe=Me="",lt=null,rt=null,ke=Infinity;for(var nt=[],ut=void 0,Tt=0;Tt<n.length;++Tt){var vt=n[Tt],Rt=vt.marker;if(Rt.type=="bookmark"&&vt.from==q&&Rt.widgetNode)nt.push(Rt);else if(vt.from<=q&&(vt.to==null||vt.to>q||Rt.collapsed&&vt.to==q&&vt.from==q)){if(vt.to!=null&&vt.to!=q&&ke>vt.to&&(ke=vt.to,Ye=""),Rt.className&&(He+=" "+Rt.className),Rt.css&&(Me=(Me?Me+";":"")+Rt.css),Rt.startStyle&&vt.from==q&&(Qe+=" "+Rt.startStyle),Rt.endStyle&&vt.to==ke&&(ut||(ut=[])).push(Rt.endStyle,vt.to),Rt.title&&((lt||(lt={})).title=Rt.title),Rt.attributes)for(var Xt in Rt.attributes)(lt||(lt={}))[Xt]=Rt.attributes[Xt];Rt.collapsed&&(!rt||yr(rt.marker,Rt)<0)&&(rt=vt)}else vt.from>q&&ke>vt.from&&(ke=vt.from)}if(ut)for(var gr=0;gr<ut.length;gr+=2)ut[gr+1]==ke&&(Ye+=" "+ut[gr]);if(!rt||rt.from==q)for(var er=0;er<nt.length;++er)Mt(t,0,nt[er]);if(rt&&(rt.from||0)==q){if(Mt(t,(rt.to==null?Q+1:rt.to)-q,rt.marker,rt.from==null),rt.to==null)return;rt.to==q&&(rt=!1)}}if(q>=Q)break;for(var Gr=Math.min(Q,ke);;){if(pe){var Nr=q+pe.length;if(!rt){var sr=Nr>Gr?pe.slice(0,Gr-q):pe;t.addToken(t,sr,ye?ye+He:He,Qe,q+sr.length==ke?Ye:"",Me,lt)}if(Nr>=Gr){pe=pe.slice(Gr-q),q=Gr;break}q=Nr,Qe=""}pe=c.slice(N,N=i[te++]),ye=Dt(i[te++],t.cm.options)}}}function Wt(e,t,i){this.line=t,this.rest=xn(t),this.size=this.rest?Ot(re(this.rest))-i+1:1,this.node=this.text=null,this.hidden=an(e,t)}function kr(e,t,i){for(var n=[],c,N=t;N<i;N=c){var z=new Wt(e.doc,dt(e.doc,N),N);c=N+z.size,n.push(z)}return n}var Tr=null;function Jr(e){Tr?Tr.ops.push(e):e.ownsGroup=Tr={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var c=e.ops[n];if(c.cursorActivityHandlers)for(;c.cursorActivityCalled<c.cursorActivityHandlers.length;)c.cursorActivityHandlers[c.cursorActivityCalled++].call(null,c.cm)}}while(i<t.length)}function Io(e,t){var i=e.ownsGroup;if(!i)return;try{Lo(i)}finally{Tr=null,t(i)}}var mi=null;function br(e,t){var i=ct(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),c;Tr?c=Tr.delayedCallbacks:mi?c=mi:(c=mi=[],setTimeout(Do,0));for(var N=function(Q){c.push(function(){return i[Q].apply(null,n)})},z=0;z<i.length;++z)N(z)}function Do(){var e=mi;mi=null;for(var t=0;t<e.length;++t)e[t]()}function Xa(e,t,i,n){for(var c=0;c<t.changes.length;c++){var N=t.changes[c];N=="text"?Mo(e,t):N=="gutter"?Ja(e,t,i,n):N=="class"?ha(e,t):N=="widget"&&Po(e,t,n)}t.changes=null}function gi(e){return e.node==e.text&&(e.node=f("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),K&&H<8&&(e.node.style.zIndex=2)),e.node}function ko(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=gi(t);t.background=n.insertBefore(f("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Bt(e,t)}function Mo(e,t){var i=t.text.className,n=$a(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,ha(e,t)):i&&(t.text.className=i)}function ha(e,t){ko(e,t),t.line.wrapClass?gi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Ja(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var c=gi(t);t.gutterBackground=f("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),c.insertBefore(t.gutterBackground,t.text)}var N=t.line.gutterMarkers;if(e.options.lineNumbers||N){var z=gi(t),Q=t.gutter=f("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Q),z.insertBefore(Q,t.text),t.line.gutterClass&&(Q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!N||!N["CodeMirror-linenumbers"])&&(t.lineNumber=Q.appendChild(f("div",Xr(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),N)for(var q=0;q<e.display.gutterSpecs.length;++q){var te=e.display.gutterSpecs[q].className,pe=N.hasOwnProperty(te)&&N[te];pe&&Q.appendChild(f("div",[pe],"CodeMirror-gutter-elt","left: "+n.gutterLeft[te]+"px; width: "+n.gutterWidth[te]+"px"))}}}function Po(e,t,i){t.alignable&&(t.alignable=null);for(var n=O("CodeMirror-linewidget"),c=t.node.firstChild,N=void 0;c;c=N)N=c.nextSibling,n.test(c.className)&&t.node.removeChild(c);Za(e,t,i)}function No(e,t,i,n){var c=$a(e,t);return t.text=t.node=c.pre,c.bgClass&&(t.bgClass=c.bgClass),c.textClass&&(t.textClass=c.textClass),ha(e,t),Ja(e,t,i,n),Za(e,t,n),t.node}function Za(e,t,i){if(Qa(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)Qa(e,t.rest[n],t,i,!1)}function Qa(e,t,i,n,c){if(!t.widgets)return;for(var N=gi(i),z=0,Q=t.widgets;z<Q.length;++z){var q=Q[z],te=f("div",[q.node],"CodeMirror-linewidget"+(q.className?" "+q.className:""));q.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Fo(q,te,i,n),e.display.input.setUneditable(te),c&&q.above?N.insertBefore(te,i.gutter||i.text):N.appendChild(te),br(q,"redraw")}}function Fo(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var c=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(c-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=c+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function vi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!b(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),T(t.display.measure,f("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function dn(e,t){for(var i=Ce(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Hi(e){return e.lineSpace.offsetTop}function ca(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=T(e.measure,f("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function sn(e){return oe-e.display.nativeBarWidth}function Pn(e){return e.display.scroller.clientWidth-sn(e)-e.display.barWidth}function da(e){return e.display.scroller.clientHeight-sn(e)-e.display.barHeight}function Bo(e,t,i){var n=e.options.lineWrapping,c=n&&Pn(e);if(!t.measure.heights||n&&t.measure.width!=c){var N=t.measure.heights=[];if(n){t.measure.width=c;for(var z=t.text.firstChild.getClientRects(),Q=0;Q<z.length-1;Q++){var q=z[Q],te=z[Q+1];Math.abs(q.bottom-te.bottom)>2&&N.push((q.bottom+te.top)/2-i.top)}}N.push(i.bottom-i.top)}}function es(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var c=0;c<e.rest.length;c++)if(Ot(e.rest[c])>i)return{map:e.measure.maps[c],cache:e.measure.caches[c],before:!0}}function Uo(e,t){t=Ar(t);var i=Ot(t),n=e.display.externalMeasured=new Wt(e.doc,t,i);n.lineN=i;var c=n.built=Bt(e,n);return n.text=c.pre,T(e.display.lineMeasure,c.pre),n}function ts(e,t,i,n){return on(e,Xn(e,t),i,n)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Bn(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Xn(e,t){var i=Ot(t),n=fa(e,i);n&&!n.text?n=null:n&&n.changes&&(Xa(e,n,i,ba(e)),e.curOp.forceUpdate=!0),n||(n=Uo(e,t));var c=es(n,t,i);return{line:t,view:n,rect:null,map:c.map,cache:c.cache,before:c.before,hasHeights:!1}}function on(e,t,i,n,c){t.before&&(i=-1);var N=i+(n||""),z;return t.cache.hasOwnProperty(N)?z=t.cache[N]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Bo(e,t.view,t.rect),t.hasHeights=!0),z=Ho(e,t,i,n),z.bogus||(t.cache[N]=z)),{left:z.left,right:z.right,top:c?z.rtop:z.top,bottom:c?z.rbottom:z.bottom}}var rs={left:0,right:0,top:0,bottom:0};function ns(e,t,i){for(var n,c,N,z,Q,q,te=0;te<e.length;te+=3)if(Q=e[te],q=e[te+1],t<Q?(c=0,N=1,z="left"):t<q?(c=t-Q,N=c+1):(te==e.length-3||t==q&&e[te+3]>t)&&(N=q-Q,c=N-1,t>=q&&(z="right")),c!=null){if(n=e[te+2],Q==q&&i==(n.insertLeft?"left":"right")&&(z=i),i=="left"&&c==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)n=e[(te-=3)+2],z="left";if(i=="right"&&c==q-Q)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)n=e[(te+=3)+2],z="right";break}return{node:n,start:c,end:N,collapse:z,coverStart:Q,coverEnd:q}}function jo(e,t){var i=rs;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var c=e.length-1;c>=0&&!((i=e[c]).left!=i.right);c--);return i}function Ho(e,t,i,n){var c=ns(t.map,i,n),N=c.node,z=c.start,Q=c.end,q=c.collapse,te;if(N.nodeType==3){for(var pe=0;pe<4;pe++){for(;z&&Ae(t.line.text.charAt(c.coverStart+z));)--z;for(;c.coverStart+Q<c.coverEnd&&Ae(t.line.text.charAt(c.coverStart+Q));)++Q;if(K&&H<9&&z==0&&Q==c.coverEnd-c.coverStart?te=N.parentNode.getBoundingClientRect():te=jo(y(N,z,Q).getClientRects(),n),te.left||te.right||z==0)break;Q=z,z=z-1,q="right"}K&&H<11&&(te=Wo(e.display.measure,te))}else{z>0&&(q=n="right");var ye;e.options.lineWrapping&&(ye=N.getClientRects()).length>1?te=ye[n=="right"?ye.length-1:0]:te=N.getBoundingClientRect()}if(K&&H<9&&!z&&(!te||!te.left&&!te.right)){var Me=N.parentNode.getClientRects()[0];Me?te={left:Me.left,right:Me.left+Jn(e.display),top:Me.top,bottom:Me.bottom}:te=rs}for(var ke=te.top-t.rect.top,He=te.bottom-t.rect.top,Ye=(ke+He)/2,Qe=t.view.measure.heights,rt=0;rt<Qe.length-1&&!(Ye<Qe[rt]);rt++);var lt=rt?Qe[rt-1]:0,nt=Qe[rt],ut={left:(q=="right"?te.right:te.left)-t.rect.left,right:(q=="left"?te.left:te.right)-t.rect.left,top:lt,bottom:nt};return!te.left&&!te.right&&(ut.bogus=!0),e.options.singleCursorHeightPerLine||(ut.rtop=ke,ut.rbottom=He),ut}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!qt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function is(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,C(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)is(e.display.view[t])}function yi(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 v&&o?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return v&&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 i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=vi(e.widgets[i]));return t}function Wi(e,t,i,n,c){if(!c){var N=pa(t);i.top+=N,i.bottom+=N}if(n=="line")return i;n||(n="local");var z=qr(t);if(n=="local"?z+=Hi(e.display):z-=e.display.viewOffset,n=="page"||n=="window"){var Q=e.display.lineSpace.getBoundingClientRect();z+=Q.top+(n=="window"?0:os());var q=Q.left+(n=="window"?0:ss());i.left+=q,i.right+=q}return i.top+=z,i.bottom+=z,i}function ls(e,t,i){if(i=="div")return t;var n=t.left,c=t.top;if(i=="page")n-=ss(),c-=os();else if(i=="local"||!i){var N=e.display.sizer.getBoundingClientRect();n+=N.left,c+=N.top}var z=e.display.lineSpace.getBoundingClientRect();return{left:n-z.left,top:c-z.top}}function ma(e,t,i,n,c){return n||(n=dt(e.doc,t.line)),Wi(e,n,ts(e,n,t.ch,c),i)}function en(e,t,i,n,c,N){n=n||dt(e.doc,t.line),c||(c=Xn(e,n));function z(He,Ye){var Qe=on(e,c,He,Ye?"right":"left",N);return Ye?Qe.left=Qe.right:Qe.right=Qe.left,Wi(e,n,Qe,i)}var Q=qe(n,e.doc.direction),q=t.ch,te=t.sticky;if(q>=n.text.length?(q=n.text.length,te="before"):q<=0&&(q=0,te="after"),!Q)return z(te=="before"?q-1:q,te=="before");function pe(He,Ye,Qe){var rt=Q[Ye],lt=rt.level==1;return z(Qe?He-1:He,lt!=Qe)}var ye=Je(Q,q,te),Me=Ze,ke=pe(q,ye,te=="before");return Me!=null&&(ke.other=pe(q,Me,te!="before")),ke}function us(e,t){var i=0;t=x(e.doc,t),e.options.lineWrapping||(i=Jn(e.display)*t.ch);var n=dt(e.doc,t.line),c=qr(n)+Hi(e.display);return{left:i,right:i,top:c,bottom:c+n.height}}function ga(e,t,i,n,c){var N=Xe(e,t,i);return N.xRel=c,n&&(N.outside=n),N}function va(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return ga(n.first,0,null,-1,-1);var c=lr(n,i),N=n.first+n.size-1;if(c>N)return ga(n.first+n.size-1,dt(n,N).text.length,null,1,1);t<0&&(t=0);for(var z=dt(n,c);;){var Q=Go(e,z,c,t,i),q=nn(z,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!q)return Q;var te=q.find(1);if(te.line==c)return te;z=dt(n,c=te.line)}}function hs(e,t,i,n){n-=pa(t);var c=t.text.length,N=Ge(function(z){return on(e,i,z-1).bottom<=n},c,0);return c=Ge(function(z){return on(e,i,z).top>n},N,c),{begin:N,end:c}}function cs(e,t,i,n){i||(i=Xn(e,t));var c=Wi(e,t,on(e,i,n),"line").top;return hs(e,t,i,c)}function ya(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Go(e,t,i,n,c){c-=qr(t);var N=Xn(e,t),z=pa(t),Q=0,q=t.text.length,te=!0,pe=qe(t,e.doc.direction);if(pe){var ye=(e.options.lineWrapping?zo:Ko)(e,t,i,N,pe,n,c);te=ye.level!=1,Q=te?ye.from:ye.to-1,q=te?ye.to:ye.from-1}var Me=null,ke=null,He=Ge(function(Tt){var vt=on(e,N,Tt);return vt.top+=z,vt.bottom+=z,ya(vt,n,c,!1)?(vt.top<=c&&vt.left<=n&&(Me=Tt,ke=vt),!0):!1},Q,q),Ye,Qe,rt=!1;if(ke){var lt=n-ke.left<ke.right-n,nt=lt==te;He=Me+(nt?0:1),Qe=nt?"after":"before",Ye=lt?ke.left:ke.right}else{!te&&(He==q||He==Q)&&He++,Qe=He==0?"after":He==t.text.length?"before":on(e,N,He-(te?1:0)).bottom+z<=c==te?"after":"before";var ut=en(e,Xe(i,He,Qe),"line",t,N);Ye=ut.left,rt=c<ut.top?-1:c>=ut.bottom?1:0}return He=Ie(t.text,He,1),ga(i,He,Qe,rt,n-Ye)}function Ko(e,t,i,n,c,N,z){var Q=Ge(function(ye){var Me=c[ye],ke=Me.level!=1;return ya(en(e,Xe(i,ke?Me.to:Me.from,ke?"before":"after"),"line",t,n),N,z,!0)},0,c.length-1),q=c[Q];if(Q>0){var te=q.level!=1,pe=en(e,Xe(i,te?q.from:q.to,te?"after":"before"),"line",t,n);ya(pe,N,z,!0)&&pe.top>z&&(q=c[Q-1])}return q}function zo(e,t,i,n,c,N,z){var Q=hs(e,t,n,z),q=Q.begin,te=Q.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var pe=null,ye=null,Me=0;Me<c.length;Me++){var ke=c[Me];if(ke.from>=te||ke.to<=q)continue;var He=ke.level!=1,Ye=on(e,n,He?Math.min(te,ke.to)-1:Math.max(q,ke.from)).right,Qe=Ye<N?N-Ye+1e9:Ye-N;(!pe||ye>Qe)&&(pe=ke,ye=Qe)}return pe||(pe=c[c.length-1]),pe.from<q&&(pe={from:q,to:pe.to,level:pe.level}),pe.to>te&&(pe={from:pe.from,to:te,level:pe.level}),pe}var Nn;function $n(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Nn==null){Nn=f("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Nn.appendChild(document.createTextNode("x")),Nn.appendChild(f("br"));Nn.appendChild(document.createTextNode("x"))}T(e.measure,Nn);var i=Nn.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),C(e.measure),i||1}function Jn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=f("span","xxxxxxxxxx"),i=f("pre",[t],"CodeMirror-line-like");T(e.measure,i);var n=t.getBoundingClientRect(),c=(n.right-n.left)/10;return c>2&&(e.cachedCharWidth=c),c||10}function ba(e){for(var t=e.display,i={},n={},c=t.gutters.clientLeft,N=t.gutters.firstChild,z=0;N;N=N.nextSibling,++z){var Q=e.display.gutterSpecs[z].className;i[Q]=N.offsetLeft+N.clientLeft+c,n[Q]=N.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ds(e){var t=$n(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Jn(e.display)-3);return function(c){if(an(e.doc,c))return 0;var N=0;if(c.widgets)for(var z=0;z<c.widgets.length;z++)c.widgets[z].height&&(N+=c.widgets[z].height);return i?N+(Math.ceil(c.text.length/n)||1)*t:N+t}}function Ea(e){var t=e.doc,i=ds(e);t.iter(function(n){var c=i(n);c!=n.height&&Jt(n,c)})}function Fn(e,t,i,n){var c=e.display;if(!i&&Ce(t).getAttribute("cm-not-content")=="true")return null;var N,z,Q=c.lineSpace.getBoundingClientRect();try{N=t.clientX-Q.left,z=t.clientY-Q.top}catch(ye){return null}var q=va(e,N,z),te;if(n&&q.xRel>0&&(te=dt(e.doc,q.line).text).length==q.ch){var pe=W(te,te.length,e.options.tabSize)-te.length;q=Xe(q.line,Math.max(0,Math.round((N-qa(e.display).left)/Jn(e.display))-pe))}return q}function Bn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function Mr(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var c=e.display;if(n&&i<c.viewTo&&(c.updateLineNumbers==null||c.updateLineNumbers>t)&&(c.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=c.viewTo)dr&&di(e.doc,t)<c.viewTo&&Sn(e);else if(i<=c.viewFrom)dr&&Tn(e.doc,i+n)>c.viewFrom?Sn(e):(c.viewFrom+=n,c.viewTo+=n);else if(t<=c.viewFrom&&i>=c.viewTo)Sn(e);else if(t<=c.viewFrom){var N=Gi(e,i,i+n,1);N?(c.view=c.view.slice(N.index),c.viewFrom=N.lineN,c.viewTo+=n):Sn(e)}else if(i>=c.viewTo){var z=Gi(e,t,t,-1);z?(c.view=c.view.slice(0,z.index),c.viewTo=z.lineN):Sn(e)}else{var Q=Gi(e,t,t,-1),q=Gi(e,i,i+n,1);Q&&q?(c.view=c.view.slice(0,Q.index).concat(kr(e,Q.lineN,q.lineN)).concat(c.view.slice(q.index)),c.viewTo+=n):Sn(e)}var te=c.externalMeasured;te&&(i<te.lineN?te.lineN+=n:t<te.lineN+te.size&&(c.externalMeasured=null))}function wn(e,t,i){e.curOp.viewChanged=!0;var n=e.display,c=e.display.externalMeasured;if(c&&t>=c.lineN&&t<c.lineN+c.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var N=n.view[Bn(e,t)];if(N.node==null)return;var z=N.changes||(N.changes=[]);ne(z,i)==-1&&z.push(i)}function Sn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gi(e,t,i,n){var c=Bn(e,t),N,z=e.display.view;if(!dr||i==e.doc.first+e.doc.size)return{index:c,lineN:i};for(var Q=e.display.viewFrom,q=0;q<c;q++)Q+=z[q].size;if(Q!=t){if(n>0){if(c==z.length-1)return null;N=Q+z[c].size-t,c++}else N=Q-t;t+=N,i+=N}for(;di(e.doc,i)!=i;){if(c==(n<0?0:z.length-1))return null;i+=n*z[c-(n<0?1:0)].size,c+=n}return{index:c,lineN:i}}function Vo(e,t,i){var n=e.display,c=n.view;c.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=kr(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=kr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Bn(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(kr(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Bn(e,i)))),n.viewTo=i}function fs(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var c=t[n];!c.hidden&&(!c.node||c.changes)&&++i}return i}function bi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},c=n.cursors=document.createDocumentFragment(),N=n.selection=document.createDocumentFragment(),z=0;z<i.sel.ranges.length;z++){if(!t&&z==i.sel.primIndex)continue;var Q=i.sel.ranges[z];if(Q.from().line>=e.display.viewTo||Q.to().line<e.display.viewFrom)continue;var q=Q.empty();(q||e.options.showCursorWhenSelecting)&&ms(e,Q.head,c),q||Yo(e,Q,N)}return n}function ms(e,t,i){var n=en(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),c=i.appendChild(f("div","\xA0","CodeMirror-cursor"));if(c.style.left=n.left+"px",c.style.top=n.top+"px",c.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var N=i.appendChild(f("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));N.style.display="",N.style.left=n.other.left+"px",N.style.top=n.other.top+"px",N.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Ki(e,t){return e.top-t.top||e.left-t.left}function Yo(e,t,i){var n=e.display,c=e.doc,N=document.createDocumentFragment(),z=qa(e.display),Q=z.left,q=Math.max(n.sizerWidth,Pn(e)-n.sizer.offsetLeft)-z.right,te=c.direction=="ltr";function pe(nt,ut,Tt,vt){ut<0&&(ut=0),ut=Math.round(ut),vt=Math.round(vt),N.appendChild(f("div",null,"CodeMirror-selected","position: absolute; left: "+nt+`px;
top: `+ut+"px; width: "+(Tt==null?q-nt:Tt)+`px;
height: `+(vt-ut)+"px"))}function ye(nt,ut,Tt){var vt=dt(c,nt),Rt=vt.text.length,Xt,gr;function er(sr,Fr){return ma(e,Xe(nt,sr),"div",vt,Fr)}function Gr(sr,Fr,_r){var hr=cs(e,vt,null,sr),or=Fr=="ltr"==(_r=="after")?"left":"right",rr=_r=="after"?hr.begin:hr.end-(/\s/.test(vt.text.charAt(hr.end-1))?2:1);return er(rr,or)[or]}var Nr=qe(vt,c.direction);return $e(Nr,ut||0,Tt==null?Rt:Tt,function(sr,Fr,_r,hr){var or=_r=="ltr",rr=er(sr,or?"left":"right"),Br=er(Fr-1,or?"right":"left"),ui=ut==null&&sr==0,In=Tt==null&&Fr==Rt,Sr=hr==0,ln=!Nr||hr==Nr.length-1;if(Br.top-rr.top<=3){var vr=(te?ui:In)&&Sr,Va=(te?In:ui)&&ln,pn=vr?Q:(or?rr:Br).left,Gn=Va?q:(or?Br:rr).right;pe(pn,rr.top,Gn-pn,rr.bottom)}else{var Kn,Rr,hi,Ya;or?(Kn=te&&ui&&Sr?Q:rr.left,Rr=te?q:Gr(sr,_r,"before"),hi=te?Q:Gr(Fr,_r,"after"),Ya=te&&In&&ln?q:Br.right):(Kn=te?Gr(sr,_r,"before"):Q,Rr=!te&&ui&&Sr?q:rr.right,hi=!te&&In&&ln?Q:Br.left,Ya=te?Gr(Fr,_r,"after"):q),pe(Kn,rr.top,Rr-Kn,rr.bottom),rr.bottom<Br.top&&pe(Q,rr.bottom,null,Br.top),pe(hi,Br.top,Ya-hi,Br.bottom)}(!Xt||Ki(rr,Xt)<0)&&(Xt=rr),Ki(Br,Xt)<0&&(Xt=Br),(!gr||Ki(rr,gr)<0)&&(gr=rr),Ki(Br,gr)<0&&(gr=Br)}),{start:Xt,end:gr}}var Me=t.from(),ke=t.to();if(Me.line==ke.line)ye(Me.line,Me.ch,ke.ch);else{var He=dt(c,Me.line),Ye=dt(c,ke.line),Qe=Ar(He)==Ar(Ye),rt=ye(Me.line,Me.ch,Qe?He.text.length+1:null).end,lt=ye(ke.line,Qe?0:null,ke.ch).start;Qe&&(rt.top<lt.top-2?(pe(rt.right,rt.top,null,rt.bottom),pe(Q,lt.top,lt.left,lt.bottom)):pe(rt.right,rt.top,lt.left-rt.right,rt.bottom)),rt.bottom<lt.top&&pe(Q,rt.bottom,null,lt.top)}i.appendChild(N)}function xa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Zn(e),t.cursorDiv.style.visibility=(i=!i)?"":"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,Zn(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(je(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),r&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function Zn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(je(e,"blur",e,t),e.state.focused=!1,A(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zi(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var c=t.view[n],N=e.options.lineWrapping,z=void 0,Q=0;if(c.hidden)continue;if(K&&H<8){var q=c.node.offsetTop+c.node.offsetHeight;z=q-i,i=q}else{var te=c.node.getBoundingClientRect();z=te.bottom-te.top,!N&&c.text.firstChild&&(Q=c.text.firstChild.getBoundingClientRect().right-te.left-1)}var pe=c.line.height-z;if((pe>.005||pe<-.005)&&(Jt(c.line,z),ys(c.line),c.rest))for(var ye=0;ye<c.rest.length;ye++)ys(c.rest[ye]);if(Q>e.display.sizerWidth){var Me=Math.ceil(Q/Jn(e.display));Me>e.display.maxLineLength&&(e.display.maxLineLength=Me,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Vi(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Hi(e));var c=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,N=lr(t,n),z=lr(t,c);if(i&&i.ensure){var Q=i.ensure.from.line,q=i.ensure.to.line;Q<N?(N=Q,z=lr(t,qr(dt(t,Q))+e.wrapper.clientHeight)):Math.min(q,t.lastLine())>=z&&(N=lr(t,qr(dt(t,q))-e.wrapper.clientHeight),z=q)}return{from:N,to:Math.max(z,N+1)}}function Xo(e,t){if(We(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),c=null;if(t.top+n.top<0?c=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(c=!1),c!=null&&!h){var N=f("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Hi(e.display))+`px;
height: `+(t.bottom-t.top+sn(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(N),N.scrollIntoView(c),e.display.lineSpace.removeChild(N)}}function $o(e,t,i,n){n==null&&(n=0);var c;!e.options.lineWrapping&&t==i&&(t=t.ch?Xe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Xe(t.line,t.ch+1,"before"):t);for(var N=0;N<5;N++){var z=!1,Q=en(e,t),q=!i||i==t?Q:en(e,i);c={left:Math.min(Q.left,q.left),top:Math.min(Q.top,q.top)-n,right:Math.max(Q.left,q.left),bottom:Math.max(Q.bottom,q.bottom)+n};var te=wa(e,c),pe=e.doc.scrollTop,ye=e.doc.scrollLeft;if(te.scrollTop!=null&&(Ei(e,te.scrollTop),Math.abs(e.doc.scrollTop-pe)>1&&(z=!0)),te.scrollLeft!=null&&(Un(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-ye)>1&&(z=!0)),!z)break}return c}function Jo(e,t){var i=wa(e,t);i.scrollTop!=null&&Ei(e,i.scrollTop),i.scrollLeft!=null&&Un(e,i.scrollLeft)}function wa(e,t){var i=e.display,n=$n(e.display);t.top<0&&(t.top=0);var c=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,N=da(e),z={};t.bottom-t.top>N&&(t.bottom=t.top+N);var Q=e.doc.height+ca(i),q=t.top<n,te=t.bottom>Q-n;if(t.top<c)z.scrollTop=q?0:t.top;else if(t.bottom>c+N){var pe=Math.min(t.top,(te?Q:t.bottom)-N);pe!=c&&(z.scrollTop=pe)}var ye=e.options.fixedGutter?0:i.gutters.offsetWidth,Me=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-ye,ke=Pn(e)-i.gutters.offsetWidth,He=t.right-t.left>ke;return He&&(t.right=t.left+ke),t.left<10?z.scrollLeft=0:t.left<Me?z.scrollLeft=Math.max(0,t.left+ye-(He?0:10)):t.right>ke+Me-3&&(z.scrollLeft=t.right+(He?0:10)-ke),z}function Sa(e,t){if(t==null)return;Yi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qn(e){Yi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _i(e,t,i){(t!=null||i!=null)&&Yi(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zo(e,t){Yi(e),e.curOp.scrollToPos=t}function Yi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=us(e,t.from),n=us(e,t.to);bs(e,i,n,t.margin)}}function bs(e,t,i,n){var c=wa(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});_i(e,c.scrollLeft,c.scrollTop)}function Ei(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||Aa(e,{top:t}),_s(e,t,!0),P&&Aa(e),wi(e,100)}function _s(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Un(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function xi(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+ca(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var jn=function(e,t,i){this.cm=i;var n=this.vert=f("div",[f("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),c=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=c.tabIndex=-1,e(n),e(c),Be(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Be(c,"scroll",function(){c.clientWidth&&t(c.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&H<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};jn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var c=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+c)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var N=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+N)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},jn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},jn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},jn.prototype.zeroWidthHack=function(){var e=s&&!u?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $,this.disableVert=new $},jn.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var c=e.getBoundingClientRect(),N=i=="vert"?document.elementFromPoint(c.right-1,(c.top+c.bottom)/2):document.elementFromPoint((c.right+c.left)/2,c.bottom-1);N!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},jn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ti=function(){};Ti.prototype.update=function(){return{bottom:0,right:0}},Ti.prototype.setScrollLeft=function(){},Ti.prototype.setScrollTop=function(){},Ti.prototype.clear=function(){};function qn(e,t){t||(t=xi(e));var i=e.display.barWidth,n=e.display.barHeight;Es(e,t);for(var c=0;c<4&&i!=e.display.barWidth||n!=e.display.barHeight;c++)i!=e.display.barWidth&&e.options.lineWrapping&&zi(e),Es(e,xi(e)),i=e.display.barWidth,n=e.display.barHeight}function Es(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var xs={native:jn,null:Ti};function Ts(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&A(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),Be(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Un(e,t):Ei(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Qo=0;function Hn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qo},Jr(e.curOp)}function Wn(e){var t=e.curOp;t&&Io(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;qo(i)})}function qo(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var c=0;c<t.length;c++)rl(t[c]);for(var N=0;N<t.length;N++)nl(t[N]);for(var z=0;z<t.length;z++)il(t[z])}function el(e){var t=e.cm,i=t.display;sl(t),e.updateMaxLine&&ji(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Xi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function rl(e){var t=e.cm,i=t.display;e.updatedDisplay&&zi(t),e.barMeasure=xi(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Pn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Un(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==U();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qn(t,e.barMeasure),e.updatedDisplay&&Ra(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&gs(e.cm)}function il(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&ws(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&_s(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Un(t,e.scrollLeft,!0,!0),e.scrollToPos){var c=$o(t,x(n,e.scrollToPos.from),x(n,e.scrollToPos.to),e.scrollToPos.margin);Xo(t,c)}var N=e.maybeHiddenMarkers,z=e.maybeUnhiddenMarkers;if(N)for(var Q=0;Q<N.length;++Q)N[Q].lines.length||je(N[Q],"hide");if(z)for(var q=0;q<z.length;++q)z[q].lines.length&&je(z[q],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&je(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Wr(e,t){if(e.curOp)return t();Hn(e);try{return t()}finally{Wn(e)}}function pr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Hn(e);try{return t.apply(e,arguments)}finally{Wn(e)}}}function Or(e){return function(){if(this.curOp)return e.apply(this,arguments);Hn(this);try{return e.apply(this,arguments)}finally{Wn(this)}}}function mr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Hn(t);try{return e.apply(this,arguments)}finally{Wn(t)}}}function wi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=et(e,t.highlightFrontier),c=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(N){if(n.line>=e.display.viewFrom){var z=N.styles,Q=N.text.length>e.options.maxHighlightLength?Ft(t.mode,n.state):null,q=Ee(e,N,n,!0);Q&&(n.state=Q),N.styles=q.styles;var te=N.styleClasses,pe=q.classes;pe?N.styleClasses=pe:te&&(N.styleClasses=null);for(var ye=!z||z.length!=N.styles.length||te!=pe&&(!te||!pe||te.bgClass!=pe.bgClass||te.textClass!=pe.textClass),Me=0;!ye&&Me<z.length;++Me)ye=z[Me]!=N.styles[Me];ye&&c.push(n.line),N.stateAfter=n.save(),n.nextLine()}else N.text.length<=e.options.maxHighlightLength&&pt(e,N.text,n),N.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return wi(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),c.length&&Wr(e,function(){for(var N=0;N<c.length;N++)wn(e,c[N],"text")})}var Xi=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Vi(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Pn(e),this.force=i,this.dims=ba(e),this.events=[]};Xi.prototype.signal=function(e,t){_e(e,t)&&this.events.push(arguments)},Xi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)je.apply(null,this.events[e])};function sl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=sn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=sn(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=U();if(!t||!b(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&b(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==U())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&b(document.body,e.anchorNode)&&b(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Sn(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&fs(e)==0)return!1;Cs(e)&&(Sn(e),t.dims=ba(e));var c=n.first+n.size,N=Math.max(t.visible.from-e.options.viewportMargin,n.first),z=Math.min(c,t.visible.to+e.options.viewportMargin);i.viewFrom<N&&N-i.viewFrom<20&&(N=Math.max(n.first,i.viewFrom)),i.viewTo>z&&i.viewTo-z<20&&(z=Math.min(c,i.viewTo)),dr&&(N=di(e.doc,N),z=Tn(e.doc,z));var Q=N!=i.viewFrom||z!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vo(e,N,z),i.viewOffset=qr(dt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var q=fs(e);if(!Q&&q==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var te=ol(e);return q>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),q>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(te),C(i.cursorDiv),C(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,Q&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,wi(e,400)),i.updateLineNumbers=null,!0}function ws(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Pn(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+ca(e.display)-da(e),i.top)}),t.visible=Vi(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Vi(e.display,e.doc,i));if(!Ca(e,t))break;zi(e);var c=xi(e);bi(e),qn(e,c),Ra(e,c),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Aa(e,t){var i=new Xi(e,t);if(Ca(e,i)){zi(e),ws(e,i);var n=xi(e);bi(e),qn(e,n),Ra(e,n),i.finish()}}function ul(e,t,i){var n=e.display,c=e.options.lineNumbers,N=n.lineDiv,z=N.firstChild;function Q(He){var Ye=He.nextSibling;return r&&s&&e.display.currentWheelTarget==He?He.style.display="none":He.parentNode.removeChild(He),Ye}for(var q=n.view,te=n.viewFrom,pe=0;pe<q.length;pe++){var ye=q[pe];if(!ye.hidden)if(!ye.node||ye.node.parentNode!=N){var Me=No(e,ye,te,i);N.insertBefore(Me,z)}else{for(;z!=ye.node;)z=Q(z);var ke=c&&t!=null&&t<=te&&ye.lineNumber;ye.changes&&(ne(ye.changes,"gutter")>-1&&(ke=!1),Xa(e,ye,te,i)),ke&&(C(ye.lineNumber),ye.lineNumber.appendChild(document.createTextNode(Xr(e.options,te)))),z=ye.node.nextSibling}te+=ye.size}for(;z;)z=Q(z)}function Oa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ra(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+sn(e)+"px"}function Ss(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,c=t.gutters.offsetWidth,N=n+"px",z=0;z<i.length;z++)if(!i[z].hidden){e.options.fixedGutter&&(i[z].gutter&&(i[z].gutter.style.left=N),i[z].gutterBackground&&(i[z].gutterBackground.style.left=N));var Q=i[z].alignable;if(Q)for(var q=0;q<Q.length;q++)Q[q].style.left=N}e.options.fixedGutter&&(t.gutters.style.left=n+c+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Xr(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var c=n.measure.appendChild(f("div",[f("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),N=c.firstChild.offsetWidth,z=c.offsetWidth-N;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(N,n.lineGutter.offsetWidth-z)+1,n.lineNumWidth=n.lineNumInnerWidth+z,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Oa(e.display),!0}return!1}function La(e,t){for(var i=[],n=!1,c=0;c<e.length;c++){var N=e[c],z=null;if(typeof N!="string"&&(z=N.style,N=N.className),N=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:N,style:z})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function As(e){var t=e.gutters,i=e.gutterSpecs;C(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var c=i[n],N=c.className,z=c.style,Q=t.appendChild(f("div",null,"CodeMirror-gutter "+N));z&&(Q.style.cssText=z),N=="CodeMirror-linenumbers"&&(e.lineGutter=Q,Q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Oa(e)}function Si(e){As(e.display),Mr(e),Ss(e)}function hl(e,t,i,n){var c=this;this.input=i,c.scrollbarFiller=f("div",null,"CodeMirror-scrollbar-filler"),c.scrollbarFiller.setAttribute("cm-not-content","true"),c.gutterFiller=f("div",null,"CodeMirror-gutter-filler"),c.gutterFiller.setAttribute("cm-not-content","true"),c.lineDiv=S("div",null,"CodeMirror-code"),c.selectionDiv=f("div",null,null,"position: relative; z-index: 1"),c.cursorDiv=f("div",null,"CodeMirror-cursors"),c.measure=f("div",null,"CodeMirror-measure"),c.lineMeasure=f("div",null,"CodeMirror-measure"),c.lineSpace=S("div",[c.measure,c.lineMeasure,c.selectionDiv,c.cursorDiv,c.lineDiv],null,"position: relative; outline: none");var N=S("div",[c.lineSpace],"CodeMirror-lines");c.mover=f("div",[N],null,"position: relative"),c.sizer=f("div",[c.mover],"CodeMirror-sizer"),c.sizerWidth=null,c.heightForcer=f("div",null,null,"position: absolute; height: "+oe+"px; width: 1px;"),c.gutters=f("div",null,"CodeMirror-gutters"),c.lineGutter=null,c.scroller=f("div",[c.sizer,c.heightForcer,c.gutters],"CodeMirror-scroll"),c.scroller.setAttribute("tabIndex","-1"),c.wrapper=f("div",[c.scrollbarFiller,c.gutterFiller,c.scroller],"CodeMirror"),K&&H<8&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight=0),!r&&!(P&&l)&&(c.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(c.wrapper):e(c.wrapper)),c.viewFrom=c.viewTo=t.first,c.reportedViewFrom=c.reportedViewTo=t.first,c.view=[],c.renderedView=null,c.externalMeasured=null,c.viewOffset=0,c.lastWrapHeight=c.lastWrapWidth=0,c.updateLineNumbers=null,c.nativeBarWidth=c.barHeight=c.barWidth=0,c.scrollbarsClipped=!1,c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null,c.alignWidgets=!1,c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=null,c.maxLine=null,c.maxLineLength=0,c.maxLineChanged=!1,c.wheelDX=c.wheelDY=c.wheelStartX=c.wheelStartY=null,c.shift=!1,c.selForContextMenu=null,c.activeTouch=null,c.gutterSpecs=La(n.gutters,n.lineNumbers),As(c),i.init(c)}var $i=0,Vr=null;K?Vr=-.53:P?Vr=15:v?Vr=-.7:p&&(Vr=-1/3);function Os(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function cl(e){var t=Os(e);return t.x*=Vr,t.y*=Vr,t}function Rs(e,t){var i=Os(t),n=i.x,c=i.y,N=e.display,z=N.scroller,Q=z.scrollWidth>z.clientWidth,q=z.scrollHeight>z.clientHeight;if(!(n&&Q||c&&q))return;if(c&&s&&r){e:for(var te=t.target,pe=N.view;te!=z;te=te.parentNode)for(var ye=0;ye<pe.length;ye++)if(pe[ye].node==te){e.display.currentWheelTarget=te;break e}}if(n&&!P&&!m&&Vr!=null){c&&q&&Ei(e,Math.max(0,z.scrollTop+c*Vr)),Un(e,Math.max(0,z.scrollLeft+n*Vr)),(!c||c&&q)&&ae(t),N.wheelStartX=null;return}if(c&&Vr!=null){var Me=c*Vr,ke=e.doc.scrollTop,He=ke+N.wrapper.clientHeight;Me<0?ke=Math.max(0,ke+Me-50):He=Math.min(e.doc.height,He+Me+50),Aa(e,{top:ke,bottom:He})}$i<20&&(N.wheelStartX==null?(N.wheelStartX=z.scrollLeft,N.wheelStartY=z.scrollTop,N.wheelDX=n,N.wheelDY=c,setTimeout(function(){if(N.wheelStartX==null)return;var Ye=z.scrollLeft-N.wheelStartX,Qe=z.scrollTop-N.wheelStartY,rt=Qe&&N.wheelDY&&Qe/N.wheelDY||Ye&&N.wheelDX&&Ye/N.wheelDX;if(N.wheelStartX=N.wheelStartY=null,!rt)return;Vr=(Vr*$i+rt)/($i+1),++$i},200)):(N.wheelDX+=n,N.wheelDY+=c))}var Yr=function(e,t){this.ranges=e,this.primIndex=t};Yr.prototype.primary=function(){return this.ranges[this.primIndex]},Yr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(!mn(i.anchor,n.anchor)||!mn(i.head,n.head))return!1}return!0},Yr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Gt(gn(this.ranges[t].anchor),gn(this.ranges[t].head));return new Yr(e,this.primIndex)},Yr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Yr.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(Ct(t,n.from())>=0&&Ct(e,n.to())<=0)return i}return-1};var Gt=function(e,t){this.anchor=e,this.head=t};Gt.prototype.from=function(){return yn(this.anchor,this.head)},Gt.prototype.to=function(){return vn(this.anchor,this.head)},Gt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function tn(e,t,i){var n=e&&e.options.selectionsMayTouch,c=t[i];t.sort(function(Me,ke){return Ct(Me.from(),ke.from())}),i=ne(t,c);for(var N=1;N<t.length;N++){var z=t[N],Q=t[N-1],q=Ct(Q.to(),z.from());if(n&&!z.empty()?q>0:q>=0){var te=yn(Q.from(),z.from()),pe=vn(Q.to(),z.to()),ye=Q.empty()?z.from()==z.head:Q.from()==Q.head;N<=i&&--i,t.splice(--N,2,new Gt(ye?pe:te,ye?te:pe))}}return new Yr(t,i)}function Cn(e,t){return new Yr([new Gt(e,t||e)],0)}function An(e){return e.text?Xe(e.from.line+e.text.length-1,re(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 An(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=An(t).ch-t.to.ch),Xe(i,n)}function Ia(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var c=e.sel.ranges[n];i.push(new Gt(Ls(c.anchor,t),Ls(c.head,t)))}return tn(e.cm,i,e.sel.primIndex)}function Is(e,t,i){return e.line==t.line?Xe(i.line,e.ch-t.ch+i.ch):Xe(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var n=[],c=Xe(e.first,0),N=c,z=0;z<t.length;z++){var Q=t[z],q=Is(Q.from,c,N),te=Is(An(Q),c,N);if(c=Q.to,N=te,i=="around"){var pe=e.sel.ranges[z],ye=Ct(pe.head,pe.anchor)<0;n[z]=new Gt(ye?te:q,ye?q:te)}else n[z]=new Gt(q,q)}return new Yr(n,e.sel.primIndex)}function Da(e){e.doc.mode=Lr(e.options,e.doc.modeOption),Ci(e)}function Ci(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,wi(e,100),e.state.modeGen++,e.curOp&&Mr(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&re(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,i,n){function c(lt){return i?i[lt]:null}function N(lt,nt,ut){ua(lt,nt,ut,n),br(lt,"change",lt,t)}function z(lt,nt){for(var ut=[],Tt=lt;Tt<nt;++Tt)ut.push(new Mn(te[Tt],c(Tt),n));return ut}var Q=t.from,q=t.to,te=t.text,pe=dt(e,Q.line),ye=dt(e,q.line),Me=re(te),ke=c(te.length-1),He=q.line-Q.line;if(t.full)e.insert(0,z(0,te.length)),e.remove(te.length,e.size-te.length);else if(Ds(e,t)){var Ye=z(0,te.length-1);N(ye,ye.text,ke),He&&e.remove(Q.line,He),Ye.length&&e.insert(Q.line,Ye)}else if(pe==ye)if(te.length==1)N(pe,pe.text.slice(0,Q.ch)+Me+pe.text.slice(q.ch),ke);else{var Qe=z(1,te.length-1);Qe.push(new Mn(Me+pe.text.slice(q.ch),ke,n)),N(pe,pe.text.slice(0,Q.ch)+te[0],c(0)),e.insert(Q.line+1,Qe)}else if(te.length==1)N(pe,pe.text.slice(0,Q.ch)+te[0]+ye.text.slice(q.ch),c(0)),e.remove(Q.line+1,He);else{N(pe,pe.text.slice(0,Q.ch)+te[0],c(0)),N(ye,Me+ye.text.slice(q.ch),ke);var rt=z(1,te.length-1);He>1&&e.remove(Q.line+1,He-1),e.insert(Q.line+1,rt)}br(e,"change",e,t)}function On(e,t,i){function n(c,N,z){if(c.linked)for(var Q=0;Q<c.linked.length;++Q){var q=c.linked[Q];if(q.doc==N)continue;var te=z&&q.sharedHist;if(i&&!te)continue;t(q.doc,te),n(q.doc,c,te)}}n(e,null,!0)}function ks(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ea(e),Da(e),Ms(e),e.options.lineWrapping||ji(e),e.options.mode=t.modeOption,Mr(e)}function Ms(e){(e.doc.direction=="rtl"?F:A)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Wr(e,function(){Ms(e),Mr(e)})}function Ji(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 i={from:gn(t.from),to:An(t),text:Ur(e,t.from,t.to)};return Fs(e,i,t.from.line,t.to.line+1),On(e,function(n){return Fs(n,i,t.from.line,t.to.line+1)},!0),i}function Ps(e){for(;e.length;){var t=re(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ps(e.done),re(e.done);if(e.done.length&&!re(e.done).ranges)return re(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),re(e.done)}function Ns(e,t,i,n){var c=e.history;c.undone.length=0;var N=+new Date,z,Q;if((c.lastOp==n||c.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&c.lastModTime>N-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(z=pl(c,c.lastOp==n)))Q=re(z.changes),Ct(t.from,t.to)==0&&Ct(t.from,Q.to)==0?Q.to=An(t):z.changes.push(Ma(e,t));else{var q=re(c.done);for((!q||!q.ranges)&&Zi(e.sel,c.done),z={changes:[Ma(e,t)],generation:c.generation},c.done.push(z);c.done.length>c.undoDepth;)c.done.shift(),c.done[0].ranges||c.done.shift()}c.done.push(i),c.generation=++c.maxGeneration,c.lastModTime=c.lastSelTime=N,c.lastOp=c.lastSelOp=n,c.lastOrigin=c.lastSelOrigin=t.origin,Q||je(e,"historyAdded")}function ml(e,t,i,n){var c=t.charAt(0);return c=="*"||c=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var c=e.history,N=n&&n.origin;i==c.lastSelOp||N&&c.lastSelOrigin==N&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==N||ml(e,N,re(c.done),t))?c.done[c.done.length-1]=t:Zi(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=N,c.lastSelOp=i,n&&n.clearRedo!==!1&&Ps(c.undone)}function Zi(e,t){var i=re(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Fs(e,t,i,n){var c=t["spans_"+e.id],N=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(z){z.markedSpans&&((c||(c=t["spans_"+e.id]={}))[N]=z.markedSpans),++N})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],c=0;c<t.text.length;++c)n.push(vl(i[c]));return n}function Bs(e,t){var i=yl(e,t),n=Qr(e,t);if(!i)return n;if(!n)return i;for(var c=0;c<i.length;++c){var N=i[c],z=n[c];if(N&&z){e:for(var Q=0;Q<z.length;++Q){for(var q=z[Q],te=0;te<N.length;++te)if(N[te].marker==q.marker)continue e;N.push(q)}}else z&&(i[c]=z)}return i}function ei(e,t,i){for(var n=[],c=0;c<e.length;++c){var N=e[c];if(N.ranges){n.push(i?Yr.prototype.deepCopy.call(N):N);continue}var z=N.changes,Q=[];n.push({changes:Q});for(var q=0;q<z.length;++q){var te=z[q],pe=void 0;if(Q.push({from:te.from,to:te.to,text:te.text}),t)for(var ye in te)(pe=ye.match(/^spans_(\d+)$/))&&(ne(t,Number(pe[1]))>-1&&(re(Q)[ye]=te[ye],delete te[ye]))}}return n}function Pa(e,t,i,n){if(n){var c=e.anchor;if(i){var N=Ct(t,c)<0;N!=Ct(i,c)<0?(c=t,t=i):N!=Ct(t,i)<0&&(t=i)}return new Gt(c,t)}else return new Gt(i||t,t)}function Qi(e,t,i,n,c){c==null&&(c=e.cm&&(e.cm.display.shift||e.extend)),wr(e,new Yr([Pa(e.sel.primary(),t,i,c)],0),n)}function Us(e,t,i){for(var n=[],c=e.cm&&(e.cm.display.shift||e.extend),N=0;N<e.sel.ranges.length;N++)n[N]=Pa(e.sel.ranges[N],t[N],null,c);var z=tn(e.cm,n,e.sel.primIndex);wr(e,z,i)}function Na(e,t,i,n){var c=e.sel.ranges.slice(0);c[t]=i,wr(e,tn(e.cm,c,e.sel.primIndex),n)}function js(e,t,i,n){wr(e,Cn(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(c){this.ranges=[];for(var N=0;N<c.length;N++)this.ranges[N]=new Gt(x(e,c[N].anchor),x(e,c[N].head))},origin:i&&i.origin};return je(e,"beforeSelectionChange",e,n),e.cm&&je(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?tn(e.cm,n.ranges,n.ranges.length-1):t}function Hs(e,t,i){var n=e.history.done,c=re(n);c&&c.ranges?(n[n.length-1]=t,qi(e,t,i)):wr(e,t,i)}function wr(e,t,i){qi(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function qi(e,t,i){(_e(e,"beforeSelectionChange")||e.cm&&_e(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(Ct(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,Ks(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&Qn(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,Oe(e.cm)),br(e,"cursorActivity",e)}function Gs(e){Ws(e,Ks(e,e.sel,null,!1))}function Ks(e,t,i,n){for(var c,N=0;N<t.ranges.length;N++){var z=t.ranges[N],Q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[N],q=ea(e,z.anchor,Q&&Q.anchor,i,n),te=ea(e,z.head,Q&&Q.head,i,n);(c||q!=z.anchor||te!=z.head)&&(c||(c=t.ranges.slice(0,N)),c[N]=new Gt(q,te))}return c?tn(e.cm,c,t.primIndex):t}function ti(e,t,i,n,c){var N=dt(e,t.line);if(N.markedSpans)for(var z=0;z<N.markedSpans.length;++z){var Q=N.markedSpans[z],q=Q.marker,te="selectLeft"in q?!q.selectLeft:q.inclusiveLeft,pe="selectRight"in q?!q.selectRight:q.inclusiveRight;if((Q.from==null||(te?Q.from<=t.ch:Q.from<t.ch))&&(Q.to==null||(pe?Q.to>=t.ch:Q.to>t.ch))){if(c&&(je(q,"beforeCursorEnter"),q.explicitlyCleared))if(N.markedSpans){--z;continue}else break;if(!q.atomic)continue;if(i){var ye=q.find(n<0?1:-1),Me=void 0;if((n<0?pe:te)&&(ye=zs(e,ye,-n,ye&&ye.line==t.line?N:null)),ye&&ye.line==t.line&&(Me=Ct(ye,i))&&(n<0?Me<0:Me>0))return ti(e,ye,t,n,c)}var ke=q.find(n<0?-1:1);return(n<0?te:pe)&&(ke=zs(e,ke,n,ke.line==t.line?N:null)),ke?ti(e,ke,t,n,c):null}}return t}function ea(e,t,i,n,c){var N=n||1,z=ti(e,t,i,N,c)||!c&&ti(e,t,i,N,!0)||ti(e,t,i,-N,c)||!c&&ti(e,t,i,-N,!0);return z||(e.cantEdit=!0,Xe(e.first,0))}function zs(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?x(e,Xe(t.line-1)):null:i>0&&t.ch==(n||dt(e,t.line)).text.length?t.line<e.first+e.size-1?Xe(t.line+1,0):null:new Xe(t.line,t.ch+i)}function Vs(e){e.setSelection(Xe(e.firstLine(),0),Xe(e.lastLine()),ge)}function Ys(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(c,N,z,Q){c&&(n.from=x(e,c)),N&&(n.to=x(e,N)),z&&(n.text=z),Q!==void 0&&(n.origin=Q)}),je(e,"beforeChange",e,n),e.cm&&je(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function ri(e,t,i){if(e.cm){if(!e.cm.curOp)return pr(e.cm,ri)(e,t,i);if(e.cm.state.suppressEdits)return}if((_e(e,"beforeChange")||e.cm&&_e(e.cm,"beforeChange"))&&(t=Ys(e,t,!0),!t))return;var n=Dn&&!i&&_n(e,t.from,t.to);if(n)for(var c=n.length-1;c>=0;--c)Xs(e,{from:n[c].from,to:n[c].to,text:c?[""]: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 i=Ia(e,t);Ns(e,t,i,e.cm?e.cm.curOp.id:NaN),Ai(e,t,i,Qr(e,t));var n=[];On(e,function(c,N){!N&&ne(n,c.history)==-1&&(Qs(c.history,t),n.push(c.history)),Ai(c,t,null,Qr(c,t))})}function ta(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var c=e.history,N,z=e.sel,Q=t=="undo"?c.done:c.undone,q=t=="undo"?c.undone:c.done,te=0;te<Q.length&&!(N=Q[te],i?N.ranges&&!N.equals(e.sel):!N.ranges);te++);if(te==Q.length)return;for(c.lastOrigin=c.lastSelOrigin=null;;)if(N=Q.pop(),N.ranges){if(Zi(N,q),i&&!N.equals(e.sel)){wr(e,N,{clearRedo:!1});return}z=N}else if(n){Q.push(N);return}else break;var pe=[];Zi(z,q),q.push({changes:pe,generation:c.generation}),c.generation=N.generation||++c.maxGeneration;for(var ye=_e(e,"beforeChange")||e.cm&&_e(e.cm,"beforeChange"),Me=function(Ye){var Qe=N.changes[Ye];if(Qe.origin=t,ye&&!Ys(e,Qe,!1))return Q.length=0,{};pe.push(Ma(e,Qe));var rt=Ye?Ia(e,Qe):re(Q);Ai(e,Qe,rt,Bs(e,Qe)),!Ye&&e.cm&&e.cm.scrollIntoView({from:Qe.from,to:An(Qe)});var lt=[];On(e,function(nt,ut){!ut&&ne(lt,nt.history)==-1&&(Qs(nt.history,Qe),lt.push(nt.history)),Ai(nt,Qe,null,Bs(nt,Qe))})},ke=N.changes.length-1;ke>=0;--ke){var He=Me(ke);if(He)return He.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Yr(de(e.sel.ranges,function(c){return new Gt(Xe(c.anchor.line+t,c.anchor.ch),Xe(c.head.line+t,c.head.ch))}),e.sel.primIndex),e.cm){Mr(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)wn(e.cm,n,"gutter")}}function Ai(e,t,i,n){if(e.cm&&!e.cm.curOp)return pr(e.cm,Ai)(e,t,i,n);if(t.to.line<e.first){$s(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var c=t.text.length-1-(e.first-t.from.line);$s(e,c),t={from:Xe(e.first,0),to:Xe(t.to.line+c,t.to.ch),text:[re(t.text)],origin:t.origin}}var N=e.lastLine();t.to.line>N&&(t={from:t.from,to:Xe(N,dt(e,N).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ur(e,t.from,t.to),i||(i=Ia(e,t)),e.cm?_l(e.cm,t,n):ka(e,t,n),qi(e,i,ge),e.cantEdit&&ea(e,Xe(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,i){var n=e.doc,c=e.display,N=t.from,z=t.to,Q=!1,q=N.line;e.options.lineWrapping||(q=Ot(Ar(dt(n,N.line))),n.iter(q,z.line+1,function(ke){if(ke==c.maxLine)return Q=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Oe(e),ka(n,t,i,ds(e)),e.options.lineWrapping||(n.iter(q,N.line+t.text.length,function(ke){var He=pi(ke);He>c.maxLineLength&&(c.maxLine=ke,c.maxLineLength=He,c.maxLineChanged=!0,Q=!1)}),Q&&(e.curOp.updateMaxLine=!0)),Zr(n,N.line),wi(e,400);var te=t.text.length-(z.line-N.line)-1;t.full?Mr(e):N.line==z.line&&t.text.length==1&&!Ds(e.doc,t)?wn(e,N.line,"text"):Mr(e,N.line,z.line+1,te);var pe=_e(e,"changes"),ye=_e(e,"change");if(ye||pe){var Me={from:N,to:z,text:t.text,removed:t.removed,origin:t.origin};ye&&br(e,"change",e,Me),pe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Me)}e.display.selForContextMenu=null}function ni(e,t,i,n,c){var N;n||(n=i),Ct(n,i)<0&&(N=[n,i],i=N[0],n=N[1]),typeof t=="string"&&(t=e.splitLines(t)),ri(e,{from:i,to:n,text:t,origin:c})}function Js(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Zs(e,t,i,n){for(var c=0;c<e.length;++c){var N=e[c],z=!0;if(N.ranges){N.copied||(N=e[c]=N.deepCopy(),N.copied=!0);for(var Q=0;Q<N.ranges.length;Q++)Js(N.ranges[Q].anchor,t,i,n),Js(N.ranges[Q].head,t,i,n);continue}for(var q=0;q<N.changes.length;++q){var te=N.changes[q];if(i<te.from.line)te.from=Xe(te.from.line+n,te.from.ch),te.to=Xe(te.to.line+n,te.to.ch);else if(t<=te.to.line){z=!1;break}}z||(e.splice(0,c+1),c=0)}}function Qs(e,t){var i=t.from.line,n=t.to.line,c=t.text.length-(n-i)-1;Zs(e.done,i,n,c),Zs(e.undone,i,n,c)}function Oi(e,t,i,n){var c=t,N=t;return typeof t=="number"?N=dt(e,Y(e,t)):c=Ot(t),c==null?null:(n(N,c)&&e.cm&&wn(e.cm,c,i),N)}function Ri(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Ri.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var c=this.lines[i];this.height-=c.height,gt(c),br(c,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function Li(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var c=e[n];t+=c.chunkSize(),i+=c.height,c.parent=this}this.size=t,this.height=i,this.parent=null}Li.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],c=n.chunkSize();if(e<c){var N=Math.min(t,c-e),z=n.height;if(n.removeInner(e,N),this.height-=z-n.height,c==N&&(this.children.splice(i--,1),n.parent=null),(t-=N)==0)break;e=0}else e-=c}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ri))){var Q=[];this.collapse(Q),this.children=[new Ri(Q)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var c=this.children[n],N=c.chunkSize();if(e<=N){if(c.insertInner(e,t,i),c.lines&&c.lines.length>50){for(var z=c.lines.length%25+25,Q=z;Q<c.lines.length;){var q=new Ri(c.lines.slice(Q,Q+=25));c.height-=q.height,this.children.splice(++n,0,q),q.parent=this}c.lines=c.lines.slice(0,z),this.maybeSpill()}break}e-=N}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Li(t);if(e.parent){e.size-=i.size,e.height-=i.height;var c=ne(e.parent.children,e);e.parent.children.splice(c+1,0,i)}else{var n=new Li(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var c=this.children[n],N=c.chunkSize();if(e<N){var z=Math.min(t,N-e);if(c.iterN(e,z,i))return!0;if((t-=z)==0)break;e=0}else e-=N}}};var Ii=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Ii.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Ot(i);if(n==null||!t)return;for(var c=0;c<t.length;++c)t[c]==this&&t.splice(c--,1);t.length||(i.widgets=null);var N=vi(this);Jt(i,Math.max(0,i.height-N)),e&&(Wr(e,function(){qs(e,i,-N),wn(e,n,"widget")}),br(e,"lineWidgetCleared",e,this,n))},Ii.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var c=vi(this)-t;if(!c)return;an(this.doc,n)||Jt(n,n.height+c),i&&Wr(i,function(){i.curOp.forceUpdate=!0,qs(i,n,c),br(i,"lineWidgetChanged",i,e,Ot(n))})},Te(Ii);function qs(e,t,i){qr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,i)}function El(e,t,i,n){var c=new Ii(e,i,n),N=e.cm;return N&&c.noHScroll&&(N.display.alignWidgets=!0),Oi(e,t,"widget",function(z){var Q=z.widgets||(z.widgets=[]);if(c.insertAt==null?Q.push(c):Q.splice(Math.min(Q.length-1,Math.max(0,c.insertAt)),0,c),c.line=z,N&&!an(e,z)){var q=qr(z)<e.scrollTop;Jt(z,z.height+vi(c)),q&&Sa(N,c.height),N.curOp.forceUpdate=!0}return!0}),N&&br(N,"lineWidgetAdded",N,c,typeof t=="number"?t:Ot(t)),c}var eo=0,Rn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};Rn.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hn(e),_e(this,"clear")){var i=this.find();i&&br(this,"clear",i.from,i.to)}for(var n=null,c=null,N=0;N<this.lines.length;++N){var z=this.lines[N],Q=Hr(z.markedSpans,this);e&&!this.collapsed?wn(e,Ot(z),"text"):e&&(Q.to!=null&&(c=Ot(z)),Q.from!=null&&(n=Ot(z))),z.markedSpans=kn(z.markedSpans,Q),Q.from==null&&this.collapsed&&!an(this.doc,z)&&e&&Jt(z,$n(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var q=0;q<this.lines.length;++q){var te=Ar(this.lines[q]),pe=pi(te);pe>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=pe,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Mr(e,n,c+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&br(e,"markerCleared",e,this,n,c),t&&Wn(e),this.parent&&this.parent.clear()},Rn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,c=0;c<this.lines.length;++c){var N=this.lines[c],z=Hr(N.markedSpans,this);if(z.from!=null&&(i=Xe(t?N:Ot(N),z.from),e==-1))return i;if(z.to!=null&&(n=Xe(t?N:Ot(N),z.to),e==1))return n}return i&&{from:i,to:n}},Rn.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Wr(n,function(){var c=t.line,N=Ot(t.line),z=fa(n,N);if(z&&(is(z),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!an(i.doc,c)&&i.height!=null){var Q=i.height;i.height=null;var q=vi(i)-Q;q&&Jt(c,c.height+q)}br(n,"markerChanged",n,e)})},Rn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ne(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Rn.prototype.detachLine=function(e){if(this.lines.splice(ne(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Te(Rn);function ii(e,t,i,n,c){if(n&&n.shared)return xl(e,t,i,n,c);if(e.cm&&!e.cm.curOp)return pr(e.cm,ii)(e,t,i,n,c);var N=new Rn(e,c),z=Ct(t,i);if(n&&g(n,N,!1),z>0||z==0&&N.clearWhenEmpty!==!1)return N;if(N.replacedWith&&(N.collapsed=!0,N.widgetNode=S("span",[N.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||N.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(N.widgetNode.insertLeft=!0)),N.collapsed){if(fr(e,t.line,t,i,N)||t.line!=i.line&&fr(e,i.line,t,i,N))throw new Error("Inserting collapsed marker partially overlapping an existing one");un()}N.addToHistory&&Ns(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var Q=t.line,q=e.cm,te;if(e.iter(Q,i.line+1,function(ye){q&&N.collapsed&&!q.options.lineWrapping&&Ar(ye)==q.display.maxLine&&(te=!0),N.collapsed&&Q!=t.line&&Jt(ye,0),bn(ye,new hn(N,Q==t.line?t.ch:null,Q==i.line?i.ch:null)),++Q}),N.collapsed&&e.iter(t.line,i.line+1,function(ye){an(e,ye)&&Jt(ye,0)}),N.clearOnEnter&&Be(N,"beforeCursorEnter",function(){return N.clear()}),N.readOnly&&(zr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),N.collapsed&&(N.id=++eo,N.atomic=!0),q){if(te&&(q.curOp.updateMaxLine=!0),N.collapsed)Mr(q,t.line,i.line+1);else if(N.className||N.startStyle||N.endStyle||N.css||N.attributes||N.title)for(var pe=t.line;pe<=i.line;pe++)wn(q,pe,"text");N.atomic&&Gs(q.doc),br(q,"markerAdded",q,N)}return N}var Di=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Di.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();br(this,"clear")},Di.prototype.find=function(e,t){return this.primary.find(e,t)},Te(Di);function xl(e,t,i,n,c){n=g(n),n.shared=!1;var N=[ii(e,t,i,n,c)],z=N[0],Q=n.widgetNode;return On(e,function(q){Q&&(n.widgetNode=Q.cloneNode(!0)),N.push(ii(q,x(q,t),x(q,i),n,c));for(var te=0;te<q.linked.length;++te)if(q.linked[te].isParent)return;z=re(N)}),new Di(N,z)}function to(e){return e.findMarks(Xe(e.first,0),e.clipPos(Xe(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var i=0;i<t.length;i++){var n=t[i],c=n.find(),N=e.clipPos(c.from),z=e.clipPos(c.to);if(Ct(N,z)){var Q=ii(e,N,z,n.primary,n.primary.type);n.markers.push(Q),Q.parent=n}}}function wl(e){for(var t=function(n){var c=e[n],N=[c.primary.doc];On(c.primary.doc,function(q){return N.push(q)});for(var z=0;z<c.markers.length;z++){var Q=c.markers[z];ne(N,Q.doc)==-1&&(Q.parent=null,c.markers.splice(z--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,Pr=function(e,t,i,n,c){if(!(this instanceof Pr))return new Pr(e,t,i,n,c);i==null&&(i=0),Li.call(this,[new Ri([new Mn("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var N=Xe(i,0);this.sel=Cn(N),this.history=new Ji(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=c=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ka(this,{from:N,to:N,text:e}),wr(this,Cn(N),ge)};Pr.prototype=Ne(Li.prototype,{constructor:Pr,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},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:mr(function(e){var t=Xe(this.first,0),i=this.first+this.size-1;ri(this,{from:t,to:Xe(i,dt(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&_i(this.cm,0,0),wr(this,Cn(t),ge)}),replaceRange:function(e,t,i,n){t=x(this,t),i=i?x(this,i):t,ni(this,e,t,i,n)},getRange:function(e,t,i){var n=Ur(this,x(this,e),x(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ir(this,e))return dt(this,e)},getLineNumber:function(e){return Ot(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=dt(this,e)),Ar(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return x(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:mr(function(e,t,i){js(this,x(this,typeof e=="number"?Xe(e,t||0):e),null,i)}),setSelection:mr(function(e,t,i){js(this,x(this,e),x(this,t||e),i)}),extendSelection:mr(function(e,t,i){Qi(this,x(this,e),t&&x(this,t),i)}),extendSelections:mr(function(e,t){Us(this,G(this,e),t)}),extendSelectionsBy:mr(function(e,t){var i=de(this.sel.ranges,e);Us(this,G(this,i),t)}),setSelections:mr(function(e,t,i){if(!e.length)return;for(var n=[],c=0;c<e.length;c++)n[c]=new Gt(x(this,e[c].anchor),x(this,e[c].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),wr(this,tn(this.cm,n,t),i)}),addSelection:mr(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Gt(x(this,e),x(this,t||e))),wr(this,tn(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var c=Ur(this,t[n].from(),t[n].to());i=i?i.concat(c):c}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var c=Ur(this,i[n].from(),i[n].to());e!==!1&&(c=c.join(e||this.lineSeparator())),t[n]=c}return t},replaceSelection:function(e,t,i){for(var n=[],c=0;c<this.sel.ranges.length;c++)n[c]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:mr(function(e,t,i){for(var n=[],c=this.sel,N=0;N<c.ranges.length;N++){var z=c.ranges[N];n[N]={from:z.from(),to:z.to(),text:this.splitLines(e[N]),origin:i}}for(var Q=t&&t!="end"&&dl(this,n,t),q=n.length-1;q>=0;q--)ri(this,n[q]);Q?Hs(this,Q):this.cm&&Qn(this.cm)}),undo:mr(function(){ta(this,"undo")}),redo:mr(function(){ta(this,"redo")}),undoSelection:mr(function(){ta(this,"undo",!0)}),redoSelection:mr(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,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var c=0;c<e.undone.length;c++)e.undone[c].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Ji(this.history.maxGeneration),On(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:ei(this.history.done),undone:ei(this.history.undone)}},setHistory:function(e){var t=this.history=new Ji(this.history.maxGeneration);t.done=ei(e.done.slice(0),null,!0),t.undone=ei(e.undone.slice(0),null,!0)},setGutterMarker:mr(function(e,t,i){return Oi(this,e,"gutter",function(n){var c=n.gutterMarkers||(n.gutterMarkers={});return c[t]=i,!i&&le(c)&&(n.gutterMarkers=null),!0})}),clearGutter:mr(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Oi(t,i,"gutter",function(){return i.gutterMarkers[e]=null,le(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Ir(this,e))return null;if(t=e,e=dt(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:mr(function(e,t,i){return Oi(this,e,t=="gutter"?"gutter":"class",function(n){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[c])n[c]=i;else{if(O(i).test(n[c]))return!1;n[c]+=" "+i}return!0})}),removeLineClass:mr(function(e,t,i){return Oi(this,e,t=="gutter"?"gutter":"class",function(n){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",N=n[c];if(N)if(i==null)n[c]=null;else{var z=N.match(O(i));if(!z)return!1;var Q=z.index+z[0].length;n[c]=N.slice(0,z.index)+(!z.index||Q==N.length?"":" ")+N.slice(Q)||null}else return!1;return!0})}),addLineWidget:mr(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return ii(this,x(this,e),x(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=x(this,e),ii(this,e,e,i,"bookmark")},findMarksAt:function(e){e=x(this,e);var t=[],i=dt(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var c=i[n];(c.from==null||c.from<=e.ch)&&(c.to==null||c.to>=e.ch)&&t.push(c.marker.parent||c.marker)}return t},findMarks:function(e,t,i){e=x(this,e),t=x(this,t);var n=[],c=e.line;return this.iter(e.line,t.line+1,function(N){var z=N.markedSpans;if(z)for(var Q=0;Q<z.length;Q++){var q=z[Q];!(q.to!=null&&c==e.line&&e.ch>=q.to||q.from==null&&c!=e.line||q.from!=null&&c==t.line&&q.from>=t.ch)&&(!i||i(q.marker))&&n.push(q.marker.parent||q.marker)}++c}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(c){var N=c.text.length+n;if(N>e)return t=e,!0;e-=N,++i}),x(this,Xe(i,t))},indexFromPos:function(e){e=x(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new Pr(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,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new Pr(Vt(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(n,to(this)),n},unlinkDoc:function(e){if(e instanceof Qt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(to(this));break}if(e.history==this.history){var n=[e.id];On(e,function(c){return n.push(c.id)},!0),e.history=new Ji(null),e.history.done=ei(this.history.done,n),e.history.undone=ei(this.history.undone,n)}},iterLinkedDocs:function(e){On(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):St(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:mr(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)})}),Pr.prototype.eachLine=Pr.prototype.iter;var ro=0;function Cl(e){var t=this;if(no(t),We(t,e)||dn(t.display,e))return;ae(e),K&&(ro=+new Date);var i=Fn(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var c=n.length,N=Array(c),z=0,Q=function(){++z==c&&pr(t,function(){i=x(t.doc,i);var ke={from:i,to:i,text:t.doc.splitLines(N.filter(function(He){return He!=null}).join(t.doc.lineSeparator())),origin:"paste"};ri(t.doc,ke),Hs(t.doc,Cn(x(t.doc,i),x(t.doc,An(ke))))})()},q=function(ke,He){if(t.options.allowDropFileTypes&&ne(t.options.allowDropFileTypes,ke.type)==-1){Q();return}var Ye=new FileReader;Ye.onerror=function(){return Q()},Ye.onload=function(){var Qe=Ye.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Qe)){Q();return}N[He]=Qe,Q()},Ye.readAsText(ke)},te=0;te<n.length;te++)q(n[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var pe=e.dataTransfer.getData("Text");if(pe){var ye;if(t.state.draggingText&&!t.state.draggingText.copy&&(ye=t.listSelections()),qi(t.doc,Cn(i,i)),ye)for(var Me=0;Me<ye.length;++Me)ni(t.doc,"",ye[Me].anchor,ye[Me].head,"drag");t.replaceSelection(pe,"around","paste"),t.display.input.focus()}}catch(ke){}}}function Al(e,t){if(K&&(!e.state.draggingText||+new Date-ro<100)){me(t);return}if(We(e,t)||dn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var i=f("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),m&&i.parentNode.removeChild(i)}}function Ol(e,t){var i=Fn(e,t);if(!i)return;var n=document.createDocumentFragment();ms(e,i,n),e.display.dragCursor||(e.display.dragCursor=f("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),T(e.display.dragCursor,n)}function no(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function io(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var c=t[n].CodeMirror;c&&i.push(c)}i.length&&i[0].operation(function(){for(var N=0;N<i.length;N++)e(i[N])})}var ao=!1;function Rl(){if(ao)return;Ll(),ao=!0}function Ll(){var e;Be(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,io(Il)},100))}),Be(window,"blur",function(){return io(Zn)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ln={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ki=0;ki<10;ki++)Ln[ki+48]=Ln[ki+96]=String(ki);for(var ra=65;ra<=90;ra++)Ln[ra]=String.fromCharCode(ra);for(var Mi=1;Mi<=12;Mi++)Ln[Mi+111]=Ln[Mi+63235]="F"+Mi;var fn={};fn.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},fn.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},fn.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},fn.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},fn.default=s?fn.macDefault:fn.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,c,N,z=0;z<t.length-1;z++){var Q=t[z];if(/^(cmd|meta|m)$/i.test(Q))N=!0;else if(/^a(lt)?$/i.test(Q))i=!0;else if(/^(c|ctrl|control)$/i.test(Q))n=!0;else if(/^s(hift)?$/i.test(Q))c=!0;else throw new Error("Unrecognized modifier name: "+Q)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),N&&(e="Cmd-"+e),c&&(e="Shift-"+e),e}function kl(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var c=de(i.split(" "),Dl),N=0;N<c.length;N++){var z=void 0,Q=void 0;N==c.length-1?(Q=c.join(" "),z=n):(Q=c.slice(0,N+1).join(" "),z="...");var q=t[Q];if(!q)t[Q]=z;else if(q!=z)throw new Error("Inconsistent bindings for "+Q)}delete e[i]}for(var te in t)e[te]=t[te];return e}function ai(e,t,i,n){t=na(t);var c=t.call?t.call(e,n):t[e];if(c===!1)return"nothing";if(c==="...")return"multi";if(c!=null&&i(c))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ai(e,t.fallthrough,i,n);for(var N=0;N<t.fallthrough.length;N++){var z=ai(e,t.fallthrough[N],i,n);if(z)return z}}}function so(e){var t=typeof e=="string"?e:Ln[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(w?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(w?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(m&&e.keyCode==34&&e.char)return!1;var i=Ln[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),oo(i,e,t))}function na(e){return typeof e=="string"?fn[e]:e}function si(e,t){for(var i=e.doc.sel.ranges,n=[],c=0;c<i.length;c++){for(var N=t(i[c]);n.length&&Ct(N.from,re(n).to)<=0;){var z=n.pop();if(Ct(z.from,N.from)<0){N.from=z.from;break}}n.push(N)}Wr(e,function(){for(var Q=n.length-1;Q>=0;Q--)ni(e.doc,"",n[Q].from,n[Q].to,"+delete");Qn(e)})}function Fa(e,t,i){var n=Ie(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Ba(e,t,i){var n=Fa(e,t.ch,i);return n==null?null:new Xe(t.line,n,i<0?"after":"before")}function Ua(e,t,i,n,c){if(e){t.doc.direction=="rtl"&&(c=-c);var N=qe(i,t.doc.direction);if(N){var z=c<0?re(N):N[0],Q=c<0==(z.level==1),q=Q?"after":"before",te;if(z.level>0||t.doc.direction=="rtl"){var pe=Xn(t,i);te=c<0?i.text.length-1:0;var ye=on(t,pe,te).top;te=Ge(function(Me){return on(t,pe,Me).top==ye},c<0==(z.level==1)?z.from:z.to-1,te),q=="before"&&(te=Fa(i,te,1))}else te=c<0?z.to:z.from;return new Xe(n,te,q)}}return new Xe(n,c<0?i.text.length:0,c<0?"before":"after")}function Ml(e,t,i,n){var c=qe(t,e.doc.direction);if(!c)return Ba(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var N=Je(c,i.ch,i.sticky),z=c[N];if(e.doc.direction=="ltr"&&z.level%2==0&&(n>0?z.to>i.ch:z.from<i.ch))return Ba(t,i,n);var Q=function(rt,lt){return Fa(t,rt instanceof Xe?rt.ch:rt,lt)},q,te=function(rt){return e.options.lineWrapping?(q=q||Xn(e,t),cs(e,t,q,rt)):{begin:0,end:t.text.length}},pe=te(i.sticky=="before"?Q(i,-1):i.ch);if(e.doc.direction=="rtl"||z.level==1){var ye=z.level==1==n<0,Me=Q(i,ye?1:-1);if(Me!=null&&(ye?Me<=z.to&&Me<=pe.end:Me>=z.from&&Me>=pe.begin)){var ke=ye?"before":"after";return new Xe(i.line,Me,ke)}}var He=function(rt,lt,nt){for(var ut=function(Xt,gr){return gr?new Xe(i.line,Q(Xt,1),"before"):new Xe(i.line,Xt,"after")};rt>=0&&rt<c.length;rt+=lt){var Tt=c[rt],vt=lt>0==(Tt.level!=1),Rt=vt?nt.begin:Q(nt.end,-1);if(Tt.from<=Rt&&Rt<Tt.to)return ut(Rt,vt);if(Rt=vt?Tt.from:Q(Tt.to,-1),nt.begin<=Rt&&Rt<nt.end)return ut(Rt,vt)}},Ye=He(N+n,n,pe);if(Ye)return Ye;var Qe=n>0?pe.end:Q(pe.begin,-1);return Qe!=null&&!(n>0&&Qe==t.text.length)&&(Ye=He(n>0?0:c.length-1,n,te(Qe)),Ye)?Ye:null}var Pi={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ge)},killLine:function(e){return si(e,function(t){if(t.empty()){var i=dt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Xe(t.head.line+1,0)}:{from:t.head,to:Xe(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return si(e,function(t){return{from:Xe(t.from().line,0),to:x(e.doc,Xe(t.to().line+1,0))}})},delLineLeft:function(e){return si(e,function(t){return{from:Xe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return si(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return si(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Xe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Xe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return uo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ho(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},Re)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},Re)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?ho(e,t.head):n},Re)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,c=0;c<i.length;c++){var N=i[c].from(),z=W(e.getLine(N.line),N.ch,n);t.push(he(n-z%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Wr(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var c=t[n].head,N=dt(e.doc,c.line).text;if(N){if(c.ch==N.length&&(c=new Xe(c.line,c.ch-1)),c.ch>0)c=new Xe(c.line,c.ch+1),e.replaceRange(N.charAt(c.ch-1)+N.charAt(c.ch-2),Xe(c.line,c.ch-2),c,"+transpose");else if(c.line>e.doc.first){var z=dt(e.doc,c.line-1).text;z&&(c=new Xe(c.line,1),e.replaceRange(N.charAt(0)+e.doc.lineSeparator()+z.charAt(z.length-1),Xe(c.line-1,z.length-1),c,"+transpose"))}}i.push(new Gt(c,c))}e.setSelections(i)})},newlineAndIndent:function(e){return Wr(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Qn(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var i=dt(e.doc,t),n=Ar(i);return n!=i&&(t=Ot(n)),Ua(!0,e,n,t,1)}function Pl(e,t){var i=dt(e.doc,t),n=Yn(i);return n!=i&&(t=Ot(n)),Ua(!0,e,i,t,-1)}function ho(e,t){var i=uo(e,t.line),n=dt(e.doc,i.line),c=qe(n,e.doc.direction);if(!c||c[0].level==0){var N=Math.max(i.ch,n.text.search(/\S/)),z=t.line==i.line&&t.ch<=N&&t.ch;return Xe(i.line,z?0:N,i.sticky)}return i}function ia(e,t,i){if(typeof t=="string"&&(t=Pi[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,c=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),c=t(e)!=we}finally{e.display.shift=n,e.state.suppressEdits=!1}return c}function Nl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var c=ai(t,e.state.keyMaps[n],i,e);if(c)return c}return e.options.extraKeys&&ai(t,e.options.extraKeys,i,e)||ai(t,e.options.keyMap,i,e)}var Fl=new $;function Ni(e,t,i,n){var c=e.state.keySeq;if(c){if(so(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==c&&(e.state.keySeq=null,e.display.input.reset())}),co(e,c+" "+t,i,n))return!0}return co(e,t,i,n)}function co(e,t,i,n){var c=Nl(e,t,n);return c=="multi"&&(e.state.keySeq=t),c=="handled"&&br(e,"keyHandled",e,t,i),(c=="handled"||c=="multi")&&(ae(i),xa(e)),!!c}function fo(e,t){var i=lo(t,!0);return i?t.shiftKey&&!e.state.keySeq?Ni(e,"Shift-"+i,t,function(n){return ia(e,n,!0)})||Ni(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ia(e,n)}):Ni(e,i,t,function(n){return ia(e,n)}):!1}function Bl(e,t,i){return Ni(e,"'"+i+"'",t,function(n){return ia(e,n,!0)})}var ja=null;function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=U(),We(t,e))return;K&&H<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=fo(t,e);m&&(ja=n?i:null,!n&&i==88&&!Ut&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!s&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;F(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(A(t,"CodeMirror-crosshair"),ot(document,"keyup",i),ot(document,"mouseover",i))}Be(document,"keyup",i),Be(document,"mouseover",i)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),We(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(dn(t.display,e)||We(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(m&&i==ja){ja=null,ae(e);return}if(m&&(!e.which||e.which<10)&&fo(t,e))return;var c=String.fromCharCode(n==null?i:n);if(c=="\b")return;if(Bl(t,e,c))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,i){this.time=e,this.pos=t,this.button=i};Ha.prototype.compare=function(e,t,i){return this.time+jl>e&&Ct(t,this.pos)==0&&i==this.button};var Fi,Bi;function Hl(e,t){var i=+new Date;return Bi&&Bi.compare(i,e,t)?(Fi=Bi=null,"triple"):Fi&&Fi.compare(i,e,t)?(Bi=new Ha(i,e,t),Fi=null,"double"):(Fi=new Ha(i,e,t),Bi=null,"single")}function vo(e){var t=this,i=t.display;if(We(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,dn(i,e)){r||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Wa(t,e))return;var n=Fn(t,e),c=Fe(e),N=n?Hl(n,c):"single";if(window.focus(),c==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,c,n,N,e))return;c==1?n?Kl(t,n,N,e):Ce(e)==i.scroller&&ae(e):c==2?(n&&Qi(t.doc,n),setTimeout(function(){return i.input.focus()},20)):c==3&&(D?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,i,n,c){var N="Click";return n=="double"?N="Double"+N:n=="triple"&&(N="Triple"+N),N=(t==1?"Left":t==2?"Middle":"Right")+N,Ni(e,oo(N,c),c,function(z){if(typeof z=="string"&&(z=Pi[z]),!z)return!1;var Q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Q=z(e,i)!=we}finally{e.state.suppressEdits=!1}return Q})}function Gl(e,t,i){var n=e.getOption("configureMouse"),c=n?n(e,t,i):{};if(c.unit==null){var N=a?i.shiftKey&&i.metaKey:i.altKey;c.unit=N?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(c.extend==null||e.doc.extend)&&(c.extend=e.doc.extend||i.shiftKey),c.addNew==null&&(c.addNew=s?i.metaKey:i.ctrlKey),c.moveOnDrag==null&&(c.moveOnDrag=!(s?i.altKey:i.ctrlKey)),c}function Kl(e,t,i,n){K?setTimeout(I(gs,e),0):e.curOp.focus=U();var c=Gl(e,i,n),N=e.doc.sel,z;e.options.dragDrop&&ze&&!e.isReadOnly()&&i=="single"&&(z=N.contains(t))>-1&&(Ct((z=N.ranges[z]).from(),t)<0||t.xRel>0)&&(Ct(z.to(),t)>0||t.xRel<0)?zl(e,n,t,c):Vl(e,n,t,c)}function zl(e,t,i,n){var c=e.display,N=!1,z=pr(e,function(te){r&&(c.scroller.draggable=!1),e.state.draggingText=!1,ot(c.wrapper.ownerDocument,"mouseup",z),ot(c.wrapper.ownerDocument,"mousemove",Q),ot(c.scroller,"dragstart",q),ot(c.scroller,"drop",z),N||(ae(te),n.addNew||Qi(e.doc,i,null,null,n.extend),r&&!p||K&&H==9?setTimeout(function(){c.wrapper.ownerDocument.body.focus({preventScroll:!0}),c.input.focus()},20):c.input.focus())}),Q=function(te){N=N||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},q=function(){return N=!0};r&&(c.scroller.draggable=!0),e.state.draggingText=z,z.copy=!n.moveOnDrag,c.scroller.dragDrop&&c.scroller.dragDrop(),Be(c.wrapper.ownerDocument,"mouseup",z),Be(c.wrapper.ownerDocument,"mousemove",Q),Be(c.scroller,"dragstart",q),Be(c.scroller,"drop",z),vs(e),setTimeout(function(){return c.input.focus()},20)}function yo(e,t,i){if(i=="char")return new Gt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Gt(Xe(t.line,0),x(e.doc,Xe(t.line+1,0)));var n=i(e,t);return new Gt(n.from,n.to)}function Vl(e,t,i,n){var c=e.display,N=e.doc;ae(t);var z,Q,q=N.sel,te=q.ranges;if(n.addNew&&!n.extend?(Q=N.sel.contains(i),Q>-1?z=te[Q]:z=new Gt(i,i)):(z=N.sel.primary(),Q=N.sel.primIndex),n.unit=="rectangle")n.addNew||(z=new Gt(i,i)),i=Fn(e,t,!0,!0),Q=-1;else{var pe=yo(e,i,n.unit);n.extend?z=Pa(z,pe.anchor,pe.head,n.extend):z=pe}n.addNew?Q==-1?(Q=te.length,wr(N,tn(e,te.concat([z]),Q),{scroll:!1,origin:"*mouse"})):te.length>1&&te[Q].empty()&&n.unit=="char"&&!n.extend?(wr(N,tn(e,te.slice(0,Q).concat(te.slice(Q+1)),0),{scroll:!1,origin:"*mouse"}),q=N.sel):Na(N,Q,z,xe):(Q=0,wr(N,new Yr([z],0),xe),q=N.sel);var ye=i;function Me(nt){if(Ct(ye,nt)==0)return;if(ye=nt,n.unit=="rectangle"){for(var ut=[],Tt=e.options.tabSize,vt=W(dt(N,i.line).text,i.ch,Tt),Rt=W(dt(N,nt.line).text,nt.ch,Tt),Xt=Math.min(vt,Rt),gr=Math.max(vt,Rt),er=Math.min(i.line,nt.line),Gr=Math.min(e.lastLine(),Math.max(i.line,nt.line));er<=Gr;er++){var Nr=dt(N,er).text,sr=Le(Nr,Xt,Tt);Xt==gr?ut.push(new Gt(Xe(er,sr),Xe(er,sr))):Nr.length>sr&&ut.push(new Gt(Xe(er,sr),Xe(er,Le(Nr,gr,Tt))))}ut.length||ut.push(new Gt(i,i)),wr(N,tn(e,q.ranges.slice(0,Q).concat(ut),Q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(nt)}else{var Fr=z,_r=yo(e,nt,n.unit),hr=Fr.anchor,or;Ct(_r.anchor,hr)>0?(or=_r.head,hr=yn(Fr.from(),_r.anchor)):(or=_r.anchor,hr=vn(Fr.to(),_r.head));var rr=q.ranges.slice(0);rr[Q]=Yl(e,new Gt(x(N,hr),or)),wr(N,tn(e,rr,Q),xe)}}var ke=c.wrapper.getBoundingClientRect(),He=0;function Ye(nt){var ut=++He,Tt=Fn(e,nt,!0,n.unit=="rectangle");if(!Tt)return;if(Ct(Tt,ye)!=0){e.curOp.focus=U(),Me(Tt);var vt=Vi(c,N);(Tt.line>=vt.to||Tt.line<vt.from)&&setTimeout(pr(e,function(){He==ut&&Ye(nt)}),150)}else{var Rt=nt.clientY<ke.top?-20:nt.clientY>ke.bottom?20:0;Rt&&setTimeout(pr(e,function(){if(He!=ut)return;c.scroller.scrollTop+=Rt,Ye(nt)}),50)}}function Qe(nt){e.state.selectingText=!1,He=Infinity,nt&&(ae(nt),c.input.focus()),ot(c.wrapper.ownerDocument,"mousemove",rt),ot(c.wrapper.ownerDocument,"mouseup",lt),N.history.lastSelOrigin=null}var rt=pr(e,function(nt){nt.buttons===0||!Fe(nt)?Qe(nt):Ye(nt)}),lt=pr(e,Qe);e.state.selectingText=lt,Be(c.wrapper.ownerDocument,"mousemove",rt),Be(c.wrapper.ownerDocument,"mouseup",lt)}function Yl(e,t){var i=t.anchor,n=t.head,c=dt(e.doc,i.line);if(Ct(i,n)==0&&i.sticky==n.sticky)return t;var N=qe(c);if(!N)return t;var z=Je(N,i.ch,i.sticky),Q=N[z];if(Q.from!=i.ch&&Q.to!=i.ch)return t;var q=z+(Q.from==i.ch==(Q.level!=1)?0:1);if(q==0||q==N.length)return t;var te;if(n.line!=i.line)te=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var pe=Je(N,n.ch,n.sticky),ye=pe-z||(n.ch-i.ch)*(Q.level==1?-1:1);pe==q-1||pe==q?te=ye<0:te=ye>0}var Me=N[q+(te?-1:0)],ke=te==(Me.level==1),He=ke?Me.from:Me.to,Ye=ke?"after":"before";return i.ch==He&&i.sticky==Ye?t:new Gt(new Xe(i.line,He,Ye),n)}function bo(e,t,i,n){var c,N;if(t.touches)c=t.touches[0].clientX,N=t.touches[0].clientY;else try{c=t.clientX,N=t.clientY}catch(Me){return!1}if(c>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ae(t);var z=e.display,Q=z.lineDiv.getBoundingClientRect();if(N>Q.bottom||!_e(e,i))return fe(t);N-=Q.top-z.viewOffset;for(var q=0;q<e.display.gutterSpecs.length;++q){var te=z.gutters.childNodes[q];if(te&&te.getBoundingClientRect().right>=c){var pe=lr(e.doc,N),ye=e.display.gutterSpecs[q];return je(e,i,e,pe,ye.className,t),fe(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(dn(e.display,t)||Xl(e,t))return;if(We(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Xl(e,t){return _e(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-"),yi(e)}var oi={toString:function(){return"CodeMirror.Init"}},xo={},aa={};function $l(e){var t=e.optionHandlers;function i(n,c,N,z){e.defaults[n]=c,N&&(t[n]=z?function(Q,q,te){te!=oi&&N(Q,q,te)}:N)}e.defineOption=i,e.Init=oi,i("value","",function(n,c){return n.setValue(c)},!0),i("mode",null,function(n,c){n.doc.modeOption=c,Da(n)},!0),i("indentUnit",2,Da,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){Ci(n),yi(n),Mr(n)},!0),i("lineSeparator",null,function(n,c){if(n.doc.lineSep=c,!c)return;var N=[],z=n.doc.first;n.doc.iter(function(q){for(var te=0;;){var pe=q.text.indexOf(c,te);if(pe==-1)break;te=pe+c.length,N.push(Xe(z,pe))}z++});for(var Q=N.length-1;Q>=0;Q--)ni(n.doc,c,N[Q],Xe(N[Q].line,N[Q].ch+c.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,c,N){n.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),N!=oi&&n.refresh()}),i("specialCharPlaceholder",Yt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",l?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,c){return n.getInputField().spellcheck=c},!0),i("autocorrect",!1,function(n,c){return n.getInputField().autocorrect=c},!0),i("autocapitalize",!1,function(n,c){return n.getInputField().autocapitalize=c},!0),i("rtlMoveVisually",!R),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Eo(n),Si(n)},!0),i("keyMap","default",function(n,c,N){var z=na(c),Q=N!=oi&&na(N);Q&&Q.detach&&Q.detach(n,z),z.attach&&z.attach(n,Q||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,c){n.display.gutterSpecs=La(c,n.options.lineNumbers),Si(n)},!0),i("fixedGutter",!0,function(n,c){n.display.gutters.style.left=c?_a(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return qn(n)},!0),i("scrollbarStyle","native",function(n){Ts(n),qn(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,c){n.display.gutterSpecs=La(n.options.gutters,c),Si(n)},!0),i("firstLineNumber",1,Si,!0),i("lineNumberFormatter",function(n){return n},Si,!0),i("showCursorWhenSelecting",!1,bi,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,c){c=="nocursor"&&(Zn(n),n.display.input.blur()),n.display.input.readOnlyChanged(c)}),i("screenReaderLabel",null,function(n,c){c=c===""?null:c,n.display.input.screenReaderLabelChanged(c)}),i("disableInput",!1,function(n,c){c||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,bi,!0),i("singleCursorHeightPerLine",!0,bi,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,Ci,!0),i("addModeClass",!1,Ci,!0),i("pollInterval",100),i("undoDepth",200,function(n,c){return n.doc.history.undoDepth=c}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,Ci,!0),i("moveInputWithCursor",!0,function(n,c){c||n.display.input.resetPosition()}),i("tabindex",null,function(n,c){return n.display.input.getField().tabIndex=c||""}),i("autofocus",null),i("direction","ltr",function(n,c){return n.doc.setDirection(c)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=oi;if(!t!=!n){var c=e.display.dragFunctions,N=t?Be:ot;N(e.display.scroller,"dragstart",c.start),N(e.display.scroller,"dragenter",c.enter),N(e.display.scroller,"dragover",c.over),N(e.display.scroller,"dragleave",c.leave),N(e.display.scroller,"drop",c.drop)}}function Zl(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(A(e.display.wrapper,"CodeMirror-wrap"),ji(e)),Ea(e),Mr(e),yi(e),setTimeout(function(){return qn(e)},100)}function Qt(e,t){var i=this;if(!(this instanceof Qt))return new Qt(e,t);this.options=t=t?g(t):{},g(xo,t,!1);var n=t.value;typeof n=="string"?n=new Pr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var c=new Qt.inputStyles[t.inputStyle](this),N=this.display=new hl(e,n,c,t);N.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 $,keySeq:null,specialChars:null},t.autofocus&&!l&&N.input.focus(),K&&H<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Rl(),Hn(this),this.curOp.forceUpdate=!0,ks(this,n),t.autofocus&&!l||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Ta(i)},20):Zn(this);for(var z in aa)aa.hasOwnProperty(z)&&aa[z](this,t[z],oi);Cs(this),t.finishInit&&t.finishInit(this);for(var Q=0;Q<Ga.length;++Q)Ga[Q](this);Wn(this),r&&t.lineWrapping&&getComputedStyle(N.lineDiv).textRendering=="optimizelegibility"&&(N.lineDiv.style.textRendering="auto")}Qt.defaults=xo,Qt.optionHandlers=aa;function Ql(e){var t=e.display;Be(t.scroller,"mousedown",pr(e,vo)),K&&H<11?Be(t.scroller,"dblclick",pr(e,function(q){if(We(e,q))return;var te=Fn(e,q);if(!te||Wa(e,q)||dn(e.display,q))return;ae(q);var pe=e.findWordAt(te);Qi(e.doc,pe.anchor,pe.head)})):Be(t.scroller,"dblclick",function(q){return We(e,q)||ae(q)}),Be(t.scroller,"contextmenu",function(q){return _o(e,q)}),Be(t.input.getField(),"contextmenu",function(q){t.scroller.contains(q.target)||_o(e,q)});var i,n={end:0};function c(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function N(q){if(q.touches.length!=1)return!1;var te=q.touches[0];return te.radiusX<=1&&te.radiusY<=1}function z(q,te){if(te.left==null)return!0;var pe=te.left-q.left,ye=te.top-q.top;return pe*pe+ye*ye>20*20}Be(t.scroller,"touchstart",function(q){if(!We(e,q)&&!N(q)&&!Wa(e,q)){t.input.ensurePolled(),clearTimeout(i);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-n.end<=300?n:null},q.touches.length==1&&(t.activeTouch.left=q.touches[0].pageX,t.activeTouch.top=q.touches[0].pageY)}}),Be(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Be(t.scroller,"touchend",function(q){var te=t.activeTouch;if(te&&!dn(t,q)&&te.left!=null&&!te.moved&&new Date-te.start<300){var pe=e.coordsChar(t.activeTouch,"page"),ye;!te.prev||z(te,te.prev)?ye=new Gt(pe,pe):!te.prev.prev||z(te,te.prev.prev)?ye=e.findWordAt(pe):ye=new Gt(Xe(pe.line,0),x(e.doc,Xe(pe.line+1,0))),e.setSelection(ye.anchor,ye.head),e.focus(),ae(q)}c()}),Be(t.scroller,"touchcancel",c),Be(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ei(e,t.scroller.scrollTop),Un(e,t.scroller.scrollLeft,!0),je(e,"scroll",e))}),Be(t.scroller,"mousewheel",function(q){return Rs(e,q)}),Be(t.scroller,"DOMMouseScroll",function(q){return Rs(e,q)}),Be(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(q){We(e,q)||me(q)},over:function(q){We(e,q)||(Ol(e,q),me(q))},start:function(q){return Al(e,q)},drop:pr(e,Cl),leave:function(q){We(e,q)||no(e)}};var Q=t.input.getField();Be(Q,"keyup",function(q){return mo.call(e,q)}),Be(Q,"keydown",pr(e,po)),Be(Q,"keypress",pr(e,go)),Be(Q,"focus",function(q){return Ta(e,q)}),Be(Q,"blur",function(q){return Zn(e,q)})}var Ga=[];Qt.defineInitHook=function(e){return Ga.push(e)};function Ui(e,t,i,n){var c=e.doc,N;i==null&&(i="add"),i=="smart"&&(c.mode.indent?N=et(e,t).state:i="prev");var z=e.options.tabSize,Q=dt(c,t),q=W(Q.text,null,z);Q.stateAfter&&(Q.stateAfter=null);var te=Q.text.match(/^\s*/)[0],pe;if(!n&&!/\S/.test(Q.text))pe=0,i="not";else if(i=="smart"&&(pe=c.mode.indent(N,Q.text.slice(te.length),Q.text),pe==we||pe>150)){if(!n)return;i="prev"}i=="prev"?t>c.first?pe=W(dt(c,t-1).text,null,z):pe=0:i=="add"?pe=q+e.options.indentUnit:i=="subtract"?pe=q-e.options.indentUnit:typeof i=="number"&&(pe=q+i),pe=Math.max(0,pe);var ye="",Me=0;if(e.options.indentWithTabs)for(var ke=Math.floor(pe/z);ke;--ke)Me+=z,ye+=" ";if(Me<pe&&(ye+=he(pe-Me)),ye!=te)return ni(c,ye,Xe(t,0),Xe(t,te.length),"+input"),Q.stateAfter=null,!0;for(var He=0;He<c.sel.ranges.length;He++){var Ye=c.sel.ranges[He];if(Ye.head.line==t&&Ye.head.ch<te.length){var Qe=Xe(t,te.length);Na(c,He,new Gt(Qe,Qe));break}}}var rn=null;function sa(e){rn=e}function Ka(e,t,i,n,c){var N=e.doc;e.display.shift=!1,n||(n=N.sel);var z=+new Date-200,Q=c=="paste"||e.state.pasteIncoming>z,q=St(t),te=null;if(Q&&n.ranges.length>1)if(rn&&rn.text.join(`
`)==t){if(n.ranges.length%rn.text.length==0){te=[];for(var pe=0;pe<rn.text.length;pe++)te.push(N.splitLines(rn.text[pe]))}}else q.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(te=de(q,function(rt){return[rt]}));for(var ye=e.curOp.updateInput,Me=n.ranges.length-1;Me>=0;Me--){var ke=n.ranges[Me],He=ke.from(),Ye=ke.to();ke.empty()&&(i&&i>0?He=Xe(He.line,He.ch-i):e.state.overwrite&&!Q?Ye=Xe(Ye.line,Math.min(dt(N,Ye.line).text.length,Ye.ch+re(q).length)):Q&&rn&&rn.lineWise&&rn.text.join(`
`)==q.join(`
`)&&(He=Ye=Xe(He.line,0)));var Qe={from:He,to:Ye,text:te?te[Me%te.length]:q,origin:c||(Q?"paste":e.state.cutIncoming>z?"cut":"+input")};ri(e.doc,Qe),br(e,"inputRead",e,Qe)}t&&!Q&&wo(e,t),Qn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ye),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Wr(t,function(){return Ka(t,i,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var c=i.ranges[n];if(c.head.ch>100||n&&i.ranges[n-1].head.line==c.head.line)continue;var N=e.getModeAt(c.head),z=!1;if(N.electricChars){for(var Q=0;Q<N.electricChars.length;Q++)if(t.indexOf(N.electricChars.charAt(Q))>-1){z=Ui(e,c.head.line,"smart");break}}else N.electricInput&&(N.electricInput.test(dt(e.doc,c.head.line).text.slice(0,c.head.ch))&&(z=Ui(e,c.head.line,"smart")));z&&br(e,"electricInput",e,c.head.line)}}function So(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var c=e.doc.sel.ranges[n].head.line,N={anchor:Xe(c,0),head:Xe(c+1,0)};i.push(N),t.push(e.getRange(N.anchor,N.head))}return{text:t,ranges:i}}function Co(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ao(){var e=f("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=f("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return r?e.style.width="1000px":e.setAttribute("wrap","off"),d&&(e.style.border="1px solid black"),Co(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,c){var N=this.options,z=N[n];if(N[n]==c&&n!="mode")return;N[n]=c,t.hasOwnProperty(n)&&pr(this,t[n])(this,c,z),je(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,c){this.state.keyMaps[c?"push":"unshift"](na(n))},removeKeyMap:function(n){for(var c=this.state.keyMaps,N=0;N<c.length;++N)if(c[N]==n||c[N].name==n)return c.splice(N,1),!0},addOverlay:Or(function(n,c){var N=n.token?n:e.getMode(this.options,n);if(N.startState)throw new Error("Overlays may not be stateful.");se(this.state.overlays,{mode:N,modeSpec:n,opaque:c&&c.opaque,priority:c&&c.priority||0},function(z){return z.priority}),this.state.modeGen++,Mr(this)}),removeOverlay:Or(function(n){for(var c=this.state.overlays,N=0;N<c.length;++N){var z=c[N].modeSpec;if(z==n||typeof n=="string"&&z.name==n){c.splice(N,1),this.state.modeGen++,Mr(this);return}}}),indentLine:Or(function(n,c,N){typeof c!="string"&&typeof c!="number"&&(c==null?c=this.options.smartIndent?"smart":"prev":c=c?"add":"subtract"),Ir(this.doc,n)&&Ui(this,n,c,N)}),indentSelection:Or(function(n){for(var c=this.doc.sel.ranges,N=-1,z=0;z<c.length;z++){var Q=c[z];if(Q.empty())Q.head.line>N&&(Ui(this,Q.head.line,n,!0),N=Q.head.line,z==this.doc.sel.primIndex&&Qn(this));else{var q=Q.from(),te=Q.to(),pe=Math.max(N,q.line);N=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var ye=pe;ye<N;++ye)Ui(this,ye,n);var Me=this.doc.sel.ranges;q.ch==0&&c.length==Me.length&&Me[z].from().ch>0&&Na(this.doc,z,new Gt(q,Me[z].to()),ge)}}}),getTokenAt:function(n,c){return $t(this,n,c)},getLineTokens:function(n,c){return $t(this,Xe(n),c,!0)},getTokenTypeAt:function(n){n=x(this.doc,n);var c=Ke(this,dt(this.doc,n.line)),N=0,z=(c.length-1)/2,Q=n.ch,q;if(Q==0)q=c[2];else for(;;){var te=N+z>>1;if((te?c[te*2-1]:0)>=Q)z=te;else if(c[te*2+1]<Q)N=te+1;else{q=c[te*2+2];break}}var pe=q?q.indexOf("overlay "):-1;return pe<0?q:pe==0?null:q.slice(0,pe-1)},getModeAt:function(n){var c=this.doc.mode;return c.innerMode?e.innerMode(c,this.getTokenAt(n).state).mode:c},getHelper:function(n,c){return this.getHelpers(n,c)[0]},getHelpers:function(n,c){var N=[];if(!i.hasOwnProperty(c))return N;var z=i[c],Q=this.getModeAt(n);if(typeof Q[c]=="string")z[Q[c]]&&N.push(z[Q[c]]);else if(Q[c])for(var q=0;q<Q[c].length;q++){var te=z[Q[c][q]];te&&N.push(te)}else Q.helperType&&z[Q.helperType]?N.push(z[Q.helperType]):z[Q.name]&&N.push(z[Q.name]);for(var pe=0;pe<z._global.length;pe++){var ye=z._global[pe];ye.pred(Q,this)&&ne(N,ye.val)==-1&&N.push(ye.val)}return N},getStateAfter:function(n,c){var N=this.doc;return n=Y(N,n==null?N.first+N.size-1:n),et(this,n+1,c).state},cursorCoords:function(n,c){var N,z=this.doc.sel.primary();return n==null?N=z.head:typeof n=="object"?N=x(this.doc,n):N=n?z.from():z.to(),en(this,N,c||"page")},charCoords:function(n,c){return ma(this,x(this.doc,n),c||"page")},coordsChar:function(n,c){return n=ls(this,n,c||"page"),va(this,n.left,n.top)},lineAtHeight:function(n,c){return n=ls(this,{top:n,left:0},c||"page").top,lr(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,c,N){var z=!1,Q;if(typeof n=="number"){var q=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>q&&(n=q,z=!0),Q=dt(this.doc,n)}else Q=n;return Wi(this,Q,{top:0,left:0},c||"page",N||z).top+(z?this.doc.height-qr(Q):0)},defaultTextHeight:function(){return $n(this.display)},defaultCharWidth:function(){return Jn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,c,N,z,Q){var q=this.display;n=en(this,x(this.doc,n));var te=n.bottom,pe=n.left;if(c.style.position="absolute",c.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(c),q.sizer.appendChild(c),z=="over")te=n.top;else if(z=="above"||z=="near"){var ye=Math.max(q.wrapper.clientHeight,this.doc.height),Me=Math.max(q.sizer.clientWidth,q.lineSpace.clientWidth);(z=="above"||n.bottom+c.offsetHeight>ye)&&n.top>c.offsetHeight?te=n.top-c.offsetHeight:n.bottom+c.offsetHeight<=ye&&(te=n.bottom),pe+c.offsetWidth>Me&&(pe=Me-c.offsetWidth)}c.style.top=te+"px",c.style.left=c.style.right="",Q=="right"?(pe=q.sizer.clientWidth-c.offsetWidth,c.style.right="0px"):(Q=="left"?pe=0:Q=="middle"&&(pe=(q.sizer.clientWidth-c.offsetWidth)/2),c.style.left=pe+"px"),N&&Jo(this,{left:pe,top:te,right:pe+c.offsetWidth,bottom:te+c.offsetHeight})},triggerOnKeyDown:Or(po),triggerOnKeyPress:Or(go),triggerOnKeyUp:mo,triggerOnMouseDown:Or(vo),execCommand:function(n){if(Pi.hasOwnProperty(n))return Pi[n].call(null,this)},triggerElectric:Or(function(n){wo(this,n)}),findPosH:function(n,c,N,z){var Q=1;c<0&&(Q=-1,c=-c);for(var q=x(this.doc,n),te=0;te<c&&!(q=za(this.doc,q,Q,N,z),q.hitSide);++te);return q},moveH:Or(function(n,c){var N=this;this.extendSelectionsBy(function(z){return N.display.shift||N.doc.extend||z.empty()?za(N.doc,z.head,n,c,N.options.rtlMoveVisually):n<0?z.from():z.to()},Re)}),deleteH:Or(function(n,c){var N=this.doc.sel,z=this.doc;N.somethingSelected()?z.replaceSelection("",null,"+delete"):si(this,function(Q){var q=za(z,Q.head,n,c,!1);return n<0?{from:q,to:Q.head}:{from:Q.head,to:q}})}),findPosV:function(n,c,N,z){var Q=1,q=z;c<0&&(Q=-1,c=-c);for(var te=x(this.doc,n),pe=0;pe<c;++pe){var ye=en(this,te,"div");if(q==null?q=ye.left:ye.left=q,te=Oo(this,ye,Q,N),te.hitSide)break}return te},moveV:Or(function(n,c){var N=this,z=this.doc,Q=[],q=!this.display.shift&&!z.extend&&z.sel.somethingSelected();if(z.extendSelectionsBy(function(pe){if(q)return n<0?pe.from():pe.to();var ye=en(N,pe.head,"div");pe.goalColumn!=null&&(ye.left=pe.goalColumn),Q.push(ye.left);var Me=Oo(N,ye,n,c);return c=="page"&&pe==z.sel.primary()&&Sa(N,ma(N,Me,"div").top-ye.top),Me},Re),Q.length)for(var te=0;te<z.sel.ranges.length;te++)z.sel.ranges[te].goalColumn=Q[te]}),findWordAt:function(n){var c=this.doc,N=dt(c,n.line).text,z=n.ch,Q=n.ch;if(N){var q=this.getHelper(n,"wordChars");(n.sticky=="before"||Q==N.length)&&z?--z:++Q;for(var te=N.charAt(z),pe=Ue(te,q)?function(ye){return Ue(ye,q)}:/\s/.test(te)?function(ye){return/\s/.test(ye)}:function(ye){return!/\s/.test(ye)&&!Ue(ye)};z>0&&pe(N.charAt(z-1));)--z;for(;Q<N.length&&pe(N.charAt(Q));)++Q}return new Gt(Xe(n.line,z),Xe(n.line,Q))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):A(this.display.cursorDiv,"CodeMirror-overwrite"),je(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==U()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Or(function(n,c){_i(this,n,c)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-sn(this)-this.display.barHeight,width:n.scrollWidth-sn(this)-this.display.barWidth,clientHeight:da(this),clientWidth:Pn(this)}},scrollIntoView:Or(function(n,c){n==null?(n={from:this.doc.sel.primary().head,to:null},c==null&&(c=this.options.cursorScrollMargin)):typeof n=="number"?n={from:Xe(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=c||0,n.from.line!=null?Zo(this,n):bs(this,n.from,n.to,n.margin)}),setSize:Or(function(n,c){var N=this,z=function(q){return typeof q=="number"||/^\d+$/.test(String(q))?q+"px":q};n!=null&&(this.display.wrapper.style.width=z(n)),c!=null&&(this.display.wrapper.style.height=z(c)),this.options.lineWrapping&&as(this);var Q=this.display.viewFrom;this.doc.iter(Q,this.display.viewTo,function(q){if(q.widgets){for(var te=0;te<q.widgets.length;te++)if(q.widgets[te].noHScroll){wn(N,Q,"widget");break}}++Q}),this.curOp.forceUpdate=!0,je(this,"refresh",this)}),operation:function(n){return Wr(this,n)},startOperation:function(){return Hn(this)},endOperation:function(){return Wn(this)},refresh:Or(function(){var n=this.display.cachedTextHeight;Mr(this),this.curOp.forceUpdate=!0,yi(this),_i(this,this.doc.scrollLeft,this.doc.scrollTop),Oa(this.display),(n==null||Math.abs(n-$n(this.display))>.5||this.options.lineWrapping)&&Ea(this),je(this,"refresh",this)}),swapDoc:Or(function(n){var c=this.doc;return c.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,n),yi(this),this.display.input.reset(),_i(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,br(this,"swapDoc",this,c),c}),phrase:function(n){var c=this.options.phrases;return c&&Object.prototype.hasOwnProperty.call(c,n)?c[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Te(e),e.registerHelper=function(n,c,N){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][c]=N},e.registerGlobalHelper=function(n,c,N,z){e.registerHelper(n,c,z),i[n]._global.push({pred:N,val:z})}}function za(e,t,i,n,c){var N=t,z=i,Q=dt(e,t.line),q=c&&e.direction=="rtl"?-i:i;function te(){var lt=t.line+q;return lt<e.first||lt>=e.first+e.size?!1:(t=new Xe(lt,t.ch,t.sticky),Q=dt(e,lt))}function pe(lt){var nt;if(n=="codepoint"){var ut=Q.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(ut)?nt=null:nt=new Xe(t.line,Math.max(0,Math.min(Q.text.length,t.ch+i*(ut>=55296&&ut<56320?2:1))),-i)}else c?nt=Ml(e.cm,Q,t,i):nt=Ba(Q,t,i);if(nt==null)if(!lt&&te())t=Ua(c,e.cm,Q,t.line,q);else return!1;else t=nt;return!0}if(n=="char"||n=="codepoint")pe();else if(n=="column")pe(!0);else if(n=="word"||n=="group")for(var ye=null,Me=n=="group",ke=e.cm&&e.cm.getHelper(t,"wordChars"),He=!0;!(i<0&&!pe(!He));He=!1){var Ye=Q.text.charAt(t.ch)||`
`,Qe=Ue(Ye,ke)?"w":Me&&Ye==`
`?"n":!Me||/\s/.test(Ye)?null:"p";if(Me&&!He&&!Qe&&(Qe="s"),ye&&ye!=Qe){i<0&&(i=1,pe(),t.sticky="after");break}if(Qe&&(ye=Qe),i>0&&!pe(!He))break}var rt=ea(e,t,N,z,!0);return mn(N,rt)&&(rt.hitSide=!0),rt}function Oo(e,t,i,n){var c=e.doc,N=t.left,z;if(n=="page"){var Q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),q=Math.max(Q-.5*$n(e.display),3);z=(i>0?t.bottom:t.top)+i*q}else n=="line"&&(z=i>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,N,z),!te.outside);){if(i<0?z<=0:z>=c.height){te.hitSide=!0;break}z+=i*5}return te}var zt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};zt.prototype.init=function(e){var t=this,i=this,n=i.cm,c=i.div=e.lineDiv;Co(c,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function N(Q){for(var q=Q.target;q;q=q.parentNode){if(q==c)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(q.className))break}return!1}Be(c,"paste",function(Q){if(!N(Q)||We(n,Q)||To(Q,n))return;H<=11&&setTimeout(pr(n,function(){return t.updateFromDOM()}),20)}),Be(c,"compositionstart",function(Q){t.composing={data:Q.data,done:!1}}),Be(c,"compositionupdate",function(Q){t.composing||(t.composing={data:Q.data,done:!1})}),Be(c,"compositionend",function(Q){t.composing&&(Q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Be(c,"touchstart",function(){return i.forceCompositionEnd()}),Be(c,"input",function(){t.composing||t.readFromDOMSoon()});function z(Q){if(!N(Q)||We(n,Q))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()}),Q.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var q=So(n);sa({lineWise:!0,text:q.text}),Q.type=="cut"&&n.operation(function(){n.setSelections(q.ranges,0,ge),n.replaceSelection("",null,"cut")})}else return;if(Q.clipboardData){Q.clipboardData.clearData();var te=rn.text.join(`
`);if(Q.clipboardData.setData("Text",te),Q.clipboardData.getData("Text")==te){Q.preventDefault();return}}var pe=Ao(),ye=pe.firstChild;n.display.lineSpace.insertBefore(pe,n.display.lineSpace.firstChild),ye.value=rn.text.join(`
`);var Me=document.activeElement;M(ye),setTimeout(function(){n.display.lineSpace.removeChild(pe),Me.focus(),Me==c&&i.showPrimarySelection()},50)}Be(c,"copy",z),Be(c,"cut",z)},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,i=t.doc.sel.primary(),n=i.from(),c=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||c.line<t.display.viewFrom){e.removeAllRanges();return}var N=oa(t,e.anchorNode,e.anchorOffset),z=oa(t,e.focusNode,e.focusOffset);if(N&&!N.bad&&z&&!z.bad&&Ct(yn(N,z),n)==0&&Ct(vn(N,z),c)==0)return;var Q=t.display.view,q=n.line>=t.display.viewFrom&&Ro(t,n)||{node:Q[0].measure.map[2],offset:0},te=c.line<t.display.viewTo&&Ro(t,c);if(!te){var pe=Q[Q.length-1].measure,ye=pe.maps?pe.maps[pe.maps.length-1]:pe.map;te={node:ye[ye.length-1],offset:ye[ye.length-2]-ye[ye.length-3]}}if(!q||!te){e.removeAllRanges();return}var Me=e.rangeCount&&e.getRangeAt(0),ke;try{ke=y(q.node,q.offset,te.offset,te.node)}catch(He){}ke&&(!P&&t.state.focused?(e.collapse(q.node,q.offset),ke.collapsed||(e.removeAllRanges(),e.addRange(ke))):(e.removeAllRanges(),e.addRange(ke)),Me&&e.anchorNode==null?e.addRange(Me):P&&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){T(this.cm.display.cursorDiv,e.cursors),T(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 b(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():Wr(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&&v&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=oa(t,e.anchorNode,e.anchorOffset),n=oa(t,e.focusNode,e.focusOffset);i&&n&&Wr(t,function(){wr(t.doc,Cn(i,n),ge),(i.bad||n.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,i=e.doc.sel.primary(),n=i.from(),c=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=Xe(n.line-1,dt(e.doc,n.line-1).length)),c.ch==dt(e.doc,c.line).text.length&&c.line<e.lastLine()&&(c=Xe(c.line+1,0)),n.line<t.viewFrom||c.line>t.viewTo-1)return!1;var N,z,Q;n.line==t.viewFrom||(N=Bn(e,n.line))==0?(z=Ot(t.view[0].line),Q=t.view[0].node):(z=Ot(t.view[N].line),Q=t.view[N-1].node.nextSibling);var q=Bn(e,c.line),te,pe;if(q==t.view.length-1?(te=t.viewTo-1,pe=t.lineDiv.lastChild):(te=Ot(t.view[q+1].line)-1,pe=t.view[q+1].node.previousSibling),!Q)return!1;for(var ye=e.doc.splitLines(tu(e,Q,pe,z,te)),Me=Ur(e.doc,Xe(z,0),Xe(te,dt(e.doc,te).text.length));ye.length>1&&Me.length>1;)if(re(ye)==re(Me))ye.pop(),Me.pop(),te--;else if(ye[0]==Me[0])ye.shift(),Me.shift(),z++;else break;for(var ke=0,He=0,Ye=ye[0],Qe=Me[0],rt=Math.min(Ye.length,Qe.length);ke<rt&&Ye.charCodeAt(ke)==Qe.charCodeAt(ke);)++ke;for(var lt=re(ye),nt=re(Me),ut=Math.min(lt.length-(ye.length==1?ke:0),nt.length-(Me.length==1?ke:0));He<ut&&lt.charCodeAt(lt.length-He-1)==nt.charCodeAt(nt.length-He-1);)++He;if(ye.length==1&&Me.length==1&&z==n.line)for(;ke&&ke>n.ch&&lt.charCodeAt(lt.length-He-1)==nt.charCodeAt(nt.length-He-1);)ke--,He++;ye[ye.length-1]=lt.slice(0,lt.length-He).replace(/^\u200b+/,""),ye[0]=ye[0].slice(ke).replace(/\u200b+$/,"");var Tt=Xe(z,ke),vt=Xe(te,Me.length?re(Me).length-He:0);if(ye.length>1||ye[0]||Ct(Tt,vt))return ni(e.doc,ye,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())&&Wr(this.cm,function(){return Mr(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()||pr(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 i=fa(e,t.line);if(!i||i.hidden)return null;var n=dt(e.doc,t.line),c=es(i,n,t.line),N=qe(n,e.doc.direction),z="left";if(N){var Q=Je(N,t.ch);z=Q%2?"right":"left"}var q=ns(c.map,t.ch,z);return q.offset=q.collapse=="right"?q.end:q.start,q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function li(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,c){var N="",z=!1,Q=e.doc.lineSeparator(),q=!1;function te(ke){return function(He){return He.id==ke}}function pe(){z&&(N+=Q,q&&(N+=Q),z=q=!1)}function ye(ke){ke&&(pe(),N+=ke)}function Me(ke){if(ke.nodeType==1){var He=ke.getAttribute("cm-text");if(He){ye(He);return}var Ye=ke.getAttribute("cm-marker"),Qe;if(Ye){var rt=e.findMarks(Xe(n,0),Xe(c+1,0),te(+Ye));rt.length&&(Qe=rt[0].find(0))&&ye(Ur(e.doc,Qe.from,Qe.to).join(Q));return}if(ke.getAttribute("contenteditable")=="false")return;var lt=/^(pre|div|p|li|table|br)$/i.test(ke.nodeName);if(!/^br$/i.test(ke.nodeName)&&ke.textContent.length==0)return;lt&&pe();for(var nt=0;nt<ke.childNodes.length;nt++)Me(ke.childNodes[nt]);/^(pre|p)$/i.test(ke.nodeName)&&(q=!0),lt&&(z=!0)}else ke.nodeType==3&&ye(ke.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Me(t),t==i);)t=t.nextSibling,q=!1;return N}function oa(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return li(e.clipPos(Xe(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var c=0;c<e.display.view.length;c++){var N=e.display.view[c];if(N.node==n)return ru(N,t,i)}}function ru(e,t,i){var n=e.text.firstChild,c=!1;if(!t||!b(n,t))return li(Xe(Ot(e.line),0),!0);if(t==n&&(c=!0,t=n.childNodes[i],i=0,!t)){var N=e.rest?re(e.rest):e.line;return li(Xe(Ot(N),N.text.length),c)}var z=t.nodeType==3?t:null,Q=t;for(!z&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(z=t.firstChild,i&&(i=z.nodeValue.length));Q.parentNode!=n;)Q=Q.parentNode;var q=e.measure,te=q.maps;function pe(Qe,rt,lt){for(var nt=-1;nt<(te?te.length:0);nt++)for(var ut=nt<0?q.map:te[nt],Tt=0;Tt<ut.length;Tt+=3){var vt=ut[Tt+2];if(vt==Qe||vt==rt){var Rt=Ot(nt<0?e.line:e.rest[nt]),Xt=ut[Tt]+lt;return(lt<0||vt!=Qe)&&(Xt=ut[Tt+(lt?1:0)]),Xe(Rt,Xt)}}}var ye=pe(z,Q,i);if(ye)return li(ye,c);for(var Me=Q.nextSibling,ke=z?z.nodeValue.length-i:0;Me;Me=Me.nextSibling){if(ye=pe(Me,Me.firstChild,0),ye)return li(Xe(ye.line,ye.ch-ke),c);ke+=Me.textContent.length}for(var He=Q.previousSibling,Ye=i;He;He=He.previousSibling){if(ye=pe(He,He.firstChild,-1),ye)return li(Xe(ye.line,ye.ch+Ye),c);Ye+=He.textContent.length}}var ir=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new $,this.hasSelection=!1,this.composing=null};ir.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var c=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),d&&(c.style.width="0px"),Be(c,"input",function(){K&&H>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Be(c,"paste",function(z){if(We(n,z)||To(z,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function N(z){if(We(n,z))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var Q=So(n);sa({lineWise:!0,text:Q.text}),z.type=="cut"?n.setSelections(Q.ranges,null,ge):(i.prevInput="",c.value=Q.text.join(`
`),M(c))}else return;z.type=="cut"&&(n.state.cutIncoming=+new Date)}Be(c,"cut",N),Be(c,"copy",N),Be(e.scroller,"paste",function(z){if(dn(e,z)||We(n,z))return;if(!c.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var Q=new Event("paste");Q.clipboardData=z.clipboardData,c.dispatchEvent(Q)}),Be(e.lineSpace,"selectstart",function(z){dn(e,z)||ae(z)}),Be(c,"compositionstart",function(){var z=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:z,range:n.markText(z,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Be(c,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},ir.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},ir.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ir.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=ps(e);if(e.options.moveInputWithCursor){var c=en(e,i.sel.primary().head,"div"),N=t.wrapper.getBoundingClientRect(),z=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,c.top+z.top-N.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,c.left+z.left-N.left))}return n},ir.prototype.showSelection=function(e){var t=this.cm,i=t.display;T(i.cursorDiv,e.cursors),T(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ir.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&M(this.textarea),K&&H>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",K&&H>=9&&(this.hasSelection=null))},ir.prototype.getField=function(){return this.textarea},ir.prototype.supportsTouch=function(){return!1},ir.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!l||U()!=this.textarea))try{this.textarea.focus()}catch(e){}},ir.prototype.blur=function(){this.textarea.blur()},ir.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ir.prototype.receivedFocus=function(){this.slowPoll()},ir.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()})},ir.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},ir.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ht(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var c=i.value;if(c==n&&!t.somethingSelected())return!1;if(K&&H>=9&&this.hasSelection===c||s&&/[\uf700-\uf7ff]/.test(c))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var N=c.charCodeAt(0);if(N==8203&&!n&&(n="\u200B"),N==8666)return this.reset(),this.cm.execCommand("undo")}for(var z=0,Q=Math.min(n.length,c.length);z<Q&&n.charCodeAt(z)==c.charCodeAt(z);)++z;return Wr(t,function(){Ka(t,c.slice(z),n.length-z,null,e.composing?"*compose":null),c.length>1e3||c.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=c,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ir.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ir.prototype.onKeyPress=function(){K&&H>=9&&(this.hasSelection=null),this.fastPoll()},ir.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,c=t.textarea;t.contextMenuPending&&t.contextMenuPending();var N=Fn(i,e),z=n.scroller.scrollTop;if(!N||m)return;var Q=i.options.resetSelectionOnContextMenu;Q&&i.doc.sel.contains(N)==-1&&pr(i,wr)(i.doc,Cn(N),ge);var q=c.style.cssText,te=t.wrapper.style.cssText,pe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",c.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-pe.top-5)+"px; left: "+(e.clientX-pe.left-5)+`px;
z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ye;r&&(ye=window.scrollY),n.input.focus(),r&&window.scrollTo(null,ye),n.input.reset(),i.somethingSelected()||(c.value=t.prevInput=" "),t.contextMenuPending=ke,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function Me(){if(c.selectionStart!=null){var Ye=i.somethingSelected(),Qe="\u200B"+(Ye?c.value:"");c.value="\u21DA",c.value=Qe,t.prevInput=Ye?"":"\u200B",c.selectionStart=1,c.selectionEnd=Qe.length,n.selForContextMenu=i.doc.sel}}function ke(){if(t.contextMenuPending!=ke)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,c.style.cssText=q,K&&H<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=z),c.selectionStart!=null){(!K||K&&H<9)&&Me();var Ye=0,Qe=function(){n.selForContextMenu==i.doc.sel&&c.selectionStart==0&&c.selectionEnd>0&&t.prevInput=="\u200B"?pr(i,Vs)(i):Ye++<10?n.detectingSelectAll=setTimeout(Qe,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Qe,200)}}if(K&&H>=9&&Me(),D){me(e);var He=function(){ot(window,"mouseup",He),setTimeout(ke,20)};Be(window,"mouseup",He)}else setTimeout(ke,50)},ir.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ir.prototype.setUneditable=function(){},ir.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?g(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=U();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=Q.getValue()}var c;if(e.form&&(Be(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var N=e.form;c=N.submit;try{var z=N.submit=function(){n(),N.submit=c,N.submit(),N.submit=z}}catch(q){}}t.finishInit=function(q){q.save=n,q.getTextArea=function(){return e},q.toTextArea=function(){q.toTextArea=isNaN,n(),e.parentNode.removeChild(q.getWrapperElement()),e.style.display="",e.form&&(ot(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=c))}},e.style.display="none";var Q=Qt(function(q){return e.parentNode.insertBefore(q,e.nextSibling)},t);return Q}function iu(e){e.off=ot,e.on=Be,e.wheelEventPixels=cl,e.Doc=Pr,e.splitLines=St,e.countColumn=W,e.findColumn=Le,e.isWordChar=Pe,e.Pass=we,e.signal=je,e.Line=Mn,e.changeEnd=An,e.scrollbarModel=xs,e.Pos=Xe,e.cmpPos=Ct,e.modes=Zt,e.mimeModes=It,e.resolveMode=yt,e.getMode=Lr,e.modeExtensions=bt,e.extendMode=xt,e.copyState=Ft,e.startState=cr,e.innerMode=tr,e.commands=Pi,e.keyMap=fn,e.keyName=lo,e.isModifierKey=so,e.lookupKey=ai,e.normalizeKeyMap=kl,e.StringStream=Pt,e.SharedTextMarker=Di,e.TextMarker=Rn,e.LineWidget=Ii,e.e_preventDefault=ae,e.e_stopPropagation=ue,e.e_stop=me,e.addClass=F,e.contains=b,e.rmClass=A,e.keyNames=Ln}$l(Qt),ql(Qt);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Pr.prototype)Pr.prototype.hasOwnProperty(la)&&ne(au,la)<0&&(Qt.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Pr.prototype[la]));return Te(Pr),Qt.inputStyles={textarea:ir,contenteditable:zt},Qt.defineMode=function(e){!Qt.defaults.mode&&e!="null"&&(Qt.defaults.mode=e),Cr.apply(this,arguments)},Qt.defineMIME=Kr,Qt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Qt.defineMIME("text/plain","null"),Qt.defineExtension=function(e,t){Qt.prototype[e]=t},Qt.defineDocExtension=function(e,t){Pr.prototype[e]=t},Qt.fromTextArea=nu,iu(Qt),Qt.version="5.58.2",Qt})},Y1PL:function(tt,be,Z){"use strict";Z.r(be),Z.d(be,"ResizableTextArea",function(){return ne});var ie=Z("wx14"),J=Z("1OyB"),P=Z("vuIU"),X=Z("Ji7U"),j=Z("LK+K"),B=Z("q1tI"),K=Z("VTBJ"),H=Z("rePB"),r=Z("Zm9Q"),L=Z("Kwbf"),v=Z("c+Xe"),m=Z("m+aA"),p=Z("bdgK"),u=new Map;function h(ge){ge.forEach(function(xe){var Re,Le=xe.target;(Re=u.get(Le))===null||Re===void 0||Re.forEach(function(ce){return ce(Le)})})}var d=new p.default(h),o=null,l=null;function s(ge,xe){u.has(ge)||(u.set(ge,new Set),d.observe(ge)),u.get(ge).add(xe)}function a(ge,xe){u.has(ge)&&(u.get(ge).delete(xe),u.get(ge).size||(d.unobserve(ge),u.delete(ge)))}var R=function(ge){Object(X.a)(Re,ge);var xe=Object(j.a)(Re);function Re(){return Object(J.a)(this,Re),xe.apply(this,arguments)}return Object(P.a)(Re,[{key:"render",value:function(){return this.props.children}}]),Re}(B.Component),E=B.createContext(null);function w(ge){var xe=ge.children,Re=ge.onBatchResize,Le=B.useRef(0),ce=B.useRef([]),he=B.useContext(E),re=B.useCallback(function(de,se,De){Le.current+=1;var Ne=Le.current;ce.current.push({size:de,element:se,data:De}),Promise.resolve().then(function(){Ne===Le.current&&(Re==null||Re(ce.current),ce.current=[])}),he==null||he(de,se,De)},[Re,he]);return B.createElement(E.Provider,{value:re},xe)}function D(ge){var xe=ge.children,Re=ge.disabled,Le=B.useRef(null),ce=B.useRef(null),he=B.useContext(E),re=B.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),de=B.isValidElement(xe)&&Object(v.c)(xe),se=de?xe.ref:null,De=B.useMemo(function(){return Object(v.a)(se,Le)},[se,Le]),Ne=B.useRef(ge);Ne.current=ge;var Se=B.useCallback(function(Pe){var Ue=Ne.current,le=Ue.onResize,ve=Ue.data,Ae=Pe.getBoundingClientRect(),Ie=Ae.width,Ge=Ae.height,$e=Pe.offsetWidth,Ze=Pe.offsetHeight,Je=Math.floor(Ie),at=Math.floor(Ge);if(re.current.width!==Je||re.current.height!==at||re.current.offsetWidth!==$e||re.current.offsetHeight!==Ze){var qe={width:Je,height:at,offsetWidth:$e,offsetHeight:Ze};re.current=qe;var it=$e===Math.round(Ie)?Ie:$e,Be=Ze===Math.round(Ge)?Ge:Ze,ct=Object(K.a)(Object(K.a)({},qe),{},{offsetWidth:it,offsetHeight:Be});he==null||he(ct,Pe,ve),le&&Promise.resolve().then(function(){le(ct,Pe)})}},[]);return B.useEffect(function(){var Pe=Object(m.a)(Le.current)||Object(m.a)(ce.current);return Pe&&!Re&&s(Pe,Se),function(){return a(Pe,Se)}},[Le.current,Re]),B.createElement(R,{ref:ce},de?B.cloneElement(xe,{ref:De}):xe)}var O="rc-observer-key";function A(ge){var xe=ge.children,Re=Object(r.a)(xe);return Re.map(function(Le,ce){var he=(Le==null?void 0:Le.key)||"".concat(O,"-").concat(ce);return B.createElement(D,Object(ie.a)({},ge,{key:he}),Le)})}A.Collection=w;var C=A,T=Z("bT9E"),f=Z("TSYQ"),S=Z.n(f),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
`,b=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],U={},F;function _(ge){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Re=ge.getAttribute("id")||ge.getAttribute("data-reactid")||ge.getAttribute("name");if(xe&&U[Re])return U[Re];var Le=window.getComputedStyle(ge),ce=Le.getPropertyValue("box-sizing")||Le.getPropertyValue("-moz-box-sizing")||Le.getPropertyValue("-webkit-box-sizing"),he=parseFloat(Le.getPropertyValue("padding-bottom"))+parseFloat(Le.getPropertyValue("padding-top")),re=parseFloat(Le.getPropertyValue("border-bottom-width"))+parseFloat(Le.getPropertyValue("border-top-width")),de=b.map(function(De){return"".concat(De,":").concat(Le.getPropertyValue(De))}).join(";"),se={sizingStyle:de,paddingSize:he,borderSize:re,boxSizing:ce};return xe&&Re&&(U[Re]=se),se}function M(ge){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Le=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),ge.getAttribute("wrap")?F.setAttribute("wrap",ge.getAttribute("wrap")):F.removeAttribute("wrap");var ce=_(ge,xe),he=ce.paddingSize,re=ce.borderSize,de=ce.boxSizing,se=ce.sizingStyle;F.setAttribute("style","".concat(se,";").concat(y)),F.value=ge.value||ge.placeholder||"";var De=Number.MIN_SAFE_INTEGER,Ne=Number.MAX_SAFE_INTEGER,Se=F.scrollHeight,Pe;if(de==="border-box"?Se+=re:de==="content-box"&&(Se-=he),Re!==null||Le!==null){F.value=" ";var Ue=F.scrollHeight-he;Re!==null&&(De=Ue*Re,de==="border-box"&&(De=De+he+re),Se=Math.max(De,Se)),Le!==null&&(Ne=Ue*Le,de==="border-box"&&(Ne=Ne+he+re),Pe=Se>Ne?"":"hidden",Se=Math.min(Ne,Se))}return{height:Se,minHeight:De,maxHeight:Ne,overflowY:Pe,resize:"none"}}var I=Z("Gytx"),g=Z.n(I),W;(function(ge){ge[ge.NONE=0]="NONE",ge[ge.RESIZING=1]="RESIZING",ge[ge.RESIZED=2]="RESIZED"})(W||(W={}));var $=function(ge){Object(X.a)(Re,ge);var xe=Object(j.a)(Re);function Re(Le){var ce;return Object(J.a)(this,Re),ce=xe.call(this,Le),ce.nextFrameActionId=void 0,ce.resizeFrameId=void 0,ce.textArea=void 0,ce.saveTextArea=function(he){ce.textArea=he},ce.handleResize=function(he){var re=ce.state.resizeStatus,de=ce.props,se=de.autoSize,De=de.onResize;if(re!==W.NONE)return;typeof De=="function"&&De(he),se&&ce.resizeOnNextFrame()},ce.resizeOnNextFrame=function(){cancelAnimationFrame(ce.nextFrameActionId),ce.nextFrameActionId=requestAnimationFrame(ce.resizeTextarea)},ce.resizeTextarea=function(){var he=ce.props.autoSize;if(!he||!ce.textArea)return;var re=he.minRows,de=he.maxRows,se=M(ce.textArea,!1,re,de);ce.setState({textareaStyles:se,resizeStatus:W.RESIZING},function(){cancelAnimationFrame(ce.resizeFrameId),ce.resizeFrameId=requestAnimationFrame(function(){ce.setState({resizeStatus:W.RESIZED},function(){ce.resizeFrameId=requestAnimationFrame(function(){ce.setState({resizeStatus:W.NONE}),ce.fixFirefoxAutoScroll()})})})})},ce.renderTextArea=function(){var he=ce.props,re=he.prefixCls,de=re===void 0?"rc-textarea":re,se=he.autoSize,De=he.onResize,Ne=he.className,Se=he.disabled,Pe=ce.state,Ue=Pe.textareaStyles,le=Pe.resizeStatus,ve=Object(T.a)(ce.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ae=S()(de,Ne,Object(H.a)({},"".concat(de,"-disabled"),Se));"value"in ve&&(ve.value=ve.value||"");var Ie=Object(K.a)(Object(K.a)(Object(K.a)({},ce.props.style),Ue),le===W.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return B.createElement(C,{onResize:ce.handleResize,disabled:!(se||De)},B.createElement("textarea",Object(ie.a)({},ve,{className:Ae,style:Ie,ref:ce.saveTextArea})))},ce.state={textareaStyles:{},resizeStatus:W.NONE},ce}return Object(P.a)(Re,[{key:"componentDidUpdate",value:function(ce){(ce.value!==this.props.value||!g()(ce.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var ce=this.textArea.selectionStart,he=this.textArea.selectionEnd;this.textArea.setSelectionRange(ce,he)}}catch(re){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Re}(B.Component),ne=$,oe=function(ge){Object(X.a)(Re,ge);var xe=Object(j.a)(Re);function Re(Le){var ce;Object(J.a)(this,Re),ce=xe.call(this,Le),ce.resizableTextArea=void 0,ce.focus=function(){ce.resizableTextArea.textArea.focus()},ce.saveTextArea=function(re){ce.resizableTextArea=re},ce.handleChange=function(re){var de=ce.props.onChange;ce.setValue(re.target.value,function(){ce.resizableTextArea.resizeTextarea()}),de&&de(re)},ce.handleKeyDown=function(re){var de=ce.props,se=de.onPressEnter,De=de.onKeyDown;re.keyCode===13&&se&&se(re),De&&De(re)};var he=typeof Le.value=="undefined"||Le.value===null?Le.defaultValue:Le.value;return ce.state={value:he},ce}return Object(P.a)(Re,[{key:"setValue",value:function(ce,he){"value"in this.props||this.setState({value:ce},he)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return B.createElement(ne,Object(ie.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ce){return"value"in ce?{value:ce.value}:null}}]),Re}(B.Component),we=be.default=oe},ZW9T:function(tt,be,Z){"use strict";Z.d(be,"a",function(){return I});var ie=Z("k1fw"),J=Z("oBTY"),P=Z("miYZ"),X=Z("tsqr"),j=Z("rAM+"),B=Z("tJVT"),K=Z("PpiC"),H=Z("q1tI"),r=Z.n(H),L=Z("bdgK"),v=Z("9og8"),m=Z("WmNS"),p=Z.n(m),u={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},h={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"]},d={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(`
`)}]},l=Z("5VLF"),s=Z.n(l),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"]}},R=function(W,$){return $.map(function(ne){return{label:ne,kind:W.languages.CompletionItemKind.Keyword,insertText:ne}})},E=function(W){return Object.keys(a.tables).map(function($){return{label:$,kind:W.languages.CompletionItemKind.Variable,insertText:$}})},w=function(W,$){var ne=a.tables[W];return ne?ne.map(function(oe){return{label:oe,kind:$.languages.CompletionItemKind.Field,insertText:oe}}):[]};function D(g,W,$,ne,oe){var we=W.getWordUntilPosition($),ge={startLineNumber:$.lineNumber,endLineNumber:$.lineNumber,startColumn:we.startColumn,endColumn:we.endColumn},xe=ne.map(function(Re){return{label:Re,kind:g.languages.CompletionItemKind.Keyword,insertText:Re,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}});return oe.map(function(Re){xe.push(Object(ie.a)(Object(ie.a)({},Re),{},{range:ge}))}),xe}var O=function(g){a.languages.map(function(oe){return g.languages.registerDocumentFormattingEditProvider(oe,{provideDocumentFormattingEdits:function(ge,xe,Re){return Object(v.a)(p.a.mark(function Le(){var ce;return p.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return ce=s()(ge.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}),re.abrupt("return",[{range:ge.getFullModelRange(),text:ce}]);case 2:case"end":return re.stop()}},Le)}))()}}),oe});var W=d.quickKey.map(function(oe){return{label:oe.label,kind:g.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),$=o.quickKey.map(function(oe){return{label:oe.label,kind:g.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ne=h.quickKey.map(function(oe){return{label:oe.label,kind:g.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}});g.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(we,ge){var xe=we.getWordUntilPosition(ge),Re={startLineNumber:ge.lineNumber,endLineNumber:ge.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},Le=we.getLineContent(ge.lineNumber).substring(xe.startColumn-2,xe.endColumn);return{suggestions:[].concat(Object(J.a)(d.keywords.map(function(ce){return{label:ce,kind:g.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})),Object(J.a)(d.quickKey.map(function(ce){return{label:ce.label,kind:g.languages.CompletionItemKind.Function,documentation:ce.content,insertText:Le.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})))}}}),g.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(we,ge){var xe=we.getWordUntilPosition(ge),Re={startLineNumber:ge.lineNumber,endLineNumber:ge.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn};return{suggestions:Object(J.a)(u.keywords.map(function(Le){return{label:Le,kind:g.languages.CompletionItemKind.Function,documentation:Le,insertText:Le,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}}))}}}),g.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(we,ge){var xe=we.getWordUntilPosition(ge),Re={startLineNumber:ge.lineNumber,endLineNumber:ge.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},Le=we.getLineContent(ge.lineNumber).substring(xe.startColumn-2,xe.endColumn);return{suggestions:[].concat(Object(J.a)(h.keywords.map(function(ce){return{label:ce,kind:g.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})),Object(J.a)(h.quickKey.map(function(ce){return{label:ce.label,kind:g.languages.CompletionItemKind.Function,documentation:ce.content,insertText:Le.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})))}}}),g.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(we,ge){var xe=we.getWordUntilPosition(ge),Re={startLineNumber:ge.lineNumber,endLineNumber:ge.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},Le=we.getLineContent(ge.lineNumber).substring(xe.startColumn-2,xe.endColumn);return{suggestions:[].concat(Object(J.a)(o.keywords.map(function(ce){return{label:ce,kind:g.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})),Object(J.a)(o.quickKey.map(function(ce){return{label:ce.label,kind:g.languages.CompletionItemKind.Function,documentation:ce.content,insertText:Le.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})))}}})},A="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",C=Z("fjLI"),T=Z("LvDl"),f=Z("+ua5");function S(g){return/^\d+$/.test(g)?"".concat(g,"px"):g}function y(){}var b=!1,U={"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 F(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],W=g;if(Array.isArray(g)){for(var $=0;$<g.length;$++){var ne=U[g[$]];if(ne)return ne}return W[0]}return U[W]||W}var _=null,M=be.b=function(g){var W=g.width,$=W===void 0?"100%":W,ne=g.height,oe=ne===void 0?"100%":ne,we=g.value,ge=g.language,xe=ge===void 0?"javascript":ge,Re=g.style,Le=Re===void 0?{}:Re,ce=g.options,he=ce===void 0?{}:ce,re=g.overrideServices,de=re===void 0?{}:re,se=g.theme,De=se===void 0?"vs-dark":se,Ne=g.onEditBlur,Se=g.onSave,Pe=g.autoHeight,Ue=Pe===void 0?!1:Pe,le=g.forbidCopy,ve=le===void 0?!1:le,Ae=g.onChange,Ie=Ae===void 0?y:Ae,Ge=g.editorDidMount,$e=Ge===void 0?y:Ge,Ze=g.onFocus,Je=Ze===void 0?y:Ze,at=g.filename,qe=at===void 0?"educoder.txt":at,it=g.errorLine,Be=g.errorContent,ct=Be===void 0?"":Be,ot=Object(K.a)(g,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),je=Object(H.useRef)(),We=Object(H.useRef)({}),Oe=Object(H.useRef)(),_e=Object(H.useRef)(),Te=Object(H.useRef)(!1),ae=Object(H.useRef)(),ue=Object(H.useState)(!1),fe=Object(B.a)(ue,2),me=fe[0],Ce=fe[1];function Fe(){var bt;return je.current&&(bt=new L.default(function(xt){var Ft=Object(j.a)(xt),tr;try{for(Ft.s();!(tr=Ft.n()).done;){var cr=tr.value;(cr.target.offsetHeight>0||cr.target.offsetWidth>0)&&We.current.instance.layout()}}catch(Pt){Ft.e(Pt)}finally{Ft.f()}}),bt.observe(je.current)),bt}function ze(){X.b.warn(decodeURIComponent(A))}var st=function(){var xt=We.current.instance;if(we!=null&&xt&&me){var Ft=xt.getModel();Ft&&we!==Ft.getValue()&&(b=!0,Ft.setValue(we),xt.layout(),b=!1)}};Object(H.useEffect)(function(){_e.current&&clearTimeout(_e.current),_e.current=setTimeout(function(){st()},500)},[we,me,We.current]),Object(H.useEffect)(function(){if(it&&We.current&&We.current.instance){var bt=We.current.instance;bt.changeViewZones(function(Ft){var tr=document.createElement("div");tr.style.padding="10px 20px",tr.style.width="calc(100% - 20px)",tr.className="my-error-line-wrp",tr.innerHTML=ct,Ft.addZone({afterLineNumber:it||11,heightInLines:3,domNode:tr})});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})}},[it,We.current,me]);function mt(){var bt=We.current.instance;if(bt){var xt=bt.getSelection(),Ft=We.current.pastePos||{},tr=new _.Range(Ft.startLineNumber||xt.endLineNumber,Ft.startColumn||xt.endColumn,Ft.endLineNumber||xt.endLineNumber,Ft.endColumn||xt.endColumn);setTimeout(function(){bt.executeEdits("",[{range:tr,text:""}])},300)}}function ft(bt){(window.navigator.platform.match("Mac")?bt.metaKey:bt.ctrlKey)&&bt.keyCode==83&&(bt.preventDefault(),Se())}var wt=function(){if(Ue&&We.current.instance){var xt=We.current.instance.getContentHeight();yt(xt<oe?oe:xt)}else yt(oe)};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 ht(bt,xt){var Ft=window.URL||window.webkitURL||window,tr=new Blob([xt]),cr=document.createElementNS("http://www.w3.org/1999/xhtml","a");cr.href=Ft.createObjectURL(tr),cr.download=bt,St(cr)}Object(H.useEffect)(function(){wt()},[wt]),Object(H.useEffect)(function(){je.current&&!me&&Promise.all([Z.e(15),Z.e(27)]).then(Z.t.bind(null,"M/lh",7)).then(function(bt){try{_=bt,We.current.instance=_.editor.create(je.current,{value:we,language:F(xe),theme:De,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},de);var xt=We.current.instance,Ft=C.d._menuItems,tr=Object(J.a)(Ft).find(function(Vt){return Vt[0]._debugName=="EditorContext"}),cr=tr[1],Pt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],dt=function(Jt,Ot){var lr=Jt._first;do{var Ir,Xr,Xe=Ot.includes((Ir=lr.element)===null||Ir===void 0||((Xr=Ir.command)===null||Xr===void 0)?void 0:Xr.id);Xe&&Jt._remove(lr)}while(lr=lr.next)};if($e(xt,_),setTimeout(function(){wt(),We.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ht(qe||"educoder.txt",xt.getValue())}}),xt.getDomNode().addEventListener("input",function(){Oe.current.autoFormat&&xt.getAction("editor.action.formatDocument").run()})},500),We.current.subscription=xt.onDidChangeModelContent(function(Vt){Te.current?clearTimeout(ae.current):(wt(),Ie(xt.getValue(),Vt)),ae.current=setTimeout(function(){Te.current=!1},500)}),window.Monaco||O(_,F(xe)),ve&&(dt(cr,Pt),je.current.classList.add("noCopyPaste"),xt.onKeyDown(function(Vt){var Jt=Vt.keyCode,Ot=Vt.ctrlKey,lr=Vt.metaKey;(Jt===33||Jt===52)&&(lr||Ot)&&(ze(),Vt.preventDefault())})),window.Monaco=_,Ne&&xt.onDidBlurEditorWidget(function(){Ne(xt.getValue())}),Je&&xt.onDidFocusEditorText(function(){Je(xt.getValue())}),ve){xt.addCommand(_.KeyMod.CtrlCmd|_.KeyCode.KEY_V,function(){return ze(),null}),xt.onDidPaste(function(Vt){We.current.pastePos=Vt});try{window.addEventListener("paste",mt)}catch(Vt){}}var Ur=Fe();return Ce(!0),function(){var Vt=We.current.instance;Vt.dispose();var Jt=Vt.getModel();Jt&&Jt.dispose(),We.current.subscription&&We.current.subscription.dispose(),ve&&window.removeEventListener("paste",mt),Ur.unobserve(je.current)}}catch(Vt){}})},[]),Object(H.useEffect)(function(){var bt=We.current.instance;if(bt&&me)return document.addEventListener("keydown",ft,!1),function(){document.removeEventListener("keydown",ft)}},[Se,me]),Object(H.useEffect)(function(){var bt=We.current.instance;if(bt&&me){var xt=F(xe);_.editor.setModelLanguage(bt.getModel(),xt),console.log("language:",xe,bt.getModel(),xt)}},[xe,me]),Object(H.useEffect)(function(){var bt=We.current.instance;bt&&me&&_.editor.setTheme(De)},[De,me]),Object(H.useEffect)(function(){var bt=We.current.instance;Oe.current=he,bt&&me&&(bt.updateOptions(Object(ie.a)({},he)),setTimeout(function(){bt.getModel().updateOptions(Object(ie.a)({},he))},200))},[JSON.stringify(he),me]),Object(H.useEffect)(function(){var bt=We.current.instance;bt&&me&&bt.layout()},[$,oe,me]);var Ut=Object(H.useState)(S($)),Lt=Object(B.a)(Ut,2),qt=Lt[0],Zt=Lt[1],It=Object(H.useState)(S(oe)),Cr=Object(B.a)(It,2),Kr=Cr[0],yt=Cr[1],Lr=Object(ie.a)(Object(ie.a)({},Le),{},{width:qt,height:Kr});return r.a.createElement("div",{className:"my-monaco-editor",ref:je,style:Lr})};function I(g){var W=g.width,$=W===void 0?"100%":W,ne=g.height,oe=ne===void 0?"100%":ne,we=g.original,ge=g.modified,xe=g.language,Re=g.options,Le=Re===void 0?{}:Re,ce=Object(H.useRef)(),he=Object(H.useState)(null),re=Object(B.a)(he,2),de=re[0],se=re[1];function De(Ue){var le;return ce.current&&(le=new L.default(function(ve){var Ae=Object(j.a)(ve),Ie;try{for(Ae.s();!(Ie=Ae.n()).done;){var Ge=Ie.value;(Ge.target.offsetHeight>0||Ge.target.offsetWidth>0)&&Ue.layout()}}catch($e){Ae.e($e)}finally{Ae.f()}}),le.observe(ce.current)),le}Object(H.useEffect)(function(){ce.current&&Promise.all([Z.e(15),Z.e(27)]).then(Z.t.bind(null,"M/lh",7)).then(function(Ue){_=Ue;var le=_.editor.createDiffEditor(ce.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},Le),{},{wordWrap:!0}));se(le);var ve=De(le);return function(){le.dispose();var Ae=le.getModel();Ae&&Ae.dispose(),ve.unobserve(ce.current)}})},[]),Object(H.useEffect)(function(){de&&de.setModel({original:_.editor.createModel(we,xe),modified:_.editor.createModel(ge,xe)})},[we,ge,xe,de]);var Ne=S($),Se=S(oe),Pe={width:Ne,height:Se};return r.a.createElement("div",{className:"my-diff-editor",ref:ce,style:Pe})}},ZpRC:function(tt,be,Z){"use strict";function ie(v){return typeof v=="object"&&v!=null&&v.nodeType===1}function J(v,m){return(!m||v!=="hidden")&&v!=="visible"&&v!=="clip"}function P(v,m){if(v.clientHeight<v.scrollHeight||v.clientWidth<v.scrollWidth){var p=getComputedStyle(v,null);return J(p.overflowY,m)||J(p.overflowX,m)||function(u){var h=function(d){if(!d.ownerDocument||!d.ownerDocument.defaultView)return null;try{return d.ownerDocument.defaultView.frameElement}catch(o){return null}}(u);return!!h&&(h.clientHeight<u.scrollHeight||h.clientWidth<u.scrollWidth)}(v)}return!1}function X(v,m,p,u,h,d,o,l){return d<v&&o>m||d>v&&o<m?0:d<=v&&l<=p||o>=m&&l>=p?d-v-u:o>m&&l<p||d<v&&l>p?o-m+h:0}var j=function(v,m){var p=window,u=m.scrollMode,h=m.block,d=m.inline,o=m.boundary,l=m.skipOverflowHiddenElements,s=typeof o=="function"?o:function(Ue){return Ue!==o};if(!ie(v))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,R=[],E=v;ie(E)&&s(E);){if((E=E.parentElement)===a){R.push(E);break}E!=null&&E===document.body&&P(E)&&!P(document.documentElement)||E!=null&&P(E,l)&&R.push(E)}for(var w=p.visualViewport?p.visualViewport.width:innerWidth,D=p.visualViewport?p.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,A=window.scrollY||pageYOffset,C=v.getBoundingClientRect(),T=C.height,f=C.width,S=C.top,y=C.right,b=C.bottom,U=C.left,F=h==="start"||h==="nearest"?S:h==="end"?b:S+T/2,_=d==="center"?U+f/2:d==="end"?y:U,M=[],I=0;I<R.length;I++){var g=R[I],W=g.getBoundingClientRect(),$=W.height,ne=W.width,oe=W.top,we=W.right,ge=W.bottom,xe=W.left;if(u==="if-needed"&&S>=0&&U>=0&&b<=D&&y<=w&&S>=oe&&b<=ge&&U>=xe&&y<=we)return M;var Re=getComputedStyle(g),Le=parseInt(Re.borderLeftWidth,10),ce=parseInt(Re.borderTopWidth,10),he=parseInt(Re.borderRightWidth,10),re=parseInt(Re.borderBottomWidth,10),de=0,se=0,De="offsetWidth"in g?g.offsetWidth-g.clientWidth-Le-he:0,Ne="offsetHeight"in g?g.offsetHeight-g.clientHeight-ce-re:0;if(a===g)de=h==="start"?F:h==="end"?F-D:h==="nearest"?X(A,A+D,D,ce,re,A+F,A+F+T,T):F-D/2,se=d==="start"?_:d==="center"?_-w/2:d==="end"?_-w:X(O,O+w,w,Le,he,O+_,O+_+f,f),de=Math.max(0,de+A),se=Math.max(0,se+O);else{de=h==="start"?F-oe-ce:h==="end"?F-ge+re+Ne:h==="nearest"?X(oe,ge,$,ce,re+Ne,F,F+T,T):F-(oe+$/2)+Ne/2,se=d==="start"?_-xe-Le:d==="center"?_-(xe+ne/2)+De/2:d==="end"?_-we+he+De:X(xe,we,ne,Le,he+De,_,_+f,f);var Se=g.scrollLeft,Pe=g.scrollTop;F+=Pe-(de=Math.max(0,Math.min(Pe+de,g.scrollHeight-$+Ne))),_+=Se-(se=Math.max(0,Math.min(Se+se,g.scrollWidth-ne+De)))}M.push({el:g,top:de,left:se})}return M};function B(v){return v===Object(v)&&Object.keys(v).length!==0}function K(v,m){m===void 0&&(m="auto");var p="scrollBehavior"in document.body.style;v.forEach(function(u){var h=u.el,d=u.top,o=u.left;h.scroll&&p?h.scroll({top:d,left:o,behavior:m}):(h.scrollTop=d,h.scrollLeft=o)})}function H(v){return v===!1?{block:"end",inline:"nearest"}:B(v)?v:{block:"start",inline:"nearest"}}function r(v,m){var p=!v.ownerDocument.documentElement.contains(v);if(B(m)&&typeof m.behavior=="function")return m.behavior(p?[]:j(v,m));if(p)return;var u=H(m);return K(j(v,u),u.behavior)}var L=be.a=r},Zss7:function(tt,be,Z){var ie;(function(J){var P=/^\s+/,X=/\s+$/,j=0,B=J.round,K=J.min,H=J.max,r=J.random;function L(re,de){if(re=re||"",de=de||{},re instanceof L)return re;if(!(this instanceof L))return new L(re,de);var se=v(re);this._originalInput=re,this._r=se.r,this._g=se.g,this._b=se.b,this._a=se.a,this._roundA=B(100*this._a)/100,this._format=de.format||se.format,this._gradientType=de.gradientType,this._r<1&&(this._r=B(this._r)),this._g<1&&(this._g=B(this._g)),this._b<1&&(this._b=B(this._b)),this._ok=se.ok,this._tc_id=j++}L.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var re=this.toRgb();return(re.r*299+re.g*587+re.b*114)/1e3},getLuminance:function(){var re=this.toRgb(),de,se,De,Ne,Se,Pe;return de=re.r/255,se=re.g/255,De=re.b/255,de<=.03928?Ne=de/12.92:Ne=J.pow((de+.055)/1.055,2.4),se<=.03928?Se=se/12.92:Se=J.pow((se+.055)/1.055,2.4),De<=.03928?Pe=De/12.92:Pe=J.pow((De+.055)/1.055,2.4),.2126*Ne+.7152*Se+.0722*Pe},setAlpha:function(re){return this._a=M(re),this._roundA=B(100*this._a)/100,this},toHsv:function(){var re=h(this._r,this._g,this._b);return{h:re.h*360,s:re.s,v:re.v,a:this._a}},toHsvString:function(){var re=h(this._r,this._g,this._b),de=B(re.h*360),se=B(re.s*100),De=B(re.v*100);return this._a==1?"hsv("+de+", "+se+"%, "+De+"%)":"hsva("+de+", "+se+"%, "+De+"%, "+this._roundA+")"},toHsl:function(){var re=p(this._r,this._g,this._b);return{h:re.h*360,s:re.s,l:re.l,a:this._a}},toHslString:function(){var re=p(this._r,this._g,this._b),de=B(re.h*360),se=B(re.s*100),De=B(re.l*100);return this._a==1?"hsl("+de+", "+se+"%, "+De+"%)":"hsla("+de+", "+se+"%, "+De+"%, "+this._roundA+")"},toHex:function(re){return o(this._r,this._g,this._b,re)},toHexString:function(re){return"#"+this.toHex(re)},toHex8:function(re){return l(this._r,this._g,this._b,this._a,re)},toHex8String:function(re){return"#"+this.toHex8(re)},toRgb:function(){return{r:B(this._r),g:B(this._g),b:B(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+B(this._r)+", "+B(this._g)+", "+B(this._b)+")":"rgba("+B(this._r)+", "+B(this._g)+", "+B(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:B(I(this._r,255)*100)+"%",g:B(I(this._g,255)*100)+"%",b:B(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+B(I(this._r,255)*100)+"%, "+B(I(this._g,255)*100)+"%, "+B(I(this._b,255)*100)+"%)":"rgba("+B(I(this._r,255)*100)+"%, "+B(I(this._g,255)*100)+"%, "+B(I(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:F[o(this._r,this._g,this._b,!0)]||!1},toFilter:function(re){var de="#"+s(this._r,this._g,this._b,this._a),se=de,De=this._gradientType?"GradientType = 1, ":"";if(re){var Ne=L(re);se="#"+s(Ne._r,Ne._g,Ne._b,Ne._a)}return"progid:DXImageTransform.Microsoft.gradient("+De+"startColorstr="+de+",endColorstr="+se+")"},toString:function(re){var de=!!re;re=re||this._format;var se=!1,De=this._a<1&&this._a>=0,Ne=!de&&De&&(re==="hex"||re==="hex6"||re==="hex3"||re==="hex4"||re==="hex8"||re==="name");return Ne?re==="name"&&this._a===0?this.toName():this.toRgbString():(re==="rgb"&&(se=this.toRgbString()),re==="prgb"&&(se=this.toPercentageRgbString()),(re==="hex"||re==="hex6")&&(se=this.toHexString()),re==="hex3"&&(se=this.toHexString(!0)),re==="hex4"&&(se=this.toHex8String(!0)),re==="hex8"&&(se=this.toHex8String()),re==="name"&&(se=this.toName()),re==="hsl"&&(se=this.toHslString()),re==="hsv"&&(se=this.toHsvString()),se||this.toHexString())},clone:function(){return L(this.toString())},_applyModification:function(re,de){var se=re.apply(null,[this].concat([].slice.call(de)));return this._r=se._r,this._g=se._g,this._b=se._b,this.setAlpha(se._a),this},lighten:function(){return this._applyModification(w,arguments)},brighten:function(){return this._applyModification(D,arguments)},darken:function(){return this._applyModification(O,arguments)},desaturate:function(){return this._applyModification(a,arguments)},saturate:function(){return this._applyModification(R,arguments)},greyscale:function(){return this._applyModification(E,arguments)},spin:function(){return this._applyModification(A,arguments)},_applyCombination:function(re,de){return re.apply(null,[this].concat([].slice.call(de)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(C,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(S,arguments)},triad:function(){return this._applyCombination(T,arguments)},tetrad:function(){return this._applyCombination(f,arguments)}},L.fromRatio=function(re,de){if(typeof re=="object"){var se={};for(var De in re)re.hasOwnProperty(De)&&(De==="a"?se[De]=re[De]:se[De]=we(re[De]));re=se}return L(re,de)};function v(re){var de={r:0,g:0,b:0},se=1,De=null,Ne=null,Se=null,Pe=!1,Ue=!1;return typeof re=="string"&&(re=ce(re)),typeof re=="object"&&(Le(re.r)&&Le(re.g)&&Le(re.b)?(de=m(re.r,re.g,re.b),Pe=!0,Ue=String(re.r).substr(-1)==="%"?"prgb":"rgb"):Le(re.h)&&Le(re.s)&&Le(re.v)?(De=we(re.s),Ne=we(re.v),de=d(re.h,De,Ne),Pe=!0,Ue="hsv"):Le(re.h)&&Le(re.s)&&Le(re.l)&&(De=we(re.s),Se=we(re.l),de=u(re.h,De,Se),Pe=!0,Ue="hsl"),re.hasOwnProperty("a")&&(se=re.a)),se=M(se),{ok:Pe,format:re.format||Ue,r:K(255,H(de.r,0)),g:K(255,H(de.g,0)),b:K(255,H(de.b,0)),a:se}}function m(re,de,se){return{r:I(re,255)*255,g:I(de,255)*255,b:I(se,255)*255}}function p(re,de,se){re=I(re,255),de=I(de,255),se=I(se,255);var De=H(re,de,se),Ne=K(re,de,se),Se,Pe,Ue=(De+Ne)/2;if(De==Ne)Se=Pe=0;else{var le=De-Ne;Pe=Ue>.5?le/(2-De-Ne):le/(De+Ne);switch(De){case re:Se=(de-se)/le+(de<se?6:0);break;case de:Se=(se-re)/le+2;break;case se:Se=(re-de)/le+4;break}Se/=6}return{h:Se,s:Pe,l:Ue}}function u(re,de,se){var De,Ne,Se;re=I(re,360),de=I(de,100),se=I(se,100);function Pe(ve,Ae,Ie){return Ie<0&&(Ie+=1),Ie>1&&(Ie-=1),Ie<1/6?ve+(Ae-ve)*6*Ie:Ie<1/2?Ae:Ie<2/3?ve+(Ae-ve)*(2/3-Ie)*6:ve}if(de===0)De=Ne=Se=se;else{var Ue=se<.5?se*(1+de):se+de-se*de,le=2*se-Ue;De=Pe(le,Ue,re+1/3),Ne=Pe(le,Ue,re),Se=Pe(le,Ue,re-1/3)}return{r:De*255,g:Ne*255,b:Se*255}}function h(re,de,se){re=I(re,255),de=I(de,255),se=I(se,255);var De=H(re,de,se),Ne=K(re,de,se),Se,Pe,Ue=De,le=De-Ne;if(Pe=De===0?0:le/De,De==Ne)Se=0;else{switch(De){case re:Se=(de-se)/le+(de<se?6:0);break;case de:Se=(se-re)/le+2;break;case se:Se=(re-de)/le+4;break}Se/=6}return{h:Se,s:Pe,v:Ue}}function d(re,de,se){re=I(re,360)*6,de=I(de,100),se=I(se,100);var De=J.floor(re),Ne=re-De,Se=se*(1-de),Pe=se*(1-Ne*de),Ue=se*(1-(1-Ne)*de),le=De%6,ve=[se,Pe,Se,Se,Ue,se][le],Ae=[Ue,se,se,Pe,Se,Se][le],Ie=[Se,Se,Ue,se,se,Pe][le];return{r:ve*255,g:Ae*255,b:Ie*255}}function o(re,de,se,De){var Ne=[oe(B(re).toString(16)),oe(B(de).toString(16)),oe(B(se).toString(16))];return De&&Ne[0].charAt(0)==Ne[0].charAt(1)&&Ne[1].charAt(0)==Ne[1].charAt(1)&&Ne[2].charAt(0)==Ne[2].charAt(1)?Ne[0].charAt(0)+Ne[1].charAt(0)+Ne[2].charAt(0):Ne.join("")}function l(re,de,se,De,Ne){var Se=[oe(B(re).toString(16)),oe(B(de).toString(16)),oe(B(se).toString(16)),oe(ge(De))];return Ne&&Se[0].charAt(0)==Se[0].charAt(1)&&Se[1].charAt(0)==Se[1].charAt(1)&&Se[2].charAt(0)==Se[2].charAt(1)&&Se[3].charAt(0)==Se[3].charAt(1)?Se[0].charAt(0)+Se[1].charAt(0)+Se[2].charAt(0)+Se[3].charAt(0):Se.join("")}function s(re,de,se,De){var Ne=[oe(ge(De)),oe(B(re).toString(16)),oe(B(de).toString(16)),oe(B(se).toString(16))];return Ne.join("")}L.equals=function(re,de){return!re||!de?!1:L(re).toRgbString()==L(de).toRgbString()},L.random=function(){return L.fromRatio({r:r(),g:r(),b:r()})};function a(re,de){de=de===0?0:de||10;var se=L(re).toHsl();return se.s-=de/100,se.s=g(se.s),L(se)}function R(re,de){de=de===0?0:de||10;var se=L(re).toHsl();return se.s+=de/100,se.s=g(se.s),L(se)}function E(re){return L(re).desaturate(100)}function w(re,de){de=de===0?0:de||10;var se=L(re).toHsl();return se.l+=de/100,se.l=g(se.l),L(se)}function D(re,de){de=de===0?0:de||10;var se=L(re).toRgb();return se.r=H(0,K(255,se.r-B(255*-(de/100)))),se.g=H(0,K(255,se.g-B(255*-(de/100)))),se.b=H(0,K(255,se.b-B(255*-(de/100)))),L(se)}function O(re,de){de=de===0?0:de||10;var se=L(re).toHsl();return se.l-=de/100,se.l=g(se.l),L(se)}function A(re,de){var se=L(re).toHsl(),De=(se.h+de)%360;return se.h=De<0?360+De:De,L(se)}function C(re){var de=L(re).toHsl();return de.h=(de.h+180)%360,L(de)}function T(re){var de=L(re).toHsl(),se=de.h;return[L(re),L({h:(se+120)%360,s:de.s,l:de.l}),L({h:(se+240)%360,s:de.s,l:de.l})]}function f(re){var de=L(re).toHsl(),se=de.h;return[L(re),L({h:(se+90)%360,s:de.s,l:de.l}),L({h:(se+180)%360,s:de.s,l:de.l}),L({h:(se+270)%360,s:de.s,l:de.l})]}function S(re){var de=L(re).toHsl(),se=de.h;return[L(re),L({h:(se+72)%360,s:de.s,l:de.l}),L({h:(se+216)%360,s:de.s,l:de.l})]}function y(re,de,se){de=de||6,se=se||30;var De=L(re).toHsl(),Ne=360/se,Se=[L(re)];for(De.h=(De.h-(Ne*de>>1)+720)%360;--de;)De.h=(De.h+Ne)%360,Se.push(L(De));return Se}function b(re,de){de=de||6;for(var se=L(re).toHsv(),De=se.h,Ne=se.s,Se=se.v,Pe=[],Ue=1/de;de--;)Pe.push(L({h:De,s:Ne,v:Se})),Se=(Se+Ue)%1;return Pe}L.mix=function(re,de,se){se=se===0?0:se||50;var De=L(re).toRgb(),Ne=L(de).toRgb(),Se=se/100,Pe={r:(Ne.r-De.r)*Se+De.r,g:(Ne.g-De.g)*Se+De.g,b:(Ne.b-De.b)*Se+De.b,a:(Ne.a-De.a)*Se+De.a};return L(Pe)},L.readability=function(re,de){var se=L(re),De=L(de);return(J.max(se.getLuminance(),De.getLuminance())+.05)/(J.min(se.getLuminance(),De.getLuminance())+.05)},L.isReadable=function(re,de,se){var De=L.readability(re,de),Ne,Se;Se=!1,Ne=he(se);switch(Ne.level+Ne.size){case"AAsmall":case"AAAlarge":Se=De>=4.5;break;case"AAlarge":Se=De>=3;break;case"AAAsmall":Se=De>=7;break}return Se},L.mostReadable=function(re,de,se){var De=null,Ne=0,Se,Pe,Ue,le;se=se||{},Pe=se.includeFallbackColors,Ue=se.level,le=se.size;for(var ve=0;ve<de.length;ve++)Se=L.readability(re,de[ve]),Se>Ne&&(Ne=Se,De=L(de[ve]));return L.isReadable(re,De,{level:Ue,size:le})||!Pe?De:(se.includeFallbackColors=!1,L.mostReadable(re,["#fff","#000"],se))};var U=L.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},F=L.hexNames=_(U);function _(re){var de={};for(var se in re)re.hasOwnProperty(se)&&(de[re[se]]=se);return de}function M(re){return re=parseFloat(re),(isNaN(re)||re<0||re>1)&&(re=1),re}function I(re,de){$(re)&&(re="100%");var se=ne(re);return re=K(de,H(0,parseFloat(re))),se&&(re=parseInt(re*de,10)/100),J.abs(re-de)<1e-6?1:re%de/parseFloat(de)}function g(re){return K(1,H(0,re))}function W(re){return parseInt(re,16)}function $(re){return typeof re=="string"&&re.indexOf(".")!=-1&&parseFloat(re)===1}function ne(re){return typeof re=="string"&&re.indexOf("%")!=-1}function oe(re){return re.length==1?"0"+re:""+re}function we(re){return re<=1&&(re=re*100+"%"),re}function ge(re){return J.round(parseFloat(re)*255).toString(16)}function xe(re){return W(re)/255}var Re=function(){var re="[-\\+]?\\d+%?",de="[-\\+]?\\d*\\.\\d+%?",se="(?:"+de+")|(?:"+re+")",De="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?",Ne="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?";return{CSS_UNIT:new RegExp(se),rgb:new RegExp("rgb"+De),rgba:new RegExp("rgba"+Ne),hsl:new RegExp("hsl"+De),hsla:new RegExp("hsla"+Ne),hsv:new RegExp("hsv"+De),hsva:new RegExp("hsva"+Ne),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Le(re){return!!Re.CSS_UNIT.exec(re)}function ce(re){re=re.replace(P,"").replace(X,"").toLowerCase();var de=!1;if(U[re])re=U[re],de=!0;else if(re=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var se;return(se=Re.rgb.exec(re))?{r:se[1],g:se[2],b:se[3]}:(se=Re.rgba.exec(re))?{r:se[1],g:se[2],b:se[3],a:se[4]}:(se=Re.hsl.exec(re))?{h:se[1],s:se[2],l:se[3]}:(se=Re.hsla.exec(re))?{h:se[1],s:se[2],l:se[3],a:se[4]}:(se=Re.hsv.exec(re))?{h:se[1],s:se[2],v:se[3]}:(se=Re.hsva.exec(re))?{h:se[1],s:se[2],v:se[3],a:se[4]}:(se=Re.hex8.exec(re))?{r:W(se[1]),g:W(se[2]),b:W(se[3]),a:xe(se[4]),format:de?"name":"hex8"}:(se=Re.hex6.exec(re))?{r:W(se[1]),g:W(se[2]),b:W(se[3]),format:de?"name":"hex"}:(se=Re.hex4.exec(re))?{r:W(se[1]+""+se[1]),g:W(se[2]+""+se[2]),b:W(se[3]+""+se[3]),a:xe(se[4]+""+se[4]),format:de?"name":"hex8"}:(se=Re.hex3.exec(re))?{r:W(se[1]+""+se[1]),g:W(se[2]+""+se[2]),b:W(se[3]+""+se[3]),format:de?"name":"hex"}:!1}function he(re){var de,se;return re=re||{level:"AA",size:"small"},de=(re.level||"AA").toUpperCase(),se=(re.size||"small").toLowerCase(),de!=="AA"&&de!=="AAA"&&(de="AA"),se!=="small"&&se!=="large"&&(se="small"),{level:de,size:se}}tt.exports?tt.exports=L:!(ie=function(){return L}.call(be,Z,be,tt),ie!==void 0&&(tt.exports=ie))})(Math)},bT9E:function(tt,be,Z){"use strict";Z.d(be,"a",function(){return J});var ie=Z("VTBJ");function J(P,X){var j=Object(ie.a)({},P);return Array.isArray(X)&&X.forEach(function(B){delete j[B]}),j}},c5Ni:function(tt,be,Z){},dejd:function(tt,be,Z){},dmUQ:function(tt,be,Z){"use strict";var ie=Z("Ff2n"),J=Z("rePB"),P=Z("1OyB"),X=Z("vuIU"),j=Z("Ji7U"),B=Z("md7G"),K=Z("foSv"),H=Z("q1tI"),r=Z.n(H),L=Z("TSYQ"),v=Z.n(L),m=Z("4IlW");function p(T,f){var S=Object.keys(T);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(T);f&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(T,b).enumerable})),S.push.apply(S,y)}return S}function u(T){for(var f=1;f<arguments.length;f++){var S=arguments[f]!=null?arguments[f]:{};f%2?p(Object(S),!0).forEach(function(y){Object(J.a)(T,y,S[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(S)):p(Object(S)).forEach(function(y){Object.defineProperty(T,y,Object.getOwnPropertyDescriptor(S,y))})}return T}function h(T){var f=d();return function(){var y=Object(K.a)(T),b;if(f){var U=Object(K.a)(this).constructor;b=Reflect.construct(y,arguments,U)}else b=y.apply(this,arguments);return Object(B.a)(this,b)}}function d(){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(T){return!1}}function o(){}function l(T){T.preventDefault()}var s=function(f){return f.replace(/[^\w.-]+/g,"")},a=200,R=600,E=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,w=function(f){return f!=null},D=function(f,S){return S===f||typeof S=="number"&&typeof f=="number"&&isNaN(S)&&isNaN(f)},O=function(T){Object(j.a)(S,T);var f=h(S);function S(y){var b;Object(P.a)(this,S),b=f.call(this,y),b.onKeyDown=function(_){var M=b.props,I=M.onKeyDown,g=M.onPressEnter;if(_.keyCode===m.a.UP){var W=b.getRatio(_);b.up(_,W,null),b.stop()}else if(_.keyCode===m.a.DOWN){var $=b.getRatio(_);b.down(_,$,null),b.stop()}else _.keyCode===m.a.ENTER&&g&&g(_);if(b.recordCursorPosition(),b.lastKeyCode=_.keyCode,I){for(var ne=arguments.length,oe=new Array(ne>1?ne-1:0),we=1;we<ne;we++)oe[we-1]=arguments[we];I.apply(void 0,[_].concat(oe))}},b.onKeyUp=function(_){var M=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),M){for(var I=arguments.length,g=new Array(I>1?I-1:0),W=1;W<I;W++)g[W-1]=arguments[W];M.apply(void 0,[_].concat(g))}},b.onChange=function(_){var M=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(_)),b.setState({inputValue:b.rawInput}),M(b.toNumber(b.rawInput))},b.onMouseUp=function(){var _=b.props.onMouseUp;b.recordCursorPosition(),_&&_.apply(void 0,arguments)},b.onFocus=function(){var _;b.setState({focused:!0}),(_=b.props).onFocus.apply(_,arguments)},b.onBlur=function(){var _=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var M=b.getCurrentValidValue(b.state.inputValue),I=b.setValue(M,o);if(_){var g=b.input.value,W=b.getInputDisplayValue({focus:!1,value:I});b.input.value=W&&Number(W),_.apply(void 0,arguments),b.input.value=g}},b.getRatio=function(_){var M=1;return _.metaKey||_.ctrlKey?M=.1:_.shiftKey&&(M=10),M},b.getFullNum=function(_){return isNaN(_)?_:/e/i.test(String(_))?Number(_).toFixed(18).replace(/\.?0+$/,""):_},b.getPrecision=function(_){if(w(b.props.precision))return b.props.precision;var M=String(_);if(M.indexOf("e-")>=0)return parseInt(M.slice(M.indexOf("e-")+2),10);var I=0;return M.indexOf(".")>=0&&(I=M.length-M.indexOf(".")-1),I},b.getInputDisplayValue=function(_){var M=_||b.state,I=M.focused,g=M.inputValue,W=M.value,$;I?$=g:$=b.toPrecisionAsStep(W),$==null&&($="");var ne=b.formatWrapper($);return w(b.props.decimalSeparator)&&(ne=ne.toString().replace(".",b.props.decimalSeparator)),ne},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(_){}},b.restoreByAfter=function(_){if(_===void 0)return!1;var M=b.input.value,I=M.lastIndexOf(_);if(I===-1)return!1;var g=b.cursorBefore.length;return b.lastKeyCode===m.a.DELETE&&b.cursorBefore.charAt(g-1)===_[0]?(b.fixCaret(g,g),!0):I+_.length===M.length?(b.fixCaret(I,I),!0):!1},b.partRestoreByAfter=function(_){return _===void 0?!1:Array.prototype.some.call(_,function(M,I){var g=_.substring(I);return b.restoreByAfter(g)})},b.isNotCompleteNumber=function(_){return isNaN(_)||_===""||_===null||_&&_.toString().indexOf(".")===_.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(_,M,I){b.pressingUpOrDown=!0,b.step("down",_,M,I)},b.up=function(_,M,I){b.pressingUpOrDown=!0,b.step("up",_,M,I)},b.saveInput=function(_){b.input=_};var U=y.value;U===void 0&&(U=y.defaultValue),b.state={focused:y.autoFocus};var F=b.getValidValue(b.toNumber(U));return b.state=u(u({},b.state),{},{inputValue:b.toPrecisionAsStep(F),value:F}),b}return Object(X.a)(S,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var U=this.props,F=U.value,_=U.onChange,M=U.max,I=U.min,g=this.state.focused;if(b){if(!D(b.value,F)||!D(b.max,M)||!D(b.min,I)){var W=g?F:this.getValidValue(F),$;this.pressingUpOrDown?$=W:this.inputting?$=this.rawInput:$=this.toPrecisionAsStep(W),this.setState({value:W,inputValue:$})}var ne="value"in this.props?F:this.state.value;"max"in this.props&&b.max!==M&&typeof ne=="number"&&ne>M&&_&&_(M),"min"in this.props&&b.min!==I&&typeof ne=="number"&&ne<I&&_&&_(I)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var oe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?oe=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(oe=this.cursorStart):oe=this.input.value.length,this.fixCaret(oe,oe)}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(we){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(b){var U=b;return U===""?U="":this.isNotCompleteNumber(parseFloat(U))?U=this.state.value:U=this.getValidValue(U),this.toNumber(U)}},{key:"getValueFromEvent",value:function(b){var U=b.target.value.trim().replace(/。/g,".");return w(this.props.decimalSeparator)&&(U=U.replace(this.props.decimalSeparator,".")),U}},{key:"getValidValue",value:function(b){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,_=parseFloat(b);return isNaN(_)?b:(_<U&&(_=U),_>F&&(_=F),_)}},{key:"setValue",value:function(b,U){var F=this.props.precision,_=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),M=this.state.value,I=M===void 0?null:M,g=this.state.inputValue,W=g===void 0?null:g,$=typeof _=="number"?_.toFixed(F):"".concat(_),ne=_!==I||$!=="".concat(W);return"value"in this.props?(W=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:W},U)):this.setState({value:_,inputValue:this.toPrecisionAsStep(b)},U),ne&&this.props.onChange(_),_}},{key:"getMaxPrecision",value:function(b){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,_=F.precision,M=F.step;if(w(_))return _;var I=this.getPrecision(U),g=this.getPrecision(M),W=this.getPrecision(b);return b?Math.max(W,I+g):I+g}},{key:"getPrecisionFactor",value:function(b){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(b,U);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var U=Math.abs(this.getMaxPrecision(b));return isNaN(U)?b.toString():Number(b).toFixed(U)}},{key:"toNumber",value:function(b){var U=this.props.precision,F=this.state.focused,_=b&&b.length>16&&F;return this.isNotCompleteNumber(b)||_?b:w(U)?Math.round(b*Math.pow(10,U))/Math.pow(10,U):Number(b)}},{key:"upStep",value:function(b,U){var F=this.props.step,_=this.getPrecisionFactor(b,U),M=Math.abs(this.getMaxPrecision(b,U)),I=((_*b+_*F*U)/_).toFixed(M);return this.toNumber(I)}},{key:"downStep",value:function(b,U){var F=this.props.step,_=this.getPrecisionFactor(b,U),M=Math.abs(this.getMaxPrecision(b,U)),I=((_*b-_*F*U)/_).toFixed(M);return this.toNumber(I)}},{key:"step",value:function(b,U){var F=this,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,M=arguments.length>3?arguments[3]:void 0;this.stop(),U&&(U.persist(),U.preventDefault());var I=this.props;if(I.disabled)return;var g=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(g))return;var W=this["".concat(b,"Step")](g,_),$=W>I.max||W<I.min;if(W>I.max?W=I.max:W<I.min&&(W=I.min),this.setValue(W,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),$)return;this.autoStepTimer=setTimeout(function(){F[b](U,_,!0)},M?a:R)}},{key:"fixCaret",value:function(b,U){if(b===void 0||U===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,_=this.input.selectionEnd;(b!==F||U!==_)&&this.input.setSelectionRange(b,U)}catch(M){}}},{key:"render",value:function(){var b,U=this.props,F=U.prefixCls,_=U.disabled,M=U.readOnly,I=U.useTouch,g=U.autoComplete,W=U.upHandler,$=U.downHandler,ne=U.className,oe=U.max,we=U.min,ge=U.style,xe=U.title,Re=U.onMouseEnter,Le=U.onMouseLeave,ce=U.onMouseOver,he=U.onMouseOut,re=U.required,de=U.onClick,se=U.tabIndex,De=U.type,Ne=U.placeholder,Se=U.id,Pe=U.inputMode,Ue=U.pattern,le=U.step,ve=U.maxLength,Ae=U.autoFocus,Ie=U.name,Ge=U.onPaste,$e=U.onInput,Ze=Object(ie.a)(U,["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,qe=Je.focused,it=v()(F,(b={},Object(J.a)(b,ne,!!ne),Object(J.a)(b,"".concat(F,"-disabled"),_),Object(J.a)(b,"".concat(F,"-focused"),qe),b)),Be={};Object.keys(Ze).forEach(function(me){(me.substr(0,5)==="data-"||me.substr(0,5)==="aria-"||me==="role")&&(Be[me]=Ze[me])});var ct=!M&&!_,ot=this.getInputDisplayValue(null),je=(at||at===0)&&(isNaN(at)||Number(at)>=oe),We=(at||at===0)&&(isNaN(at)||Number(at)<=we),Oe=je||_||M,_e=We||_||M,Te=v()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(J.a)({},"".concat(F,"-handler-up-disabled"),Oe)),ae=v()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(J.a)({},"".concat(F,"-handler-down-disabled"),_e)),ue=I?{onTouchStart:Oe?o:this.up,onTouchEnd:this.stop}:{onMouseDown:Oe?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},fe=I?{onTouchStart:_e?o:this.down,onTouchEnd:this.stop}:{onMouseDown:_e?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:it,style:ge,title:xe,onMouseEnter:Re,onMouseLeave:Le,onMouseOver:ce,onMouseOut:he,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(F,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},ue,{role:"button","aria-label":"Increase Value","aria-disabled":Oe,className:Te}),W||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:l})),r.a.createElement("span",Object.assign({unselectable:"on"},fe,{role:"button","aria-label":"Decrease Value","aria-disabled":_e,className:ae}),$||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:l}))),r.a.createElement("div",{className:"".concat(F,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":we,"aria-valuemax":oe,"aria-valuenow":at,required:re,type:De,placeholder:Ne,onPaste:Ge,onClick:de,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:se,autoComplete:g,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ct?this.onKeyDown:o,onKeyUp:ct?this.onKeyUp:o,autoFocus:Ae,maxLength:ve,readOnly:M,disabled:_,max:oe,min:we,step:le,name:Ie,title:xe,id:Se,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ot),pattern:Ue,inputMode:Pe,onInput:$e},Be))))}}]),S}(r.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:E,min:-E,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:s,required:!1,autoComplete:"off"};var A=O,C=be.a=A},fjLI:function(tt,be,Z){"use strict";Z.d(be,"f",function(){return p}),Z.d(be,"b",function(){return u}),Z.d(be,"a",function(){return h}),Z.d(be,"d",function(){return d}),Z.d(be,"e",function(){return o}),Z.d(be,"c",function(){return l});var ie=Z("8HAY"),J=Z("Vhoy"),P=Z("MI8n"),X=Z("JYp7"),j=Z("pmY6"),B=Z("24hK"),K=Z("nnTU"),H=Z("T8No"),r=Z("Cg/j"),L=Z("t9D7"),v=function(s,a,R,E){var w=arguments.length,D=w<3?a:E===null?E=Object.getOwnPropertyDescriptor(a,R):E,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(s,a,R,E);else for(var A=s.length-1;A>=0;A--)(O=s[A])&&(D=(w<3?O(D):w>3?O(a,R,D):O(a,R))||D);return w>3&&D&&Object.defineProperty(a,R,D),D},m=function(s,a){return function(R,E){a(R,E,s)}};function p(s){return s.command!==void 0}class u{constructor(s){this.id=u._idPool++,this._debugName=s}}u._idPool=0,u.CommandPalette=new u("CommandPalette"),u.EditorContext=new u("EditorContext"),u.SimpleEditorContext=new u("SimpleEditorContext"),u.EditorContextCopy=new u("EditorContextCopy"),u.EditorContextPeek=new u("EditorContextPeek"),u.MenubarEditMenu=new u("MenubarEditMenu"),u.MenubarCopy=new u("MenubarCopy"),u.MenubarGoMenu=new u("MenubarGoMenu"),u.MenubarSelectionMenu=new u("MenubarSelectionMenu"),u.InlineCompletionsActions=new u("InlineCompletionsActions");const h=Object(r.c)("menuService"),d=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new P.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===u.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(j.i)(()=>{let a=!1;for(const R of s)a=this._commands.delete(R.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,R)=>s.set(R,a)),s}appendMenuItem(s,a){return this.appendMenuItems(X.a.single({id:s,item:a}))}appendMenuItems(s){const a=new Set,R=new B.a;for(const{id:E,item:w}of s){let D=this._menuItems.get(E);D||(D=new B.a,this._menuItems.set(E,D)),R.push(D.push(w)),a.add(E)}return this._onDidChangeMenu.fire(a),Object(j.i)(()=>{if(R.size>0){for(let E of R)E();this._onDidChangeMenu.fire(a),R.clear()}})}getMenuItems(s){let a;return this._menuItems.has(s)?a=[...this._menuItems.get(s)]:a=[],s===u.CommandPalette&&this._appendImplicitItems(a),a}_appendImplicitItems(s){const a=new Set;for(const R of s)p(R)&&(a.add(R.command.id),R.alt&&a.add(R.alt.id));this._commands.forEach((R,E)=>{a.has(E)||s.push({command:R})})}};class o extends ie.e{constructor(s,a,R,E){super(`submenuitem.${s.submenu.id}`,typeof s.title=="string"?s.title:s.title.value,[],"submenu");this.item=s,this._menuService=a,this._contextKeyService=R,this._options=E}get actions(){const s=[],a=this._menuService.createMenu(this.item.submenu,this._contextKeyService),R=a.getActions(this._options);a.dispose();for(const[,E]of R)E.length>0&&(s.push(...E),s.push(new ie.d));return s.length&&s.pop(),s}}let l=class s{constructor(a,R,E,w,D){var O,A;if(this._commandService=D,this.id=a.id,this.label=(E==null?void 0:E.renderShortTitle)&&a.shortTitle?typeof a.shortTitle=="string"?a.shortTitle:a.shortTitle.value:typeof a.title=="string"?a.title:a.title.value,this.tooltip=(A=typeof a.tooltip=="string"?a.tooltip:(O=a.tooltip)===null||O===void 0?void 0:O.value)!==null&&A!==void 0?A:"",this.enabled=!a.precondition||w.contextMatchesRules(a.precondition),this.checked=void 0,a.toggled){const C=a.toggled.condition?a.toggled:{condition:a.toggled};this.checked=w.contextMatchesRules(C.condition),this.checked&&C.tooltip&&(this.tooltip=typeof C.tooltip=="string"?C.tooltip:C.tooltip.value),C.title&&(this.label=typeof C.title=="string"?C.title:C.title.value)}this.item=a,this.alt=R?new s(R,void 0,E,w,D):void 0,this._options=E,L.d.isThemeIcon(a.icon)&&(this.class=J.a.asClassName(a.icon))}dispose(){}run(...a){var R,E;let w=[];return((R=this._options)===null||R===void 0?void 0:R.arg)&&(w=[...w,this._options.arg]),((E=this._options)===null||E===void 0?void 0:E.shouldForwardArgs)&&(w=[...w,...a]),this._commandService.executeCommand(this.id,...w)}};l=v([m(3,H.b),m(4,K.b)],l)},h78n:function(tt,be,Z){"use strict";Z.d(be,"a",function(){return b});var ie=Z("q1tI"),J=Z.n(ie),P=Z("TSYQ"),X=Z.n(P),j={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},B=function(_){var M=_.map(function(){return Object(ie.useRef)()}),I=Object(ie.useRef)();return Object(ie.useEffect)(function(){var g=Date.now(),W=!1;Object.keys(M).forEach(function($){var ne=M[$].current;if(!ne)return;W=!0;var oe=ne.style;oe.transitionDuration=".3s, .3s, .3s, .06s",I.current&&g-I.current<100&&(oe.transitionDuration="0s, 0s")}),W&&(I.current=Date.now())}),[M]};function K(){return K=Object.assign||function(F){for(var _=1;_<arguments.length;_++){var M=arguments[_];for(var I in M)Object.prototype.hasOwnProperty.call(M,I)&&(F[I]=M[I])}return F},K.apply(this,arguments)}function H(F,_){return p(F)||m(F,_)||L(F,_)||r()}function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L(F,_){if(!F)return;if(typeof F=="string")return v(F,_);var M=Object.prototype.toString.call(F).slice(8,-1);if(M==="Object"&&F.constructor&&(M=F.constructor.name),M==="Map"||M==="Set")return Array.from(F);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return v(F,_)}function v(F,_){(_==null||_>F.length)&&(_=F.length);for(var M=0,I=new Array(_);M<_;M++)I[M]=F[M];return I}function m(F,_){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var M=[],I=!0,g=!1,W=void 0;try{for(var $=F[Symbol.iterator](),ne;!(I=(ne=$.next()).done)&&!(M.push(ne.value),_&&M.length===_);I=!0);}catch(oe){g=!0,W=oe}finally{try{!I&&$.return!=null&&$.return()}finally{if(g)throw W}}return M}function p(F){if(Array.isArray(F))return F}function u(F,_){if(F==null)return{};var M=h(F,_),I,g;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(F);for(g=0;g<W.length;g++){if(I=W[g],_.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;M[I]=F[I]}}return M}function h(F,_){if(F==null)return{};var M={},I=Object.keys(F),g,W;for(W=0;W<I.length;W++){if(g=I[W],_.indexOf(g)>=0)continue;M[g]=F[g]}return M}var d=function(_){var M=_.className,I=_.percent,g=_.prefixCls,W=_.strokeColor,$=_.strokeLinecap,ne=_.strokeWidth,oe=_.style,we=_.trailColor,ge=_.trailWidth,xe=_.transition,Re=u(_,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Re.gapPosition;var Le=Array.isArray(I)?I:[I],ce=Array.isArray(W)?W:[W],he=B(Le),re=H(he,1),de=re[0],se=ne/2,De=100-ne/2,Ne="M ".concat($==="round"?se:0,",").concat(se,`
L `).concat($==="round"?De:100,",").concat(se),Se="0 0 100 ".concat(ne),Pe=0;return J.a.createElement("svg",K({className:X()("".concat(g,"-line"),M),viewBox:Se,preserveAspectRatio:"none",style:oe},Re),J.a.createElement("path",{className:"".concat(g,"-line-trail"),d:Ne,strokeLinecap:$,stroke:we,strokeWidth:ge||ne,fillOpacity:"0"}),Le.map(function(Ue,le){var ve={strokeDasharray:"".concat(Ue,"px, 100px"),strokeDashoffset:"-".concat(Pe,"px"),transition:xe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ae=ce[le]||ce[ce.length-1];return Pe+=Ue,J.a.createElement("path",{key:le,className:"".concat(g,"-line-path"),d:Ne,strokeLinecap:$,stroke:Ae,strokeWidth:ne,fillOpacity:"0",ref:de[le],style:ve})}))};d.defaultProps=j;var o=d;function l(){return l=Object.assign||function(F){for(var _=1;_<arguments.length;_++){var M=arguments[_];for(var I in M)Object.prototype.hasOwnProperty.call(M,I)&&(F[I]=M[I])}return F},l.apply(this,arguments)}function s(F,_){return D(F)||w(F,_)||R(F,_)||a()}function a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(F,_){if(!F)return;if(typeof F=="string")return E(F,_);var M=Object.prototype.toString.call(F).slice(8,-1);if(M==="Object"&&F.constructor&&(M=F.constructor.name),M==="Map"||M==="Set")return Array.from(F);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return E(F,_)}function E(F,_){(_==null||_>F.length)&&(_=F.length);for(var M=0,I=new Array(_);M<_;M++)I[M]=F[M];return I}function w(F,_){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var M=[],I=!0,g=!1,W=void 0;try{for(var $=F[Symbol.iterator](),ne;!(I=(ne=$.next()).done)&&!(M.push(ne.value),_&&M.length===_);I=!0);}catch(oe){g=!0,W=oe}finally{try{!I&&$.return!=null&&$.return()}finally{if(g)throw W}}return M}function D(F){if(Array.isArray(F))return F}function O(F,_){if(F==null)return{};var M=A(F,_),I,g;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(F);for(g=0;g<W.length;g++){if(I=W[g],_.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;M[I]=F[I]}}return M}function A(F,_){if(F==null)return{};var M={},I=Object.keys(F),g,W;for(W=0;W<I.length;W++){if(g=I[W],_.indexOf(g)>=0)continue;M[g]=F[g]}return M}var C=0;function T(F){return+F.replace("%","")}function f(F){return Array.isArray(F)?F:[F]}function S(F,_,M,I){var g=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,W=arguments.length>5?arguments[5]:void 0,$=50-I/2,ne=0,oe=-$,we=0,ge=-2*$;switch(W){case"left":ne=-$,oe=0,we=2*$,ge=0;break;case"right":ne=$,oe=0,we=-2*$,ge=0;break;case"bottom":oe=$,ge=2*$;break;default:}var xe="M 50,50 m ".concat(ne,",").concat(oe,`
a `).concat($,",").concat($," 0 1 1 ").concat(we,",").concat(-ge,`
a `).concat($,",").concat($," 0 1 1 ").concat(-we,",").concat(ge),Re=Math.PI*2*$,Le={stroke:M,strokeDasharray:"".concat(_/100*(Re-g),"px ").concat(Re,"px"),strokeDashoffset:"-".concat(g/2+F/100*(Re-g),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:xe,pathStyle:Le}}var y=function(_){var M=_.prefixCls,I=_.strokeWidth,g=_.trailWidth,W=_.gapDegree,$=_.gapPosition,ne=_.trailColor,oe=_.strokeLinecap,we=_.style,ge=_.className,xe=_.strokeColor,Re=_.percent,Le=O(_,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ce=Object(ie.useMemo)(function(){return C+=1,C},[]),he=S(0,100,ne,I,W,$),re=he.pathString,de=he.pathStyle,se=f(Re),De=f(xe),Ne=De.find(function(ve){return Object.prototype.toString.call(ve)==="[object Object]"}),Se=B(se),Pe=s(Se,1),Ue=Pe[0],le=function(){var Ae=0;return se.map(function(Ie,Ge){var $e=De[Ge]||De[De.length-1],Ze=Object.prototype.toString.call($e)==="[object Object]"?"url(#".concat(M,"-gradient-").concat(ce,")"):"",Je=S(Ae,Ie,$e,I,W,$);return Ae+=Ie,J.a.createElement("path",{key:Ge,className:"".concat(M,"-circle-path"),d:Je.pathString,stroke:Ze,strokeLinecap:oe,strokeWidth:I,opacity:Ie===0?0:1,fillOpacity:"0",style:Je.pathStyle,ref:Ue[Ge]})})};return J.a.createElement("svg",l({className:X()("".concat(M,"-circle"),ge),viewBox:"0 0 100 100",style:we},Le),Ne&&J.a.createElement("defs",null,J.a.createElement("linearGradient",{id:"".concat(M,"-gradient-").concat(ce),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ne).sort(function(ve,Ae){return T(ve)-T(Ae)}).map(function(ve,Ae){return J.a.createElement("stop",{key:Ae,offset:ve,stopColor:Ne[ve]})}))),J.a.createElement("path",{className:"".concat(M,"-circle-trail"),d:re,stroke:ne,strokeLinecap:oe,strokeWidth:g||I,fillOpacity:"0",style:de}),le().reverse())};y.defaultProps=j;var b=y,U={Line:o,Circle:b}},ic2d:function(tt,be,Z){"use strict";Z.d(be,"a",function(){return X});var ie=Z("FWmy"),J=Z("746U");class P{constructor(){this.data=new Map}add(j,B){ie.a(J.l(j)),ie.a(J.k(B)),ie.a(!this.data.has(j),"There is already an extension with this id"),this.data.set(j,B)}as(j){return this.data.get(j)||null}}const X=new P},kSUc:function(tt,be,Z){},lYpw:function(tt,be,Z){tt.exports={flex_box_center:"flex_box_center___3D7LV",flex_space_between:"flex_space_between___2Jo8y",flex_box_vertical_center:"flex_box_vertical_center___3g7rr",flex_box_center_end:"flex_box_center_end___1WMPu",flex_box_column:"flex_box_column___37nyR",bg:"bg___22rVB",title:"title___FxZ0V",titleLeft:"titleLeft___1O0pm",titleRight:"titleRight___13DWe",btns:"btns___x4l1O"}},lZu9:function(tt,be,Z){(function(ie){ie(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(ie){"use strict";ie.defineMode("markdown",function(J,P){var X=ie.getMode(J,"text/html"),j=X.name=="null";function B(I){if(ie.findModeByName){var g=ie.findModeByName(I);g&&(I=g.mime||g.mimes[0])}var W=ie.getMode(J,I);return W.name=="null"?null:W}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var K={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 H in K)K.hasOwnProperty(H)&&P.tokenTypeOverrides[H]&&(K[H]=P.tokenTypeOverrides[H]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,m=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,h=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,d=/^\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]/,l=" ";function s(I,g,W){return g.f=g.inline=W,W(I,g)}function a(I,g,W){return g.f=g.block=W,W(I,g)}function R(I){return!I||!/\S/.test(I.string)}function E(I){if(I.linkTitle=!1,I.linkHref=!1,I.linkText=!1,I.em=!1,I.strong=!1,I.strikethrough=!1,I.quote=0,I.indentedCode=!1,I.f==D){var g=j;if(!g){var W=ie.innerMode(X,I.htmlState);g=W.mode.name=="xml"&&W.state.tagStart===null&&!W.state.context&&W.state.tokenize.isInText}g&&(I.f=T,I.block=w,I.htmlState=null)}return I.trailingSpace=0,I.trailingSpaceNewLine=!1,I.prevLine=I.thisLine,I.thisLine={stream:null},null}function w(I,g){var W=I.column()===g.indentation,$=R(g.prevLine.stream),ne=g.indentedCode,oe=g.prevLine.hr,we=g.list!==!1,ge=(g.listStack[g.listStack.length-1]||0)+3;g.indentedCode=!1;var xe=g.indentation;if(g.indentationDiff===null&&(g.indentationDiff=g.indentation,we)){for(g.list=null;xe<g.listStack[g.listStack.length-1];)g.listStack.pop(),g.listStack.length?g.indentation=g.listStack[g.listStack.length-1]:g.list=!1;g.list!==!1&&(g.indentationDiff=xe-g.listStack[g.listStack.length-1])}var Re=!$&&!oe&&!g.prevLine.header&&(!we||!ne)&&!g.prevLine.fencedCodeEnd,Le=(g.list===!1||oe||$)&&g.indentation<=ge&&I.match(r),ce=null;if(g.indentationDiff>=4&&(ne||g.prevLine.fencedCodeEnd||g.prevLine.header||$))return I.skipToEnd(),g.indentedCode=!0,K.code;if(I.eatSpace())return null;if(W&&g.indentation<=ge&&(ce=I.match(m))&&ce[1].length<=6)return g.quote=0,g.header=ce[1].length,g.thisLine.header=!0,P.highlightFormatting&&(g.formatting="header"),g.f=g.inline,A(g);if(g.indentation<=ge&&I.eat(">"))return g.quote=W?1:g.quote+1,P.highlightFormatting&&(g.formatting="quote"),I.eatSpace(),A(g);if(!Le&&!g.setext&&W&&g.indentation<=ge&&(ce=I.match(L))){var he=ce[1]?"ol":"ul";return g.indentation=xe+I.current().length,g.list=!0,g.quote=0,g.listStack.push(g.indentation),g.em=!1,g.strong=!1,g.code=!1,g.strikethrough=!1,P.taskLists&&I.match(v,!1)&&(g.taskList=!0),g.f=g.inline,P.highlightFormatting&&(g.formatting=["list","list-"+he]),A(g)}else{if(W&&g.indentation<=ge&&(ce=I.match(h,!0)))return g.quote=0,g.fencedEndRE=new RegExp(ce[1]+"+ *$"),g.localMode=P.fencedCodeBlockHighlighting&&B(ce[2]||P.fencedCodeBlockDefaultMode),g.localMode&&(g.localState=ie.startState(g.localMode)),g.f=g.block=O,P.highlightFormatting&&(g.formatting="code-block"),g.code=-1,A(g);if(g.setext||(!Re||!we)&&!g.quote&&g.list===!1&&!g.code&&!Le&&!d.test(I.string)&&(ce=I.lookAhead(1))&&(ce=ce.match(p)))return g.setext?(g.header=g.setext,g.setext=0,I.skipToEnd(),P.highlightFormatting&&(g.formatting="header")):(g.header=ce[0].charAt(0)=="="?1:2,g.setext=g.header),g.thisLine.header=!0,g.f=g.inline,A(g);if(Le)return I.skipToEnd(),g.hr=!0,g.thisLine.hr=!0,K.hr;if(I.peek()==="[")return s(I,g,U)}return s(I,g,g.inline)}function D(I,g){var W=X.token(I,g.htmlState);if(!j){var $=ie.innerMode(X,g.htmlState);($.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText||g.md_inside&&I.current().indexOf(">")>-1)&&(g.f=T,g.block=w,g.htmlState=null)}return W}function O(I,g){var W=g.listStack[g.listStack.length-1]||0,$=g.indentation<W,ne=W+3;if(g.fencedEndRE&&g.indentation<=ne&&($||I.match(g.fencedEndRE))){P.highlightFormatting&&(g.formatting="code-block");var oe;return $||(oe=A(g)),g.localMode=g.localState=null,g.block=w,g.f=T,g.fencedEndRE=null,g.code=0,g.thisLine.fencedCodeEnd=!0,$?a(I,g,g.block):oe}else return g.localMode?g.localMode.token(I,g.localState):(I.skipToEnd(),K.code)}function A(I){var g=[];if(I.formatting){g.push(K.formatting),typeof I.formatting=="string"&&(I.formatting=[I.formatting]);for(var W=0;W<I.formatting.length;W++)g.push(K.formatting+"-"+I.formatting[W]),I.formatting[W]==="header"&&g.push(K.formatting+"-"+I.formatting[W]+"-"+I.header),I.formatting[W]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=I.quote?g.push(K.formatting+"-"+I.formatting[W]+"-"+I.quote):g.push("error"))}if(I.taskOpen)return g.push("meta"),g.length?g.join(" "):null;if(I.taskClosed)return g.push("property"),g.length?g.join(" "):null;if(I.linkHref?g.push(K.linkHref,"url"):(I.strong&&g.push(K.strong),I.em&&g.push(K.em),I.strikethrough&&g.push(K.strikethrough),I.emoji&&g.push(K.emoji),I.linkText&&g.push(K.linkText),I.code&&g.push(K.code),I.image&&g.push(K.image),I.imageAltText&&g.push(K.imageAltText,"link"),I.imageMarker&&g.push(K.imageMarker)),I.header&&g.push(K.header,K.header+"-"+I.header),I.quote&&(g.push(K.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=I.quote?g.push(K.quote+"-"+I.quote):g.push(K.quote+"-"+P.maxBlockquoteDepth)),I.list!==!1){var $=(I.listStack.length-1)%3;$?$===1?g.push(K.list2):g.push(K.list3):g.push(K.list1)}return I.trailingSpaceNewLine?g.push("trailing-space-new-line"):I.trailingSpace&&g.push("trailing-space-"+(I.trailingSpace%2?"a":"b")),g.length?g.join(" "):null}function C(I,g){return I.match(u,!0)?A(g):void 0}function T(I,g){var W=g.text(I,g);if(typeof W!="undefined")return W;if(g.list)return g.list=null,A(g);if(g.taskList){var $=I.match(v,!0)[1]===" ";return $?g.taskOpen=!0:g.taskClosed=!0,P.highlightFormatting&&(g.formatting="task"),g.taskList=!1,A(g)}if(g.taskOpen=!1,g.taskClosed=!1,g.header&&I.match(/^#+$/,!0))return P.highlightFormatting&&(g.formatting="header"),A(g);var ne=I.next();if(g.linkTitle){g.linkTitle=!1;var oe=ne;ne==="("&&(oe=")"),oe=(oe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var we="^\\s*(?:[^"+oe+"\\\\]+|\\\\\\\\|\\\\.)"+oe;if(I.match(new RegExp(we),!0))return K.linkHref}if(ne==="`"){var ge=g.formatting;P.highlightFormatting&&(g.formatting="code"),I.eatWhile("`");var xe=I.current().length;if(g.code==0&&(!g.quote||xe==1))return g.code=xe,A(g);if(xe==g.code){var Re=A(g);return g.code=0,Re}else return g.formatting=ge,A(g)}else if(g.code)return A(g);if(ne==="\\"&&(I.next(),P.highlightFormatting)){var Le=A(g),ce=K.formatting+"-escape";return Le?Le+" "+ce:ce}if(ne==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return g.imageMarker=!0,g.image=!0,P.highlightFormatting&&(g.formatting="image"),A(g);if(ne==="["&&g.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return g.imageMarker=!1,g.imageAltText=!0,P.highlightFormatting&&(g.formatting="image"),A(g);if(ne==="]"&&g.imageAltText){P.highlightFormatting&&(g.formatting="image");var Le=A(g);return g.imageAltText=!1,g.image=!1,g.inline=g.f=S,Le}if(ne==="["&&!g.image)return g.linkText&&I.match(/^.*?\]/)||(g.linkText=!0,P.highlightFormatting&&(g.formatting="link")),A(g);if(ne==="]"&&g.linkText){P.highlightFormatting&&(g.formatting="link");var Le=A(g);return g.linkText=!1,g.inline=g.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?S:T,Le}if(ne==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=f,P.highlightFormatting&&(g.formatting="link");var Le=A(g);return Le?Le+=" ":Le="",Le+K.linkInline}if(ne==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=f,P.highlightFormatting&&(g.formatting="link");var Le=A(g);return Le?Le+=" ":Le="",Le+K.linkEmail}if(P.xml&&ne==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var he=I.string.indexOf(">",I.pos);if(he!=-1){var re=I.string.substring(I.start,he);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(re)&&(g.md_inside=!0)}return I.backUp(1),g.htmlState=ie.startState(X),a(I,g,D)}if(P.xml&&ne==="<"&&I.match(/^\/\w*?>/))return g.md_inside=!1,"tag";if(ne==="*"||ne==="_"){for(var de=1,se=I.pos==1?" ":I.string.charAt(I.pos-2);de<3&&I.eat(ne);)de++;var De=I.peek()||" ",Ne=!/\s/.test(De)&&(!o.test(De)||/\s/.test(se)||o.test(se)),Se=!/\s/.test(se)&&(!o.test(se)||/\s/.test(De)||o.test(De)),Pe=null,Ue=null;if(de%2&&(!g.em&&Ne&&(ne==="*"||!Se||o.test(se))?Pe=!0:g.em==ne&&Se&&(ne==="*"||!Ne||o.test(De))&&(Pe=!1)),de>1&&(!g.strong&&Ne&&(ne==="*"||!Se||o.test(se))?Ue=!0:g.strong==ne&&Se&&(ne==="*"||!Ne||o.test(De))&&(Ue=!1)),Ue!=null||Pe!=null){P.highlightFormatting&&(g.formatting=Pe==null?"strong":Ue==null?"em":"strong em"),Pe===!0&&(g.em=ne),Ue===!0&&(g.strong=ne);var Re=A(g);return Pe===!1&&(g.em=!1),Ue===!1&&(g.strong=!1),Re}}else if(ne===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return A(g);I.backUp(1)}if(P.strikethrough){if(ne==="~"&&I.eatWhile(ne)){if(g.strikethrough){P.highlightFormatting&&(g.formatting="strikethrough");var Re=A(g);return g.strikethrough=!1,Re}else if(I.match(/^[^\s]/,!1))return g.strikethrough=!0,P.highlightFormatting&&(g.formatting="strikethrough"),A(g)}else if(ne===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return A(g);I.backUp(2)}}if(P.emoji&&ne===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){g.emoji=!0,P.highlightFormatting&&(g.formatting="emoji");var le=A(g);return g.emoji=!1,le}return ne===" "&&(I.match(/^ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),A(g)}function f(I,g){var W=I.next();if(W===">"){g.f=g.inline=T,P.highlightFormatting&&(g.formatting="link");var $=A(g);return $?$+=" ":$="",$+K.linkInline}return I.match(/^[^>]+/,!0),K.linkInline}function S(I,g){if(I.eatSpace())return null;var W=I.next();return W==="("||W==="["?(g.f=g.inline=b(W==="("?")":"]"),P.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,A(g)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(I){return function(g,W){var $=g.next();if($===I){W.f=W.inline=T,P.highlightFormatting&&(W.formatting="link-string");var ne=A(W);return W.linkHref=!1,ne}return g.match(y[I]),W.linkHref=!0,A(W)}}function U(I,g){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(g.f=F,I.next(),P.highlightFormatting&&(g.formatting="link"),g.linkText=!0,A(g)):s(I,g,T)}function F(I,g){if(I.match(/^\]:/,!0)){g.f=g.inline=_,P.highlightFormatting&&(g.formatting="link");var W=A(g);return g.linkText=!1,W}return I.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function _(I,g){return I.eatSpace()?null:(I.match(/^[^\s]+/,!0),I.peek()===void 0?g.linkTitle=!0:I.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),g.f=g.inline=T,K.linkHref+" url")}var M={startState:function(){return{f:w,prevLine:{stream:null},thisLine:{stream:null},block:w,htmlState:null,indentation:0,inline:T,text:C,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(I){return{f:I.f,prevLine:I.prevLine,thisLine:I.thisLine,block:I.block,htmlState:I.htmlState&&ie.copyState(X,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?ie.copyState(I.localMode,I.localState):null,inline:I.inline,text:I.text,formatting:!1,linkText:I.linkText,linkTitle:I.linkTitle,linkHref:I.linkHref,code:I.code,em:I.em,strong:I.strong,strikethrough:I.strikethrough,emoji:I.emoji,header:I.header,setext:I.setext,hr:I.hr,taskList:I.taskList,list:I.list,listStack:I.listStack.slice(0),quote:I.quote,indentedCode:I.indentedCode,trailingSpace:I.trailingSpace,trailingSpaceNewLine:I.trailingSpaceNewLine,md_inside:I.md_inside,fencedEndRE:I.fencedEndRE}},token:function(I,g){if(g.formatting=!1,I!=g.thisLine.stream){if(g.header=0,g.hr=!1,I.match(/^\s*$/,!0))return E(g),null;if(g.prevLine=g.thisLine,g.thisLine={stream:I},g.taskList=!1,g.trailingSpace=0,g.trailingSpaceNewLine=!1,!g.localState&&(g.f=g.block,g.f!=D)){var W=I.match(/^\s*/,!0)[0].replace(/\t/g,l).length;if(g.indentation=W,g.indentationDiff=null,W>0)return null}}return g.f(I,g)},innerMode:function(I){return I.block==D?{state:I.htmlState,mode:X}:I.localState?{state:I.localState,mode:I.localMode}:{state:I,mode:M}},indent:function(I,g,W){return I.block==D&&X.indent?X.indent(I.htmlState,g,W):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,g,W):ie.Pass},blankLine:E,getType:A,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return M},"xml"),ie.defineMIME("text/markdown","markdown"),ie.defineMIME("text/x-markdown","markdown")})},nEHx:function(tt,be,Z){"use strict";Z.d(be,"a",function(){return ie});var ie;(function(J){J.DARK="dark",J.LIGHT="light",J.HIGH_CONTRAST="hc"})(ie||(ie={}))},nnTU:function(tt,be,Z){"use strict";Z.d(be,"b",function(){return K}),Z.d(be,"a",function(){return H});var ie=Z("MI8n"),J=Z("JYp7"),P=Z("pmY6"),X=Z("24hK"),j=Z("746U"),B=Z("Cg/j");const K=Object(B.c)("commandService"),H=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ie.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(r,L){if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!L)throw new Error("invalid command");return this.registerCommand({id:r,handler:L})}if(r.description){const h=[];for(let o of r.description.args)h.push(o.constraint);const d=r.handler;r.handler=function(o,...l){return Object(j.o)(l,h),d(o,...l)}}const{id:v}=r;let m=this._commands.get(v);m||(m=new X.a,this._commands.set(v,m));let p=m.unshift(r),u=Object(P.i)(()=>{p();const h=this._commands.get(v);(h==null?void 0:h.isEmpty())&&this._commands.delete(v)});return this._onDidRegisterCommand.fire(v),u}registerCommandAlias(r,L){return H.registerCommand(r,(v,...m)=>v.get(K).executeCommand(L,...m))}getCommand(r){const L=this._commands.get(r);return!L||L.isEmpty()?void 0:J.a.first(L)}getCommands(){const r=new Map;for(const L of this._commands.keys()){const v=this.getCommand(L);v&&r.set(L,v)}return r}};H.registerCommand("noop",()=>{})},osHv:function(tt,be,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";var J=ie.Pos;function P(o,l){return o.line-l.line||o.ch-l.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",j=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",B=new RegExp("<(/?)(["+X+"]["+j+"]*)","g");function K(o,l,s,a){this.line=l,this.ch=s,this.cm=o,this.text=o.getLine(l),this.min=a?Math.max(a.from,o.firstLine()):o.firstLine(),this.max=a?Math.min(a.to-1,o.lastLine()):o.lastLine()}function H(o,l){var s=o.cm.getTokenTypeAt(J(o.line,l));return s&&/\btag\b/.test(s)}function r(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function L(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function v(o){for(;;){var l=o.text.indexOf(">",o.ch);if(l==-1){if(r(o))continue;return}if(!H(o,l+1)){o.ch=l+1;continue}var s=o.text.lastIndexOf("/",l),a=s>-1&&!/\S/.test(o.text.slice(s+1,l));return o.ch=l+1,a?"selfClose":"regular"}}function m(o){for(;;){var l=o.ch?o.text.lastIndexOf("<",o.ch-1):-1;if(l==-1){if(L(o))continue;return}if(!H(o,l+1)){o.ch=l;continue}B.lastIndex=l,o.ch=l;var s=B.exec(o.text);if(s&&s.index==l)return s}}function p(o){for(;;){B.lastIndex=o.ch;var l=B.exec(o.text);if(!l){if(r(o))continue;return}if(!H(o,l.index+1)){o.ch=l.index+1;continue}return o.ch=l.index+l[0].length,l}}function u(o){for(;;){var l=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(l==-1){if(L(o))continue;return}if(!H(o,l+1)){o.ch=l;continue}var s=o.text.lastIndexOf("/",l),a=s>-1&&!/\S/.test(o.text.slice(s+1,l));return o.ch=l+1,a?"selfClose":"regular"}}function h(o,l){for(var s=[];;){var a=p(o),R,E=o.line,w=o.ch-(a?a[0].length:0);if(!a||!(R=v(o)))return;if(R=="selfClose")continue;if(a[1]){for(var D=s.length-1;D>=0;--D)if(s[D]==a[2]){s.length=D;break}if(D<0&&(!l||l==a[2]))return{tag:a[2],from:J(E,w),to:J(o.line,o.ch)}}else s.push(a[2])}}function d(o,l){for(var s=[];;){var a=u(o);if(!a)return;if(a=="selfClose"){m(o);continue}var R=o.line,E=o.ch,w=m(o);if(!w)return;if(w[1])s.push(w[2]);else{for(var D=s.length-1;D>=0;--D)if(s[D]==w[2]){s.length=D;break}if(D<0&&(!l||l==w[2]))return{tag:w[2],from:J(o.line,o.ch),to:J(R,E)}}}}ie.registerHelper("fold","xml",function(o,l){for(var s=new K(o,l.line,0);;){var a=p(s);if(!a||s.line!=l.line)return;var R=v(s);if(!R)return;if(!a[1]&&R!="selfClose"){var E=J(s.line,s.ch),w=h(s,a[2]);return w&&P(w.from,E)>0?{from:E,to:w.from}:null}}}),ie.findMatchingTag=function(o,l,s){var a=new K(o,l.line,l.ch,s);if(a.text.indexOf(">")==-1&&a.text.indexOf("<")==-1)return;var R=v(a),E=R&&J(a.line,a.ch),w=R&&m(a);if(!R||!w||P(a,l)>0)return;var D={from:J(a.line,a.ch),to:E,tag:w[2]};return R=="selfClose"?{open:D,close:null,at:"open"}:w[1]?{open:d(a,w[2]),close:D,at:"close"}:(a=new K(o,E.line,E.ch,s),{open:D,close:h(a,w[2]),at:"open"})},ie.findEnclosingTag=function(o,l,s,a){for(var R=new K(o,l.line,l.ch,s);;){var E=d(R,a);if(!E)break;var w=new K(o,l.line,l.ch,s),D=h(w,E.tag);if(D)return{open:E,close:D}}},ie.scanForClosingTag=function(o,l,s,a){var R=new K(o,l.line,l.ch,a?{from:0,to:a}:null);return h(R,s)}})},p5ED:function(tt,be,Z){"use strict";var ie=Z("+L6B"),J=Z("2/Rp"),P=Z("5Dmo"),X=Z("3S7+"),j=Z("k1fw"),B=Z("tJVT"),K=Z("q1tI"),H=Z.n(K),r=Z("vHTk"),L=Z.n(r),v=Z("yEEn"),m=Z("ZW9T"),p=Z("1vsH");be.a=function(u){var h=u.name,d=u.data,o=u.theme,l=u.type,s=u.filename,a=u.monacoEditor,R=u.className,E=u.style,w=u.close,D=u.onClose,O=u.hasMask,A=Object(K.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),C=Object(B.a)(A,2),T=C[0],f=C[1],S=Object(K.useState)(""),y=Object(B.a)(S,2),b=y[0],U=y[1],F,_=1024*1024,M=10*_,I=Object(K.useRef)();l==="office"&&(F=Object(p.T)(d).filesize,F>M&&(l="other")),s&&(a.filename=s),Object(K.useEffect)(function(){var $,ne,oe=($=document.cookie)===null||$===void 0||((ne=$.replace(/\s/g,""))===null||ne===void 0)?void 0:ne.split(";");oe==null||oe.map(function(we){var ge=we.split("=");ge[0]==="_educoder_session"&&U(ge[1])})},[]);var g=function(){if(d.startsWith("http")||d.startsWith("/")){W();return}Object(p.z)(s||"educoder",d,s)},W=function(){Object(p.x)(s||h,d)};return console.log("data:",d,"fileanme:",s," name:",h),H.a.createElement("div",{style:Object(j.a)({},E||{}),className:"".concat(O&&L.a.bgBlack," ").concat(l?L.a.wrp:"hide")},w&&H.a.createElement("div",{className:L.a.close,ref:I},H.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return I.current}},H.a.createElement("span",{onClick:W},H.a.createElement("i",{className:"icon-quxiaozhiding"}))),H.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return I.current}},H.a.createElement("span",{className:"",onClick:D},H.a.createElement("i",{className:"icon-guanbi1"})))),H.a.createElement("div",{className:"".concat(L.a[R]," ").concat(R," ").concat(L.a.monaco," ").concat(l==="txt"?"show":"hide")},l==="txt"&&H.a.createElement(m.b,a)),l==="audio"&&H.a.createElement("audio",{src:"".concat(d!=null&&d.startsWith("/")||(d==null?void 0:d.indexOf("https://"))>-1?d:"data:audio/mp3;base64,").concat(d),autoPlay:!0}),l==="video"&&H.a.createElement(H.a.Fragment,null,d!=null&&d.startsWith("/")?H.a.createElement("video",{controls:!0,src:"".concat(d),autoPlay:!0}):H.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(d),autoPlay:!0})),l==="html"&&H.a.createElement("iframe",{src:d+"&disposition=inline"}),l==="pdf"&&H.a.createElement("embed",{className:L.a.embed,src:d}),l==="image"&&H.a.createElement(H.a.Fragment,null,H.a.createElement("img",{src:"".concat(d!=null&&d.startsWith("/")||(d==null?void 0:d.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(d)})),l==="other"&&H.a.createElement("div",null,H.a.createElement(J.a,{type:"primary",size:"large",onClick:g},H.a.createElement(v.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(l==="download"||l==="office")&&H.a.createElement(J.a,{type:"primary",size:"large",onClick:g},H.a.createElement(v.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(tt,be,Z){},pmY6:function(tt,be,Z){"use strict";Z.d(be,"h",function(){return L}),Z.d(be,"g",function(){return m}),Z.d(be,"f",function(){return p}),Z.d(be,"e",function(){return u}),Z.d(be,"i",function(){return h}),Z.d(be,"b",function(){return d}),Z.d(be,"a",function(){return o}),Z.d(be,"d",function(){return l}),Z.d(be,"c",function(){return s});var ie=Z("C/vA"),J=Z("JYp7");const P=!1;let X=null;function j(a){X=a}if(P){const a="__is_disposable_tracked__";j(new class{trackDisposable(R){const E=new Error("Potentially leaked disposable").stack;setTimeout(()=>{R[a]||console.log(E)},3e3)}setParent(R,E){if(R&&R!==o.None)try{R[a]=!0}catch(w){}}markAsDisposed(R){if(R&&R!==o.None)try{R[a]=!0}catch(E){}}markAsSingleton(R){}})}function B(a){return X==null||X.trackDisposable(a),a}function K(a){X==null||X.markAsDisposed(a)}function H(a,R){X==null||X.setParent(a,R)}function r(a,R){if(!X)return;for(const E of a)X.setParent(E,R)}function L(a){return X==null||X.markAsSingleton(a),a}class v 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(J.a.is(a)){let R=[];for(const E of a)if(E)try{E.dispose()}catch(w){R.push(w)}if(R.length===1)throw R[0];if(R.length>1)throw new v(R);return Array.isArray(a)?[]:a}else if(a)return a.dispose(),a}function u(...a){const R=h(()=>p(a));return r(a,R),R}function h(a){const R=B({dispose:Object(ie.a)(()=>{K(R),a()})});return R}class d{constructor(){this._toDispose=new Set,this._isDisposed=!1,B(this)}dispose(){if(this._isDisposed)return;K(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 H(a,this),this._isDisposed?d.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}}d.DISABLE_DISPOSED_WARNING=!1;class o{constructor(){this._store=new d,B(this),H(this._store,this)}dispose(){K(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 l{constructor(){this._isDisposed=!1,B(this)}get value(){return this._isDisposed?void 0:this._value}set value(a){var R;if(this._isDisposed||a===this._value)return;(R=this._value)===null||R===void 0||R.dispose(),a&&H(a,this),this._value=a}clear(){this.value=void 0}dispose(){var a;this._isDisposed=!0,K(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&&H(a,null),a}}class s{constructor(a){this.object=a}dispose(){}}},psGv:function(tt,be,Z){var ie,J;(function(){var P;(function(){"use strict";var K=[,,function(v){function m(h){this.__parent=h,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 h=new m(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},m.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},m.prototype.has_match=function(h){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(h))return!0;return!1},m.prototype.set_indent=function(h,d){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=d||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 h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__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(h){this.__items.push(h);var d=h.lastIndexOf(`
`);d!==-1?this.__character_count=h.length-d:this.__character_count+=h.length},m.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},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 h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function p(h,d){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),d=d||"",h.indent_level>0&&(d=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}p.prototype.get_indent_size=function(h,d){var o=this.__base_string_length;return d=d||0,h<0&&(o=0),o+=h*this.__indent_size,o+=d,o},p.prototype.get_indent_string=function(h,d){var o=this.__base_string;return d=d||0,h<0&&(h=0,o=""),d+=h*this.__indent_size,this.__ensure_cache(d),o+=this.__cache[d],o},p.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var h=this.__cache.length,d=0,o="";this.__indent_size&&h>=this.__indent_size&&(d=Math.floor(h/this.__indent_size),h-=d*this.__indent_size,o=new Array(d+1).join(this.__indent_string)),h&&(o+=new Array(h+1).join(" ")),this.__cache.push(o)};function u(h,d){this.__indent_cache=new p(h,d),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.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()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(h,d){return this.__indent_cache.get_indent_string(h,d)},u.prototype.get_indent_size=function(h,d){return this.__indent_cache.get_indent_size(h,d)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(h){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return h!==`
`&&(o=o.replace(/[\n]/g,h)),o},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(h,d){return h=h||0,d=d||0,this.next_line.set_indent(h,d),this.__lines.length>1?(this.current_line.set_indent(h,d),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(h){for(var d=0;d<h.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},u.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},u.prototype.remove_indent=function(h){for(var d=this.__lines.length;h<d;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(h,d){for(var o=this.__lines.length-2;o>=0;){var l=this.__lines[o];if(l.is_empty())break;if(l.item(0).indexOf(h)!==0&&l.item(-1)!==d){this.__lines.splice(o+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},v.exports.Output=u},function(v){function m(p,u,h,d){this.type=p,this.text=u,this.comments_before=null,this.newlines=h||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}v.exports.Token=m},,,function(v){function m(h,d){this.raw_options=p(h,d),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(h,d){var o=this.raw_options[h],l=d||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(l=o.concat()):typeof o=="string"&&(l=o.split(/[^a-zA-Z0-9_\/\-]+/)),l},m.prototype._get_boolean=function(h,d){var o=this.raw_options[h],l=o===void 0?!!d:!!o;return l},m.prototype._get_characters=function(h,d){var o=this.raw_options[h],l=d||"";return typeof o=="string"&&(l=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),l},m.prototype._get_number=function(h,d){var o=this.raw_options[h];d=parseInt(d,10),isNaN(d)&&(d=0);var l=parseInt(o,10);return isNaN(l)&&(l=d),l},m.prototype._get_selection=function(h,d,o){var l=this._get_selection_list(h,d,o);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
`+d+`
You passed in: '`+this.raw_options[h]+"'");return l[0]},m.prototype._get_selection_list=function(h,d,o){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[d[0]],!this._is_valid_selection(o,d))throw new Error("Invalid Default Value!");var l=this._get_array(h,o);if(!this._is_valid_selection(l,d))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
`+d+`
You passed in: '`+this.raw_options[h]+"'");return l},m.prototype._is_valid_selection=function(h,d){return h.length&&d.length&&!h.some(function(o){return d.indexOf(o)===-1})};function p(h,d){var o={};h=u(h);var l;for(l in h)l!==d&&(o[l]=h[l]);if(d&&h[d])for(l in h[d])o[l]=h[d][l];return o}function u(h){var d={},o;for(o in h){var l=o.replace(/-/g,"_");d[l]=h[o]}return d}v.exports.Options=m,v.exports.normalizeOpts=u,v.exports.mergeOpts=p},,function(v){var m=RegExp.prototype.hasOwnProperty("sticky");function p(u){this.__input=u||"",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 u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},p.prototype.peek=function(u){var h=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(h=this.__input.charAt(u)),h},p.prototype.__match=function(u,h){u.lastIndex=h;var d=u.exec(this.__input);return d&&!(m&&u.sticky)&&(d.index!==h&&(d=null)),d},p.prototype.test=function(u,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(u,h):!1},p.prototype.testChar=function(u,h){var d=this.peek(h);return u.lastIndex=0,d!==null&&u.test(d)},p.prototype.match=function(u){var h=this.__match(u,this.__position);return h?this.__position+=h[0].length:h=null,h},p.prototype.read=function(u,h,d){var o="",l;return u&&(l=this.match(u),l&&(o+=l[0])),h&&(l||!u)&&(o+=this.readUntil(h,d)),o},p.prototype.readUntil=function(u,h){var d="",o=this.__position;u.lastIndex=this.__position;var l=u.exec(this.__input);return l?(o=l.index,h&&(o+=l[0].length)):o=this.__input_length,d=this.__input.substring(this.__position,o),this.__position=o,d},p.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},p.prototype.get_regexp=function(u,h){var d=null,o="g";return h&&m&&(o="y"),typeof u=="string"&&u!==""?d=new RegExp(u,o):u&&(d=new RegExp(u.source,o)),d},p.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(u){var h=this.__position,d=this.readUntilAfter(u);return this.__position=h,d},p.prototype.lookBack=function(u){var h=this.__position-1;return h>=u.length&&this.__input.substring(h-u.length,h).toLowerCase()===u},v.exports.InputScanner=p},function(v,m,p){var u=p(8).InputScanner,h=p(3).Token,d=p(10).TokenStream,o=p(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(a,R){this._input=new u(a),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var a,R=new h(l.START,""),E=null,w=[],D=new d;R.type!==l.EOF;){for(a=this._get_next_token(R,E);this._is_comment(a);)D.add(a),a=this._get_next_token(R,E);D.isEmpty()||(a.comments_before=D,D=new d),a.parent=E,this._is_opening(a)?(w.push(E),E=a):E&&this._is_closing(a,E)&&(a.opened=E,E.closed=a,E=w.pop(),a.parent=E),a.previous=R,R.next=a,this.__tokens.add(a),R=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,R){this._readWhitespace();var E=this._input.read(/.+/g);return E?this._create_token(l.RAW,E):this._create_token(l.EOF,"")},s.prototype._is_comment=function(a){return!1},s.prototype._is_opening=function(a){return!1},s.prototype._is_closing=function(a,R){return!1},s.prototype._create_token=function(a,R){var E=new h(a,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return E},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},v.exports.Tokenizer=s,v.exports.TOKEN=l},function(v){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 u=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(u=this.__tokens[p]),u},m.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},v.exports.TokenStream=m},function(v,m,p){var u=p(12).Pattern;function h(d,o){u.call(this,d,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}h.prototype=new u,h.prototype.__set_whitespace_patterns=function(d,o){d+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},h.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var o=this.__split(this._newline_regexp,d);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return d},h.prototype.matching=function(d,o){var l=this._create();return l.__set_whitespace_patterns(d,o),l._update(),l},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(d,o){d.lastIndex=0;for(var l=0,s=[],a=d.exec(o);a;)s.push(o.substring(l,a.index)),l=a.index+a[0].length,a=d.exec(o);return l<o.length?s.push(o.substring(l,o.length)):s.push(""),s},v.exports.WhitespacePattern=h},function(v){function m(p,u){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,u&&(this._starting_pattern=this._input.get_regexp(u._starting_pattern,!0),this._match_pattern=this._input.get_regexp(u._match_pattern,!0),this._until_pattern=this._input.get_regexp(u._until_pattern),this._until_after=u._until_after)}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 u=this._create();return u._until_after=!0,u._until_pattern=this._input.get_regexp(p),u._update(),u},m.prototype.until=function(p){var u=this._create();return u._until_after=!1,u._until_pattern=this._input.get_regexp(p),u._update(),u},m.prototype.starting_with=function(p){var u=this._create();return u._starting_pattern=this._input.get_regexp(p,!0),u._update(),u},m.prototype.matching=function(p){var u=this._create();return u._match_pattern=this._input.get_regexp(p,!0),u._update(),u},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},v.exports.Pattern=m},function(v){function m(p,u){p=typeof p=="string"?p:p.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+u,"g")}m.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(p);h;)u[h[1]]=h[2],h=this.__directive_pattern.exec(p);return u},m.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},v.exports.Directives=m},function(v,m,p){var u=p(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(o,l){u.call(this,o,l),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),l&&(this.__template_pattern=this._input.get_regexp(l.__template_pattern),this._excluded=Object.assign(this._excluded,l._excluded),this._disabled=Object.assign(this._disabled,l._disabled));var s=new u(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}/)}}d.prototype=new u,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(o){var l=this._create();return l._disabled[o]=!0,l._update(),l},d.prototype.read_options=function(o){var l=this._create();for(var s in h)l._disabled[s]=o.templating.indexOf(s)===-1;return l._update(),l},d.prototype.exclude=function(o){var l=this._create();return l._excluded[o]=!0,l._update(),l},d.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 l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),o+=l,l=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},d.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("|")+")")},d.prototype._read_template=function(){var o="",l=this._input.peek();if(l==="<"){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 l==="{"&&(!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},v.exports.TemplatablePattern=d},,,,function(v,m,p){var u=p(19).Beautifier,h=p(20).Options;function d(o,l,s,a){var R=new u(o,l,s,a);return R.beautify()}v.exports=d,v.exports.defaultOptions=function(){return new h}},function(v,m,p){var u=p(20).Options,h=p(2).Output,d=p(21).Tokenizer,o=p(21).TOKEN,l=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,a=function(S,y){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=S.max_preserve_newlines,this.preserve_newlines=S.preserve_newlines,this._output=new h(S,y)};a.prototype.current_line_has_match=function(S){return this._output.current_line.has_match(S)},a.prototype.set_space_before_token=function(S,y){this._output.space_before_token=S,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(S){this._output.add_raw_token(S)},a.prototype.print_preserved_newlines=function(S){var y=0;S.type!==o.TEXT&&S.previous.type!==o.TEXT&&(y=S.newlines?1:0),this.preserve_newlines&&(y=S.newlines<this.max_preserve_newlines+1?S.newlines:this.max_preserve_newlines+1);for(var b=0;b<y;b++)this.print_newline(b>0);return y!==0},a.prototype.traverse_whitespace=function(S){return S.whitespace_before||S.newlines?(this.print_preserved_newlines(S)||(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(S){this._output.add_new_line(S)},a.prototype.print_token=function(S){S.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(S.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.get_full_indent=function(S){return S=this.indent_level+(S||0),S<1?"":this._output.get_indent_string(S)};var R=function(S){for(var y=null,b=S.next;b.type!==o.EOF&&S.closed!==b;){if(b.type===o.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===o.EQUALS&&b.next.next&&b.next.next.type===o.VALUE&&(y=b.next.next.text);break}b=b.next}return y},E=function(S,y){var b=null,U=null;return y.closed?(S==="script"?b="text/javascript":S==="style"&&(b="text/css"),b=R(y)||b,b.search("text/css")>-1?U="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?U="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?U="html":b.search(/test\/null/)>-1&&(U="null"),U):null};function w(S,y){return y.indexOf(S)!==-1}function D(S,y,b){this.parent=S||null,this.tag=y?y.tag_name:"",this.indent_level=b||0,this.parser_token=y||null}function O(S){this._printer=S,this._current_frame=null}O.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},O.prototype.record_tag=function(S){var y=new D(this._current_frame,S,this._printer.indent_level);this._current_frame=y},O.prototype._try_pop_frame=function(S){var y=null;return S&&(y=S.parser_token,this._printer.indent_level=S.indent_level,this._current_frame=S.parent),y},O.prototype._get_frame=function(S,y){for(var b=this._current_frame;b&&!(S.indexOf(b.tag)!==-1);){if(y&&y.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},O.prototype.try_pop=function(S,y){var b=this._get_frame([S],y);return this._try_pop_frame(b)},O.prototype.indent_to_tag=function(S){var y=this._get_frame(S);y&&(this._printer.indent_level=y.indent_level)};function A(S,y,b,U){this._source_text=S||"",y=y||{},this._js_beautify=b,this._css_beautify=U,this._tag_stack=null;var F=new u(y,"html");this._options=F,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"}A.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var S=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=`
`,S&&l.test(S)&&(y=S.match(l)[0])),S=S.replace(s,`
`);var b=S.match(/^[\t ]*/)[0],U={text:"",type:""},F=new C,_=new a(this._options,b),M=new d(S,this._options).tokenize();this._tag_stack=new O(_);for(var I=null,g=M.next();g.type!==o.EOF;)g.type===o.TAG_OPEN||g.type===o.COMMENT?(I=this._handle_tag_open(_,g,F,U),F=I):g.type===o.ATTRIBUTE||g.type===o.EQUALS||g.type===o.VALUE||g.type===o.TEXT&&!F.tag_complete?I=this._handle_inside_tag(_,g,F,M):g.type===o.TAG_CLOSE?I=this._handle_tag_close(_,g,F):g.type===o.TEXT?I=this._handle_text(_,g,F):_.add_raw_token(g),U=I,g=M.next();var W=_._output.get_code(y);return W},A.prototype._handle_tag_close=function(S,y,b){var U={text:y.text,type:y.type};return S.alignment_size=0,b.tag_complete=!0,S.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted?S.add_raw_token(y):(b.tag_start_char==="<"&&(S.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&S.print_newline(!1)),S.print_token(y)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(S.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&S.set_wrap_point(),U},A.prototype._handle_inside_tag=function(S,y,b,U){var F=b.has_wrapped_attrs,_={text:y.text,type:y.type};if(S.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted)S.add_raw_token(y);else if(b.tag_start_char==="{"&&y.type===o.TEXT)S.print_preserved_newlines(y)?(y.newlines=0,S.add_raw_token(y)):S.print_token(y);else{if(y.type===o.ATTRIBUTE?(S.set_space_before_token(!0),b.attr_count+=1):(y.type===o.EQUALS||y.type===o.VALUE&&y.previous.type===o.EQUALS)&&S.set_space_before_token(!1),y.type===o.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(S.traverse_whitespace(y),F=F||y.newlines!==0),this._is_wrap_attributes_force)){var M=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var I=!0,g=0,W;do{if(W=U.peek(g),W.type===o.ATTRIBUTE){I=!1;break}g+=1}while(g<4&&W.type!==o.EOF&&W.type!==o.TAG_CLOSE);M=!I}M&&(S.print_newline(!1),F=!0)}S.print_token(y),F=F||S.previous_token_wrapped(),b.has_wrapped_attrs=F}return _},A.prototype._handle_text=function(S,y,b){var U={text:y.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(S,y,b):b.is_unformatted||b.is_content_unformatted?S.add_raw_token(y):(S.traverse_whitespace(y),S.print_token(y)),U},A.prototype._print_custom_beatifier_text=function(S,y,b){var U=this;if(y.text!==""){var F=y.text,_,M=1,I="",g="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?_=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?_=this._css_beautify:b.custom_beautifier_name==="html"&&(_=function(ge,xe){var Re=new A(ge,xe,U._js_beautify,U._css_beautify);return Re.beautify()}),this._options.indent_scripts==="keep"?M=0:this._options.indent_scripts==="separate"&&(M=-S.indent_level);var W=S.get_full_indent(M);if(F=F.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var $=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!$){S.add_raw_token(y);return}I=W+$[1]+`
`,F=$[4],$[5]&&(g=W+$[5]),F=F.replace(/\n[ \t]*$/,""),($[2]||$[3].indexOf(`
`)!==-1)&&($=$[3].match(/[ \t]+$/),$&&(y.whitespace_before=$[0]))}if(F)if(_){var ne=function(){this.eol=`
`};ne.prototype=this._options.raw_options;var oe=new ne;F=_(W+F,oe)}else{var we=y.whitespace_before;we&&(F=F.replace(new RegExp(`
(`+we+")?","g"),`
`)),F=W+F.replace(/\n/g,`
`+W)}I&&(F?F=I+F+`
`+g:F=I+g),S.print_newline(!1),F&&(y.text=F,y.whitespace_before="",y.newlines=0,S.add_raw_token(y),S.print_newline(!0))}},A.prototype._handle_tag_open=function(S,y,b,U){var F=this._get_tag_open_token(y);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&y.type===o.TAG_OPEN&&y.text.indexOf("</")===0?(S.add_raw_token(y),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(S.traverse_whitespace(y),this._set_tag_position(S,y,F,b,U),F.is_inline_element||S.set_wrap_point(),S.print_token(y)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(F.alignment_size=y.text.length+1),!F.tag_complete&&!F.is_unformatted&&(S.alignment_size=F.alignment_size),F};var C=function(S,y){if(this.parent=S||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 b;this.tag_start_char=y.text[0],this.text=y.text,this.tag_start_char==="<"?(b=y.text.match(/^<([^\s>]*)/),this.tag_check=b?b[1]:""):(b=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[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 U=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(U=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(U)))}};A.prototype._get_tag_open_token=function(S){var y=new C(this._tag_stack.get_parser_token(),S);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||w(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&&w(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&w(y.tag_check,this._options.content_unformatted),y.is_inline_element=w(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},A.prototype._set_tag_position=function(S,y,b,U,F){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||S.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=E(b.tag_check,y)))),w(b.tag_check,this._options.extra_liners)&&(S.print_newline(!1),S._output.just_added_blankline()||S.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var _=S.current_line_has_match(/{{#if/);_||S.print_newline(!1)}b.tag_name==="!--"&&F.type===o.TAG_CLOSE&&U.is_end_tag&&b.text.indexOf(`
`)===-1||(b.is_inline_element||b.is_unformatted||S.print_newline(!1),this._calcluate_parent_multiline(S,b))}else if(b.is_end_tag){var M=!1;M=b.start_tag_token&&b.start_tag_token.multiline_content,M=M||!b.is_inline_element&&!(U.is_inline_element||U.is_unformatted)&&!(F.type===o.TAG_CLOSE&&b.start_tag_token===U)&&F.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(M=!1),M&&S.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(F.type!=="TK_CONTENT"||b.is_content_unformatted)&&S.print_newline(!1),this._calcluate_parent_multiline(S,b)},A.prototype._calcluate_parent_multiline=function(S,y){y.parent&&S._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var T=["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"],f=["a","audio","del","ins","map","noscript","video"];A.prototype._do_optional_end_element=function(S){var y=null;if(S.is_empty_element||!S.is_start_tag||!S.parent)return;if(S.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(S.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(S.tag_name==="dd"||S.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(S.parent.tag_name==="p"&&T.indexOf(S.tag_name)!==-1){var b=S.parent.parent;(!b||f.indexOf(b.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else S.tag_name==="rp"||S.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):S.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):S.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):S.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):S.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):S.tag_name==="tbody"||S.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"])):S.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"])):(S.tag_name==="th"||S.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 S.parent=this._tag_stack.get_parser_token(),y},v.exports.Beautifier=A},function(v,m,p){var u=p(6).Options;function h(d){u.call(this,d,"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"])}h.prototype=new u,v.exports.Options=h},function(v,m,p){var u=p(9).Tokenizer,h=p(9).TOKEN,d=p(13).Directives,o=p(14).TemplatablePattern,l=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:h.START,RAW:h.RAW,EOF:h.EOF},a=new d(/<\!--/,/-->/),R=function(E,w){u.call(this,E,w),this._current_tag_name="";var D=new o(this._input).read_options(this._options),O=new l(this._input);if(this.__patterns={word:D.until(/[\n\r\t <]/),single_quote:D.until_after(/'/),double_quote:D.until_after(/"/),attribute:D.until(/[\n\r\t =>]|\/>/),element_name:D.until(/[\n\r\t >\/]/),handlebars_comment:O.starting_with(/{{!--/).until_after(/--}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),handlebars_open:O.until(/[\n\r\t }]/),handlebars_raw_close:O.until(/}}/),comment:O.starting_with(/<!--/).until_after(/-->/),cdata:O.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:O.starting_with(/<!\[/).until_after(/]>/),processing:O.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 A=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(A).until_after(A)}};R.prototype=new u,R.prototype._is_comment=function(E){return!1},R.prototype._is_opening=function(E){return E.type===s.TAG_OPEN},R.prototype._is_closing=function(E,w){return E.type===s.TAG_CLOSE&&w&&((E.text===">"||E.text==="/>")&&w.text[0]==="<"||E.text==="}}"&&w.text[0]==="{"&&w.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(E,w){var D=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(s.EOF,""):(D=D||this._read_open_handlebars(O,w),D=D||this._read_attribute(O,E,w),D=D||this._read_close(O,w),D=D||this._read_raw_content(O,E,w),D=D||this._read_content_word(O),D=D||this._read_comment_or_cdata(O),D=D||this._read_processing(O),D=D||this._read_open(O,w),D=D||this._create_token(s.UNKNOWN,this._input.next()),D)},R.prototype._read_comment_or_cdata=function(E){var w=null,D=null,O=null;if(E==="<"){var A=this._input.peek(1);A==="!"&&(D=this.__patterns.comment.read(),D?(O=a.get_directives(D),O&&O.ignore==="start"&&(D+=a.readIgnored(this._input))):D=this.__patterns.cdata.read()),D&&(w=this._create_token(s.COMMENT,D),w.directives=O)}return w},R.prototype._read_processing=function(E){var w=null,D=null,O=null;if(E==="<"){var A=this._input.peek(1);(A==="!"||A==="?")&&(D=this.__patterns.conditional_comment.read(),D=D||this.__patterns.processing.read()),D&&(w=this._create_token(s.COMMENT,D),w.directives=O)}return w},R.prototype._read_open=function(E,w){var D=null,O=null;return w||E==="<"&&(D=this._input.next(),this._input.peek()==="/"&&(D+=this._input.next()),D+=this.__patterns.element_name.read(),O=this._create_token(s.TAG_OPEN,D)),O},R.prototype._read_open_handlebars=function(E,w){var D=null,O=null;return w||this._options.indent_handlebars&&E==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(D=this.__patterns.handlebars_comment.read(),D=D||this.__patterns.handlebars.read(),O=this._create_token(s.COMMENT,D)):(D=this.__patterns.handlebars_open.read(),O=this._create_token(s.TAG_OPEN,D))),O},R.prototype._read_close=function(E,w){var D=null,O=null;return w&&(w.text[0]==="<"&&(E===">"||E==="/"&&this._input.peek(1)===">")?(D=this._input.next(),E==="/"&&(D+=this._input.next()),O=this._create_token(s.TAG_CLOSE,D)):w.text[0]==="{"&&E==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(s.TAG_CLOSE,"}}"))),O},R.prototype._read_attribute=function(E,w,D){var O=null,A="";if(D&&D.text[0]==="<")if(E==="=")O=this._create_token(s.EQUALS,this._input.next());else if(E==='"'||E==="'"){var C=this._input.next();E==='"'?C+=this.__patterns.double_quote.read():C+=this.__patterns.single_quote.read(),O=this._create_token(s.VALUE,C)}else A=this.__patterns.attribute.read(),A&&(w.type===s.EQUALS?O=this._create_token(s.VALUE,A):O=this._create_token(s.ATTRIBUTE,A));return O},R.prototype._is_content_unformatted=function(E){return this._options.void_elements.indexOf(E)===-1&&(this._options.content_unformatted.indexOf(E)!==-1||this._options.unformatted.indexOf(E)!==-1)},R.prototype._read_raw_content=function(E,w,D){var O="";if(D&&D.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(w.type===s.TAG_CLOSE&&w.opened.text[0]==="<"&&w.text[0]!=="/"){var A=w.opened.text.substr(1).toLowerCase();if(A==="script"||A==="style"){var C=this._read_comment_or_cdata(E);if(C)return C.type=s.TEXT,C;O=this._input.readUntil(new RegExp("</"+A+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(A)&&(O=this._input.readUntil(new RegExp("</"+A+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(s.TEXT,O):null},R.prototype._read_content_word=function(E){var w="";if(this._options.unformatted_content_delimiter&&(E===this._options.unformatted_content_delimiter[0]&&(w=this.__patterns.unformatted_content_delimiter.read())),w||(w=this.__patterns.word.read()),w)return this._create_token(s.TEXT,w)},v.exports.Tokenizer=R,v.exports.TOKEN=s}],H={};function r(v){var m=H[v];if(m!==void 0)return m.exports;var p=H[v]={exports:{}};return K[v](p,p.exports,r),p.exports}var L=r(18);P=L})();var X=P;if(!0)!(ie=[Z,Z("6UM0"),Z("TXwP")],J=function(K){var H=Z("6UM0"),r=Z("TXwP");return{html_beautify:function(L,v){return X(L,v,H.js_beautify,r.css_beautify)}}}.apply(be,ie),J!==void 0&&(tt.exports=J));else var j,B})()},"rAM+":function(tt,be,Z){"use strict";Z.d(be,"a",function(){return J});var ie=Z("Qw5x");function J(P,X){var j;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(j=Object(ie.a)(P))||X&&P&&typeof P.length=="number"){j&&(P=j);var B=0,K=function(){};return{s:K,n:function(){return B>=P.length?{done:!0}:{done:!1,value:P[B++]}},e:function(m){throw m},f:K}}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 H=!0,r=!1,L;return{s:function(){j=P[Symbol.iterator]()},n:function(){var m=j.next();return H=m.done,m},e:function(m){r=!0,L=m},f:function(){try{!H&&j.return!=null&&j.return()}finally{if(r)throw L}}}}},rUJ1:function(tt,be){const Z=/[&<>"']/,ie=/[&<>"']/g,J=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,X={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},j=O=>X[O];function B(O,A){if(A){if(Z.test(O))return O.replace(ie,j)}else if(J.test(O))return O.replace(P,j);return O}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function H(O){return O.replace(K,(A,C)=>(C=C.toLowerCase(),C==="colon"?":":C.charAt(0)==="#"?C.charAt(1)==="x"?String.fromCharCode(parseInt(C.substring(2),16)):String.fromCharCode(+C.substring(1)):""))}const r=/(^|[^\[])\^/g;function L(O,A){O=O.source||O,A=A||"";const C={replace:(T,f)=>(f=f.source||f,f=f.replace(r,"$1"),O=O.replace(T,f),C),getRegex:()=>new RegExp(O,A)};return C}const v=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(O,A,C){if(O){let T;try{T=decodeURIComponent(H(C)).replace(v,"").toLowerCase()}catch(f){return null}if(T.indexOf("javascript:")===0||T.indexOf("vbscript:")===0||T.indexOf("data:")===0)return null}A&&!m.test(C)&&(C=l(A,C));try{C=encodeURI(C).replace(/%25/g,"%")}catch(T){return null}return C}const u={},h=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(O,A){u[" "+O]||(h.test(O)?u[" "+O]=O+"/":u[" "+O]=E(O,"/",!0)),O=u[" "+O];const C=O.indexOf(":")===-1;return A.substring(0,2)==="//"?C?A:O.replace(d,"$1")+A:A.charAt(0)==="/"?C?A:O.replace(o,"$1")+A:O+A}const s={exec:function(){}};function a(O){let A=1,C,T;for(;A<arguments.length;A++){C=arguments[A];for(T in C)Object.prototype.hasOwnProperty.call(C,T)&&(O[T]=C[T])}return O}function R(O,A){const C=O.replace(/\|/g,(S,y,b)=>{let U=!1,F=y;for(;--F>=0&&b[F]==="\\";)U=!U;return U?"|":" |"}),T=C.split(/ \|/);let f=0;if(T.length>A)T.splice(A);else for(;T.length<A;)T.push("");for(;f<T.length;f++)T[f]=T[f].trim().replace(/\\\|/g,"|");return T}function E(O,A,C){const T=O.length;if(T===0)return"";let f=0;for(;f<T;){const S=O.charAt(T-f-1);if(S===A&&!C)f++;else if(S!==A&&C)f++;else break}return O.substr(0,T-f)}function w(O,A){if(O.indexOf(A[1])===-1)return-1;const C=O.length;let T=0,f=0;for(;f<C;f++)if(O[f]==="\\")f++;else if(O[f]===A[0])T++;else if(O[f]===A[1]&&(T--,T<0))return f;return-1}function D(O){O&&O.sanitize&&!O.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")}tt.exports={escape:B,unescape:H,edit:L,cleanUrl:p,resolveUrl:l,noopTest:s,merge:a,splitCells:R,rtrim:E,findClosingBracket:w,checkSanitizeDeprecation:D}},t9D7:function(tt,be,Z){"use strict";Z.d(be,"b",function(){return K}),Z.d(be,"g",function(){return r}),Z.d(be,"d",function(){return L}),Z.d(be,"e",function(){return v}),Z.d(be,"a",function(){return m}),Z.d(be,"f",function(){return h}),Z.d(be,"c",function(){return d});var ie=Z("Vhoy"),J=Z("MI8n"),P=Z("pmY6"),X=Z("Cg/j"),j=Z("ic2d"),B=Z("nEHx");const K=Object(X.c)("themeService");var H;(function(o){function l(s){return s&&typeof s=="object"&&typeof s.id=="string"}o.isThemeColor=l})(H||(H={}));function r(o){return{id:o}}var L;(function(o){function l(D){return D&&typeof D=="object"&&typeof D.id=="string"&&(typeof D.color=="undefined"||H.isThemeColor(D.color))}o.isThemeIcon=l;const s=new RegExp(`^\\$\\((${ie.a.iconNameExpression}(?:${ie.a.iconModifierExpression})?)\\)$`);function a(D){const O=s.exec(D);if(!O)return;let[,A]=O;return{id:A}}o.fromString=a;function R(D,O){let A=D.id;const C=A.lastIndexOf("~");return C!==-1&&(A=A.substring(0,C)),O&&(A=`${A}~${O}`),{id:A}}o.modify=R;function E(D,O){var A,C;return D.id===O.id&&((A=D.color)===null||A===void 0?void 0:A.id)===((C=O.color)===null||C===void 0?void 0:C.id)}o.isEqual=E;function w(D,O){return{id:D.id,color:O?r(O):void 0}}o.asThemeIcon=w,o.asClassNameArray=ie.a.asClassNameArray,o.asClassName=ie.a.asClassName,o.asCSSSelector=ie.a.asCSSSelector})(L||(L={}));function v(o){switch(o){case B.a.DARK:return"vs-dark";case B.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 J.b}onColorThemeChange(o){return this.themingParticipants.push(o),this.onThemingParticipantAddedEmitter.fire(o),Object(P.i)(()=>{const l=this.themingParticipants.indexOf(o);this.themingParticipants.splice(l,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new p;j.a.add(m.ThemingContribution,u);function h(o){return u.onColorThemeChange(o)}class d extends P.a{constructor(o){super();this.themeService=o,this.theme=o.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(l=>this.onThemeChange(l)))}onThemeChange(o){this.theme=o,this.updateStyles()}updateStyles(){}}},ulZh:function(tt,be,Z){typeof window!="undefined"&&function(J,P){tt.exports=P()}(this,function(){return function(ie){var J={};function P(X){if(J[X])return J[X].exports;var j=J[X]={i:X,l:!1,exports:{}};return ie[X].call(j.exports,j,j.exports,P),j.l=!0,j.exports}return P.m=ie,P.c=J,P.d=function(X,j,B){P.o(X,j)||Object.defineProperty(X,j,{enumerable:!0,get:B})},P.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},P.t=function(X,j){if(j&1&&(X=P(X)),j&8)return X;if(j&4&&typeof X=="object"&&X&&X.__esModule)return X;var B=Object.create(null);if(P.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:X}),j&2&&typeof X!="string")for(var K in X)P.d(B,K,function(H){return X[H]}.bind(null,K));return B},P.n=function(X){var j=X&&X.__esModule?function(){return X.default}:function(){return X};return P.d(j,"a",j),j},P.o=function(X,j){return Object.prototype.hasOwnProperty.call(X,j)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ie,J,P){"use strict";var X=Object.prototype.hasOwnProperty,j="~";function B(){}Object.create&&(B.prototype=Object.create(null),new B().__proto__||(j=!1));function K(v,m,p){this.fn=v,this.context=m,this.once=p||!1}function H(v,m,p,u,h){if(typeof p!="function")throw new TypeError("The listener must be a function");var d=new K(p,u||v,h),o=j?j+m:m;return v._events[o]?v._events[o].fn?v._events[o]=[v._events[o],d]:v._events[o].push(d):(v._events[o]=d,v._eventsCount++),v}function r(v,m){--v._eventsCount===0?v._events=new B:delete v._events[m]}function L(){this._events=new B,this._eventsCount=0}L.prototype.eventNames=function(){var m=[],p,u;if(this._eventsCount===0)return m;for(u in p=this._events)X.call(p,u)&&m.push(j?u.slice(1):u);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(p)):m},L.prototype.listeners=function(m){var p=j?j+m:m,u=this._events[p];if(!u)return[];if(u.fn)return[u.fn];for(var h=0,d=u.length,o=new Array(d);h<d;h++)o[h]=u[h].fn;return o},L.prototype.listenerCount=function(m){var p=j?j+m:m,u=this._events[p];return u?u.fn?1:u.length:0},L.prototype.emit=function(m,p,u,h,d,o){var l=j?j+m:m;if(!this._events[l])return!1;var s=this._events[l],a=arguments.length,R,E;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,u),!0;case 4:return s.fn.call(s.context,p,u,h),!0;case 5:return s.fn.call(s.context,p,u,h,d),!0;case 6:return s.fn.call(s.context,p,u,h,d,o),!0}for(E=1,R=new Array(a-1);E<a;E++)R[E-1]=arguments[E];s.fn.apply(s.context,R)}else{var w=s.length,D;for(E=0;E<w;E++){s[E].once&&this.removeListener(m,s[E].fn,void 0,!0);switch(a){case 1:s[E].fn.call(s[E].context);break;case 2:s[E].fn.call(s[E].context,p);break;case 3:s[E].fn.call(s[E].context,p,u);break;case 4:s[E].fn.call(s[E].context,p,u,h);break;default:if(!R)for(D=1,R=new Array(a-1);D<a;D++)R[D-1]=arguments[D];s[E].fn.apply(s[E].context,R)}}}return!0},L.prototype.on=function(m,p,u){return H(this,m,p,u,!1)},L.prototype.once=function(m,p,u){return H(this,m,p,u,!0)},L.prototype.removeListener=function(m,p,u,h){var d=j?j+m:m;if(!this._events[d])return this;if(!p)return r(this,d),this;var o=this._events[d];if(o.fn)o.fn===p&&(!h||o.once)&&(!u||o.context===u)&&r(this,d);else{for(var l=0,s=[],a=o.length;l<a;l++)(o[l].fn!==p||h&&!o[l].once||u&&o[l].context!==u)&&s.push(o[l]);s.length?this._events[d]=s.length===1?s[0]:s:r(this,d)}return this},L.prototype.removeAllListeners=function(m){var p;return m?(p=j?j+m:m,this._events[p]&&r(this,p)):(this._events=new B,this._eventsCount=0),this},L.prototype.off=L.prototype.removeListener,L.prototype.addListener=L.prototype.on,L.prefixed=j,L.EventEmitter=L,ie.exports=L},"./node_modules/url-toolkit/src/url-toolkit.js":function(ie,J,P){(function(X){var j=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,B=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,H=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(L,v,m){if(m=m||{},L=L.trim(),v=v.trim(),!v){if(!m.alwaysNormalize)return L;var p=r.parseURL(L);if(!p)throw new Error("Error trying to parse base URL.");return p.path=r.normalizePath(p.path),r.buildURLFromParts(p)}var u=r.parseURL(v);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return m.alwaysNormalize?(u.path=r.normalizePath(u.path),r.buildURLFromParts(u)):v;var h=r.parseURL(L);if(!h)throw new Error("Error trying to parse base URL.");if(!h.netLoc&&h.path&&h.path[0]!=="/"){var d=B.exec(h.path);h.netLoc=d[1],h.path=d[2]}h.netLoc&&!h.path&&(h.path="/");var o={scheme:h.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(o.netLoc=h.netLoc,u.path[0]!=="/"))if(!u.path)o.path=h.path,u.params||(o.params=h.params,u.query||(o.query=h.query));else{var l=h.path,s=l.substring(0,l.lastIndexOf("/")+1)+u.path;o.path=r.normalizePath(s)}return o.path===null&&(o.path=m.alwaysNormalize?r.normalizePath(u.path):u.path),r.buildURLFromParts(o)},parseURL:function(L){var v=j.exec(L);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(L){for(L=L.split("").reverse().join("").replace(K,"");L.length!==(L=L.replace(H,"")).length;);return L.split("").reverse().join("")},buildURLFromParts:function(L){return L.scheme+L.netLoc+L.path+L.params+L.query+L.fragment}};ie.exports=r})(this)},"./node_modules/webworkify-webpack/index.js":function(ie,J,P){function X(m){var p={};function u(d){if(p[d])return p[d].exports;var o=p[d]={i:d,l:!1,exports:{}};return m[d].call(o.exports,o,o.exports,u),o.l=!0,o.exports}u.m=m,u.c=p,u.i=function(d){return d},u.d=function(d,o,l){u.o(d,o)||Object.defineProperty(d,o,{configurable:!1,enumerable:!0,get:l})},u.r=function(d){Object.defineProperty(d,"__esModule",{value:!0})},u.n=function(d){var o=d&&d.__esModule?function(){return d.default}:function(){return d};return u.d(o,"a",o),o},u.o=function(d,o){return Object.prototype.hasOwnProperty.call(d,o)},u.p="/",u.oe=function(d){throw console.error(d),d};var h=u(u.s=ENTRY_MODULE);return h.default||h}var j="[\\.|\\-|\\+|\\w|/|@]+",B="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+j+").*?\\)";function K(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function H(m){return!isNaN(1*m)}function r(m,p,u){var h={};h[u]=[];var d=p.toString(),o=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return h;for(var l=o[1],s=new RegExp("(\\\\n|\\W)"+K(l)+B,"g"),a;a=s.exec(d);){if(a[3]==="dll-reference")continue;h[u].push(a[3])}for(s=new RegExp("\\("+K(l)+'\\("(dll-reference\\s('+j+'))"\\)\\)'+B,"g");a=s.exec(d);)m[a[2]]||(h[u].push(a[1]),m[a[2]]=P(a[1]).m),h[a[2]]=h[a[2]]||[],h[a[2]].push(a[4]);for(var R=Object.keys(h),E=0;E<R.length;E++)for(var w=0;w<h[R[E]].length;w++)H(h[R[E]][w])&&(h[R[E]][w]=1*h[R[E]][w]);return h}function L(m){var p=Object.keys(m);return p.reduce(function(u,h){return u||m[h].length>0},!1)}function v(m,p){for(var u={main:[p]},h={main:[]},d={main:{}};L(u);)for(var o=Object.keys(u),l=0;l<o.length;l++){var s=o[l],a=u[s],R=a.pop();if(d[s]=d[s]||{},d[s][R]||!m[s][R])continue;d[s][R]=!0,h[s]=h[s]||[],h[s].push(R);for(var E=r(m,m[s][R],s),w=Object.keys(E),D=0;D<w.length;D++)u[w[D]]=u[w[D]]||[],u[w[D]]=u[w[D]].concat(E[w[D]])}return h}ie.exports=function(m,p){p=p||{};var u={main:P.m},h=p.all?{main:Object.keys(u.main)}:v(u,m),d="";Object.keys(h).filter(function(R){return R!=="main"}).forEach(function(R){for(var E=0;h[R][E];)E++;h[R].push(E),u[R][E]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",d=d+"var "+R+" = ("+X.toString().replace("ENTRY_MODULE",JSON.stringify(E))+")({"+h[R].map(function(w){return""+JSON.stringify(w)+": "+u[R][w].toString()}).join(",")+`});
`}),d=d+"new (("+X.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+h.main.map(function(R){return""+JSON.stringify(R)+": "+u.main[R].toString()}).join(",")+"}))(self);";var o=new window.Blob([d],{type:"text/javascript"});if(p.bare)return o;var l=window.URL||window.webkitURL||window.mozURL||window.msURL,s=l.createObjectURL(o),a=new window.Worker(s);return a.objectURL=s,a}},"./src/config.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"hlsDefaultConfig",function(){return D}),P.d(J,"mergeConfig",function(){return A}),P.d(J,"enableStreamingMode",function(){return C});var X=P("./src/controller/abr-controller.ts"),j=P("./src/controller/audio-stream-controller.ts"),B=P("./src/controller/audio-track-controller.ts"),K=P("./src/controller/subtitle-stream-controller.ts"),H=P("./src/controller/subtitle-track-controller.ts"),r=P("./src/controller/buffer-controller.ts"),L=P("./src/controller/timeline-controller.ts"),v=P("./src/controller/cap-level-controller.ts"),m=P("./src/controller/fps-controller.ts"),p=P("./src/controller/eme-controller.ts"),u=P("./src/controller/cmcd-controller.ts"),h=P("./src/utils/xhr-loader.ts"),d=P("./src/utils/fetch-loader.ts"),o=P("./src/utils/cues.ts"),l=P("./src/utils/mediakeys-helper.ts"),s=P("./src/utils/logger.ts");function a(){return a=Object.assign||function(T){for(var f=1;f<arguments.length;f++){var S=arguments[f];for(var y in S)Object.prototype.hasOwnProperty.call(S,y)&&(T[y]=S[y])}return T},a.apply(this,arguments)}function R(T,f){var S=Object.keys(T);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(T);f&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(T,b).enumerable})),S.push.apply(S,y)}return S}function E(T){for(var f=1;f<arguments.length;f++){var S=arguments[f]!=null?arguments[f]:{};f%2?R(Object(S),!0).forEach(function(y){w(T,y,S[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(S)):R(Object(S)).forEach(function(y){Object.defineProperty(T,y,Object.getOwnPropertyDescriptor(S,y))})}return T}function w(T,f,S){return f in T?Object.defineProperty(T,f,{value:S,enumerable:!0,configurable:!0,writable:!0}):T[f]=S,T}var D=E(E({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:h.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:X.default,bufferController:r.default,capLevelController:v.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:l.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:H.default,timelineController:L.TimelineController,audioStreamController:j.default,audioTrackController:B.default,emeController:p.default,cmcdController:u.default});function O(){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 A(T,f){if((f.liveSyncDurationCount||f.liveMaxLatencyDurationCount)&&(f.liveSyncDuration||f.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(f.liveMaxLatencyDurationCount!==void 0&&(f.liveSyncDurationCount===void 0||f.liveMaxLatencyDurationCount<=f.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(f.liveMaxLatencyDuration!==void 0&&(f.liveSyncDuration===void 0||f.liveMaxLatencyDuration<=f.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return a({},T,f)}function C(T){var f=T.loader;if(f!==d.default&&f!==h.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),T.progressive=!1;else{var S=Object(d.fetchSupported)();S&&(T.loader=d.default,T.progressive=!0,T.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/polyfills/number.ts"),j=P("./src/utils/ewma-bandwidth-estimator.ts"),B=P("./src/events.ts"),K=P("./src/utils/buffer-helper.ts"),H=P("./src/errors.ts"),r=P("./src/types/loader.ts"),L=P("./src/utils/logger.ts");function v(u,h){for(var d=0;d<h.length;d++){var o=h[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,o.key,o)}}function m(u,h,d){return h&&v(u.prototype,h),d&&v(u,d),u}var p=function(){function u(d){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=d;var o=d.config;this.bwEstimator=new j.default(o.abrEwmaSlowVoD,o.abrEwmaFastVoD,o.abrEwmaDefaultEstimate),this.registerListeners()}var h=u.prototype;return h.registerListeners=function(){var o=this.hls;o.on(B.Events.FRAG_LOADING,this.onFragLoading,this),o.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(B.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var o=this.hls;o.off(B.Events.FRAG_LOADING,this.onFragLoading,this),o.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(B.Events.ERROR,this.onError,this)},h.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},h.onFragLoading=function(o,l){var s=l.frag;if(s.type===r.PlaylistLevelType.MAIN&&!this.timer){var a;this.fragCurrent=s,this.partCurrent=(a=l.part)!=null?a:null,this.timer=self.setInterval(this.onCheck,100)}},h.onLevelLoaded=function(o,l){var s=this.hls.config;l.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},h._abandonRulesCheck=function(){var o=this.fragCurrent,l=this.partCurrent,s=this.hls,a=s.autoLevelEnabled,R=s.config,E=s.media;if(!o||!E)return;var w=l?l.stats:o.stats,D=l?l.duration:o.duration;if(w.aborted){L.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!a||E.paused||!E.playbackRate||!E.readyState)return;var O=performance.now()-w.loading.start,A=Math.abs(E.playbackRate);if(O<=500*D/A)return;var C=s.levels,T=s.minAutoLevel,f=C[o.level],S=w.total||Math.max(w.loaded,Math.round(D*f.maxBitrate/8)),y=Math.max(1,w.bwEstimate?w.bwEstimate/8:w.loaded*1e3/O),b=(S-w.loaded)/y,U=E.currentTime,F=(K.BufferHelper.bufferInfo(E,U,R.maxBufferHole).end-U)/A;if(F>=2*D/A||b<=F)return;var _=Number.POSITIVE_INFINITY,M;for(M=o.level-1;M>T;M--){var I=C[M].maxBitrate;if(_=D*I/(8*.8*y),_<F)break}if(_>=b)return;var g=this.bwEstimator.getEstimate();L.logger.warn("Fragment "+o.sn+(l?" part "+l.index:"")+" of level "+o.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+M+`
Current BW estimate: `+(Object(X.isFiniteNumber)(g)?(g/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+b.toFixed(3)+` s
Estimated load time for the next fragment: `+_.toFixed(3)+` s
Time to underbuffer: `+F.toFixed(3)+" s"),s.nextLoadLevel=M,this.bwEstimator.sample(O,w.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),s.trigger(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:l,stats:w})},h.onFragLoaded=function(o,l){var s=l.frag,a=l.part;if(s.type===r.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(s.sn)){var R=a?a.stats:s.stats,E=a?a.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var w=this.hls.levels[s.level],D=(w.loaded?w.loaded.bytes:0)+R.loaded,O=(w.loaded?w.loaded.duration:0)+E;w.loaded={bytes:D,duration:O},w.realBitrate=Math.round(8*D/O)}if(s.bitrateTest){var A={stats:R,frag:s,part:a,id:s.type};this.onFragBuffered(B.Events.FRAG_BUFFERED,A),s.bitrateTest=!1}}},h.onFragBuffered=function(o,l){var s=l.frag,a=l.part,R=a?a.stats:s.stats;if(R.aborted)return;if(s.type!==r.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var E=R.parsing.end-R.loading.start;this.bwEstimator.sample(E,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=E/1e3:this.bitrateTestDelay=0},h.onError=function(o,l){switch(l.details){case H.ErrorDetails.FRAG_LOAD_ERROR:case H.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},h.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},h.getNextABRAutoLevel=function(){var o=this.fragCurrent,l=this.partCurrent,s=this.hls,a=s.maxAutoLevel,R=s.config,E=s.minAutoLevel,w=s.media,D=l?l.duration:o?o.duration:0,O=w?w.currentTime:0,A=w&&w.playbackRate!==0?Math.abs(w.playbackRate):1,C=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,T=(K.BufferHelper.bufferInfo(w,O,R.maxBufferHole).end-O)/A,f=this.findBestLevel(C,E,a,T,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(f>=0)return f;L.logger.trace((T?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var S=D?Math.min(D,R.maxStarvationDelay):R.maxStarvationDelay,y=R.abrBandWidthFactor,b=R.abrBandWidthUpFactor;if(!T){var U=this.bitrateTestDelay;if(U){var F=D?Math.min(D,R.maxLoadingDelay):R.maxLoadingDelay;S=F-U,L.logger.trace("bitrate test took "+Math.round(1e3*U)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*S)+" ms"),y=b=1}}return f=this.findBestLevel(C,E,a,T+S,y,b),Math.max(f,0)},h.findBestLevel=function(o,l,s,a,R,E){for(var w,D=this.fragCurrent,O=this.partCurrent,A=this.lastLoadedFragLevel,C=this.hls.levels,T=C[A],f=!!(T!=null&&(w=T.details)!==null&&w!==void 0&&w.live),S=T==null?void 0:T.codecSet,y=O?O.duration:D?D.duration:0,b=s;b>=l;b--){var U=C[b];if(!U||S&&U.codecSet!==S)continue;var F=U.details,_=(O?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||y,M=void 0;b<=A?M=R*o:M=E*o;var I=C[b].maxBitrate,g=I*_/M;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(M)+"/"+I+"/"+_+"/"+a+"/"+g),M>I&&(!g||f&&!this.bitrateTestDelay||g<a))return b}return-1},m(u,[{key:"nextAutoLevel",get:function(){var o=this._nextAutoLevel,l=this.bwEstimator;if(o!==-1&&(!l||!l.canEstimate()))return o;var s=this.getNextABRAutoLevel();return o!==-1&&(s=Math.min(o,s)),s},set:function(o){this._nextAutoLevel=o}}]),u}();J.default=p},"./src/controller/audio-stream-controller.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/polyfills/number.ts"),j=P("./src/controller/base-stream-controller.ts"),B=P("./src/events.ts"),K=P("./src/utils/buffer-helper.ts"),H=P("./src/controller/fragment-tracker.ts"),r=P("./src/types/level.ts"),L=P("./src/types/loader.ts"),v=P("./src/loader/fragment.ts"),m=P("./src/demux/chunk-cache.ts"),p=P("./src/demux/transmuxer-interface.ts"),u=P("./src/types/transmuxer.ts"),h=P("./src/controller/fragment-finders.ts"),d=P("./src/utils/discontinuities.ts"),o=P("./src/errors.ts"),l=P("./src/utils/logger.ts");function s(){return s=Object.assign||function(D){for(var O=1;O<arguments.length;O++){var A=arguments[O];for(var C in A)Object.prototype.hasOwnProperty.call(A,C)&&(D[C]=A[C])}return D},s.apply(this,arguments)}function a(D,O){D.prototype=Object.create(O.prototype),D.prototype.constructor=D,R(D,O)}function R(D,O){return R=Object.setPrototypeOf||function(C,T){return C.__proto__=T,C},R(D,O)}var E=100,w=function(D){a(O,D);function O(C,T){var f;return f=D.call(this,C,T,"[audio-stream-controller]")||this,f.videoBuffer=null,f.videoTrackCC=-1,f.waitingVideoCC=-1,f.audioSwitch=!1,f.trackId=-1,f.waitingData=null,f.mainDetails=null,f.bufferFlushed=!1,f._registerListeners(),f}var A=O.prototype;return A.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},A._registerListeners=function(){var T=this.hls;T.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(B.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),T.on(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.on(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),T.on(B.Events.ERROR,this.onError,this),T.on(B.Events.BUFFER_RESET,this.onBufferReset,this),T.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this),T.on(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.on(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),T.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var T=this.hls;T.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(B.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),T.off(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.off(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),T.off(B.Events.ERROR,this.onError,this),T.off(B.Events.BUFFER_RESET,this.onBufferReset,this),T.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),T.off(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.off(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),T.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onInitPtsFound=function(T,f){var S=f.frag,y=f.id,b=f.initPTS;if(y==="main"){var U=S.cc;this.initPTS[S.cc]=b,this.log("InitPTS for cc: "+U+" found from main: "+b),this.videoTrackCC=U,this.state===j.State.WAITING_INIT_PTS&&this.tick()}},A.startLoad=function(T){if(!this.levels){this.startPosition=T,this.state=j.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(E),this.fragLoadError=0,f>0&&T===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),this.state=j.State.IDLE):(this.loadedmetadata=!1,this.state=j.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=T,this.tick()},A.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_TRACK:{var T,f=this.levels,S=this.trackId,y=f==null||((T=f[S])===null||T===void 0)?void 0:T.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=j.State.WAITING_INIT_PTS}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var b,U=performance.now(),F=this.retryDate;(!F||U>=F||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=j.State.IDLE);break}case j.State.WAITING_INIT_PTS:{var _=this.waitingData;if(_){var M=_.frag,I=_.part,g=_.cache,W=_.complete;if(this.initPTS[M.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.FRAG_LOADING;var $=g.flush(),ne={frag:M,part:I,payload:$,networkDetails:null};this._handleFragmentLoadProgress(ne),W&&D.prototype._handleFragmentLoadComplete.call(this,ne)}else if(this.videoTrackCC!==this.waitingVideoCC)l.logger.log("Waiting fragment cc ("+M.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var oe=this.getLoadPosition(),we=K.BufferHelper.bufferInfo(this.mediaBuffer,oe,this.config.maxBufferHole),ge=Object(h.fragmentWithinToleranceTest)(we.end,this.config.maxFragLookUpTolerance,M);ge<0&&(l.logger.log("Waiting fragment cc ("+M.cc+") @ "+M.start+" cancelled because another fragment at "+we.end+" is needed"),this.clearWaitingFragment())}}else this.state=j.State.IDLE}}this.onTickEnd()},A.clearWaitingFragment=function(){var T=this.waitingData;T&&(this.fragmentTracker.removeFragment(T.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.IDLE)},A.onTickEnd=function(){var T=this.media;if(!T||!T.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:T,S=f.buffered;!this.loadedmetadata&&S.length&&(this.loadedmetadata=!0),this.lastCurrentTime=T.currentTime},A.doTickIdle=function(){var T,f,S=this.hls,y=this.levels,b=this.media,U=this.trackId,F=S.config;if(!y||!y[U])return;if(!b&&(this.startFragRequested||!F.startFragPrefetch))return;var _=y[U],M=_.details;if(!M||M.live&&this.levelLastLoaded!==U||this.waitForCdnTuneIn(M)){this.state=j.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(I===null)return;var g=I.len,W=this.getMaxBufferLength(),$=this.audioSwitch;if(g>=W&&!$)return;if(!$&&this._streamEnded(I,M)){S.trigger(B.Events.BUFFER_EOS,{type:"audio"}),this.state=j.State.ENDED;return}var ne=M.fragments,oe=ne[0].start,we=I.end;if($){var ge=this.getLoadPosition();we=ge,M.PTSKnown&&ge<oe&&((I.end>oe||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=oe+.05))}var xe=this.getNextFragment(we,M);if(!xe){this.bufferFlushed=!0;return}((T=xe.decryptdata)===null||T===void 0?void 0:T.keyFormat)==="identity"&&!((f=xe.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(xe,M):this.loadFragment(xe,M,we)},A.getMaxBufferLength=function(){var T=D.prototype.getMaxBufferLength.call(this),f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return f===null?T:Math.max(T,f.len)},A.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},A.onAudioTracksUpdated=function(T,f){var S=f.audioTracks;this.resetTransmuxer(),this.levels=S.map(function(y){return new r.Level(y)})},A.onAudioTrackSwitching=function(T,f){var S=!!f.url;this.trackId=f.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),S?this.setInterval(E):this.resetTransmuxer(),S?(this.audioSwitch=!0,this.state=j.State.IDLE):this.state=j.State.STOPPED,this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},A.onLevelLoaded=function(T,f){this.mainDetails=f.details},A.onAudioTrackLoaded=function(T,f){var S,y=this.levels,b=f.details,U=f.id;if(!y){this.warn("Audio tracks were reset while loading level "+U);return}this.log("Track "+U+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var F=y[U],_=0;if(b.live||(S=F.details)!==null&&S!==void 0&&S.live){var M=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!M)return;!F.details&&b.hasProgramDateTime&&M.hasProgramDateTime?(Object(d.alignMediaPlaylistByPDT)(b,M),_=b.fragments[0].start):_=this.alignPlaylists(b,F.details)}F.details=b,this.levelLastLoaded=U,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(F.details,_),this.state===j.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=j.State.IDLE),this.tick()},A._handleFragmentLoadProgress=function(T){var f,S=T.frag,y=T.part,b=T.payload,U=this.config,F=this.trackId,_=this.levels;if(!_){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+S.sn+" of level "+S.level+" will not be buffered");return}var M=_[F];console.assert(M,"Audio track is defined on fragment load progress");var I=M.details;console.assert(I,"Audio track details are defined on fragment load progress");var g=U.defaultAudioCodec||M.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new p.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var $=this.initPTS[S.cc],ne=(f=S.initSegment)===null||f===void 0?void 0:f.data;if($!==void 0){var oe=!1,we=y?y.index:-1,ge=we!==-1,xe=new u.ChunkMetadata(S.level,S.sn,S.stats.chunkCount,b.byteLength,we,ge);W.push(b,ne,g,"",S,y,I.totalduration,oe,xe,$)}else{l.logger.log("Unknown video PTS for cc "+S.cc+", waiting for video PTS before demuxing audio frag "+S.sn+" of ["+I.startSN+" ,"+I.endSN+"],track "+F);var Re=this.waitingData=this.waitingData||{frag:S,part:y,cache:new m.default,complete:!1},Le=Re.cache;Le.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=j.State.WAITING_INIT_PTS}},A._handleFragmentLoadComplete=function(T){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,T)},A.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},A.onBufferCreated=function(T,f){var S=f.tracks.audio;S&&(this.mediaBuffer=S.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},A.onFragBuffered=function(T,f){var S=f.frag,y=f.part;if(S.type!==L.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(S)){this.warn("Fragment "+S.sn+(y?" p: "+y.index:"")+" of level "+S.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}S.sn!=="initSegment"&&(this.fragPrevious=S,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(S,y)},A.onError=function(T,f){switch(f.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(L.PlaylistLevelType.AUDIO,f);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==j.State.ERROR&&this.state!==j.State.STOPPED&&(this.state=f.fatal?j.State.ERROR:j.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var S=!0,y=this.getFwdBufferInfo(this.mediaBuffer,L.PlaylistLevelType.AUDIO);y&&y.len>.5&&(S=!this.reduceMaxBufferLength(y.len)),S&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},A.onBufferFlushed=function(T,f){var S=f.type;S===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},A._handleTransmuxComplete=function(T){var f,S="audio",y=this.hls,b=T.remuxResult,U=T.chunkMeta,F=this.getCurrentContext(U);if(!F){this.warn("The loading context changed while buffering fragment "+U.sn+" of level "+U.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(U.level);return}var _=F.frag,M=F.part,I=b.audio,g=b.text,W=b.id3,$=b.initSegment;if(this.fragContextChanged(_))return;if(this.state=j.State.PARSING,this.audioSwitch&&I&&this.completeAudioSwitch(),$!=null&&$.tracks&&(this._bufferInitSegment($.tracks,_,U),y.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:_,id:S,tracks:$.tracks})),I){var ne=I.startPTS,oe=I.endPTS,we=I.startDTS,ge=I.endDTS;M&&(M.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ne,endPTS:oe,startDTS:we,endDTS:ge}),_.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ne,oe,we,ge),this.bufferFragmentData(I,_,M,U)}if(W!=null&&(f=W.samples)!==null&&f!==void 0&&f.length){var xe=s({frag:_,id:S},W);y.trigger(B.Events.FRAG_PARSING_METADATA,xe)}if(g){var Re=s({frag:_,id:S},g);y.trigger(B.Events.FRAG_PARSING_USERDATA,Re)}},A._bufferInitSegment=function(T,f,S){if(this.state!==j.State.PARSING)return;T.video&&delete T.video;var y=T.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(B.Events.BUFFER_CODECS,T);var b=y.initSegment;if(b!=null&&b.byteLength){var U={type:"audio",frag:f,part:null,chunkMeta:S,parent:f.type,data:b};this.hls.trigger(B.Events.BUFFER_APPENDING,U)}this.tick()},A.loadFragment=function(T,f,S){var y=this.fragmentTracker.getState(T);this.fragCurrent=T,(this.audioSwitch||y===H.FragmentState.NOT_LOADED||y===H.FragmentState.PARTIAL)&&(T.sn==="initSegment"?this._loadInitSegment(T):f.live&&!Object(X.isFiniteNumber)(this.initPTS[T.cc])?(this.log("Waiting for video PTS in continuity counter "+T.cc+" of live stream before loading audio fragment "+T.sn+" of level "+this.trackId),this.state=j.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,T,f,S)))},A.completeAudioSwitch=function(){var T=this.hls,f=this.media,S=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,T.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:S})},O}(j.default);J.default=w},"./src/controller/audio-track-controller.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/events.ts"),j=P("./src/errors.ts"),B=P("./src/controller/base-playlist-controller.ts"),K=P("./src/types/loader.ts");function H(p,u){for(var h=0;h<u.length;h++){var d=u[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(p,d.key,d)}}function r(p,u,h){return u&&H(p.prototype,u),h&&H(p,h),p}function L(p,u){p.prototype=Object.create(u.prototype),p.prototype.constructor=p,v(p,u)}function v(p,u){return v=Object.setPrototypeOf||function(d,o){return d.__proto__=o,d},v(p,u)}var m=function(p){L(u,p);function u(d){var o;return o=p.call(this,d,"[audio-track-controller]")||this,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.trackName="",o.selectDefaultTrack=!0,o.registerListeners(),o}var h=u.prototype;return h.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)},h.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)},h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},h.onManifestParsed=function(o,l){this.tracks=l.audioTracks||[]},h.onAudioTrackLoaded=function(o,l){var s=l.id,a=l.details,R=this.tracksInGroup[s];if(!R){this.warn("Invalid audio track id "+s);return}var E=R.details;R.details=l.details,this.log("audioTrack "+s+" loaded ["+a.startSN+"-"+a.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,l,E))},h.onLevelLoading=function(o,l){this.switchLevel(l.level)},h.onLevelSwitching=function(o,l){this.switchLevel(l.level)},h.switchLevel=function(o){var l=this.hls.levels[o];if(!(l!=null&&l.audioGroupIds))return;var s=l.audioGroupIds[l.urlId];if(this.groupId!==s){this.groupId=s;var a=this.tracks.filter(function(E){return!s||E.groupId===s});this.selectDefaultTrack&&!a.some(function(E){return E.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=a;var R={audioTracks:a};this.log("Updating audio tracks, "+a.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(X.Events.AUDIO_TRACKS_UPDATED,R),this.selectInitialTrack()}},h.onError=function(o,l){if(p.prototype.onError.call(this,o,l),l.fatal||!l.context)return;l.context.type===K.PlaylistContextType.AUDIO_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},h.setAudioTrack=function(o){var l=this.tracksInGroup;if(o<0||o>=l.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=l[this.trackId];this.log("Now switching to audio-track index "+o);var a=l[o],R=a.id,E=a.groupId,w=E===void 0?"":E,D=a.name,O=a.type,A=a.url;if(this.trackId=o,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:w,name:D,type:O,url:A}),a.details&&!a.details.live)return;var C=this.switchParams(a.url,s==null?void 0:s.details);this.loadPlaylist(C)},h.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.length,"Initial audio track should be selected when tracks are known");var l=this.trackName,s=this.findTrackId(l)||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:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},h.findTrackId=function(o){for(var l=this.tracksInGroup,s=0;s<l.length;s++){var a=l[s];if((!this.selectDefaultTrack||a.default)&&(!o||o===a.name))return a.id}return-1},h.loadPlaylist=function(o){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var s=l.id,a=l.groupId,R=l.url;if(o)try{R=o.addDirectives(R)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(X.Events.AUDIO_TRACK_LOADING,{url:R,id:s,groupId:a,deliveryDirectives:o||null})}},r(u,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1,this.setAudioTrack(o)}}]),u}(B.default);J.default=m},"./src/controller/base-playlist-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return r});var X=P("./src/polyfills/number.ts"),j=P("./src/types/level.ts"),B=P("./src/controller/level-helper.ts"),K=P("./src/utils/logger.ts"),H=P("./src/errors.ts"),r=function(){function L(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=K.logger.log.bind(K.logger,p+":"),this.warn=K.logger.warn.bind(K.logger,p+":"),this.hls=m}var v=L.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(p,u){u.fatal&&u.type===H.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},v.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},v.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},v.stopLoad=function(){this.canLoad=!1,this.clearTimer()},v.switchParams=function(p,u){var h=u==null?void 0:u.renditionReports;if(h)for(var d=0;d<h.length;d++){var o=h[d],l=""+o.URI;if(l===p.substr(-l.length)){var s=parseInt(o["LAST-MSN"]),a=parseInt(o["LAST-PART"]);if(u&&this.hls.config.lowLatencyMode){var R=Math.min(u.age-u.partTarget,u.targetduration);a!==void 0&&R>u.partTarget&&(a+=1)}if(Object(X.isFiniteNumber)(s))return new j.HlsUrlParameters(s,Object(X.isFiniteNumber)(a)?a:void 0,j.HlsSkip.No)}}},v.loadPlaylist=function(p){},v.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},v.playlistLoaded=function(p,u,h){var d=this,o=u.details,l=u.stats,s=l.loading.end?Math.max(0,self.performance.now()-l.loading.end):0;if(o.advancedDateTime=Date.now()-s,o.live||h!=null&&h.live){if(o.reloaded(h),h&&this.log("live playlist "+p+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),h&&o.fragments.length>0&&Object(B.mergeDetails)(h,o),!this.canLoad||!o.live)return;var a,R=void 0,E=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var w=this.hls.config.lowLatencyMode,D=o.lastPartSn,O=o.endSN,A=o.lastPartIndex,C=A!==-1,T=D===O,f=w?0:A;C?(R=T?O+1:D,E=T?f:A+1):R=O+1;var S=o.age,y=S+o.ageHeader,b=Math.min(y-o.partTarget,o.targetduration*1.5);if(b>0){if(h&&b>h.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+h.tuneInGoal+" to: "+b+" with playlist age: "+o.age),b=0;else{var U=Math.floor(b/o.targetduration);if(R+=U,E!==void 0){var F=Math.round(b%o.targetduration/o.partTarget);E+=F}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+S.toFixed(2)+"s goal: "+b+" skip sn "+U+" to part "+E)}o.tuneInGoal=b}if(a=this.getDeliveryDirectives(o,u.deliveryDirectives,R,E),w||!T){this.loadPlaylist(a);return}}else a=this.getDeliveryDirectives(o,u.deliveryDirectives,R,E);var _=Object(B.computeReloadInterval)(o,l);R!==void 0&&o.canBlockReload&&(_-=o.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(_)+" ms"),this.timer=self.setTimeout(function(){return d.loadPlaylist(a)},_)}else this.clearTimer()},v.getDeliveryDirectives=function(p,u,h,d){var o=Object(j.getSkipValue)(p,h);return u!=null&&u.skip&&p.deltaUpdateFailed&&(h=u.msn,d=u.part,o=j.HlsSkip.No),new j.HlsUrlParameters(h,d,o)},v.retryLoadingOrFail=function(p){var u=this,h=this.hls.config,d=this.retryCount<h.levelLoadingMaxRetry;if(d){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 l=Math.min(Math.pow(2,this.retryCount)*h.levelLoadingRetryDelay,h.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.loadPlaylist()},l),this.warn("retry playlist loading #"+this.retryCount+" in "+l+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return d},L}()},"./src/controller/base-stream-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"State",function(){return O}),P.d(J,"default",function(){return A});var X=P("./src/polyfills/number.ts"),j=P("./src/task-loop.ts"),B=P("./src/controller/fragment-tracker.ts"),K=P("./src/utils/buffer-helper.ts"),H=P("./src/utils/logger.ts"),r=P("./src/events.ts"),L=P("./src/errors.ts"),v=P("./src/types/transmuxer.ts"),m=P("./src/utils/mp4-tools.ts"),p=P("./src/utils/discontinuities.ts"),u=P("./src/controller/fragment-finders.ts"),h=P("./src/controller/level-helper.ts"),d=P("./src/loader/fragment-loader.ts"),o=P("./src/crypt/decrypter.ts"),l=P("./src/utils/time-ranges.ts"),s=P("./src/types/loader.ts");function a(C,T){for(var f=0;f<T.length;f++){var S=T[f];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(C,S.key,S)}}function R(C,T,f){return T&&a(C.prototype,T),f&&a(C,f),C}function E(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function w(C,T){C.prototype=Object.create(T.prototype),C.prototype.constructor=C,D(C,T)}function D(C,T){return D=Object.setPrototypeOf||function(S,y){return S.__proto__=y,S},D(C,T)}var O={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"},A=function(C){w(T,C);function T(S,y,b){var U;return U=C.call(this)||this,U.hls=void 0,U.fragPrevious=null,U.fragCurrent=null,U.fragmentTracker=void 0,U.transmuxer=null,U._state=O.STOPPED,U.media=void 0,U.mediaBuffer=void 0,U.config=void 0,U.bitrateTest=!1,U.lastCurrentTime=0,U.nextLoadPosition=0,U.startPosition=0,U.loadedmetadata=!1,U.fragLoadError=0,U.retryDate=0,U.levels=null,U.fragmentLoader=void 0,U.levelLastLoaded=null,U.startFragRequested=!1,U.decrypter=void 0,U.initPTS=[],U.onvseeking=null,U.onvended=null,U.logPrefix="",U.log=void 0,U.warn=void 0,U.logPrefix=b,U.log=H.logger.log.bind(H.logger,b+":"),U.warn=H.logger.warn.bind(H.logger,b+":"),U.hls=S,U.fragmentLoader=new d.default(S.config),U.fragmentTracker=y,U.config=S.config,U.decrypter=new o.default(S,S.config),S.on(r.Events.KEY_LOADED,U.onKeyLoaded,E(U)),U}var f=T.prototype;return f.doTick=function(){this.onTickEnd()},f.onTickEnd=function(){},f.startLoad=function(y){},f.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=O.STOPPED},f._streamEnded=function(y,b){var U=this.fragCurrent,F=this.fragmentTracker;if(!b.live&&U&&U.sn===b.endSN&&!y.nextStart){var _=F.getState(U);return _===B.FragmentState.PARTIAL||_===B.FragmentState.OK}return!1},f.onMediaAttached=function(y,b){var U=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),U.addEventListener("seeking",this.onvseeking),U.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(F.startPosition)},f.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()},f.onMediaSeeking=function(){var y=this.config,b=this.fragCurrent,U=this.media,F=this.mediaBuffer,_=this.state,M=U?U.currentTime:0,I=K.BufferHelper.bufferInfo(F||U,M,y.maxBufferHole);if(this.log("media seeking to "+(Object(X.isFiniteNumber)(M)?M.toFixed(3):M)+", state: "+_),_===O.ENDED)this.resetLoadingState();else if(b&&!I.len){var g=y.maxFragLookUpTolerance,W=b.start-g,$=b.start+b.duration+g,ne=M>$;(M<W||ne)&&(ne&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}U&&(this.lastCurrentTime=M),!this.loadedmetadata&&!I.len&&(this.nextLoadPosition=this.startPosition=M),this.tickImmediate()},f.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},f.onKeyLoaded=function(y,b){if(this.state!==O.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var U=this.levels[b.frag.level].details;U&&this.loadFragment(b.frag,U,b.frag.start)},f.onHandlerDestroying=function(){this.stopLoad(),C.prototype.onHandlerDestroying.call(this)},f.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(r.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,C.prototype.onHandlerDestroyed.call(this)},f.loadKey=function(y,b){this.log("Loading key for "+y.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=O.KEY_LOADING,this.fragCurrent=y,this.hls.trigger(r.Events.KEY_LOADING,{frag:y})},f.loadFragment=function(y,b,U){this._loadFragForPlayback(y,b,U)},f._loadFragForPlayback=function(y,b,U){var F=this,_=function(I){if(F.fragContextChanged(y)){F.warn("Fragment "+y.sn+(I.part?" p: "+I.part.index:"")+" of level "+y.level+" was dropped during download."),F.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,F._handleFragmentLoadProgress(I)};this._doFragLoad(y,b,U,_).then(function(M){if(!M)return;F.fragLoadError=0;var I=F.state;if(F.fragContextChanged(y)){(I===O.FRAG_LOADING||I===O.BACKTRACKING||!F.fragCurrent&&I===O.PARSING)&&(F.fragmentTracker.removeFragment(y),F.state=O.IDLE);return}if("payload"in M&&(F.log("Loaded fragment "+y.sn+" of level "+y.level),F.hls.trigger(r.Events.FRAG_LOADED,M),F.state===O.BACKTRACKING)){F.fragmentTracker.backtrack(y,M),F.resetFragmentLoading(y);return}F._handleFragmentLoadComplete(M)}).catch(function(M){F.warn(M),F.resetFragmentLoading(y)})},f.flushMainBuffer=function(y,b,U){if(U===void 0&&(U=null),!(y-b))return;var F={startOffset:y,endOffset:b,type:U};this.fragLoadError=0,this.hls.trigger(r.Events.BUFFER_FLUSHING,F)},f._loadInitSegment=function(y){var b=this;this._doFragLoad(y).then(function(U){if(!U||b.fragContextChanged(y)||!b.levels)throw new Error("init load aborted");return U}).then(function(U){var F=b.hls,_=U.payload,M=y.decryptdata;if(_&&_.byteLength>0&&M&&M.key&&M.iv&&M.method==="AES-128"){var I=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(_),M.key.buffer,M.iv.buffer).then(function(g){var W=self.performance.now();return F.trigger(r.Events.FRAG_DECRYPTED,{frag:y,payload:g,stats:{tstart:I,tdecrypt:W}}),U.payload=g,U})}return U}).then(function(U){var F=b.fragCurrent,_=b.hls,M=b.levels;if(!M)throw new Error("init load aborted, missing levels");var I=M[y.level].details;console.assert(I,"Level details are defined when init segment is loaded");var g=y.stats;b.state=O.IDLE,b.fragLoadError=0,y.data=new Uint8Array(U.payload),g.parsing.start=g.buffering.start=self.performance.now(),g.parsing.end=g.buffering.end=self.performance.now(),U.frag===F&&_.trigger(r.Events.FRAG_BUFFERED,{stats:g,frag:F,part:null,id:y.type}),b.tick()}).catch(function(U){b.warn(U),b.resetFragmentLoading(y)})},f.fragContextChanged=function(y){var b=this.fragCurrent;return!y||!b||y.level!==b.level||y.sn!==b.sn||y.urlId!==b.urlId},f.fragBufferedComplete=function(y,b){var U=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+l.default.toString(K.BufferHelper.getBuffered(U))),this.state=O.IDLE,this.tick()},f._handleFragmentLoadComplete=function(y){var b=this.transmuxer;if(!b)return;var U=y.frag,F=y.part,_=y.partsLoaded,M=!_||_.length===0||_.some(function(g){return!g}),I=new v.ChunkMetadata(U.level,U.sn,U.stats.chunkCount+1,0,F?F.index:-1,!M);b.flush(I)},f._handleFragmentLoadProgress=function(y){},f._doFragLoad=function(y,b,U,F){var _=this;if(U===void 0&&(U=null),!this.levels)throw new Error("frag load aborted, missing levels");if(U=Math.max(y.start,U||0),this.config.lowLatencyMode&&b){var M=b.partList;if(M&&F){U>y.end&&b.fragmentHint&&(y=b.fragmentHint);var I=this.getNextPart(M,y,U);if(I>-1){var g=M[I];return this.log("Loading part sn: "+y.sn+" p: "+g.index+" cc: "+y.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+I+"-"+(M.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(U.toFixed(3))),this.nextLoadPosition=g.start+g.duration,this.state=O.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:y,part:M[I],targetBufferTime:U}),this.doFragPartsLoad(y,M,I,F).catch(function(W){return _.handleFragLoadError(W)})}else if(!y.url||this.loadedEndOfParts(M,U))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(U.toFixed(3))),Object(X.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=O.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:y,targetBufferTime:U}),this.fragmentLoader.load(y,F).catch(function(W){return _.handleFragLoadError(W)})},f.doFragPartsLoad=function(y,b,U,F){var _=this;return new Promise(function(M,I){var g=[],W=function $(ne){var oe=b[ne];_.fragmentLoader.loadPart(y,oe,F).then(function(we){g[oe.index]=we;var ge=we.part;_.hls.trigger(r.Events.FRAG_LOADED,we);var xe=b[ne+1];if(xe&&xe.fragment===y)$(ne+1);else return M({frag:y,part:ge,partsLoaded:g})}).catch(I)};W(U)})},f.handleFragLoadError=function(y){var b=y.data;return b&&b.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(r.Events.ERROR,b),null},f._handleTransmuxerFlush=function(y){var b=this.getCurrentContext(y);if(!b||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var U=b.frag,F=b.part,_=b.level,M=self.performance.now();U.stats.parsing.end=M,F&&(F.stats.parsing.end=M),this.updateLevelTiming(U,F,_,y.partial)},f.getCurrentContext=function(y){var b=this.levels,U=y.level,F=y.sn,_=y.part;if(!b||!b[U])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+U+". The current chunk will not be buffered."),null;var M=b[U],I=_>-1?Object(h.getPartWith)(M,F,_):null,g=I?I.fragment:Object(h.getFragmentWithSN)(M,F,this.fragCurrent);return g?{frag:g,part:I,level:M}:null},f.bufferFragmentData=function(y,b,U,F){if(!y||this.state!==O.PARSING)return;var _=y.data1,M=y.data2,I=_;if(_&&M&&(I=Object(m.appendUint8Array)(_,M)),!I||!I.length)return;var g={type:y.type,frag:b,part:U,chunkMeta:F,parent:b.type,data:I};this.hls.trigger(r.Events.BUFFER_APPENDING,g),y.dropped&&y.independent&&!U&&this.flushBufferGap(b)},f.flushBufferGap=function(y){var b=this.media;if(!b)return;if(!K.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,y.start);return}var U=b.currentTime,F=K.BufferHelper.bufferInfo(b,U,0),_=y.duration,M=Math.min(this.config.maxFragLookUpTolerance*2,_*.25),I=Math.max(Math.min(y.start-M,F.end-M),U+M);y.start-I>M&&this.flushMainBuffer(I,y.start)},f.getFwdBufferInfo=function(y,b){var U=this.config,F=this.getLoadPosition();if(!Object(X.isFiniteNumber)(F))return null;var _=K.BufferHelper.bufferInfo(y,F,U.maxBufferHole);if(_.len===0&&_.nextStart!==void 0){var M=this.fragmentTracker.getBufferedFrag(F,b);if(M&&_.nextStart<M.end)return K.BufferHelper.bufferInfo(y,F,Math.max(_.nextStart,U.maxBufferHole))}return _},f.getMaxBufferLength=function(y){var b=this.config,U;return y?U=Math.max(8*b.maxBufferSize/y,b.maxBufferLength):U=b.maxBufferLength,Math.min(U,b.maxMaxBufferLength)},f.reduceMaxBufferLength=function(y){var b=this.config,U=y||b.maxBufferLength;return b.maxMaxBufferLength>=U?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(y,b){var U,F,_=b.fragments,M=_.length;if(!M)return null;var I=this.config,g=_[0].start,W;if(b.live){var $=I.initialLiveManifestSize;if(M<$)return this.warn("Not enough fragments to start playback (have: "+M+", need: "+$+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(W=this.getInitialLiveFragment(b,_),this.startPosition=W?this.hls.liveSyncPosition||W.start:y)}else y<=g&&(W=_[0]);if(!W){var ne=I.lowLatencyMode?b.partEnd:b.fragmentEnd;W=this.getFragmentAtPosition(y,ne,b)}return(U=W)!==null&&U!==void 0&&U.initSegment&&!((F=W)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(W=W.initSegment),W},f.getNextPart=function(y,b,U){for(var F=-1,_=!1,M=!0,I=0,g=y.length;I<g;I++){var W=y[I];if(M=M&&!W.independent,F>-1&&U<W.start)break;var $=W.loaded;!$&&(_||W.independent||M)&&W.fragment===b&&(F=I),_=$}return F},f.loadedEndOfParts=function(y,b){var U=y[y.length-1];return U&&b>U.start&&U.loaded},f.getInitialLiveFragment=function(y,b){var U=this.fragPrevious,F=null;if(U){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+U.programDateTime),F=Object(u.findFragmentByPDT)(b,U.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var _=U.sn+1;if(_>=y.startSN&&_<=y.endSN){var M=b[_-y.startSN];U.cc===M.cc&&(F=M,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(u.findFragWithCC)(b,U.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var I=this.hls.liveSyncPosition;I!==null&&(F=this.getFragmentAtPosition(I,this.bitrateTest?y.fragmentEnd:y.edge,y))}return F},f.getFragmentAtPosition=function(y,b,U){var F=this.config,_=this.fragPrevious,M=U.fragments,I=U.endSN,g=U.fragmentHint,W=F.maxFragLookUpTolerance,$=!!(F.lowLatencyMode&&U.partList&&g);$&&g&&!this.bitrateTest&&(M=M.concat(g),I=g.sn);var ne;if(y<b){var oe=y>b-W?0:W;ne=Object(u.findFragmentByPTS)(_,M,y,oe)}else ne=M[M.length-1];if(ne){var we=ne.sn-U.startSN,ge=_&&ne.level===_.level,xe=M[we+1],Re=this.fragmentTracker.getState(ne);if(Re===B.FragmentState.BACKTRACKED){ne=null;for(var Le=we;M[Le]&&this.fragmentTracker.getState(M[Le])===B.FragmentState.BACKTRACKED;)_?ne=M[Le--]:ne=M[--Le];ne||(ne=xe)}else _&&ne.sn===_.sn&&!$&&(ge&&(ne.sn<I&&this.fragmentTracker.getState(xe)!==B.FragmentState.OK?(this.log("SN "+ne.sn+" just loaded, load next one: "+xe.sn),ne=xe):ne=null))}return ne},f.synchronizeToLiveEdge=function(y){var b=this.config,U=this.media;if(!U)return;var F=this.hls.liveSyncPosition,_=U.currentTime,M=y.fragments[0].start,I=y.edge,g=_>=M-b.maxFragLookUpTolerance&&_<=I;if(F!==null&&U.duration>F&&(_<F||!g)){var W=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*y.targetduration;(!g&&U.readyState<4||_<I-W)&&(this.loadedmetadata||(this.nextLoadPosition=F),U.readyState&&(this.warn("Playback: "+_.toFixed(3)+" is located too far from the end of live sliding playlist: "+I+", reset currentTime to : "+F.toFixed(3)),U.currentTime=F))}},f.alignPlaylists=function(y,b){var U=this.levels,F=this.levelLastLoaded,_=this.fragPrevious,M=F!==null?U[F]:null,I=y.fragments.length;if(!I)return this.warn("No fragments in live playlist"),0;var g=y.fragments[0].start,W=!b,$=y.alignedSliding&&Object(X.isFiniteNumber)(g);if(W||!$&&!g){Object(p.alignStream)(_,M,y);var ne=y.fragments[0].start;return this.log("Live playlist sliding: "+ne.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+y.startSN+" prev-sn: "+(_?_.sn:"na")+" fragments: "+I),ne}return g},f.waitForCdnTuneIn=function(y){var b=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*b)},f.setStartPosition=function(y,b){var U=this.startPosition;if(U<b&&(U=-1),U===-1||this.lastCurrentTime===-1){var F=y.startTimeOffset;Object(X.isFiniteNumber)(F)?(U=b+F,F<0&&(U+=y.totalduration),U=Math.min(Math.max(b,U),b+y.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+U),this.startPosition=U):y.live?U=this.hls.liveSyncPosition||b:this.startPosition=U=0,this.lastCurrentTime=U}this.nextLoadPosition=U},f.getLoadPosition=function(){var y=this.media,b=0;return this.loadedmetadata&&y?b=y.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},f.handleFragLoadAborted=function(y,b){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(b?" part"+b.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},f.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=O.IDLE)},f.onFragmentOrKeyLoadError=function(y,b){if(b.fatal)return;var U=b.frag;if(!U||U.type!==y)return;var F=this.fragCurrent;console.assert(F&&U.sn===F.sn&&U.level===F.level&&U.urlId===F.urlId,"Frag load error must match current frag to retry");var _=this.config;if(this.fragLoadError+1<=_.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(U.level))return;var M=Math.min(Math.pow(2,this.fragLoadError)*_.fragLoadingRetryDelay,_.fragLoadingMaxRetryTimeout);this.warn("Fragment "+U.sn+" of "+y+" "+U.level+" failed to load, retrying in "+M+"ms"),this.retryDate=self.performance.now()+M,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(y===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(H.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},f.afterBufferFlushed=function(y,b,U){if(!y)return;var F=K.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(b,F,U),this.state===O.ENDED&&this.resetLoadingState()},f.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},f.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[y].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},f.updateLevelTiming=function(y,b,U,F){var _=this,M=U.details;console.assert(!!M,"level.details must be defined");var I=Object.keys(y.elementaryStreams).reduce(function(g,W){var $=y.elementaryStreams[W];if($){var ne=$.endPTS-$.startPTS;if(ne<=0)return _.warn("Could not parse fragment "+y.sn+" "+W+" duration reliably ("+ne+") resetting transmuxer to fallback to playlist timing"),_.resetTransmuxer(),g||!1;var oe=F?0:Object(h.updateFragPTSDTS)(M,y,$.startPTS,$.endPTS,$.startDTS,$.endDTS);return _.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:M,level:U,drift:oe,type:W,frag:y,start:$.startPTS,end:$.endPTS}),!0}return g},!1);I?(this.state=O.PARSED,this.hls.trigger(r.Events.FRAG_PARSED,{frag:y,part:b})):this.resetLoadingState()},f.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},R(T,[{key:"state",get:function(){return this._state},set:function(y){var b=this._state;b!==y&&(this._state=y,this.log(b+"->"+y))}}]),T}(j.default)},"./src/controller/buffer-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return u});var X=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),B=P("./src/utils/logger.ts"),K=P("./src/errors.ts"),H=P("./src/utils/buffer-helper.ts"),r=P("./src/utils/mediasource-helper.ts"),L=P("./src/loader/fragment.ts"),v=P("./src/controller/buffer-operation-queue.ts"),m=Object(r.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function h(o){var l=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=l.hls,a=l.media,R=l.mediaSource;B.logger.log("[buffer-controller]: Media source opened"),a&&(l.updateMediaElementDuration(),s.trigger(j.Events.MEDIA_ATTACHED,{media:a})),R&&R.removeEventListener("sourceopen",l._onMediaSourceOpen),l.checkPendingTracks()},this._onMediaSourceClose=function(){B.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){B.logger.log("[buffer-controller]: Media source ended")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var d=h.prototype;return d.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},d.destroy=function(){this.unregisterListeners(),this.details=null},d.registerListeners=function(){var l=this.hls;l.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(j.Events.BUFFER_RESET,this.onBufferReset,this),l.on(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),l.on(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.on(j.Events.BUFFER_EOS,this.onBufferEos,this),l.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),l.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),l.on(j.Events.FRAG_PARSED,this.onFragParsed,this),l.on(j.Events.FRAG_CHANGED,this.onFragChanged,this)},d.unregisterListeners=function(){var l=this.hls;l.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(j.Events.BUFFER_RESET,this.onBufferReset,this),l.off(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),l.off(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.off(j.Events.BUFFER_EOS,this.onBufferEos,this),l.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),l.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),l.off(j.Events.FRAG_PARSED,this.onFragParsed,this),l.off(j.Events.FRAG_CHANGED,this.onFragChanged,this)},d._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},d.onManifestParsed=function(l,s){var a=2;(s.audio&&!s.video||!s.altAudio)&&(a=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=a,this.details=null,B.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(l,s){var a=this.media=s.media;if(a&&m){var R=this.mediaSource=new m;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),a.src=self.URL.createObjectURL(R),this._objectUrl=a.src}},d.onMediaDetaching=function(){var l=this.media,s=this.mediaSource,a=this._objectUrl;if(s){if(B.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(R){B.logger.warn("[buffer-controller]: onMediaDetaching: "+R.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),l&&(a&&self.URL.revokeObjectURL(a),l.src===a?(l.removeAttribute("src"),l.load()):B.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(j.Events.MEDIA_DETACHED,void 0)},d.onBufferReset=function(){var l=this;this.getSourceBufferTypes().forEach(function(s){var a=l.sourceBuffer[s];try{a&&(l.removeBufferListeners(s),l.mediaSource&&l.mediaSource.removeSourceBuffer(a),l.sourceBuffer[s]=void 0)}catch(R){B.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",R)}}),this._initSourceBuffer()},d.onBufferCodecs=function(l,s){var a=this,R=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(E){if(R){var w=a.tracks[E];if(w&&typeof w.buffer.changeType=="function"){var D=s[E],O=D.codec,A=D.levelCodec,C=D.container,T=(w.levelCodec||w.codec).replace(p,"$1"),f=(A||O).replace(p,"$1");if(T!==f){var S=C+";codecs="+(A||O);a.appendChangeType(E,S)}}}else a.pendingTracks[E]=s[E]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(l,s){var a=this,R=this.operationQueue,E={execute:function(){var D=a.sourceBuffer[l];D&&(B.logger.log("[buffer-controller]: changing "+l+" sourceBuffer type to "+s),D.changeType(s)),R.shiftAndExecuteNext(l)},onStart:function(){},onComplete:function(){},onError:function(D){B.logger.warn("[buffer-controller]: Failed to change "+l+" SourceBuffer type",D)}};R.append(E,l)},d.onBufferAppending=function(l,s){var a=this,R=this.hls,E=this.operationQueue,w=this.tracks,D=s.data,O=s.type,A=s.frag,C=s.part,T=s.chunkMeta,f=T.buffering[O],S=self.performance.now();f.start=S;var y=A.stats.buffering,b=C?C.stats.buffering:null;y.start===0&&(y.start=S),b&&b.start===0&&(b.start=S);var U=w.audio,F=O==="audio"&&T.id===1&&(U==null?void 0:U.container)==="audio/mpeg",_={execute:function(){if(f.executeStart=self.performance.now(),F){var I=a.sourceBuffer[O];if(I){var g=A.start-I.timestampOffset;Math.abs(g)>=.1&&(B.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+A.start+" (delta: "+g+") sn: "+A.sn+")"),I.timestampOffset=A.start)}}a.appendExecutor(D,O)},onStart:function(){},onComplete:function(){var I=self.performance.now();f.executeEnd=f.end=I,y.first===0&&(y.first=I),b&&b.first===0&&(b.first=I);var g=a.sourceBuffer,W={};for(var $ in g)W[$]=H.BufferHelper.getBuffered(g[$]);a.appendError=0,a.hls.trigger(j.Events.BUFFER_APPENDED,{type:O,frag:A,part:C,chunkMeta:T,parent:A.type,timeRanges:W})},onError:function(I){B.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",I);var g={type:K.ErrorTypes.MEDIA_ERROR,parent:A.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:I,fatal:!1};I.code===DOMException.QUOTA_EXCEEDED_ERR?g.details=K.ErrorDetails.BUFFER_FULL_ERROR:(a.appendError++,g.details=K.ErrorDetails.BUFFER_APPEND_ERROR,a.appendError>R.config.appendErrorMaxRetry&&(B.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),g.fatal=!0)),R.trigger(j.Events.ERROR,g)}};E.append(_,O)},d.onBufferFlushing=function(l,s){var a=this,R=this.operationQueue,E=function(D){return{execute:a.removeExecutor.bind(a,D,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){a.hls.trigger(j.Events.BUFFER_FLUSHED,{type:D})},onError:function(A){B.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",A)}}};s.type?R.append(E(s.type),s.type):this.getSourceBufferTypes().forEach(function(w){R.append(E(w),w)})},d.onFragParsed=function(l,s){var a=this,R=s.frag,E=s.part,w=[],D=E?E.elementaryStreams:R.elementaryStreams;D[L.ElementaryStreamTypes.AUDIOVIDEO]?w.push("audiovideo"):(D[L.ElementaryStreamTypes.AUDIO]&&w.push("audio"),D[L.ElementaryStreamTypes.VIDEO]&&w.push("video"));var O=function(){var C=self.performance.now();R.stats.buffering.end=C,E&&(E.stats.buffering.end=C);var T=E?E.stats:R.stats;a.hls.trigger(j.Events.FRAG_BUFFERED,{frag:R,part:E,stats:T,id:R.type})};w.length===0&&B.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(O,w)},d.onFragChanged=function(l,s){this.flushBackBuffer()},d.onBufferEos=function(l,s){var a=this,R=this.getSourceBufferTypes().reduce(function(E,w){var D=a.sourceBuffer[w];return(!s.type||s.type===w)&&(D&&!D.ended&&(D.ended=!0,B.logger.log("[buffer-controller]: "+w+" sourceBuffer now EOS"))),E&&!!(!D||D.ended)},!0);R&&this.blockBuffers(function(){var E=a.mediaSource;if(!E||E.readyState!=="open")return;E.endOfStream()})},d.onLevelUpdated=function(l,s){var a=s.details;if(!a.fragments.length)return;this.details=a,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},d.flushBackBuffer=function(){var l=this.hls,s=this.details,a=this.media,R=this.sourceBuffer;if(!a||s===null)return;var E=this.getSourceBufferTypes();if(!E.length)return;var w=s.live&&l.config.liveBackBufferLength!==null?l.config.liveBackBufferLength:l.config.backBufferLength;if(!Object(X.isFiniteNumber)(w)||w<0)return;var D=a.currentTime,O=s.levelTargetDuration,A=Math.max(w,O),C=Math.floor(D/O)*O-A;E.forEach(function(T){var f=R[T];if(f){var S=H.BufferHelper.getBuffered(f);S.length>0&&C>S.start(0)&&(l.trigger(j.Events.BACK_BUFFER_REACHED,{bufferEnd:C}),s.live&&l.trigger(j.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:C}),l.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:C,type:T}))}})},d.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var l=this.details,s=this.hls,a=this.media,R=this.mediaSource,E=l.fragments[0].start+l.totalduration,w=a.duration,D=Object(X.isFiniteNumber)(R.duration)?R.duration:0;l.live&&s.config.liveDurationInfinity?(B.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(l)):(E>D&&E>w||!Object(X.isFiniteNumber)(w))&&(B.logger.log("[buffer-controller]: Updating Media Source duration to "+E.toFixed(3)),R.duration=E)},d.updateSeekableRange=function(l){var s=this.mediaSource,a=l.fragments,R=a.length;if(R&&l.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var E=Math.max(0,a[0].start),w=Math.max(E,E+l.totalduration);s.setLiveSeekableRange(E,w)}},d.checkPendingTracks=function(){var l=this.bufferCodecEventsExpected,s=this.operationQueue,a=this.pendingTracks,R=Object.keys(a).length;if(R&&!l||R===2){this.createSourceBuffers(a),this.pendingTracks={};var E=this.getSourceBufferTypes();if(E.length===0){this.hls.trigger(j.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}E.forEach(function(w){s.executeNext(w)})}},d.createSourceBuffers=function(l){var s=this.sourceBuffer,a=this.mediaSource;if(!a)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var E in l)if(!s[E]){var w=l[E];if(!w)throw Error("source buffer exists for track "+E+", however track does not");var D=w.levelCodec||w.codec,O=w.container+";codecs="+D;B.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var A=s[E]=a.addSourceBuffer(O),C=E;this.addBufferListener(C,"updatestart",this._onSBUpdateStart),this.addBufferListener(C,"updateend",this._onSBUpdateEnd),this.addBufferListener(C,"error",this._onSBUpdateError),this.tracks[E]={buffer:A,codec:D,container:w.container,levelCodec:w.levelCodec,id:w.id},R++}catch(T){B.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+T.message),this.hls.trigger(j.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:T,mimeType:O})}}R&&this.hls.trigger(j.Events.BUFFER_CREATED,{tracks:this.tracks})},d._onSBUpdateStart=function(l){var s=this.operationQueue,a=s.current(l);a.onStart()},d._onSBUpdateEnd=function(l){var s=this.operationQueue,a=s.current(l);a.onComplete(),s.shiftAndExecuteNext(l)},d._onSBUpdateError=function(l,s){B.logger.error("[buffer-controller]: "+l+" SourceBuffer error",s),this.hls.trigger(j.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var a=this.operationQueue.current(l);a&&a.onError(s)},d.removeExecutor=function(l,s,a){var R=this.media,E=this.mediaSource,w=this.operationQueue,D=this.sourceBuffer,O=D[l];if(!R||!E||!O){B.logger.warn("[buffer-controller]: Attempting to remove from the "+l+" SourceBuffer, but it does not exist"),w.shiftAndExecuteNext(l);return}var A=Object(X.isFiniteNumber)(R.duration)?R.duration:Infinity,C=Object(X.isFiniteNumber)(E.duration)?E.duration:Infinity,T=Math.max(0,s),f=Math.min(a,A,C);f>T?(B.logger.log("[buffer-controller]: Removing ["+T+","+f+"] from the "+l+" SourceBuffer"),console.assert(!O.updating,l+" sourceBuffer must not be updating"),O.remove(T,f)):w.shiftAndExecuteNext(l)},d.appendExecutor=function(l,s){var a=this.operationQueue,R=this.sourceBuffer,E=R[s];if(!E){B.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),a.shiftAndExecuteNext(s);return}E.ended=!1,console.assert(!E.updating,s+" sourceBuffer must not be updating"),E.appendBuffer(l)},d.blockBuffers=function(l,s){var a=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){B.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(l);return}var R=this.operationQueue,E=s.map(function(w){return R.appendBlocker(w)});Promise.all(E).then(function(){l(),s.forEach(function(w){var D=a.sourceBuffer[w];(!D||!D.updating)&&R.shiftAndExecuteNext(w)})})},d.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},d.addBufferListener=function(l,s,a){var R=this.sourceBuffer[l];if(!R)return;var E=a.bind(this,l);this.listeners[l].push({event:s,listener:E}),R.addEventListener(s,E)},d.removeBufferListeners=function(l){var s=this.sourceBuffer[l];if(!s)return;this.listeners[l].forEach(function(a){s.removeEventListener(a.event,a.listener)})},h}()},"./src/controller/buffer-operation-queue.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return j});var X=P("./src/utils/logger.ts"),j=function(){function B(H){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=H}var K=B.prototype;return K.append=function(r,L){var v=this.queues[L];v.push(r),v.length===1&&this.buffers[L]&&this.executeNext(L)},K.insertAbort=function(r,L){var v=this.queues[L];v.unshift(r),this.executeNext(L)},K.appendBlocker=function(r){var L,v=new Promise(function(p){L=p}),m={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,r),v},K.executeNext=function(r){var L=this.buffers,v=this.queues,m=L[r],p=v[r];if(p.length){var u=p[0];try{u.execute()}catch(h){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(h),(!m||!m.updating)&&(p.shift(),this.executeNext(r))}}},K.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},K.current=function(r){return this.queues[r][0]},B}()},"./src/controller/cap-level-controller.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/events.ts");function j(H,r){for(var L=0;L<r.length;L++){var v=r[L];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(H,v.key,v)}}function B(H,r,L){return r&&j(H.prototype,r),L&&j(H,L),H}var K=function(){function H(L){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=L,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var r=H.prototype;return r.setStreamController=function(v){this.streamController=v},r.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},r.registerListeners=function(){var v=this.hls;v.on(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var v=this.hls;v.off(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(v,m){H.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},r.onMediaAttaching=function(v,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},r.onManifestParsed=function(v,m){var p=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},r.onBufferCodecs=function(v,m){var p=this.hls;p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},r.onMediaDetaching=function(){this.stopCapping()},r.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(v.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},r.getMaxLevel=function(v){var m=this,p=this.hls.levels;if(!p.length)return-1;var u=p.filter(function(h,d){return H.isLevelAllowed(d,m.restrictedLevels)&&d<=v});return this.clientRect=null,H.getMaxLevelByMediaSize(u,this.mediaWidth,this.mediaHeight)},r.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()},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var v=this.media,m={width:0,height:0};if(v){var p=v.getBoundingClientRect();m.width=p.width,m.height=p.height,!m.width&&!m.height&&(m.width=p.right-p.left||v.width||0,m.height=p.bottom-p.top||v.height||0)}return this.clientRect=m,m},H.isLevelAllowed=function(v,m){return m===void 0&&(m=[]),m.indexOf(v)===-1},H.getMaxLevelByMediaSize=function(v,m,p){if(!v||!v.length)return-1;for(var u=function(s,a){return a?s.width!==a.width||s.height!==a.height:!0},h=v.length-1,d=0;d<v.length;d+=1){var o=v[d];if((o.width>=m||o.height>=p)&&u(o,v[d+1])){h=d;break}}return h},B(H,[{key:"mediaWidth",get:function(){return this.getDimensions().width*H.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*H.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(m){}return v}}]),H}();J.default=K},"./src/controller/cmcd-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return u});var X=P("./src/events.ts"),j=P("./src/types/cmcd.ts"),B=P("./src/utils/buffer-helper.ts"),K=P("./src/utils/logger.ts");function H(h,d){for(var o=0;o<d.length;o++){var l=d[o];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function r(h,d,o){return d&&H(h.prototype,d),o&&H(h,o),h}function L(h,d){var o=typeof Symbol!="undefined"&&h[Symbol.iterator]||h["@@iterator"];if(o)return(o=o.call(h)).next.bind(o);if(Array.isArray(h)||(o=v(h))||d&&h&&typeof h.length=="number"){o&&(h=o);var l=0;return function(){return l>=h.length?{done:!0}:{done:!1,value:h[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(h,d){if(!h)return;if(typeof h=="string")return m(h,d);var o=Object.prototype.toString.call(h).slice(8,-1);if(o==="Object"&&h.constructor&&(o=h.constructor.name),o==="Map"||o==="Set")return Array.from(h);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return m(h,d)}function m(h,d){(d==null||d>h.length)&&(d=h.length);for(var o=0,l=new Array(d);o<d;o++)l[o]=h[o];return l}function p(){return p=Object.assign||function(h){for(var d=1;d<arguments.length;d++){var o=arguments[d];for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&(h[l]=o[l])}return h},p.apply(this,arguments)}var u=function(){function h(o){var l=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(){l.initialized&&(l.starved=!0),l.buffering=!0},this.onPlaying=function(){l.initialized||(l.initialized=!0),l.buffering=!1},this.applyPlaylistData=function(R){try{l.apply(R,{ot:j.CMCDObjectType.MANIFEST,su:!l.initialized})}catch(E){K.logger.warn("Could not generate manifest CMCD data.",E)}},this.applyFragmentData=function(R){try{var E=R.frag,w=l.hls.levels[E.level],D=l.getObjectType(E),O={d:E.duration*1e3,ot:D};(D===j.CMCDObjectType.VIDEO||D===j.CMCDObjectType.AUDIO||D==j.CMCDObjectType.MUXED)&&(O.br=w.bitrate/1e3,O.tb=l.getTopBandwidth(D),O.bl=l.getBufferLength(D)),l.apply(R,O)}catch(A){K.logger.warn("Could not generate segment CMCD data.",A)}},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||h.uuid(),this.cid=a.contentId,this.useHeaders=a.useHeaders===!0,this.registerListeners())}var d=h.prototype;return d.registerListeners=function(){var l=this.hls;l.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),l.on(X.Events.BUFFER_CREATED,this.onBufferCreated,this)},d.unregisterListeners=function(){var l=this.hls;l.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),l.off(X.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},d.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},d.onMediaAttached=function(l,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},d.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},d.onBufferCreated=function(l,s){var a,R;this.audioBuffer=(a=s.tracks.audio)===null||a===void 0?void 0:a.buffer,this.videoBuffer=(R=s.tracks.video)===null||R===void 0?void 0:R.buffer},d.createData=function(){var l;return{v:j.CMCDVersion,sf:j.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(l=this.media)===null||l===void 0?void 0:l.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},d.apply=function(l,s){s===void 0&&(s={}),p(s,this.createData());var a=s.ot===j.CMCDObjectType.INIT||s.ot===j.CMCDObjectType.VIDEO||s.ot===j.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 R=h.toHeaders(s);if(!Object.keys(R).length)return;l.headers||(l.headers={}),p(l.headers,R)}else{var E=h.toQuery(s);if(!E)return;l.url=h.appendQueryToUri(l.url,E)}},d.getObjectType=function(l){var s=l.type;return s==="subtitle"?j.CMCDObjectType.TIMED_TEXT:l.sn==="initSegment"?j.CMCDObjectType.INIT:s==="audio"?j.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?j.CMCDObjectType.VIDEO:j.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(l){for(var s=0,a=l===j.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,R=L(a),E;!(E=R()).done;){var w=E.value;w.bitrate>s&&(s=w.bitrate)}return s>0?s:NaN},d.getBufferLength=function(l){var s=this.hls.media,a=l===j.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!a||!s)return NaN;var R=B.BufferHelper.bufferInfo(a,s.currentTime,this.config.maxBufferHole);return R.len*1e3},d.createPlaylistLoader=function(){var l=this.config.pLoader,s=this.applyPlaylistData,a=l||this.config.loader;return function(){function R(w){this.loader=void 0,this.loader=new a(w)}var E=R.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(D,O,A){s(D),this.loader.load(D,O,A)},r(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},d.createFragmentLoader=function(){var l=this.config.fLoader,s=this.applyFragmentData,a=l||this.config.loader;return function(){function R(w){this.loader=void 0,this.loader=new a(w)}var E=R.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(D,O,A){s(D),this.loader.load(D,O,A)},r(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},h.uuid=function(){var l=URL.createObjectURL(new Blob),s=l.toString();return URL.revokeObjectURL(l),s.substr(s.lastIndexOf("/")+1)},h.serialize=function(l){for(var s=[],a=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},R=function(F){return Math.round(F)},E=function(F){return R(F/100)*100},w=function(F){return encodeURIComponent(F)},D={br:R,d:R,bl:E,dl:E,mtp:E,nor:w,rtp:E,tb:R},O=Object.keys(l||{}).sort(),A=L(O),C;!(C=A()).done;){var T=C.value,f=l[T];if(!a(f))continue;if(T==="v"&&f===1)continue;if(T=="pr"&&f===1)continue;var S=D[T];S&&(f=S(f));var y=typeof f,b=void 0;T==="ot"||T==="sf"||T==="st"?b=T+"="+f:y==="boolean"?b=T:y==="number"?b=T+"="+f:b=T+"="+JSON.stringify(f),s.push(b)}return s.join(",")},h.toHeaders=function(l){for(var s=Object.keys(l),a={},R=["Object","Request","Session","Status"],E=[{},{},{},{}],w={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},D=0,O=s;D<O.length;D++){var A=O[D],C=w[A]!=null?w[A]:1;E[C][A]=l[A]}for(var T=0;T<E.length;T++){var f=h.serialize(E[T]);f&&(a["CMCD-"+R[T]]=f)}return a},h.toQuery=function(l){return"CMCD="+encodeURIComponent(h.serialize(l))},h.appendQueryToUri=function(l,s){if(!s)return l;var a=l.includes("?")?"&":"?";return""+l+a+s},h}()},"./src/controller/eme-controller.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/events.ts"),j=P("./src/errors.ts"),B=P("./src/utils/logger.ts"),K=P("./src/utils/mediakeys-helper.ts");function H(u,h){for(var d=0;d<h.length;d++){var o=h[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,o.key,o)}}function r(u,h,d){return h&&H(u.prototype,h),d&&H(u,d),u}var L=3,v=function(h,d,o){var l={audioCapabilities:[],videoCapabilities:[]};return h.forEach(function(s){l.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:o.audioRobustness||""})}),d.forEach(function(s){l.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:o.videoRobustness||""})}),[l]},m=function(h,d,o,l){switch(h){case K.KeySystems.WIDEVINE:return v(d,o,l);default:throw new Error("Unknown key-system: "+h)}},p=function(){function u(d){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=d,this._config=d.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 h=u.prototype;return h.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},h._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)},h._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)},h.getLicenseServerUrl=function(o){switch(o){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+o+'"')},h._attemptKeySystemAccess=function(o,l,s){var a=this,R=m(o,l,s,this._drmSystemOptions);B.logger.log("Requesting encrypted media key-system access");var E=this.requestMediaKeySystemAccess(o,R);this.mediaKeysPromise=E.then(function(w){return a._onMediaKeySystemAccessObtained(o,w)}),E.catch(function(w){B.logger.error('Failed to obtain key-system "'+o+'" access:',w)})},h._onMediaKeySystemAccessObtained=function(o,l){var s=this;B.logger.log('Access for key-system "'+o+'" obtained');var a={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:l,mediaKeySystemDomain:o};this._mediaKeysList.push(a);var R=Promise.resolve().then(function(){return l.createMediaKeys()}).then(function(E){return a.mediaKeys=E,B.logger.log('Media-keys created for key-system "'+o+'"'),s._onMediaKeysCreated(),E});return R.catch(function(E){B.logger.error("Failed to create media-keys:",E)}),R},h._onMediaKeysCreated=function(){var o=this;this._mediaKeysList.forEach(function(l){l.mediaKeysSession||(l.mediaKeysSession=l.mediaKeys.createSession(),o._onNewMediaKeySession(l.mediaKeysSession))})},h._onNewMediaKeySession=function(o){var l=this;B.logger.log("New key-system session "+o.sessionId),o.addEventListener("message",function(s){l._onKeySessionMessage(o,s.message)},!1)},h._onKeySessionMessage=function(o,l){B.logger.log("Got EME message event, creating license request"),this._requestLicense(l,function(s){B.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),o.update(s)})},h.onMediaEncrypted=function(o){var l=this;if(B.logger.log('Media is encrypted using "'+o.initDataType+'" init data type'),!this.mediaKeysPromise){B.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(R){if(!l._media)return;l._attemptSetMediaKeys(R),l._generateRequestWithPreferredKeySession(o.initDataType,o.initData)};this.mediaKeysPromise.then(s).catch(s)},h._attemptSetMediaKeys=function(o){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var l=this._mediaKeysList[0];if(!l||!l.mediaKeys){B.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}B.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(l.mediaKeys),this._hasSetMediaKeys=!0}},h._generateRequestWithPreferredKeySession=function(o,l){var s=this,a=this._mediaKeysList[0];if(!a){B.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(a.mediaKeysSessionInitialized){B.logger.warn("Key-Session already initialized but requested again");return}var R=a.mediaKeysSession;if(!R){B.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!l){B.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}B.logger.log('Generating key-session request for "'+o+'" init data type'),a.mediaKeysSessionInitialized=!0,R.generateRequest(o,l).then(function(){B.logger.debug("Key-session generation succeeded")}).catch(function(E){B.logger.error("Error generating key-session request:",E),s.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},h._createLicenseXhr=function(o,l,s){var a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,a,o,l,s);var R=this._licenseXhrSetup;if(R)try{R.call(this.hls,a,o),R=void 0}catch(E){B.logger.error(E)}try{a.readyState||a.open("POST",o,!0),R&&R.call(this.hls,a,o)}catch(E){throw new Error("issue setting up KeySystem license XHR "+E)}return a},h._onLicenseRequestReadyStageChange=function(o,l,s,a){switch(o.readyState){case 4:if(o.status===200){this._requestLicenseFailureCount=0,B.logger.log("License request succeeded");var R=o.response,E=this._licenseResponseCallback;if(E)try{R=E.call(this.hls,o,l)}catch(D){B.logger.error(D)}a(R)}else{if(B.logger.error("License Request XHR failed ("+l+"). Status: "+o.status+" ("+o.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>L){this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var w=L-this._requestLicenseFailureCount+1;B.logger.warn("Retrying license request, "+w+" attempts left"),this._requestLicense(s,a)}break}},h._generateLicenseRequestChallenge=function(o,l){switch(o.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return l}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},h._requestLicense=function(o,l){B.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){B.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var a=this.getLicenseServerUrl(s.mediaKeySystemDomain),R=this._createLicenseXhr(a,o,l);B.logger.log("Sending license request to URL: "+a);var E=this._generateLicenseRequestChallenge(s,o);R.send(E)}catch(w){B.logger.error("Failure requesting DRM license: "+w),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},h.onMediaAttached=function(o,l){if(!this._emeEnabled)return;var s=l.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},h.onMediaDetached=function(){var o=this._media,l=this._mediaKeysList;if(!o)return;o.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(l.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return o.setMediaKeys(null)}).catch(function(){})},h.onManifestParsed=function(o,l){if(!this._emeEnabled)return;var s=l.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),a=l.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,s,a)},r(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();J.default=p},"./src/controller/fps-controller.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/events.ts"),j=P("./src/utils/logger.ts"),B=function(){function K(r){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=r,this.registerListeners()}var H=K.prototype;return H.setStreamController=function(L){this.streamController=L},H.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},H.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},H.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},H.onMediaAttaching=function(L,v){var m=this.hls.config;if(m.capLevelOnFPSDrop){var p=v.media instanceof self.HTMLVideoElement?v.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)}},H.checkFPS=function(L,v,m){var p=performance.now();if(v){if(this.lastTime){var u=p-this.lastTime,h=m-this.lastDroppedFrames,d=v-this.lastDecodedFrames,o=1e3*h/u,l=this.hls;if(l.trigger(X.Events.FPS_DROP,{currentDropped:h,currentDecoded:d,totalDroppedFrames:m}),o>0&&h>l.config.fpsDroppedMonitoringThreshold*d){var s=l.currentLevel;j.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=s)&&(s=s-1,l.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:l.currentLevel}),l.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=m,this.lastDecodedFrames=v}},H.checkFPSInterval=function(){var L=this.media;if(L)if(this.isVideoPlaybackQualityAvailable){var v=L.getVideoPlaybackQuality();this.checkFPS(L,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(L,L.webkitDecodedFrameCount,L.webkitDroppedFrameCount)},K}();J.default=B},"./src/controller/fragment-finders.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"findFragmentByPDT",function(){return B}),P.d(J,"findFragmentByPTS",function(){return K}),P.d(J,"fragmentWithinToleranceTest",function(){return H}),P.d(J,"pdtWithinToleranceTest",function(){return r}),P.d(J,"findFragWithCC",function(){return L});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/binary-search.ts");function B(v,m,p){if(m===null||!Array.isArray(v)||!v.length||!Object(X.isFiniteNumber)(m))return null;var u=v[0].programDateTime;if(m<(u||0))return null;var h=v[v.length-1].endProgramDateTime;if(m>=(h||0))return null;p=p||0;for(var d=0;d<v.length;++d){var o=v[d];if(r(m,p,o))return o}return null}function K(v,m,p,u){p===void 0&&(p=0),u===void 0&&(u=0);var h=null;if(v?h=m[v.sn-m[0].sn+1]||null:p===0&&m[0].start===0&&(h=m[0]),h&&H(p,u,h)===0)return h;var d=j.default.search(m,H.bind(null,p,u));return d||h}function H(v,m,p){v===void 0&&(v=0),m===void 0&&(m=0);var u=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-u<=v?1:p.start-u>v&&p.start?-1:0}function r(v,m,p){var u=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,h=p.endProgramDateTime||0;return h-u>v}function L(v,m){return j.default.search(v,function(p){return p.cc<m?1:p.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"FragmentState",function(){return B}),P.d(J,"FragmentTracker",function(){return K});var X=P("./src/events.ts"),j=P("./src/types/loader.ts"),B;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(B||(B={}));var K=function(){function L(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 v=L.prototype;return v._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)},v._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)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(p,u){if(u===j.PlaylistLevelType.MAIN){var h=this.activeFragment,d=this.activeParts;if(!h)return null;if(d)for(var o=d.length;o--;){var l=d[o],s=l?l.end:h.appendedPTS;if(l.start<=p&&s!==void 0&&p<=s)return o>9&&(this.activeParts=d.slice(o-9)),l}else if(h.start<=p&&h.appendedPTS!==void 0&&p<=h.appendedPTS)return h}return this.getBufferedFrag(p,u)},v.getBufferedFrag=function(p,u){for(var h=this.fragments,d=Object.keys(h),o=d.length;o--;){var l=h[d[o]];if((l==null?void 0:l.body.type)===u&&l.buffered){var s=l.body;if(s.start<=p&&p<=s.end)return s}}return null},v.detectEvictedFragments=function(p,u,h){var d=this;Object.keys(this.fragments).forEach(function(o){var l=d.fragments[o];if(!l)return;if(!l.buffered){l.body.type===h&&d.removeFragment(l.body);return}var s=l.range[p];if(!s)return;s.time.some(function(a){var R=!d.isTimeBuffered(a.startPTS,a.endPTS,u);return R&&d.removeFragment(l.body),R})})},v.detectPartialFragments=function(p){var u=this,h=this.timeRanges,d=p.frag,o=p.part;if(!h||d.sn==="initSegment")return;var l=r(d),s=this.fragments[l];if(!s)return;Object.keys(h).forEach(function(a){var R=d.elementaryStreams[a];if(!R)return;var E=h[a],w=o!==null||R.partial===!0;s.range[a]=u.getBufferedTimes(d,o,w,E)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},v.fragBuffered=function(p){var u=r(p),h=this.fragments[u];h&&(h.backtrack=h.loaded=null,h.buffered=!0)},v.getBufferedTimes=function(p,u,h,d){for(var o={time:[],partial:h},l=u?u.start:p.start,s=u?u.end:p.end,a=p.minEndPTS||s,R=p.maxStartPTS||l,E=0;E<d.length;E++){var w=d.start(E)-this.bufferPadding,D=d.end(E)+this.bufferPadding;if(R>=w&&a<=D){o.time.push({startPTS:Math.max(l,d.start(E)),endPTS:Math.min(s,d.end(E))});break}else if(l<D&&s>w)o.partial=!0,o.time.push({startPTS:Math.max(l,d.start(E)),endPTS:Math.min(s,d.end(E))});else if(s<=w)break}return o},v.getPartialFragment=function(p){var u=null,h,d,o,l=0,s=this.bufferPadding,a=this.fragments;return Object.keys(a).forEach(function(R){var E=a[R];if(!E)return;H(E)&&(d=E.body.start-s,o=E.body.end+s,p>=d&&p<=o&&(h=Math.min(p-d,o-p),l<=h&&(u=E.body,l=h)))}),u},v.getState=function(p){var u=r(p),h=this.fragments[u];return h?h.buffered?H(h)?B.PARTIAL:B.OK:h.backtrack?B.BACKTRACKED:B.APPENDING:B.NOT_LOADED},v.backtrack=function(p,u){var h=r(p),d=this.fragments[h];if(!d||d.backtrack)return null;var o=d.backtrack=u||d.loaded;return d.loaded=null,o},v.getBacktrackData=function(p){var u=r(p),h=this.fragments[u];if(h){var d,o=h.backtrack;if(o!=null&&(d=o.payload)!==null&&d!==void 0&&d.byteLength)return o;this.removeFragment(p)}return null},v.isTimeBuffered=function(p,u,h){for(var d,o,l=0;l<h.length;l++){if(d=h.start(l)-this.bufferPadding,o=h.end(l)+this.bufferPadding,p>=d&&u<=o)return!0;if(u<=d)return!1}return!1},v.onFragLoaded=function(p,u){var h=u.frag,d=u.part;if(h.sn==="initSegment"||h.bitrateTest||d)return;var o=r(h);this.fragments[o]={body:h,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(p,u){var h=this,d=u.frag,o=u.part,l=u.timeRanges;if(d.type===j.PlaylistLevelType.MAIN)if(this.activeFragment=d,o){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(o)}else this.activeParts=null;this.timeRanges=l,Object.keys(l).forEach(function(a){var R=l[a];if(h.detectEvictedFragments(a,R),!o)for(var E=0;E<R.length;E++)d.appendedPTS=Math.max(R.end(E),d.appendedPTS||0)})},v.onFragBuffered=function(p,u){this.detectPartialFragments(u)},v.hasFragment=function(p){var u=r(p);return!!this.fragments[u]},v.removeFragmentsInRange=function(p,u,h){var d=this;Object.keys(this.fragments).forEach(function(o){var l=d.fragments[o];if(!l)return;if(l.buffered){var s=l.body;s.type===h&&s.start<u&&s.end>p&&d.removeFragment(s)}})},v.removeFragment=function(p){var u=r(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[u]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function H(L){var v,m;return L.buffered&&(((v=L.range.video)===null||v===void 0?void 0:v.partial)||((m=L.range.audio)===null||m===void 0?void 0:m.partial))}function r(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"STALL_MINIMUM_DURATION_MS",function(){return H}),P.d(J,"MAX_START_GAP_JUMP",function(){return r}),P.d(J,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),P.d(J,"SKIP_BUFFER_RANGE_START",function(){return v}),P.d(J,"default",function(){return m});var X=P("./src/utils/buffer-helper.ts"),j=P("./src/errors.ts"),B=P("./src/events.ts"),K=P("./src/utils/logger.ts"),H=250,r=2,L=.1,v=.05,m=function(){function p(h,d,o,l){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=h,this.media=d,this.fragmentTracker=o,this.hls=l}var u=p.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(d){var o=this.config,l=this.media,s=this.stalled,a=l.currentTime,R=l.seeking,E=this.seeking&&!R,w=!this.seeking&&R;if(this.seeking=R,a!==d){if(this.moved=!0,s!==null){if(this.stallReported){var D=self.performance.now()-s;K.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((w||E)&&(this.stalled=null),l.paused||l.ended||l.playbackRate===0||!X.BufferHelper.getBuffered(l).length)return;var O=X.BufferHelper.bufferInfo(l,a,0),A=O.len>0,C=O.nextStart||0;if(!A&&!C)return;if(R){var T=O.len>r,f=!C||C-a>r&&!this.fragmentTracker.getPartialFragment(a);if(T||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var S,y=Math.max(C,O.start||0)-a,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,U=b==null||((S=b.details)===null||S===void 0)?void 0:S.live,F=U?b.details.targetduration*2:r;if(y>0&&y<=F){this._trySkipBufferHole(null);return}}var _=self.performance.now();if(s===null){this.stalled=_;return}var M=_-s;!R&&M>=H&&this._reportStall(O.len);var I=X.BufferHelper.bufferInfo(l,a,o.maxBufferHole);this._tryFixBufferStall(I,M)},u._tryFixBufferStall=function(d,o){var l=this.config,s=this.fragmentTracker,a=this.media,R=a.currentTime,E=s.getPartialFragment(R);if(E){var w=this._trySkipBufferHole(E);if(w)return}d.len>l.maxBufferHole&&o>l.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(d){var o=this.hls,l=this.media,s=this.stallReported;s||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+l.currentTime+" due to low buffer (buffer="+d+")"),o.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},u._trySkipBufferHole=function(d){for(var o=this.config,l=this.hls,s=this.media,a=s.currentTime,R=0,E=X.BufferHelper.getBuffered(s),w=0;w<E.length;w++){var D=E.start(w);if(a+o.maxBufferHole>=R&&a<D){var O=Math.max(D+v,s.currentTime+L);return K.logger.warn("skipping hole, adjusting currentTime from "+a+" to "+O),this.moved=!0,this.stalled=null,s.currentTime=O,d&&l.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+a+" to "+O,frag:d}),O}R=E.end(w)}return 0},u._tryNudgeBuffer=function(){var d=this.config,o=this.hls,l=this.media,s=l.currentTime,a=(this.nudgeRetry||0)+1;if(this.nudgeRetry=a,a<d.nudgeMaxRetry){var R=s+a*d.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+s+" to "+R),l.currentTime=R,o.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+d.nudgeMaxRetry+" nudges"),o.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/events.ts"),j=P("./src/utils/texttrack-utils.ts"),B=P("./src/demux/id3.ts"),K=.25,H=function(){function r(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var L=r.prototype;return L.destroy=function(){this._unregisterListeners()},L._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)},L._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)},L.onMediaAttached=function(m,p){this.media=p.media},L.onMediaDetaching=function(){if(!this.id3Track)return;Object(j.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},L.getID3Track=function(m){if(!this.media)return;for(var p=0;p<m.length;p++){var u=m[p];if(u.kind==="metadata"&&u.label==="id3")return Object(j.sendAddTrackEvent)(u,this.media),u}return this.media.addTextTrack("metadata","id3")},L.onFragParsingMetadata=function(m,p){if(!this.media)return;var u=p.frag,h=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var d=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<h.length;o++){var l=B.getID3Frames(h[o].data);if(l){var s=h[o].pts,a=o<h.length-1?h[o+1].pts:u.end,R=a-s;R<=0&&(a=s+K);for(var E=0;E<l.length;E++){var w=l[E];if(!B.isTimeStampFrame(w)){var D=new d(s,a,"");D.value=w,this.id3Track.addCue(D)}}}}},L.onBufferFlushing=function(m,p){var u=p.startOffset,h=p.endOffset,d=p.type;if(!d||d==="audio"){var o=this.id3Track;o&&Object(j.removeCuesInRange)(o,u,h)}},r}();J.default=H},"./src/controller/latency-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return r});var X=P("./src/errors.ts"),j=P("./src/events.ts"),B=P("./src/utils/logger.ts");function K(L,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(L,p.key,p)}}function H(L,v,m){return v&&K(L.prototype,v),m&&K(L,m),L}var r=function(){function L(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 v=L.prototype;return v.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},v.registerListeners=function(){this.hls.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(j.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){this.hls.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(j.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(j.Events.ERROR,this.onError)},v.onMediaAttached=function(p,u){this.media=u.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},v.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},v.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},v.onLevelUpdated=function(p,u){var h=u.details;this.levelDetails=h,h.advanced&&this.timeupdate(),!h.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},v.onError=function(p,u){if(u.details!==X.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,B.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.timeupdate=function(){var p=this.media,u=this.levelDetails;if(!p||!u)return;this.currentTime=p.currentTime;var h=this.computeLatency();if(h===null)return;this._latency=h;var d=this.config,o=d.lowLatencyMode,l=d.maxLiveSyncPlaybackRate;if(!o||l===1)return;var s=this.targetLatency;if(s===null)return;var a=h-s,R=Math.min(this.maxLatency,s+u.targetduration),E=a<R;if(u.live&&E&&a>.05&&this.forwardBufferLength>1){var w=Math.min(2,Math.max(1,l)),D=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;p.playbackRate=Math.min(w,Math.max(1,D))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},v.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},v.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},H(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,u=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:u?p.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var u=p.holdBack,h=p.partHoldBack,d=p.targetduration,o=this.config,l=o.liveSyncDuration,s=o.liveSyncDurationCount,a=o.lowLatencyMode,R=this.hls.userConfig,E=a&&h||u;(R.liveSyncDuration||R.liveSyncDurationCount||E===0)&&(E=l!==void 0?l:s*d);var w=d,D=1;return E+Math.min(this.stallCount*D,w)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),u=this.targetLatency,h=this.levelDetails;if(p===null||u===null||h===null)return null;var d=h.edge,o=p-u-this.edgeStalled,l=d-h.totalduration,s=d-(this.config.lowLatencyMode&&h.partTarget||h.targetduration);return Math.min(Math.max(l,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 u=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-u,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,u=this.levelDetails;if(!p||!u)return 0;var h=p.buffered.length;return h?p.buffered.end(h-1):u.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return o});var X=P("./src/types/level.ts"),j=P("./src/events.ts"),B=P("./src/errors.ts"),K=P("./src/utils/codecs.ts"),H=P("./src/controller/level-helper.ts"),r=P("./src/controller/base-playlist-controller.ts"),L=P("./src/types/loader.ts");function v(){return v=Object.assign||function(l){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var R in a)Object.prototype.hasOwnProperty.call(a,R)&&(l[R]=a[R])}return l},v.apply(this,arguments)}function m(l,s){for(var a=0;a<s.length;a++){var R=s[a];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(l,R.key,R)}}function p(l,s,a){return s&&m(l.prototype,s),a&&m(l,a),l}function u(l,s){l.prototype=Object.create(s.prototype),l.prototype.constructor=l,h(l,s)}function h(l,s){return h=Object.setPrototypeOf||function(R,E){return R.__proto__=E,R},h(l,s)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),o=function(l){u(s,l);function s(R){var E;return E=l.call(this,R,"[level-controller]")||this,E._levels=[],E._firstLevel=-1,E._startLevel=void 0,E.currentLevelIndex=-1,E.manualLevelIndex=-1,E.onParsedComplete=void 0,E._registerListeners(),E}var a=s.prototype;return a._registerListeners=function(){var E=this.hls;E.on(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),E.on(j.Events.ERROR,this.onError,this)},a._unregisterListeners=function(){var E=this.hls;E.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),E.off(j.Events.ERROR,this.onError,this)},a.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,l.prototype.destroy.call(this)},a.startLoad=function(){var E=this._levels;E.forEach(function(w){w.loadError=0}),l.prototype.startLoad.call(this)},a.onManifestLoaded=function(E,w){var D=[],O=[],A=[],C,T={},f,S=!1,y=!1,b=!1;if(w.levels.forEach(function(M){var I=M.attrs;S=S||!!(M.width&&M.height),y=y||!!M.videoCodec,b=b||!!M.audioCodec,d&&M.audioCodec&&M.audioCodec.indexOf("mp4a.40.34")!==-1&&(M.audioCodec=void 0);var g=M.bitrate+"-"+M.attrs.RESOLUTION+"-"+M.attrs.CODECS;f=T[g],f?f.url.push(M.url):(f=new X.Level(M),T[g]=f,D.push(f)),I&&(I.AUDIO&&Object(H.addGroupId)(f,"audio",I.AUDIO),I.SUBTITLES&&Object(H.addGroupId)(f,"text",I.SUBTITLES))}),(S||y)&&b&&(D=D.filter(function(M){var I=M.videoCodec,g=M.width,W=M.height;return!!I||!!(g&&W)})),D=D.filter(function(M){var I=M.audioCodec,g=M.videoCodec;return(!I||Object(K.isCodecSupportedInMp4)(I,"audio"))&&(!g||Object(K.isCodecSupportedInMp4)(g,"video"))}),w.audioTracks&&(O=w.audioTracks.filter(function(M){return!M.audioCodec||Object(K.isCodecSupportedInMp4)(M.audioCodec,"audio")}),Object(H.assignTrackIdsByGroup)(O)),w.subtitles&&(A=w.subtitles,Object(H.assignTrackIdsByGroup)(A)),D.length>0){C=D[0].bitrate,D.sort(function(M,I){return M.bitrate-I.bitrate}),this._levels=D;for(var U=0;U<D.length;U++)if(D[U].bitrate===C){this._firstLevel=U,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+C);break}var F=b&&!y,_={levels:D,audioTracks:O,subtitleTracks:A,firstLevel:this._firstLevel,stats:w.stats,audio:b,video:y,altAudio:!F&&O.some(function(M){return!!M.url})};this.hls.trigger(j.Events.MANIFEST_PARSED,_),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(j.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:w.url,reason:"no level with compatible codecs found in manifest"})},a.onError=function(E,w){if(l.prototype.onError.call(this,E,w),w.fatal)return;var D=w.context,O=this._levels[this.currentLevelIndex];if(D&&(D.type===L.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&D.groupId===O.audioGroupIds[O.urlId]||D.type===L.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&D.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var A=!1,C=!0,T;switch(w.details){case B.ErrorDetails.FRAG_LOAD_ERROR:case B.ErrorDetails.FRAG_LOAD_TIMEOUT:case B.ErrorDetails.KEY_LOAD_ERROR:case B.ErrorDetails.KEY_LOAD_TIMEOUT:if(w.frag){var f=this._levels[w.frag.level];f?(f.fragmentError++,f.fragmentError>this.hls.config.fragLoadingMaxRetry&&(T=w.frag.level)):T=w.frag.level}break;case B.ErrorDetails.LEVEL_LOAD_ERROR:case B.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(C=!1),T=D.level),A=!0;break;case B.ErrorDetails.REMUX_ALLOC_ERROR:T=w.level,A=!0;break}T!==void 0&&this.recoverLevel(w,T,A,C)},a.recoverLevel=function(E,w,D,O){var A=E.details,C=this._levels[w];if(C.loadError++,D){var T=this.retryLoadingOrFail(E);if(T)E.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var f=C.url.length;if(f>1&&C.loadError<f)E.levelRetry=!0,this.redundantFailover(w);else if(this.manualLevelIndex===-1){var S=w===0?this._levels.length-1:w-1;this.currentLevelIndex!==S&&this._levels[S].loadError===0&&(this.warn(A+": switch to "+S),E.levelRetry=!0,this.hls.nextAutoLevel=S)}}},a.redundantFailover=function(E){var w=this._levels[E],D=w.url.length;if(D>1){var O=(w.urlId+1)%D;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(A){A.urlId=O}),this.level=E}},a.onFragLoaded=function(E,w){var D=w.frag;if(D!==void 0&&D.type===L.PlaylistLevelType.MAIN){var O=this._levels[D.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},a.onLevelLoaded=function(E,w){var D,O=w.level,A=w.details,C=this._levels[O];if(!C){var T;this.warn("Invalid level index "+O),(T=w.deliveryDirectives)!==null&&T!==void 0&&T.skip&&(A.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(C.fragmentError===0&&(C.loadError=0,this.retryCount=0),this.playlistLoaded(O,w,C.details)):(D=w.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(A.deltaUpdateFailed=!0)},a.onAudioTrackSwitched=function(E,w){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var O=-1,A=this.hls.audioTracks[w.id].groupId,C=0;C<D.audioGroupIds.length;C++)if(D.audioGroupIds[C]===A){O=C;break}O!==D.urlId&&(D.urlId=O,this.startLoad())}},a.loadPlaylist=function(E){var w=this.currentLevelIndex,D=this._levels[w];if(this.canLoad&&D&&D.url.length>0){var O=D.urlId,A=D.url[O];if(E)try{A=E.addDirectives(A)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Attempt loading level index "+w+(E?" at sn "+E.msn+" part "+E.part:"")+" with URL-id "+O+" "+A),this.clearTimer(),this.hls.trigger(j.Events.LEVEL_LOADING,{url:A,level:w,id:O,deliveryDirectives:E||null})}},a.removeLevel=function(E,w){var D=function(C,T){return T!==w},O=this._levels.filter(function(A,C){return C!==E?!0:A.url.length>1&&w!==void 0?(A.url=A.url.filter(D),A.audioGroupIds&&(A.audioGroupIds=A.audioGroupIds.filter(D)),A.textGroupIds&&(A.textGroupIds=A.textGroupIds.filter(D)),A.urlId=0,!0):!1}).map(function(A,C){var T=A.details;return T!=null&&T.fragments&&T.fragments.forEach(function(f){f.level=C}),A});this._levels=O,this.hls.trigger(j.Events.LEVELS_UPDATED,{levels:O})},p(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(E){var w,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===E&&(w=D[E])!==null&&w!==void 0&&w.details)return;if(E<0||E>=D.length){var O=E<0;if(this.hls.trigger(j.Events.ERROR,{type:B.ErrorTypes.OTHER_ERROR,details:B.ErrorDetails.LEVEL_SWITCH_ERROR,level:E,fatal:O,reason:"invalid level idx"}),O)return;E=Math.min(E,D.length-1)}this.clearTimer();var A=this.currentLevelIndex,C=D[A],T=D[E];this.log("switching to level "+E+" from "+A),this.currentLevelIndex=E;var f=v({},T,{level:E,maxBitrate:T.maxBitrate,uri:T.uri,urlId:T.urlId});delete f._urlId,this.hls.trigger(j.Events.LEVEL_SWITCHING,f);var S=T.details;if(!S||S.live){var y=this.switchParams(T.uri,C==null?void 0:C.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(E){this.manualLevelIndex=E,this._startLevel===void 0&&(this._startLevel=E),E!==-1&&(this.level=E)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(E){this._firstLevel=E}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var E=this.hls.config.startLevel;return E!==void 0?E:this._firstLevel}else return this._startLevel},set:function(E){this._startLevel=E}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(E){this.level=E,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=E)}}]),s}(r.default)},"./src/controller/level-helper.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"addGroupId",function(){return B}),P.d(J,"assignTrackIdsByGroup",function(){return K}),P.d(J,"updatePTS",function(){return H}),P.d(J,"updateFragPTSDTS",function(){return L}),P.d(J,"mergeDetails",function(){return v}),P.d(J,"mapPartIntersection",function(){return m}),P.d(J,"mapFragmentIntersection",function(){return p}),P.d(J,"adjustSliding",function(){return u}),P.d(J,"addSliding",function(){return h}),P.d(J,"computeReloadInterval",function(){return d}),P.d(J,"getFragmentWithSN",function(){return o}),P.d(J,"getPartWith",function(){return l});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts");function B(s,a,R){switch(a){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(R);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(R);break}}function K(s){var a={};s.forEach(function(R){var E=R.groupId||"";R.id=a[E]=a[E]||0,a[E]++})}function H(s,a,R){var E=s[a],w=s[R];r(E,w)}function r(s,a){var R=a.startPTS;if(Object(X.isFiniteNumber)(R)){var E=0,w;a.sn>s.sn?(E=R-s.start,w=s):(E=s.start-R,w=a),w.duration!==E&&(w.duration=E)}else if(a.sn>s.sn){var D=s.cc===a.cc;D&&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 L(s,a,R,E,w,D){var O=E-R;O<=0&&(j.logger.warn("Fragment should have a positive duration",a),E=R+a.duration,D=w+a.duration);var A=R,C=E,T=a.startPTS,f=a.endPTS;if(Object(X.isFiniteNumber)(T)){var S=Math.abs(T-R);Object(X.isFiniteNumber)(a.deltaPTS)?a.deltaPTS=Math.max(S,a.deltaPTS):a.deltaPTS=S,A=Math.max(R,T),R=Math.min(R,T),w=Math.min(w,a.startDTS),C=Math.min(E,f),E=Math.max(E,f),D=Math.max(D,a.endDTS)}a.duration=E-R;var y=R-a.start;a.appendedPTS=E,a.start=a.startPTS=R,a.maxStartPTS=A,a.startDTS=w,a.endPTS=E,a.minEndPTS=C,a.endDTS=D;var b=a.sn;if(!s||b<s.startSN||b>s.endSN)return 0;var U,F=b-s.startSN,_=s.fragments;for(_[F]=a,U=F;U>0;U--)r(_[U],_[U-1]);for(U=F;U<_.length-1;U++)r(_[U],_[U+1]);return s.fragmentHint&&r(_[_.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,y}function v(s,a){for(var R=null,E=s.fragments,w=E.length-1;w>=0;w--){var D=E[w].initSegment;if(D){R=D;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var O=0,A;if(p(s,a,function(U,F){U.relurl&&(O=U.cc-F.cc),Object(X.isFiniteNumber)(U.startPTS)&&Object(X.isFiniteNumber)(U.endPTS)&&(F.start=F.startPTS=U.startPTS,F.startDTS=U.startDTS,F.appendedPTS=U.appendedPTS,F.maxStartPTS=U.maxStartPTS,F.endPTS=U.endPTS,F.endDTS=U.endDTS,F.minEndPTS=U.minEndPTS,F.duration=U.endPTS-U.startPTS,F.duration&&(A=F),a.PTSKnown=a.alignedSliding=!0),F.elementaryStreams=U.elementaryStreams,F.loader=U.loader,F.stats=U.stats,F.urlId=U.urlId,U.initSegment&&(F.initSegment=U.initSegment,R=U.initSegment)}),R){var C=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;C.forEach(function(U){var F;(!U.initSegment||U.initSegment.relurl===((F=R)===null||F===void 0?void 0:F.relurl))&&(U.initSegment=R)})}if(a.skippedSegments&&(a.deltaUpdateFailed=a.fragments.some(function(U){return!U}),a.deltaUpdateFailed)){j.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var T=a.skippedSegments;T--;)a.fragments.shift();a.startSN=a.fragments[0].sn,a.startCC=a.fragments[0].cc}var f=a.fragments;if(O){j.logger.warn("discontinuity sliding from playlist, take drift into account");for(var S=0;S<f.length;S++)f[S].cc+=O}a.skippedSegments&&(a.startCC=a.fragments[0].cc),m(s.partList,a.partList,function(U,F){F.elementaryStreams=U.elementaryStreams,F.stats=U.stats}),A?L(a,A,A.startPTS,A.endPTS,A.startDTS,A.endDTS):u(s,a),f.length&&(a.totalduration=a.edge-f[0].start),a.driftStartTime=s.driftStartTime,a.driftStart=s.driftStart;var y=a.advancedDateTime;if(a.advanced&&y){var b=a.edge;a.driftStart||(a.driftStartTime=y,a.driftStart=b),a.driftEndTime=y,a.driftEnd=b}else a.driftEndTime=s.driftEndTime,a.driftEnd=s.driftEnd,a.advancedDateTime=s.advancedDateTime}function m(s,a,R){if(s&&a)for(var E=0,w=0,D=s.length;w<=D;w++){var O=s[w],A=a[w+E];O&&A&&O.index===A.index&&O.fragment.sn===A.fragment.sn?R(O,A):E--}}function p(s,a,R){for(var E=a.skippedSegments,w=Math.max(s.startSN,a.startSN)-a.startSN,D=(s.fragmentHint?1:0)+(E?a.endSN:Math.min(s.endSN,a.endSN))-a.startSN,O=a.startSN-s.startSN,A=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,C=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,T=w;T<=D;T++){var f=C[O+T],S=A[T];E&&!S&&T<E&&(S=a.fragments[T]=f),f&&S&&R(f,S)}}function u(s,a){var R=a.startSN+a.skippedSegments-s.startSN,E=s.fragments;if(R<0||R>=E.length)return;h(a,E[R].start)}function h(s,a){if(a){for(var R=s.fragments,E=s.skippedSegments;E<R.length;E++)R[E].start+=a;s.fragmentHint&&(s.fragmentHint.start+=a)}}function d(s,a){var R=1e3*s.levelTargetDuration,E=R/2,w=s.age,D=w>0&&w<R*3,O=a.loading.end-a.loading.start,A,C=s.availabilityDelay;if(s.updated===!1)if(D){var T=333*s.misses;A=Math.max(Math.min(E,O*2),T),s.availabilityDelay=(s.availabilityDelay||0)+A}else A=E;else D?(C=Math.min(C||R/2,w),s.availabilityDelay=C,A=C+R-w):A=R-O;return Math.round(A)}function o(s,a,R){if(!s||!s.details)return null;var E=s.details,w=E.fragments[a-E.startSN];return w||(w=E.fragmentHint,w&&w.sn===a?w:a<E.startSN&&R&&R.sn===a?R:null)}function l(s,a,R){if(!s||!s.details)return null;var E=s.details.partList;if(E)for(var w=E.length;w--;){var D=E[w];if(D.index===R&&D.fragment.sn===a)return D}return null}},"./src/controller/stream-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return E});var X=P("./src/polyfills/number.ts"),j=P("./src/controller/base-stream-controller.ts"),B=P("./src/is-supported.ts"),K=P("./src/events.ts"),H=P("./src/utils/buffer-helper.ts"),r=P("./src/controller/fragment-tracker.ts"),L=P("./src/types/loader.ts"),v=P("./src/loader/fragment.ts"),m=P("./src/demux/transmuxer-interface.ts"),p=P("./src/types/transmuxer.ts"),u=P("./src/controller/gap-controller.ts"),h=P("./src/errors.ts"),d=P("./src/utils/logger.ts");function o(w,D){for(var O=0;O<D.length;O++){var A=D[O];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(w,A.key,A)}}function l(w,D,O){return D&&o(w.prototype,D),O&&o(w,O),w}function s(w,D){w.prototype=Object.create(D.prototype),w.prototype.constructor=w,a(w,D)}function a(w,D){return a=Object.setPrototypeOf||function(A,C){return A.__proto__=C,A},a(w,D)}var R=100,E=function(w){s(D,w);function D(A,C){var T;return T=w.call(this,A,C,"[stream-controller]")||this,T.audioCodecSwap=!1,T.gapController=null,T.level=-1,T._forceStartLoad=!1,T.altAudio=!1,T.audioOnly=!1,T.fragPlaying=null,T.onvplaying=null,T.onvseeked=null,T.fragLastKbps=0,T.stalled=!1,T.couldBacktrack=!1,T.audioCodecSwitch=!1,T.videoBuffer=null,T._registerListeners(),T}var O=D.prototype;return O._registerListeners=function(){var C=this.hls;C.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),C.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),C.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),C.on(K.Events.ERROR,this.onError,this),C.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),C.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),C.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var C=this.hls;C.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),C.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),C.off(K.Events.ERROR,this.onError,this),C.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),C.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),C.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(C){if(this.levels){var T=this.lastCurrentTime,f=this.hls;if(this.stopLoad(),this.setInterval(R),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var S=f.startLevel;S===-1&&(f.config.testBandwidth?(S=0,this.bitrateTest=!0):S=f.nextAutoLevel),this.level=f.nextLoadLevel=S,this.loadedmetadata=!1}T>0&&C===-1&&(this.log("Override startPosition with lastCurrentTime @"+T.toFixed(3)),C=T),this.state=j.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=C,this.tick()}else this._forceStartLoad=!0,this.state=j.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,w.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_LEVEL:{var C,T=this.levels,f=this.level,S=T==null||((C=T[f])===null||C===void 0)?void 0:C.details;if(S&&(!S.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(S))break;this.state=j.State.IDLE;break}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var y,b=self.performance.now(),U=this.retryDate;(!U||b>=U||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=j.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){w.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var C,T,f=this.hls,S=this.levelLastLoaded,y=this.levels,b=this.media,U=f.config,F=f.nextLoadLevel;if(S===null||!b&&(this.startFragRequested||!U.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[F])return;var _=y[F];this.level=f.nextLoadLevel=F;var M=_.details;if(!M||this.state===j.State.WAITING_LEVEL||M.live&&this.levelLastLoaded!==F){this.state=j.State.WAITING_LEVEL;return}var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,L.PlaylistLevelType.MAIN);if(I===null)return;var g=I.len,W=this.getMaxBufferLength(_.maxBitrate);if(g>=W)return;if(this._streamEnded(I,M)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,$),this.state=j.State.ENDED;return}var ne=I.end,oe=this.getNextFragment(ne,M);if(this.couldBacktrack&&!this.fragPrevious&&oe&&oe.sn!=="initSegment"){var we=oe.sn-M.startSN;we>1&&(oe=M.fragments[we-1],this.fragmentTracker.removeFragment(oe))}if(oe&&this.fragmentTracker.getState(oe)===r.FragmentState.OK&&this.nextLoadPosition>ne){var ge=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,ge,L.PlaylistLevelType.MAIN),oe=this.getNextFragment(this.nextLoadPosition,M)}if(!oe)return;oe.initSegment&&!oe.initSegment.data&&!this.bitrateTest&&(oe=oe.initSegment),((C=oe.decryptdata)===null||C===void 0?void 0:C.keyFormat)==="identity"&&!((T=oe.decryptdata)!==null&&T!==void 0&&T.key)?this.loadKey(oe,M):this.loadFragment(oe,M,ne)},O.loadFragment=function(C,T,f){var S,y=this.fragmentTracker.getState(C);if(this.fragCurrent=C,y===r.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(C);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else y=r.FragmentState.NOT_LOADED}y===r.FragmentState.NOT_LOADED||y===r.FragmentState.PARTIAL?C.sn==="initSegment"?this._loadInitSegment(C):this.bitrateTest?(C.bitrateTest=!0,this.log("Fragment "+C.sn+" of level "+C.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(C)):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,C,T,f)):y===r.FragmentState.APPENDING?this.reduceMaxBufferLength(C.duration)&&this.fragmentTracker.removeFragment(C):((S=this.media)===null||S===void 0?void 0:S.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(C){var T=this.fragmentTracker.getAppendedFrag(C,L.PlaylistLevelType.MAIN);return T&&"fragment"in T?T.fragment:T},O.getBufferedFrag=function(C){return this.fragmentTracker.getBufferedFrag(C,L.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(C){return C?this.getBufferedFrag(C.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var C=this.levels,T=this.media;if(T!=null&&T.readyState){var f,S=this.getAppendedFrag(T.currentTime);if(S&&S.start>1&&this.flushMainBuffer(0,S.start-1),!T.paused&&C){var y=this.hls.nextLoadLevel,b=C[y],U=this.fragLastKbps;U&&this.fragCurrent?f=this.fragCurrent.duration*b.maxBitrate/(1e3*U)+1:f=0}else f=0;var F=this.getBufferedFrag(T.currentTime+f);if(F){var _=this.followingBufferedFrag(F);if(_){this.abortCurrentFrag();var M=_.maxStartPTS?_.maxStartPTS:_.start,I=_.duration,g=Math.max(F.end,M+Math.min(Math.max(I-this.config.maxFragLookUpTolerance,I*.5),I*.75));this.flushMainBuffer(g,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var C=this.fragCurrent;this.fragCurrent=null,C!=null&&C.loader&&C.loader.abort(),this.state===j.State.KEY_LOADING&&(this.state=j.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(C,T){w.prototype.flushMainBuffer.call(this,C,T,this.altAudio?"video":null)},O.onMediaAttached=function(C,T){w.prototype.onMediaAttached.call(this,C,T);var f=T.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),f.addEventListener("playing",this.onvplaying),f.addEventListener("seeked",this.onvseeked),this.gapController=new u.default(this.config,f,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var C=this.media;C&&(C.removeEventListener("playing",this.onvplaying),C.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),w.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var C=this.media,T=C?C.currentTime:null;Object(X.isFiniteNumber)(T)&&this.log("Media seeked to "+T.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(C,T){var f=!1,S=!1,y;T.levels.forEach(function(b){y=b.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(f=!0),y.indexOf("mp4a.40.5")!==-1&&(S=!0))}),this.audioCodecSwitch=f&&S&&!Object(B.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=T.levels,this.startFragRequested=!1},O.onLevelLoading=function(C,T){var f=this.levels;if(!f||this.state!==j.State.IDLE)return;var S=f[T.level];(!S.details||S.details.live&&this.levelLastLoaded!==T.level||this.waitForCdnTuneIn(S.details))&&(this.state=j.State.WAITING_LEVEL)},O.onLevelLoaded=function(C,T){var f,S=this.levels,y=T.level,b=T.details,U=b.totalduration;if(!S){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+U);var F=this.fragCurrent;F&&(this.state===j.State.FRAG_LOADING||this.state===j.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==T.level&&F.loader&&(this.state=j.State.IDLE,F.loader.abort()));var _=S[y],M=0;if(b.live||(f=_.details)!==null&&f!==void 0&&f.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;M=this.alignPlaylists(b,_.details)}if(_.details=b,this.levelLastLoaded=y,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:b,level:y}),this.state===j.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=j.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,M),this.tick()},O._handleFragmentLoadProgress=function(C){var T,f=C.frag,S=C.part,y=C.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var U=b[f.level],F=U.details;if(!F){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var _=U.videoCodec,M=F.PTSKnown||!F.live,I=(T=f.initSegment)===null||T===void 0?void 0:T.data,g=this._getAudioCodec(U),W=this.transmuxer=this.transmuxer||new m.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=S?S.index:-1,ne=$!==-1,oe=new p.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,y.byteLength,$,ne),we=this.initPTS[f.cc];W.push(y,I,g,_,f,S,F.totalduration,M,oe,we)},O.onAudioTrackSwitching=function(C,T){var f=this.altAudio,S=!!T.url,y=T.id;if(!S){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var U=this.hls;f&&U.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),U.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:y})}},O.onAudioTrackSwitched=function(C,T){var f=T.id,S=!!this.hls.audioTracks[f].url;if(S){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=S,this.tick()},O.onBufferCreated=function(C,T){var f=T.tracks,S,y,b=!1;for(var U in f){var F=f[U];if(F.id==="main"){if(y=U,S=F,U==="video"){var _=f[U];_&&(this.videoBuffer=_.buffer)}}else b=!0}b&&S?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=S.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(C,T){var f=T.frag,S=T.part;if(f&&f.type!==L.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(S?" p: "+S.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state),this.state===j.State.PARSED&&(this.state=j.State.IDLE);return}var y=S?S.stats:f.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,S)},O.onError=function(C,T){switch(T.details){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:case h.ErrorDetails.KEY_LOAD_ERROR:case h.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.MAIN,T);break;case h.ErrorDetails.LEVEL_LOAD_ERROR:case h.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==j.State.ERROR&&(T.fatal?(this.warn(""+T.details),this.state=j.State.ERROR):!T.levelRetry&&this.state===j.State.WAITING_LEVEL&&(this.state=j.State.IDLE));break;case h.ErrorDetails.BUFFER_FULL_ERROR:if(T.parent==="main"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var f=!0,S=this.getFwdBufferInfo(this.media,L.PlaylistLevelType.MAIN);S&&S.len>.5&&(f=!this.reduceMaxBufferLength(S.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var C=this.media,T=this.gapController;if(!C||!T||!C.readyState)return;var f=H.BufferHelper.getBuffered(C);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):T.poll(this.lastCurrentTime),this.lastCurrentTime=C.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=j.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(C,T){var f=T.type;if(f!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var S=(f===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(S,f,L.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(C,T){this.levels=T.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var C=this.media,T=C.currentTime,f=this.startPosition;if(f>=0&&T<f){if(C.seeking){d.logger.log("could not seek to "+f+", already seeking at "+T);return}var S=H.BufferHelper.getBuffered(C),y=S.length?S.start(0):0,b=y-f;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(d.logger.log("adjusting start position by "+b+" to match buffer start"),f+=b,this.startPosition=f),this.log("seek to target start position "+f+" from current time "+T),C.currentTime=f}},O._getAudioCodec=function(C){var T=this.config.defaultAudioCodec||C.audioCodec;return this.audioCodecSwap&&T&&(this.log("Swapping audio codec"),T.indexOf("mp4a.40.5")!==-1?T="mp4a.40.2":T="mp4a.40.5"),T},O._loadBitrateTestFrag=function(C){var T=this;this._doFragLoad(C).then(function(f){var S=T.hls;if(!f||S.nextLoadLevel||T.fragContextChanged(C))return;T.fragLoadError=0,T.state=j.State.IDLE,T.startFragRequested=!1,T.bitrateTest=!1;var y=C.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),S.trigger(K.Events.FRAG_LOADED,f)})},O._handleTransmuxComplete=function(C){var T,f="main",S=this.hls,y=C.remuxResult,b=C.chunkMeta,U=this.getCurrentContext(b);if(!U){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(b.level);return}var F=U.frag,_=U.part,M=U.level,I=y.video,g=y.text,W=y.id3,$=y.initSegment,ne=this.altAudio?void 0:y.audio;if(this.fragContextChanged(F))return;if(this.state=j.State.PARSING,$){$.tracks&&(this._bufferInitSegment(M,$.tracks,F,b),S.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:f,tracks:$.tracks}));var oe=$.initPTS,we=$.timescale;Object(X.isFiniteNumber)(oe)&&(this.initPTS[F.cc]=oe,S.trigger(K.Events.INIT_PTS_FOUND,{frag:F,id:f,initPTS:oe,timescale:we}))}if(I&&y.independent!==!1){if(M.details){var ge=I.startPTS,xe=I.endPTS,Re=I.startDTS,Le=I.endDTS;if(_)_.elementaryStreams[I.type]={startPTS:ge,endPTS:xe,startDTS:Re,endDTS:Le};else if(I.firstKeyFrame&&I.independent&&(this.couldBacktrack=!0),I.dropped&&I.independent){var ce=this.getLoadPosition()+this.config.maxBufferHole;if(ce<ge){this.backtrack(F);return}F.setElementaryStreamInfo(I.type,F.start,xe,F.start,Le,!0)}F.setElementaryStreamInfo(I.type,ge,xe,Re,Le),this.bufferFragmentData(I,F,_,b)}}else if(y.independent===!1){this.backtrack(F);return}if(ne){var he=ne.startPTS,re=ne.endPTS,de=ne.startDTS,se=ne.endDTS;_&&(_.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:he,endPTS:re,startDTS:de,endDTS:se}),F.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,he,re,de,se),this.bufferFragmentData(ne,F,_,b)}if(W!=null&&(T=W.samples)!==null&&T!==void 0&&T.length){var De={frag:F,id:f,samples:W.samples};S.trigger(K.Events.FRAG_PARSING_METADATA,De)}if(g){var Ne={frag:F,id:f,samples:g.samples};S.trigger(K.Events.FRAG_PARSING_USERDATA,Ne)}},O._bufferInitSegment=function(C,T,f,S){var y=this;if(this.state!==j.State.PARSING)return;this.audioOnly=!!T.audio&&!T.video,this.altAudio&&!this.audioOnly&&delete T.audio;var b=T.audio,U=T.video,F=T.audiovideo;if(b){var _=C.audioCodec,M=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(_&&(_.indexOf("mp4a.40.5")!==-1?_="mp4a.40.2":_="mp4a.40.5"),b.metadata.channelCount!==1&&M.indexOf("firefox")===-1&&(_="mp4a.40.5")),M.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(_="mp4a.40.2",this.log("Android: force audio codec to "+_)),C.audioCodec&&C.audioCodec!==_&&this.log('Swapping manifest audio codec "'+C.audioCodec+'" for "'+_+'"'),b.levelCodec=_,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(_||"")+"/"+(C.audioCodec||"")+"/"+b.codec+"]")}U&&(U.levelCodec=C.videoCodec,U.id="main",this.log("Init video buffer, container:"+U.container+", codecs[level/parsed]=["+(C.videoCodec||"")+"/"+U.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(C.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,T),Object.keys(T).forEach(function(I){var g=T[I],W=g.initSegment;W!=null&&W.byteLength&&y.hls.trigger(K.Events.BUFFER_APPENDING,{type:I,data:W,frag:f,part:null,chunkMeta:S,parent:f.type})}),this.tick()},O.backtrack=function(C){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(C);var T=this.fragmentTracker.backtrack(C);this.fragPrevious=null,this.nextLoadPosition=C.start,T?this.resetFragmentLoading(C):this.state=j.State.BACKTRACKING},O.checkFragmentChanged=function(){var C=this.media,T=null;if(C&&C.readyState>1&&C.seeking===!1){var f=C.currentTime;if(H.BufferHelper.isBuffered(C,f)?T=this.getAppendedFrag(f):H.BufferHelper.isBuffered(C,f+.1)&&(T=this.getAppendedFrag(f+.1)),T){var S=this.fragPlaying,y=T.level;(!S||T.sn!==S.sn||S.level!==y||T.urlId!==S.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:T}),(!S||S.level!==y)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=T)}}},l(D,[{key:"nextLevel",get:function(){var C=this.nextBufferedFrag;return C?C.level:-1}},{key:"currentLevel",get:function(){var C=this.media;if(C){var T=this.getAppendedFrag(C.currentTime);if(T)return T.level}return-1}},{key:"nextBufferedFrag",get:function(){var C=this.media;if(C){var T=this.getAppendedFrag(C.currentTime);return this.followingBufferedFrag(T)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(j.default)},"./src/controller/subtitle-stream-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"SubtitleStreamController",function(){return s});var X=P("./src/events.ts"),j=P("./src/utils/logger.ts"),B=P("./src/utils/buffer-helper.ts"),K=P("./src/controller/fragment-finders.ts"),H=P("./src/utils/discontinuities.ts"),r=P("./src/controller/level-helper.ts"),L=P("./src/controller/fragment-tracker.ts"),v=P("./src/controller/base-stream-controller.ts"),m=P("./src/types/loader.ts"),p=P("./src/types/level.ts");function u(a,R){for(var E=0;E<R.length;E++){var w=R[E];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(a,w.key,w)}}function h(a,R,E){return R&&u(a.prototype,R),E&&u(a,E),a}function d(a,R){a.prototype=Object.create(R.prototype),a.prototype.constructor=a,o(a,R)}function o(a,R){return o=Object.setPrototypeOf||function(w,D){return w.__proto__=D,w},o(a,R)}var l=500,s=function(a){d(R,a);function R(w,D){var O;return O=a.call(this,w,D,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var E=R.prototype;return E.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},E._registerListeners=function(){var D=this.hls;D.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on(X.Events.ERROR,this.onError,this),D.on(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E._unregisterListeners=function(){var D=this.hls;D.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off(X.Events.ERROR,this.onError,this),D.off(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E.startLoad=function(){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(l),this.tick()},E.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},E.onLevelLoaded=function(D,O){this.mainDetails=O.details},E.onSubtitleFragProcessed=function(D,O){var A=O.frag,C=O.success;if(this.fragPrevious=A,this.state=v.State.IDLE,!C)return;var T=this.tracksBuffered[this.currentTrackId];if(!T)return;for(var f,S=A.start,y=0;y<T.length;y++)if(S>=T[y].start&&S<=T[y].end){f=T[y];break}var b=A.start+A.duration;f?f.end=b:(f={start:S,end:b},T.push(f)),this.fragmentTracker.fragBuffered(A)},E.onBufferFlushing=function(D,O){var A=O.startOffset,C=O.endOffset;if(A===0&&C!==Number.POSITIVE_INFINITY){var T=this.currentTrackId,f=this.levels;if(!f.length||!f[T]||!f[T].details)return;var S=f[T].details,y=S.targetduration,b=C-y;if(b<=0)return;O.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(U){for(var F=0;F<U.length;){if(U[F].end<=b){U.shift();continue}else if(U[F].start<b)U[F].start=b;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(A,b,m.PlaylistLevelType.SUBTITLE)}},E.onError=function(D,O){var A,C=O.frag;if(!C||C.type!==m.PlaylistLevelType.SUBTITLE)return;(A=this.fragCurrent)!==null&&A!==void 0&&A.loader&&this.fragCurrent.loader.abort(),this.state=v.State.IDLE},E.onSubtitleTracksUpdated=function(D,O){var A=this,C=O.subtitleTracks;this.tracksBuffered=[],this.levels=C.map(function(T){return new p.Level(T)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(T){A.tracksBuffered[T.id]=[]}),this.mediaBuffer=null},E.onSubtitleTrackSwitch=function(D,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var A=this.levels[this.currentTrackId];A!=null&&A.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,A&&this.setInterval(l)},E.onSubtitleTrackLoaded=function(D,O){var A,C=O.details,T=O.id,f=this.currentTrackId,S=this.levels;if(!S.length)return;var y=S[f];if(T>=S.length||T!==f||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,C.live||(A=y.details)!==null&&A!==void 0&&A.live){var b=this.mainDetails;if(C.deltaUpdateFailed||!b)return;var U=b.fragments[0];if(!y.details)C.hasProgramDateTime&&b.hasProgramDateTime?Object(H.alignMediaPlaylistByPDT)(C,b):U&&Object(r.addSliding)(C,U.start);else{var F=this.alignPlaylists(C,y.details);F===0&&U&&Object(r.addSliding)(C,U.start)}}if(y.details=C,this.levelLastLoaded=T,this.tick(),C.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var _=Object(K.findFragmentByPTS)(null,C.fragments,this.media.currentTime,0);_||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},E._handleFragmentLoadComplete=function(D){var O=D.frag,A=D.payload,C=O.decryptdata,T=this.hls;if(this.fragContextChanged(O))return;if(A&&A.byteLength>0&&C&&C.key&&C.iv&&C.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(A),C.key.buffer,C.iv.buffer).then(function(S){var y=performance.now();T.trigger(X.Events.FRAG_DECRYPTED,{frag:O,payload:S,stats:{tstart:f,tdecrypt:y}})})}},E.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var D,O=this.currentTrackId,A=this.levels;if(!A.length||!A[O]||!A[O].details)return;var C=A[O].details,T=C.targetduration,f=this.config,S=this.media,y=B.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,S.currentTime-T,f.maxBufferHole),b=y.end,U=y.len,F=this.getMaxBufferLength()+T;if(U>F)return;console.assert(C,"Subtitle track details are defined on idle subtitle stream controller tick");var _=C.fragments,M=_.length,I=C.edge,g,W=this.fragPrevious;if(b<I){var $=f.maxFragLookUpTolerance;W&&C.hasProgramDateTime&&(g=Object(K.findFragmentByPDT)(_,W.endProgramDateTime,$)),g||(g=Object(K.findFragmentByPTS)(W,_,b,$),!g&&W&&W.start<_[0].start&&(g=_[0]))}else g=_[M-1];(D=g)!==null&&D!==void 0&&D.encrypted?(j.logger.log("Loading key for "+g.sn),this.state=v.State.KEY_LOADING,this.hls.trigger(X.Events.KEY_LOADING,{frag:g})):g&&this.fragmentTracker.getState(g)===L.FragmentState.NOT_LOADED&&this.loadFragment(g,C,b)}},E.loadFragment=function(D,O,A){this.fragCurrent=D,a.prototype.loadFragment.call(this,D,O,A)},h(R,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),R}(v.default)},"./src/controller/subtitle-track-controller.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/events.ts"),j=P("./src/utils/texttrack-utils.ts"),B=P("./src/controller/base-playlist-controller.ts"),K=P("./src/types/loader.ts");function H(u,h){for(var d=0;d<h.length;d++){var o=h[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,o.key,o)}}function r(u,h,d){return h&&H(u.prototype,h),d&&H(u,d),u}function L(u,h){u.prototype=Object.create(h.prototype),u.prototype.constructor=u,v(u,h)}function v(u,h){return v=Object.setPrototypeOf||function(o,l){return o.__proto__=l,o},v(u,h)}var m=function(u){L(h,u);function h(o){var l;return l=u.call(this,o,"[subtitle-track-controller]")||this,l.media=null,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.selectDefaultTrack=!0,l.queuedDefaultTrack=-1,l.trackChangeListener=function(){return l.onTextTracksChanged()},l.asyncPollTrackChange=function(){return l.pollTrackChange(0)},l.useTextTrackPolling=!1,l.subtitlePollingInterval=-1,l.subtitleDisplay=!0,l.registerListeners(),l}var d=h.prototype;return d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,u.prototype.destroy.call(this)},d.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.MANIFEST_PARSED,this.onManifestParsed,this),l.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),l.on(X.Events.ERROR,this.onError,this)},d.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.MANIFEST_PARSED,this.onManifestParsed,this),l.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),l.off(X.Events.ERROR,this.onError,this)},d.onMediaAttached=function(l,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)},d.pollTrackChange=function(l){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,l)},d.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 l=p(this.media.textTracks);l.forEach(function(s){Object(j.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},d.onManifestParsed=function(l,s){this.tracks=s.subtitleTracks},d.onSubtitleTrackLoaded=function(l,s){var a=s.id,R=s.details,E=this.trackId,w=this.tracksInGroup[E];if(!w){this.warn("Invalid subtitle track id "+a);return}var D=w.details;w.details=s.details,this.log("subtitle track "+a+" loaded ["+R.startSN+"-"+R.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,s,D))},d.onLevelLoading=function(l,s){this.switchLevel(s.level)},d.onLevelSwitching=function(l,s){this.switchLevel(s.level)},d.switchLevel=function(l){var s=this.hls.levels[l];if(!(s!=null&&s.textGroupIds))return;var a=s.textGroupIds[s.urlId];if(this.groupId!==a){var R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,E=this.tracks.filter(function(O){return!a||O.groupId===a});this.tracksInGroup=E;var w=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=a;var D={subtitleTracks:E};this.log("Updating subtitle tracks, "+E.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,D),w!==-1&&this.setSubtitleTrack(w,R)}},d.findTrackId=function(l){for(var s=this.tracksInGroup,a=0;a<s.length;a++){var R=s[a];if((!this.selectDefaultTrack||R.default)&&(!l||l===R.name))return R.id}return-1},d.onError=function(l,s){if(u.prototype.onError.call(this,l,s),s.fatal||!s.context)return;s.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},d.loadPlaylist=function(l){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var a=s.id,R=s.groupId,E=s.url;if(l)try{E=l.addDirectives(E)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("Loading subtitle playlist for id "+a),this.hls.trigger(X.Events.SUBTITLE_TRACK_LOADING,{url:E,id:a,groupId:R,deliveryDirectives:l||null})}},d.toggleTrackModes=function(l){var s=this,a=this.media,R=this.subtitleDisplay,E=this.trackId;if(!a)return;var w=p(a.textTracks),D=w.filter(function(C){return C.groupId===s.groupId});if(l===-1)[].slice.call(w).forEach(function(C){C.mode="disabled"});else{var O=D[E];O&&(O.mode="disabled")}var A=D[l];A&&(A.mode=R?"showing":"hidden")},d.setSubtitleTrack=function(l,s){var a,R=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=l;return}if(this.trackId!==l&&this.toggleTrackModes(l),this.trackId===l&&(l===-1||(a=R[l])!==null&&a!==void 0&&a.details)||l<-1||l>=R.length)return;this.clearTimer();var E=R[l];if(this.log("Switching to subtitle track "+l),this.trackId=l,E){var w=E.id,D=E.groupId,O=D===void 0?"":D,A=E.name,C=E.type,T=E.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:w,groupId:O,name:A,type:C,url:T});var f=this.switchParams(E.url,s==null?void 0:s.details);this.loadPlaylist(f)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:l})},d.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var l=-1,s=p(this.media.textTracks),a=0;a<s.length;a++)if(s[a].mode==="hidden")l=a;else if(s[a].mode==="showing"){l=a;break}this.subtitleTrack!==l&&(this.subtitleTrack=l)},r(h,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(l,s)}}]),h}(B.default);function p(u){for(var h=[],d=0;d<u.length;d++){var o=u[d];o.kind==="subtitles"&&o.label&&h.push(u[d])}return h}J.default=m},"./src/controller/timeline-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"TimelineController",function(){return p});var X=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),B=P("./src/utils/cea-608-parser.ts"),K=P("./src/utils/output-filter.ts"),H=P("./src/utils/webvtt-parser.ts"),r=P("./src/utils/texttrack-utils.ts"),L=P("./src/utils/imsc1-ttml-parser.ts"),v=P("./src/types/loader.ts"),m=P("./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=d(),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 K.default(this,"textTrack1"),R=new K.default(this,"textTrack2"),E=new K.default(this,"textTrack3"),w=new K.default(this,"textTrack4");this.cea608Parser1=new B.default(1,a,R),this.cea608Parser2=new B.default(3,E,w)}s.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(j.Events.FRAG_LOADING,this.onFragLoading,this),s.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var l=o.prototype;return l.destroy=function(){var a=this.hls;a.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.off(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.off(j.Events.FRAG_LOADING,this.onFragLoading,this),a.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.off(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.off(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},l.addCues=function(a,R,E,w,D){for(var O=!1,A=D.length;A--;){var C=D[A],T=h(C[0],C[1],R,E);if(T>=0&&(C[0]=Math.min(C[0],R),C[1]=Math.max(C[1],E),O=!0,T/(E-R)>.5))return}if(O||D.push([R,E]),this.config.renderTextTracksNatively){var f=this.captionsTracks[a];this.Cues.newCue(f,R,E,w)}else{var S=this.Cues.newCue(null,R,E,w);this.hls.trigger(j.Events.CUES_PARSED,{type:"captions",cues:S,track:a})}},l.onInitPtsFound=function(a,R){var E=this,w=R.frag,D=R.id,O=R.initPTS,A=R.timescale,C=this.unparsedVttFrags;D==="main"&&(this.initPTS[w.cc]=O,this.timescale[w.cc]=A),C.length&&(this.unparsedVttFrags=[],C.forEach(function(T){E.onFragLoaded(j.Events.FRAG_LOADED,T)}))},l.getExistingTrack=function(a){var R=this.media;if(R)for(var E=0;E<R.textTracks.length;E++){var w=R.textTracks[E];if(w[a])return w}return null},l.createCaptionsTrack=function(a){this.config.renderTextTracksNatively?this.createNativeTrack(a):this.createNonNativeTrack(a)},l.createNativeTrack=function(a){if(this.captionsTracks[a])return;var R=this.captionsProperties,E=this.captionsTracks,w=this.media,D=R[a],O=D.label,A=D.languageCode,C=this.getExistingTrack(a);if(C)E[a]=C,Object(r.clearCurrentCues)(E[a]),Object(r.sendAddTrackEvent)(E[a],w);else{var T=this.createTextTrack("captions",O,A);T&&(T[a]=!0,E[a]=T)}},l.createNonNativeTrack=function(a){if(this.nonNativeCaptionsTracks[a])return;var R=this.captionsProperties[a];if(!R)return;var E=R.label,w={_id:a,label:E,kind:"captions",default:R.media?!!R.media.default:!1,closedCaptions:R.media};this.nonNativeCaptionsTracks[a]=w,this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[w]})},l.createTextTrack=function(a,R,E){var w=this.media;return w?w.addTextTrack(a,R,E):void 0},l.onMediaAttaching=function(a,R){this.media=R.media,this._cleanTracks()},l.onMediaDetaching=function(){var a=this.captionsTracks;Object.keys(a).forEach(function(R){Object(r.clearCurrentCues)(a[R]),delete a[R]}),this.nonNativeCaptionsTracks={}},l.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),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())},l._cleanTracks=function(){var a=this.media;if(!a)return;var R=a.textTracks;if(R)for(var E=0;E<R.length;E++)Object(r.clearCurrentCues)(R[E])},l.onSubtitleTracksUpdated=function(a,R){var E=this;this.textTracks=[];var w=R.subtitleTracks||[],D=w.some(function(T){return T.textCodec===L.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var O=this.tracks&&w&&this.tracks.length===w.length;if(this.tracks=w||[],this.config.renderTextTracksNatively){var A=this.media?this.media.textTracks:[];this.tracks.forEach(function(T,f){var S;if(f<A.length){for(var y=null,b=0;b<A.length;b++)if(u(A[b],T)){y=A[b];break}y&&(S=y)}S?Object(r.clearCurrentCues)(S):(S=E.createTextTrack("subtitles",T.name,T.lang),S&&(S.mode="disabled")),S&&(S.groupId=T.groupId,E.textTracks.push(S))})}else if(!O&&this.tracks&&this.tracks.length){var C=this.tracks.map(function(T){return{label:T.name,kind:T.type.toLowerCase(),default:T.default,subtitleTrack:T}});this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:C})}}},l.onManifestLoaded=function(a,R){var E=this;this.config.enableCEA708Captions&&R.captions&&R.captions.forEach(function(w){var D=/(?:CC|SERVICE)([1-4])/.exec(w.instreamId);if(!D)return;var O="textTrack"+D[1],A=E.captionsProperties[O];if(!A)return;A.label=w.name,w.lang&&(A.languageCode=w.lang),A.media=w})},l.onFragLoading=function(a,R){var E=this.cea608Parser1,w=this.cea608Parser2,D=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(E&&w))return;if(R.frag.type===v.PlaylistLevelType.MAIN){var A,C,T=R.frag.sn,f=(A=R==null||((C=R.part)===null||C===void 0)?void 0:C.index)!=null?A:-1;T===D+1||T===D&&f===O+1||(E.reset(),w.reset()),this.lastSn=T,this.lastPartIndex=f}},l.onFragLoaded=function(a,R){var E=R.frag,w=R.payload,D=this.initPTS,O=this.unparsedVttFrags;if(E.type===v.PlaylistLevelType.SUBTITLE)if(w.byteLength){if(!Object(X.isFiniteNumber)(D[E.cc])){O.push(R),D.length&&this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Missing initial subtitle PTS")});return}var A=E.decryptdata;if(A==null||A.key==null||A.method!=="AES-128"){var C=this.tracks[E.level],T=this.vttCCs;T[E.cc]||(T[E.cc]={start:E.start,prevCC:this.prevCC,new:!0},this.prevCC=E.cc),C&&C.textCodec===L.IMSC1_CODEC?this._parseIMSC1(E,w):this._parseVTTs(E,w,T)}}else this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Empty subtitle payload")})},l._parseIMSC1=function(a,R){var E=this,w=this.hls;Object(L.parseIMSC1)(R,this.initPTS[a.cc],this.timescale[a.cc],function(D){E._appendCues(D,a.level),w.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(D){m.logger.log("Failed to parse IMSC1: "+D),w.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:D})})},l._parseVTTs=function(a,R,E){var w=this,D=this.hls;Object(H.parseWebVTT)(R,this.initPTS[a.cc],this.timescale[a.cc],E,a.cc,a.start,function(O){w._appendCues(O,a.level),D.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(O){w._fallbackToIMSC1(a,R),m.logger.log("Failed to parse VTT cue: "+O),D.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:O})})},l._fallbackToIMSC1=function(a,R){var E=this,w=this.tracks[a.level];w.textCodec||Object(L.parseIMSC1)(R,this.initPTS[a.cc],this.timescale[a.cc],function(){w.textCodec=L.IMSC1_CODEC,E._parseIMSC1(a,R)},function(){w.textCodec="wvtt"})},l._appendCues=function(a,R){var E=this.hls;if(this.config.renderTextTracksNatively){var w=this.textTracks[R];if(w.mode==="disabled")return;a.forEach(function(A){return Object(r.addCueToTrack)(w,A)})}else{var D=this.tracks[R],O=D.default?"default":"subtitles"+R;E.trigger(j.Events.CUES_PARSED,{type:"subtitles",cues:a,track:O})}},l.onFragDecrypted=function(a,R){var E=R.frag;if(E.type===v.PlaylistLevelType.SUBTITLE){if(!Object(X.isFiniteNumber)(this.initPTS[E.cc])){this.unparsedVttFrags.push(R);return}this.onFragLoaded(j.Events.FRAG_LOADED,R)}},l.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},l.onFragParsingUserdata=function(a,R){var E=this.cea608Parser1,w=this.cea608Parser2;if(!this.enabled||!(E&&w))return;for(var D=0;D<R.samples.length;D++){var O=R.samples[D].bytes;if(O){var A=this.extractCea608Data(O);E.addData(R.samples[D].pts,A[0]),w.addData(R.samples[D].pts,A[1])}}},l.onBufferFlushing=function(a,R){var E=R.startOffset,w=R.endOffset,D=R.endOffsetSubtitles,O=R.type,A=this.media;if(!A||A.currentTime<w)return;if(!O||O==="video"){var C=this.captionsTracks;Object.keys(C).forEach(function(f){return Object(r.removeCuesInRange)(C[f],E,w)})}if(this.config.renderTextTracksNatively&&(E===0&&D!==void 0)){var T=this.textTracks;Object.keys(T).forEach(function(f){return Object(r.removeCuesInRange)(T[f],E,D)})}},l.extractCea608Data=function(a){for(var R=a[0]&31,E=2,w=[[],[]],D=0;D<R;D++){var O=a[E++],A=127&a[E++],C=127&a[E++],T=(4&O)!==0,f=3&O;if(A===0&&C===0)continue;T&&((f===0||f===1)&&(w[f].push(A),w[f].push(C)))}return w},o}();function u(o,l){return o&&o.label===l.name&&!(o.textTrack1||o.textTrack2)}function h(o,l,s,a){return Math.min(l,a)-Math.max(o,s)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return X});var X=function(){function j(K,H){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=H}var B=j.prototype;return B.decrypt=function(H,r){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},r,H)},j}()},"./src/crypt/aes-decryptor.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"removePadding",function(){return j}),P.d(J,"default",function(){return B});var X=P("./src/utils/typed-array.ts");function j(K){var H=K.byteLength,r=H&&new DataView(K.buffer).getUint8(H-1);return r?Object(X.sliceUint8)(K,0,H-r):K}var B=function(){function K(){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 H=K.prototype;return H.uint8ArrayToUint32Array_=function(L){for(var v=new DataView(L),m=new Uint32Array(4),p=0;p<4;p++)m[p]=v.getUint32(p*4);return m},H.initTable=function(){var L=this.sBox,v=this.invSBox,m=this.subMix,p=m[0],u=m[1],h=m[2],d=m[3],o=this.invSubMix,l=o[0],s=o[1],a=o[2],R=o[3],E=new Uint32Array(256),w=0,D=0,O=0;for(O=0;O<256;O++)O<128?E[O]=O<<1:E[O]=O<<1^283;for(O=0;O<256;O++){var A=D^D<<1^D<<2^D<<3^D<<4;A=A>>>8^A&255^99,L[w]=A,v[A]=w;var C=E[w],T=E[C],f=E[T],S=E[A]*257^A*16843008;p[w]=S<<24|S>>>8,u[w]=S<<16|S>>>16,h[w]=S<<8|S>>>24,d[w]=S,S=f*16843009^T*65537^C*257^w*16843008,l[A]=S<<24|S>>>8,s[A]=S<<16|S>>>16,a[A]=S<<8|S>>>24,R[A]=S,w?(w=C^E[E[E[f^C]]],D^=E[E[D]]):w=D=1}},H.expandKey=function(L){for(var v=this.uint8ArrayToUint32Array_(L),m=!0,p=0;p<v.length&&m;)m=v[p]===this.key[p],p++;if(m)return;this.key=v;var u=this.keySize=v.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);var h=this.ksRows=(u+6+1)*4,d,o,l=this.keySchedule=new Uint32Array(h),s=this.invKeySchedule=new Uint32Array(h),a=this.sBox,R=this.rcon,E=this.invSubMix,w=E[0],D=E[1],O=E[2],A=E[3],C,T;for(d=0;d<h;d++){if(d<u){C=l[d]=v[d];continue}T=C,d%u===0?(T=T<<8|T>>>24,T=a[T>>>24]<<24|a[T>>>16&255]<<16|a[T>>>8&255]<<8|a[T&255],T^=R[d/u|0]<<24):u>6&&d%u===4&&(T=a[T>>>24]<<24|a[T>>>16&255]<<16|a[T>>>8&255]<<8|a[T&255]),l[d]=C=(l[d-u]^T)>>>0}for(o=0;o<h;o++)d=h-o,o&3?T=l[d]:T=l[d-4],o<4||d<=4?s[o]=T:s[o]=w[a[T>>>24]]^D[a[T>>>16&255]]^O[a[T>>>8&255]]^A[a[T&255]],s[o]=s[o]>>>0},H.networkToHostOrderSwap=function(L){return L<<24|(L&65280)<<8|(L&16711680)>>8|L>>>24},H.decrypt=function(L,v,m){for(var p=this.keySize+6,u=this.invKeySchedule,h=this.invSBox,d=this.invSubMix,o=d[0],l=d[1],s=d[2],a=d[3],R=this.uint8ArrayToUint32Array_(m),E=R[0],w=R[1],D=R[2],O=R[3],A=new Int32Array(L),C=new Int32Array(A.length),T,f,S,y,b,U,F,_,M,I,g,W,$,ne,oe=this.networkToHostOrderSwap;v<A.length;){for(M=oe(A[v]),I=oe(A[v+1]),g=oe(A[v+2]),W=oe(A[v+3]),b=M^u[0],U=W^u[1],F=g^u[2],_=I^u[3],$=4,ne=1;ne<p;ne++)T=o[b>>>24]^l[U>>16&255]^s[F>>8&255]^a[_&255]^u[$],f=o[U>>>24]^l[F>>16&255]^s[_>>8&255]^a[b&255]^u[$+1],S=o[F>>>24]^l[_>>16&255]^s[b>>8&255]^a[U&255]^u[$+2],y=o[_>>>24]^l[b>>16&255]^s[U>>8&255]^a[F&255]^u[$+3],b=T,U=f,F=S,_=y,$=$+4;T=h[b>>>24]<<24^h[U>>16&255]<<16^h[F>>8&255]<<8^h[_&255]^u[$],f=h[U>>>24]<<24^h[F>>16&255]<<16^h[_>>8&255]<<8^h[b&255]^u[$+1],S=h[F>>>24]<<24^h[_>>16&255]<<16^h[b>>8&255]<<8^h[U&255]^u[$+2],y=h[_>>>24]<<24^h[b>>16&255]<<16^h[U>>8&255]<<8^h[F&255]^u[$+3],C[v]=oe(T^E),C[v+1]=oe(y^w),C[v+2]=oe(S^D),C[v+3]=oe(f^O),E=M,w=I,D=g,O=W,v=v+4}return C.buffer},K}()},"./src/crypt/decrypter.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return v});var X=P("./src/crypt/aes-crypto.ts"),j=P("./src/crypt/fast-aes-key.ts"),B=P("./src/crypt/aes-decryptor.ts"),K=P("./src/utils/logger.ts"),H=P("./src/utils/mp4-tools.ts"),r=P("./src/utils/typed-array.ts"),L=16,v=function(){function m(u,h,d){var o=d===void 0?{}:d,l=o.removePKCS7Padding,s=l===void 0?!0:l;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=u,this.config=h,this.removePKCS7Padding=s,s)try{var a=self.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(R){}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 h=this.currentResult;if(!h){this.reset();return}var d=new Uint8Array(h);return this.reset(),this.removePKCS7Padding?Object(B.removePadding)(d):d},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(h,d,o,l){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(h),d,o);var s=this.flush();s&&l(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(h),d,o).then(l)},p.softwareDecrypt=function(h,d,o){var l=this.currentIV,s=this.currentResult,a=this.remainderData;this.logOnce("JS AES decrypt"),a&&(h=Object(H.appendUint8Array)(a,h),this.remainderData=null);var R=this.getValidChunk(h);if(!R.length)return null;l&&(o=l);var E=this.softwareDecrypter;E||(E=this.softwareDecrypter=new B.default),E.expandKey(d);var w=s;return this.currentResult=E.decrypt(R.buffer,0,o),this.currentIV=Object(r.sliceUint8)(R,-16).buffer,w||null},p.webCryptoDecrypt=function(h,d,o){var l=this,s=this.subtle;return(this.key!==d||!this.fastAesKey)&&(this.key=d,this.fastAesKey=new j.default(s,d)),this.fastAesKey.expandKey().then(function(a){if(!s)return Promise.reject(new Error("web crypto not initialized"));var R=new X.default(s,o);return R.decrypt(h.buffer,a)}).catch(function(a){return l.onWebCryptoError(a,h,d,o)})},p.onWebCryptoError=function(h,d,o,l){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",h),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(d,o,l)},p.getValidChunk=function(h){var d=h,o=h.length-h.length%L;return o!==h.length&&(d=Object(r.sliceUint8)(h,0,o),this.remainderData=Object(r.sliceUint8)(h,o)),d},p.logOnce=function(h){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+h),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return X});var X=function(){function j(K,H){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=H}var B=j.prototype;return B.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},j}()},"./src/demux/aacdemuxer.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/demux/base-audio-demuxer.ts"),j=P("./src/demux/adts.ts"),B=P("./src/utils/logger.ts"),K=P("./src/demux/id3.ts");function H(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,r(v,m)}function r(v,m){return r=Object.setPrototypeOf||function(u,h){return u.__proto__=h,u},r(v,m)}var L=function(v){H(m,v);function m(u,h){var d;return d=v.call(this)||this,d.observer=void 0,d.config=void 0,d.observer=u,d.config=h,d}var p=m.prototype;return p.resetInitSegment=function(h,d,o){v.prototype.resetInitSegment.call(this,h,d,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:h,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(h){if(!h)return!1;for(var d=K.getID3Data(h,0)||[],o=d.length,l=h.length;o<l;o++)if(j.probe(h,o))return B.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(h,d){return j.canParse(h,d)},p.appendFrame=function(h,d,o){j.initTrackConfig(h,this.observer,d,o,h.manifestCodec);var l=j.appendFrame(h,d,o,this.initPTS,this.frameIndex);if(l&&l.missing===0)return l},m}(X.default);L.minProbeByteLength=9,J.default=L},"./src/demux/adts.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"getAudioConfig",function(){return K}),P.d(J,"isHeaderPattern",function(){return H}),P.d(J,"getHeaderLength",function(){return r}),P.d(J,"getFullFrameLength",function(){return L}),P.d(J,"canGetFrameLength",function(){return v}),P.d(J,"isHeader",function(){return m}),P.d(J,"canParse",function(){return p}),P.d(J,"probe",function(){return u}),P.d(J,"initTrackConfig",function(){return h}),P.d(J,"getFrameDuration",function(){return d}),P.d(J,"parseFrameHeader",function(){return o}),P.d(J,"appendFrame",function(){return l});var X=P("./src/utils/logger.ts"),j=P("./src/errors.ts"),B=P("./src/events.ts");function K(s,a,R,E){var w,D,O,A,C=navigator.userAgent.toLowerCase(),T=E,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];w=((a[R+2]&192)>>>6)+1;var S=(a[R+2]&60)>>>2;if(S>f.length-1){s.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+S});return}return O=(a[R+2]&1)<<2,O|=(a[R+3]&192)>>>6,X.logger.log("manifest codec:"+E+", ADTS type:"+w+", samplingIndex:"+S),/firefox/i.test(C)?S>=6?(w=5,A=new Array(4),D=S-3):(w=2,A=new Array(2),D=S):C.indexOf("android")!==-1?(w=2,A=new Array(2),D=S):(w=5,A=new Array(4),E&&(E.indexOf("mp4a.40.29")!==-1||E.indexOf("mp4a.40.5")!==-1)||!E&&S>=6?D=S-3:((E&&E.indexOf("mp4a.40.2")!==-1&&(S>=6&&O===1||/vivaldi/i.test(C))||!E&&O===1)&&(w=2,A=new Array(2)),D=S)),A[0]=w<<3,A[0]|=(S&14)>>1,A[1]|=(S&1)<<7,A[1]|=O<<3,w===5&&(A[1]|=(D&14)>>1,A[2]=(D&1)<<7,A[2]|=2<<2,A[3]=0),{config:A,samplerate:f[S],channelCount:O,codec:"mp4a.40."+w,manifestCodec:T}}function H(s,a){return s[a]===255&&(s[a+1]&246)===240}function r(s,a){return s[a+1]&1?7:9}function L(s,a){return(s[a+3]&3)<<11|s[a+4]<<3|(s[a+5]&224)>>>5}function v(s,a){return a+5<s.length}function m(s,a){return a+1<s.length&&H(s,a)}function p(s,a){return v(s,a)&&H(s,a)&&L(s,a)<=s.length-a}function u(s,a){if(m(s,a)){var R=r(s,a);if(a+R>=s.length)return!1;var E=L(s,a);if(E<=R)return!1;var w=a+E;return w===s.length||m(s,w)}return!1}function h(s,a,R,E,w){if(!s.samplerate){var D=K(a,R,E,w);if(!D)return;s.config=D.config,s.samplerate=D.samplerate,s.channelCount=D.channelCount,s.codec=D.codec,s.manifestCodec=D.manifestCodec,X.logger.log("parsed codec:"+s.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function d(s){return 1024*9e4/s}function o(s,a,R,E,w){var D=r(s,a),O=L(s,a);if(O-=D,O>0){var A=R+E*w;return{headerLength:D,frameLength:O,stamp:A}}}function l(s,a,R,E,w){var D=d(s.samplerate),O=o(a,R,E,w,D);if(O){var A=O.frameLength,C=O.headerLength,T=O.stamp,f=C+A,S=Math.max(0,R+f-a.length),y;S?(y=new Uint8Array(f-C),y.set(a.subarray(R+C,a.length),0)):y=a.subarray(R+C,R+f);var b={unit:y,pts:T};return S||s.samples.push(b),{sample:b,length:f,missing:S}}}},"./src/demux/base-audio-demuxer.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"initPTSFn",function(){return L});var X=P("./src/polyfills/number.ts"),j=P("./src/demux/id3.ts"),B=P("./src/demux/dummy-demuxed-track.ts"),K=P("./src/utils/mp4-tools.ts"),H=P("./src/utils/typed-array.ts"),r=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=v.prototype;return m.resetInitSegment=function(u,h,d){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(u,h){return!1},m.appendFrame=function(u,h,d){},m.demux=function(u,h){this.cachedData&&(u=Object(K.appendUint8Array)(this.cachedData,u),this.cachedData=null);var d=j.getID3Data(u,0),o=d?d.length:0,l,s,a=this._audioTrack,R=this._id3Track,E=d?j.getTimeStamp(d):void 0,w=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(E,h)),d&&d.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),s=this.initPTS;o<w;){if(this.canParse(u,o)){var D=this.appendFrame(a,u,o);D?(this.frameIndex++,s=D.sample.pts,o+=D.length,l=o):o=w}else j.canParse(u,o)?(d=j.getID3Data(u,o),R.samples.push({pts:s,dts:s,data:d}),o+=d.length,l=o):o++;if(o===w&&l!==w){var O=Object(H.sliceUint8)(u,l);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:a,avcTrack:Object(B.dummyTrack)(),id3Track:R,textTrack:Object(B.dummyTrack)()}},m.demuxSampleAes=function(u,h,d){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(u){var h=this.cachedData;return h&&(this.cachedData=null,this.demux(h,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(B.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(B.dummyTrack)()}},m.destroy=function(){},v}(),L=function(m,p){return Object(X.isFiniteNumber)(m)?m*90:p*9e4};J.default=r},"./src/demux/chunk-cache.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return X});var X=function(){function B(){this.chunks=[],this.dataLength=0}var K=B.prototype;return K.push=function(r){this.chunks.push(r),this.dataLength+=r.length},K.flush=function(){var r=this.chunks,L=this.dataLength,v;if(r.length)r.length===1?v=r[0]:v=j(r,L);else return new Uint8Array(0);return this.reset(),v},K.reset=function(){this.chunks.length=0,this.dataLength=0},B}();function j(B,K){for(var H=new Uint8Array(K),r=0,L=0;L<B.length;L++){var v=B[L];H.set(v,r),r+=v.length}return H}},"./src/demux/dummy-demuxed-track.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"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,J,P){"use strict";P.r(J);var X=P("./src/utils/logger.ts"),j=function(){function B(H){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=H,this.bytesAvailable=H.byteLength,this.word=0,this.bitsAvailable=0}var K=B.prototype;return K.loadWord=function(){var r=this.data,L=this.bytesAvailable,v=r.byteLength-L,m=new Uint8Array(4),p=Math.min(4,L);if(p===0)throw new Error("no bytes available");m.set(r.subarray(v,v+p)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},K.skipBits=function(r){var L;this.bitsAvailable>r?(this.word<<=r,this.bitsAvailable-=r):(r-=this.bitsAvailable,L=r>>3,r-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=r,this.bitsAvailable-=r)},K.readBits=function(r){var L=Math.min(this.bitsAvailable,r),v=this.word>>>32-L;return r>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=r-L,L>0&&this.bitsAvailable?v<<L|this.readBits(L):v},K.skipLZ=function(){var r;for(r=0;r<this.bitsAvailable;++r)if((this.word&2147483648>>>r)!==0)return this.word<<=r,this.bitsAvailable-=r,r;return this.loadWord(),r+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},K.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(r){for(var L=8,v=8,m,p=0;p<r;p++)v!==0&&(m=this.readEG(),v=(L+m+256)%256),L=v===0?L:v},K.readSPS=function(){var r=0,L=0,v=0,m=0,p,u,h,d=this.readUByte.bind(this),o=this.readBits.bind(this),l=this.readUEG.bind(this),s=this.readBoolean.bind(this),a=this.skipBits.bind(this),R=this.skipEG.bind(this),E=this.skipUEG.bind(this),w=this.skipScalingList.bind(this);d();var D=d();if(o(5),a(3),d(),E(),D===100||D===110||D===122||D===244||D===44||D===83||D===86||D===118||D===128){var O=l();if(O===3&&a(1),E(),E(),a(1),s())for(u=O!==3?8:12,h=0;h<u;h++)s()&&(h<6?w(16):w(64))}E();var A=l();if(A===0)l();else if(A===1)for(a(1),R(),R(),p=l(),h=0;h<p;h++)R();E(),a(1);var C=l(),T=l(),f=o(1);f===0&&a(1),a(1),s()&&(r=l(),L=l(),v=l(),m=l());var S=[1,1];if(s()&&s()){var y=d();switch(y){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:{S=[d()<<8|d(),d()<<8|d()];break}}}return{width:Math.ceil((C+1)*16-r*2-L*2),height:(2-f)*(T+1)*16-(f?2:4)*(v+m),pixelRatio:S}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},B}();J.default=j},"./src/demux/id3.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"isHeader",function(){return X}),P.d(J,"isFooter",function(){return j}),P.d(J,"getID3Data",function(){return B}),P.d(J,"canParse",function(){return H}),P.d(J,"getTimeStamp",function(){return r}),P.d(J,"isTimeStampFrame",function(){return L}),P.d(J,"getID3Frames",function(){return m}),P.d(J,"decodeFrame",function(){return p}),P.d(J,"utf8ArrayToStr",function(){return l}),P.d(J,"testables",function(){return s});var X=function(w,D){return D+10<=w.length&&(w[D]===73&&w[D+1]===68&&w[D+2]===51&&(w[D+3]<255&&w[D+4]<255&&(w[D+6]<128&&w[D+7]<128&&w[D+8]<128&&w[D+9]<128)))},j=function(w,D){return D+10<=w.length&&(w[D]===51&&w[D+1]===68&&w[D+2]===73&&(w[D+3]<255&&w[D+4]<255&&(w[D+6]<128&&w[D+7]<128&&w[D+8]<128&&w[D+9]<128)))},B=function(w,D){for(var O=D,A=0;X(w,D);){A+=10;var C=K(w,D+6);A+=C,j(w,D+10)&&(A+=10),D+=A}return A>0?w.subarray(O,O+A):void 0},K=function(w,D){var O=0;return O=(w[D]&127)<<21,O|=(w[D+1]&127)<<14,O|=(w[D+2]&127)<<7,O|=w[D+3]&127,O},H=function(w,D){return X(w,D)&&K(w,D+6)+10<=w.length-D},r=function(w){for(var D=m(w),O=0;O<D.length;O++){var A=D[O];if(L(A))return o(A)}return},L=function(w){return w&&w.key==="PRIV"&&w.info==="com.apple.streaming.transportStreamTimestamp"},v=function(w){var D=String.fromCharCode(w[0],w[1],w[2],w[3]),O=K(w,4),A=10;return{type:D,size:O,data:w.subarray(A,A+O)}},m=function(w){for(var D=0,O=[];X(w,D);){var A=K(w,D+6);D+=10;for(var C=D+A;D+8<C;){var T=v(w.subarray(D)),f=p(T);f&&O.push(f),D+=T.size+10}j(w,D)&&(D+=10)}return O},p=function(w){return w.type==="PRIV"?u(w):w.type[0]==="W"?d(w):h(w)},u=function(w){if(w.size<2)return;var D=l(w.data,!0),O=new Uint8Array(w.data.subarray(D.length+1));return{key:w.type,info:D,data:O.buffer}},h=function(w){if(w.size<2)return;if(w.type==="TXXX"){var D=1,O=l(w.data.subarray(D),!0);D+=O.length+1;var A=l(w.data.subarray(D));return{key:w.type,info:O,data:A}}var C=l(w.data.subarray(1));return{key:w.type,data:C}},d=function(w){if(w.type==="WXXX"){if(w.size<2)return;var D=1,O=l(w.data.subarray(D),!0);D+=O.length+1;var A=l(w.data.subarray(D));return{key:w.type,info:O,data:A}}var C=l(w.data);return{key:w.type,data:C}},o=function(w){if(w.data.byteLength===8){var D=new Uint8Array(w.data),O=D[3]&1,A=(D[4]<<23)+(D[5]<<15)+(D[6]<<7)+D[7];return A/=45,O&&(A+=4772185884e-2),Math.round(A)}return},l=function(w,D){D===void 0&&(D=!1);var O=R();if(O){var A=O.decode(w);if(D){var C=A.indexOf("\0");return C!==-1?A.substring(0,C):A}return A.replace(/\0/g,"")}for(var T=w.length,f,S,y,b="",U=0;U<T;){if(f=w[U++],f===0&&D)return b;if(f===0||f===3)continue;switch(f>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(f);break;case 12:case 13:S=w[U++],b+=String.fromCharCode((f&31)<<6|S&63);break;case 14:S=w[U++],y=w[U++],b+=String.fromCharCode((f&15)<<12|(S&63)<<6|(y&63)<<0);break;default:}}return b},s={decodeTextFrame:h},a;function R(){return!a&&typeof self.TextDecoder!="undefined"&&(a=new self.TextDecoder("utf-8")),a}},"./src/demux/mp3demuxer.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/demux/base-audio-demuxer.ts"),j=P("./src/demux/id3.ts"),B=P("./src/utils/logger.ts"),K=P("./src/demux/mpegaudio.ts");function H(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,r(v,m)}function r(v,m){return r=Object.setPrototypeOf||function(u,h){return u.__proto__=h,u},r(v,m)}var L=function(v){H(m,v);function m(){return v.apply(this,arguments)||this}var p=m.prototype;return p.resetInitSegment=function(h,d,o){v.prototype.resetInitSegment.call(this,h,d,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:h,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(h){if(!h)return!1;for(var d=j.getID3Data(h,0)||[],o=d.length,l=h.length;o<l;o++)if(K.probe(h,o))return B.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(h,d){return K.canParse(h,d)},p.appendFrame=function(h,d,o){return this.initPTS===null?void 0:K.appendFrame(h,d,o,this.initPTS,this.frameIndex)},m}(X.default);L.minProbeByteLength=4,J.default=L},"./src/demux/mp4demuxer.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/utils/mp4-tools.ts"),j=P("./src/demux/dummy-demuxed-track.ts"),B=function(){function K(r,L){this.remainderData=null,this.config=void 0,this.config=L}var H=K.prototype;return H.resetTimeStamp=function(){},H.resetInitSegment=function(){},H.resetContiguity=function(){},K.probe=function(L){return Object(X.findBox)({data:L,start:0,end:Math.min(L.length,16384)},["moof"]).length>0},H.demux=function(L){var v=L,m=Object(j.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(X.appendUint8Array)(this.remainderData,L));var p=Object(X.segmentValidRange)(v);this.remainderData=p.remainder,m.samples=p.valid||new Uint8Array}else m.samples=v;return{audioTrack:Object(j.dummyTrack)(),avcTrack:m,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},H.flush=function(){var L=Object(j.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(j.dummyTrack)(),avcTrack:L,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},H.demuxSampleAes=function(L,v,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},H.destroy=function(){},K}();B.minProbeByteLength=1024,J.default=B},"./src/demux/mpegaudio.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"appendFrame",function(){return r}),P.d(J,"parseHeader",function(){return L}),P.d(J,"isHeaderPattern",function(){return v}),P.d(J,"isHeader",function(){return m}),P.d(J,"canParse",function(){return p}),P.d(J,"probe",function(){return u});var X=null,j=[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],B=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],H=[0,1,1,4];function r(h,d,o,l,s){if(o+24>d.length)return;var a=L(d,o);if(a&&o+a.frameLength<=d.length){var R=a.samplesPerFrame*9e4/a.sampleRate,E=l+s*R,w={unit:d.subarray(o,o+a.frameLength),pts:E,dts:E};return h.config=[],h.channelCount=a.channelCount,h.samplerate=a.sampleRate,h.samples.push(w),{sample:w,length:a.frameLength,missing:0}}}function L(h,d){var o=h[d+1]>>3&3,l=h[d+1]>>1&3,s=h[d+2]>>4&15,a=h[d+2]>>2&3;if(o!==1&&s!==0&&s!==15&&a!==3){var R=h[d+2]>>1&1,E=h[d+3]>>6,w=o===3?3-l:l===3?3:4,D=j[w*14+s-1]*1e3,O=o===3?0:o===2?1:2,A=B[O*3+a],C=E===3?1:2,T=K[o][l],f=H[l],S=T*8*f,y=Math.floor(T*D/A+R)*f;if(X===null){var b=navigator.userAgent||"",U=b.match(/Chrome\/(\d+)/i);X=U?parseInt(U[1]):0}var F=!!X&&X<=87;return F&&l===2&&D>=224e3&&E===0&&(h[d+3]=h[d+3]|128),{sampleRate:A,channelCount:C,frameLength:y,samplesPerFrame:S}}}function v(h,d){return h[d]===255&&(h[d+1]&224)===224&&(h[d+1]&6)!==0}function m(h,d){return d+1<h.length&&v(h,d)}function p(h,d){var o=4;return v(h,d)&&o<=h.length-d}function u(h,d){if(d+1<h.length&&v(h,d)){var o=4,l=L(h,d),s=o;l!=null&&l.frameLength&&(s=l.frameLength);var a=d+s;return a===h.length||m(h,a)}return!1}},"./src/demux/sample-aes.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/crypt/decrypter.ts"),j=P("./src/demux/tsdemuxer.ts"),B=function(){function K(r,L,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new X.default(r,L,{removePKCS7Padding:!1})}var H=K.prototype;return H.decryptBuffer=function(L,v){this.decrypter.decrypt(L,this.keyData.key.buffer,this.keyData.iv.buffer,v)},H.decryptAacSample=function(L,v,m,p){var u=L[v].unit,h=u.subarray(16,u.length-u.length%16),d=h.buffer.slice(h.byteOffset,h.byteOffset+h.length),o=this;this.decryptBuffer(d,function(l){var s=new Uint8Array(l);u.set(s,16),p||o.decryptAacSamples(L,v+1,m)})},H.decryptAacSamples=function(L,v,m){for(;;v++){if(v>=L.length){m();return}if(L[v].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(L,v,m,p),!p)return}},H.getAvcEncryptedData=function(L){for(var v=Math.floor((L.length-48)/160)*16+16,m=new Int8Array(v),p=0,u=32;u<=L.length-16;u+=160,p+=16)m.set(L.subarray(u,u+16),p);return m},H.getAvcDecryptedUnit=function(L,v){for(var m=new Uint8Array(v),p=0,u=32;u<=L.length-16;u+=160,p+=16)L.set(m.subarray(p,p+16),u);return L},H.decryptAvcSample=function(L,v,m,p,u,h){var d=Object(j.discardEPB)(u.data),o=this.getAvcEncryptedData(d),l=this;this.decryptBuffer(o.buffer,function(s){u.data=l.getAvcDecryptedUnit(d,s),h||l.decryptAvcSamples(L,v,m+1,p)})},H.decryptAvcSamples=function(L,v,m,p){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,m=0){if(v>=L.length){p();return}for(var u=L[v].units;!(m>=u.length);m++){var h=u[m];if(h.data.length<=48||h.type!==1&&h.type!==5)continue;var d=this.decrypter.isSync();if(this.decryptAvcSample(L,v,m,p,h,d),!d)return}}},K}();J.default=B},"./src/demux/transmuxer-interface.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return u});var X=P("./node_modules/webworkify-webpack/index.js"),j=P.n(X),B=P("./src/events.ts"),K=P("./src/demux/transmuxer.ts"),H=P("./src/utils/logger.ts"),r=P("./src/errors.ts"),L=P("./src/utils/mediasource-helper.ts"),v=P("./node_modules/eventemitter3/index.js"),m=P.n(v),p=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function h(o,l,s,a){var R=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=l,this.onTransmuxComplete=s,this.onFlush=a;var E=o.config,w=function(T,f){f=f||{},f.frag=R.frag,f.id=R.id,o.trigger(T,f)};this.observer=new v.EventEmitter,this.observer.on(B.Events.FRAG_DECRYPTED,w),this.observer.on(B.Events.ERROR,w);var D={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(E.enableWorker&&typeof Worker!="undefined"){H.logger.log("demuxing in webworker");var A;try{A=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),A.addEventListener("message",this.onwmsg),A.onerror=function(C){o.trigger(B.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(C.message+" ("+C.filename+":"+C.lineno+")")})},A.postMessage({cmd:"init",typeSupported:D,vendor:O,id:l,config:JSON.stringify(E)})}catch(C){H.logger.warn("Error in worker:",C),H.logger.error("Error while initializing DemuxerWorker, fallback to inline"),A&&self.URL.revokeObjectURL(A.objectURL),this.transmuxer=new K.default(this.observer,D,E,O,l),this.worker=null}}else this.transmuxer=new K.default(this.observer,D,E,O,l)}var d=h.prototype;return d.destroy=function(){var l=this.worker;if(l)l.removeEventListener("message",this.onwmsg),l.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},d.push=function(l,s,a,R,E,w,D,O,A,C){var T=this;A.transmuxing.start=self.performance.now();var f=this.transmuxer,S=this.worker,y=w?w.start:E.start,b=E.decryptdata,U=this.frag,F=!(U&&E.cc===U.cc),_=!(U&&A.level===U.level),M=U?A.sn-U.sn:-1,I=this.part?A.part-this.part.index:1,g=!_&&(M===1||M===0&&I===1),W=self.performance.now();(_||M||E.stats.parsing.start===0)&&(E.stats.parsing.start=W),w&&(I||!g)&&(w.stats.parsing.start=W);var $=new K.TransmuxState(F,g,O,_,y);if(!g||F){H.logger.log("[transmuxer-interface, "+E.type+"]: Starting new transmux session for sn: "+A.sn+" p: "+A.part+" level: "+A.level+" id: "+A.id+`
discontinuity: `+F+`
trackSwitch: `+_+`
contiguous: `+g+`
accurateTimeOffset: `+O+`
timeOffset: `+y);var ne=new K.TransmuxConfig(a,R,s,D,C);this.configureTransmuxer(ne)}if(this.frag=E,this.part=w,S)S.postMessage({cmd:"demux",data:l,decryptdata:b,chunkMeta:A,state:$},l instanceof ArrayBuffer?[l]:[]);else if(f){var oe=f.push(l,b,A,$);Object(K.isPromise)(oe)?oe.then(function(we){T.handleTransmuxComplete(we)}):this.handleTransmuxComplete(oe)}},d.flush=function(l){var s=this;l.transmuxing.start=self.performance.now();var a=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:l});else if(a){var E=a.flush(l);Object(K.isPromise)(E)?E.then(function(w){s.handleFlushResult(w,l)}):this.handleFlushResult(E,l)}},d.handleFlushResult=function(l,s){var a=this;l.forEach(function(R){a.handleTransmuxComplete(R)}),this.onFlush(s)},d.onWorkerMessage=function(l){var s=l.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}}},d.configureTransmuxer=function(l){var s=this.worker,a=this.transmuxer;s?s.postMessage({cmd:"configure",config:l}):a&&a.configure(l)},d.handleTransmuxComplete=function(l){l.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(l)},h}()},"./src/demux/transmuxer-worker.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return r});var X=P("./src/demux/transmuxer.ts"),j=P("./src/events.ts"),B=P("./src/utils/logger.ts"),K=P("./node_modules/eventemitter3/index.js"),H=P.n(K);function r(u){var h=new K.EventEmitter,d=function(l,s){u.postMessage({event:l,data:s})};h.on(j.Events.FRAG_DECRYPTED,d),h.on(j.Events.ERROR,d),u.addEventListener("message",function(o){var l=o.data;switch(l.cmd){case"init":{var s=JSON.parse(l.config);u.transmuxer=new X.default(h,l.typeSupported,s,l.vendor,l.id),Object(B.enableLogs)(s.debug),d("init",null);break}case"configure":{u.transmuxer.configure(l.config);break}case"demux":{var a=u.transmuxer.push(l.data,l.decryptdata,l.chunkMeta,l.state);Object(X.isPromise)(a)?a.then(function(w){L(u,w)}):L(u,a);break}case"flush":{var R=l.chunkMeta,E=u.transmuxer.flush(R);Object(X.isPromise)(E)?E.then(function(w){m(u,w,R)}):m(u,E,R);break}default:break}})}function L(u,h){if(p(h.remuxResult))return;var d=[],o=h.remuxResult,l=o.audio,s=o.video;l&&v(d,l),s&&v(d,s),u.postMessage({event:"transmuxComplete",data:h},d)}function v(u,h){h.data1&&u.push(h.data1.buffer),h.data2&&u.push(h.data2.buffer)}function m(u,h,d){h.forEach(function(o){L(u,o)}),u.postMessage({event:"flush",data:d})}function p(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return s}),P.d(J,"isPromise",function(){return E}),P.d(J,"TransmuxConfig",function(){return w}),P.d(J,"TransmuxState",function(){return D});var X=P("./src/events.ts"),j=P("./src/errors.ts"),B=P("./src/crypt/decrypter.ts"),K=P("./src/demux/aacdemuxer.ts"),H=P("./src/demux/mp4demuxer.ts"),r=P("./src/demux/tsdemuxer.ts"),L=P("./src/demux/mp3demuxer.ts"),v=P("./src/remux/mp4-remuxer.ts"),m=P("./src/remux/passthrough-remuxer.ts"),p=P("./src/demux/chunk-cache.ts"),u=P("./src/utils/mp4-tools.ts"),h=P("./src/utils/logger.ts"),d;try{d=self.performance.now.bind(self.performance)}catch(O){h.logger.debug("Unable to use Performance API on this environment"),d=self.Date.now}var o=[{demux:r.default,remux:v.default},{demux:H.default,remux:m.default},{demux:K.default,remux:v.default},{demux:L.default,remux:v.default}],l=1024;o.forEach(function(O){var A=O.demux;l=Math.max(l,A.minProbeByteLength)});var s=function(){function O(C,T,f,S,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=C,this.typeSupported=T,this.config=f,this.vendor=S,this.id=y}var A=O.prototype;return A.configure=function(T){this.transmuxConfig=T,this.decrypter&&this.decrypter.reset()},A.push=function(T,f,S,y){var b=this,U=S.transmuxing;U.executeStart=d();var F=new Uint8Array(T),_=this.cache,M=this.config,I=this.currentTransmuxState,g=this.transmuxConfig;y&&(this.currentTransmuxState=y);var W=a(F,f);if(W&&W.method==="AES-128"){var $=this.getDecrypter();if(M.enableSoftwareAES){var ne=$.softwareDecrypt(F,W.key.buffer,W.iv.buffer);if(!ne)return U.executeEnd=d(),R(S);F=new Uint8Array(ne)}else return this.decryptionPromise=$.webCryptoDecrypt(F,W.key.buffer,W.iv.buffer).then(function(Pe){var Ue=b.push(Pe,null,S);return b.decryptionPromise=null,Ue}),this.decryptionPromise}var oe=y||I,we=oe.contiguous,ge=oe.discontinuity,xe=oe.trackSwitch,Re=oe.accurateTimeOffset,Le=oe.timeOffset,ce=g.audioCodec,he=g.videoCodec,re=g.defaultInitPts,de=g.duration,se=g.initSegmentData;if((ge||xe)&&this.resetInitSegment(se,ce,he,de),ge&&this.resetInitialTimestamp(re),we||this.resetContiguity(),this.needsProbing(F,ge,xe)){if(_.dataLength){var De=_.flush();F=Object(u.appendUint8Array)(De,F)}this.configureTransmuxer(F,g)}var Ne=this.transmux(F,W,Le,Re,S),Se=this.currentTransmuxState;return Se.contiguous=!0,Se.discontinuity=!1,Se.trackSwitch=!1,U.executeEnd=d(),Ne},A.flush=function(T){var f=this,S=T.transmuxing;S.executeStart=d();var y=this.decrypter,b=this.cache,U=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return f.flush(T)});var _=[],M=U.timeOffset;if(y){var I=y.flush();I&&_.push(this.push(I,null,T))}var g=b.dataLength;b.reset();var W=this.demuxer,$=this.remuxer;if(!W||!$)return g>=l&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),S.executeEnd=d(),[R(T)];var ne=W.flush(M);return E(ne)?ne.then(function(oe){return f.flushRemux(_,oe,T),_}):(this.flushRemux(_,ne,T),_)},A.flushRemux=function(T,f,S){var y=f.audioTrack,b=f.avcTrack,U=f.id3Track,F=f.textTrack,_=this.currentTransmuxState,M=_.accurateTimeOffset,I=_.timeOffset;h.logger.log("[transmuxer.ts]: Flushed fragment "+S.sn+(S.part>-1?" p: "+S.part:"")+" of level "+S.level);var g=this.remuxer.remux(y,b,U,F,I,M,!0,this.id);T.push({remuxResult:g,chunkMeta:S}),S.transmuxing.executeEnd=d()},A.resetInitialTimestamp=function(T){var f=this.demuxer,S=this.remuxer;if(!f||!S)return;f.resetTimeStamp(T),S.resetTimeStamp(T)},A.resetContiguity=function(){var T=this.demuxer,f=this.remuxer;if(!T||!f)return;T.resetContiguity(),f.resetNextTimestamp()},A.resetInitSegment=function(T,f,S,y){var b=this.demuxer,U=this.remuxer;if(!b||!U)return;b.resetInitSegment(f,S,y),U.resetInitSegment(T,f,S)},A.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},A.transmux=function(T,f,S,y,b){var U;return f&&f.method==="SAMPLE-AES"?U=this.transmuxSampleAes(T,f,S,y,b):U=this.transmuxUnencrypted(T,S,y,b),U},A.transmuxUnencrypted=function(T,f,S,y){var b=this.demuxer.demux(T,f,!1,!this.config.progressive),U=b.audioTrack,F=b.avcTrack,_=b.id3Track,M=b.textTrack,I=this.remuxer.remux(U,F,_,M,f,S,!1,this.id);return{remuxResult:I,chunkMeta:y}},A.transmuxSampleAes=function(T,f,S,y,b){var U=this;return this.demuxer.demuxSampleAes(T,f,S).then(function(F){var _=U.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,S,y,!1,U.id);return{remuxResult:_,chunkMeta:b}})},A.configureTransmuxer=function(T,f){for(var S=this.config,y=this.observer,b=this.typeSupported,U=this.vendor,F=f.audioCodec,_=f.defaultInitPts,M=f.duration,I=f.initSegmentData,g=f.videoCodec,W,$=0,ne=o.length;$<ne;$++)if(o[$].demux.probe(T)){W=o[$];break}W||(h.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),W={demux:H.default,remux:m.default});var oe=this.demuxer,we=this.remuxer,ge=W.remux,xe=W.demux;(!we||!(we instanceof ge))&&(this.remuxer=new ge(y,S,b,U)),(!oe||!(oe instanceof xe))&&(this.demuxer=new xe(y,S,b),this.probe=xe.probe),this.resetInitSegment(I,F,g,M),this.resetInitialTimestamp(_)},A.needsProbing=function(T,f,S){return!this.demuxer||!this.remuxer||f||S},A.getDecrypter=function(){var T=this.decrypter;return T||(T=this.decrypter=new B.default(this.observer,this.config)),T},O}();function a(O,A){var C=null;return O.byteLength>0&&A!=null&&A.key!=null&&A.iv!==null&&A.method!=null&&(C=A),C}var R=function(A){return{remuxResult:{},chunkMeta:A}};function E(O){return"then"in O&&O.then instanceof Function}var w=function(A,C,T,f,S){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=A,this.videoCodec=C,this.initSegmentData=T,this.duration=f,this.defaultInitPts=S},D=function(A,C,T,f,S){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=A,this.contiguous=C,this.accurateTimeOffset=T,this.trackSwitch=f,this.timeOffset=S}},"./src/demux/tsdemuxer.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"discardEPB",function(){return R});var X=P("./src/demux/adts.ts"),j=P("./src/demux/mpegaudio.ts"),B=P("./src/demux/exp-golomb.ts"),K=P("./src/demux/id3.ts"),H=P("./src/demux/sample-aes.ts"),r=P("./src/events.ts"),L=P("./src/utils/mp4-tools.ts"),v=P("./src/utils/logger.ts"),m=P("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},u=function(){function E(D,O,A){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=D,this.config=O,this.typeSupported=A}E.probe=function(O){var A=E.syncOffset(O);return A<0?!1:(A&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+A+", junk ahead ?"),!0)},E.syncOffset=function(O){for(var A=Math.min(1e3,O.length-3*188),C=0;C<A;){if(O[C]===71&&O[C+188]===71&&O[C+2*188]===71)return C;C++}return-1},E.createTrack=function(O,A){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:p[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?A:void 0}};var w=E.prototype;return w.resetInitSegment=function(O,A,C){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=E.createTrack("video",C),this._audioTrack=E.createTrack("audio",C),this._id3Track=E.createTrack("id3",C),this._txtTrack=E.createTrack("text",C),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=A,this._duration=C},w.resetTimeStamp=function(){},w.resetContiguity=function(){var O=this._audioTrack,A=this._avcTrack,C=this._id3Track;O&&(O.pesData=null),A&&(A.pesData=null),C&&(C.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},w.demux=function(O,A,C,T){C===void 0&&(C=!1),T===void 0&&(T=!1),C||(this.sampleAes=null);var f,S=this._avcTrack,y=this._audioTrack,b=this._id3Track,U=S.pid,F=S.pesData,_=y.pid,M=b.pid,I=y.pesData,g=b.pesData,W=!1,$=this.pmtParsed,ne=this._pmtId,oe=O.length;if(this.remainderData&&(O=Object(L.appendUint8Array)(this.remainderData,O),oe=O.length,this.remainderData=null),oe<188&&!T)return this.remainderData=O,{audioTrack:y,avcTrack:S,id3Track:b,textTrack:this._txtTrack};var we=Math.max(0,E.syncOffset(O));oe-=(oe+we)%188,oe<O.byteLength&&!T&&(this.remainderData=new Uint8Array(O.buffer,oe,O.buffer.byteLength-oe));for(var ge=we;ge<oe;ge+=188)if(O[ge]===71){var xe=!!(O[ge+1]&64),Re=((O[ge+1]&31)<<8)+O[ge+2],Le=(O[ge+3]&48)>>4,ce=void 0;if(Le>1){if(ce=ge+5+O[ge+4],ce===ge+188)continue}else ce=ge+4;switch(Re){case U:xe&&(F&&(f=l(F))&&this.parseAVCPES(f,!1),F={data:[],size:0}),F&&(F.data.push(O.subarray(ce,ge+188)),F.size+=ge+188-ce);break;case _:xe&&(I&&(f=l(I))&&(y.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),I={data:[],size:0}),I&&(I.data.push(O.subarray(ce,ge+188)),I.size+=ge+188-ce);break;case M:xe&&(g&&(f=l(g))&&this.parseID3PES(f),g={data:[],size:0}),g&&(g.data.push(O.subarray(ce,ge+188)),g.size+=ge+188-ce);break;case 0:xe&&(ce+=O[ce]+1),ne=this._pmtId=d(O,ce);break;case ne:{xe&&(ce+=O[ce]+1);var he=o(O,ce,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,C);U=he.avc,U>0&&(S.pid=U),_=he.audio,_>0&&(y.pid=_,y.isAAC=he.isAAC),M=he.id3,M>0&&(b.pid=M),W&&!$&&(v.logger.log("reparse from beginning"),W=!1,ge=we-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:W=!0;break}}else this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});S.pesData=F,y.pesData=I,b.pesData=g;var re={audioTrack:y,avcTrack:S,id3Track:b,textTrack:this._txtTrack};return T&&this.extractRemainingSamples(re),re},w.flush=function(){var O=this.remainderData;this.remainderData=null;var A;return O?A=this.demux(O,-1,!1,!0):A={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(A),this.sampleAes?this.decrypt(A,this.sampleAes):A},w.extractRemainingSamples=function(O){var A=O.audioTrack,C=O.avcTrack,T=O.id3Track,f=C.pesData,S=A.pesData,y=T.pesData,b;f&&(b=l(f))?(this.parseAVCPES(b,!0),C.pesData=null):C.pesData=f,S&&(b=l(S))?(A.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),A.pesData=null):(S!=null&&S.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),A.pesData=S),y&&(b=l(y))?(this.parseID3PES(b),T.pesData=null):T.pesData=y},w.demuxSampleAes=function(O,A,C){var T=this.demux(O,C,!0,!this.config.progressive),f=this.sampleAes=new H.default(this.observer,this.config,A);return this.decrypt(T,f)},w.decrypt=function(O,A){return new Promise(function(C){var T=O.audioTrack,f=O.avcTrack;T.samples&&T.isAAC?A.decryptAacSamples(T.samples,0,function(){f.samples?A.decryptAvcSamples(f.samples,0,0,function(){C(O)}):C(O)}):f.samples&&A.decryptAvcSamples(f.samples,0,0,function(){C(O)})})},w.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},w.parseAVCPES=function(O,A){var C=this,T=this._avcTrack,f=this.parseAVCNALu(O.data),S=!1,y=this.avcSample,b,U=!1;O.data=null,y&&f.length&&!T.audFound&&(s(y,T),y=this.avcSample=h(!1,O.pts,O.dts,"")),f.forEach(function(F){switch(F.type){case 1:{b=!0,y||(y=C.avcSample=h(!0,O.pts,O.dts,"")),S&&(y.debug+="NDR "),y.frame=!0;var _=F.data;if(U&&_.length>4){var M=new B.default(_).readSliceType();(M===2||M===4||M===7||M===9)&&(y.key=!0)}break}case 5:b=!0,y||(y=C.avcSample=h(!0,O.pts,O.dts,"")),S&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{b=!0,S&&y&&(y.debug+="SEI ");var I=new B.default(R(F.data));I.readUByte();for(var g=0,W=0,$=!1,ne=0;!$&&I.bytesAvailable>1;){g=0;do ne=I.readUByte(),g+=ne;while(ne===255);W=0;do ne=I.readUByte(),W+=ne;while(ne===255);if(g===4&&I.bytesAvailable!==0){$=!0;var oe=I.readUByte();if(oe===181){var we=I.readUShort();if(we===49){var ge=I.readUInt();if(ge===1195456820){var xe=I.readUByte();if(xe===3){for(var Re=I.readUByte(),Le=I.readUByte(),ce=31&Re,he=[Re,Le],re=0;re<ce;re++)he.push(I.readUByte()),he.push(I.readUByte()),he.push(I.readUByte());a(C._txtTrack.samples,{type:3,pts:O.pts,bytes:he})}}}}}else if(g===5&&I.bytesAvailable!==0){if($=!0,W>16){for(var de=[],se=0;se<16;se++)de.push(I.readUByte().toString(16)),(se===3||se===5||se===7||se===9)&&de.push("-");for(var De=W-16,Ne=new Uint8Array(De),Se=0;Se<De;Se++)Ne[Se]=I.readUByte();a(C._txtTrack.samples,{pts:O.pts,payloadType:g,uuid:de.join(""),userData:Object(K.utf8ArrayToStr)(Ne),userDataBytes:Ne})}}else if(W<I.bytesAvailable)for(var Pe=0;Pe<W;Pe++)I.readUByte()}break}case 7:if(b=!0,U=!0,S&&y&&(y.debug+="SPS "),!T.sps){var Ue=new B.default(F.data),le=Ue.readSPS();T.width=le.width,T.height=le.height,T.pixelRatio=le.pixelRatio,T.sps=[F.data],T.duration=C._duration;for(var ve=F.data.subarray(1,4),Ae="avc1.",Ie=0;Ie<3;Ie++){var Ge=ve[Ie].toString(16);Ge.length<2&&(Ge="0"+Ge),Ae+=Ge}T.codec=Ae}break;case 8:b=!0,S&&y&&(y.debug+="PPS "),T.pps||(T.pps=[F.data]);break;case 9:b=!1,T.audFound=!0,y&&s(y,T),y=C.avcSample=h(!1,O.pts,O.dts,S?"AUD ":"");break;case 12:b=!1;break;default:b=!1,y&&(y.debug+="unknown NAL "+F.type+" ");break}if(y&&b){var $e=y.units;$e.push(F)}}),A&&y&&(s(y,T),this.avcSample=null)},w.getLastNalUnit=function(){var O,A=this.avcSample,C;if(!A||A.units.length===0){var T=this._avcTrack.samples;A=T[T.length-1]}if((O=A)!==null&&O!==void 0&&O.units){var f=A.units;C=f[f.length-1]}return C},w.parseAVCNALu=function(O){var A=O.byteLength,C=this._avcTrack,T=C.naluState||0,f=T,S=[],y=0,b,U,F,_=-1,M=0;for(T===-1&&(_=0,M=O[0]&31,T=0,y=1);y<A;){if(b=O[y++],!T){T=b?0:1;continue}if(T===1){T=b?0:2;continue}if(!b)T=3;else if(b===1){if(_>=0){var I={data:O.subarray(_,y-T-1),type:M};S.push(I)}else{var g=this.getLastNalUnit();if(g&&(f&&y<=4-f&&(g.state&&(g.data=g.data.subarray(0,g.data.byteLength-f))),U=y-T-1,U>0)){var W=new Uint8Array(g.data.byteLength+U);W.set(g.data,0),W.set(O.subarray(0,U),g.data.byteLength),g.data=W,g.state=0}}y<A?(F=O[y]&31,_=y,M=F,T=0):T=-1}else T=0}if(_>=0&&T>=0){var $={data:O.subarray(_,A),type:M,state:T};S.push($)}if(S.length===0){var ne=this.getLastNalUnit();if(ne){var oe=new Uint8Array(ne.data.byteLength+O.byteLength);oe.set(ne.data,0),oe.set(O,ne.data.byteLength),ne.data=oe}}return C.naluState=T,S},w.parseAACPES=function(O){var A=0,C=this._audioTrack,T=this.aacOverFlow,f=O.data;if(T){this.aacOverFlow=null;var S=T.sample.unit.byteLength,y=Math.min(T.missing,S),b=S-y;T.sample.unit.set(f.subarray(0,y),b),C.samples.push(T.sample),A=T.missing}var U,F;for(U=A,F=f.length;U<F-1&&!X.isHeader(f,U);U++);if(U!==A){var _,M;if(U<F-1?(_="AAC PES did not start with ADTS header,offset:"+U,M=!1):(_="no ADTS header found in AAC PES",M=!0),v.logger.warn("parsing error:"+_),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:M,reason:_}),M)return}X.initTrackConfig(C,this.observer,f,U,this.audioCodec);var I;if(O.pts!==void 0)I=O.pts;else if(T){var g=X.getFrameDuration(C.samplerate);I=T.sample.pts+g}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var W=0;U<F;)if(X.isHeader(f,U)){if(U+5<F){var $=X.appendFrame(C,f,U,I,W);if($)if($.missing)this.aacOverFlow=$;else{U+=$.length,W++;continue}}break}else U++},w.parseMPEGPES=function(O){var A=O.data,C=A.length,T=0,f=0,S=O.pts;if(S===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<C;)if(j.isHeader(A,f)){var y=j.appendFrame(this._audioTrack,A,f,S,T);if(y)f+=y.length,T++;else break}else f++},w.parseID3PES=function(O){if(O.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},E}();u.minProbeByteLength=188;function h(E,w,D,O){return{key:E,frame:!1,pts:w,dts:D,units:[],debug:O,length:0}}function d(E,w){return(E[w+10]&31)<<8|E[w+11]}function o(E,w,D,O){var A={audio:-1,avc:-1,id3:-1,isAAC:!0},C=(E[w+1]&15)<<8|E[w+2],T=w+3+C-4,f=(E[w+10]&15)<<8|E[w+11];for(w+=12+f;w<T;){var S=(E[w+1]&31)<<8|E[w+2];switch(E[w]){case 207:if(!O){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:A.audio===-1&&(A.audio=S);break;case 21:A.id3===-1&&(A.id3=S);break;case 219:if(!O){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:A.avc===-1&&(A.avc=S);break;case 3:case 4:D?A.audio===-1&&(A.audio=S,A.isAAC=!1):v.logger.log("MPEG audio found, not supported in this browser");break;case 36:v.logger.warn("Unsupported HEVC stream type found");break;default:break}w+=((E[w+3]&15)<<8|E[w+4])+5}return A}function l(E){var w=0,D,O,A,C,T,f=E.data;if(!E||E.size===0)return null;for(;f[0].length<19&&f.length>1;){var S=new Uint8Array(f[0].length+f[1].length);S.set(f[0]),S.set(f[1],f[0].length),f[0]=S,f.splice(1,1)}D=f[0];var y=(D[0]<<16)+(D[1]<<8)+D[2];if(y===1){if(O=(D[4]<<8)+D[5],O&&O>E.size-6)return null;var b=D[7];b&192&&(C=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,b&64?(T=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,C-T>60*9e4&&(v.logger.warn(Math.round((C-T)/9e4)+"s delta between PTS and DTS, align them"),C=T)):T=C),A=D[8];var U=A+9;if(E.size<=U)return null;E.size-=U;for(var F=new Uint8Array(E.size),_=0,M=f.length;_<M;_++){D=f[_];var I=D.byteLength;if(U)if(U>I){U-=I;continue}else D=D.subarray(U),I-=U,U=0;F.set(D,w),w+=I}return O&&(O-=A+3),{data:F,pts:C,dts:T,len:O}}return null}function s(E,w){if(E.units.length&&E.frame){if(E.pts===void 0){var D=w.samples,O=D.length;if(O){var A=D[O-1];E.pts=A.pts,E.dts=A.dts}else{w.dropped++;return}}w.samples.push(E)}E.debug.length&&v.logger.log(E.pts+"/"+E.dts+":"+E.debug)}function a(E,w){var D=E.length;if(D>0){if(w.pts>=E[D-1].pts)E.push(w);else for(var O=D-1;O>=0;O--)if(w.pts<E[O].pts){E.splice(O,0,w);break}}else E.push(w)}function R(E){for(var w=E.byteLength,D=[],O=1;O<w-2;)E[O]===0&&E[O+1]===0&&E[O+2]===3?(D.push(O+2),O+=2):O++;if(D.length===0)return E;var A=w-D.length,C=new Uint8Array(A),T=0;for(O=0;O<A;T++,O++)T===D[0]&&(T++,D.shift()),C[O]=E[T];return C}J.default=u},"./src/errors.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"ErrorTypes",function(){return X}),P.d(J,"ErrorDetails",function(){return j});var X;(function(B){B.NETWORK_ERROR="networkError",B.MEDIA_ERROR="mediaError",B.KEY_SYSTEM_ERROR="keySystemError",B.MUX_ERROR="muxError",B.OTHER_ERROR="otherError"})(X||(X={}));var j;(function(B){B.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",B.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",B.KEY_SYSTEM_NO_SESSION="keySystemNoSession",B.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",B.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",B.MANIFEST_LOAD_ERROR="manifestLoadError",B.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",B.MANIFEST_PARSING_ERROR="manifestParsingError",B.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",B.LEVEL_EMPTY_ERROR="levelEmptyError",B.LEVEL_LOAD_ERROR="levelLoadError",B.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",B.LEVEL_SWITCH_ERROR="levelSwitchError",B.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",B.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",B.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",B.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",B.FRAG_LOAD_ERROR="fragLoadError",B.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",B.FRAG_DECRYPT_ERROR="fragDecryptError",B.FRAG_PARSING_ERROR="fragParsingError",B.REMUX_ALLOC_ERROR="remuxAllocError",B.KEY_LOAD_ERROR="keyLoadError",B.KEY_LOAD_TIMEOUT="keyLoadTimeOut",B.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",B.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",B.BUFFER_APPEND_ERROR="bufferAppendError",B.BUFFER_APPENDING_ERROR="bufferAppendingError",B.BUFFER_STALLED_ERROR="bufferStalledError",B.BUFFER_FULL_ERROR="bufferFullError",B.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",B.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",B.INTERNAL_EXCEPTION="internalException",B.INTERNAL_ABORTED="aborted",B.UNKNOWN="unknown"})(j||(j={}))},"./src/events.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"Events",function(){return X});var X;(function(j){j.MEDIA_ATTACHING="hlsMediaAttaching",j.MEDIA_ATTACHED="hlsMediaAttached",j.MEDIA_DETACHING="hlsMediaDetaching",j.MEDIA_DETACHED="hlsMediaDetached",j.BUFFER_RESET="hlsBufferReset",j.BUFFER_CODECS="hlsBufferCodecs",j.BUFFER_CREATED="hlsBufferCreated",j.BUFFER_APPENDING="hlsBufferAppending",j.BUFFER_APPENDED="hlsBufferAppended",j.BUFFER_EOS="hlsBufferEos",j.BUFFER_FLUSHING="hlsBufferFlushing",j.BUFFER_FLUSHED="hlsBufferFlushed",j.MANIFEST_LOADING="hlsManifestLoading",j.MANIFEST_LOADED="hlsManifestLoaded",j.MANIFEST_PARSED="hlsManifestParsed",j.LEVEL_SWITCHING="hlsLevelSwitching",j.LEVEL_SWITCHED="hlsLevelSwitched",j.LEVEL_LOADING="hlsLevelLoading",j.LEVEL_LOADED="hlsLevelLoaded",j.LEVEL_UPDATED="hlsLevelUpdated",j.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",j.LEVELS_UPDATED="hlsLevelsUpdated",j.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",j.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",j.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",j.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",j.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",j.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",j.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",j.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",j.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",j.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",j.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",j.CUES_PARSED="hlsCuesParsed",j.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",j.INIT_PTS_FOUND="hlsInitPtsFound",j.FRAG_LOADING="hlsFragLoading",j.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",j.FRAG_LOADED="hlsFragLoaded",j.FRAG_DECRYPTED="hlsFragDecrypted",j.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",j.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",j.FRAG_PARSING_METADATA="hlsFragParsingMetadata",j.FRAG_PARSED="hlsFragParsed",j.FRAG_BUFFERED="hlsFragBuffered",j.FRAG_CHANGED="hlsFragChanged",j.FPS_DROP="hlsFpsDrop",j.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",j.ERROR="hlsError",j.DESTROYING="hlsDestroying",j.KEY_LOADING="hlsKeyLoading",j.KEY_LOADED="hlsKeyLoaded",j.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",j.BACK_BUFFER_REACHED="hlsBackBufferReached"})(X||(X={}))},"./src/hls.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return E});var X=P("./node_modules/url-toolkit/src/url-toolkit.js"),j=P.n(X),B=P("./src/loader/playlist-loader.ts"),K=P("./src/loader/key-loader.ts"),H=P("./src/controller/id3-track-controller.ts"),r=P("./src/controller/latency-controller.ts"),L=P("./src/controller/level-controller.ts"),v=P("./src/controller/fragment-tracker.ts"),m=P("./src/controller/stream-controller.ts"),p=P("./src/is-supported.ts"),u=P("./src/utils/logger.ts"),h=P("./src/config.ts"),d=P("./node_modules/eventemitter3/index.js"),o=P.n(d),l=P("./src/events.ts"),s=P("./src/errors.ts");function a(w,D){for(var O=0;O<D.length;O++){var A=D[O];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(w,A.key,A)}}function R(w,D,O){return D&&a(w.prototype,D),O&&a(w,O),w}var E=function(){w.isSupported=function(){return Object(p.isSupported)()};function w(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new d.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 A=this.config=Object(h.mergeConfig)(w.DefaultConfig,O);this.userConfig=O,Object(u.enableLogs)(A.debug),this._autoLevelCapping=-1,A.progressive&&Object(h.enableStreamingMode)(A);var C=A.abrController,T=A.bufferController,f=A.capLevelController,S=A.fpsController,y=this.abrController=new C(this),b=this.bufferController=new T(this),U=this.capLevelController=new f(this),F=new S(this),_=new B.default(this),M=new K.default(this),I=new H.default(this),g=this.levelController=new L.default(this),W=new v.FragmentTracker(this),$=this.streamController=new m.default(this,W);U.setStreamController($),F.setStreamController($);var ne=[g,$];this.networkControllers=ne;var oe=[_,M,y,b,U,F,I,W];this.audioTrackController=this.createController(A.audioTrackController,null,ne),this.createController(A.audioStreamController,W,ne),this.subtitleTrackController=this.createController(A.subtitleTrackController,null,ne),this.createController(A.subtitleStreamController,W,ne),this.createController(A.timelineController,null,oe),this.emeController=this.createController(A.emeController,null,oe),this.cmcdController=this.createController(A.cmcdController,null,oe),this.latencyController=this.createController(r.default,null,oe),this.coreComponents=oe}var D=w.prototype;return D.createController=function(A,C,T){if(A){var f=C?new A(this,C):new A(this);return T&&T.push(f),f}return null},D.on=function(A,C,T){T===void 0&&(T=this),this._emitter.on(A,C,T)},D.once=function(A,C,T){T===void 0&&(T=this),this._emitter.once(A,C,T)},D.removeAllListeners=function(A){this._emitter.removeAllListeners(A)},D.off=function(A,C,T,f){T===void 0&&(T=this),this._emitter.off(A,C,T,f)},D.listeners=function(A){return this._emitter.listeners(A)},D.emit=function(A,C,T){return this._emitter.emit(A,C,T)},D.trigger=function(A,C){if(this.config.debug)return this.emit(A,A,C);try{return this.emit(A,A,C)}catch(T){u.logger.error("An internal error happened while handling event "+A+'. Error message: "'+T.message+'". Here is a stacktrace:',T),this.trigger(l.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:A,error:T})}return!1},D.listenerCount=function(A){return this._emitter.listenerCount(A)},D.destroy=function(){u.logger.log("destroy"),this.trigger(l.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(A){return A.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(A){return A.destroy()}),this.coreComponents.length=0},D.attachMedia=function(A){u.logger.log("attachMedia"),this._media=A,this.trigger(l.Events.MEDIA_ATTACHING,{media:A})},D.detachMedia=function(){u.logger.log("detachMedia"),this.trigger(l.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(A){this.stopLoad();var C=this.media,T=this.url,f=this.url=X.buildAbsoluteURL(self.location.href,A,{alwaysNormalize:!0});u.logger.log("loadSource:"+f),C&&T&&T!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(C)),this.trigger(l.Events.MANIFEST_LOADING,{url:A})},D.startLoad=function(A){A===void 0&&(A=-1),u.logger.log("startLoad("+A+")"),this.networkControllers.forEach(function(C){C.startLoad(A)})},D.stopLoad=function(){u.logger.log("stopLoad"),this.networkControllers.forEach(function(A){A.stopLoad()})},D.swapAudioCodec=function(){u.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){u.logger.log("recoverMediaError");var A=this._media;this.detachMedia(),A&&this.attachMedia(A)},D.removeLevel=function(A,C){C===void 0&&(C=0),this.levelController.removeLevel(A,C)},R(w,[{key:"levels",get:function(){var A=this.levelController.levels;return A||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(A){u.logger.log("set currentLevel:"+A),this.loadLevel=A,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(A){u.logger.log("set nextLevel:"+A),this.levelController.manualLevel=A,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(A){u.logger.log("set loadLevel:"+A),this.levelController.manualLevel=A}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(A){this.levelController.nextLoadLevel=A}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(A){u.logger.log("set firstLevel:"+A),this.levelController.firstLevel=A}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(A){u.logger.log("set startLevel:"+A),A!==-1&&(A=Math.max(A,this.minAutoLevel)),this.levelController.startLevel=A}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(A){var C=!!A;C!==this.config.capLevelToPlayerSize&&(C?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=C)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(A){this._autoLevelCapping!==A&&(u.logger.log("set autoLevelCapping:"+A),this._autoLevelCapping=A)}},{key:"bandwidthEstimate",get:function(){var A=this.abrController.bwEstimator;return A?A.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var A=this.levels,C=this.config.minAutoBitrate;if(!A)return 0;for(var T=A.length,f=0;f<T;f++)if(A[f].maxBitrate>C)return f;return 0}},{key:"maxAutoLevel",get:function(){var A=this.levels,C=this.autoLevelCapping,T;return C===-1&&A&&A.length?T=A.length-1:T=C,T}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(A){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,A)}},{key:"audioTracks",get:function(){var A=this.audioTrackController;return A?A.audioTracks:[]}},{key:"audioTrack",get:function(){var A=this.audioTrackController;return A?A.audioTrack:-1},set:function(A){var C=this.audioTrackController;C&&(C.audioTrack=A)}},{key:"subtitleTracks",get:function(){var A=this.subtitleTrackController;return A?A.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var A=this.subtitleTrackController;return A?A.subtitleTrack:-1},set:function(A){var C=this.subtitleTrackController;C&&(C.subtitleTrack=A)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var A=this.subtitleTrackController;return A?A.subtitleDisplay:!1},set:function(A){var C=this.subtitleTrackController;C&&(C.subtitleDisplay=A)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(A){this.config.lowLatencyMode=A}},{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 l.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return w.defaultConfig?w.defaultConfig:h.hlsDefaultConfig},set:function(A){w.defaultConfig=A}}]),w}();E.defaultConfig=void 0},"./src/is-supported.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"isSupported",function(){return B}),P.d(J,"changeTypeSupported",function(){return K});var X=P("./src/utils/mediasource-helper.ts");function j(){return self.SourceBuffer||self.WebKitSourceBuffer}function B(){var H=Object(X.getMediaSource)();if(!H)return!1;var r=j(),L=H&&typeof H.isTypeSupported=="function"&&H.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!L&&!!v}function K(){var H,r=j();return typeof(r==null||((H=r.prototype)===null||H===void 0)?void 0:H.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return u}),P.d(J,"LoadError",function(){return d});var X=P("./src/polyfills/number.ts"),j=P("./src/errors.ts");function B(o,l){o.prototype=Object.create(l.prototype),o.prototype.constructor=o,v(o,l)}function K(o){var l=typeof Map=="function"?new Map:void 0;return K=function(a){if(a===null||!L(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(typeof l!="undefined"){if(l.has(a))return l.get(a);l.set(a,R)}function R(){return H(a,arguments,m(this).constructor)}return R.prototype=Object.create(a.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),v(R,a)},K(o)}function H(o,l,s){return r()?H=Reflect.construct:H=function(R,E,w){var D=[null];D.push.apply(D,E);var O=Function.bind.apply(R,D),A=new O;return w&&v(A,w.prototype),A},H.apply(null,arguments)}function r(){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 L(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function v(o,l){return v=Object.setPrototypeOf||function(a,R){return a.__proto__=R,a},v(o,l)}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),u=function(){function o(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var l=o.prototype;return l.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},l.abort=function(){this.loader&&this.loader.abort()},l.load=function(a,R){var E=this,w=a.url;if(!w)return Promise.reject(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,networkDetails:null},"Fragment does not have a "+(w?"part list":"url")));this.abort();var D=this.config,O=D.fLoader,A=D.loader;return new Promise(function(C,T){E.loader&&E.loader.destroy();var f=E.loader=a.loader=O?new O(D):new A(D),S=h(a),y={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};a.stats=f.stats,f.load(S,y,{onSuccess:function(U,F,_,M){E.resetLoader(a,f),C({frag:a,part:null,payload:U.data,networkDetails:M})},onError:function(U,F,_){E.resetLoader(a,f),T(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,response:U,networkDetails:_}))},onAbort:function(U,F,_){E.resetLoader(a,f),T(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,networkDetails:_}))},onTimeout:function(U,F,_){E.resetLoader(a,f),T(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,networkDetails:_}))},onProgress:function(U,F,_,M){R&&R({frag:a,part:null,payload:_,networkDetails:M})}})})},l.loadPart=function(a,R,E){var w=this;this.abort();var D=this.config,O=D.fLoader,A=D.loader;return new Promise(function(C,T){w.loader&&w.loader.destroy();var f=w.loader=a.loader=O?new O(D):new A(D),S=h(a,R),y={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};R.stats=f.stats,f.load(S,y,{onSuccess:function(U,F,_,M){w.resetLoader(a,f),w.updateStatsFromPart(a,R);var I={frag:a,part:R,payload:U.data,networkDetails:M};E(I),C(I)},onError:function(U,F,_){w.resetLoader(a,f),T(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,part:R,response:U,networkDetails:_}))},onAbort:function(U,F,_){a.stats.aborted=R.stats.aborted,w.resetLoader(a,f),T(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,part:R,networkDetails:_}))},onTimeout:function(U,F,_){w.resetLoader(a,f),T(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,part:R,networkDetails:_}))}})})},l.updateStatsFromPart=function(a,R){var E=a.stats,w=R.stats,D=w.total;if(E.loaded+=w.loaded,D){var O=Math.round(a.duration/R.duration),A=Math.min(Math.round(E.loaded/D),O),C=O-A,T=C*Math.round(E.loaded/A);E.total=E.loaded+T}else E.total=Math.max(E.loaded,E.total);var f=E.loading,S=w.loading;f.start?f.first+=S.first-S.start:(f.start=S.start,f.first=S.first),f.end=S.end},l.resetLoader=function(a,R){a.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},o}();function h(o,l){l===void 0&&(l=null);var s=l||o,a={frag:o,part:l,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},R=s.byteRangeStartOffset,E=s.byteRangeEndOffset;return Object(X.isFiniteNumber)(R)&&Object(X.isFiniteNumber)(E)&&(a.rangeStart=R,a.rangeEnd=E),a}var d=function(o){B(l,o);function l(s){for(var a,R=arguments.length,E=new Array(R>1?R-1:0),w=1;w<R;w++)E[w-1]=arguments[w];return a=o.call.apply(o,[this].concat(E))||this,a.data=void 0,a.data=s,a}return l}(K(Error))},"./src/loader/fragment.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"ElementaryStreamTypes",function(){return u}),P.d(J,"BaseSegment",function(){return h}),P.d(J,"Fragment",function(){return d}),P.d(J,"Part",function(){return o});var X=P("./src/polyfills/number.ts"),j=P("./node_modules/url-toolkit/src/url-toolkit.js"),B=P.n(j),K=P("./src/utils/logger.ts"),H=P("./src/loader/level-key.ts"),r=P("./src/loader/load-stats.ts");function L(l,s){l.prototype=Object.create(s.prototype),l.prototype.constructor=l,v(l,s)}function v(l,s){return v=Object.setPrototypeOf||function(R,E){return R.__proto__=E,R},v(l,s)}function m(l,s){for(var a=0;a<s.length;a++){var R=s[a];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(l,R.key,R)}}function p(l,s,a){return s&&m(l.prototype,s),a&&m(l,a),l}var u;(function(l){l.AUDIO="audio",l.VIDEO="video",l.AUDIOVIDEO="audiovideo"})(u||(u={}));var h=function(){function l(a){var R;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(R={},R[u.AUDIO]=null,R[u.VIDEO]=null,R[u.AUDIOVIDEO]=null,R),this.baseurl=a}var s=l.prototype;return s.setByteRange=function(R,E){var w=R.split("@",2),D=[];w.length===1?D[0]=E?E.byteRangeEndOffset:0:D[0]=parseInt(w[1]),D[1]=parseInt(w[0])+D[0],this._byteRange=D},p(l,[{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(j.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(R){this._url=R}}]),l}(),d=function(l){L(s,l);function s(R,E){var w;return w=l.call(this,E)||this,w._decryptdata=null,w.rawProgramDateTime=null,w.programDateTime=null,w.tagList=[],w.duration=0,w.sn=0,w.levelkey=void 0,w.type=void 0,w.loader=null,w.level=-1,w.cc=0,w.startPTS=void 0,w.endPTS=void 0,w.appendedPTS=void 0,w.startDTS=void 0,w.endDTS=void 0,w.start=0,w.deltaPTS=void 0,w.maxStartPTS=void 0,w.minEndPTS=void 0,w.stats=new r.LoadStats,w.urlId=0,w.data=void 0,w.bitrateTest=!1,w.title=null,w.initSegment=null,w.type=R,w}var a=s.prototype;return a.createInitializationVector=function(E){for(var w=new Uint8Array(16),D=12;D<16;D++)w[D]=E>>8*(15-D)&255;return w},a.setDecryptDataFromLevelKey=function(E,w){var D=E;return(E==null?void 0:E.method)==="AES-128"&&E.uri&&!E.iv&&(D=H.LevelKey.fromURI(E.uri),D.method=E.method,D.iv=this.createInitializationVector(w),D.keyFormat="identity"),D},a.setElementaryStreamInfo=function(E,w,D,O,A,C){C===void 0&&(C=!1);var T=this.elementaryStreams,f=T[E];if(!f){T[E]={startPTS:w,endPTS:D,startDTS:O,endDTS:A,partial:C};return}f.startPTS=Math.min(f.startPTS,w),f.endPTS=Math.max(f.endPTS,D),f.startDTS=Math.min(f.startDTS,O),f.endDTS=Math.max(f.endDTS,A)},a.clearElementaryStreamInfo=function(){var E=this.elementaryStreams;E[u.AUDIO]=null,E[u.VIDEO]=null,E[u.AUDIOVIDEO]=null},p(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var E=this.sn;typeof E!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),E=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,E)}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 E=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+E*1e3}},{key:"encrypted",get:function(){var E;return!!((E=this.decryptdata)!==null&&E!==void 0&&E.keyFormat&&this.decryptdata.uri)}}]),s}(h),o=function(l){L(s,l);function s(a,R,E,w,D){var O;O=l.call(this,E)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new r.LoadStats,O.duration=a.decimalFloatingPoint("DURATION"),O.gap=a.bool("GAP"),O.independent=a.bool("INDEPENDENT"),O.relurl=a.enumeratedString("URI"),O.fragment=R,O.index=w;var A=a.enumeratedString("BYTERANGE");return A&&O.setByteRange(A,D),D&&(O.fragOffset=D.fragOffset+D.duration),O}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 R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),s}(h)},"./src/loader/key-loader.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return K});var X=P("./src/events.ts"),j=P("./src/errors.ts"),B=P("./src/utils/logger.ts"),K=function(){function H(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,this._registerListeners()}var r=H.prototype;return r._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var m=this.loaders[v];m&&m.destroy()}this.loaders={}},r.onKeyLoading=function(v,m){var p=m.frag,u=p.type,h=this.loaders[u];if(!p.decryptdata){B.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var d=p.decryptdata.uri;if(d!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(h&&(B.logger.warn("abort previous key loader for type:"+u),h.abort()),!d){B.logger.warn("key uri is falsy");return}var l=o.loader,s=p.loader=this.loaders[u]=new l(o);this.decrypturl=d,this.decryptkey=null;var a={url:d,frag:p,responseType:"arraybuffer"},R={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(a,R,E)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:p}))},r.loadsuccess=function(v,m,p){var u=p.frag;if(!u.decryptdata){B.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(v.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:u})},r.loaderror=function(v,m){var p=m.frag,u=p.loader;u&&u.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:v})},r.loadtimeout=function(v,m){var p=m.frag,u=p.loader;u&&u.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},H}()},"./src/loader/level-details.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"LevelDetails",function(){return H});var X=P("./src/polyfills/number.ts");function j(r,L){for(var v=0;v<L.length;v++){var m=L[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(r,m.key,m)}}function B(r,L,v){return L&&j(r.prototype,L),v&&j(r,v),r}var K=10,H=function(){function r(v){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=v}var L=r.prototype;return L.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-m.lastPartSn,u=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!u||!!p,this.advanced=this.endSN>m.endSN||p>0||p===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},B(r,[{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||K}},{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}}]),r}()},"./src/loader/level-key.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"LevelKey",function(){return H});var X=P("./node_modules/url-toolkit/src/url-toolkit.js"),j=P.n(X);function B(r,L){for(var v=0;v<L.length;v++){var m=L[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(r,m.key,m)}}function K(r,L,v){return L&&B(r.prototype,L),v&&B(r,v),r}var H=function(){r.fromURL=function(v,m){return new r(v,m)},r.fromURI=function(v){return new r(v)};function r(L,v){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,v?this._uri=Object(X.buildAbsoluteURL)(L,v,{alwaysNormalize:!0}):this._uri=L}return K(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"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,J,P){"use strict";P.r(J),P.d(J,"default",function(){return s});var X=P("./src/polyfills/number.ts"),j=P("./node_modules/url-toolkit/src/url-toolkit.js"),B=P.n(j),K=P("./src/loader/fragment.ts"),H=P("./src/loader/level-details.ts"),r=P("./src/loader/level-key.ts"),L=P("./src/utils/attr-list.ts"),v=P("./src/utils/logger.ts"),m=P("./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,u=/#EXT-X-MEDIA:(.*)/g,h=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),d=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 l(D){var O,A;return o.test((O=(A=j.parseURL(D))===null||A===void 0?void 0:A.path)!=null?O:"")}var s=function(){function D(){}return D.findGroup=function(A,C){for(var T=0;T<A.length;T++){var f=A[T];if(f.id===C)return f}},D.convertAVC1ToAVCOTI=function(A){var C=A.split(".");if(C.length>2){var T=C.shift()+".";return T+=parseInt(C.shift()).toString(16),T+=("000"+parseInt(C.shift()).toString(16)).substr(-4),T}return A},D.resolve=function(A,C){return j.buildAbsoluteURL(C,A,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(A,C){var T=[],f={},S=!1;p.lastIndex=0;for(var y;(y=p.exec(A))!=null;)if(y[1]){var b=new L.AttrList(y[1]),U={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:D.resolve(y[2],C)},F=b.decimalResolution("RESOLUTION");F&&(U.width=F.width,U.height=F.height),a((b.CODECS||"").split(/[ ,]+/).filter(function(M){return M}),U),U.videoCodec&&U.videoCodec.indexOf("avc1")!==-1&&(U.videoCodec=D.convertAVC1ToAVCOTI(U.videoCodec)),T.push(U)}else if(y[3]){var _=new L.AttrList(y[3]);_["DATA-ID"]&&(S=!0,f[_["DATA-ID"]]=_)}return{levels:T,sessionData:S?f:null}},D.parseMasterPlaylistMedia=function(A,C,T,f){f===void 0&&(f=[]);var S,y=[],b=0;for(u.lastIndex=0;(S=u.exec(A))!==null;){var U=new L.AttrList(S[1]);if(U.TYPE===T){var F={attrs:U,bitrate:0,id:b++,groupId:U["GROUP-ID"],instreamId:U["INSTREAM-ID"],name:U.NAME||U.LANGUAGE||"",type:T,default:U.bool("DEFAULT"),autoselect:U.bool("AUTOSELECT"),forced:U.bool("FORCED"),lang:U.LANGUAGE,url:U.URI?D.resolve(U.URI,C):""};if(f.length){var _=D.findGroup(f,F.groupId)||f[0];R(F,_,"audioCodec"),R(F,_,"textCodec")}y.push(F)}}return y},D.parseLevelPlaylist=function(A,C,T,f,S){var y=new H.LevelDetails(C),b=y.fragments,U=null,F=0,_=0,M=0,I=0,g=null,W=new K.Fragment(f,C),$,ne,oe,we=-1,ge=!1;for(h.lastIndex=0,y.m3u8=A;($=h.exec(A))!==null;){ge&&(ge=!1,W=new K.Fragment(f,C),W.start=M,W.sn=F,W.cc=I,W.level=T,U&&(W.initSegment=U,W.rawProgramDateTime=U.rawProgramDateTime));var xe=$[1];if(xe){W.duration=parseFloat(xe);var Re=(" "+$[2]).slice(1);W.title=Re||null,W.tagList.push(Re?["INF",xe,Re]:["INF",xe])}else if($[3])Object(X.isFiniteNumber)(W.duration)&&(W.start=M,oe&&(W.levelkey=oe),W.sn=F,W.level=T,W.cc=I,W.urlId=S,b.push(W),W.relurl=(" "+$[3]).slice(1),w(W,g),g=W,M+=W.duration,F++,_=0,ge=!0);else if($[4]){var Le=(" "+$[4]).slice(1);g?W.setByteRange(Le,g):W.setByteRange(Le)}else if($[5])W.rawProgramDateTime=(" "+$[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),we===-1&&(we=b.length);else{if($=$[0].match(d),!$){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(ne=1;ne<$.length&&!(typeof $[ne]!="undefined");ne++);var ce=(" "+$[ne]).slice(1),he=(" "+$[ne+1]).slice(1),re=$[ne+2]?(" "+$[ne+2]).slice(1):"";switch(ce){case"PLAYLIST-TYPE":y.type=he.toUpperCase();break;case"MEDIA-SEQUENCE":F=y.startSN=parseInt(he);break;case"SKIP":{var de=new L.AttrList(he),se=de.decimalInteger("SKIPPED-SEGMENTS");if(Object(X.isFiniteNumber)(se)){y.skippedSegments=se;for(var De=se;De--;)b.unshift(null);F+=se}var Ne=de.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ne&&(y.recentlyRemovedDateranges=Ne.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(he);break;case"VERSION":y.version=parseInt(he);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(he||re)&&W.tagList.push(re?[he,re]:[he]);break;case"DIS":I++;case"GAP":W.tagList.push([ce]);break;case"BITRATE":W.tagList.push([ce,he]);break;case"DISCONTINUITY-SEQ":I=parseInt(he);break;case"KEY":{var Se,Pe=new L.AttrList(he),Ue=Pe.enumeratedString("METHOD"),le=Pe.URI,ve=Pe.hexadecimalInteger("IV"),Ae=Pe.enumeratedString("KEYFORMATVERSIONS"),Ie=Pe.enumeratedString("KEYID"),Ge=(Se=Pe.enumeratedString("KEYFORMAT"))!=null?Se:"identity",$e=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if($e.indexOf(Ge)>-1){v.logger.warn("Keyformat "+Ge+" is not supported from the manifest");continue}else if(Ge!=="identity")continue;Ue&&(oe=r.LevelKey.fromURL(C,le),le&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ue)>=0&&(oe.method=Ue,oe.keyFormat=Ge,Ie&&(oe.keyID=Ie),Ae&&(oe.keyFormatVersions=Ae),oe.iv=ve));break}case"START":{var Ze=new L.AttrList(he),Je=Ze.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(Je)&&(y.startTimeOffset=Je);break}case"MAP":{var at=new L.AttrList(he);W.relurl=at.URI,at.BYTERANGE&&W.setByteRange(at.BYTERANGE),W.level=T,W.sn="initSegment",oe&&(W.levelkey=oe),W.initSegment=null,U=W,ge=!0;break}case"SERVER-CONTROL":{var qe=new L.AttrList(he);y.canBlockReload=qe.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=qe.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&qe.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=qe.optionalFloat("PART-HOLD-BACK",0),y.holdBack=qe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var it=new L.AttrList(he);y.partTarget=it.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Be=y.partList;Be||(Be=y.partList=[]);var ct=_>0?Be[Be.length-1]:void 0,ot=_++,je=new K.Part(new L.AttrList(he),W,C,ot,ct);Be.push(je),W.duration+=je.duration;break}case"PRELOAD-HINT":{var We=new L.AttrList(he);y.preloadHint=We;break}case"RENDITION-REPORT":{var Oe=new L.AttrList(he);y.renditionReports=y.renditionReports||[],y.renditionReports.push(Oe);break}default:v.logger.warn("line parsed but not handled: "+$);break}}}g&&!g.relurl?(b.pop(),M-=g.duration,y.partList&&(y.fragmentHint=g)):y.partList&&(w(W,g),W.cc=I,y.fragmentHint=W);var _e=b.length,Te=b[0],ae=b[_e-1];if(M+=y.skippedSegments*y.targetduration,M>0&&_e&&ae){y.averagetargetduration=M/_e;var ue=ae.sn;y.endSN=ue!=="initSegment"?ue:0,Te&&(y.startCC=Te.cc,Te.initSegment||y.fragments.every(function(fe){return fe.relurl&&l(fe.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new K.Fragment(f,C),W.relurl=ae.relurl,W.level=T,W.sn="initSegment",Te.initSegment=W,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(M+=y.fragmentHint.duration),y.totalduration=M,y.endCC=I,we>0&&E(b,we),y},D}();function a(D,O){["video","audio","text"].forEach(function(A){var C=D.filter(function(f){return Object(m.isCodecType)(f,A)});if(C.length){var T=C.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});O[A+"Codec"]=T.length>0?T[0]:C[0],D=D.filter(function(f){return C.indexOf(f)===-1})}}),O.unknownCodecs=D}function R(D,O,A){var C=O[A];C&&(D[A]=C)}function E(D,O){for(var A=D[O],C=O;C--;){var T=D[C];if(!T)return;T.programDateTime=A.programDateTime-T.duration*1e3,A=T}}function w(D,O){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):O!=null&&O.programDateTime&&(D.programDateTime=O.endProgramDateTime),Object(X.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),B=P("./src/errors.ts"),K=P("./src/utils/logger.ts"),H=P("./src/utils/mp4-tools.ts"),r=P("./src/loader/m3u8-parser.ts"),L=P("./src/types/loader.ts"),v=P("./src/utils/attr-list.ts");function m(h){var d=h.type;switch(d){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function p(h,d){var o=h.url;return(o===void 0||o.indexOf("data:")===0)&&(o=d.url),o}var u=function(){function h(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var d=h.prototype;return d.registerListeners=function(){var l=this.hls;l.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),l.on(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.unregisterListeners=function(){var l=this.hls;l.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),l.off(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.createInternalLoader=function(l){var s=this.hls.config,a=s.pLoader,R=s.loader,E=a||R,w=new E(s);return l.loader=w,this.loaders[l.type]=w,w},d.getInternalLoader=function(l){return this.loaders[l.type]},d.resetInternalLoader=function(l){this.loaders[l]&&delete this.loaders[l]},d.destroyInternalLoaders=function(){for(var l in this.loaders){var s=this.loaders[l];s&&s.destroy(),this.resetInternalLoader(l)}},d.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},d.onManifestLoading=function(l,s){var a=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:a,deliveryDirectives:null})},d.onLevelLoading=function(l,s){var a=s.id,R=s.level,E=s.url,w=s.deliveryDirectives;this.load({id:a,groupId:null,level:R,responseType:"text",type:L.PlaylistContextType.LEVEL,url:E,deliveryDirectives:w})},d.onAudioTrackLoading=function(l,s){var a=s.id,R=s.groupId,E=s.url,w=s.deliveryDirectives;this.load({id:a,groupId:R,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:E,deliveryDirectives:w})},d.onSubtitleTrackLoading=function(l,s){var a=s.id,R=s.groupId,E=s.url,w=s.deliveryDirectives;this.load({id:a,groupId:R,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:E,deliveryDirectives:w})},d.load=function(l){var s,a=this.hls.config,R=this.getInternalLoader(l);if(R){var E=R.context;if(E&&E.url===l.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+l.type),R.abort()}var w,D,O,A;switch(l.type){case L.PlaylistContextType.MANIFEST:w=a.manifestLoadingMaxRetry,D=a.manifestLoadingTimeOut,O=a.manifestLoadingRetryDelay,A=a.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:w=0,D=a.levelLoadingTimeOut;break;default:w=a.levelLoadingMaxRetry,D=a.levelLoadingTimeOut,O=a.levelLoadingRetryDelay,A=a.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(l),(s=l.deliveryDirectives)!==null&&s!==void 0&&s.part){var C;if(l.type===L.PlaylistContextType.LEVEL&&l.level!==null?C=this.hls.levels[l.level].details:l.type===L.PlaylistContextType.AUDIO_TRACK&&l.id!==null?C=this.hls.audioTracks[l.id].details:l.type===L.PlaylistContextType.SUBTITLE_TRACK&&l.id!==null&&(C=this.hls.subtitleTracks[l.id].details),C){var T=C.partTarget,f=C.targetduration;T&&f&&(D=Math.min(Math.max(T*3,f*.8)*1e3,D))}}var S={timeout:D,maxRetry:w,retryDelay:O,maxRetryDelay:A,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(l,S,y)},d.loadsuccess=function(l,s,a,R){if(R===void 0&&(R=null),a.isSidxRequest){this.handleSidxRequest(l,a),this.handlePlaylistLoaded(l,s,a,R);return}this.resetInternalLoader(a.type);var E=l.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,a,"no EXTM3U delimiter",R);return}s.parsing.start=performance.now(),E.indexOf("#EXTINF:")>0||E.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(l,s,a,R):this.handleMasterPlaylist(l,s,a,R)},d.loaderror=function(l,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!1,l)},d.loadtimeout=function(l,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!0)},d.handleMasterPlaylist=function(l,s,a,R){var E=this.hls,w=l.data,D=p(l,a),O=r.default.parseMasterPlaylist(w,D),A=O.levels,C=O.sessionData;if(!A.length){this.handleManifestParsingError(l,a,"no level found in manifest",R);return}var T=A.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),f=A.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),S=r.default.parseMasterPlaylistMedia(w,D,"AUDIO",T),y=r.default.parseMasterPlaylistMedia(w,D,"SUBTITLES",f),b=r.default.parseMasterPlaylistMedia(w,D,"CLOSED-CAPTIONS");if(S.length){var U=S.some(function(F){return!F.url});!U&&A[0].audioCodec&&!A[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),S.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}E.trigger(j.Events.MANIFEST_LOADED,{levels:A,audioTracks:S,subtitles:y,captions:b,url:D,stats:s,networkDetails:R,sessionData:C})},d.handleTrackOrLevelPlaylist=function(l,s,a,R){var E=this.hls,w=a.id,D=a.level,O=a.type,A=p(l,a),C=Object(X.isFiniteNumber)(w)?w:0,T=Object(X.isFiniteNumber)(D)?D:C,f=m(a),S=r.default.parseLevelPlaylist(l.data,A,T,f,C);if(!S.fragments.length){E.trigger(j.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:A,reason:"no fragments found in level",level:typeof a.level=="number"?a.level:void 0});return}if(O===L.PlaylistContextType.MANIFEST){var y={attrs:new v.AttrList({}),bitrate:0,details:S,name:"",url:A};E.trigger(j.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:A,stats:s,networkDetails:R,sessionData:null})}if(s.parsing.end=performance.now(),S.needSidxRanges){var b,U=(b=S.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:U,isSidxRequest:!0,type:O,level:D,levelDetails:S,id:w,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}a.levelDetails=S,this.handlePlaylistLoaded(l,s,a,R)},d.handleSidxRequest=function(l,s){var a=Object(H.parseSegmentIndex)(new Uint8Array(l.data));if(!a)return;var R=a.references,E=s.levelDetails;R.forEach(function(w,D){var O=w.info,A=E.fragments[D];A.byteRange.length===0&&A.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),A.initSegment&&A.initSegment.setByteRange(String(a.moovEndOffset)+"@0")})},d.handleManifestParsingError=function(l,s,a,R){this.hls.trigger(j.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===L.PlaylistContextType.MANIFEST,url:l.url,reason:a,response:l,context:s,networkDetails:R})},d.handleNetworkError=function(l,s,a,R){a===void 0&&(a=!1),K.logger.warn("[playlist-loader]: A network "+(a?"timeout":"error")+" occurred while loading "+l.type+" level: "+l.level+" id: "+l.id+' group-id: "'+l.groupId+'"');var E=B.ErrorDetails.UNKNOWN,w=!1,D=this.getInternalLoader(l);switch(l.type){case L.PlaylistContextType.MANIFEST:E=a?B.ErrorDetails.MANIFEST_LOAD_TIMEOUT:B.ErrorDetails.MANIFEST_LOAD_ERROR,w=!0;break;case L.PlaylistContextType.LEVEL:E=a?B.ErrorDetails.LEVEL_LOAD_TIMEOUT:B.ErrorDetails.LEVEL_LOAD_ERROR,w=!1;break;case L.PlaylistContextType.AUDIO_TRACK:E=a?B.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,w=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:E=a?B.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:B.ErrorDetails.SUBTITLE_LOAD_ERROR,w=!1;break}D&&this.resetInternalLoader(l.type);var O={type:B.ErrorTypes.NETWORK_ERROR,details:E,fatal:w,url:l.url,loader:D,context:l,networkDetails:s};R&&(O.response=R),this.hls.trigger(j.Events.ERROR,O)},d.handlePlaylistLoaded=function(l,s,a,R){var E=a.type,w=a.level,D=a.id,O=a.groupId,A=a.loader,C=a.levelDetails,T=a.deliveryDirectives;if(!(C!=null&&C.targetduration)){this.handleManifestParsingError(l,a,"invalid target duration",R);return}if(!A)return;C.live&&(A.getCacheAge&&(C.ageHeader=A.getCacheAge()||0),(!A.getCacheAge||isNaN(C.ageHeader))&&(C.ageHeader=0));switch(E){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(j.Events.LEVEL_LOADED,{details:C,level:w||0,id:D||0,stats:s,networkDetails:R,deliveryDirectives:T});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(j.Events.AUDIO_TRACK_LOADED,{details:C,id:D||0,groupId:O||"",stats:s,networkDetails:R,deliveryDirectives:T});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(j.Events.SUBTITLE_TRACK_LOADED,{details:C,id:D||0,groupId:O||"",stats:s,networkDetails:R,deliveryDirectives:T});break}},h}();J.default=u},"./src/polyfills/number.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"isFiniteNumber",function(){return X}),P.d(J,"MAX_SAFE_INTEGER",function(){return j});var X=Number.isFinite||function(B){return typeof B=="number"&&isFinite(B)},j=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ie,J,P){"use strict";P.r(J);var X=function(){function j(){}return j.getSilentFrame=function(K,H){switch(K){case"mp4a.40.2":if(H===1)return new Uint8Array([0,200,0,128,35,128]);if(H===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(H===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(H===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(H===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(H===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(H===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(H===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(H===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},j}();J.default=X},"./src/remux/mp4-generator.ts":function(ie,J,P){"use strict";P.r(J);var X=Math.pow(2,32)-1,j=function(){function B(){}return B.init=function(){B.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 H;for(H in B.types)B.types.hasOwnProperty(H)&&(B.types[H]=[H.charCodeAt(0),H.charCodeAt(1),H.charCodeAt(2),H.charCodeAt(3)]);var r=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]),L=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]);B.HDLR_TYPES={video:r,audio:L};var v=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]);B.STTS=B.STSC=B.STCO=m,B.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),B.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),B.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),B.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),h=new Uint8Array([0,0,0,1]);B.FTYP=B.box(B.types.ftyp,p,h,p,u),B.DINF=B.box(B.types.dinf,B.box(B.types.dref,v))},B.box=function(H){for(var r=8,L=arguments.length,v=new Array(L>1?L-1:0),m=1;m<L;m++)v[m-1]=arguments[m];for(var p=v.length,u=p;p--;)r+=v[p].byteLength;var h=new Uint8Array(r);for(h[0]=r>>24&255,h[1]=r>>16&255,h[2]=r>>8&255,h[3]=r&255,h.set(H,4),p=0,r=8;p<u;p++)h.set(v[p],r),r+=v[p].byteLength;return h},B.hdlr=function(H){return B.box(B.types.hdlr,B.HDLR_TYPES[H])},B.mdat=function(H){return B.box(B.types.mdat,H)},B.mdhd=function(H,r){r*=H;var L=Math.floor(r/(X+1)),v=Math.floor(r%(X+1));return B.box(B.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,H>>24&255,H>>16&255,H>>8&255,H&255,L>>24,L>>16&255,L>>8&255,L&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},B.mdia=function(H){return B.box(B.types.mdia,B.mdhd(H.timescale,H.duration),B.hdlr(H.type),B.minf(H))},B.mfhd=function(H){return B.box(B.types.mfhd,new Uint8Array([0,0,0,0,H>>24,H>>16&255,H>>8&255,H&255]))},B.minf=function(H){return H.type==="audio"?B.box(B.types.minf,B.box(B.types.smhd,B.SMHD),B.DINF,B.stbl(H)):B.box(B.types.minf,B.box(B.types.vmhd,B.VMHD),B.DINF,B.stbl(H))},B.moof=function(H,r,L){return B.box(B.types.moof,B.mfhd(H),B.traf(L,r))},B.moov=function(H){for(var r=H.length,L=[];r--;)L[r]=B.trak(H[r]);return B.box.apply(null,[B.types.moov,B.mvhd(H[0].timescale,H[0].duration)].concat(L).concat(B.mvex(H)))},B.mvex=function(H){for(var r=H.length,L=[];r--;)L[r]=B.trex(H[r]);return B.box.apply(null,[B.types.mvex].concat(L))},B.mvhd=function(H,r){r*=H;var L=Math.floor(r/(X+1)),v=Math.floor(r%(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,H>>24&255,H>>16&255,H>>8&255,H&255,L>>24,L>>16&255,L>>8&255,L&255,v>>24,v>>16&255,v>>8&255,v&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return B.box(B.types.mvhd,m)},B.sdtp=function(H){var r=H.samples||[],L=new Uint8Array(4+r.length),v,m;for(v=0;v<r.length;v++)m=r[v].flags,L[v+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return B.box(B.types.sdtp,L)},B.stbl=function(H){return B.box(B.types.stbl,B.stsd(H),B.box(B.types.stts,B.STTS),B.box(B.types.stsc,B.STSC),B.box(B.types.stsz,B.STSZ),B.box(B.types.stco,B.STCO))},B.avc1=function(H){var r=[],L=[],v,m,p;for(v=0;v<H.sps.length;v++)m=H.sps[v],p=m.byteLength,r.push(p>>>8&255),r.push(p&255),r=r.concat(Array.prototype.slice.call(m));for(v=0;v<H.pps.length;v++)m=H.pps[v],p=m.byteLength,L.push(p>>>8&255),L.push(p&255),L=L.concat(Array.prototype.slice.call(m));var u=B.box(B.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|H.sps.length].concat(r).concat([H.pps.length]).concat(L))),h=H.width,d=H.height,o=H.pixelRatio[0],l=H.pixelRatio[1];return B.box(B.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,h>>8&255,h&255,d>>8&255,d&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u,B.box(B.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),B.box(B.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,l>>24,l>>16&255,l>>8&255,l&255])))},B.esds=function(H){var r=H.config.length;return new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(H.config).concat([6,1,2]))},B.mp4a=function(H){var r=H.samplerate;return B.box(B.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,H.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),B.box(B.types.esds,B.esds(H)))},B.mp3=function(H){var r=H.samplerate;return B.box(B.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,H.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},B.stsd=function(H){return H.type==="audio"?!H.isAAC&&H.codec==="mp3"?B.box(B.types.stsd,B.STSD,B.mp3(H)):B.box(B.types.stsd,B.STSD,B.mp4a(H)):B.box(B.types.stsd,B.STSD,B.avc1(H))},B.tkhd=function(H){var r=H.id,L=H.duration*H.timescale,v=H.width,m=H.height,p=Math.floor(L/(X+1)),u=Math.floor(L%(X+1));return B.box(B.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,u>>24,u>>16&255,u>>8&255,u&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,v>>8&255,v&255,0,0,m>>8&255,m&255,0,0]))},B.traf=function(H,r){var L=B.sdtp(H),v=H.id,m=Math.floor(r/(X+1)),p=Math.floor(r%(X+1));return B.box(B.types.traf,B.box(B.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),B.box(B.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])),B.trun(H,L.length+16+20+8+16+8+8),L)},B.trak=function(H){return H.duration=H.duration||4294967295,B.box(B.types.trak,B.tkhd(H),B.mdia(H))},B.trex=function(H){var r=H.id;return B.box(B.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},B.trun=function(H,r){var L=H.samples||[],v=L.length,m=12+16*v,p=new Uint8Array(m),u,h,d,o,l,s;for(r+=8+m,p.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),u=0;u<v;u++)h=L[u],d=h.duration,o=h.size,l=h.flags,s=h.cts,p.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,l.isLeading<<2|l.dependsOn,l.isDependedOn<<6|l.hasRedundancy<<4|l.paddingValue<<1|l.isNonSync,l.degradPrio&240<<8,l.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*u);return B.box(B.types.trun,p)},B.initSegment=function(H){B.types||B.init();var r=B.moov(H),L=new Uint8Array(B.FTYP.byteLength+r.byteLength);return L.set(B.FTYP),L.set(r,B.FTYP.byteLength),L},B}();j.types=void 0,j.HDLR_TYPES=void 0,j.STTS=void 0,j.STSC=void 0,j.STCO=void 0,j.STSZ=void 0,j.VMHD=void 0,j.SMHD=void 0,j.STSD=void 0,j.FTYP=void 0,j.DINF=void 0,J.default=j},"./src/remux/mp4-remuxer.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return s}),P.d(J,"normalizePts",function(){return a});var X=P("./src/polyfills/number.ts"),j=P("./src/remux/aac-helper.ts"),B=P("./src/remux/mp4-generator.ts"),K=P("./src/events.ts"),H=P("./src/errors.ts"),r=P("./src/utils/logger.ts"),L=P("./src/types/loader.ts"),v=P("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(D){for(var O=1;O<arguments.length;O++){var A=arguments[O];for(var C in A)Object.prototype.hasOwnProperty.call(A,C)&&(D[C]=A[C])}return D},m.apply(this,arguments)}var p=10*1e3,u=1024,h=1152,d=null,o=null,l=!1,s=function(){function D(A,C,T,f){if(f===void 0&&(f=""),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=A,this.config=C,this.typeSupported=T,this.ISGenerated=!1,d===null){var S=navigator.userAgent||"",y=S.match(/Chrome\/(\d+)/i);d=y?parseInt(y[1]):0}if(o===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);o=b?parseInt(b[1]):0}l=!!d&&d<75||!!o&&o<600}var O=D.prototype;return O.destroy=function(){},O.resetTimeStamp=function(C){r.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=C},O.resetNextTimestamp=function(){r.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){r.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(C){var T=!1,f=C.reduce(function(S,y){var b=y.pts-S;return b<-4294967296?(T=!0,a(S,y.pts)):b>0?S:y.pts},C[0].pts);return T&&r.logger.debug("PTS rollover detected"),f},O.remux=function(C,T,f,S,y,b,U,F){var _,M,I,g,W,$,ne=y,oe=y,we=C.pid>-1,ge=T.pid>-1,xe=T.samples.length,Re=C.samples.length>0,Le=xe>1,ce=(!we||Re)&&(!ge||Le)||this.ISGenerated||U;if(ce){this.ISGenerated||(I=this.generateIS(C,T,y));var he=this.isVideoContiguous,re=-1;if(Le&&(re=R(T.samples),!he&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,re>0){r.logger.warn("[mp4-remuxer]: Dropped "+re+" out of "+xe+" video samples due to a missing keyframe");var de=this.getVideoStartPts(T.samples);T.samples=T.samples.slice(re),T.dropped+=re,oe+=(T.samples[0].pts-de)/(T.timescale||9e4)}else re===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+xe+" video samples"),$=!1);if(this.ISGenerated){if(Re&&Le){var se=this.getVideoStartPts(T.samples),De=a(C.samples[0].pts,se)-se,Ne=De/T.inputTimeScale;ne+=Math.max(0,Ne),oe+=Math.max(0,-Ne)}if(Re){if(C.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),I=this.generateIS(C,T,y)),M=this.remuxAudio(C,ne,this.isAudioContiguous,b,ge||Le||F===L.PlaylistLevelType.AUDIO?oe:void 0),Le){var Se=M?M.endPTS-M.startPTS:0;T.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),I=this.generateIS(C,T,y)),_=this.remuxVideo(T,oe,he,Se)}}else Le&&(_=this.remuxVideo(T,oe,he,0));_&&(_.firstKeyFrame=re,_.independent=re!==-1)}}return this.ISGenerated&&(f.samples.length&&(W=this.remuxID3(f,y)),S.samples.length&&(g=this.remuxText(S,y))),{audio:M,video:_,initSegment:I,independent:$,text:g,id3:W}},O.generateIS=function(C,T,f){var S=C.samples,y=T.samples,b=this.typeSupported,U={},F=!Object(X.isFiniteNumber)(this._initPTS),_="audio/mp4",M,I,g;if(F&&(M=I=Infinity),C.config&&S.length&&(C.timescale=C.samplerate,C.isAAC||(b.mpeg?(_="audio/mpeg",C.codec=""):b.mp3&&(C.codec="mp3")),U.audio={id:"audio",container:_,codec:C.codec,initSegment:!C.isAAC&&b.mpeg?new Uint8Array(0):B.default.initSegment([C]),metadata:{channelCount:C.channelCount}},F&&(g=C.inputTimeScale,M=I=S[0].pts-Math.round(g*f))),T.sps&&T.pps&&y.length&&(T.timescale=T.inputTimeScale,U.video={id:"main",container:"video/mp4",codec:T.codec,initSegment:B.default.initSegment([T]),metadata:{width:T.width,height:T.height}},F)){g=T.inputTimeScale;var W=this.getVideoStartPts(y),$=Math.round(g*f);I=Math.min(I,a(y[0].dts,W)-$),M=Math.min(M,W-$)}if(Object.keys(U).length)return this.ISGenerated=!0,F&&(this._initPTS=M,this._initDTS=I),{tracks:U,initPTS:M,timescale:g}},O.remuxVideo=function(C,T,f,S){var y=C.inputTimeScale,b=C.samples,U=[],F=b.length,_=this._initPTS,M=this.nextAvcDts,I=8,g,W,$,ne=Number.POSITIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,we=0,ge=!1;if(!f||M===null){var xe=T*y,Re=b[0].pts-a(b[0].dts,b[0].pts);M=xe-Re}for(var Le=0;Le<F;Le++){var ce=b[Le];if(ce.pts=a(ce.pts-_,M),ce.dts=a(ce.dts-_,M),ce.dts>ce.pts){var he=9e4*.2;we=Math.max(Math.min(we,ce.pts-ce.dts),-1*he)}ce.dts<b[Le>0?Le-1:Le].dts&&(ge=!0)}ge&&b.sort(function(wt,St){var ht=wt.dts-St.dts,Ut=wt.pts-St.pts;return ht||Ut}),W=b[0].dts,$=b[b.length-1].dts;var re=Math.round(($-W)/(F-1));if(we<0){if(we<re*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-re,!0)+" ms");for(var de=we,se=0;se<F;se++)b[se].dts=de=Math.max(de,b[se].pts-re),b[se].pts=Math.max(de,b[se].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(we,!0)+" ms to overcome this issue");for(var De=0;De<F;De++)b[De].dts=b[De].dts+we}W=b[0].dts}if(f){var Ne=W-M,Se=Ne>re,Pe=Ne<-1;if(Se||Pe){Se?r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(Ne,!0)+" ms ("+Ne+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-Ne,!0)+" ms ("+Ne+"dts) overlapping between fragments detected"),W=M;var Ue=b[0].pts-Ne;b[0].dts=W,b[0].pts=Ue,r.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(Ue,!0)+"/"+Object(v.toMsFromMpegTsClock)(W,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(Ne,!0)+" ms")}}l&&(W=Math.max(0,W));for(var le=0,ve=0,Ae=0;Ae<F;Ae++){for(var Ie=b[Ae],Ge=Ie.units,$e=Ge.length,Ze=0,Je=0;Je<$e;Je++)Ze+=Ge[Je].data.length;ve+=Ze,le+=$e,Ie.length=Ze,Ie.dts=Math.max(Ie.dts,W),Ie.pts=Math.max(Ie.pts,Ie.dts,0),ne=Math.min(Ie.pts,ne),oe=Math.max(Ie.pts,oe)}$=b[F-1].dts;var at=ve+4*le+8,qe;try{qe=new Uint8Array(at)}catch(wt){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:at,reason:"fail allocating video mdat "+at});return}var it=new DataView(qe.buffer);it.setUint32(0,at),qe.set(B.default.types.mdat,4);for(var Be=0;Be<F;Be++){for(var ct=b[Be],ot=ct.units,je=0,We=0,Oe=ot.length;We<Oe;We++){var _e=ot[We],Te=_e.data,ae=_e.data.byteLength;it.setUint32(I,ae),I+=4,qe.set(Te,I),I+=ae,je+=4+ae}if(Be<F-1)g=b[Be+1].dts-ct.dts;else{var ue=this.config,fe=ct.dts-b[Be>0?Be-1:Be].dts;if(ue.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(ue.maxBufferHole*y),Ce=(S?ne+S*y:this.nextAudioPts)-ct.pts;Ce>me?(g=Ce-fe,g<0&&(g=fe),r.logger.log("[mp4-remuxer]: It is approximately "+Ce/90+" ms to the next segment; using duration "+g/90+" ms for the last video frame.")):g=fe}else g=fe}var Fe=Math.round(ct.pts-ct.dts);U.push(new E(ct.key,g,je,Fe))}if(U.length&&d&&d<70){var ze=U[0].flags;ze.dependsOn=2,ze.isNonSync=0}console.assert(g!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=M=$+g,this.isVideoContiguous=!0;var st=B.default.moof(C.sequenceNumber++,W,m({},C,{samples:U})),mt="video",ft={data1:st,data2:qe,startPTS:ne/y,endPTS:(oe+g)/y,startDTS:W/y,endDTS:M/y,type:mt,hasAudio:!1,hasVideo:!0,nb:U.length,dropped:C.dropped};return C.samples=[],C.dropped=0,console.assert(qe.length,"MDAT length must not be zero"),ft},O.remuxAudio=function(C,T,f,S,y){var b=C.inputTimeScale,U=C.samplerate?C.samplerate:b,F=b/U,_=C.isAAC?u:h,M=_*F,I=this._initPTS,g=!C.isAAC&&this.typeSupported.mpeg,W=[],$=C.samples,ne=g?0:8,oe=this.nextAudioPts||-1,we=T*b;if(this.isAudioContiguous=f=f||$.length&&oe>0&&(S&&Math.abs(we-oe)<9e3||Math.abs(a($[0].pts-I,we)-oe)<20*M),$.forEach(function(Te){Te.pts=a(Te.pts-I,we)}),!f||oe<0){if($=$.filter(function(Te){return Te.pts>=0}),!$.length)return;y===0?oe=0:S?oe=Math.max(0,we):oe=$[0].pts}if(C.isAAC)for(var ge=y!==void 0,xe=this.config.maxAudioFramesDrift,Re=0,Le=oe;Re<$.length;Re++){var ce=$[Re],he=ce.pts,re=he-Le,de=Math.abs(1e3*re/b);if(re<=-xe*M&&ge)Re===0&&(r.logger.warn("Audio frame @ "+(he/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*re/b)+" ms."),this.nextAudioPts=oe=Le=he);else if(re>=xe*M&&de<p&&ge){var se=Math.round(re/M);Le=he-se*M,Le<0&&(se--,Le+=M),Re===0&&(this.nextAudioPts=oe=Le),r.logger.warn("[mp4-remuxer]: Injecting "+se+" audio frame @ "+(Le/b).toFixed(3)+"s due to "+Math.round(1e3*re/b)+" ms gap.");for(var De=0;De<se;De++){var Ne=Math.max(Le,0),Se=j.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);Se||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Se=ce.unit.subarray()),$.splice(Re,0,{unit:Se,pts:Ne}),Le+=M,Re++}}ce.pts=Le,Le+=M}for(var Pe=null,Ue=null,le,ve=0,Ae=$.length;Ae--;)ve+=$[Ae].unit.byteLength;for(var Ie=0,Ge=$.length;Ie<Ge;Ie++){var $e=$[Ie],Ze=$e.unit,Je=$e.pts;if(Ue!==null){var at=W[Ie-1];at.duration=Math.round((Je-Ue)/F)}else if(f&&C.isAAC&&(Je=oe),Pe=Je,ve>0){ve+=ne;try{le=new Uint8Array(ve)}catch(Te){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ve,reason:"fail allocating audio mdat "+ve});return}if(!g){var qe=new DataView(le.buffer);qe.setUint32(0,ve),le.set(B.default.types.mdat,4)}}else return;le.set(Ze,ne);var it=Ze.byteLength;ne+=it,W.push(new E(!0,_,it,0)),Ue=Je}var Be=W.length;if(!Be)return;var ct=W[W.length-1];this.nextAudioPts=oe=Ue+F*ct.duration;var ot=g?new Uint8Array(0):B.default.moof(C.sequenceNumber++,Pe/F,m({},C,{samples:W}));C.samples=[];var je=Pe/b,We=oe/b,Oe="audio",_e={data1:ot,data2:le,startPTS:je,endPTS:We,startDTS:je,endDTS:We,type:Oe,hasAudio:!0,hasVideo:!1,nb:Be};return this.isAudioContiguous=!0,console.assert(le.length,"MDAT length must not be zero"),_e},O.remuxEmptyAudio=function(C,T,f,S){var y=C.inputTimeScale,b=C.samplerate?C.samplerate:y,U=y/b,F=this.nextAudioPts,_=(F!==null?F:S.startDTS*y)+this._initDTS,M=S.endDTS*y+this._initDTS,I=U*u,g=Math.ceil((M-_)/I),W=j.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!W){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var $=[],ne=0;ne<g;ne++){var oe=_+ne*I;$.push({unit:W,pts:oe,dts:oe})}return C.samples=$,this.remuxAudio(C,T,f,!1)},O.remuxID3=function(C,T){var f=C.samples.length;if(!f)return;for(var S=C.inputTimeScale,y=this._initPTS,b=this._initDTS,U=0;U<f;U++){var F=C.samples[U];F.pts=a(F.pts-y,T*S)/S,F.dts=a(F.dts-b,T*S)/S}var _=C.samples;return C.samples=[],{samples:_}},O.remuxText=function(C,T){var f=C.samples.length;if(!f)return;for(var S=C.inputTimeScale,y=this._initPTS,b=0;b<f;b++){var U=C.samples[b];U.pts=a(U.pts-y,T*S)/S}C.samples.sort(function(_,M){return _.pts-M.pts});var F=C.samples;return C.samples=[],{samples:F}},D}();function a(D,O){var A;if(O===null)return D;for(O<D?A=-8589934592:A=8589934592;Math.abs(D-O)>4294967296;)D+=A;return D}function R(D){for(var O=0;O<D.length;O++)if(D[O].key)return O;return-1}var E=function(O,A,C,T){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=A,this.size=C,this.cts=T,this.flags=new w(O)},w=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/polyfills/number.ts"),j=P("./src/utils/mp4-tools.ts"),B=P("./src/loader/fragment.ts"),K=P("./src/utils/logger.ts"),H=function(){function v(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var m=v.prototype;return m.destroy=function(){},m.resetTimeStamp=function(u){this.initPTS=u,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(u,h,d){this.audioCodec=h,this.videoCodec=d,this.generateInitSegment(u),this.emitInitSegment=!0},m.generateInitSegment=function(u){var h=this.audioCodec,d=this.videoCodec;if(!u||!u.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=Object(j.parseInitSegment)(u);h||(h=L(o.audio,B.ElementaryStreamTypes.AUDIO)),d||(d=L(o.video,B.ElementaryStreamTypes.VIDEO));var l={};o.audio&&o.video?l.audiovideo={container:"video/mp4",codec:h+","+d,initSegment:u,id:"main"}:o.audio?l.audio={container:"audio/mp4",codec:h,initSegment:u,id:"audio"}:o.video?l.video={container:"video/mp4",codec:d,initSegment:u,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=l},m.remux=function(u,h,d,o,l){var s=this.initPTS,a=this.lastEndDTS,R={audio:void 0,video:void 0,text:o,id3:d,initSegment:void 0};Object(X.isFiniteNumber)(a)||(a=this.lastEndDTS=l||0);var E=h.samples;if(!E||!E.length)return R;var w={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(E),D=this.initData),!D||!D.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),R;this.emitInitSegment&&(w.tracks=this.initTracks,this.emitInitSegment=!1),Object(X.isFiniteNumber)(s)||(this.initPTS=w.initPTS=s=r(D,E,a));var O=Object(j.getDuration)(E,D),A=a,C=O+A;Object(j.offsetStartDTS)(D,E,s),O>0?this.lastEndDTS=C:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var T=!!D.audio,f=!!D.video,S="";T&&(S+="audio"),f&&(S+="video");var y={data1:E,startPTS:A,startDTS:A,endPTS:C,endDTS:C,type:S,hasAudio:T,hasVideo:f,nb:1,dropped:0};return R.audio=y.type==="audio"?y:void 0,R.video=y.type!=="audio"?y:void 0,R.text=o,R.id3=d,R.initSegment=w,R},v}(),r=function(m,p,u){return Object(j.getStartDTS)(m,p)-u};function L(v,m){var p=v==null?void 0:v.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||m===B.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}J.default=H},"./src/task-loop.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return X});var X=function(){function j(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var B=j.prototype;return B.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},B.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},B.onHandlerDestroyed=function(){},B.hasInterval=function(){return!!this._tickInterval},B.hasNextTick=function(){return!!this._tickTimer},B.setInterval=function(H){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,H),!0)},B.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},B.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},B.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},B.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},B.doTick=function(){},j}()},"./src/types/cmcd.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"CMCDVersion",function(){return X}),P.d(J,"CMCDObjectType",function(){return j}),P.d(J,"CMCDStreamingFormat",function(){return B}),P.d(J,"CMCDStreamType",function(){return K});var X=1,j;(function(H){H.MANIFEST="m",H.AUDIO="a",H.VIDEO="v",H.MUXED="av",H.INIT="i",H.CAPTION="c",H.TIMED_TEXT="tt",H.KEY="k",H.OTHER="o"})(j||(j={}));var B;(function(H){H.DASH="d",H.HLS="h",H.SMOOTH="s",H.OTHER="o"})(B||(B={}));var K;(function(H){H.VOD="v",H.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"HlsSkip",function(){return B}),P.d(J,"getSkipValue",function(){return K}),P.d(J,"HlsUrlParameters",function(){return H}),P.d(J,"Level",function(){return r});function X(L,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(L,p.key,p)}}function j(L,v,m){return v&&X(L.prototype,v),m&&X(L,m),L}var B;(function(L){L.No="",L.Yes="YES",L.v2="v2"})(B||(B={}));function K(L,v){var m=L.canSkipUntil,p=L.canSkipDateRanges,u=L.endSN,h=v!==void 0?v-u:0;return m&&h<m?p?B.v2:B.Yes:B.No}var H=function(){function L(m,p,u){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=p,this.skip=u}var v=L.prototype;return v.addDirectives=function(p){var u=new self.URL(p);return this.msn!==void 0&&u.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&u.searchParams.set("_HLS_part",this.part.toString()),this.skip&&u.searchParams.set("_HLS_skip",this.skip),u.toString()},L}(),r=function(){function L(v){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[v.url],this.attrs=v.attrs,this.bitrate=v.bitrate,v.details&&(this.details=v.details),this.id=v.id||0,this.name=v.name,this.width=v.width||0,this.height=v.height||0,this.audioCodec=v.audioCodec,this.videoCodec=v.videoCodec,this.unknownCodecs=v.unknownCodecs,this.codecSet=[v.videoCodec,v.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return j(L,[{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)}}]),L}()},"./src/types/loader.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"PlaylistContextType",function(){return X}),P.d(J,"PlaylistLevelType",function(){return j});var X;(function(B){B.MANIFEST="manifest",B.LEVEL="level",B.AUDIO_TRACK="audioTrack",B.SUBTITLE_TRACK="subtitleTrack"})(X||(X={}));var j;(function(B){B.MAIN="main",B.AUDIO="audio",B.SUBTITLE="subtitle"})(j||(j={}))},"./src/types/transmuxer.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"ChunkMetadata",function(){return X});var X=function(K,H,r,L,v,m){L===void 0&&(L=0),v===void 0&&(v=-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=j(),this.buffering={audio:j(),video:j(),audiovideo:j()},this.level=K,this.sn=H,this.id=r,this.size=L,this.part=v,this.partial=m};function j(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"AttrList",function(){return B});var X=/^(\d+)x(\d+)$/,j=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,B=function(){function K(r){typeof r=="string"&&(r=K.parseAttrList(r));for(var L in r)r.hasOwnProperty(L)&&(this[L]=r[L])}var H=K.prototype;return H.decimalInteger=function(L){var v=parseInt(this[L],10);return v>Number.MAX_SAFE_INTEGER?Infinity:v},H.hexadecimalInteger=function(L){if(this[L]){var v=(this[L]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var m=new Uint8Array(v.length/2),p=0;p<v.length/2;p++)m[p]=parseInt(v.slice(p*2,p*2+2),16);return m}else return null},H.hexadecimalIntegerAsNumber=function(L){var v=parseInt(this[L],16);return v>Number.MAX_SAFE_INTEGER?Infinity:v},H.decimalFloatingPoint=function(L){return parseFloat(this[L])},H.optionalFloat=function(L,v){var m=this[L];return m?parseFloat(m):v},H.enumeratedString=function(L){return this[L]},H.bool=function(L){return this[L]==="YES"},H.decimalResolution=function(L){var v=X.exec(this[L]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},K.parseAttrList=function(L){var v,m={},p='"';for(j.lastIndex=0;(v=j.exec(L))!==null;){var u=v[2];u.indexOf(p)===0&&u.lastIndexOf(p)===u.length-1&&(u=u.slice(1,-1)),m[v[1]]=u}return m},K}()},"./src/utils/binary-search.ts":function(ie,J,P){"use strict";P.r(J);var X={search:function(B,K){for(var H=0,r=B.length-1,L=null,v=null;H<=r;){L=(H+r)/2|0,v=B[L];var m=K(v);if(m>0)H=L+1;else if(m<0)r=L-1;else return v}return null}};J.default=X},"./src/utils/buffer-helper.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"BufferHelper",function(){return B});var X=P("./src/utils/logger.ts"),j={length:0,start:function(){return 0},end:function(){return 0}},B=function(){function K(){}return K.isBuffered=function(r,L){try{if(r){for(var v=K.getBuffered(r),m=0;m<v.length;m++)if(L>=v.start(m)&&L<=v.end(m))return!0}}catch(p){}return!1},K.bufferInfo=function(r,L,v){try{if(r){var m=K.getBuffered(r),p=[],u;for(u=0;u<m.length;u++)p.push({start:m.start(u),end:m.end(u)});return this.bufferedInfo(p,L,v)}}catch(h){}return{len:0,start:L,end:L,nextStart:void 0}},K.bufferedInfo=function(r,L,v){L=Math.max(0,L),r.sort(function(w,D){var O=w.start-D.start;return O||D.end-w.end});var m=[];if(v)for(var p=0;p<r.length;p++){var u=m.length;if(u){var h=m[u-1].end;r[p].start-h<v?r[p].end>h&&(m[u-1].end=r[p].end):m.push(r[p])}else m.push(r[p])}else m=r;for(var d=0,o,l=L,s=L,a=0;a<m.length;a++){var R=m[a].start,E=m[a].end;if(L+v>=R&&L<E)l=R,s=E,d=s-L;else if(L+v<R){o=R;break}}return{len:d,start:l||0,end:s||0,nextStart:o}},K.getBuffered=function(r){try{return r.buffered}catch(L){return X.logger.log("failed to get media.buffered",L),j}},K}()},"./src/utils/cea-608-parser.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"Row",function(){return s}),P.d(J,"CaptionScreen",function(){return a});var X=P("./src/utils/logger.ts"),j={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},B=function(C){var T=C;return j.hasOwnProperty(C)&&(T=j[C]),String.fromCharCode(T)},K=15,H=100,r={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},L={17:2,18:4,21:6,22:8,23:10,19:13,20:15},v={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},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"],u;(function(A){A[A.ERROR=0]="ERROR",A[A.TEXT=1]="TEXT",A[A.WARNING=2]="WARNING",A[A.INFO=2]="INFO",A[A.DEBUG=3]="DEBUG",A[A.DATA=3]="DATA"})(u||(u={}));var h=function(){function A(){this.time=null,this.verboseLevel=u.ERROR}var C=A.prototype;return C.log=function(f,S){this.verboseLevel>=f&&X.logger.log(this.time+" ["+f+"] "+S)},A}(),d=function(C){for(var T=[],f=0;f<C.length;f++)T.push(C[f].toString(16));return T},o=function(){function A(T,f,S,y,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=T||"white",this.underline=f||!1,this.italics=S||!1,this.background=y||"black",this.flash=b||!1}var C=A.prototype;return C.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},C.setStyles=function(f){for(var S=["foreground","underline","italics","background","flash"],y=0;y<S.length;y++){var b=S[y];f.hasOwnProperty(b)&&(this[b]=f[b])}},C.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},C.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},C.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},C.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},A}(),l=function(){function A(T,f,S,y,b,U){this.uchar=void 0,this.penState=void 0,this.uchar=T||" ",this.penState=new o(f,S,y,b,U)}var C=A.prototype;return C.reset=function(){this.uchar=" ",this.penState.reset()},C.setChar=function(f,S){this.uchar=f,this.penState.copy(S)},C.setPenState=function(f){this.penState.copy(f)},C.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},C.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},C.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},A}(),s=function(){function A(T){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var f=0;f<H;f++)this.chars.push(new l);this.logger=T,this.pos=0,this.currPenState=new o}var C=A.prototype;return C.equals=function(f){for(var S=!0,y=0;y<H;y++)if(!this.chars[y].equals(f.chars[y])){S=!1;break}return S},C.copy=function(f){for(var S=0;S<H;S++)this.chars[S].copy(f.chars[S])},C.isEmpty=function(){for(var f=!0,S=0;S<H;S++)if(!this.chars[S].isEmpty()){f=!1;break}return f},C.setCursor=function(f){this.pos!==f&&(this.pos=f),this.pos<0?(this.logger.log(u.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>H&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=H)},C.moveCursor=function(f){var S=this.pos+f;if(f>1)for(var y=this.pos+1;y<S+1;y++)this.chars[y].setPenState(this.currPenState);this.setCursor(S)},C.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},C.insertChar=function(f){f>=144&&this.backSpace();var S=B(f);if(this.pos>=H){this.logger.log(u.ERROR,"Cannot insert "+f.toString(16)+" ("+S+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(S,this.currPenState),this.moveCursor(1)},C.clearFromPos=function(f){var S;for(S=f;S<H;S++)this.chars[S].reset()},C.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},C.clearToEndOfRow=function(){this.clearFromPos(this.pos)},C.getTextString=function(){for(var f=[],S=!0,y=0;y<H;y++){var b=this.chars[y].uchar;b!==" "&&(S=!1),f.push(b)}return S?"":f.join("")},C.setPenStyles=function(f){this.currPenState.setStyles(f);var S=this.chars[this.pos];S.setPenState(this.currPenState)},A}(),a=function(){function A(T){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var f=0;f<K;f++)this.rows.push(new s(T));this.logger=T,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var C=A.prototype;return C.reset=function(){for(var f=0;f<K;f++)this.rows[f].clear();this.currRow=K-1},C.equals=function(f){for(var S=!0,y=0;y<K;y++)if(!this.rows[y].equals(f.rows[y])){S=!1;break}return S},C.copy=function(f){for(var S=0;S<K;S++)this.rows[S].copy(f.rows[S])},C.isEmpty=function(){for(var f=!0,S=0;S<K;S++)if(!this.rows[S].isEmpty()){f=!1;break}return f},C.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},C.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},C.insertChar=function(f){var S=this.rows[this.currRow];S.insertChar(f)},C.setPen=function(f){var S=this.rows[this.currRow];S.setPenStyles(f)},C.moveCursor=function(f){var S=this.rows[this.currRow];S.moveCursor(f)},C.setCursor=function(f){this.logger.log(u.INFO,"setCursor: "+f);var S=this.rows[this.currRow];S.setCursor(f)},C.setPAC=function(f){this.logger.log(u.INFO,"pacData = "+JSON.stringify(f));var S=f.row-1;if(this.nrRollUpRows&&S<this.nrRollUpRows-1&&(S=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==S){for(var y=0;y<K;y++)this.rows[y].clear();var b=this.currRow+1-this.nrRollUpRows,U=this.lastOutputScreen;if(U){var F=U.rows[b].cueStartTime,_=this.logger.time;if(F&&_!==null&&F<_)for(var M=0;M<this.nrRollUpRows;M++)this.rows[S-this.nrRollUpRows+M+1].copy(U.rows[b+M])}}this.currRow=S;var I=this.rows[this.currRow];if(f.indent!==null){var g=f.indent,W=Math.max(g-1,0);I.setCursor(f.indent),f.color=I.chars[W].penState.foreground}var $={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen($)},C.setBkgData=function(f){this.logger.log(u.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},C.setRollUpRows=function(f){this.nrRollUpRows=f},C.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(u.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(u.TEXT,this.getDisplayText());var f=this.currRow+1-this.nrRollUpRows,S=this.rows.splice(f,1)[0];S.clear(),this.rows.splice(this.currRow,0,S),this.logger.log(u.INFO,"Rolling up")},C.getDisplayText=function(f){f=f||!1;for(var S=[],y="",b=-1,U=0;U<K;U++){var F=this.rows[U].getTextString();F&&(b=U+1,f?S.push("Row "+b+": '"+F+"'"):S.push(F.trim()))}return S.length>0&&(f?y="["+S.join(" | ")+"]":y=S.join(`
`)),y},C.getTextAndFormat=function(){return this.rows},A}(),R=function(){function A(T,f,S){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=T,this.outputFilter=f,this.mode=null,this.verbose=0,this.displayedMemory=new a(S),this.nonDisplayedMemory=new a(S),this.lastOutputScreen=new a(S),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=S}var C=A.prototype;return C.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},C.getHandler=function(){return this.outputFilter},C.setHandler=function(f){this.outputFilter=f},C.setPAC=function(f){this.writeScreen.setPAC(f)},C.setBkgData=function(f){this.writeScreen.setBkgData(f)},C.setMode=function(f){if(f===this.mode)return;this.mode=f,this.logger.log(u.INFO,"MODE="+f),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=f},C.insertChars=function(f){for(var S=0;S<f.length;S++)this.writeScreen.insertChar(f[S]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(u.INFO,y+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(u.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},C.ccRCL=function(){this.logger.log(u.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},C.ccBS=function(){if(this.logger.log(u.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},C.ccAOF=function(){},C.ccAON=function(){},C.ccDER=function(){this.logger.log(u.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},C.ccRU=function(f){this.logger.log(u.INFO,"RU("+f+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(f)},C.ccFON=function(){this.logger.log(u.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},C.ccRDC=function(){this.logger.log(u.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},C.ccTR=function(){this.logger.log(u.INFO,"TR"),this.setMode("MODE_TEXT")},C.ccRTD=function(){this.logger.log(u.INFO,"RTD"),this.setMode("MODE_TEXT")},C.ccEDM=function(){this.logger.log(u.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},C.ccCR=function(){this.logger.log(u.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},C.ccENM=function(){this.logger.log(u.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},C.ccEOC=function(){if(this.logger.log(u.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var f=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=f,this.writeScreen=this.nonDisplayedMemory,this.logger.log(u.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},C.ccTO=function(f){this.logger.log(u.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},C.ccMIDROW=function(f){var S={flash:!1};if(S.underline=f%2===1,S.italics=f>=46,S.italics)S.foreground="white";else{var y=Math.floor(f/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];S.foreground=b[y]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(S)),this.writeScreen.setPen(S)},C.outputDataUpdate=function(f){f===void 0&&(f=!1);var S=this.logger.time;if(S===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=S:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,S,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:S),this.lastOutputScreen.copy(this.displayedMemory))},C.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},A}(),E=function(){function A(T,f,S){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new h;this.channels=[null,new R(T,f,y),new R(T+1,S,y)],this.cmdHistory=O(),this.logger=y}var C=A.prototype;return C.getHandler=function(f){return this.channels[f].getHandler()},C.setHandler=function(f,S){this.channels[f].setHandler(S)},C.addData=function(f,S){var y,b,U,F=!1;this.logger.time=f;for(var _=0;_<S.length;_+=2){if(b=S[_]&127,U=S[_+1]&127,b===0&&U===0)continue;if(this.logger.log(u.DATA,"["+d([S[_],S[_+1]])+"] -> ("+d([b,U])+")"),y=this.parseCmd(b,U),y||(y=this.parseMidrow(b,U)),y||(y=this.parsePAC(b,U)),y||(y=this.parseBackgroundAttributes(b,U)),!y&&(F=this.parseChars(b,U),F)){var M=this.currentChannel;if(M&&M>0){var I=this.channels[M];I.insertChars(F)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!F&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+d([b,U])+" orig: "+d([S[_],S[_+1]]))}},C.parseCmd=function(f,S){var y=this.cmdHistory,b=(f===20||f===28||f===21||f===29)&&S>=32&&S<=47,U=(f===23||f===31)&&S>=33&&S<=35;if(!(b||U))return!1;if(D(f,S,y))return w(null,null,y),this.logger.log(u.DEBUG,"Repeated command ("+d([f,S])+") is dropped"),!0;var F=f===20||f===21||f===23?1:2,_=this.channels[F];return f===20||f===21||f===28||f===29?S===32?_.ccRCL():S===33?_.ccBS():S===34?_.ccAOF():S===35?_.ccAON():S===36?_.ccDER():S===37?_.ccRU(2):S===38?_.ccRU(3):S===39?_.ccRU(4):S===40?_.ccFON():S===41?_.ccRDC():S===42?_.ccTR():S===43?_.ccRTD():S===44?_.ccEDM():S===45?_.ccCR():S===46?_.ccENM():S===47&&_.ccEOC():_.ccTO(S-32),w(f,S,y),this.currentChannel=F,!0},C.parseMidrow=function(f,S){var y=0;if((f===17||f===25)&&S>=32&&S<=47){if(f===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[y];return b?(b.ccMIDROW(S),this.logger.log(u.DEBUG,"MIDROW ("+d([f,S])+")"),!0):!1}return!1},C.parsePAC=function(f,S){var y,b=this.cmdHistory,U=(f>=17&&f<=23||f>=25&&f<=31)&&S>=64&&S<=127,F=(f===16||f===24)&&S>=64&&S<=95;if(!(U||F))return!1;if(D(f,S,b))return w(null,null,b),!0;var _=f<=23?1:2;S>=64&&S<=95?y=_===1?r[f]:v[f]:y=_===1?L[f]:m[f];var M=this.channels[_];return M?(M.setPAC(this.interpretPAC(y,S)),w(f,S,b),this.currentChannel=_,!0):!1},C.interpretPAC=function(f,S){var y,b={color:null,italics:!1,indent:null,underline:!1,row:f};return S>95?y=S-96:y=S-64,b.underline=(y&1)===1,y<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((y-16)/2)*4,b},C.parseChars=function(f,S){var y,b=null,U=null;if(f>=25?(y=2,U=f-8):(y=1,U=f),U>=17&&U<=19){var F;U===17?F=S+80:U===18?F=S+112:F=S+144,this.logger.log(u.INFO,"Special char '"+B(F)+"' in channel "+y),b=[F]}else f>=32&&f<=127&&(b=S===0?[f]:[f,S]);if(b){var _=d(b);this.logger.log(u.DEBUG,"Char codes = "+_.join(",")),w(f,S,this.cmdHistory)}return b},C.parseBackgroundAttributes=function(f,S){var y=(f===16||f===24)&&S>=32&&S<=47,b=(f===23||f===31)&&S>=45&&S<=47;if(!(y||b))return!1;var U,F={};f===16||f===24?(U=Math.floor((S-32)/2),F.background=p[U],S%2===1&&(F.background=F.background+"_semi")):S===45?F.background="transparent":(F.foreground="black",S===47&&(F.underline=!0));var _=f<=23?1:2,M=this.channels[_];return M.setBkgData(F),w(f,S,this.cmdHistory),!0},C.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var S=this.channels[f];S&&S.reset()}this.cmdHistory=O()},C.cueSplitAtTime=function(f){for(var S=0;S<this.channels.length;S++){var y=this.channels[S];y&&y.cueSplitAtTime(f)}},A}();function w(A,C,T){T.a=A,T.b=C}function D(A,C,T){return T.a===A&&T.b===C}function O(){return{a:null,b:null}}J.default=E},"./src/utils/codecs.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"isCodecType",function(){return j}),P.d(J,"isCodecSupportedInMp4",function(){return B});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 j(K,H){var r=X[H];return!!r&&r[K.slice(0,4)]===!0}function B(K,H){return MediaSource.isTypeSupported((H||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/utils/vttparser.ts"),j=P("./src/utils/webvtt-parser.ts"),B=P("./src/utils/texttrack-utils.ts"),K=/\s/,H={newCue:function(L,v,m,p){for(var u=[],h,d,o,l,s,a=self.VTTCue||self.TextTrackCue,R=0;R<p.rows.length;R++)if(h=p.rows[R],o=!0,l=0,s="",!h.isEmpty()){for(var E=0;E<h.chars.length;E++)K.test(h.chars[E].uchar)&&o?l++:(s+=h.chars[E].uchar,o=!1);h.cueStartTime=v,v===m&&(m+=1e-4),l>=16?l--:l++;var w=Object(X.fixLineBreaks)(s.trim()),D=Object(j.generateCueId)(v,m,w);(!L||!L.cues||!L.cues.getCueById(D))&&(d=new a(v,m,w),d.id=D,d.line=R+1,d.align="left",d.position=10+Math.min(80,Math.floor(l*8/32)*10),u.push(d))}return L&&u.length&&(u.sort(function(O,A){return O.line==="auto"||A.line==="auto"?0:O.line>8&&A.line>8?A.line-O.line:O.line-A.line}),u.forEach(function(O){return Object(B.addCueToTrack)(L,O)})),u}};J.default=H},"./src/utils/discontinuities.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"findFirstFragWithCC",function(){return K}),P.d(J,"shouldAlignOnDiscontinuities",function(){return H}),P.d(J,"findDiscontinuousReferenceFrag",function(){return r}),P.d(J,"adjustSlidingStart",function(){return v}),P.d(J,"alignStream",function(){return m}),P.d(J,"alignPDT",function(){return u}),P.d(J,"alignFragmentByPDTDelta",function(){return h}),P.d(J,"alignMediaPlaylistByPDT",function(){return d});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts"),B=P("./src/controller/level-helper.ts");function K(o,l){for(var s=null,a=0,R=o.length;a<R;a++){var E=o[a];if(E&&E.cc===l){s=E;break}}return s}function H(o,l,s){return!!(l.details&&(s.endCC>s.startCC||o&&o.cc<s.startCC))}function r(o,l){var s=o.fragments,a=l.fragments;if(!a.length||!s.length){j.logger.log("No fragments to align");return}var R=K(s,a[0].cc);if(!R||R&&!R.startPTS){j.logger.log("No frag in previous level to align on");return}return R}function L(o,l){if(o){var s=o.start+l;o.start=o.startPTS=s,o.endPTS=s+o.duration}}function v(o,l){for(var s=l.fragments,a=0,R=s.length;a<R;a++)L(s[a],o);l.fragmentHint&&L(l.fragmentHint,o),l.alignedSliding=!0}function m(o,l,s){if(!l)return;p(o,s,l),!s.alignedSliding&&l.details&&u(s,l.details),!s.alignedSliding&&l.details&&!s.skippedSegments&&Object(B.adjustSliding)(l.details,s)}function p(o,l,s){if(H(o,s,l)){var a=r(s.details,l);a&&Object(X.isFiniteNumber)(a.start)&&(j.logger.log("Adjusting PTS using last level due to CC increase within current level "+l.url),v(a.start,l))}}function u(o,l){if(!l.fragments.length||!o.hasProgramDateTime||!l.hasProgramDateTime)return;var s=l.fragments[0].programDateTime,a=o.fragments[0].programDateTime,R=(a-s)/1e3+l.fragments[0].start;R&&Object(X.isFiniteNumber)(R)&&(j.logger.log("Adjusting PTS using programDateTime delta "+(a-s)+"ms, sliding:"+R.toFixed(3)+" "+o.url+" "),v(R,o))}function h(o,l){var s=o.programDateTime;if(!s)return;var a=(s-l)/1e3;o.start=o.startPTS=a,o.endPTS=a+o.duration}function d(o,l){if(!l.fragments.length||!o.hasProgramDateTime||!l.hasProgramDateTime)return;var s=l.fragments[0].programDateTime,a=l.fragments[0].start,R=s-a*1e3;o.fragments.forEach(function(E){h(E,R)}),o.fragmentHint&&h(o.fragmentHint,R),o.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/utils/ewma.ts"),j=function(){function B(H,r,L){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=L,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new X.default(H),this.fast_=new X.default(r)}var K=B.prototype;return K.update=function(r,L){var v=this.slow_,m=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new X.default(r,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==L&&(this.fast_=new X.default(L,m.getEstimate(),m.getTotalWeight()))},K.sample=function(r,L){r=Math.max(r,this.minDelayMs_);var v=8*L,m=r/1e3,p=v/m;this.fast_.sample(m,p),this.slow_.sample(m,p)},K.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},B}();J.default=j},"./src/utils/ewma.ts":function(ie,J,P){"use strict";P.r(J);var X=function(){function j(K,H,r){H===void 0&&(H=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=H,this.totalWeight_=r}var B=j.prototype;return B.sample=function(H,r){var L=Math.pow(this.alpha_,H);this.estimate_=r*(1-L)+L*this.estimate_,this.totalWeight_+=H},B.getTotalWeight=function(){return this.totalWeight_},B.getEstimate=function(){if(this.alpha_){var H=1-Math.pow(this.alpha_,this.totalWeight_);if(H)return this.estimate_/H}return this.estimate_},j}();J.default=X},"./src/utils/fetch-loader.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"fetchSupported",function(){return h});var X=P("./src/polyfills/number.ts"),j=P("./src/loader/load-stats.ts"),B=P("./src/demux/chunk-cache.ts");function K(a,R){a.prototype=Object.create(R.prototype),a.prototype.constructor=a,m(a,R)}function H(a){var R=typeof Map=="function"?new Map:void 0;return H=function(w){if(w===null||!v(w))return w;if(typeof w!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(w))return R.get(w);R.set(w,D)}function D(){return r(w,arguments,p(this).constructor)}return D.prototype=Object.create(w.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),m(D,w)},H(a)}function r(a,R,E){return L()?r=Reflect.construct:r=function(D,O,A){var C=[null];C.push.apply(C,O);var T=Function.bind.apply(D,C),f=new T;return A&&m(f,A.prototype),f},r.apply(null,arguments)}function L(){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 v(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function m(a,R){return m=Object.setPrototypeOf||function(w,D){return w.__proto__=D,w},m(a,R)}function p(a){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},p(a)}function u(){return u=Object.assign||function(a){for(var R=1;R<arguments.length;R++){var E=arguments[R];for(var w in E)Object.prototype.hasOwnProperty.call(E,w)&&(a[w]=E[w])}return a},u.apply(this,arguments)}function h(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}var d=function(){function a(E){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=E.fetchSetup||l,this.controller=new self.AbortController,this.stats=new j.LoadStats}var R=a.prototype;return R.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},R.abortInternal=function(){var w=this.response;(!w||!w.ok)&&(this.stats.aborted=!0,this.controller.abort())},R.abort=function(){var w;this.abortInternal(),(w=this.callbacks)!==null&&w!==void 0&&w.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},R.load=function(w,D,O){var A=this,C=this.stats;if(C.loading.start)throw new Error("Loader can only be used once.");C.loading.start=self.performance.now();var T=o(w,this.controller.signal),f=O.onProgress,S=w.responseType==="arraybuffer",y=S?"byteLength":"length";this.context=w,this.config=D,this.callbacks=O,this.request=this.fetchSetup(w,T),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){A.abortInternal(),O.onTimeout(C,w,A.response)},D.timeout),self.fetch(this.request).then(function(b){if(A.response=A.loader=b,!b.ok){var U=b.status,F=b.statusText;throw new s(F||"fetch, bad network response",U,b)}return C.loading.first=Math.max(self.performance.now(),C.loading.start),C.total=parseInt(b.headers.get("Content-Length")||"0"),f&&Object(X.isFiniteNumber)(D.highWaterMark)?A.loadProgressively(b,C,w,D.highWaterMark,f):S?b.arrayBuffer():b.text()}).then(function(b){var U=A.response;self.clearTimeout(A.requestTimeout),C.loading.end=Math.max(self.performance.now(),C.loading.first),C.loaded=C.total=b[y];var F={url:U.url,data:b};f&&!Object(X.isFiniteNumber)(D.highWaterMark)&&f(C,w,b,U),O.onSuccess(F,C,w,U)}).catch(function(b){if(self.clearTimeout(A.requestTimeout),C.aborted)return;var U=b.code||0;O.onError({code:U,text:b.message},w,b.details)})},R.getCacheAge=function(){var w=null;if(this.response){var D=this.response.headers.get("age");w=D?parseFloat(D):null}return w},R.loadProgressively=function(w,D,O,A,C){A===void 0&&(A=0);var T=new B.default,f=w.body.getReader(),S=function y(){return f.read().then(function(b){if(b.done)return T.dataLength&&C(D,O,T.flush(),w),Promise.resolve(new ArrayBuffer(0));var U=b.value,F=U.length;return D.loaded+=F,F<A||T.dataLength?(T.push(U),T.dataLength>=A&&C(D,O,T.flush(),w)):C(D,O,U,w),y()}).catch(function(){return Promise.reject()})};return S()},a}();function o(a,R){var E={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(u({},a.headers))};return a.rangeEnd&&E.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),E}function l(a,R){return new self.Request(a.url,R)}var s=function(a){K(R,a);function R(E,w,D){var O;return O=a.call(this,E)||this,O.code=void 0,O.details=void 0,O.code=w,O.details=D,O}return R}(H(Error));J.default=d},"./src/utils/imsc1-ttml-parser.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"IMSC1_CODEC",function(){return v}),P.d(J,"parseIMSC1",function(){return h});var X=P("./src/utils/mp4-tools.ts"),j=P("./src/utils/vttparser.ts"),B=P("./src/utils/vttcue.ts"),K=P("./src/demux/id3.ts"),H=P("./src/utils/timescale-conversion.ts"),r=P("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(A){for(var C=1;C<arguments.length;C++){var T=arguments[C];for(var f in T)Object.prototype.hasOwnProperty.call(T,f)&&(A[f]=T[f])}return A},L.apply(this,arguments)}var v="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,u={left:"start",center:"center",right:"end",start:"start",end:"end"};function h(A,C,T,f,S){var y=Object(X.findBox)(new Uint8Array(A),["mdat"]);if(y.length===0){S(new Error("Could not parse IMSC1 mdat"));return}var b=y[0],U=Object(K.utf8ArrayToStr)(new Uint8Array(A,b.start,b.end-b.start)),F=Object(H.toTimescaleFromScale)(C,1,T);try{f(d(U,F))}catch(_){S(_)}}function d(A,C){var T=new DOMParser,f=T.parseFromString(A,"text/xml"),S=f.getElementsByTagName("tt")[0];if(!S)throw new Error("Invalid ttml");var y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(y).reduce(function(I,g){return I[g]=S.getAttribute("ttp:"+g)||y[g],I},{}),U=S.getAttribute("xml:space")!=="preserve",F=l(o(S,"styling","style")),_=l(o(S,"layout","region")),M=o(S,"body","[begin]");return[].map.call(M,function(I){var g=s(I,U);if(!g||!I.hasAttribute("begin"))return null;var W=w(I.getAttribute("begin"),b),$=w(I.getAttribute("dur"),b),ne=w(I.getAttribute("end"),b);if(W===null)throw E(I);if(ne===null){if($===null)throw E(I);ne=W+$}var oe=new B.default(W-C,ne-C,g);oe.id=Object(r.generateCueId)(oe.startTime,oe.endTime,oe.text);var we=_[I.getAttribute("region")],ge=F[I.getAttribute("style")];oe.position=10,oe.size=80;var xe=a(we,ge),Re=xe.textAlign;if(Re){var Le=u[Re];Le&&(oe.lineAlign=Le),oe.align=Re}return L(oe,xe),oe}).filter(function(I){return I!==null})}function o(A,C,T){var f=A.getElementsByTagName(C)[0];return f?[].slice.call(f.querySelectorAll(T)):[]}function l(A){return A.reduce(function(C,T){var f=T.getAttribute("xml:id");return f&&(C[f]=T),C},{})}function s(A,C){return[].slice.call(A.childNodes).reduce(function(T,f,S){var y;return f.nodeName==="br"&&S?T+`
`:(y=f.childNodes)!==null&&y!==void 0&&y.length?s(f,C):C?T+f.textContent.trim().replace(/\s+/g," "):T+f.textContent},"")}function a(A,C){var T="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(S,y){var b=R(C,T,y)||R(A,T,y);return b&&(S[y]=b),S},{})}function R(A,C,T){return A.hasAttributeNS(C,T)?A.getAttributeNS(C,T):null}function E(A){return new Error("Could not parse ttml timestamp "+A)}function w(A,C){if(!A)return null;var T=Object(j.parseTimeStamp)(A);return T===null&&(m.test(A)?T=D(A,C):p.test(A)&&(T=O(A,C))),T}function D(A,C){var T=m.exec(A),f=(T[4]|0)+(T[5]|0)/C.subFrameRate;return(T[1]|0)*3600+(T[2]|0)*60+(T[3]|0)+f/C.frameRate}function O(A,C){var T=p.exec(A),f=Number(T[1]),S=T[2];switch(S){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/C.frameRate;case"t":return f/C.tickRate}return f}},"./src/utils/logger.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"enableLogs",function(){return r}),P.d(J,"logger",function(){return L});var X=function(){},j={trace:X,debug:X,log:X,warn:X,info:X,error:X},B=j;function K(v){var m=self.console[v];return m?m.bind(self.console,"["+v+"] >"):X}function H(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),u=1;u<m;u++)p[u-1]=arguments[u];p.forEach(function(h){B[h]=v[h]?v[h].bind(v):K(h)})}function r(v){if(self.console&&v===!0||typeof v=="object"){H(v,"debug","log","info","warn","error");try{B.log()}catch(m){B=j}}else B=j}var L=B},"./src/utils/mediakeys-helper.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"KeySystems",function(){return X}),P.d(J,"requestMediaKeySystemAccess",function(){return j});var X;(function(B){B.WIDEVINE="com.widevine.alpha",B.PLAYREADY="com.microsoft.playready"})(X||(X={}));var j=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"getMediaSource",function(){return X});function X(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"bin2str",function(){return H}),P.d(J,"readUint16",function(){return r}),P.d(J,"readUint32",function(){return L}),P.d(J,"writeUint32",function(){return v}),P.d(J,"findBox",function(){return m}),P.d(J,"parseSegmentIndex",function(){return p}),P.d(J,"parseInitSegment",function(){return u}),P.d(J,"getStartDTS",function(){return h}),P.d(J,"getDuration",function(){return d}),P.d(J,"computeRawDurationFromSamples",function(){return o}),P.d(J,"offsetStartDTS",function(){return l}),P.d(J,"segmentValidRange",function(){return s}),P.d(J,"appendUint8Array",function(){return a});var X=P("./src/utils/typed-array.ts"),j=P("./src/loader/fragment.ts"),B=Math.pow(2,32)-1,K=[].push;function H(R){return String.fromCharCode.apply(null,R)}function r(R,E){"data"in R&&(E+=R.start,R=R.data);var w=R[E]<<8|R[E+1];return w<0?65536+w:w}function L(R,E){"data"in R&&(E+=R.start,R=R.data);var w=R[E]<<24|R[E+1]<<16|R[E+2]<<8|R[E+3];return w<0?4294967296+w:w}function v(R,E,w){"data"in R&&(E+=R.start,R=R.data),R[E]=w>>24,R[E+1]=w>>16&255,R[E+2]=w>>8&255,R[E+3]=w&255}function m(R,E){var w=[];if(!E.length)return w;var D,O,A;"data"in R?(D=R.data,O=R.start,A=R.end):(D=R,O=0,A=D.byteLength);for(var C=O;C<A;){var T=L(D,C),f=H(D.subarray(C+4,C+8)),S=T>1?C+T:A;if(f===E[0])if(E.length===1)w.push({data:D,start:C+8,end:S});else{var y=m({data:D,start:C+8,end:S},E.slice(1));y.length&&K.apply(w,y)}C=S}return w}function p(R){var E=m(R,["moov"]),w=E[0],D=w?w.end:null,O=m(R,["sidx"]);if(!O||!O[0])return null;var A=[],C=O[0],T=C.data[0],f=T===0?8:16,S=L(C,f);f+=4;var y=0,b=0;T===0?f+=8:f+=16,f+=2;var U=C.end+b,F=r(C,f);f+=2;for(var _=0;_<F;_++){var M=f,I=L(C,M);M+=4;var g=I&2147483647,W=(I&2147483648)>>>31;if(W===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var $=L(C,M);M+=4,A.push({referenceSize:g,subsegmentDuration:$,info:{duration:$/S,start:U,end:U+g-1}}),U+=g,M+=4,f=M}return{earliestPresentationTime:y,timescale:S,version:T,referencesCount:F,references:A,moovEndOffset:D}}function u(R){for(var E=[],w=m(R,["moov","trak"]),D=0;D<w.length;D++){var O=w[D],A=m(O,["tkhd"])[0];if(A){var C=A.data[A.start],T=C===0?12:20,f=L(A,T),S=m(O,["mdia","mdhd"])[0];if(S){C=S.data[S.start],T=C===0?12:20;var y=L(S,T),b=m(O,["mdia","hdlr"])[0];if(b){var U=H(b.data.subarray(b.start+8,b.start+12)),F={soun:j.ElementaryStreamTypes.AUDIO,vide:j.ElementaryStreamTypes.VIDEO}[U];if(F){var _=m(O,["mdia","minf","stbl","stsd"])[0],M=void 0;_&&(M=H(_.data.subarray(_.start+12,_.start+16))),E[f]={timescale:y,type:F},E[F]={timescale:y,id:f,codec:M}}}}}}var I=m(R,["moov","mvex","trex"]);return I.forEach(function(g){var W=L(g,4),$=E[W];$&&($.default={duration:L(g,12),flags:L(g,20)})}),E}function h(R,E){return m(E,["moof","traf"]).reduce(function(w,D){var O=m(D,["tfdt"])[0],A=O.data[O.start],C=m(D,["tfhd"]).reduce(function(T,f){var S=L(f,4),y=R[S];if(y){var b=L(O,4);A===1&&(b*=Math.pow(2,32),b+=L(O,8));var U=y.timescale||9e4,F=b/U;if(isFinite(F)&&(T===null||F<T))return F}return T},null);return C!==null&&isFinite(C)&&(w===null||C<w)?C:w},null)||0}function d(R,E){for(var w=0,D=0,O=0,A=m(R,["moof","traf"]),C=0;C<A.length;C++){var T=A[C],f=m(T,["tfhd"])[0],S=L(f,4),y=E[S];if(!y)continue;var b=y.default,U=L(f,0)|(b==null?void 0:b.flags),F=b==null?void 0:b.duration;U&8&&(U&2?F=L(f,12):F=L(f,8));for(var _=y.timescale||9e4,M=m(T,["trun"]),I=0;I<M.length;I++){if(F){var g=L(M[I],4);w=F*g}else w=o(M[I]);y.type===j.ElementaryStreamTypes.VIDEO?D+=w/_:y.type===j.ElementaryStreamTypes.AUDIO&&(O+=w/_)}}if(D===0&&O===0){var W=p(R);if(W!=null&&W.references)return W.references.reduce(function($,ne){return $+ne.info.duration||0},0)}return D||O}function o(R){var E=L(R,0),w=8;E&1&&(w+=4),E&4&&(w+=4);for(var D=0,O=L(R,4),A=0;A<O;A++){if(E&256){var C=L(R,w);D+=C,w+=4}E&512&&(w+=4),E&1024&&(w+=4),E&2048&&(w+=4)}return D}function l(R,E,w){m(E,["moof","traf"]).forEach(function(D){m(D,["tfhd"]).forEach(function(O){var A=L(O,4),C=R[A];if(!C)return;var T=C.timescale||9e4;m(D,["tfdt"]).forEach(function(f){var S=f.data[f.start],y=L(f,4);if(S===0)v(f,4,y-w*T);else{y*=Math.pow(2,32),y+=L(f,8),y-=w*T,y=Math.max(y,0);var b=Math.floor(y/(B+1)),U=Math.floor(y%(B+1));v(f,4,b),v(f,8,U)}})})})}function s(R){var E={valid:null,remainder:null},w=m(R,["moof"]);if(w){if(w.length<2)return E.remainder=R,E}else return E;var D=w[w.length-1];return E.valid=Object(X.sliceUint8)(R,0,D.start-8),E.remainder=Object(X.sliceUint8)(R,D.start-8),E}function a(R,E){var w=new Uint8Array(R.length+E.length);return w.set(R),w.set(E,R.length),w}},"./src/utils/output-filter.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return X});var X=function(){function j(K,H){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=H}var B=j.prototype;return B.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},B.newCue=function(H,r,L){(this.startTime===null||this.startTime>H)&&(this.startTime=H),this.endTime=r,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},B.reset=function(){this.cueRanges=[]},j}()},"./src/utils/texttrack-utils.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"sendAddTrackEvent",function(){return j}),P.d(J,"addCueToTrack",function(){return B}),P.d(J,"clearCurrentCues",function(){return K}),P.d(J,"removeCuesInRange",function(){return H}),P.d(J,"getCuesInRange",function(){return L});var X=P("./src/utils/logger.ts");function j(v,m){var p;try{p=new Event("addtrack")}catch(u){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=v,m.dispatchEvent(p)}function B(v,m){var p=v.mode;if(p==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(m.id))try{if(v.addCue(m),!v.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(h){X.logger.debug("[texttrack-utils]: "+h);var u=new self.TextTrackCue(m.startTime,m.endTime,m.text);u.id=m.id,v.addCue(u)}p==="disabled"&&(v.mode=p)}function K(v){var m=v.mode;if(m==="disabled"&&(v.mode="hidden"),v.cues)for(var p=v.cues.length;p--;)v.removeCue(v.cues[p]);m==="disabled"&&(v.mode=m)}function H(v,m,p){var u=v.mode;if(u==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var h=L(v.cues,m,p),d=0;d<h.length;d++)v.removeCue(h[d]);u==="disabled"&&(v.mode=u)}function r(v,m){if(m<v[0].startTime)return 0;var p=v.length-1;if(m>v[p].endTime)return-1;for(var u=0,h=p;u<=h;){var d=Math.floor((h+u)/2);if(m<v[d].startTime)h=d-1;else if(m>v[d].startTime&&u<p)u=d+1;else return d}return v[u].startTime-m<m-v[h].startTime?u:h}function L(v,m,p){var u=[],h=r(v,m);if(h>-1)for(var d=h,o=v.length;d<o;d++){var l=v[d];if(l.startTime>=m&&l.endTime<=p)u.push(l);else if(l.startTime>p)return u}return u}},"./src/utils/time-ranges.ts":function(ie,J,P){"use strict";P.r(J);var X={toString:function(B){for(var K="",H=B.length,r=0;r<H;r++)K+="["+B.start(r).toFixed(3)+","+B.end(r).toFixed(3)+"]";return K}};J.default=X},"./src/utils/timescale-conversion.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"toTimescaleFromBase",function(){return j}),P.d(J,"toTimescaleFromScale",function(){return B}),P.d(J,"toMsFromMpegTsClock",function(){return K}),P.d(J,"toMpegTsClockFromTimescale",function(){return H});var X=9e4;function j(r,L,v,m){v===void 0&&(v=1),m===void 0&&(m=!1);var p=r*L*v;return m?Math.round(p):p}function B(r,L,v,m){return v===void 0&&(v=1),m===void 0&&(m=!1),j(r,L,1/v,m)}function K(r,L){return L===void 0&&(L=!1),j(r,1e3,1/X,L)}function H(r,L){return L===void 0&&(L=1),j(r,X,1/L)}},"./src/utils/typed-array.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"sliceUint8",function(){return X});function X(j,B,K){return Uint8Array.prototype.slice?j.slice(B,K):new Uint8Array(Array.prototype.slice.call(j,B,K))}},"./src/utils/vttcue.ts":function(ie,J,P){"use strict";P.r(J),J.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var X=["","lr","rl"],j=["start","middle","end","left","right"];function B(v,m){if(typeof m!="string")return!1;if(!Array.isArray(v))return!1;var p=m.toLowerCase();return~v.indexOf(p)?p:!1}function K(v){return B(X,v)}function H(v){return B(j,v)}function r(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),u=1;u<m;u++)p[u-1]=arguments[u];for(var h=1;h<arguments.length;h++){var d=arguments[h];for(var o in d)v[o]=d[o]}return v}function L(v,m,p){var u=this,h={enumerable:!0};u.hasBeenReset=!1;var d="",o=!1,l=v,s=m,a=p,R=null,E="",w=!0,D="auto",O="start",A=50,C="middle",T=50,f="middle";Object.defineProperty(u,"id",r({},h,{get:function(){return d},set:function(y){d=""+y}})),Object.defineProperty(u,"pauseOnExit",r({},h,{get:function(){return o},set:function(y){o=!!y}})),Object.defineProperty(u,"startTime",r({},h,{get:function(){return l},set:function(y){if(typeof y!="number")throw new TypeError("Start time must be set to a number.");l=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",r({},h,{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(u,"text",r({},h,{get:function(){return a},set:function(y){a=""+y,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",r({},h,{get:function(){return R},set:function(y){R=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",r({},h,{get:function(){return E},set:function(y){var b=K(y);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");E=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",r({},h,{get:function(){return w},set:function(y){w=!!y,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",r({},h,{get:function(){return D},set:function(y){if(typeof y!="number"&&y!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");D=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"lineAlign",r({},h,{get:function(){return O},set:function(y){var b=H(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");O=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",r({},h,{get:function(){return A},set:function(y){if(y<0||y>100)throw new Error("Position must be between 0 and 100.");A=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",r({},h,{get:function(){return C},set:function(y){var b=H(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");C=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",r({},h,{get:function(){return T},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");T=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",r({},h,{get:function(){return f},set:function(y){var b=H(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");f=b,this.hasBeenReset=!0}})),u.displayState=void 0}return L.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"parseTimeStamp",function(){return B}),P.d(J,"fixLineBreaks",function(){return m}),P.d(J,"VTTParser",function(){return p});var X=P("./src/utils/vttcue.ts"),j=function(){function u(){}var h=u.prototype;return h.decode=function(o,l){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},u}();function B(u){function h(o,l,s,a){return(o|0)*3600+(l|0)*60+(s|0)+parseFloat(a||0)}var d=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return d?parseFloat(d[2])>59?h(d[2],d[3],0,d[4]):h(d[1],d[2],d[3],d[4]):null}var K=function(){function u(){this.values=Object.create(null)}var h=u.prototype;return h.set=function(o,l){!this.get(o)&&l!==""&&(this.values[o]=l)},h.get=function(o,l,s){return s?this.has(o)?this.values[o]:l[s]:this.has(o)?this.values[o]:l},h.has=function(o){return o in this.values},h.alt=function(o,l,s){for(var a=0;a<s.length;++a)if(l===s[a]){this.set(o,l);break}},h.integer=function(o,l){/^-?\d+$/.test(l)&&this.set(o,parseInt(l,10))},h.percent=function(o,l){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(l)){var s=parseFloat(l);if(s>=0&&s<=100)return this.set(o,s),!0}return!1},u}();function H(u,h,d,o){var l=o?u.split(o):[u];for(var s in l){if(typeof l[s]!="string")continue;var a=l[s].split(d);if(a.length!==2)continue;var R=a[0],E=a[1];h(R,E)}}var r=new X.default(0,0,""),L=r.align==="middle"?"middle":"center";function v(u,h,d){var o=u;function l(){var R=B(u);if(R===null)throw new Error("Malformed timestamp: "+o);return u=u.replace(/^[^\sa-zA-Z-]+/,""),R}function s(R,E){var w=new K;H(R,function(A,C){var T;switch(A){case"region":for(var f=d.length-1;f>=0;f--)if(d[f].id===C){w.set(A,d[f].region);break}break;case"vertical":w.alt(A,C,["rl","lr"]);break;case"line":T=C.split(","),w.integer(A,T[0]),w.percent(A,T[0])&&w.set("snapToLines",!1),w.alt(A,T[0],["auto"]),T.length===2&&w.alt("lineAlign",T[1],["start",L,"end"]);break;case"position":T=C.split(","),w.percent(A,T[0]),T.length===2&&w.alt("positionAlign",T[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":w.percent(A,C);break;case"align":w.alt(A,C,["start",L,"end","left","right"]);break}},/:/,/\s/),E.region=w.get("region",null),E.vertical=w.get("vertical","");var D=w.get("line","auto");D==="auto"&&r.line===-1&&(D=-1),E.line=D,E.lineAlign=w.get("lineAlign","start"),E.snapToLines=w.get("snapToLines",!0),E.size=w.get("size",100),E.align=w.get("align",L);var O=w.get("position","auto");O==="auto"&&r.position===50&&(O=E.align==="start"||E.align==="left"?0:E.align==="end"||E.align==="right"?100:50),E.position=O}function a(){u=u.replace(/^\s+/,"")}if(a(),h.startTime=l(),a(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);u=u.substr(3),a(),h.endTime=l(),a(),s(u,h)}function m(u){return u.replace(/<br(?: \/)?>/gi,`
`)}var p=function(){function u(){this.state="INITIAL",this.buffer="",this.decoder=new j,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var h=u.prototype;return h.parse=function(o){var l=this;o&&(l.buffer+=l.decoder.decode(o,{stream:!0}));function s(){var O=l.buffer,A=0;for(O=m(O);A<O.length&&O[A]!=="\r"&&O[A]!==`
`;)++A;var C=O.substr(0,A);return O[A]==="\r"&&++A,O[A]===`
`&&++A,l.buffer=O.substr(A),C}function a(O){H(O,function(A,C){},/:/)}try{var R="";if(l.state==="INITIAL"){if(!/\r\n|\n/.test(l.buffer))return this;R=s();var E=R.match(/^()?WEBVTT([ \t].*)?$/);if(!E||!E[0])throw new Error("Malformed WebVTT signature.");l.state="HEADER"}for(var w=!1;l.buffer;){if(!/\r\n|\n/.test(l.buffer))return this;w?w=!1:R=s();switch(l.state){case"HEADER":/:/.test(R)?a(R):R||(l.state="ID");continue;case"NOTE":R||(l.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(R)){l.state="NOTE";break}if(!R)continue;if(l.cue=new X.default(0,0,""),l.state="CUE",R.indexOf("-->")===-1){l.cue.id=R;continue}case"CUE":if(!l.cue){l.state="BADCUE";continue}try{v(R,l.cue,l.regionList)}catch(O){l.cue=null,l.state="BADCUE";continue}l.state="CUETEXT";continue;case"CUETEXT":{var D=R.indexOf("-->")!==-1;if(!R||D&&(w=!0)){l.oncue&&l.cue&&l.oncue(l.cue),l.cue=null,l.state="ID";continue}if(l.cue===null)continue;l.cue.text&&(l.cue.text+=`
`),l.cue.text+=R}continue;case"BADCUE":R||(l.state="ID")}}}catch(O){l.state==="CUETEXT"&&l.cue&&l.oncue&&l.oncue(l.cue),l.cue=null,l.state=l.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},h.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(l){o.onparsingerror&&o.onparsingerror(l)}return o.onflush&&o.onflush(),this},u}()},"./src/utils/webvtt-parser.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"generateCueId",function(){return p}),P.d(J,"parseWebVTT",function(){return h});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/vttparser.ts"),B=P("./src/demux/id3.ts"),K=P("./src/utils/timescale-conversion.ts"),H=P("./src/remux/mp4-remuxer.ts"),r=/\r\n|\n\r|\n|\r/g,L=function(o,l,s){return s===void 0&&(s=0),o.substr(s,l.length)===l},v=function(o){var l=parseInt(o.substr(-3)),s=parseInt(o.substr(-6,2)),a=parseInt(o.substr(-9,2)),R=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(l)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(a)||!Object(X.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return l+=1e3*s,l+=60*1e3*a,l+=60*60*1e3*R,l},m=function(o){for(var l=5381,s=o.length;s;)l=l*33^o.charCodeAt(--s);return(l>>>0).toString()};function p(d,o,l){return m(d.toString())+m(o.toString())+m(l)}var u=function(o,l,s){var a=o[l],R=o[a.prevCC];if(!R||!R.new&&a.new){o.ccOffset=o.presentationOffset=a.start,a.new=!1;return}for(;(E=R)!==null&&E!==void 0&&E.new;){var E;o.ccOffset+=a.start-R.start,a.new=!1,a=R,R=o[a.prevCC]}o.presentationOffset=s};function h(d,o,l,s,a,R,E,w){var D=new j.VTTParser,O=Object(B.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(r,`
`).split(`
`),A=[],C=Object(K.toMpegTsClockFromTimescale)(o,l),T="00:00.000",f=0,S=0,y,b=!0,U=!1;D.oncue=function(F){var _=s[a],M=s.ccOffset,I=(f-C)/9e4;if(_!=null&&_.new&&(S!==void 0?M=s.ccOffset=_.start:u(s,a,I)),I&&(M=I-s.presentationOffset),U){var g=F.endTime-F.startTime,W=Object(H.normalizePts)((F.startTime+M-S)*9e4,R*9e4)/9e4;F.startTime=W,F.endTime=W+g}var $=F.text.trim();F.text=decodeURIComponent(encodeURIComponent($)),F.id||(F.id=p(F.startTime,F.endTime,$)),F.endTime>0&&A.push(F)},D.onparsingerror=function(F){y=F},D.onflush=function(){if(y){w(y);return}E(A)},O.forEach(function(F){if(b)if(L(F,"X-TIMESTAMP-MAP=")){b=!1,U=!0,F.substr(16).split(",").forEach(function(_){L(_,"LOCAL:")?T=_.substr(6):L(_,"MPEGTS:")&&(f=parseInt(_.substr(7)))});try{S=v(T)/1e3}catch(_){U=!1,y=_}return}else F===""&&(b=!1);D.parse(F+`
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/utils/logger.ts"),j=P("./src/loader/load-stats.ts"),B=/^age:\s*[\d.]+\s*$/m,K=function(){function H(L){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=L?L.xhrSetup:null,this.stats=new j.LoadStats,this.retryDelay=0}var r=H.prototype;return r.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},r.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},r.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(v,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=v,this.config=m,this.callbacks=p,this.retryDelay=m.retryDelay,this.loadInternal()},r.loadInternal=function(){var v=this.config,m=this.context;if(!v)return;var p=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.loaded=0;var h=this.xhrSetup;try{if(h)try{h(p,m.url)}catch(l){p.open("GET",m.url,!0),h(p,m.url)}p.readyState||p.open("GET",m.url,!0);var d=this.context.headers;if(d)for(var o in d)p.setRequestHeader(o,d[o])}catch(l){this.callbacks.onError({code:p.status,text:l.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),v.timeout),p.send()},r.readystatechange=function(){var v=this.context,m=this.loader,p=this.stats;if(!v||!m)return;var u=m.readyState,h=this.config;if(p.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),u===4){m.onreadystatechange=null,m.onprogress=null;var d=m.status;if(d>=200&&d<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var o,l;if(v.responseType==="arraybuffer"?(o=m.response,l=o.byteLength):(o=m.responseText,l=o.length),p.loaded=p.total=l,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(p,v,o,m),!this.callbacks)return;var a={url:m.responseURL,data:o};this.callbacks.onSuccess(a,p,v,m)}else p.retry>=h.maxRetry||d>=400&&d<499?(X.logger.error(d+" while loading "+v.url),this.callbacks.onError({code:d,text:m.statusText},v,m)):(X.logger.warn(d+" while loading "+v.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,h.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),h.timeout)},r.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(v){var m=this.stats;m.loaded=v.loaded,v.lengthComputable&&(m.total=v.total)},r.getCacheAge=function(){var v=null;if(this.loader&&B.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");v=m?parseFloat(m):null}return v},H}();J.default=K}}).default})},vHTk:function(tt,be,Z){tt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wzkS:function(tt,be,Z){"use strict";Z.d(be,"c",function(){return j}),Z.d(be,"b",function(){return B}),Z.d(be,"d",function(){return K}),Z.d(be,"a",function(){return r}),Z.d(be,"e",function(){return L});var ie=Z("9og8"),J=Z("WmNS"),P=Z.n(J),X=Z("ErOA");function j(v){return Object(X.c)("libraries/".concat(v,".json"))}function B(){return Object(X.c)("library_tags.json")}function K(v){return H.apply(this,arguments)}function H(){return H=Object(ie.a)(P.a.mark(function v(m){var p;return P.a.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,Object(X.b)("attachments/".concat(m,".json"));case 2:return p=h.sent,h.abrupt("return",p.status===0);case 4:case"end":return h.stop()}},v)})),H.apply(this,arguments)}function r(v){return Object(X.f)("libraries.json",v)}function L(v,m){return Object(X.g)("libraries/".concat(v,".json"),m)}},y5JW:function(tt,be,Z){"use strict";Z.d(be,"c",function(){return d}),Z.d(be,"a",function(){return o});var ie=Z("DZo9"),J=Z("8z0m"),P=Z("+L6B"),X=Z("2/Rp"),j=Z("9og8"),B=Z("miYZ"),K=Z("tsqr"),H=Z("k1fw"),r=Z("oBTY"),L=Z("WmNS"),v=Z.n(L),m=Z("q1tI"),p=Z.n(m),u=Z("m3rI"),h=Z("wzkS"),d="\u3000\u3000";function o(l){var s=["Bytes","KB","MB","GB","TB"];if(l==0)return"0 Byte";var a=parseInt(""+Math.floor(Math.log(l)/Math.log(1024)),10);return(l/Math.pow(1024,a)).toFixed(1)+" "+s[a]}be.b=function(l){var s=l.value,a=s===void 0?[]:s,R=l.action,E=l.onChange,w=l.className,D=l.maxSize,O=D===void 0?150:D,A=l.title,C=A===void 0?"\u6587\u4EF6\u4E0A\u4F20":A,T=l.accept,f=T===void 0?null:T,S={multiple:!1,fileList:a,accept:f,withCredentials:!0,beforeUpload:function(U){var F=U.size/1024/1024;return!0},action:"".concat(u.a.API_SERVER,"/api/attachments.json"),onChange:function(U){var F,_,M=Object(r.a)(U.fileList);if(M=M.map(function(W){return W.name.indexOf(d)===-1&&(W.name="".concat(W.name).concat(d).concat(o(W.size))),Object(H.a)({},W)}),U.file.status==="done"&&((F=U.file)===null||F===void 0||((_=F.response)===null||_===void 0)?void 0:_.status)===-1){var I,g;K.b.error((I=U.file)===null||I===void 0||((g=I.response)===null||g===void 0)?void 0:g.message),E([]);return}E(M)},onRemove:function(){var b=Object(j.a)(v.a.mark(function F(_){var M,I,g;return v.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:if(M=_.size/1024/1024,!(_.status==="uploading")){$.next=3;break}return $.abrupt("return",!0);case 3:if(M<O){$.next=7;break}return $.abrupt("return",!0);case 7:if(I=_.response?_.response.id:_.uid,!I){$.next=15;break}return $.next=11,Object(h.d)(_.response?_.response.id:_.id);case 11:return g=$.sent,$.abrupt("return",g);case 15:return $.abrupt("return",!0);case 16:case"end":return $.stop()}},F)}));function U(F){return b.apply(this,arguments)}return U}()};function y(b){b.preventDefault(),b.stopPropagation()}return p.a.createElement("div",{className:"single-upload ".concat(w||"")},p.a.createElement(J.a,S,p.a.createElement(X.a,{type:"primary",title:a.length>0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:a.length>0,ghost:!0},C),p.a.createElement("span",{onClick:y,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",O,"M)"," ")))}}}]);