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__Problemset__NewItem__ind...

446 lines
1.3 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[208,5,6,7,8,21],{"+NIl":function(at,Ee,H){(function(ee){ee(H("VrN/"))})(function(ee){"use strict";ee.defineMode("stex",function(V,N){"use strict";function $(l,a){l.cmdState.push(a)}function j(l){return l.cmdState.length>0?l.cmdState[l.cmdState.length-1]:null}function P(l){var a=l.cmdState.pop();a&&a.closeBracket()}function G(l){for(var a=l.cmdState,f=a.length-1;f>=0;f--){var u=a[f];if(u.name=="DEFAULT")continue;return u}return{styleIdentifier:function(){return null}}}function W(l,a,f){return function(){this.name=l,this.bracketNo=0,this.style=a,this.styles=f,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var n={};n.importmodule=W("importmodule","tag",["string","builtin"]),n.documentclass=W("documentclass","tag",["","atom"]),n.usepackage=W("usepackage","tag",["atom"]),n.begin=W("begin","tag",["atom"]),n.end=W("end","tag",["atom"]),n.label=W("label","tag",["atom"]),n.ref=W("ref","tag",["atom"]),n.eqref=W("eqref","tag",["atom"]),n.cite=W("cite","tag",["atom"]),n.bibitem=W("bibitem","tag",["atom"]),n.Bibitem=W("Bibitem","tag",["atom"]),n.RBibitem=W("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(l,a){l.f=a}function y(l,a){var f;if(l.match(/^\\[a-zA-Z@]+/)){var u=l.current().slice(1);return f=n.hasOwnProperty(u)?n[u]:n.DEFAULT,f=new f,$(a,f),D(a,p),f.style}if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/\\]/))return"tag";if(l.match("\\["))return D(a,function(i,o){return g(i,o,"\\]")}),"keyword";if(l.match("\\("))return D(a,function(i,o){return g(i,o,"\\)")}),"keyword";if(l.match("$$"))return D(a,function(i,o){return g(i,o,"$$")}),"keyword";if(l.match("$"))return D(a,function(i,o){return g(i,o,"$")}),"keyword";var d=l.next();if(d=="%")return l.skipToEnd(),"comment";if(d=="}"||d=="]"){if(f=j(a),f)f.closeBracket(d),D(a,p);else return"error";return"bracket"}else return d=="{"||d=="["?(f=n.DEFAULT,f=new f,$(a,f),"bracket"):/\d/.test(d)?(l.eatWhile(/[\w.%]/),"atom"):(l.eatWhile(/[\w\-_]/),f=G(a),f.name=="begin"&&(f.argument=l.current()),f.styleIdentifier())}function g(l,a,f){if(l.eatSpace())return null;if(f&&l.match(f))return D(a,y),"keyword";if(l.match(/^\\[a-zA-Z@]+/))return"tag";if(l.match(/^[a-zA-Z]+/))return"variable-2";if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/]/))return"tag";if(l.match(/^[\^_&]/))return"tag";if(l.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(l.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var u=l.next();return u=="{"||u=="}"||u=="["||u=="]"||u=="("||u==")"?"bracket":u=="%"?(l.skipToEnd(),"comment"):"error"}function p(l,a){var f=l.peek(),u;return f=="{"||f=="["?(u=j(a),u.openBracket(f),l.eat(f),D(a,y),"bracket"):/[ \t\r]/.test(f)?(l.eat(f),null):(D(a,y),P(a),y(l,a))}return{startState:function(){var l=N.inMathMode?function(a,f){return g(a,f)}:y;return{cmdState:[],f:l}},copyState:function(l){return{cmdState:l.cmdState.slice(),f:l.f}},token:function(l,a){return a.f(l,a)},blankLine:function(l){l.f=y,l.cmdState.length=0},lineComment:"%"}}),ee.defineMIME("text/x-stex","stex"),ee.defineMIME("text/x-latex","stex")})},"+ua5":function(at,Ee,H){},"/cxE":function(at,Ee,H){"use strict";H.d(Ee,"f",function(){return N}),H.d(Ee,"g",function(){return $}),H.d(Ee,"h",function(){return j}),H.d(Ee,"e",function(){return G}),H.d(Ee,"b",function(){return W}),H.d(Ee,"c",function(){return n}),H.d(Ee,"d",function(){return D}),H.d(Ee,"a",function(){return y});class ee{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(g){setTimeout(()=>{throw g.stack?new Error(g.message+`
`+g.stack):g},0)}}emit(g){this.listeners.forEach(p=>{p(g)})}onUnexpectedError(g){this.unexpectedErrorHandler(g),this.emit(g)}onUnexpectedExternalError(g){this.unexpectedErrorHandler(g)}}const V=new ee;function N(g){G(g)||V.onUnexpectedError(g);return}function $(g){G(g)||V.onUnexpectedExternalError(g);return}function j(g){if(g instanceof Error){let{name:p,message:l}=g;const a=g.stacktrace||g.stack;return{$isError:!0,name:p,message:l,stack:a}}return g}const P="Canceled";function G(g){return g instanceof Error&&g.name===P&&g.message===P}function W(){const g=new Error(P);return g.name=g.message,g}function n(g){return g?new Error(`Illegal argument: ${g}`):new Error("Illegal argument")}function D(g){return g?new Error(`Illegal state: ${g}`):new Error("Illegal state")}class y extends Error{constructor(g){super("NotSupported");g&&(this.message=g)}}},"0dNJ":function(at,Ee,H){"use strict";H.r(Ee);var ee=H("g9YV"),V=H("wCAj"),N=H("+L6B"),$=H("2/Rp"),j=H("BoS7"),P=H("Sdc0"),G=H("6UJt"),W=H("DFOY"),n=H("7Kak"),D=H("9yH6"),y=H("sPJy"),g=H("bE4q"),p=H("2qtc"),l=H("kLXV"),a=H("9og8"),f=H("oBTY"),u=H("k1fw"),d=H("miYZ"),i=H("tsqr"),o=H("y8nQ"),O=H("Vl3Y"),w=H("tJVT"),C=H("PpiC"),L=H("OaEy"),A=H("2fM7"),_=H("DZo9"),T=H("8z0m"),v=H("WmNS"),c=H.n(v),E=H("q1tI"),h=H.n(E),x=H("9kvl"),U=H("m3rI"),F=H("yFVG"),S=H.n(F),M=H("5Dmo"),I=H("3S7+"),b=H("Ot1p"),K=H("9Bee"),Q=H("EgHG"),ne=H.n(Q),fe=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],we=function(_e,ye){var ve=_e.problemset,ue=_e.globalSetting,ce=_e.loading,be=_e.dispatch,xe=_e.isEdit,Oe=Object(E.useState)([]),Ue=Object(w.a)(Oe,2),Ke=Ue[0],et=Ue[1],it=Object(E.useState)(),nt=Object(w.a)(it,2),yt=nt[0],bt=nt[1],dt=Object(E.useState)([]),wt=Object(w.a)(dt,2),Tt=wt[0],Ct=wt[1],Nt=Object(E.useState)(""),At=Object(w.a)(Nt,2),It=At[0],gt=At[1],Ye=Object(E.useState)(""),_t=Object(w.a)(Ye,2),$e=_t[0],Je=_t[1];Object(E.useEffect)(function(){et(["","","",""])},[]),Object(E.useEffect)(function(){var Rt,mt,ct,Vt;if(!ve.editData||!xe)return;gt((Rt=ve.editData)===null||Rt===void 0?void 0:Rt.name),Je((mt=ve.editData)===null||mt===void 0?void 0:mt.analysis),et((ct=ve.editData)===null||ct===void 0?void 0:ct.choices.map(function(qt){return qt.choice_text}));var jt=[];(Vt=ve.editData)===null||Vt===void 0||Vt.choices.map(function(qt,Wt){qt.is_answer&&jt.push(Wt)}),Ct(jt)},[ve.editData]),Object(E.useImperativeHandle)(ye,function(){return{onSave:vt,Clear:St}});var vt=function(){if(!It)return i.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var mt=Ke.findIndex(function(Vt){return!Vt});if(mt>-1)return i.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(fe[mt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(!Tt.length)return i.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;var ct=Ke.map(function(Vt,jt){return{choice_text:Vt,is_answer:Tt.includes(jt)?1:0}});return{item_type:Tt.length>1?"MULTIPLE":"SINGLE",name:It,choices:ct,analysis:$e}},St=function(){et(["","","",""]),gt(""),Je(""),Ct([])};return h.a.createElement("section",{className:ne.a.wrap},h.a.createElement("p",{className:ne.a.titleWrap},h.a.createElement("span",{className:ne.a.required},"*"),h.a.createElement("span",{className:ne.a.title},"\u9898\u5E72\uFF1A")),h.a.createElement(b.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:It,onChange:function(mt){return gt(mt)}}),h.a.createElement("p",{className:ne.a.titleWrap},h.a.createElement("span",{className:ne.a.required},"*"),h.a.createElement("span",{className:ne.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",h.a.createElement("span",{className:ne.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Ke.map(function(Rt,mt){return h.a.createElement("div",{className:ne.a.choiceWrap,key:mt},h.a.createElement(I.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},h.a.createElement("div",{className:"".concat(ne.a.answer," ").concat(Tt.includes(mt)?ne.a.activeAnswer:""),onClick:function(){Tt.includes(mt)?Ct(Tt.filter(function(Vt){return Vt!==mt})):Ct([].concat(Object(f.a)(Tt),[mt]))}},fe[mt])),h.a.createElement("div",{className:ne.a.editorWrap},yt===mt?h.a.createElement(b.a,{id:"single-question-option-".concat(mt),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Rt,onChange:function(Vt){Ke[mt]=Vt,et(Ke)}}):h.a.createElement("div",{className:ne.a.htmlWrap,onClick:function(){return bt(mt)}},h.a.createElement(K.a,{value:Rt}))),mt>1&&h.a.createElement(I.a,{title:"\u5220\u9664"},h.a.createElement("i",{className:"".concat(ne.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return et(Ke.filter(function(Vt,jt){return jt!==mt}))}})),mt<7&&mt===Ke.length-1&&h.a.createElement(I.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},h.a.createElement("i",{className:"".concat(ne.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return et([].concat(Object(f.a)(Ke),[""]))}})))}),h.a.createElement("p",{className:ne.a.titleWrap},h.a.createElement("span",{className:ne.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),h.a.createElement(b.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:$e,onChange:function(mt){return Je(mt)}}))},Se=Object(x.a)(function(Fe){var _e=Fe.problemset,ye=Fe.loading,ve=Fe.globalSetting;return{problemset:_e,globalSetting:ve,loading:ye.effects}},null,null,{forwardRef:!0})(Object(E.forwardRef)(we)),he=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],se=function(_e,ye){var ve=_e.problemset,ue=_e.globalSetting,ce=_e.loading,be=_e.dispatch,xe=_e.onRef,Oe=xe===void 0?function(){}:xe,Ue=_e.isEdit,Ke=Object(C.a)(_e,["problemset","globalSetting","loading","dispatch","onRef","isEdit"]),et=Object(E.useState)(),it=Object(w.a)(et,2),nt=it[0],yt=it[1],bt=Object(E.useState)(""),dt=Object(w.a)(bt,2),wt=dt[0],Tt=dt[1],Ct=Object(E.useState)(""),Nt=Object(w.a)(Ct,2),At=Nt[0],It=Nt[1];Object(E.useEffect)(function(){var _t,$e,Je;if(!ve.editData||!Ue)return;Tt((_t=ve.editData)===null||_t===void 0?void 0:_t.name),It(($e=ve.editData)===null||$e===void 0?void 0:$e.analysis);var vt=(Je=ve.editData)===null||Je===void 0?void 0:Je.choices.find(function(St){return St.is_answer});yt(vt.choice_text==="\u6B63\u786E"?"0":"1")},[ve.editData]),Object(E.useImperativeHandle)(ye,function(){return{onSave:gt,Clear:Ye}});var gt=function(){if(!wt)return i.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!nt)return i.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;var $e=[{choice_text:"\u6B63\u786E",is_answer:nt==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:nt==="1"?1:0}];return{name:wt,choices:$e,analysis:At}},Ye=function(){Tt(""),It(""),yt("")};return h.a.createElement("section",{className:ne.a.wrap},h.a.createElement("p",{className:ne.a.titleWrap},h.a.createElement("span",{className:ne.a.required},"*"),h.a.createElement("span",{className:ne.a.title},"\u9898\u5E72\uFF1A")),h.a.createElement(b.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:wt,onChange:function($e){return Tt($e)}}),h.a.createElement("p",{className:ne.a.titleWrap},h.a.createElement("span",{className:ne.a.required},"*"),h.a.createElement("span",{className:ne.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",h.a.createElement("span",{className:ne.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),h.a.createElement(D.a.Group,{buttonStyle:"solid",value:nt,onChange:function($e){return yt($e.target.value)}},h.a.createElement(D.a.Button,{value:"0",className:"".concat(ne.a.radio," mr40")},"\u6B63\u786E"),h.a.createElement(D.a.Button,{value:"1",className:ne.a.radio},"\u9519\u8BEF")),h.a.createElement("p",{className:ne.a.titleWrap},h.a.createElement("span",{className:ne.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),h.a.createElement(b.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:At,onChange:function($e){return It($e)}}))},me=Object(x.a)(function(Fe){var _e=Fe.problemset,ye=Fe.loading,ve=Fe.globalSetting;return{problemset:_e,globalSetting:ve,loading:ye.effects}},null,null,{forwardRef:!0})(Object(E.forwardRef)(se)),re=H("Z9P2"),le=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Z=function(_e,ye){var ve=_e.problemset,ue=_e.globalSetting,ce=_e.loading,be=_e.dispatch,xe=_e.onRef,Oe=xe===void 0?function(){}:xe,Ue=_e.isEdit,Ke=Object(C.a)(_e,["problemset","globalSetting","loading","dispatch","onRef","isEdit"]),et=Object(E.useState)(""),it=Object(w.a)(et,2),nt=it[0],yt=it[1],bt=Object(E.useState)(""),dt=Object(w.a)(bt,2),wt=dt[0],Tt=dt[1],Ct=Object(E.useState)(""),Nt=Object(w.a)(Ct,2),At=Nt[0],It=Nt[1],gt=Object(E.useState)([[],[]]),Ye=Object(w.a)(gt,2),_t=Ye[0],$e=Ye[1];Object(E.useEffect)(function(){var St,Rt,mt,ct,Vt,jt;if(!ve.editData||!Ue)return;yt((St=ve.editData)===null||St===void 0?void 0:St.name),Tt((Rt=ve.editData)===null||Rt===void 0?void 0:Rt.analysis),It((mt=ve.editData)===null||mt===void 0||((ct=mt.answer_texts)===null||ct===void 0)?void 0:ct[0]),$e([(Vt=ve.editData)===null||Vt===void 0?void 0:Vt.normal_keywords,(jt=ve.editData)===null||jt===void 0?void 0:jt.main_keywords])},[ve.editData]),Object(E.useImperativeHandle)(ye,function(){return{onSave:Je,Clear:vt}});var Je=function(){return nt?{name:nt,answer_texts:[At],analysis:wt,normal_keywords:_t[0],main_keywords:_t[1]}:(i.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},vt=function(){yt(""),Tt(""),It(""),$e([[],[]])};return h.a.createElement("section",{className:ne.a.wrap},h.a.createElement("p",{className:ne.a.titleWrap},h.a.createElement("span",{className:ne.a.required},"*"),h.a.createElement("span",{className:ne.a.title},"\u9898\u5E72\uFF1A")),h.a.createElement(b.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:nt,onChange:function(Rt){return yt(Rt)}}),h.a.createElement("p",{className:ne.a.titleWrap},h.a.createElement("span",{className:ne.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),h.a.createElement(b.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:At,onChange:function(Rt){return It(Rt)}}),h.a.createElement(re.a,{value:_t,onChange:$e}),h.a.createElement("p",{className:ne.a.titleWrap},h.a.createElement("span",{className:ne.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),h.a.createElement(b.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:wt,onChange:function(Rt){return Tt(Rt)}}))},ae=Object(x.a)(function(Fe){var _e=Fe.problemset,ye=Fe.loading,ve=Fe.globalSetting;return{problemset:_e,globalSetting:ve,loading:ye.effects}},null,null,{forwardRef:!0})(Object(E.forwardRef)(Z)),oe=H("sRBo"),ge=H("kaz8"),Re=H("kqOp"),Te=H("7qnI"),Me=H("1vsH"),Be=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],pe=function(_e,ye){var ve=_e.problemset,ue=_e.globalSetting,ce=_e.loading,be=_e.dispatch,xe=_e.isEdit,Oe=Object(C.a)(_e,["problemset","globalSetting","loading","dispatch","isEdit"]),Ue=Object(E.useState)(""),Ke=Object(w.a)(Ue,2),et=Ke[0],it=Ke[1],nt=Object(E.useState)(""),yt=Object(w.a)(nt,2),bt=yt[0],dt=yt[1],wt=Object(E.useState)([]),Tt=Object(w.a)(wt,2),Ct=Tt[0],Nt=Tt[1],At=Object(E.useState)(""),It=Object(w.a)(At,2),gt=It[0],Ye=It[1],_t=Object(E.useState)(),$e=Object(w.a)(_t,2),Je=$e[0],vt=$e[1],St=Object(E.useState)(!1),Rt=Object(w.a)(St,2),mt=Rt[0],ct=Rt[1];Object(E.useEffect)(function(){var Qe,ht,Qt;if(!ve.editData||!xe)return;it((Qe=ve.editData)===null||Qe===void 0?void 0:Qe.name),dt((ht=ve.editData)===null||ht===void 0?void 0:ht.analysis),vt((Qt=ve.editData)===null||Qt===void 0?void 0:Qt.is_ordered),ct(!0)},[ve.editData]),Object(E.useEffect)(function(){var Qe;if(!mt)return;var ht=(Qe=ve.editData)===null||Qe===void 0?void 0:Qe.standard_answer.map(function(Qt){return Qt.answer_text});Nt(ht),ct(!1)},[mt]),Object(E.useImperativeHandle)(ye,function(){return{onSave:Vt,Clear:jt}});var Vt=function(){var ht=[],Qt=!1;return Ct.forEach(function(pn,_n){ht.push({position:_n+1,answer_text:[]}),pn.forEach(function(fn,Y){ht[_n].answer_text.push(fn),(!fn||!Object(Me.db)(fn,1e4))&&(Ye("".concat(_n,"-").concat(Y)),i.b.info(fn?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Qt=!0)})}),Qt?!1:(ht==null?void 0:ht.length)>20?(i.b.warn("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:et,analysis:bt,standard_answers:ht,is_ordered:Je}},jt=function(){it(""),dt(""),Nt([]),vt(!1)},qt=function(ht,Qt,pn){var _n=Ct.slice();if(Qt&&_n.splice(ht,Qt),pn)for(var fn=0;fn<pn;fn++)_n.splice(ht+fn,0,[""]);Nt(_n)},Wt=function(ht,Qt,pn){Ye("");var _n=Ct.slice();_n[ht][Qt]=pn,Nt(_n)},rn=function(ht){var Qt=Ct.slice();Qt[ht]=[].concat(Object(f.a)(Qt[ht]),[""]),Nt(Qt)},On=function(ht,Qt){var pn=Ct.slice();if(!pn[ht][Qt]){pn[ht]=pn[ht].filter(function(_n,fn){return fn!==Qt}),Nt(pn);return}l.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:ne.a.modal,onOk:function(){pn[ht]=pn[ht].filter(function(fn,Y){return Y!==Qt}),Nt(pn)}})},Ln=function(ht){l.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:ne.a.modal,onOk:function(){var pn=Ct.slice();pn=Ct.filter(function(_n,fn){return ht!==fn}),Nt(pn)}})};return h.a.createElement("section",{className:ne.a.wrap},h.a.createElement("p",{className:ne.a.titleWrap},h.a.createElement("span",{className:ne.a.required},"*"),h.a.createElement("span",{className:ne.a.title},"\u9898\u5E72\uFF1A")),h.a.createElement("div",null,h.a.createElement(Re.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:et,onChange:function(ht){return it(ht)},showNullButton:!0,onPlaceholderChange:qt})),h.a.createElement("div",{className:"mt20"},Ct.map(function(Qe,ht){return h.a.createElement(Te.a,{key:ht,answers:Qe,index:ht,is_md:!0,activeOptionErrorIndex:gt,onAnswerChange:Wt,addChildAnswer:rn,deleteChildAnswer:On,deleteChildAnswermain:Ln})})),h.a.createElement("div",{className:"mt20"},Ct.length>1&&h.a.createElement("span",null,h.a.createElement(ge.a,{checked:Je,onChange:function(ht){return vt(ht.target.checked)},className:"".concat(ne.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),h.a.createElement("span",{className:"".concat(ne.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),h.a.createElement("p",{className:ne.a.titleWrap},h.a.createElement("span",{className:ne.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),h.a.createElement(b.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:bt,onChange:function(ht){return dt(ht)}}))},Ce=Object(x.a)(function(Fe){var _e=Fe.problemset,ye=Fe.loading,ve=Fe.globalSetting;return{problemset:_e,globalSetting:ve,loading:ye.effects}},null,null,{forwardRef:!0})(Object(E.forwardRef)(pe)),ke=H("LvDl"),Le=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ge=function(_e,ye){var ve=_e.problemset,ue=_e.globalSetting,ce=_e.loading,be=_e.dispatch,xe=_e.onRef,Oe=xe===void 0?function(){}:xe,Ue=_e.isEdit,Ke=Object(C.a)(_e,["problemset","globalSetting","loading","dispatch","onRef","isEdit"]),et=Object(E.useState)(""),it=Object(w.a)(et,2),nt=it[0],yt=it[1],bt=Object(E.useState)([]),dt=Object(w.a)(bt,2),wt=dt[0],Tt=dt[1];Object(E.useEffect)(function(){var gt,Ye,_t;if(!ve.editData||!Ue)return;yt((gt=ve.editData)===null||gt===void 0?void 0:gt.name);var $e=ve==null||((Ye=ve.editData)===null||Ye===void 0||((_t=Ye.sub_item_banks)===null||_t===void 0))?void 0:_t.map(function(Je){var vt,St,Rt;return Object(u.a)(Object(u.a)({},Je),{},{id:Je.id,open:!1,qusList:Je==null||((vt=Je.choices)===null||vt===void 0)?void 0:vt.map(function(mt){return mt.choice_text}),activeQusEditor:null,qusAnswer:(St=[Je==null||((Rt=Je.choices)===null||Rt===void 0)?void 0:Rt.findIndex(function(mt){return mt.is_answer})])===null||St===void 0?void 0:St.filter(function(mt){return mt!==-1})})});Tt($e)},[ve.editData]),Object(E.useImperativeHandle)(ye,function(){return{onSave:Ct,Clear:Nt}});var Ct=function(){if(!nt)return i.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(wt.length===0)return i.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),!1;for(var Ye=0;Ye<wt.length;Ye++){var _t,$e=wt[Ye];if(!($e!=null&&$e.name))return i.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(Ye+1,"\u5C0F\u9898\u9898\u5E72")),!1;var Je=$e==null||((_t=$e.qusList)===null||_t===void 0)?void 0:_t.findIndex(function(St){return!St});if(Je>-1)return i.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Ye+1,"\u5C0F\u9898").concat(Le[Je],"\u9009\u9879\u7684\u5185\u5BB9")),!1;if(!($e!=null&&$e.qusAnswer.length))return i.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Ye+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),!1}var vt=wt.map(function(St){return{id:St.id>1?St.id:null,name:St.name,item_type:St.item_type,analysis:St.analysis,choices:St.qusList.map(function(Rt,mt){return{choice_text:Rt,is_answer:St.qusAnswer[0]===mt?1:0}})}});return{name:nt,sub_item_banks:vt}},Nt=function(){yt(""),Tt([])},At=function(){var Ye={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};Tt(wt.concat(Ye))},It=function(Ye,_t,$e){var Je=Object(ke.cloneDeep)(wt);if(Ye==="open"&&(Je[_t].open=!Je[_t].open),Ye==="delete"&&Je.splice(_t,1),Ye==="value"&&(Je[_t].name=$e),Ye==="answer"&&(Je[_t].qusAnswer=[$e]),Ye==="edit"&&(Je[_t].activeQusEditor=$e),Ye==="details"&&(Je[_t].qusList[Je[_t].activeQusEditor]=$e),Ye==="addQus"&&(Je[_t].qusList=Je[_t].qusList.concat("")),Ye==="deleteQus"){var vt;Je[_t].qusList=Je[_t].qusList.filter(function(St,Rt){return Rt!==$e}),Je[_t].qusAnswer=(vt=Je[_t].qusAnswer)===null||vt===void 0?void 0:vt.filter(function(St){return St!==$e})}Ye==="analysis"&&(Je[_t].analysis=$e),Tt(Je)};return h.a.createElement("section",{className:ne.a.wrap},h.a.createElement("p",{className:ne.a.titleWrap},h.a.createElement("span",{className:ne.a.required},"*"),h.a.createElement("span",{className:ne.a.title},"\u9898\u5E72\uFF1A")),h.a.createElement(b.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:nt,onChange:function(Ye){return yt(Ye)}}),wt==null?void 0:wt.map(function(gt,Ye){var _t;return h.a.createElement("div",{className:ne.a.fold,key:gt.id},h.a.createElement("div",{onClick:function(){return It("open",Ye)},className:ne.a.head},h.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:gt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),h.a.createElement("span",null,"\u7B2C",Ye+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),h.a.createElement("b",{onClick:function(Je){Je.stopPropagation(),It("delete",Ye)},className:"iconfont icon-shanchu8"})),h.a.createElement("div",{className:"mb10",style:{display:gt.open?"block":"none"}},h.a.createElement(b.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:gt==null?void 0:gt.name,onChange:function(Je){return It("value",Ye,Je)}}),h.a.createElement("p",{className:ne.a.titleWrap},h.a.createElement("span",{className:ne.a.required},"*"),h.a.createElement("span",{className:ne.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",h.a.createElement("span",{className:ne.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),gt==null||((_t=gt.qusList)===null||_t===void 0)?void 0:_t.map(function($e,Je){var vt,St;return h.a.createElement("div",{className:ne.a.choiceWrap,key:Je},h.a.createElement(I.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},h.a.createElement("div",{className:"".concat(ne.a.answer," ").concat(gt!=null&&(vt=gt.qusAnswer)!==null&&vt!==void 0&&vt.includes(Je)?ne.a.activeAnswer:""),onClick:function(){return It("answer",Ye,Je)}},Le[Je])),h.a.createElement("div",{className:ne.a.editorWrap},(gt==null?void 0:gt.activeQusEditor)===Je?h.a.createElement(b.a,{id:"single-question-option-".concat(Je),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:$e,onChange:function(mt){return It("details",Ye,mt)}}):h.a.createElement("div",{className:ne.a.htmlWrap,onClick:function(){return It("edit",Ye,Je)}},h.a.createElement(K.a,{value:$e}))),Je>1&&h.a.createElement(I.a,{title:"\u5220\u9664"},h.a.createElement("i",{className:"".concat(ne.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return It("deleteQus",Ye,Je)}})),Je<7&&Je===(gt==null||((St=gt.qusList)===null||St===void 0)?void 0:St.length)-1&&h.a.createElement(I.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},h.a.createElement("i",{className:"".concat(ne.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return It("addQus",Ye)}})))}),h.a.createElement("p",{className:"mb10 mt10"},h.a.createElement("span",{className:ne.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),h.a.createElement(b.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:gt.analysis,onChange:function(Je){return It("analysis",Ye,Je)}})))}),wt.length<20&&h.a.createElement($.a,{type:"primary",onClick:At},h.a.createElement("i",{className:"iconfont icon-tianjiatimu mr5 font14"}),"\u6DFB\u52A0\u5C0F\u9898"))},Ve=Object(x.a)(function(Fe){var _e=Fe.problemset,ye=Fe.loading,ve=Fe.globalSetting;return{problemset:_e,globalSetting:ve,loading:ye.effects}},null,null,{forwardRef:!0})(Object(E.forwardRef)(Ge)),tt=H("ErOA"),rt=H("u2Z1"),ut=H("xvlK"),lt=H("P/tu"),Ne=T.a.Dragger,Pe=A.a.Option,ze=function(_e){return _e==="SINGLE"||_e==="MULTIPLE"?"SELECT":_e},Xe=function(_e){var ye,ve,ue,ce=_e.problemset,be=_e.globalSetting,xe=_e.loading,Oe=_e.dispatch,Ue=Object(C.a)(_e,["problemset","globalSetting","loading","dispatch"]),Ke=O.a.useForm(),et=Object(w.a)(Ke,1),it=et[0],nt=Object(E.useState)({}),yt=Object(w.a)(nt,2),bt=yt[0],dt=yt[1],wt=Object(E.useState)(),Tt=Object(w.a)(wt,2),Ct=Tt[0],Nt=Tt[1],At=Object(E.useState)(!1),It=Object(w.a)(At,2),gt=It[0],Ye=It[1],_t=Object(E.useState)([]),$e=Object(w.a)(_t,2),Je=$e[0],vt=$e[1],St=Object(E.useRef)(),Rt=Object(E.useRef)(),mt=Object(E.useState)([]),ct=Object(w.a)(mt,2),Vt=ct[0],jt=ct[1],qt=Object(E.useState)(1),Wt=Object(w.a)(qt,2),rn=Wt[0],On=Wt[1],Ln=Object(E.useState)([]),Qe=Object(w.a)(Ln,2),ht=Qe[0],Qt=Qe[1],pn=Object(E.useState)(),_n=Object(w.a)(pn,2),fn=_n[0],Y=_n[1],R=Object(E.useState)(!1),k=Object(w.a)(R,2),z=k[0],ie=k[1],J=Object(E.useState)(),De=Object(w.a)(J,2),qe=De[0],ft=De[1];Object(E.useEffect)(function(){return Oe({type:"globalSetting/footerToggle",payload:!1}),function(){Oe({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(E.useEffect)(function(){if(ce!=null&&ce.editData){var Kt;ft(!(ce!=null&&(Kt=ce.editData)!==null&&Kt!==void 0&&Kt.repeat_answer))}},[ce==null?void 0:ce.editData]);var Lt={onRemove:function(){Qt([])},beforeUpload:function(Bt){if(console.log(Bt),(Bt==null?void 0:Bt.size)>1024*1024*50)return i.b.info("\u6587\u4EF6\u8D85\u8FC750M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;var zt=[];return zt.push(Bt),Qt([].concat(zt)),!1},fileList:ht,accept:".xls,.xlsx"};Object(E.useEffect)(function(){return window.addEventListener("beforeunload",st),function(){window.removeEventListener("beforeunload",st)}},[]),Object(E.useEffect)(function(){var Kt,Bt,zt=(Kt=Ue.location.query)===null||Kt===void 0?void 0:Kt.pages;Nt(zt);var $t=(Bt=Ue.match.params)===null||Bt===void 0?void 0:Bt.id;Ye(!!$t),St.current=$t},[]),Object(E.useEffect)(function(){Oe({type:"problemset/getEditDisciplines",payload:{source:"new_question"}}),St.current&&Oe({type:"problemset/getEditData",payload:{id:St.current}})},[]),Object(E.useEffect)(function(){var Kt;it.setFieldsValue({itemType:"SELECT"}),it.setFieldsValue({difficulty:1});var Bt=((Kt=Ue.location.query)===null||Kt===void 0?void 0:Kt.group_id)||0;if(it.setFieldsValue({item_banks_group_id:[Number(Bt)]}),!ce.editData||!St.current)return;var zt=(ce==null?void 0:ce.editData)||{},$t=zt.discipline,Zt=zt.sub_discipline,an=zt.tag_disciplines,bn=zt.item_type,Pn=zt.difficulty,Un=zt.item_banks_group_id;it.setFieldsValue({course:[$t==null?void 0:$t.id,Zt==null?void 0:Zt.id]}),it.setFieldsValue({itemType:ze(bn)}),it.setFieldsValue({difficulty:Pn}),it.setFieldsValue({item_banks_group_id:Un}),it.setFieldsValue({knowledge:an==null?void 0:an.map(function(Cn){return Cn.id})}),dt({course:[$t==null?void 0:$t.id,Zt==null?void 0:Zt.id],itemType:ze(bn),difficulty:Pn,item_banks_group_id:Un,knowledge:an==null?void 0:an.map(function(Cn){return Cn.id})}),Pt($t==null?void 0:$t.id,Zt==null?void 0:Zt.id)},[ce.editData,ce.disciplinesData]);var st=function(Bt){Bt.preventDefault(),Bt.returnValue=""},Pt=function(Bt,zt){var $t,Zt,an,bn,Pn,Un=($t=ce.disciplinesData)===null||$t===void 0||((Zt=$t.disciplines)===null||Zt===void 0||((an=Zt.find(function(Cn){return Cn.id===Bt}))===null||an===void 0||((bn=an.sub_disciplines)===null||bn===void 0||((Pn=bn.find(function(Cn){return Cn.id===zt}))===null||Pn===void 0))))?void 0:Pn.tag_disciplines;er(zt)},Ut=function(Bt){if(Bt!=null&&Bt.course){var zt,$t,Zt,an,bn=Object(w.a)(Bt.course,2),Pn=bn[0],Un=bn[1],Cn=(zt=ce.disciplinesData.disciplines)===null||zt===void 0||(($t=zt.find(function(Bn){return Bn.id===Pn}))===null||$t===void 0||((Zt=$t.sub_disciplines)===null||Zt===void 0||((an=Zt.find(function(Bn){return Bn.id===Un}))===null||an===void 0)))?void 0:an.tag_disciplines;er(Un),it.setFieldsValue({knowledge:[]}),dt(Object(u.a)(Object(u.a)({},it.getFieldsValue()),{},{knowledge:[]}))}else dt(Object(u.a)({},it.getFieldsValue()))},mn=function(Bt){vt([].concat(Object(f.a)(Je),[Object(u.a)({},Bt)]))},Fn=function(){var Kt=Object(a.a)(c.a.mark(function Bt(){var zt,$t,Zt,an,bn,Pn,Un,Cn,Bn,tr,Er,nr,dn,Xt,wn,Yt,sn,on,rr;return c.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:if(zt=bt||{},$t=zt.course,Zt=zt.itemType,an=zt.difficulty,bn=zt.item_banks_group_id,Pn=zt.knowledge,Un=Pn===void 0?[]:Pn,Cn=Object(w.a)($t,2),Bn=Cn[0],tr=Cn[1],!(rn===1)){nn.next=24;break}if(!(Zt==="PROGRAM")){nn.next=7;break}return nr=Un==null?void 0:Un.join(","),Object(Me.S)("/problems/new?difficult=".concat(an,"&sub_discipline_id=").concat(tr,"&newoj=1&pages=").concat(Ct,"&tagIds=").concat(nr,"&banksIds=").concat(bn!=null&&bn[0]?bn==null?void 0:bn[0]:0)),nn.abrupt("return");case 7:if(dn=(Er=Rt.current)===null||Er===void 0?void 0:Er.onSave(),dn){nn.next=10;break}return nn.abrupt("return");case 10:if(Xt=Object(u.a)({discipline_id:Bn,sub_discipline_id:tr,item_banks_group_ids:bn,tag_discipline_ids:Un,item_type:Zt,difficulty:an},dn||{}),console.log(Xt,"postData"),!gt){nn.next=18;break}return nn.next=15,Oe({type:"problemset/editProblemset",payload:Object(u.a)(Object(u.a)({},Xt),{},{repeat_answer:!qe,id:St.current})});case 15:wn=nn.sent,nn.next=21;break;case 18:return nn.next=20,Oe({type:"problemset/addProblemset",payload:Xt});case 20:wn=nn.sent;case 21:wn.status===0&&(gt?x.d.replace("/problemset?group_id=".concat(bn)):l.a.confirm({title:null,icon:null,content:"\u521B\u5EFA\u6210\u529F",okText:"\u7EE7\u7EED\u65B0\u589E",cancelText:"\u8FD4\u56DE\u5217\u8868",onOk:function(){var Qn;(Qn=Rt.current)===null||Qn===void 0||Qn.Clear()},onCancel:function(){x.d.replace("/problemset?group_id=".concat(bn))}})),nn.next=44;break;case 24:if(!((ht==null?void 0:ht.length)<=0)){nn.next=27;break}return i.b.info("\u8BF7\u4E0A\u4F20\u8BD5\u9898\u6587\u4EF6"),nn.abrupt("return");case 27:return ie(!0),Yt=new FormData,Yt.append("file",ht[0]),Yt.append("sub_discipline_id",tr),nn.next=33,Object(tt.a)("/api/item_banks/file_import.json",{method:"post",body:Yt},!0);case 33:if(sn=nn.sent,ie(!1),!((sn==null?void 0:sn.status)===0)){nn.next=44;break}if(!((sn==null||((on=sn.fail)===null||on===void 0)?void 0:on.length)>0)){nn.next=40;break}return Y(sn==null?void 0:sn.fail),i.b.error("\u4E0A\u4F20\u5931\u8D25\u9898\u6570\u4E3A"+(sn==null||((rr=sn.fail)===null||rr===void 0)?void 0:rr.length)+"\uFF0C\u53EF\u5728\u5E95\u90E8\u8BD5\u9898\u5217\u8868\u67E5\u770B\u9519\u8BEF\u539F\u56E0\u3002"),nn.abrupt("return");case 40:it.setFieldsValue({course:[]}),Qt([]),Y([]),i.b.info("\u4E0A\u4F20\u6210\u529F");case 44:case"end":return nn.stop()}},Bt)}));return function(){return Kt.apply(this,arguments)}}();Object(E.useEffect)(function(){function Kt(){return Bt.apply(this,arguments)}function Bt(){return Bt=Object(a.a)(c.a.mark(function zt(){var $t;return c.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return an.next=2,Object(tt.c)("item_banks_groups/mine.json");case 2:$t=an.sent,jt($t);case 4:case"end":return an.stop()}},zt)})),Bt.apply(this,arguments)}Kt()},[]);var kn=function(){var Bt=bt||{itemType:"SELECT"},zt=Bt.itemType,$t={SELECT:h.a.createElement(Se,{ref:Rt,isEdit:gt}),JUDGMENT:h.a.createElement(me,{ref:Rt,isEdit:gt}),COMPLETION:h.a.createElement(Ce,{ref:Rt,isEdit:gt}),SUBJECTIVE:h.a.createElement(ae,{ref:Rt,isEdit:gt}),COMBINATION:h.a.createElement(Ve,{ref:Rt,isEdit:gt})};return $t[zt||"SELECT"]},Tn=function(Bt){var zt=Object(w.a)(Bt,2),$t=zt[0],Zt=zt[1]},er=function(){var Kt=Object(a.a)(c.a.mark(function Bt(zt){var $t;return c.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return an.next=2,Oe({type:"exercise/getTagDiscipline",payload:{sub_discipline_id:zt}});case 2:$t=an.sent,vt($t.tag_disciplines);case 4:case"end":return an.stop()}},Bt)}));return function(zt){return Kt.apply(this,arguments)}}(),_r=[{title:"\u9898\u76EE\u540D\u79F0",dataIndex:"name",key:"name"},{title:"\u9519\u8BEF\u539F\u56E0",dataIndex:"message",key:"message"}];return h.a.createElement("section",{className:S.a.bg},h.a.createElement(g.a,{className:"mb20 mt30",separator:">"},h.a.createElement(g.a.Item,{href:"/problemset"},"\u8BD5\u9898\u5E93"),h.a.createElement(g.a.Item,null,gt?"\u7F16\u8F91":"\u65B0\u589E","\u8BD5\u9898")),h.a.createElement("div",{className:S.a.main},h.a.createElement("span",{style:{fontSize:"18px"}},"\u6DFB\u52A0\u7C7B\u578B"),h.a.createElement("br",null),h.a.createElement(D.a.Group,{style:{marginTop:"5px"},onChange:function(Bt){On(Bt.target.value),it.setFieldsValue({course:[]}),Qt([]),Y([])},value:rn},h.a.createElement(D.a,{value:1},"\u5355\u4E2A\u6DFB\u52A0"),h.a.createElement(D.a,{value:2},"\u6279\u91CF\u5BFC\u5165")),rn===1&&h.a.createElement(O.a,{form:it,style:{marginTop:"10px"},className:S.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:Ut,onFinish:Fn},h.a.createElement(O.a.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B\uFF1A",name:"course",labelCol:{span:5},wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},h.a.createElement(W.a,{placeholder:"\u8BF7\u9009\u62E9...",allowClear:!1,options:ce.courseOptions,onChange:Tn})),h.a.createElement(O.a.Item,{label:h.a.createElement("span",null,"\u77E5\u8BC6\u70B9\uFF1A",h.a.createElement("span",{className:"c-grey-999"},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),name:"knowledge"},h.a.createElement(rt.a,{selectvalues:bt==null?void 0:bt.knowledge,subId:(ye=bt.course)===null||ye===void 0?void 0:ye[1],knowledgeOptions:Je,onAddKnowledgeFinish:mn})),h.a.createElement(O.a.Item,{label:"\u52A0\u5165\u6587\u4EF6\u5939\u76EE\u5F55",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6587\u4EF6\u5939"}],initialValue:[0],name:"item_banks_group_id",labelCol:{span:24},wrapperCol:{span:24}},h.a.createElement(lt.a,null)),h.a.createElement(O.a.Item,{label:"\u9898\u578B\uFF1A",name:"itemType",wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u9898\u578B"}]},h.a.createElement(A.a,{placeholder:"\u8BF7\u9009\u62E9...",disabled:gt},h.a.createElement(Pe,{value:"SELECT"},"\u9009\u62E9\u9898"),h.a.createElement(Pe,{value:"PROGRAM"},"\u7F16\u7A0B\u9898"),h.a.createElement(Pe,{value:"JUDGMENT"},"\u5224\u65AD\u9898"),h.a.createElement(Pe,{value:"COMPLETION"},"\u586B\u7A7A\u9898"),h.a.createElement(Pe,{value:"SUBJECTIVE"},"\u7B80\u7B54\u9898"),h.a.createElement(Pe,{value:"COMBINATION"},"\u7EC4\u5408\u9898"))),h.a.createElement(O.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},h.a.createElement(D.a.Group,null,h.a.createElement(D.a.Button,{value:1},"\u7B80\u5355"),h.a.createElement(D.a.Button,{value:2},"\u9002\u4E2D"),h.a.createElement(D.a.Button,{value:3},"\u56F0\u96BE"))),gt&&(ce==null||((ve=ce.editData)===null||ve===void 0)?void 0:ve.item_type)!="PROGRAM"&&(ce==null||((ue=ce.editData)===null||ue===void 0)?void 0:ue.item_type)!="COMBINATION"&&h.a.createElement("div",null,h.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),h.a.createElement(P.a,{checked:qe,onChange:function(Bt){ft(Bt)}}))),rn===2&&h.a.createElement("div",null,h.a.createElement(O.a,{form:it,style:{marginTop:"20px"},className:S.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:Ut,onFinish:Fn},h.a.createElement(O.a.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B\uFF1A",name:"course",labelCol:{span:5},wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},h.a.createElement(W.a,{placeholder:"\u8BF7\u9009\u62E9...",allowClear:!1,options:ce.courseOptions,onChange:Tn})),h.a.createElement("span",null,"\u4E0B\u8F7DExcel\u683C\u5F0F"," ",h.a.createElement("a",{onClick:Object(a.a)(c.a.mark(function Kt(){return c.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:Object(Me.v)("",Object(Me.Y)({url:U.a.API_SERVER+"/api/item_banks/down_template",query:{}}));case 1:case"end":return zt.stop()}},Kt)}))},"\u8BD5\u9898\u6A21\u677F"),", \u6BCF\u6B21\u6700\u591A\u5BFC\u5165300\u9898\u3002"),h.a.createElement("br",null),h.a.createElement(T.a,Lt,h.a.createElement($.a,{className:S.a.upload,style:{marginTop:"20px"},type:"primary",icon:h.a.createElement(ut.a,null)},"\u9009\u62E9\u6587\u4EF6"))),h.a.createElement("br",null),(fn==null?void 0:fn.length)>0&&h.a.createElement("span",{style:{fontSize:"18px",display:"flex",width:"100%",justifyContent:"center"}},"\u9519\u8BEF\u5217\u8868"),(fn==null?void 0:fn.length)>0&&h.a.createElement(V.a,{style:{marginTop:"10px"},dataSource:fn,columns:_r}))),rn===1&&h.a.createElement("div",{className:S.a.topicWrap},kn()),h.a.createElement("div",{className:S.a.buttonFixed},h.a.createElement("div",{className:S.a.buttonWrap},h.a.createElement($.a,{size:"large",className:"".concat(S.a.button," mr20"),onClick:function(){return x.d.push("/problemset")}},"\u53D6\u6D88"),h.a.createElement($.a,{size:"large",type:"primary",className:"".concat(S.a.button," mr20"),onClick:function(){return it.submit()},loading:xe["problemset/editProblemset"]||xe["problemset/addProblemset"]||z},bt.itemType==="PROGRAM"?"\u521B\u5EFA":"\u4FDD\u5B58"))))},je=Ee.default=Object(x.a)(function(Fe){var _e=Fe.problemset,ye=Fe.loading,ve=Fe.globalSetting;return{problemset:_e,globalSetting:ve,loading:ye.effects}})(Xe)},"19Vz":function(at,Ee,H){(function(ee){ee(H("VrN/"))})(function(ee){ee.defineOption("placeholder","",function(W,n,D){var y=D&&D!=ee.Init;if(n&&!y)W.on("blur",j),W.on("change",P),W.on("swapDoc",P),ee.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){$(W)}),P(W);else if(!n&&y){W.off("blur",j),W.off("change",P),W.off("swapDoc",P),ee.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),V(W);var g=W.getWrapperElement();g.className=g.className.replace(" CodeMirror-empty","")}n&&!W.hasFocus()&&j(W)});function V(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function N(W){V(W);var n=W.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=W.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var D=W.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),n.appendChild(D),W.display.lineSpace.insertBefore(n,W.display.lineSpace.firstChild)}function $(W){setTimeout(function(){var n=!1,D=W.getInputField();D.nodeName=="TEXTAREA"?n=!D.value:W.lineCount()==1&&(n=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),n?N(W):V(W)},20)}function j(W){G(W)&&N(W)}function P(W){var n=W.getWrapperElement(),D=G(W);n.className=n.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?N(W):V(W)}function G(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(at,Ee,H){(function(ee){ee(H("VrN/"))})(function(ee){"use strict";var V={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},N={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ee.defineMode("xml",function($,j){var P=$.indentUnit,G={},W=j.htmlMode?V:N;for(var n in W)G[n]=W[n];for(var n in j)G[n]=j[n];var D,y;function g(c,E){function h(F){return E.tokenize=F,F(c,E)}var x=c.next();if(x=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?h(a("atom","]]>")):null:c.match("--")?h(a("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),h(f(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),E.tokenize=a("meta","?>"),"meta"):(D=c.eat("/")?"closeTag":"openTag",E.tokenize=p,"tag bracket");if(x=="&"){var U;return c.eat("#")?c.eat("x")?U=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):U=c.eatWhile(/[\d]/)&&c.eat(";"):U=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),U?"atom":"error"}else return c.eatWhile(/[^&<]/),null}g.isInText=!0;function p(c,E){var h=c.next();if(h==">"||h=="/"&&c.eat(">"))return E.tokenize=g,D=h==">"?"endTag":"selfcloseTag","tag bracket";if(h=="=")return D="equals",null;if(h=="<"){E.tokenize=g,E.state=o,E.tagName=E.tagStart=null;var x=E.tokenize(c,E);return x?x+" tag error":"tag error"}else return/[\'\"]/.test(h)?(E.tokenize=l(h),E.stringStartCol=c.column(),E.tokenize(c,E)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(c){var E=function(h,x){for(;!h.eol();)if(h.next()==c){x.tokenize=p;break}return"string"};return E.isInAttribute=!0,E}function a(c,E){return function(h,x){for(;!h.eol();){if(h.match(E)){x.tokenize=g;break}h.next()}return c}}function f(c){return function(E,h){for(var x;(x=E.next())!=null;){if(x=="<")return h.tokenize=f(c+1),h.tokenize(E,h);if(x==">")if(c==1){h.tokenize=g;break}else return h.tokenize=f(c-1),h.tokenize(E,h)}return"meta"}}function u(c,E,h){this.prev=c.context,this.tagName=E,this.indent=c.indented,this.startOfLine=h,(G.doNotIndent.hasOwnProperty(E)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function d(c){c.context&&(c.context=c.context.prev)}function i(c,E){for(var h;;){if(!c.context)return;if(h=c.context.tagName,!G.contextGrabbers.hasOwnProperty(h)||!G.contextGrabbers[h].hasOwnProperty(E))return;d(c)}}function o(c,E,h){return c=="openTag"?(h.tagStart=E.column(),O):c=="closeTag"?w:o}function O(c,E,h){return c=="word"?(h.tagName=E.current(),y="tag",A):G.allowMissingTagName&&c=="endTag"?(y="tag bracket",A(c,E,h)):(y="error",O)}function w(c,E,h){if(c=="word"){var x=E.current();return h.context&&h.context.tagName!=x&&G.implicitlyClosed.hasOwnProperty(h.context.tagName)&&d(h),h.context&&h.context.tagName==x||G.matchClosing===!1?(y="tag",C):(y="tag error",L)}else return G.allowMissingTagName&&c=="endTag"?(y="tag bracket",C(c,E,h)):(y="error",L)}function C(c,E,h){return c!="endTag"?(y="error",C):(d(h),o)}function L(c,E,h){return y="error",C(c,E,h)}function A(c,E,h){if(c=="word")return y="attribute",_;if(c=="endTag"||c=="selfcloseTag"){var x=h.tagName,U=h.tagStart;return h.tagName=h.tagStart=null,c=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(x)?i(h,x):(i(h,x),h.context=new u(h,x,U==h.indented)),o}return y="error",A}function _(c,E,h){return c=="equals"?T:(G.allowMissing||(y="error"),A(c,E,h))}function T(c,E,h){return c=="string"?v:c=="word"&&G.allowUnquoted?(y="string",A):(y="error",A(c,E,h))}function v(c,E,h){return c=="string"?v:A(c,E,h)}return{startState:function(c){var E={tokenize:g,state:o,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(E.baseIndent=c),E},token:function(c,E){if(!E.tagName&&c.sol()&&(E.indented=c.indentation()),c.eatSpace())return null;D=null;var h=E.tokenize(c,E);return(h||D)&&h!="comment"&&(y=null,E.state=E.state(D||h,c,E),y&&(h=y=="error"?h+" error":y)),h},indent:function(c,E,h){var x=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+P;if(x&&x.noIndent)return ee.Pass;if(c.tokenize!=p&&c.tokenize!=g)return h?h.match(/^(\s*)/)[0].length:0;if(c.tagName)return G.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+P*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(E))return 0;var U=E&&/^<(\/)?([\w_:\.-]*)/.exec(E);if(U&&U[1])for(;x;)if(x.tagName==U[2]){x=x.prev;break}else if(G.implicitlyClosed.hasOwnProperty(x.tagName))x=x.prev;else break;else if(U)for(;x;){var F=G.contextGrabbers[x.tagName];if(F&&F.hasOwnProperty(U[2]))x=x.prev;else break}for(;x&&x.prev&&!x.startOfLine;)x=x.prev;return x?x.indent+P:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(c){c.state==T&&(c.state=A)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var E=[],h=c.context;h;h=h.prev)h.tagName&&E.push(h.tagName);return E.reverse()}}}),ee.defineMIME("text/xml","xml"),ee.defineMIME("application/xml","xml"),ee.mimeModes.hasOwnProperty("text/html")||ee.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return V});class ee{constructor(N){this.element=N,this.next=ee.Undefined,this.prev=ee.Undefined}}ee.Undefined=new ee(void 0);class V{constructor(){this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ee.Undefined}clear(){let N=this._first;for(;N!==ee.Undefined;){const $=N.next;N.prev=ee.Undefined,N.next=ee.Undefined,N=$}this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}unshift(N){return this._insert(N,!1)}push(N){return this._insert(N,!0)}_insert(N,$){const j=new ee(N);if(this._first===ee.Undefined)this._first=j,this._last=j;else if($){const G=this._last;this._last=j,j.prev=G,G.next=j}else{const G=this._first;this._first=j,j.next=G,G.prev=j}this._size+=1;let P=!1;return()=>{P||(P=!0,this._remove(j))}}shift(){if(this._first===ee.Undefined)return;{const N=this._first.element;return this._remove(this._first),N}}pop(){if(this._last===ee.Undefined)return;{const N=this._last.element;return this._remove(this._last),N}}_remove(N){if(N.prev!==ee.Undefined&&N.next!==ee.Undefined){const $=N.prev;$.next=N.next,N.next.prev=$}else N.prev===ee.Undefined&&N.next===ee.Undefined?(this._first=ee.Undefined,this._last=ee.Undefined):N.next===ee.Undefined?(this._last=this._last.prev,this._last.next=ee.Undefined):N.prev===ee.Undefined&&(this._first=this._first.next,this._first.prev=ee.Undefined);this._size-=1}*[Symbol.iterator](){let N=this._first;for(;N!==ee.Undefined;)yield N.element,N=N.next}}},"3/fG":function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return V});function ee(N,$){let j;return $.length===0?j=N:j=N.replace(/\{(\d+)\}/g,function(P,G){const W=G[0];return typeof $[W]!="undefined"?$[W]:P}),j}function V(N,$,...j){return ee($,j)}},"5VLF":function(at,Ee,H){"use strict";var ee,V;function N($,j,P){var G=function(W,n){return $.js_beautify(W,n)};return G.js=$.js_beautify,G.css=j.css_beautify,G.html=P.html_beautify,G.js_beautify=$.js_beautify,G.css_beautify=j.css_beautify,G.html_beautify=P.html_beautify,G}!(ee=[H("6UM0"),H("TXwP"),H("psGv")],V=function($,j,P){return N($,j,P)}.apply(Ee,ee),V!==void 0&&(at.exports=V))},"5Y4S":function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return N});var ee=H("MNsG");const V=ee.b.performance&&typeof ee.b.performance.now=="function";class N{constructor($){this._highResolution=V&&$,this._startTime=this._now(),this._stopTime=-1}static create($=!0){return new N($)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ee.b.performance.now():Date.now()}}},"6+eU":function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return C});var ee=H("wx14"),V=H("rePB"),N=H("VTBJ"),$=H("1OyB"),j=H("vuIU"),P=H("Ji7U"),G=H("LK+K"),W=H("q1tI"),n=H.n(W),D=H("TSYQ"),y=H.n(D),g=function(A){var _,T="".concat(A.rootPrefixCls,"-item"),v=y()(T,"".concat(T,"-").concat(A.page),(_={},Object(V.a)(_,"".concat(T,"-active"),A.active),Object(V.a)(_,A.className,!!A.className),Object(V.a)(_,"".concat(T,"-disabled"),!A.page),_)),c=function(){A.onClick(A.page)},E=function(x){A.onKeyPress(x,A.onClick,A.page)};return n.a.createElement("li",{title:A.showTitle?A.page:null,className:v,onClick:c,onKeyPress:E,tabIndex:"0"},A.itemRender(A.page,"page",n.a.createElement("a",{rel:"nofollow"},A.page)))},p=g,l={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},a=function(L){Object(P.a)(_,L);var A=Object(G.a)(_);function _(){var T;Object($.a)(this,_);for(var v=arguments.length,c=new Array(v),E=0;E<v;E++)c[E]=arguments[E];return T=A.call.apply(A,[this].concat(c)),T.state={goInputText:""},T.buildOptionText=function(h){return"".concat(h," ").concat(T.props.locale.items_per_page)},T.changeSize=function(h){T.props.changeSize(Number(h))},T.handleChange=function(h){T.setState({goInputText:h.target.value})},T.handleBlur=function(h){var x=T.props,U=x.goButton,F=x.quickGo,S=x.rootPrefixCls,M=T.state.goInputText;if(U||M==="")return;if(h.relatedTarget&&(h.relatedTarget.className.indexOf("".concat(S,"-prev"))>=0||h.relatedTarget.className.indexOf("".concat(S,"-next"))>=0))return;T.setState({goInputText:""}),F(T.getValidValue())},T.go=function(h){var x=T.state.goInputText;if(x==="")return;(h.keyCode===l.ENTER||h.type==="click")&&(T.setState({goInputText:""}),T.props.quickGo(T.getValidValue()))},T}return Object(j.a)(_,[{key:"getValidValue",value:function(){var v=this.state,c=v.goInputText,E=v.current;return!c||isNaN(c)?E:Number(c)}},{key:"getPageSizeOptions",value:function(){var v=this.props,c=v.pageSize,E=v.pageSizeOptions;return E.some(function(h){return h.toString()===c.toString()})?E:E.concat([c.toString()]).sort(function(h,x){var U=isNaN(Number(h))?0:Number(h),F=isNaN(Number(x))?0:Number(x);return U-F})}},{key:"render",value:function(){var v=this,c=this.props,E=c.pageSize,h=c.locale,x=c.rootPrefixCls,U=c.changeSize,F=c.quickGo,S=c.goButton,M=c.selectComponentClass,I=c.buildOptionText,b=c.selectPrefixCls,K=c.disabled,Q=this.state.goInputText,ne="".concat(x,"-options"),fe=M,we=null,Se=null,he=null;if(!U&&!F)return null;var se=this.getPageSizeOptions();if(U&&fe){var me=se.map(function(re,le){return n.a.createElement(fe.Option,{key:le,value:re.toString()},(I||v.buildOptionText)(re))});we=n.a.createElement(fe,{disabled:K,prefixCls:b,showSearch:!1,className:"".concat(ne,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(E||se[0]).toString(),onChange:this.changeSize,getPopupContainer:function(le){return le.parentNode}},me)}return F&&(S&&(he=typeof S=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:K,className:"".concat(ne,"-quick-jumper-button")},h.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},S)),Se=n.a.createElement("div",{className:"".concat(ne,"-quick-jumper")},h.jump_to,n.a.createElement("input",{disabled:K,type:"text",value:Q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),h.page,he)),n.a.createElement("li",{className:"".concat(ne)},we,Se)}}]),_}(n.a.Component);a.defaultProps={pageSizeOptions:["10","20","50","100"]};var f=a,u=H("N2Kk");function d(){}function i(L){return typeof L=="number"&&isFinite(L)&&Math.floor(L)===L}function o(L,A,_){return _}function O(L,A,_){var T=typeof L=="undefined"?A.pageSize:L;return Math.floor((_.total-1)/T)+1}var w=function(L){Object(P.a)(_,L);var A=Object(G.a)(_);function _(T){var v;Object($.a)(this,_),v=A.call(this,T),v.getJumpPrevPage=function(){return Math.max(1,v.state.current-(v.props.showLessItems?3:5))},v.getJumpNextPage=function(){return Math.min(O(void 0,v.state,v.props),v.state.current+(v.props.showLessItems?3:5))},v.getItemIcon=function(U,F){var S=v.props.prefixCls,M=U||n.a.createElement("button",{type:"button","aria-label":F,className:"".concat(S,"-item-link")});return typeof U=="function"&&(M=n.a.createElement(U,Object(N.a)({},v.props))),M},v.savePaginationNode=function(U){v.paginationNode=U},v.isValid=function(U){return i(U)&&U!==v.state.current},v.shouldDisplayQuickJumper=function(){var U=v.props,F=U.showQuickJumper,S=U.pageSize,M=U.total;return M<=S?!1:F},v.handleKeyDown=function(U){(U.keyCode===l.ARROW_UP||U.keyCode===l.ARROW_DOWN)&&U.preventDefault()},v.handleKeyUp=function(U){var F=v.getValidValue(U),S=v.state.currentInputValue;F!==S&&v.setState({currentInputValue:F}),U.keyCode===l.ENTER?v.handleChange(F):U.keyCode===l.ARROW_UP?v.handleChange(F-1):U.keyCode===l.ARROW_DOWN&&v.handleChange(F+1)},v.changePageSize=function(U){var F=v.state.current,S=O(U,v.state,v.props);F=F>S?S:F,S===0&&(F=v.state.current),typeof U=="number"&&("pageSize"in v.props||v.setState({pageSize:U}),"current"in v.props||v.setState({current:F,currentInputValue:F})),v.props.onShowSizeChange(F,U),"onChange"in v.props&&v.props.onChange&&v.props.onChange(F,U)},v.handleChange=function(U){var F=v.props.disabled,S=U;if(v.isValid(S)&&!F){var M=O(void 0,v.state,v.props);S>M?S=M:S<1&&(S=1),"current"in v.props||v.setState({current:S,currentInputValue:S});var I=v.state.pageSize;return v.props.onChange(S,I),S}return v.state.current},v.prev=function(){v.hasPrev()&&v.handleChange(v.state.current-1)},v.next=function(){v.hasNext()&&v.handleChange(v.state.current+1)},v.jumpPrev=function(){v.handleChange(v.getJumpPrevPage())},v.jumpNext=function(){v.handleChange(v.getJumpNextPage())},v.hasPrev=function(){return v.state.current>1},v.hasNext=function(){return v.state.current<O(void 0,v.state,v.props)},v.runIfEnter=function(U,F){if(U.key==="Enter"||U.charCode===13){for(var S=arguments.length,M=new Array(S>2?S-2:0),I=2;I<S;I++)M[I-2]=arguments[I];F.apply(void 0,M)}},v.runIfEnterPrev=function(U){v.runIfEnter(U,v.prev)},v.runIfEnterNext=function(U){v.runIfEnter(U,v.next)},v.runIfEnterJumpPrev=function(U){v.runIfEnter(U,v.jumpPrev)},v.runIfEnterJumpNext=function(U){v.runIfEnter(U,v.jumpNext)},v.handleGoTO=function(U){(U.keyCode===l.ENTER||U.type==="click")&&v.handleChange(v.state.currentInputValue)};var c=T.onChange!==d,E="current"in T;E&&!c&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var h=T.defaultCurrent;"current"in T&&(h=T.current);var x=T.defaultPageSize;return"pageSize"in T&&(x=T.pageSize),h=Math.min(h,O(x,void 0,T)),v.state={current:h,currentInputValue:h,pageSize:x},v}return Object(j.a)(_,[{key:"componentDidUpdate",value:function(v,c){var E=this.props.prefixCls;if(c.current!==this.state.current&&this.paginationNode){var h=this.paginationNode.querySelector(".".concat(E,"-item-").concat(c.current));h&&document.activeElement===h&&h.blur()}}},{key:"getValidValue",value:function(v){var c=v.target.value,E=O(void 0,this.state,this.props),h=this.state.currentInputValue,x;return c===""?x=c:isNaN(Number(c))?x=h:c>=E?x=E:x=Number(c),x}},{key:"getShowSizeChanger",value:function(){var v=this.props,c=v.showSizeChanger,E=v.total,h=v.totalBoundaryShowSizeChanger;return typeof c!="undefined"?c:E>h}},{key:"renderPrev",value:function(v){var c=this.props,E=c.prevIcon,h=c.itemRender,x=h(v,"prev",this.getItemIcon(E,"prev page")),U=!this.hasPrev();return Object(W.isValidElement)(x)?Object(W.cloneElement)(x,{disabled:U}):x}},{key:"renderNext",value:function(v){var c=this.props,E=c.nextIcon,h=c.itemRender,x=h(v,"next",this.getItemIcon(E,"next page")),U=!this.hasNext();return Object(W.isValidElement)(x)?Object(W.cloneElement)(x,{disabled:U}):x}},{key:"render",value:function(){var v=this,c=this.props,E=c.prefixCls,h=c.className,x=c.style,U=c.disabled,F=c.hideOnSinglePage,S=c.total,M=c.locale,I=c.showQuickJumper,b=c.showLessItems,K=c.showTitle,Q=c.showTotal,ne=c.simple,fe=c.itemRender,we=c.showPrevNextJumpers,Se=c.jumpPrevIcon,he=c.jumpNextIcon,se=c.selectComponentClass,me=c.selectPrefixCls,re=c.pageSizeOptions,le=this.state,Z=le.current,ae=le.pageSize,oe=le.currentInputValue;if(F===!0&&S<=ae)return null;var ge=O(void 0,this.state,this.props),Re=[],Te=null,Me=null,Be=null,pe=null,Ce=null,ke=I&&I.goButton,Le=b?1:2,Ge=Z-1>0?Z-1:0,Ve=Z+1<ge?Z+1:ge,tt=Object.keys(this.props).reduce(function(ue,ce){return(ce.substr(0,5)==="data-"||ce.substr(0,5)==="aria-"||ce==="role")&&(ue[ce]=v.props[ce]),ue},{});if(ne)return ke&&(typeof ke=="boolean"?Ce=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},M.jump_to_confirm):Ce=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ke),Ce=n.a.createElement("li",{title:K?"".concat(M.jump_to).concat(Z,"/").concat(ge):null,className:"".concat(E,"-simple-pager")},Ce)),n.a.createElement("ul",Object(ee.a)({className:y()(E,"".concat(E,"-simple"),Object(V.a)({},"".concat(E,"-disabled"),U),h),style:x,ref:this.savePaginationNode},tt),n.a.createElement("li",{title:K?M.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:y()("".concat(E,"-prev"),Object(V.a)({},"".concat(E,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Ge)),n.a.createElement("li",{title:K?"".concat(Z,"/").concat(ge):null,className:"".concat(E,"-simple-pager")},n.a.createElement("input",{type:"text",value:oe,disabled:U,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),n.a.createElement("span",{className:"".concat(E,"-slash")},"/"),ge),n.a.createElement("li",{title:K?M.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:y()("".concat(E,"-next"),Object(V.a)({},"".concat(E,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Ve)),Ce);if(ge<=3+Le*2){var rt={locale:M,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:K,itemRender:fe};ge||Re.push(n.a.createElement(p,Object(ee.a)({},rt,{key:"noPager",page:ge,className:"".concat(E,"-disabled")})));for(var ut=1;ut<=ge;ut+=1){var lt=Z===ut;Re.push(n.a.createElement(p,Object(ee.a)({},rt,{key:ut,page:ut,active:lt})))}}else{var Ne=b?M.prev_3:M.prev_5,Pe=b?M.next_3:M.next_5;we&&(Te=n.a.createElement("li",{title:K?Ne:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:y()("".concat(E,"-jump-prev"),Object(V.a)({},"".concat(E,"-jump-prev-custom-icon"),!!Se))},fe(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Se,"prev page"))),Me=n.a.createElement("li",{title:K?Pe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:y()("".concat(E,"-jump-next"),Object(V.a)({},"".concat(E,"-jump-next-custom-icon"),!!he))},fe(this.getJumpNextPage(),"jump-next",this.getItemIcon(he,"next page")))),pe=n.a.createElement(p,{locale:M,last:!0,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ge,page:ge,active:!1,showTitle:K,itemRender:fe}),Be=n.a.createElement(p,{locale:M,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:K,itemRender:fe});var ze=Math.max(1,Z-Le),Xe=Math.min(Z+Le,ge);Z-1<=Le&&(Xe=1+Le*2),ge-Z<=Le&&(ze=ge-Le*2);for(var je=ze;je<=Xe;je+=1){var Fe=Z===je;Re.push(n.a.createElement(p,{locale:M,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:je,page:je,active:Fe,showTitle:K,itemRender:fe}))}Z-1>=Le*2&&Z!==1+2&&(Re[0]=Object(W.cloneElement)(Re[0],{className:"".concat(E,"-item-after-jump-prev")}),Re.unshift(Te)),ge-Z>=Le*2&&Z!==ge-2&&(Re[Re.length-1]=Object(W.cloneElement)(Re[Re.length-1],{className:"".concat(E,"-item-before-jump-next")}),Re.push(Me)),ze!==1&&Re.unshift(Be),Xe!==ge&&Re.push(pe)}var _e=null;Q&&(_e=n.a.createElement("li",{className:"".concat(E,"-total-text")},Q(S,[S===0?0:(Z-1)*ae+1,Z*ae>S?S:Z*ae])));var ye=!this.hasPrev()||!ge,ve=!this.hasNext()||!ge;return n.a.createElement("ul",Object(ee.a)({className:y()(E,h,Object(V.a)({},"".concat(E,"-disabled"),U)),style:x,unselectable:"unselectable",ref:this.savePaginationNode},tt),_e,n.a.createElement("li",{title:K?M.prev_page:null,onClick:this.prev,tabIndex:ye?null:0,onKeyPress:this.runIfEnterPrev,className:y()("".concat(E,"-prev"),Object(V.a)({},"".concat(E,"-disabled"),ye)),"aria-disabled":ye},this.renderPrev(Ge)),Re,n.a.createElement("li",{title:K?M.next_page:null,onClick:this.next,tabIndex:ve?null:0,onKeyPress:this.runIfEnterNext,className:y()("".concat(E,"-next"),Object(V.a)({},"".concat(E,"-disabled"),ve)),"aria-disabled":ve},this.renderNext(Ve)),n.a.createElement(f,{disabled:U,locale:M,rootPrefixCls:E,selectComponentClass:se,selectPrefixCls:me,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Z,pageSize:ae,pageSizeOptions:re,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ke}))}}],[{key:"getDerivedStateFromProps",value:function(v,c){var E={};if("current"in v&&(E.current=v.current,v.current!==c.current&&(E.currentInputValue=E.current)),"pageSize"in v&&v.pageSize!==c.pageSize){var h=c.current,x=O(v.pageSize,c,v);h=h>x?x:h,"current"in v||(E.current=h,E.currentInputValue=h),E.pageSize=v.pageSize}return E}}]),_}(n.a.Component);w.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:d,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:d,locale:u.a,style:{},itemRender:o,totalBoundaryShowSizeChanger:50};var C=w},"6RRn":function(at,Ee,H){"use strict";var ee=H("wCXF"),V=H("n6Qo");H.d(Ee,"b",function(){return V.a});var N=H("IBYe"),$=H("6eGT"),j=H("hW8S");H.d(Ee,"a",function(){return j.a}),Ee.c=ee.b},"6UM0":function(at,Ee,H){var ee,V;(function(){var N;(function(){"use strict";var j=[function(n,D,y){var g=y(1).Beautifier,p=y(5).Options;function l(a,f){var u=new g(a,f);return u.beautify()}n.exports=l,n.exports.defaultOptions=function(){return new p}},function(n,D,y){var g=y(2).Output,p=y(3).Token,l=y(4),a=y(5).Options,f=y(7).Tokenizer,u=y(7).line_starters,d=y(7).positionable_operators,i=y(7).TOKEN;function o(b,K){return K.indexOf(b)!==-1}function O(b){return b.replace(/^\s+/g,"")}function w(b){for(var K={},Q=0;Q<b.length;Q++)K[b[Q].replace(/-/g,"_")]=b[Q];return K}function C(b,K){return b&&b.type===i.RESERVED&&b.text===K}function L(b,K){return b&&b.type===i.RESERVED&&o(b.text,K)}var A=["case","return","do","if","throw","else","await","break","continue","async"],_=["before-newline","after-newline","preserve-newline"],T=w(_),v=[T.before_newline,T.preserve_newline],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function E(b,K){if(K.multiline_frame||K.mode===c.ForInitializer||K.mode===c.Conditional)return;b.remove_indent(K.start_line_index)}function h(b){b=b.replace(l.allLineBreaks,`
`);for(var K=[],Q=b.indexOf(`
`);Q!==-1;)K.push(b.substring(0,Q)),b=b.substring(Q+1),Q=b.indexOf(`
`);return b.length&&K.push(b),K}function x(b){return b===c.ArrayLiteral}function U(b){return o(b,[c.Expression,c.ForInitializer,c.Conditional])}function F(b,K){for(var Q=0;Q<b.length;Q++){var ne=b[Q].trim();if(ne.charAt(0)!==K)return!1}return!0}function S(b,K){for(var Q=0,ne=b.length,fe;Q<ne;Q++)if(fe=b[Q],fe&&fe.indexOf(K)!==0)return!1;return!0}function M(b,K){K=K||{},this._source_text=b||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new a(K)}M.prototype.create_flags=function(b,K){var Q=0;b&&(Q=b.indentation_level,!this._output.just_added_newline()&&b.line_indent_level>Q&&(Q=b.line_indent_level));var ne={mode:K,parent:b,last_token:b?b.last_token:new p(i.START_BLOCK,""),last_word:b?b.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:Q,alignment:0,line_indent_level:b?b.line_indent_level:Q,start_line_index:this._output.get_line_number(),ternary_depth:0};return ne},M.prototype._reset=function(b){var K=b.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new g(this._options,K),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var Q=new f(b,this._options);return this._tokens=Q.tokenize(),b},M.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var b,K=this._reset(this._source_text),Q=this._options.eol;this._options.eol==="auto"&&(Q=`
`,K&&l.lineBreak.test(K||"")&&(Q=K.match(l.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 b=this._output.get_code(Q),b},M.prototype.handle_token=function(b,K){b.type===i.START_EXPR?this.handle_start_expr(b):b.type===i.END_EXPR?this.handle_end_expr(b):b.type===i.START_BLOCK?this.handle_start_block(b):b.type===i.END_BLOCK?this.handle_end_block(b):b.type===i.WORD?this.handle_word(b):b.type===i.RESERVED?this.handle_word(b):b.type===i.SEMICOLON?this.handle_semicolon(b):b.type===i.STRING?this.handle_string(b):b.type===i.EQUALS?this.handle_equals(b):b.type===i.OPERATOR?this.handle_operator(b):b.type===i.COMMA?this.handle_comma(b):b.type===i.BLOCK_COMMENT?this.handle_block_comment(b,K):b.type===i.COMMENT?this.handle_comment(b,K):b.type===i.DOT?this.handle_dot(b):b.type===i.EOF?this.handle_eof(b):b.type===i.UNKNOWN?this.handle_unknown(b,K):this.handle_unknown(b,K)},M.prototype.handle_whitespace_and_comments=function(b,K){var Q=b.newlines,ne=this._options.keep_array_indentation&&x(this._flags.mode);if(b.comments_before)for(var fe=b.comments_before.next();fe;)this.handle_whitespace_and_comments(fe,K),this.handle_token(fe,K),fe=b.comments_before.next();if(ne)for(var we=0;we<Q;we+=1)this.print_newline(we>0,K);else if(this._options.max_preserve_newlines&&Q>this._options.max_preserve_newlines&&(Q=this._options.max_preserve_newlines),this._options.preserve_newlines&&Q>1){this.print_newline(!1,K);for(var Se=1;Se<Q;Se+=1)this.print_newline(!0,K)}};var I=["async","break","continue","return","throw","yield"];M.prototype.allow_wrap_or_preserved_newline=function(b,K){if(K=K===void 0?!1:K,this._output.just_added_newline())return;var Q=this._options.preserve_newlines&&b.newlines||K,ne=o(this._flags.last_token.text,d)||o(b.text,d);if(ne){var fe=o(this._flags.last_token.text,d)&&o(this._options.operator_position,v)||o(b.text,d);Q=Q&&fe}if(Q)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(L(this._flags.last_token,I))return;this._output.set_wrap_point()}},M.prototype.print_newline=function(b,K){if(!K&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Q=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&C(Q,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(b)&&(this._flags.multiline_frame=!0)},M.prototype.print_token_line_indentation=function(b){this._output.just_added_newline()&&(this._options.keep_array_indentation&&b.newlines&&(b.text==="["||x(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(b.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},M.prototype.print_token=function(b){if(this._output.raw){this._output.add_raw_token(b);return}if(this._options.comma_first&&b.previous&&b.previous.type===i.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var K=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(K),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(b),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(b),this._output.non_breaking_space=!0,this._output.add_token(b.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},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(b){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,b),this._flags=this.create_flags(this._previous_flags,b),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},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===c.Statement&&E(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===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"]))},M.prototype.start_of_statement=function(b){var K=!1;return K=K||L(this._flags.last_token,["var","let","const"])&&b.type===i.WORD,K=K||C(this._flags.last_token,"do"),K=K||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&L(this._flags.last_token,I)&&!b.newlines,K=K||C(this._flags.last_token,"else")&&!(C(b,"if")&&!b.comments_before),K=K||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),K=K||this._flags.last_token.type===i.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(b.text==="--"||b.text==="++")&&this._last_last_text!=="function"&&b.type!==i.WORD&&b.type!==i.RESERVED,K=K||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"])),K?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(b,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b,L(b,["do","for","if","while"])),!0):!1},M.prototype.handle_start_expr=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b);var K=c.Expression;if(b.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){L(this._flags.last_token,u)&&(this._output.space_before_token=!0),this.print_token(b),this.set_mode(K),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}K=c.ArrayLiteral,x(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())),o(this._flags.last_token.type,[i.START_EXPR,i.END_EXPR,i.WORD,i.OPERATOR,i.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===i.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,K=c.ForInitializer):o(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,K=c.Conditional):o(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&b.whitespace_before===""?this._output.space_before_token=!1:(o(this._flags.last_token.text,u)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var Q=this._tokens.peek(-3);if(this._options.space_after_named_function&&Q){var ne=this._tokens.peek(-4);L(Q,["async","function"])||Q.text==="*"&&L(ne,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(Q.text==="{"||Q.text===","||Q.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(b);(this._flags.last_token.type===i.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&o(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===i.START_BLOCK?this.print_newline():(this._flags.last_token.type===i.END_EXPR||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===i.COMMA)&&this.allow_wrap_or_preserved_newline(b,b.newlines),this.print_token(b),this.set_mode(K),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},M.prototype.handle_end_expr=function(b){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(b,b.text==="]"&&x(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===i.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(b),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},M.prototype.handle_start_block=function(b){this.handle_whitespace_and_comments(b);var K=this._tokens.peek(),Q=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):Q&&(o(Q.text,[":",","])&&o(K.type,[i.STRING,i.WORD,i.RESERVED])||o(K.text,["get","set","..."])&&o(Q.type,[i.WORD,i.RESERVED]))?o(this._last_last_text,["class","interface"])&&!o(Q.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):o(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||L(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(L(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ne=!K.comments_before&&K.text==="}",fe=ne&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var we=0,Se=null;this._flags.inline_frame=!0;do if(we+=1,Se=this._tokens.peek(we-1),Se.newlines){this._flags.inline_frame=!1;break}while(Se.type!==i.EOF&&!(Se.type===i.END_BLOCK&&Se.opened===b))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(fe||this._flags.last_token.type===i.EQUALS||L(this._flags.last_token,A)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(x(this._previous_flags.mode)&&(this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.COMMA)&&((this._flags.last_token.type===i.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(b),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==i.OPERATOR&&this._flags.last_token.type!==i.START_EXPR&&(this._flags.last_token.type===i.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(b),this.indent(),!ne&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},M.prototype.handle_end_block=function(b){for(this.handle_whitespace_and_comments(b);this._flags.mode===c.Statement;)this.restore_mode();var K=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!K?this._output.space_before_token=!0:this._options.brace_style==="expand"?K||this.print_newline():K||(x(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(b)},M.prototype.handle_word=function(b){if(b.type===i.RESERVED){if(o(b.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)b.type=i.WORD;else if(b.text==="import"&&o(this._tokens.peek().text,["(","."]))b.type=i.WORD;else if(o(b.text,["as","from"])&&!this._flags.import_block)b.type=i.WORD;else if(this._flags.mode===c.ObjectLiteral){var K=this._tokens.peek();K.text===":"&&(b.type=i.WORD)}}if(this.start_of_statement(b)?L(this._flags.last_token,["var","let","const"])&&b.type===i.WORD&&(this._flags.declaration_statement=!0):b.newlines&&!U(this._flags.mode)&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==i.EQUALS&&(this._options.preserve_newlines||!L(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(b),this.print_newline()):this.handle_whitespace_and_comments(b),this._flags.do_block&&!this._flags.do_while)if(C(b,"while")){this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&C(b,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&L(b,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(b),this._flags.in_case=!0;return}if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b)),C(b,"function")){(o(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(o(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===i.OPERATOR))&&(!this._output.just_added_blankline()&&!b.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?L(this._flags.last_token,["get","set","new","export"])||L(this._flags.last_token,I)?this._output.space_before_token=!0:C(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===i.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(U(this._flags.mode)||x(this._flags.mode))||this.print_newline(),this.print_token(b),this._flags.last_word=b.text;return}var Q="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?Q="SPACE":L(b,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines?Q="NEWLINE":(Q="SPACE",this._output.space_before_token=!0):Q="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===c.BlockStatement?Q="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&U(this._flags.mode)?Q="SPACE":this._flags.last_token.type===i.STRING?Q="NEWLINE":this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&o(this._last_last_text,["{",","]))?Q="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?Q="SPACE":Q="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,Q="NEWLINE"),L(b,u)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Q="SPACE":Q="NEWLINE"),L(b,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ne=this._output.current_line;ne.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Q==="NEWLINE"?L(this._flags.last_token,A)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&L(b,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==i.END_EXPR?(this._flags.last_token.type!==i.START_EXPR||!L(b,["var","let","const"]))&&this._flags.last_token.text!==":"&&(C(b,"if")&&C(b.previous,"else")?this._output.space_before_token=!0:this.print_newline()):L(b,u)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&x(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Q==="SPACE"&&(this._output.space_before_token=!0);b.previous&&(b.previous.type===i.WORD||b.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(b),this._flags.last_word=b.text,b.type===i.RESERVED&&(b.text==="do"?this._flags.do_block=!0:b.text==="if"?this._flags.if_block=!0:b.text==="import"?this._flags.import_block=!0:this._flags.import_block&&C(b,"from")&&(this._flags.import_block=!1))},M.prototype.handle_semicolon=function(b){this.start_of_statement(b)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(b);for(var K=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&C(K,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(b)},M.prototype.handle_string=function(b){b.text.startsWith("`")&&b.newlines===0&&b.whitespace_before===""&&(b.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(b)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(b),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b):b.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(b.previous.text==="]"||b.previous.text===")")&&b.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(b)},M.prototype.handle_equals=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0},M.prototype.handle_comma=function(b){this.handle_whitespace_and_comments(b,!0),this.print_token(b),this._output.space_before_token=!0,this._flags.declaration_statement?(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(b)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(b)},M.prototype.handle_operator=function(b){var K=b.text==="*"&&(L(this._flags.last_token,["function","yield"])||o(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),Q=o(b.text,["-","+"])&&(o(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||o(this._flags.last_token.text,u)||this._flags.last_token.text===",");if(!this.start_of_statement(b)){var ne=!K;this.handle_whitespace_and_comments(b,ne)}if(b.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(b);return}if(b.text==="::"){this.print_token(b);return}if(this._flags.last_token.type===i.OPERATOR&&o(this._options.operator_position,v)&&this.allow_wrap_or_preserved_newline(b),b.text===":"&&this._flags.in_case){this.print_token(b),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==i.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 fe=!0,we=!0,Se=!1;if(b.text===":"?this._flags.ternary_depth===0?fe=!1:(this._flags.ternary_depth-=1,Se=!0):b.text==="?"&&(this._flags.ternary_depth+=1),!Q&&!K&&this._options.preserve_newlines&&o(b.text,d)){var he=b.text===":",se=he&&Se,me=he&&!Se;switch(this._options.operator_position){case T.before_newline:this._output.space_before_token=!me,this.print_token(b),(!he||se)&&this.allow_wrap_or_preserved_newline(b),this._output.space_before_token=!0;return;case T.after_newline:this._output.space_before_token=!0,!he||se?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(b):this._output.space_before_token=!1,this.print_token(b),this._output.space_before_token=!0;return;case T.preserve_newline:me||this.allow_wrap_or_preserved_newline(b),fe=!(this._output.just_added_newline()||me),this._output.space_before_token=fe,this.print_token(b),this._output.space_before_token=!0;return}}if(K){this.allow_wrap_or_preserved_newline(b),fe=!1;var re=this._tokens.peek();we=re&&o(re.type,[i.WORD,i.RESERVED])}else if(b.text==="...")this.allow_wrap_or_preserved_newline(b),fe=this._flags.last_token.type===i.START_BLOCK,we=!1;else if(o(b.text,["--","++","!","~"])||Q){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(b),fe=!1,we=!1,b.newlines&&(b.text==="--"||b.text==="++"||b.text==="~")){var le=L(this._flags.last_token,A)&&b.newlines;le&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(le,!0)}this._flags.last_token.text===";"&&U(this._flags.mode)&&(fe=!0),this._flags.last_token.type===i.RESERVED?fe=!0:this._flags.last_token.type===i.END_EXPR?fe=!(this._flags.last_token.text==="]"&&(b.text==="--"||b.text==="++")):this._flags.last_token.type===i.OPERATOR&&(fe=o(b.text,["--","-","++","+"])&&o(this._flags.last_token.text,["--","-","++","+"]),o(b.text,["+","-"])&&o(this._flags.last_token.text,["--","++"])&&(we=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||fe,this.print_token(b),this._output.space_before_token=we},M.prototype.handle_block_comment=function(b,K){if(this._output.raw){this._output.add_raw_token(b),b.directives&&b.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(b.directives){this.print_newline(!1,K),this.print_token(b),b.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!l.newline.test(b.text)&&!b.newlines){this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0;return}else this.print_block_commment(b,K)},M.prototype.print_block_commment=function(b,K){var Q=h(b.text),ne,fe=!1,we=!1,Se=b.whitespace_before,he=Se.length;if(this.print_newline(!1,K),this.print_token_line_indentation(b),this._output.add_token(Q[0]),this.print_newline(!1,K),Q.length>1){for(Q=Q.slice(1),fe=F(Q,"*"),we=S(Q,Se),fe&&(this._flags.alignment=1),ne=0;ne<Q.length;ne++)fe?(this.print_token_line_indentation(b),this._output.add_token(O(Q[ne]))):we&&Q[ne]?(this.print_token_line_indentation(b),this._output.add_token(Q[ne].substring(he))):(this._output.current_line.set_indent(-1),this._output.add_token(Q[ne])),this.print_newline(!1,K);this._flags.alignment=0}},M.prototype.handle_comment=function(b,K){b.newlines?this.print_newline(!1,K):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(b),this.print_newline(!1,K)},M.prototype.handle_dot=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),L(this._flags.last_token,A)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(b,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(b)},M.prototype.handle_unknown=function(b,K){this.print_token(b),b.text[b.text.length-1]===`
`&&this.print_newline(!1,K)},M.prototype.handle_eof=function(b){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b)},n.exports.Beautifier=M},function(n){function D(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var p=new D(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},D.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},D.prototype.has_match=function(p){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(p))return!0;return!1},D.prototype.set_indent=function(p,l){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(p){this.__items.push(p);var l=p.lastIndexOf(`
`);l!==-1?this.__character_count=p.length-l:this.__character_count+=p.length},D.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function y(p,l){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),l=l||"",p.indent_level>0&&(l=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}y.prototype.get_indent_size=function(p,l){var a=this.__base_string_length;return l=l||0,p<0&&(a=0),a+=p*this.__indent_size,a+=l,a},y.prototype.get_indent_string=function(p,l){var a=this.__base_string;return l=l||0,p<0&&(p=0,a=""),l+=p*this.__indent_size,this.__ensure_cache(l),a+=this.__cache[l],a},y.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var p=this.__cache.length,l=0,a="";this.__indent_size&&p>=this.__indent_size&&(l=Math.floor(p/this.__indent_size),p-=l*this.__indent_size,a=new Array(l+1).join(this.__indent_string)),p&&(a+=new Array(p+1).join(" ")),this.__cache.push(a)};function g(p,l){this.__indent_cache=new y(p,l),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(p,l){return this.__indent_cache.get_indent_string(p,l)},g.prototype.get_indent_size=function(p,l){return this.__indent_cache.get_indent_size(p,l)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(p){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return p!==`
`&&(a=a.replace(/[\n]/g,p)),a},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(p,l){return p=p||0,l=l||0,this.next_line.set_indent(p,l),this.__lines.length>1?(this.current_line.set_indent(p,l),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(p){for(var l=0;l<p.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.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()},g.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(" "))},g.prototype.remove_indent=function(p){for(var l=this.__lines.length;p<l;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},g.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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(p,l){for(var a=this.__lines.length-2;a>=0;){var f=this.__lines[a];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==l){this.__lines.splice(a+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},n.exports.Output=g},function(n){function D(y,g,p,l){this.type=y,this.text=g,this.comments_before=null,this.newlines=p||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=D},function(n,D){var y="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",g="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",l="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",a="(?:\\\\u[0-9a-fA-F]{4}|["+y+p+"])",f="(?:\\\\u[0-9a-fA-F]{4}|["+g+p+l+"])*";D.identifier=new RegExp(a+f,"g"),D.identifierStart=new RegExp(a),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+g+p+l+"])+");var u=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(n,D,y){var g=y(6).Options,p=["before-newline","after-newline","preserve-newline"];function l(a){g.call(this,a,"js");var f=this.raw_options.brace_style||null;f==="expand-strict"?this.raw_options.brace_style="expand":f==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var u=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var d=0;d<u.length;d++)u[d]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=u[d];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}l.prototype=new g,n.exports.Options=l},function(n){function D(p,l){this.raw_options=y(p,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}D.prototype._get_array=function(p,l){var a=this.raw_options[p],f=l||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(f=a.concat()):typeof a=="string"&&(f=a.split(/[^a-zA-Z0-9_\/\-]+/)),f},D.prototype._get_boolean=function(p,l){var a=this.raw_options[p],f=a===void 0?!!l:!!a;return f},D.prototype._get_characters=function(p,l){var a=this.raw_options[p],f=l||"";return typeof a=="string"&&(f=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),f},D.prototype._get_number=function(p,l){var a=this.raw_options[p];l=parseInt(l,10),isNaN(l)&&(l=0);var f=parseInt(a,10);return isNaN(f)&&(f=l),f},D.prototype._get_selection=function(p,l,a){var f=this._get_selection_list(p,l,a);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[p]+"'");return f[0]},D.prototype._get_selection_list=function(p,l,a){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[l[0]],!this._is_valid_selection(a,l))throw new Error("Invalid Default Value!");var f=this._get_array(p,a);if(!this._is_valid_selection(f,l))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[p]+"'");return f},D.prototype._is_valid_selection=function(p,l){return p.length&&l.length&&!p.some(function(a){return l.indexOf(a)===-1})};function y(p,l){var a={};p=g(p);var f;for(f in p)f!==l&&(a[f]=p[f]);if(l&&p[l])for(f in p[l])a[f]=p[l][f];return a}function g(p){var l={},a;for(a in p){var f=a.replace(/-/g,"_");l[f]=p[a]}return l}n.exports.Options=D,n.exports.normalizeOpts=g,n.exports.mergeOpts=y},function(n,D,y){var g=y(8).InputScanner,p=y(9).Tokenizer,l=y(9).TOKEN,a=y(13).Directives,f=y(4),u=y(12).Pattern,d=y(14).TemplatablePattern;function i(F,S){return S.indexOf(F)!==-1}var o={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:l.START,RAW:l.RAW,EOF:l.EOF},O=new a(/\/\*/,/\*\//),w=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,C=/[0-9]/,L=/[^\d\.]/,A=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),_="\\?\\.(?!\\d) "+_,_=_.replace(/ /g,"|");var T=new RegExp(_),v="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=v.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+c.join("|")+")$"),h,x=function(F,S){p.call(this,F,S),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var M=new u(this._input),I=new d(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(f.identifier).matching(f.identifierMatch),number:M.matching(w),punct:M.matching(T),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(f.lineBreak),shebang:M.starting_with(/#!/).until_after(f.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(/[`}\\]/)}};x.prototype=new p,x.prototype._is_comment=function(F){return F.type===o.COMMENT||F.type===o.BLOCK_COMMENT||F.type===o.UNKNOWN},x.prototype._is_opening=function(F){return F.type===o.START_BLOCK||F.type===o.START_EXPR},x.prototype._is_closing=function(F,S){return(F.type===o.END_BLOCK||F.type===o.END_EXPR)&&S&&(F.text==="]"&&S.text==="["||F.text===")"&&S.text==="("||F.text==="}"&&S.text==="{")},x.prototype._reset=function(){h=!1},x.prototype._get_next_token=function(F,S){var M=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(o.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(o.UNKNOWN,this._input.next()),M)},x.prototype._read_word=function(F){var S;if(S=this.__patterns.identifier.read(),S!=="")return S=S.replace(f.allLineBreaks,`
`),!(F.type===o.DOT||F.type===o.RESERVED&&(F.text==="set"||F.text==="get"))&&E.test(S)?(S==="in"||S==="of")&&(F.type===o.WORD||F.type===o.STRING)?this._create_token(o.OPERATOR,S):this._create_token(o.RESERVED,S):this._create_token(o.WORD,S);if(S=this.__patterns.number.read(),S!=="")return this._create_token(o.WORD,S)},x.prototype._read_singles=function(F){var S=null;return F==="("||F==="["?S=this._create_token(o.START_EXPR,F):F===")"||F==="]"?S=this._create_token(o.END_EXPR,F):F==="{"?S=this._create_token(o.START_BLOCK,F):F==="}"?S=this._create_token(o.END_BLOCK,F):F===";"?S=this._create_token(o.SEMICOLON,F):F==="."&&L.test(this._input.peek(1))?S=this._create_token(o.DOT,F):F===","&&(S=this._create_token(o.COMMA,F)),S&&this._input.next(),S},x.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(o.EQUALS,F):F==="?."?this._create_token(o.DOT,F):this._create_token(o.OPERATOR,F)},x.prototype._read_non_javascript=function(F){var S="";if(F==="#"){if(this._is_first_token()&&(S=this.__patterns.shebang.read(),S))return this._create_token(o.UNKNOWN,S.trim()+`
`);if(S=this.__patterns.include.read(),S)return this._create_token(o.UNKNOWN,S.trim()+`
`);F=this._input.next();var M="#";if(this._input.hasNext()&&this._input.testChar(C)){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(o.WORD,M)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(S=this.__patterns.html_comment_start.read(),S){for(;this._input.hasNext()&&!this._input.testChar(f.newline);)S+=this._input.next();return h=!0,this._create_token(o.COMMENT,S)}}else if(h&&F==="-"&&(S=this.__patterns.html_comment_end.read(),S))return h=!1,this._create_token(o.COMMENT,S);return null},x.prototype._read_comment=function(F){var S=null;if(F==="/"){var M="";if(this._input.peek(1)==="*"){M=this.__patterns.block_comment.read();var I=O.get_directives(M);I&&I.ignore==="start"&&(M+=O.readIgnored(this._input)),M=M.replace(f.allLineBreaks,`
`),S=this._create_token(o.BLOCK_COMMENT,M),S.directives=I}else this._input.peek(1)==="/"&&(M=this.__patterns.comment.read(),S=this._create_token(o.COMMENT,M))}return S},x.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var S=this._input.next();return this.has_char_escapes=!1,F==="`"?S+=this._read_string_recursive("`",!0,"${"):S+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(S=U(S)),this._input.peek()===F&&(S+=this._input.next()),S=S.replace(f.allLineBreaks,`
`),this._create_token(o.STRING,S)}return null},x.prototype._allow_regexp_or_xml=function(F){return F.type===o.RESERVED&&i(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===o.END_EXPR&&F.text===")"&&F.opened.previous.type===o.RESERVED&&i(F.opened.previous.text,["if","while","for"])||i(F.type,[o.COMMENT,o.START_EXPR,o.START_BLOCK,o.START,o.END_BLOCK,o.OPERATOR,o.EQUALS,o.EOF,o.SEMICOLON,o.COMMA])},x.prototype._read_regexp=function(F,S){if(F==="/"&&this._allow_regexp_or_xml(S)){for(var M=this._input.next(),I=!1,b=!1;this._input.hasNext()&&(I||b||this._input.peek()!==F)&&!this._input.testChar(f.newline);)M+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?b=!0:this._input.peek()==="]"&&(b=!1)),this._input.next();return this._input.peek()===F&&(M+=this._input.next(),M+=this._input.read(f.identifier)),this._create_token(o.STRING,M)}return null},x.prototype._read_xml=function(F,S){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(S)){var M="",I=this.__patterns.xml.read_match();if(I){for(var b=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),K=b.indexOf("{")===0,Q=0;I;){var ne=!!I[1],fe=I[2],we=!!I[I.length-1]||fe.slice(0,8)==="![CDATA[";if(!we&&(fe===b||K&&fe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ne?--Q:++Q),M+=I[0],Q<=0)break;I=this.__patterns.xml.read_match()}return I||(M+=this._input.match(/[\s\S]*/g)[0]),M=M.replace(f.allLineBreaks,`
`),this._create_token(o.STRING,M)}}return null};function U(F){for(var S="",M=0,I=new g(F),b=null;I.hasNext();)if(b=I.match(/([\s]|[^\\]|\\\\)+/g),b&&(S+=b[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")b=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")b=I.match(/u([0-9A-Fa-f]{4})/g);else{S+="\\",I.hasNext()&&(S+=I.next());continue}if(!b)return F;if(M=parseInt(b[1],16),M>126&&M<=255&&b[0].indexOf("x")===0)return F;if(M>=0&&M<32){S+="\\"+b[0];continue}else M===34||M===39||M===92?S+="\\"+String.fromCharCode(M):S+=String.fromCharCode(M)}return S}x.prototype._read_string_recursive=function(F,S,M){var I,b;F==="'"?b=this.__patterns.single_quote:F==='"'?b=this.__patterns.double_quote:F==="`"?b=this.__patterns.template_text:F==="}"&&(b=this.__patterns.template_expression);for(var K=b.read(),Q="";this._input.hasNext();){if(Q=this._input.next(),Q===F||!S&&f.newline.test(Q)){this._input.back();break}else Q==="\\"&&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(),Q+=this._input.next()):M&&(M==="${"&&Q==="$"&&this._input.peek()==="{"&&(Q+=this._input.next()),M===Q&&(F==="`"?Q+=this._read_string_recursive("}",S,"`"):Q+=this._read_string_recursive("`",S,"${"),this._input.hasNext()&&(Q+=this._input.next())));Q+=b.read(),K+=Q}return K},n.exports.Tokenizer=x,n.exports.TOKEN=o,n.exports.positionable_operators=A.slice(),n.exports.line_starters=v.slice()},function(n){var D=RegExp.prototype.hasOwnProperty("sticky");function y(g){this.__input=g||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},y.prototype.peek=function(g){var p=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(p=this.__input.charAt(g)),p},y.prototype.__match=function(g,p){g.lastIndex=p;var l=g.exec(this.__input);return l&&!(D&&g.sticky)&&(l.index!==p&&(l=null)),l},y.prototype.test=function(g,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(g,p):!1},y.prototype.testChar=function(g,p){var l=this.peek(p);return g.lastIndex=0,l!==null&&g.test(l)},y.prototype.match=function(g){var p=this.__match(g,this.__position);return p?this.__position+=p[0].length:p=null,p},y.prototype.read=function(g,p,l){var a="",f;return g&&(f=this.match(g),f&&(a+=f[0])),p&&(f||!g)&&(a+=this.readUntil(p,l)),a},y.prototype.readUntil=function(g,p){var l="",a=this.__position;g.lastIndex=this.__position;var f=g.exec(this.__input);return f?(a=f.index,p&&(a+=f[0].length)):a=this.__input_length,l=this.__input.substring(this.__position,a),this.__position=a,l},y.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},y.prototype.get_regexp=function(g,p){var l=null,a="g";return p&&D&&(a="y"),typeof g=="string"&&g!==""?l=new RegExp(g,a):g&&(l=new RegExp(g.source,a)),l},y.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(g){var p=this.__position,l=this.readUntilAfter(g);return this.__position=p,l},y.prototype.lookBack=function(g){var p=this.__position-1;return p>=g.length&&this.__input.substring(p-g.length,p).toLowerCase()===g},n.exports.InputScanner=y},function(n,D,y){var g=y(8).InputScanner,p=y(3).Token,l=y(10).TokenStream,a=y(11).WhitespacePattern,f={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(d,i){this._input=new g(d),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};u.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var d,i=new p(f.START,""),o=null,O=[],w=new l;i.type!==f.EOF;){for(d=this._get_next_token(i,o);this._is_comment(d);)w.add(d),d=this._get_next_token(i,o);w.isEmpty()||(d.comments_before=w,w=new l),d.parent=o,this._is_opening(d)?(O.push(o),o=d):o&&this._is_closing(d,o)&&(d.opened=o,o.closed=d,o=O.pop(),d.parent=o),d.previous=i,i.next=d,this.__tokens.add(d),i=d}return this.__tokens},u.prototype._is_first_token=function(){return this.__tokens.isEmpty()},u.prototype._reset=function(){},u.prototype._get_next_token=function(d,i){this._readWhitespace();var o=this._input.read(/.+/g);return o?this._create_token(f.RAW,o):this._create_token(f.EOF,"")},u.prototype._is_comment=function(d){return!1},u.prototype._is_opening=function(d){return!1},u.prototype._is_closing=function(d,i){return!1},u.prototype._create_token=function(d,i){var o=new p(d,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return o},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=u,n.exports.TOKEN=f},function(n){function D(y){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=y}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position<this.__tokens_length},D.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__tokens[this.__position],this.__position+=1),y},D.prototype.peek=function(y){var g=null;return y=y||0,y+=this.__position,y>=0&&y<this.__tokens_length&&(g=this.__tokens[y]),g},D.prototype.add=function(y){this.__parent_token&&(y.parent=this.__parent_token),this.__tokens.push(y),this.__tokens_length+=1},n.exports.TokenStream=D},function(n,D,y){var g=y(12).Pattern;function p(l,a){g.call(this,l,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new g,p.prototype.__set_whitespace_patterns=function(l,a){l+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var a=this.__split(this._newline_regexp,l);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return l},p.prototype.matching=function(l,a){var f=this._create();return f.__set_whitespace_patterns(l,a),f._update(),f},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(l,a){l.lastIndex=0;for(var f=0,u=[],d=l.exec(a);d;)u.push(a.substring(f,d.index)),f=d.index+d[0].length,d=l.exec(a);return f<a.length?u.push(a.substring(f,a.length)):u.push(""),u},n.exports.WhitespacePattern=p},function(n){function D(y,g){this._input=y,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,g&&(this._starting_pattern=this._input.get_regexp(g._starting_pattern,!0),this._match_pattern=this._input.get_regexp(g._match_pattern,!0),this._until_pattern=this._input.get_regexp(g._until_pattern),this._until_after=g._until_after)}D.prototype.read=function(){var y=this._input.read(this._starting_pattern);return(!this._starting_pattern||y)&&(y+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),y},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(y){var g=this._create();return g._until_after=!0,g._until_pattern=this._input.get_regexp(y),g._update(),g},D.prototype.until=function(y){var g=this._create();return g._until_after=!1,g._until_pattern=this._input.get_regexp(y),g._update(),g},D.prototype.starting_with=function(y){var g=this._create();return g._starting_pattern=this._input.get_regexp(y,!0),g._update(),g},D.prototype.matching=function(y){var g=this._create();return g._match_pattern=this._input.get_regexp(y,!0),g._update(),g},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},n.exports.Pattern=D},function(n){function D(y,g){y=typeof y=="string"?y:y.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+g,"g")}D.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(y);p;)g[p[1]]=p[2],p=this.__directive_pattern.exec(y);return g},D.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=D},function(n,D,y){var g=y(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(a,f){g.call(this,a,f),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),f&&(this.__template_pattern=this._input.get_regexp(f.__template_pattern),this._excluded=Object.assign(this._excluded,f._excluded),this._disabled=Object.assign(this._disabled,f._disabled));var u=new g(a);this.__patterns={handlebars_comment:u.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:u.starting_with(/{{{/).until_after(/}}}/),handlebars:u.starting_with(/{{/).until_after(/}}/),php:u.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:u.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:u.starting_with(/{%/).until_after(/%}/),django_value:u.starting_with(/{{/).until_after(/}}/),django_comment:u.starting_with(/{#/).until_after(/#}/),smarty:u.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:u.starting_with(/{\*/).until_after(/\*}/),smarty_literal:u.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new g,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(a){var f=this._create();return f._disabled[a]=!0,f._update(),f},l.prototype.read_options=function(a){var f=this._create();for(var u in p)f._disabled[u]=a.templating.indexOf(u)===-1;return f._update(),f},l.prototype.exclude=function(a){var f=this._create();return f._excluded[a]=!0,f._update(),f},l.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var f=this._read_template();f;)this._match_pattern?f+=this._input.read(this._match_pattern):f+=this._input.readUntil(this.__template_pattern),a+=f,f=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},l.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},l.prototype._read_template=function(){var a="",f=this._input.peek();if(f==="<"){var u=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&u==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&u==="%"&&(a=a||this.__patterns.erb.read())}else f==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},n.exports.TemplatablePattern=l}],P={};function G(n){var D=P[n];if(D!==void 0)return D.exports;var y=P[n]={exports:{}};return j[n](y,y.exports,G),y.exports}var W=G(0);N=W})();var $=N;!(ee=[],V=function(){return{js_beautify:$}}.apply(Ee,ee),V!==void 0&&(at.exports=V))})()},"6eGT":function(at,Ee,H){"use strict";function ee(V){return null}Ee.a=ee},"746U":function(at,Ee,H){"use strict";H.d(Ee,"f",function(){return ee}),H.d(Ee,"l",function(){return V}),H.d(Ee,"k",function(){return N}),H.d(Ee,"j",function(){return $}),H.d(Ee,"g",function(){return j}),H.d(Ee,"m",function(){return P}),H.d(Ee,"h",function(){return G}),H.d(Ee,"n",function(){return W}),H.d(Ee,"c",function(){return n}),H.d(Ee,"a",function(){return D}),H.d(Ee,"i",function(){return y}),H.d(Ee,"o",function(){return g}),H.d(Ee,"e",function(){return a}),H.d(Ee,"d",function(){return f}),H.d(Ee,"p",function(){return u}),H.d(Ee,"b",function(){return d});function ee(i){return Array.isArray(i)}function V(i){return typeof i=="string"}function N(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function $(i){return typeof i=="number"&&!isNaN(i)}function j(i){return i===!0||i===!1}function P(i){return typeof i=="undefined"}function G(i){return!W(i)}function W(i){return P(i)||i===null}function n(i,o){if(!i)throw new Error(o?`Unexpected type, expected '${o}'`:"Unexpected type")}function D(i){if(W(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function y(i){return typeof i=="function"}function g(i,o){const O=Math.min(i.length,o.length);for(let w=0;w<O;w++)p(i[w],o[w])}function p(i,o){if(V(o)){if(typeof i!==o)throw new Error(`argument does not match constraint: typeof ${o}`)}else if(y(o)){try{if(i instanceof o)return}catch(O){}if(!W(i)&&i.constructor===o)return;if(o.length===1&&o.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function l(i){let o=[],O=Object.getPrototypeOf(i);for(;Object.prototype!==O;)o=o.concat(Object.getOwnPropertyNames(O)),O=Object.getPrototypeOf(O);return o}function a(i){const o=[];for(const O of l(i))typeof i[O]=="function"&&o.push(O);return o}function f(i,o){const O=C=>function(){const L=Array.prototype.slice.call(arguments,0);return o(C,L)};let w={};for(const C of i)w[C]=O(C);return w}function u(i){return i===null?void 0:i}function d(i,o="Unreachable"){throw new Error(o)}},"7Cbv":function(at,Ee,H){"use strict";var ee=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function N(){if(!ee)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ee(V)}var $=/^(?:[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"&&$.test(p)}for(var P=j,G=[],W=0;W<256;++W)G.push((W+256).toString(16).substr(1));function n(p){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(G[p[l+0]]+G[p[l+1]]+G[p[l+2]]+G[p[l+3]]+"-"+G[p[l+4]]+G[p[l+5]]+"-"+G[p[l+6]]+G[p[l+7]]+"-"+G[p[l+8]]+G[p[l+9]]+"-"+G[p[l+10]]+G[p[l+11]]+G[p[l+12]]+G[p[l+13]]+G[p[l+14]]+G[p[l+15]]).toLowerCase();if(!P(a))throw TypeError("Stringified UUID is invalid");return a}var D=n;function y(p,l,a){p=p||{};var f=p.random||(p.rng||N)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,l){a=a||0;for(var u=0;u<16;++u)l[a+u]=f[u];return l}return D(f)}var g=Ee.a=y},"7ahc":function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return O});var ee=H("k1fw"),V=H("0Owb"),N=H("+L6B"),$=H("2/Rp"),j=H("y8nQ"),P=H("Vl3Y"),G=H("tJVT"),W=H("OaEy"),n=H("2fM7"),D=H("q1tI"),y=H.n(D),g=H("VrN/"),p=H.n(g),l=H("p77/"),a=H.n(l),f=H("c5Ni"),u=H.n(f),d=n.a.Option,i={labelCol:{span:4},wrapperCol:{span:20}},o={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"]};Ee.b=function(w){var C=w.callback,L=w.onCancel,A=Object(D.useState)("python"),_=Object(G.a)(A,2),T=_[0],v=_[1];function c(h){v(o[h][1])}function E(h){C(h)}return y.a.createElement(P.a,Object(V.a)({},i,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),y.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(n.a,{onChange:c},Object.keys(o).map(function(h){return y.a.createElement(d,{key:h,value:h},o[h][0])}))),y.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(O,{mode:T})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement($.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement($.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function O(w){var C=w.value,L=w.onChange,A=w.mode,_=w.options,T=_===void 0?{}:_,v=Object(D.useRef)(),c=Object(D.useState)(),E=Object(G.a)(c,2),h=E[0],x=E[1];return Object(D.useEffect)(function(){if(h){function U(F){var S=F.getValue();L&&L(S)}return h.on("change",U),function(){h.off("change",U)}}},[h,L]),Object(D.useEffect)(function(){h&&h.setOption("mode",A)},[h,A]),Object(D.useEffect)(function(){h&&((C!==h.getValue()||C==="")&&setTimeout(function(){h.setValue(C||" ")},300))},[h,C]),Object(D.useEffect)(function(){if(v.current&&!h){var U=p.a.fromTextArea(v.current,Object(ee.a)({mode:A,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},T));x(U)}},[v.current,h]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:v}))}},"7qnI":function(at,Ee,H){"use strict";var ee=H("5Dmo"),V=H("3S7+"),N=H("fWQN"),$=H("mtLc"),j=H("yKVA"),P=H("879j"),G=H("5NDa"),W=H("5rEg"),n=H("q1tI"),D=H.n(n),y=H("O2Wb"),g=H.n(y),p=W.a.TextArea,l=function(a){Object(j.a)(u,a);var f=Object(P.a)(u);function u(){return Object(N.a)(this,u),f.apply(this,arguments)}return Object($.a)(u,[{key:"render",value:function(){var i=this,o=this.props,O=o.index,w=o.onAnswerChange,C=o.addChildAnswer,L=o.exerciseIsPublish,A=o.answers,_=o.activeOptionErrorIndex,T=o.flex,v=T===void 0?"0 0 1000px":T;return D.a.createElement("div",{className:g.a.flex},D.a.createElement("div",{className:"".concat(g.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",O+1,"):"),D.a.createElement("div",{className:"".concat(g.a.flex," ").concat(g.a.flex1),style:{flexDirection:"column"}},A.map(function(c,E){var h="".concat(O,"-").concat(E);return D.a.createElement("div",{className:"".concat(g.a.flex," ").concat(g.a.flex1),key:E},D.a.createElement("div",{className:g.a.flex1,style:{flex:v}},D.a.createElement("div",null,D.a.createElement(p,{className:h===_?g.a.error:"",spellCheck:!1,rows:4,value:c||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(E==0?"":"(\u53EF\u9009)"),onChange:function(U){return w(O,E,U.target.value)},style:{minHeight:95}}))),!L&&D.a.createElement(D.a.Fragment,null,E!=0&&D.a.createElement(V.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(g.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return i.props.deleteChildAnswer(O,E)},style:{float:"right"}})),E===0&&D.a.createElement(V.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(g.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return i.props.deleteChildAnswermain(O,E)},style:{float:"right"}})),D.a.createElement(V.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},D.a.createElement("i",{className:"".concat(g.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return C(O)},style:{float:"right",visibility:E==A.length-1?"":"hidden"}}))))})))}}]),u}(n.Component);Ee.a=l},"815F":function(at,Ee,H){"use strict";H.d(Ee,"e",function(){return G}),H.d(Ee,"c",function(){return n}),H.d(Ee,"d",function(){return D}),H.d(Ee,"a",function(){return g}),H.d(Ee,"f",function(){return p}),H.d(Ee,"b",function(){return l});var ee=H("KQm4"),V=H("VTBJ"),N=H("Ff2n"),$=H("Zm9Q"),j=H("Kwbf"),P=H("OZM5");function G(a,f){return a!=null?a:f}function W(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=new Map;function u(d){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(d||[]).forEach(function(o){var O=o.key,w=o.children;Object(j.a)(O!=null,"Tree node must have a certain key: [".concat(i).concat(O,"]"));var C=String(O);Object(j.a)(!f.has(C)||O===null||O===void 0,"Same 'key' exist in the Tree: ".concat(C)),f.set(C,!0),u(w,"".concat(i).concat(C," > "))})}u(a)}function n(a){function f(u){var d=Object($.a)(u);return d.map(function(i){if(!Object(P.i)(i))return Object(j.a)(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var o=i.key,O=i.props,w=O.children,C=Object(N.a)(O,["children"]),L=Object(V.a)({key:o},C),A=f(w);return A.length&&(L.children=A),L}).filter(function(i){return i})}return f(a)}function D(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],u=new Set(f===!0?[]:f),d=[];function i(o){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return o.map(function(w,C){var L=Object(P.h)(O?O.pos:"0",C),A=G(w.key,L),_=Object(V.a)(Object(V.a)({},w),{},{parent:O,pos:L,children:null,data:w,isStart:[].concat(Object(ee.a)(O?O.isStart:[]),[C===0]),isEnd:[].concat(Object(ee.a)(O?O.isEnd:[]),[C===o.length-1])});return d.push(_),f===!0||u.has(A)?_.children=i(w.children||[],_):_.children=[],_})}return i(a),d}function y(a,f,u){var d;u?typeof u=="string"?d=function(O){return O[u]}:typeof u=="function"&&(d=function(O){return u(O)}):d=function(O,w){return G(O.key,w)};function i(o,O,w){var C=o?o.children:a,L=o?Object(P.h)(w.pos,O):"0";if(o){var A=d(o,L),_={node:o,index:O,pos:L,key:A,parentPos:w.node?w.pos:null,level:w.level+1};f(_)}C&&C.forEach(function(T,v){i(T,v,{node:o,pos:L,level:w?w.level+1:-1})})}i(null)}function g(a){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=f.initWrapper,d=f.processEntity,i=f.onProcessFinished,o=arguments.length>2?arguments[2]:void 0,O={},w={},C={posEntities:O,keyEntities:w};return u&&(C=u(C)||C),y(a,function(L){var A=L.node,_=L.index,T=L.pos,v=L.key,c=L.parentPos,E=L.level,h={node:A,index:_,key:v,pos:T,level:E},x=G(v,T);O[T]=h,w[x]=h,h.parent=O[c],h.parent&&(h.parent.children=h.parent.children||[],h.parent.children.push(h)),d&&d(h,C)},o),i&&i(C),C}function p(a,f){var u=f.expandedKeys,d=f.selectedKeys,i=f.loadedKeys,o=f.loadingKeys,O=f.checkedKeys,w=f.halfCheckedKeys,C=f.dragOverNodeKey,L=f.dropPosition,A=f.keyEntities,_=A[a],T={eventKey:a,expanded:u.indexOf(a)!==-1,selected:d.indexOf(a)!==-1,loaded:i.indexOf(a)!==-1,loading:o.indexOf(a)!==-1,checked:O.indexOf(a)!==-1,halfChecked:w.indexOf(a)!==-1,pos:String(_?_.pos:""),dragOver:C===a&&L===0,dragOverGapTop:C===a&&L===-1,dragOverGapBottom:C===a&&L===1};return T}function l(a){var f=a.data,u=a.expanded,d=a.selected,i=a.checked,o=a.loaded,O=a.loading,w=a.halfChecked,C=a.dragOver,L=a.dragOverGapTop,A=a.dragOverGapBottom,_=a.pos,T=a.active,v=Object(V.a)(Object(V.a)({},f),{},{expanded:u,selected:d,checked:i,loaded:o,loading:O,halfChecked:w,dragOver:C,dragOverGapTop:L,dragOverGapBottom:A,pos:_,active:T});return"props"in v||Object.defineProperty(v,"props",{get:function(){return Object(j.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),a}}),v}},"8EBN":function(at,Ee,H){(function(ee){ee(H("VrN/"))})(function(ee){"use strict";ee.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 V=0;V<ee.modeInfo.length;V++){var N=ee.modeInfo[V];N.mimes&&(N.mime=N.mimes[0])}ee.findModeByMIME=function($){$=$.toLowerCase();for(var j=0;j<ee.modeInfo.length;j++){var P=ee.modeInfo[j];if(P.mime==$)return P;if(P.mimes){for(var G=0;G<P.mimes.length;G++)if(P.mimes[G]==$)return P}}if(/\+xml$/.test($))return ee.findModeByMIME("application/xml");if(/\+json$/.test($))return ee.findModeByMIME("application/json")},ee.findModeByExtension=function($){$=$.toLowerCase();for(var j=0;j<ee.modeInfo.length;j++){var P=ee.modeInfo[j];if(P.ext){for(var G=0;G<P.ext.length;G++)if(P.ext[G]==$)return P}}},ee.findModeByFileName=function($){for(var j=0;j<ee.modeInfo.length;j++){var P=ee.modeInfo[j];if(P.file&&P.file.test($))return P}var G=$.lastIndexOf("."),W=G>-1&&$.substring(G+1,$.length);if(W)return ee.findModeByExtension(W)},ee.findModeByName=function($){$=$.toLowerCase();for(var j=0;j<ee.modeInfo.length;j++){var P=ee.modeInfo[j];if(P.name.toLowerCase()==$)return P;if(P.alias){for(var G=0;G<P.alias.length;G++)if(P.alias[G].toLowerCase()==$)return P}}}})},"8HAY":function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return j}),H.d(Ee,"b",function(){return P}),H.d(Ee,"d",function(){return G}),H.d(Ee,"e",function(){return W}),H.d(Ee,"c",function(){return n});var ee=H("MI8n"),V=H("pmY6"),N=H("3/fG"),$=function(D,y,g,p){function l(a){return a instanceof g?a:new g(function(f){f(a)})}return new(g||(g=Promise))(function(a,f){function u(o){try{i(p.next(o))}catch(O){f(O)}}function d(o){try{i(p.throw(o))}catch(O){f(O)}}function i(o){o.done?a(o.value):l(o.value).then(u,d)}i((p=p.apply(D,y||[])).next())})};class j extends V.a{constructor(D,y="",g="",p=!0,l){super();this._onDidChange=this._register(new ee.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=y,this._cssClass=g,this._enabled=p,this._actionCallback=l}get id(){return this._id}get label(){return this._label}set label(D){this._setLabel(D)}_setLabel(D){this._label!==D&&(this._label=D,this._onDidChange.fire({label:D}))}get tooltip(){return this._tooltip||""}set tooltip(D){this._setTooltip(D)}_setTooltip(D){this._tooltip!==D&&(this._tooltip=D,this._onDidChange.fire({tooltip:D}))}get class(){return this._cssClass}set class(D){this._setClass(D)}_setClass(D){this._cssClass!==D&&(this._cssClass=D,this._onDidChange.fire({class:D}))}get enabled(){return this._enabled}set enabled(D){this._setEnabled(D)}_setEnabled(D){this._enabled!==D&&(this._enabled=D,this._onDidChange.fire({enabled:D}))}get checked(){return this._checked}set checked(D){this._setChecked(D)}_setChecked(D){this._checked!==D&&(this._checked=D,this._onDidChange.fire({checked:D}))}run(D,y){return $(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class P extends V.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ee.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ee.b),this.onDidRun=this._onDidRun.event}run(D,y){return $(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let g;try{yield this.runAction(D,y)}catch(p){g=p}this._onDidRun.fire({action:D,error:g})})}runAction(D,y){return $(this,void 0,void 0,function*(){yield D.run(y)})}}class G extends j{constructor(D){super(G.ID,D,D?"separator text":"separator");this.checked=!1,this.enabled=!1}}G.ID="vs.actions.separator";class W{constructor(D,y,g,p){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=y,this.class=p,this._actions=g}get actions(){return this._actions}dispose(){}run(){return $(this,void 0,void 0,function*(){})}}class n extends j{constructor(){super(n.ID,N.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(at,Ee,H){at.exports={button:"button___1wy9m"}},"9Bee":function(at,Ee,H){"use strict";var ee=H("DYRE"),V=H("zeV3"),N=H("+L6B"),$=H("2/Rp"),j=H("k1fw"),P=H("9og8"),G=H("tJVT"),W=H("WmNS"),n=H.n(W),D=H("q1tI"),y=H.n(D),g=H("vg9a"),p=H("DlQD"),l=H.n(p),a=H("rUJ1");function f(Y,R){var k=Y.match(/^(\s+)(?:```)/);if(k===null)return R;var z=k[1];return R.split(`
`).map(function(ie){var J=ie.match(/^\s+/);if(J===null)return ie;var De=Object(G.a)(J,1),qe=De[0];return qe.length>=z.length?ie.slice(z.length):ie}).join(`
`)}var u=[],d=["<ul>"],i=new l.a.Renderer,o=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){u.length=0,d=["<ul>"]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function C(Y,R,k,z){if(R>=Y.length||Y[R].level<=k)return R;var ie=Y[R];z.push("<li><a href='#"+ie.anchor+"'>"+ie.text+"</a>"),R++;var J=[];return R=C(Y,R,ie.level,J),J.length>0&&(z.push("<ul>"),J.forEach(function(De){z.push(De)}),z.push("</ul>")),z.push("</li>"),R=C(Y,R,k,z),R}function L(){return C(u,0,0,d),d.push("</ul>"),d.join("")}var A={heading:function(R){var k=o.exec(R);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(R){var k=this.rules.block.fences.exec(R);if(k){var z=k[0],ie=f(z,k[3]||""),J=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(J)>=0){var De=v(),qe=ie;ie=De,c[De]={type:"block",expression:qe}}return{type:"code",raw:z,lang:J,text:ie}}}},_=/(?:\${2})([^\n`]+?)(?:\${2})/gi,T=0,v=function(){return"__special_katext_id_".concat(T++,"__")},c={};function E(){return c}function h(){T=0,c={}}function x(Y){return Y=Y.replace(_,function(R,k){var z=v();return c[z]={type:"inline",expression:k},z}),Y}var U=i.listitem;i.listitem=function(Y){return U(x(Y))};var F=i.paragraph;i.paragraph=function(Y){return F(x(Y))};var S=i.tablecell;i.tablecell=function(Y,R){return S(x(Y),R)},i.code=function(Y,R,k){var z=(R||"").match(/\S*/)[0];return z?["latex","katex","math"].indexOf(z)>=0?"<p class='editormd-tex'>".concat(Y,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(R,'">').concat(k?Y:Object(a.escape)(Y,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(k?Y:Object(a.escape)(Y,!0))+"</code></pre>"},i.heading=function(Y,R,k){var z=this.options.headerPrefix+k.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return u.push({anchor:z,level:R,text:Y}),"<h"+R+' id="'+z+'">'+Y+"</h"+R+">"},l.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),l.a.use({tokenizer:A,renderer:i});var M=l.a,I=H("SJMd"),b=H("ulZh"),K=H.n(b),Q=H("m3rI"),ne=H("Oy/b"),fe=H("p5ED"),we=H("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 Se=function(Y,R){return(Se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,z){k.__proto__=z}||function(k,z){for(var ie in z)Object.prototype.hasOwnProperty.call(z,ie)&&(k[ie]=z[ie])})(Y,R)};function he(Y,R){function k(){this.constructor=Y}Se(Y,R),Y.prototype=R===null?Object.create(R):(k.prototype=R.prototype,new k)}function se(Y,R,k,z){return new(k||(k=Promise))(function(ie,J){function De(Lt){try{ft(z.next(Lt))}catch(st){J(st)}}function qe(Lt){try{ft(z.throw(Lt))}catch(st){J(st)}}function ft(Lt){var st;Lt.done?ie(Lt.value):(st=Lt.value,st instanceof k?st:new k(function(Pt){Pt(st)})).then(De,qe)}ft((z=z.apply(Y,R||[])).next())})}function me(Y,R){var k,z,ie,J,De={label:0,sent:function(){if(1&ie[0])throw ie[1];return ie[1]},trys:[],ops:[]};return J={next:qe(0),throw:qe(1),return:qe(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function qe(ft){return function(Lt){return function(st){if(k)throw new TypeError("Generator is already executing.");for(;De;)try{if(k=1,z&&(ie=2&st[0]?z.return:st[0]?z.throw||((ie=z.return)&&ie.call(z),0):z.next)&&!(ie=ie.call(z,st[1])).done)return ie;switch(z=0,ie&&(st=[2&st[0],ie.value]),st[0]){case 0:case 1:ie=st;break;case 4:return De.label++,{value:st[1],done:!1};case 5:De.label++,z=st[1],st=[0];continue;case 7:st=De.ops.pop(),De.trys.pop();continue;default:if(!(ie=De.trys,(ie=ie.length>0&&ie[ie.length-1])||st[0]!==6&&st[0]!==2)){De=0;continue}if(st[0]===3&&(!ie||st[1]>ie[0]&&st[1]<ie[3])){De.label=st[1];break}if(st[0]===6&&De.label<ie[1]){De.label=ie[1],ie=st;break}if(ie&&De.label<ie[2]){De.label=ie[2],De.ops.push(st);break}ie[2]&&De.ops.pop(),De.trys.pop();continue}st=R.call(Y,De)}catch(Pt){st=[6,Pt],z=0}finally{k=ie=0}if(5&st[0])throw st[1];return{value:st[0]?st[1]:void 0,done:!0}}([ft,Lt])}}}function re(){for(var Y=0,R=0,k=arguments.length;R<k;R++)Y+=arguments[R].length;var z=Array(Y),ie=0;for(R=0;R<k;R++)for(var J=arguments[R],De=0,qe=J.length;De<qe;De++,ie++)z[ie]=J[De];return z}var le=function(){function Y(){}return Y.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Y.setAttributes=function(R,k){for(var z=0,ie=k;z<ie.length;z++){var J=ie[z],De=J[0],qe=J[1];R.setAttribute(De,qe)}},Y.createRect=function(R,k,z){var ie=document.createElementNS("http://www.w3.org/2000/svg","rect");return ie.setAttribute("width",R.toString()),ie.setAttribute("height",k.toString()),z&&Y.setAttributes(ie,z),ie},Y.createLine=function(R,k,z,ie,J){var De=document.createElementNS("http://www.w3.org/2000/svg","line");return De.setAttribute("x1",R.toString()),De.setAttribute("y1",k.toString()),De.setAttribute("x2",z.toString()),De.setAttribute("y2",ie.toString()),J&&Y.setAttributes(De,J),De},Y.createPolygon=function(R,k){var z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return z.setAttribute("points",R),k&&Y.setAttributes(z,k),z},Y.createCircle=function(R,k){var z=document.createElementNS("http://www.w3.org/2000/svg","circle");return z.setAttribute("cx",(R/2).toString()),z.setAttribute("cy",(R/2).toString()),z.setAttribute("r",R.toString()),k&&Y.setAttributes(z,k),z},Y.createEllipse=function(R,k,z){var ie=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ie.setAttribute("cx",(R/2).toString()),ie.setAttribute("cy",(k/2).toString()),ie.setAttribute("rx",(R/2).toString()),ie.setAttribute("ry",(k/2).toString()),z&&Y.setAttributes(ie,z),ie},Y.createGroup=function(R){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return R&&Y.setAttributes(k,R),k},Y.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Y.createMarker=function(R,k,z,ie,J,De,qe){var ft=document.createElementNS("http://www.w3.org/2000/svg","marker");return Y.setAttributes(ft,[["id",R],["orient",k],["markerWidth",z.toString()],["markerHeight",ie.toString()],["refX",J.toString()],["refY",De.toString()]]),ft.appendChild(qe),ft},Y.createText=function(R){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),R&&Y.setAttributes(k,R),k},Y.createTSpan=function(R,k){var z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return z.textContent=R,k&&Y.setAttributes(z,k),z},Y.createImage=function(R){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return R&&Y.setAttributes(k,R),k},Y.createPoint=function(R,k){var z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return z.x=R,z.y=k,z},Y.createPath=function(R,k){var z=document.createElementNS("http://www.w3.org/2000/svg","path");return z.setAttribute("d",R),k&&Y.setAttributes(z,k),z},Y}(),Z=function(){function Y(){}return Y.addKey=function(R){Y.key=R},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}(),ae=function(){function Y(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Y.prototype.rasterize=function(R,k,z){var ie=this;return new Promise(function(J){var De=z!==void 0?z:document.createElement("canvas");R===null&&(ie.markersOnly=!0,ie.naturalSize=!1);var qe=document.createElementNS("http://www.w3.org/2000/svg","svg");qe.setAttribute("xmlns","http://www.w3.org/2000/svg"),qe.setAttribute("width",k.width.baseVal.valueAsString),qe.setAttribute("height",k.height.baseVal.valueAsString),qe.setAttribute("viewBox","0 0 "+k.viewBox.baseVal.width.toString()+" "+k.viewBox.baseVal.height.toString()),qe.innerHTML=k.innerHTML,ie.naturalSize===!0?(qe.width.baseVal.value=R.naturalWidth,qe.height.baseVal.value=R.naturalHeight):ie.width!==void 0&&ie.height!==void 0&&(qe.width.baseVal.value=ie.width,qe.height.baseVal.value=ie.height),De.width=qe.width.baseVal.value,De.height=qe.height.baseVal.value;var ft=qe.outerHTML,Lt=De.getContext("2d");ie.markersOnly!==!0&&Lt.drawImage(R,0,0,De.width,De.height);var st=window.URL,Pt=new Image(De.width,De.height);Pt.setAttribute("crossOrigin","anonymous");var Ut=new Blob([ft],{type:"image/svg+xml"}),mn=st.createObjectURL(Ut);Pt.onload=function(){Lt.drawImage(Pt,0,0),st.revokeObjectURL(mn);var Fn=De.toDataURL(ie.imageType,ie.imageQuality);J(Fn)},Pt.src=mn})},Y}(),oe=function(){},ge=function(){function Y(R){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+R+"_"}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(R){return this.styleSheet===void 0&&this.addStyleSheet(),R.name=""+this.classNamePrefix+R.localName,this.classes.push(R),this.styleSheet.sheet.insertRule("."+R.name+" {"+R.style+"}",this.styleSheet.sheet.cssRules.length),R},Y.prototype.addRule=function(R){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(R),this.styleSheet.sheet.insertRule(R.selector+" {"+R.style+"}",this.styleSheet.sheet.cssRules.length)},Y.prototype.addStyleSheet=function(){var R;this.styleSheet=document.createElement("style"),((R=this.styleSheetRoot)!==null&&R!==void 0?R:document.head).appendChild(this.styleSheet),this.addRule(new Re("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Re("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Re("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Te("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Te("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Y.prototype.removeStyleSheet=function(){var R;this.styleSheet&&(((R=this.styleSheetRoot)!==null&&R!==void 0?R:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Y}(),Re=function(Y,R){this.selector=Y,this.style=R},Te=function(Y,R){this.localName=Y,this.style=R},Me=function(){function Y(R,k,z,ie,J){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=R,this.displayMode=k,this.markerItems=z,this.uiStyleSettings=ie,this.styles=J,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(R){var k=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=R,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var z=document.createElement("div");z.className=this.toolbarBlockStyleClass.name,z.style.whiteSpace="nowrap",this.uiContainer.appendChild(z),this.addActionButton(z,'<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(z,'<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(z,'<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(z,'<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(z,'<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(z,'<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(z,'<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(z,'<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(J){var De=document.createElement("div");De.className=""+k.toolbarButtonStyleClass.name,De.setAttribute("data-type-name",J.typeName),De.innerHTML=J.icon,De.addEventListener("click",function(){k.markerToolbarButtonClicked(De,J)}),k.buttons.push(De),k.markerButtons.push(De)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ie=document.createElement("div");ie.className=this.toolbarBlockStyleClass.name,ie.style.whiteSpace="nowrap",ie.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ie),this.addActionButton(ie,'<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(ie,'<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(R){this.buttonClickListeners.push(R)},Y.prototype.removeButtonClickListener=function(R){this.buttonClickListeners.indexOf(R)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(R),1)},Y.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Y.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var R=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<R||k===R&&this.markerButtons.length-1===R?this.markerButtonBlock.appendChild(this.markerButtons[k]):(k===R&&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 R=this;this.buttons.forEach(function(k){k.className=k.className.replace(R.uiStyleSettings.toolbarButtonStyleColorsClassName?R.uiStyleSettings.toolbarButtonStyleColorsClassName:R.toolbarButtonStyleColorsClass.name,"").trim(),k.className=k.className.replace(R.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?R.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:R.toolbarActiveButtonStyleColorsClass.name,"").trim(),k.className+=" "+(R.uiStyleSettings.toolbarButtonStyleColorsClassName?R.uiStyleSettings.toolbarButtonStyleColorsClassName:R.toolbarButtonStyleColorsClass.name)})},Y.prototype.addActionButton=function(R,k,z){var ie=this,J=document.createElement("div");switch(J.className=""+this.toolbarButtonStyleClass.name,J.innerHTML=k,J.setAttribute("data-action",z),J.addEventListener("click",function(){ie.actionToolbarButtonClicked(J,z)}),z){case"select":J.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":J.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":J.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":J.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":J.style.fill=this.uiStyleSettings.closeButtonColor}R.appendChild(J),this.buttons.push(J)},Y.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Te("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 Te("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Te("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Te("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 Te("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var R=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Te("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
padding: `+R+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Te("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Te("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Re("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Re("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},Y.prototype.markerToolbarButtonClicked=function(R,k){this.setActiveButton(R),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},Y.prototype.actionToolbarButtonClicked=function(R,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Y.prototype.setActiveButton=function(R){this.resetButtonStyles(),R.className=R.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),R.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Y.prototype.setActiveMarkerButton=function(R){var k=this.markerButtons.find(function(z){return z.getAttribute("data-type-name")===R});k&&this.setActiveButton(k)},Y.prototype.setCurrentMarker=function(R){var k=this;this.currentMarker=R,this.buttons.filter(function(z){return/delete|notes/.test(z.getAttribute("data-action"))}).forEach(function(z){k.currentMarker===void 0?(z.style.fillOpacity="0.4",z.style.pointerEvents="none"):(z.style.fillOpacity="1",z.style.pointerEvents="all")})},Y}(),Be=function(){function Y(R,k,z,ie){this.panels=[],this.panelButtons=[],this.markerjsContainer=R,this.displayMode=k,this.uiStyleSettings=z,this.styles=ie,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Y.prototype.addStyles=function(){var R;this.toolboxStyleClass=this.styles.addClass(new Te("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 Te("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Te("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Te("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Te("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 Te("toolbox-panel-row_colors",`
background-color: `+((R=this.uiStyleSettings.toolboxBackgroundColor)!==null&&R!==void 0?R:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Te("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 Te("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Te("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Re("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Re("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},Y.prototype.show=function(R){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=R,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(R){var k,z,ie=this;this.panels=R,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+" "+((z=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&z!==void 0?z:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(J){var De;J.uiStyleSettings=ie.uiStyleSettings;var qe=document.createElement("div");qe.className=ie.toolboxButtonStyleClass.name+" "+((De=ie.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&De!==void 0?De:ie.toolboxButtonStyleColorsClass.name),qe.innerHTML=J.icon,qe.title=J.title,qe.addEventListener("click",function(){ie.panelButtonClick(J)}),ie.panelButtons.push(qe),ie.buttonRow.appendChild(qe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Y.prototype.panelButtonClick=function(R){var k=this,z=-1;if(R!==this.activePanel){z=this.panels.indexOf(R),this.panelRow.innerHTML="";var ie=R.getUi();ie.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ie),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=R}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(J,De){var qe,ft;J.className=k.toolboxButtonStyleClass.name+" "+(De===z?""+((qe=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&qe!==void 0?qe:k.toolboxActiveButtonStyleColorsClass.name):""+((ft=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ft!==void 0?ft:k.toolboxButtonStyleColorsClass.name))})},Y}(),pe=function(Y,R){this.title=Y,this.icon=R},Ce=function(Y){function R(k,z,ie,J){var De=Y.call(this,k,J||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return De.colors=[],De.addTransparent=!1,De.colorBoxes=[],De.colors=z,De.currentColor=ie,De.setCurrentColor=De.setCurrentColor.bind(De),De.getColorBox=De.getColorBox.bind(De),De}return he(R,Y),R.prototype.getUi=function(){var k=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.whiteSpace="nowrap",this.colors.forEach(function(ie){var J=k.getColorBox(ie);z.appendChild(J),k.colorBoxes.push(J)}),z},R.prototype.getColorBox=function(k){var z=this,ie=this.uiStyleSettings.toolbarHeight/4,J=this.uiStyleSettings.toolbarHeight-ie,De=document.createElement("div");De.style.display="inline-block",De.style.boxSizing="content-box",De.style.width=J-2+"px",De.style.height=J-2+"px",De.style.padding="1px",De.style.marginRight="2px",De.style.marginBottom="2px",De.style.borderWidth="2px",De.style.borderStyle="solid",De.style.borderRadius=(J+2)/2+"px",De.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",De.addEventListener("click",function(){z.setCurrentColor(k,De)});var qe=document.createElement("div");return qe.style.display="inline-block",qe.style.width=J-2+"px",qe.style.height=J-2+"px",qe.style.backgroundColor=k,qe.style.borderRadius=J/2+"px",k==="transparent"&&(qe.style.fill=this.uiStyleSettings.toolboxAccentColor,qe.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),De.appendChild(qe),De},R.prototype.setCurrentColor=function(k,z){var ie=this;this.currentColor=k,this.colorBoxes.forEach(function(J){J.style.borderColor=J===z?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},R}(pe),ke=function(){function Y(R,k,z){this._state="new",this._isSelected=!1,this._container=R,this._overlayContainer=k,this.globalSettings=z,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(R){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(R,k){},Y.prototype.dblClick=function(R,k){},Y.prototype.manipulate=function(R){},Y.prototype.pointerUp=function(R){this.stateChanged()},Y.prototype.dispose=function(){},Y.prototype.addMarkerVisualToContainer=function(R){this.container.childNodes.length>0?this.container.insertBefore(R,this.container.childNodes[0]):this.container.appendChild(R)},Y.prototype.getState=function(){return{typeName:Y.typeName,state:this.state,notes:this.notes}},Y.prototype.restoreState=function(R){this._state=R.state,this.notes=R.notes},Y.prototype.scale=function(R,k){},Y.prototype.colorChanged=function(R){this.onColorChanged&&this.onColorChanged(R),this.stateChanged()},Y.prototype.fillColorChanged=function(R){this.onFillColorChanged&&this.onFillColorChanged(R),this.stateChanged()},Y.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var R=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),R.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(R)&&this.onStateChanged(this)}},Y.typeName="MarkerBase",Y}(),Le=function(){function Y(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Y.prototype.findGripByVisual=function(R){return this.topLeft.ownsTarget(R)?this.topLeft:this.topCenter.ownsTarget(R)?this.topCenter:this.topRight.ownsTarget(R)?this.topRight:this.centerLeft.ownsTarget(R)?this.centerLeft:this.centerRight.ownsTarget(R)?this.centerRight:this.bottomLeft.ownsTarget(R)?this.bottomLeft:this.bottomCenter.ownsTarget(R)?this.bottomCenter:this.bottomRight.ownsTarget(R)?this.bottomRight:void 0},Y}(),Ge=function(){function Y(){this.GRIP_SIZE=10,this.visual=le.createGroup(),this.visual.appendChild(le.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(le.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(R){return R===this.visual||R===this.visual.childNodes[0]||R===this.visual.childNodes[1]},Y}(),Ve=function(){function Y(){}return Y.toITransformMatrix=function(R){return{a:R.a,b:R.b,c:R.c,d:R.d,e:R.e,f:R.f}},Y.toSVGMatrix=function(R,k){return R.a=k.a,R.b=k.b,R.c=k.c,R.d=k.d,R.e=k.e,R.f=k.f,R},Y}(),tt=function(Y){function R(k,z,ie){var J=Y.call(this,k,z,ie)||this;return J.left=0,J.top=0,J.width=0,J.height=0,J.defaultSize={x:50,y:20},J.offsetX=0,J.offsetY=0,J.rotationAngle=0,J.CB_DISTANCE=10,J._suppressMarkerCreateEvent=!1,J.container.transform.baseVal.appendItem(le.createTransform()),J.setupControlBox(),J}return he(R,Y),Object.defineProperty(R.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var z=le.createTransform();this._visual.transform.baseVal.appendItem(z)},enumerable:!1,configurable:!0}),R.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))},R.prototype.pointerDown=function(k,z){Y.prototype.pointerDown.call(this,k,z),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 ie=this.unrotatePoint(k);if(this.manipulationStartX=ie.x,this.manipulationStartY=ie.y,this.offsetX=ie.x-this.left,this.offsetY=ie.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(z),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(z)){this.activeGrip=this.rotatorGrip;var J=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=J.x-this.width/2,this.top=J.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var De=this.container.transform.baseVal.getItem(0);De.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(De,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},R.prototype.pointerUp=function(k){var z=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",z==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},R.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},R.prototype.manipulate=function(k){var z=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(z.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(z.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(z):this.state==="rotate"&&this.rotate(k)},R.prototype.resize=function(k){var z=this.manipulationStartLeft,ie=this.manipulationStartWidth,J=this.manipulationStartTop,De=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:z=this.manipulationStartLeft+k.x-this.manipulationStartX,ie=this.manipulationStartWidth+this.manipulationStartLeft-z;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ie=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:J=this.manipulationStartTop+k.y-this.manipulationStartY,De=this.manipulationStartHeight+this.manipulationStartTop-J;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:De=this.manipulationStartHeight+k.y-this.manipulationStartY}ie>=0?(this.left=z,this.width=ie):(this.left=z+ie,this.width=-ie),De>=0?(this.top=J,this.height=De):(this.top=J+De,this.height=-De),this.setSize()},R.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},R.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var z=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*z,this.applyRotation()}},R.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)},R.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var z=this.container.getCTM(),ie=le.createPoint(k.x,k.y);return{x:(ie=ie.matrixTransform(z)).x,y:ie.y}},R.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var z=this.container.getCTM();z=z.inverse();var ie=le.createPoint(k.x,k.y);return{x:(ie=ie.matrixTransform(z)).x,y:ie.y}},R.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},R.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},R.prototype.setupControlBox=function(){this.controlBox=le.createGroup();var k=le.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=le.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=le.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 Le,this.addControlGrips(),this.controlBox.style.display="none"},R.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()},R.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()},R.prototype.createGrip=function(){var k=new Ge;return k.visual.transform.baseVal.appendItem(le.createTransform()),this.controlBox.appendChild(k.visual),k},R.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,z=-k/2,ie=z,J=(this.width+this.CB_DISTANCE)/2-k/2,De=(this.height+this.CB_DISTANCE)/2-k/2,qe=this.height+this.CB_DISTANCE-k/2,ft=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,z,ie),this.positionGrip(this.controlGrips.topCenter.visual,J,ie),this.positionGrip(this.controlGrips.topRight.visual,ft,ie),this.positionGrip(this.controlGrips.centerLeft.visual,z,De),this.positionGrip(this.controlGrips.centerRight.visual,ft,De),this.positionGrip(this.controlGrips.bottomLeft.visual,z,qe),this.positionGrip(this.controlGrips.bottomCenter.visual,J,qe),this.positionGrip(this.controlGrips.bottomRight.visual,ft,qe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,J,ie-3*this.CB_DISTANCE)},R.prototype.positionGrip=function(k,z,ie){var J=k.transform.baseVal.getItem(0);J.setTranslate(z,ie),k.transform.baseVal.replaceItem(J,0)},R.prototype.hideControlBox=function(){this.controlBox.style.display="none"},R.prototype.showControlBox=function(){this.controlBox.style.display=""},R.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Ve.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ve.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Y.prototype.getState.call(this))},R.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var z=k;this.left=z.left,this.top=z.top,this.width=z.width,this.height=z.height,this.rotationAngle=z.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ve.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,z.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ve.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,z.containerTransformMatrix))},R.prototype.scale=function(k,z){Y.prototype.scale.call(this,k,z);var ie=this.rotatePoint({x:this.left,y:this.top}),J=this.unrotatePoint({x:ie.x*k,y:ie.y*z});this.left=J.x,this.top=J.y,this.width=this.width*k,this.height=this.height*z,this.adjustControlBox()},R}(ke),rt=function(Y){function R(k,z,ie){var J=Y.call(this,k,z,ie)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.createVisual=J.createVisual.bind(J),J}return he(R,Y),R.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual)},R.prototype.createVisual=function(){this.visual=le.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)},R.prototype.pointerDown=function(k,z){Y.prototype.pointerDown.call(this,k,z),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},R.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k)},R.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.setSize()},R.prototype.setSize=function(){Y.prototype.setSize.call(this),le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},R.prototype.pointerUp=function(k){Y.prototype.pointerUp.call(this,k),this.setSize()},R.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&le.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},R.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&le.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},R.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&le.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},R.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&le.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},R.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))},R.prototype.restoreState=function(k){var z=k;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},R.prototype.scale=function(k,z){Y.prototype.scale.call(this,k,z),this.setSize()},R.title="Rectangle marker",R}(tt),ut=function(Y){function R(k,z,ie,J){var De=Y.call(this,k,J||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return De.widths=[],De.widthBoxes=[],De.widths=z,De.currentWidth=ie,De.setCurrentWidth=De.setCurrentWidth.bind(De),De}return he(R,Y),R.prototype.getUi=function(){var k=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.widths.forEach(function(ie){var J=document.createElement("div");J.style.display="flex",J.style.flexGrow="2",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=ie===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){k.setCurrentWidth(ie,J)}),z.appendChild(J);var De=document.createElement("div");De.innerText=ie.toString(),De.style.marginRight="5px",J.appendChild(De);var qe=document.createElement("div");qe.style.minHeight="20px",qe.style.flexGrow="2",qe.style.display="flex",qe.style.alignItems="center";var ft=document.createElement("hr");ft.style.minWidth="20px",ft.style.border="0px",ft.style.borderTop=ie+"px solid "+k.uiStyleSettings.toolboxColor,ft.style.flexGrow="2",qe.appendChild(ft),J.appendChild(qe),k.widthBoxes.push(J)}),z},R.prototype.setCurrentWidth=function(k,z){var ie=this;this.currentWidth=k,this.widthBoxes.forEach(function(J){J.style.borderColor=J===z?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},R}(pe),lt=function(Y){function R(k,z,ie,J){var De=Y.call(this,k,J||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return De.styles=[],De.styleBoxes=[],De.styles=z,De.currentStyle=ie,De.setCurrentStyle=De.setCurrentStyle.bind(De),De}return he(R,Y),R.prototype.getUi=function(){var k=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.styles.forEach(function(ie){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/k.styles.length-5+"%",J.style.borderColor=ie===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){k.setCurrentStyle(ie,J)}),z.appendChild(J);var De=document.createElement("div");De.style.minHeight="20px",De.style.flexGrow="2",De.style.overflow="hidden";var qe=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+k.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ie!==""?'stroke-dasharray="'+ie+'"':"")+` />
</svg>`;De.innerHTML=qe,J.appendChild(De),k.styleBoxes.push(J)}),z},R.prototype.setCurrentStyle=function(k,z){var ie=this;this.currentStyle=k,this.styleBoxes.forEach(function(J){J.style.borderColor=J===z?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},R}(pe),Ne=function(Y){function R(k,z,ie){var J=Y.call(this,k,z,ie)||this;return J.strokeColor=ie.defaultColor,J.strokeWidth=ie.defaultStrokeWidth,J.strokeDasharray=ie.defaultStrokeDasharray,J.strokePanel=new Ce("Line color",ie.defaultColorSet,ie.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new ut("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new lt("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return he(R,Y),Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=R.typeName,k},R.typeName="FrameMarker",R.title="Frame marker",R.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',R}(rt),Pe=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},ze=function(Y){function R(k,z,ie){var J=Y.call(this,k,z,ie)||this;return J.x1=0,J.y1=0,J.x2=0,J.y2=0,J.defaultLength=50,J.manipulationStartX=0,J.manipulationStartY=0,J.manipulationStartX1=0,J.manipulationStartY1=0,J.manipulationStartX2=0,J.manipulationStartY2=0,J.setupControlBox(),J}return he(R,Y),R.prototype.ownsTarget=function(k){return!!Y.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},R.prototype.pointerDown=function(k,z){Y.prototype.pointerDown.call(this,k,z),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(z)?this.activeGrip=this.grip1:this.grip2.ownsTarget(z)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},R.prototype.pointerUp=function(k){var z=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",z==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},R.prototype.adjustVisual=function(){},R.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)},R.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()},R.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},R.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},R.prototype.setupControlBox=function(){this.controlBox=le.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},R.prototype.adjustControlBox=function(){this.positionGrips()},R.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},R.prototype.createGrip=function(){var k=new Ge;return k.visual.transform.baseVal.appendItem(le.createTransform()),this.controlBox.appendChild(k.visual),k},R.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)},R.prototype.positionGrip=function(k,z,ie){var J=k.transform.baseVal.getItem(0);J.setTranslate(z,ie),k.transform.baseVal.replaceItem(J,0)},R.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Y.prototype.getState.call(this))},R.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var z=k;this.x1=z.x1,this.y1=z.y1,this.x2=z.x2,this.y2=z.y2},R.prototype.scale=function(k,z){Y.prototype.scale.call(this,k,z),this.x1=this.x1*k,this.y1=this.y1*z,this.x2=this.x2*k,this.y2=this.y2*z,this.adjustVisual(),this.adjustControlBox()},R}(ke),Xe=function(Y){function R(k,z,ie){var J=Y.call(this,k,z,ie)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.strokeColor=ie.defaultColor,J.strokeWidth=ie.defaultStrokeWidth,J.strokeDasharray=ie.defaultStrokeDasharray,J.strokePanel=new Ce("Line color",ie.defaultColorSet,ie.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new ut("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new lt("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return he(R,Y),R.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},R.prototype.createVisual=function(){this.visual=le.createGroup(),this.selectorLine=le.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=le.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)},R.prototype.pointerDown=function(k,z){Y.prototype.pointerDown.call(this,k,z),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},R.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()),le.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),le.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),le.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},R.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},R.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},R.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Y.prototype.getState.call(this));return k.typeName=R.typeName,k},R.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var z=k;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.createVisual(),this.adjustVisual()},R.typeName="LineMarker",R.title="Line marker",R.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',R}(ze),je=function(Y){function R(k,z,ie,J){var De=Y.call(this,k,J||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return De.fonts=[],De.fontBoxes=[],De.fonts=z,De.currentFont=ie,De.setCurrentFont=De.setCurrentFont.bind(De),De}return he(R,Y),R.prototype.getUi=function(){var k=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.flexGrow="2",this.fonts.forEach(function(ie){var J=document.createElement("div");J.style.display="inline-block",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/k.fonts.length-5+"%",J.style.borderColor=ie===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){k.setCurrentFont(ie,J)}),z.appendChild(J);var De=document.createElement("div");De.style.display="flex",De.style.minHeight="20px",De.style.flexGrow="2",De.style.fontFamily=ie,De.style.overflow="hidden";var qe=document.createElement("div");qe.style.whiteSpace="nowrap",qe.style.overflow="hidden",qe.style.textOverflow="ellipsis",qe.innerHTML="The quick brown fox jumps over the lazy dog",De.appendChild(qe),J.appendChild(De),k.fontBoxes.push(J)}),z},R.prototype.setCurrentFont=function(k,z){var ie=this;this.currentFont=k,this.fontBoxes.forEach(function(J){J.style.borderColor=J===z?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},R}(pe),Fe=function(Y){function R(k,z,ie){var J=Y.call(this,k,z,ie)||this;return J.color="transparent",J.padding=5,J.DEFAULT_TEXT="your text here",J.text=J.DEFAULT_TEXT,J.isMoved=!1,J.color=ie.defaultColor,J.fontFamily=ie.defaultFontFamily,J.defaultSize={x:100,y:30},J.setColor=J.setColor.bind(J),J.setFont=J.setFont.bind(J),J.renderText=J.renderText.bind(J),J.sizeText=J.sizeText.bind(J),J.textEditDivClicked=J.textEditDivClicked.bind(J),J.showTextEditor=J.showTextEditor.bind(J),J.setSize=J.setSize.bind(J),J.positionTextEditor=J.positionTextEditor.bind(J),J.colorPanel=new Ce("Color",ie.defaultColorSet,ie.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.fontFamilyPanel=new je("Font",ie.defaultFontFamilies,ie.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J}return he(R,Y),R.prototype.ownsTarget=function(k){if(Y.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var z=!1;return this.textElement.childNodes.forEach(function(ie){ie===k&&(z=!0)}),z},R.prototype.createVisual=function(){this.visual=le.createGroup(),this.bgRectangle=le.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=le.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(le.createTransform()),this.textElement.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},R.prototype.pointerDown=function(k,z){Y.prototype.pointerDown.call(this,k,z),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},R.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(z){k.textElement.appendChild(le.createTSpan(z.trim()===""?" ":z.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},R.prototype.getTextScale=function(){var k=this.textElement.getBBox(),z=1;if(k.width>0&&k.height>0){var ie=(1*this.width-this.width*this.padding*2/100)/k.width,J=(1*this.height-this.height*this.padding*2/100)/k.height;z=Math.min(ie,J)}return z},R.prototype.getTextPosition=function(k){var z=this.textElement.getBBox(),ie=0,J=0;return z.width>0&&z.height>0&&(ie=(this.width-z.width*k)/2,J=this.height/2-z.height*k/2),{x:ie,y:J}},R.prototype.sizeText=function(){var k=this.textElement.getBBox(),z=this.getTextScale(),ie=this.getTextPosition(z);ie.y-=k.y*z,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ie.x+"px, "+ie.y+"px) scale("+z+", "+z+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ie.x,ie.y),this.textElement.transform.baseVal.getItem(1).setScale(z,z))},R.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)},R.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},R.prototype.setSize=function(){Y.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},R.prototype.pointerUp=function(k){var z=this.state;z==="creating"&&(this._suppressMarkerCreateEvent=!0),Y.prototype.pointerUp.call(this,k),this.setSize(),(z==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},R.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(z){z.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var z=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&z>.9;)z-=.1,k.textEditor.style.fontSize=Math.max(z,.9)+"em"}),this.textEditor.addEventListener("keyup",function(z){z.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(z){if(z.clipboardData){var ie=z.clipboardData.getData("text"),J=window.getSelection();if(!J.rangeCount)return!1;J.deleteFromDocument(),J.getRangeAt(0).insertNode(document.createTextNode(ie)),z.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")},R.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),z=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ie=this.textElement.getBBox(),J={x:ie.width*k,y:ie.height*k};z.x-=J.x/2,z.y-=J.y/2,this.textEditor.style.top=z.y+"px",this.textEditor.style.left=z.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-z.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},R.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()},R.prototype.select=function(){Y.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},R.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Y.prototype.deselect.call(this)},R.prototype.dblClick=function(k,z){Y.prototype.dblClick.call(this,k,z),this.showTextEditor()},R.prototype.setColor=function(k){this.textElement&&le.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},R.prototype.setFont=function(k){this.textElement&&le.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},R.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},R.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),R.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=R.typeName,k},R.prototype.restoreState=function(k){var z=k;this.color=z.color,this.fontFamily=z.fontFamily,this.padding=z.padding,this.text=z.text,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},R.prototype.scale=function(k,z){Y.prototype.scale.call(this,k,z),this.setSize(),this.sizeText(),this.positionTextEditor()},R.typeName="TextMarker",R.title="Text marker",R.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>',R}(tt),_e=function(Y){function R(k,z,ie){var J=Y.call(this,k,z,ie)||this;return J.color="transparent",J.lineWidth=3,J.drawing=!1,J.pixelRatio=1,J.color=ie.defaultColor,J.lineWidth=ie.defaultStrokeWidth,J.pixelRatio=ie.freehandPixelRatio,J.setColor=J.setColor.bind(J),J.addCanvas=J.addCanvas.bind(J),J.finishCreation=J.finishCreation.bind(J),J.setLineWidth=J.setLineWidth.bind(J),J.colorPanel=new Ce("Color",ie.defaultColorSet,ie.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.lineWidthPanel=new ut("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),J.lineWidthPanel.onWidthChanged=J.setLineWidth,J}return he(R,Y),R.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},R.prototype.createVisual=function(){this.visual=le.createGroup(),this.drawingImage=le.createImage(),this.visual.appendChild(this.drawingImage);var k=le.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},R.prototype.pointerDown=function(k,z){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,z)},R.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)},R.prototype.resize=function(k){Y.prototype.resize.call(this,k),le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},R.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)},R.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)},R.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.select.call(this)},R.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.deselect.call(this)},R.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),z=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ie=z[0],J=z[1],De=z[2],qe=z[3],ft=!1,Lt=0;Lt<this.canvasElement.height;Lt++)for(var st=0;st<this.canvasElement.width;st++)k.data[Lt*this.canvasElement.width*4+4*st+3]>0&&(ft=!0,Lt<J&&(J=Lt),st<ie&&(ie=st),Lt>qe&&(qe=Lt),st>De&&(De=st));if(ft){this.left=ie/this.pixelRatio,this.top=J/this.pixelRatio,this.width=(De-ie)/this.pixelRatio,this.height=(qe-J)/this.pixelRatio;var Pt=document.createElement("canvas");Pt.width=De-ie,Pt.height=qe-J,Pt.getContext("2d").putImageData(this.canvasContext.getImageData(ie,J,De-ie,qe-J),0,0),this.drawingImgUrl=Pt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},R.prototype.setDrawingImage=function(){le.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},R.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},R.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},Y.prototype.getState.call(this));return k.typeName=R.typeName,k},R.prototype.restoreState=function(k){this.createVisual(),Y.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},R.prototype.scale=function(k,z){Y.prototype.scale.call(this,k,z),this.setDrawingImage()},R.typeName="FreehandMarker",R.title="Freehand marker",R.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>',R}(tt),ye=function(Y){function R(k,z,ie){var J=Y.call(this,k,ie||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return J.typeBoxes=[],J.currentType=z,J.setCurrentType=J.setCurrentType.bind(J),J}return he(R,Y),R.prototype.getUi=function(){var k=this,z=document.createElement("div");z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2";for(var ie=function(qe){var ft="both";switch(qe){case 0:ft="both";break;case 1:ft="start";break;case 2:ft="end";break;case 3:ft="none"}var Lt=document.createElement("div");if(Lt.style.display="flex",Lt.style.flexGrow="2",Lt.style.alignItems="center",Lt.style.justifyContent="space-between",Lt.style.padding="5px",Lt.style.borderWidth="2px",Lt.style.borderStyle="solid",Lt.style.borderColor=ft===J.currentType?J.uiStyleSettings.toolboxAccentColor:"transparent",Lt.addEventListener("click",function(){k.setCurrentType(ft,Lt)}),z.appendChild(Lt),ft==="both"||ft==="start"){var st=document.createElement("div");st.style.display="flex",st.style.alignItems="center",st.style.minHeight="20px",st.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="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,st.style.marginLeft="5px",Lt.appendChild(st)}var Pt=document.createElement("div");Pt.style.display="flex",Pt.style.alignItems="center",Pt.style.minHeight="20px",Pt.style.flexGrow="2";var Ut=document.createElement("hr");if(Ut.style.minWidth="20px",Ut.style.border="0px",Ut.style.borderTop="3px solid "+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee"),Ut.style.flexGrow="2",Pt.appendChild(Ut),Lt.appendChild(Pt),ft==="both"||ft==="end"){var mn=document.createElement("div");mn.style.display="flex",mn.style.alignItems="center",mn.style.minHeight="20px",mn.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="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,mn.style.marginRight="5px",Lt.appendChild(mn)}J.typeBoxes.push(Lt)},J=this,De=0;De<4;De++)ie(De);return z},R.prototype.setCurrentType=function(k,z){var ie=this;this.currentType=k,this.typeBoxes.forEach(function(J){J.style.borderColor=J===z?ie.uiStyleSettings!==void 0?ie.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},R}(pe),ve=function(Y){function R(k,z,ie){var J=Y.call(this,k,z,ie)||this;return J.arrowType="end",J.arrowBaseHeight=10,J.arrowBaseWidth=10,J.getArrowPoints=J.getArrowPoints.bind(J),J.setArrowType=J.setArrowType.bind(J),J.arrowTypePanel=new ye("Arrow type","end"),J.arrowTypePanel.onArrowTypeChanged=J.setArrowType,J}return he(R,Y),R.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},R.prototype.getArrowPoints=function(k,z){var ie=this.arrowBaseWidth+2*this.strokeWidth,J=this.arrowBaseHeight+2*this.strokeWidth;return k-ie/2+","+(z+J/2)+" "+k+","+(z-J/2)+" "+(k+ie/2)+","+(z+J/2)},R.prototype.createTips=function(){this.arrow1=le.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=le.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.arrow2)},R.prototype.pointerDown=function(k,z){Y.prototype.pointerDown.call(this,k,z),this.state==="creating"&&this.createTips()},R.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",le.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),le.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),z=this.arrow1.transform.baseVal.getItem(0);z.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(z,0);var ie=this.arrow2.transform.baseVal.getItem(0);ie.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ie,0)}},R.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},Y.prototype.getState.call(this));return k.typeName=R.typeName,k},R.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var z=k;this.arrowType=z.arrowType,this.createTips(),this.adjustVisual()},R.typeName="ArrowMarker",R.title="Arrow marker",R.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',R}(Xe),ue=function(Y){function R(k,z,ie){var J=Y.call(this,k,z,ie)||this;return J.fillColor=ie.defaultFillColor,J.strokeWidth=0,J.fillPanel=new Ce("Color",ie.defaultColorSet,ie.defaultFillColor),J.fillPanel.onColorChanged=J.setFillColor,J}return he(R,Y),Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=R.typeName,k},R.typeName="CoverMarker",R.title="Cover marker",R.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',R}(rt),ce=function(Y){function R(k,z,ie,J){var De=Y.call(this,k,J||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return De.opacities=[],De.opacityBoxes=[],De.opacities=z,De.currentOpacity=ie,De.setCurrentOpacity=De.setCurrentOpacity.bind(De),De}return he(R,Y),R.prototype.getUi=function(){var k=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",z.style.justifyContent="space-between",this.opacities.forEach(function(ie){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="center",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=ie===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){k.setCurrentOpacity(ie,J)}),z.appendChild(J);var De=document.createElement("div");De.innerText=100*ie+"%",J.appendChild(De),k.opacityBoxes.push(J)}),z},R.prototype.setCurrentOpacity=function(k,z){var ie=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(J){J.style.borderColor=J===z?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},R}(pe),be=function(Y){function R(k,z,ie){var J=Y.call(this,k,z,ie)||this;return J.setOpacity=J.setOpacity.bind(J),J.fillColor=ie.defaultHighlightColor,J.strokeWidth=0,J.opacity=ie.defaultHighlightOpacity,J.fillPanel=new Ce("Color",ie.defaultColorSet,J.fillColor),J.fillPanel.onColorChanged=J.setFillColor,J.opacityPanel=new ce("Opacity",ie.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return he(R,Y),R.prototype.setOpacity=function(k){this.opacity=k,this.visual&&le.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=R.typeName,k},R.typeName="HighlightMarker",R.title="Highlight marker",R.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>',R}(ue),xe='<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>',Oe=function(Y){function R(k,z,ie){var J=Y.call(this,k,z,ie)||this;return J.bgColor="transparent",J.tipPosition={x:0,y:0},J.tipBase1Position={x:0,y:0},J.tipBase2Position={x:0,y:0},J.tipMoving=!1,J.color=ie.defaultStrokeColor,J.bgColor=ie.defaultFillColor,J.fontFamily=ie.defaultFontFamily,J.defaultSize={x:100,y:30},J.setBgColor=J.setBgColor.bind(J),J.getTipPoints=J.getTipPoints.bind(J),J.positionTip=J.positionTip.bind(J),J.setTipPoints=J.setTipPoints.bind(J),J.colorPanel=new Ce("Text color",ie.defaultColorSet,J.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>'),J.colorPanel.onColorChanged=J.setColor,J.bgColorPanel=new Ce("Fill color",ie.defaultColorSet,J.bgColor,xe),J.bgColorPanel.onColorChanged=J.setBgColor,J.fontFamilyPanel=new je("Font",ie.defaultFontFamilies,ie.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J.tipGrip=new Ge,J.tipGrip.visual.transform.baseVal.appendItem(le.createTransform()),J.controlBox.appendChild(J.tipGrip.visual),J}return he(R,Y),R.prototype.ownsTarget=function(k){return Y.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},R.prototype.createTip=function(){le.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=le.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},R.prototype.pointerDown=function(k,z){this.state==="new"&&Y.prototype.pointerDown.call(this,k,z),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(z)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Y.prototype.pointerDown.call(this,k,z)},R.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Y.prototype.pointerUp.call(this,k);else{var z=this.state==="creating";Y.prototype.pointerUp.call(this,k),this.setTipPoints(z),this.positionTip()}},R.prototype.manipulate=function(k){if(this.tipMoving){var z=this.unrotatePoint(k);this.tipPosition={x:z.x-this.manipulationStartLeft,y:z.y-this.manipulationStartTop},this.positionTip()}else Y.prototype.manipulate.call(this,k)},R.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(le.setAttributes(this.bgRectangle,[["fill",k]]),le.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},R.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},R.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var z=Math.min(this.height/2,15),ie=this.height/5;k&&(this.tipPosition={x:z+ie/2,y:this.height+20});var J=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ie=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:0},this.tipBase2Position={x:z+ie,y:0}):(this.tipBase1Position={x:0,y:z},this.tipBase2Position={x:0,y:z+ie}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ie=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-ie,y:0},this.tipBase2Position={x:this.width-z,y:0}):(this.tipBase1Position={x:this.width,y:z},this.tipBase2Position={x:this.width,y:z+ie}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?J<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ie=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-ie,y:this.height},this.tipBase2Position={x:this.width-z,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-z-ie},this.tipBase2Position={x:this.width,y:this.height-z}):J<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ie=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:this.height},this.tipBase2Position={x:z+ie,y:this.height}):(this.tipBase1Position={x:0,y:this.height-z},this.tipBase2Position={x:0,y:this.height-z-ie})},R.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.positionTip()},R.prototype.positionTip=function(){le.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(R.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),R.prototype.select=function(){this.positionTip(),Y.prototype.select.call(this)},R.prototype.getState=function(){var k=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Y.prototype.getState.call(this));return k.typeName=R.typeName,k},R.prototype.restoreState=function(k){var z=k;this.bgColor=z.bgColor,this.tipPosition=z.tipPosition,Y.prototype.restoreState.call(this,k),this.createTip(),this.setTipPoints()},R.prototype.scale=function(k,z){Y.prototype.scale.call(this,k,z),this.tipPosition={x:this.tipPosition.x*k,y:this.tipPosition.y*z},this.positionTip()},R.typeName="CalloutMarker",R.title="Callout marker",R.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>',R}(Fe),Ue=function(Y){function R(k,z,ie){var J=Y.call(this,k,z,ie)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.strokeColor=ie.defaultColor,J.strokeWidth=ie.defaultStrokeWidth,J.strokeDasharray=ie.defaultStrokeDasharray,J.fillColor=ie.defaultFillColor,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.setOpacity=J.setOpacity.bind(J),J.createVisual=J.createVisual.bind(J),J.strokePanel=new Ce("Line color",re(ie.defaultColorSet,["transparent"]),ie.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.fillPanel=new Ce("Fill color",re(ie.defaultColorSet,["transparent"]),J.fillColor,xe),J.fillPanel.onColorChanged=J.setFillColor,J.strokeWidthPanel=new ut("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new lt("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J.opacityPanel=new ce("Opacity",ie.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return he(R,Y),R.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual)},R.prototype.createVisual=function(){this.visual=le.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)},R.prototype.pointerDown=function(k,z){Y.prototype.pointerDown.call(this,k,z),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},R.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k)},R.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.setSize()},R.prototype.setSize=function(){Y.prototype.setSize.call(this),le.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},R.prototype.pointerUp=function(k){Y.prototype.pointerUp.call(this,k),this.setSize()},R.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&le.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},R.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&le.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},R.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&le.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},R.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&le.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},R.prototype.setOpacity=function(k){this.opacity=k,this.visual&&le.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),R.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=R.typeName,k},R.prototype.restoreState=function(k){var z=k;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},R.prototype.scale=function(k,z){Y.prototype.scale.call(this,k,z),this.setSize()},R.typeName="EllipseMarker",R.title="Ellipse marker",R.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>',R}(tt),Ke=function(Y){function R(k,z,ie){return Y.call(this,k,z,ie)||this}return he(R,Y),Object.defineProperty(R.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),R.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},R.prototype.createTips=function(){this.tip1=le.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(le.createTransform()),this.visual.appendChild(this.tip1),this.tip2=le.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(le.createTransform()),this.visual.appendChild(this.tip2)},R.prototype.pointerDown=function(k,z){Y.prototype.pointerDown.call(this,k,z),this.state==="creating"&&this.createTips()},R.prototype.adjustVisual=function(){if(Y.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(le.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()]]),le.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),z=this.tip1.transform.baseVal.getItem(0);z.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(z,0);var ie=this.tip2.transform.baseVal.getItem(0);ie.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ie,0)}},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=R.typeName,k},R.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},R.typeName="MeasurementMarker",R.title="Measurement marker",R.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>',R}(Xe),et=function(Y){function R(k,z,ie){var J=Y.call(this,k,z,ie)||this;return J.strokePanel.colors=ie.defaultColorSet,J.fillColor="transparent",J}return he(R,Y),Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=R.typeName,k},R.typeName="EllipseFrameMarker",R.title="Ellipse frame marker",R.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>',R}(Ue),it=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(R){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(R)||(this.undoStack.push(R),JSON.stringify(this.lastRedoStep)!==JSON.stringify(R)&&this.redoStack.splice(0,this.redoStack.length))},Y.prototype.replaceLastUndoStep=function(R){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=R)},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 R=this.undoStack.pop();return R!==void 0&&this.redoStack.push(R),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}(),nt=function(Y){function R(k,z,ie){var J=Y.call(this,k,z,ie)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.curveX=0,J.curveY=0,J.manipulationStartCurveX=0,J.manipulationStartCurveY=0,J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.positionGrips=J.positionGrips.bind(J),J.addControlGrips=J.addControlGrips.bind(J),J.adjustVisual=J.adjustVisual.bind(J),J.setupControlBox=J.setupControlBox.bind(J),J.resize=J.resize.bind(J),J.strokeColor=ie.defaultColor,J.strokeWidth=ie.defaultStrokeWidth,J.strokeDasharray=ie.defaultStrokeDasharray,J.strokePanel=new Ce("Line color",ie.defaultColorSet,ie.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new ut("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new lt("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return he(R,Y),R.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},R.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},R.prototype.createVisual=function(){this.visual=le.createGroup(),this.selectorCurve=le.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=le.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)},R.prototype.pointerDown=function(k,z){Y.prototype.pointerDown.call(this,k,z),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(z)&&(this.activeGrip=this.curveGrip,this._state="resize")},R.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),le.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),le.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),le.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},R.prototype.setupControlBox=function(){Y.prototype.setupControlBox.call(this),this.curveControlLine1=le.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=le.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)},R.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Y.prototype.addControlGrips.call(this)},R.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()))},R.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)},R.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)},R.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},R.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},R.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},R.prototype.scale=function(k,z){this.curveX=this.curveX*k,this.curveY=this.curveY*z,Y.prototype.scale.call(this,k,z)},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.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=R.typeName,k},R.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var z=k;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.curveX=z.curveX,this.curveY=z.curveY,this.createVisual(),this.adjustVisual()},R.typeName="CurveMarker",R.title="Curve marker",R.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>',R}(ze),yt=function(){function Y(R,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=R,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}(),bt=function(Y){function R(k,z,ie){var J=Y.call(this,k,!1)||this;return J.dataUrl=z,J.state=ie,J}return he(R,Y),R}(yt),dt=function(Y){function R(k,z,ie){ie===void 0&&(ie=!1);var J=Y.call(this,k,ie)||this;return J.marker=z,J}return he(R,Y),R}(yt),wt=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(R,k){this[R].push(k)},Y.prototype.removeEventListener=function(R,k){var z=this[R].indexOf(k);z>-1&&this[R].splice(z,1)},Y}(),Tt=function(){function Y(R){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Pe,this._isOpen=!1,this.undoRedoManager=new it,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 wt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Y.instanceCounter++,this.styles=new ge(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=R,this.targetRoot=document.body,this.width=R.clientWidth,this.height=R.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[Ne,_e,ve,Fe,et,Ue,be,Oe,Ke,ue,Xe,nt]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ne,_e,ve,Fe,Ue,be,Oe]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ne,_e,ve,Fe,be]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(R){var k=this;this._availableMarkerTypes.splice(0),R.forEach(function(z){if(typeof z=="string"){var ie=k.ALL_MARKER_TYPES.find(function(J){return J.typeName===z});ie!==void 0&&k._availableMarkerTypes.push(ie)}else k._availableMarkerTypes.push(z)})},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(R){this._zoomLevel=R,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(),Z.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Y.prototype.show=function(){var R=this;this.styles.styleSheetRoot===void 0&&oe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=oe.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new yt(R))})},Y.prototype.render=function(){return se(this,void 0,void 0,function(){var R;return me(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(R=new ae).naturalSize=this.renderAtNaturalSize,R.imageType=this.renderImageType,R.imageQuality=this.renderImageQuality,R.markersOnly=this.renderMarkersOnly,R.width=this.renderWidth,R.height=this.renderHeight,[4,R.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,R.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},Y.prototype.close=function(R){var k=this;if(R===void 0&&(R=!1),this.isOpen){var z=!1;R||this.eventListeners.beforeclose.forEach(function(ie){var J=new yt(k,!0);ie(J),J.defaultPrevented&&(z=!0)}),z||(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(ie){return ie(new yt(k))}),this.detachEvents(),this._isOpen=!1)}},Y.prototype.addMarkersToToolbar=function(){for(var R,k=[],z=0;z<arguments.length;z++)k[z]=arguments[z];(R=this._availableMarkerTypes).push.apply(R,k)},Y.prototype.addRenderEventListener=function(R){this.addEventListener("render",function(k){R(k.dataUrl,k.state)})},Y.prototype.removeRenderEventListener=function(R){},Y.prototype.addCloseEventListener=function(R){this.addEventListener("close",function(){R()})},Y.prototype.removeCloseEventListener=function(R){},Y.prototype.setupResizeObserver=function(){var R=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){R.resize(R.target.clientWidth,R.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return R.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Y.prototype.onPopupTargetResize=function(){var R=1*this.target.clientWidth/this.target.clientHeight,k=this.editorCanvas.clientWidth/R>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*R:this.editorCanvas.clientWidth,z=k<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/R;this.resize(k,z)},Y.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Y.prototype.resize=function(R,k){this._isResizing=!0;var z=R/this.imageWidth,ie=k/this.imageHeight;this.imageWidth=Math.round(R),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(z,ie),this._isResizing=!1},Y.prototype.scaleMarkers=function(R,k){var z,ie=this;this._currentMarker&&this._currentMarker instanceof Fe?this._currentMarker.scale(R,k):(z=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(J){J!==ie._currentMarker&&J.scale(R,k)}),z!==void 0&&this.setCurrentMarker(z)},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 R=this.editingTarget.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=R.left-k.left,this.top=R.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 R,k=[],z=0;z<arguments.length;z++)k[z]=arguments[z];this.defs=le.createDefs(),this.addDefsToImage(),(R=this.defs).append.apply(R,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 R=document.createElement("a");R.href="https://markerjs.com/",R.target="_blank",R.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>',R.title="Powered by marker.js",R.style.display="grid",R.style.alignItems="center",R.style.justifyItems="center",R.style.padding="3px",R.style.width="20px",R.style.height="20px",this.logoUI.appendChild(R),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 R=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=R+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Me(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Be(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(R){this.markerImage.removeChild(R.container),this.markers.indexOf(R)>-1&&this.markers.splice(this.markers.indexOf(R),1),R.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(R,k){if(R==="marker"&&k!==void 0)this.createNewMarker(k);else if(R==="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 R=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ie){var J=new dt(R,R._currentMarker,!0);ie(J),J.defaultPrevented&&(k=!0)}),!k){var z=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(ie){return ie(new dt(R,z))})}}},Y.prototype.clear=function(){var R=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(De){var qe=new dt(R,void 0,!0);De(qe),qe.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var z=function(De){var qe=ie.markers[De];ie.setCurrentMarker(ie.markers[De]),ie._currentMarker.dispose(),ie.markerImage.removeChild(ie._currentMarker.container),ie.markers.splice(ie.markers.indexOf(ie._currentMarker),1),ie.eventListeners.markerdelete.forEach(function(ft){return ft(new dt(R,qe))})},ie=this,J=this.markers.length-1;J>=0;J--)z(J);this.addUndoStep()}},Object.defineProperty(Y.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Y.prototype.showNotesEditor=function(){var R;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=(R=this._currentMarker.notes)!==null&&R!==void 0?R:"",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 R=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),z=this.undoRedoManager.getLastUndoStep();if(!z||z.width===k.width&&z.height===k.height){var ie=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),ie<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(J){return J(new yt(R))})}else this.undoRedoManager.replaceLastUndoStep(k),this.eventListeners.statechange.forEach(function(J){return J(new yt(R))})}},Y.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Y.prototype.undoStep=function(){var R=this,k=this.undoRedoManager.undo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new yt(R))}))},Y.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Y.prototype.redoStep=function(){var R=this,k=this.undoRedoManager.redo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new yt(R))}))},Y.prototype.stepZoom=function(){var R=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=R<this.zoomSteps.length-1?this.zoomSteps[R+1]:this.zoomSteps[0]},Y.prototype.panTo=function(R){this.contentDiv.scrollBy({left:this.prevPanPoint.x-R.x,top:this.prevPanPoint.y-R.y}),this.prevPanPoint=R},Y.prototype.startRenderAndClose=function(){return se(this,void 0,void 0,function(){var R,k,z=this;return me(this,function(ie){switch(ie.label){case 0:return[4,this.render()];case 1:return R=ie.sent(),k=this.getState(),this.eventListeners.render.forEach(function(J){return J(new bt(z,R,k))}),this.close(!0),[2]}})})},Y.prototype.getState=function(R){R===!0&&this.setCurrentMarker();var k={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(z){return k.markers.push(z.getState())}),k},Y.prototype.restoreState=function(R){var k=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);R.markers.forEach(function(z){var ie=k._availableMarkerTypes.find(function(De){return De.typeName===z.typeName});if(ie!==void 0){var J=k.addNewMarker(ie);J.restoreState(z),k.markers.push(J)}}),R.width&&R.height&&(R.width!==this.imageWidth||R.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/R.width,this.imageHeight/R.height),this.eventListeners.restorestate.forEach(function(z){return z(new yt(k))})},Y.prototype.addNewMarker=function(R){var k=le.createGroup();return this.markerImage.appendChild(k),new R(k,this.overlayContainer,this.settings)},Y.prototype.createNewMarker=function(R){var k,z=this;(k=typeof R=="string"?this._availableMarkerTypes.find(function(ie){return ie.typeName===R}):R)&&(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(ie){return ie(new dt(z,z._currentMarker))}))},Y.prototype.markerCreated=function(R){var k=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(R),this.setCurrentMarker(R),R instanceof _e&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(_e):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(z){return z(new dt(k,k._currentMarker))})},Y.prototype.colorChanged=function(R){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=R,this.settings.defaultStrokeColor=R)},Y.prototype.fillColorChanged=function(R){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=R)},Y.prototype.markerStateChanged=function(R){var k=this;this.eventListeners.markerchange.forEach(function(z){return z(new dt(k,R))})},Y.prototype.setCurrentMarker=function(R){var k=this;this._currentMarker!==R&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(z){return z(new dt(k,k._currentMarker))})),this._currentMarker=R,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(z){return z(new dt(k,k._currentMarker))}))},Y.prototype.onPointerDown=function(R){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||R.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(z){return z.ownsTarget(R.target)});k!==void 0?(this.setCurrentMarker(k),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(R.clientX,R.clientY),R.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:R.clientX,y:R.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(R.clientX,R.clientY))},Y.prototype.onDblClick=function(R){if(this._isFocused||this.focus(),this.mode==="select"){var k=this.markers.find(function(z){return z.ownsTarget(R.target)});k!==void 0&&k!==this._currentMarker&&this.setCurrentMarker(k),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(R.clientX,R.clientY),R.target):this.setCurrentMarker()}},Y.prototype.onPointerMove=function(R){this.touchPoints!==1&&R.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||R.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(R.clientX,R.clientY)):this.zoomLevel>1&&this.panTo({x:R.clientX,y:R.clientY}))},Y.prototype.onPointerUp=function(R){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(R.clientX,R.clientY)),this.isDragging=!1,this.addUndoStep()},Y.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Y.prototype.onKeyUp=function(R){this._currentMarker===void 0||this.notesArea!==void 0||R.key!=="Delete"&&R.key!=="Backspace"||this.deleteSelectedMarker()},Y.prototype.clientToLocalCoordinates=function(R,k){var z=this.markerImage.getBoundingClientRect();return{x:(R-z.left)/this.zoomLevel,y:(k-z.top)/this.zoomLevel}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var R=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=R+"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(R){Z.addKey(R)},Y.prototype.addEventListener=function(R,k){this.eventListeners.addEventListener(R,k)},Y.prototype.removeEventListener=function(R,k){this.eventListeners.removeEventListener(R,k)},Y.prototype.renderState=function(R){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(R),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Y.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Y.prototype.focus=function(){var R=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 yt(R))}))},Y.prototype.blur=function(){var R=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new yt(R))}))},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 Ct=function(Y,R){return(Ct=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,z){k.__proto__=z}||function(k,z){for(var ie in z)Object.prototype.hasOwnProperty.call(z,ie)&&(k[ie]=z[ie])})(Y,R)};function Nt(Y,R){if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");function k(){this.constructor=Y}Ct(Y,R),Y.prototype=R===null?Object.create(R):(k.prototype=R.prototype,new k)}function At(Y,R,k,z){return new(k||(k=Promise))(function(ie,J){function De(Lt){try{ft(z.next(Lt))}catch(st){J(st)}}function qe(Lt){try{ft(z.throw(Lt))}catch(st){J(st)}}function ft(Lt){var st;Lt.done?ie(Lt.value):(st=Lt.value,st instanceof k?st:new k(function(Pt){Pt(st)})).then(De,qe)}ft((z=z.apply(Y,R||[])).next())})}function It(Y,R){var k,z,ie,J,De={label:0,sent:function(){if(1&ie[0])throw ie[1];return ie[1]},trys:[],ops:[]};return J={next:qe(0),throw:qe(1),return:qe(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function qe(ft){return function(Lt){return function(st){if(k)throw new TypeError("Generator is already executing.");for(;De;)try{if(k=1,z&&(ie=2&st[0]?z.return:st[0]?z.throw||((ie=z.return)&&ie.call(z),0):z.next)&&!(ie=ie.call(z,st[1])).done)return ie;switch(z=0,ie&&(st=[2&st[0],ie.value]),st[0]){case 0:case 1:ie=st;break;case 4:return De.label++,{value:st[1],done:!1};case 5:De.label++,z=st[1],st=[0];continue;case 7:st=De.ops.pop(),De.trys.pop();continue;default:if(!(ie=De.trys,(ie=ie.length>0&&ie[ie.length-1])||st[0]!==6&&st[0]!==2)){De=0;continue}if(st[0]===3&&(!ie||st[1]>ie[0]&&st[1]<ie[3])){De.label=st[1];break}if(st[0]===6&&De.label<ie[1]){De.label=ie[1],ie=st;break}if(ie&&De.label<ie[2]){De.label=ie[2],De.ops.push(st);break}ie[2]&&De.ops.pop(),De.trys.pop();continue}st=R.call(Y,De)}catch(Pt){st=[6,Pt],z=0}finally{k=ie=0}if(5&st[0])throw st[1];return{value:st[0]?st[1]:void 0,done:!0}}([ft,Lt])}}}var gt=function(){function Y(){}return Y.addKey=function(R){Y.key=R},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}(),Ye=function(){function Y(){}return Y.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Y.setAttributes=function(R,k){for(var z=0,ie=k;z<ie.length;z++){var J=ie[z],De=J[0],qe=J[1];R.setAttribute(De,qe)}},Y.createRect=function(R,k,z){var ie=document.createElementNS("http://www.w3.org/2000/svg","rect");return ie.setAttribute("width",R.toString()),ie.setAttribute("height",k.toString()),z&&Y.setAttributes(ie,z),ie},Y.createLine=function(R,k,z,ie,J){var De=document.createElementNS("http://www.w3.org/2000/svg","line");return De.setAttribute("x1",R.toString()),De.setAttribute("y1",k.toString()),De.setAttribute("x2",z.toString()),De.setAttribute("y2",ie.toString()),J&&Y.setAttributes(De,J),De},Y.createPolygon=function(R,k){var z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return z.setAttribute("points",R),k&&Y.setAttributes(z,k),z},Y.createCircle=function(R,k){var z=document.createElementNS("http://www.w3.org/2000/svg","circle");return z.setAttribute("cx",(R/2).toString()),z.setAttribute("cy",(R/2).toString()),z.setAttribute("r",R.toString()),k&&Y.setAttributes(z,k),z},Y.createEllipse=function(R,k,z){var ie=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ie.setAttribute("cx",(R/2).toString()),ie.setAttribute("cy",(k/2).toString()),ie.setAttribute("rx",(R/2).toString()),ie.setAttribute("ry",(k/2).toString()),z&&Y.setAttributes(ie,z),ie},Y.createGroup=function(R){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return R&&Y.setAttributes(k,R),k},Y.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Y.createMarker=function(R,k,z,ie,J,De,qe){var ft=document.createElementNS("http://www.w3.org/2000/svg","marker");return Y.setAttributes(ft,[["id",R],["orient",k],["markerWidth",z.toString()],["markerHeight",ie.toString()],["refX",J.toString()],["refY",De.toString()]]),ft.appendChild(qe),ft},Y.createText=function(R){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),R&&Y.setAttributes(k,R),k},Y.createTSpan=function(R,k){var z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return z.textContent=R,k&&Y.setAttributes(z,k),z},Y.createImage=function(R){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return R&&Y.setAttributes(k,R),k},Y.createPoint=function(R,k){var z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return z.x=R,z.y=k,z},Y.createPath=function(R,k){var z=document.createElementNS("http://www.w3.org/2000/svg","path");return z.setAttribute("d",R),k&&Y.setAttributes(z,k),z},Y.createElement=function(R,k){var z=document.createElementNS("http://www.w3.org/2000/svg",R);return k&&Y.setAttributes(z,k),z},Y.getHollowRectanglePath=function(R,k,z,ie,J,De,qe,ft){return"M"+R+","+k+"V"+(k+ie)+"H"+(R+z)+"V"+k+"H"+J+"V"+De+"H"+(J+qe)+"V"+(De+ft)+"H"+J+"V"+k+"Z"},Y}(),_t=function(){function Y(R){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+R+"_"}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(R){return this.styleSheet===void 0&&this.addStyleSheet(),R.name=""+this.classNamePrefix+R.localName,this.classes.push(R),this.styleSheet.sheet.insertRule("."+R.name+" {"+R.style+"}",this.styleSheet.sheet.cssRules.length),R},Y.prototype.addRule=function(R){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(R),this.styleSheet.sheet.insertRule(R.selector+" {"+R.style+"}",this.styleSheet.sheet.cssRules.length)},Y.prototype.addStyleSheet=function(){var R;this.styleSheet=document.createElement("style"),((R=this.styleSheetRoot)!==null&&R!==void 0?R:document.head).appendChild(this.styleSheet),this.addRule(new $e("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new $e("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new $e("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Je("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Je("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Y.prototype.removeStyleSheet=function(){var R;this.styleSheet&&(((R=this.styleSheetRoot)!==null&&R!==void 0?R:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Y}(),$e=function(Y,R){this.selector=Y,this.style=R},Je=function(Y,R){this.localName=Y,this.style=R},vt=function(){function Y(){this.blocks=[],this.display=""}return Y.prototype.addButtonBlock=function(R){R.className=this.blockClassName,R.buttonClassName=this.buttonClassName,R.buttonColorsClassName=this.buttonColorsClassName,R.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(R)},Y.prototype.addElementBlock=function(R){R.className===void 0&&(R.className=this.blockClassName),this.blocks.push(R)},Y.prototype.getUI=function(){var R=document.createElement("div");return R.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,R.style.display=this.display,this.blocks.forEach(function(k){return R.appendChild(k.getUI())}),R},Y}(),St=function(){function Y(){}return Y.prototype.getUI=function(){var R=document.createElement("div");if(R.className=this.className,this.minWidth!==void 0&&(R.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":R.style.justifyContent="flex-start";break;case"center":R.style.justifyContent="center";break;case"end":R.style.justifyContent="flex-end"}return R.style.whiteSpace="nowrap",R},Y}(),Rt=function(Y){function R(){var k=Y!==null&&Y.apply(this,arguments)||this;return k.buttons=[],k}return Nt(R,Y),R.prototype.addButton=function(k){k.className=this.buttonClassName,k.colorsClassName=this.buttonColorsClassName,k.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(k)},R.prototype.getUI=function(){var k=Y.prototype.getUI.call(this);return this.buttons.forEach(function(z){return k.appendChild(z.getUI())}),k},R}(St),mt=function(){function Y(R,k){this._isActive=!1,this._isHidden=!1,this._icon=R,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(R){this._icon=R,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isActive",{get:function(){return this._isActive},set:function(R){this._isActive=R,this.adjustClassName()},enumerable:!1,configurable:!0}),Y.prototype.getUI=function(){var R=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 R.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}(),ct=function(Y){function R(){var k=Y!==null&&Y.apply(this,arguments)||this;return k.elements=[],k}return Nt(R,Y),R.prototype.addElement=function(k){this.elements.push(k)},R.prototype.getUI=function(){var k=Y.prototype.getUI.call(this);return this.elements.forEach(function(z){return k.appendChild(z)}),k},R}(St),Vt=function(){function Y(R,k){this.horizontal=R,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(R){return R/this.ratio},Y.prototype.getHorizontalLength=function(R){return R*this.ratio},Y}(),jt=function(){function Y(){}return Y.getIcon=function(R,k){if(R>0&&k>0){var z=new Vt(R,k),ie=z.ratio>=1?20:z.getHorizontalLength(20),J=z.ratio<1?20:z.getVerticalLength(20),De=document.createElementNS("http://www.w3.org/2000/svg","svg");De.setAttribute("xmlns","http://www.w3.org/2000/svg"),De.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(De);var qe=Ye.createDefs();De.appendChild(qe);var ft=Ye.createElement("clipPath",[["id","text-bg-clip"]]);qe.appendChild(ft);var Lt=Ye.createPath(Ye.getHollowRectanglePath((24-ie)/2,(24-J)/2,ie,J,(24-ie)/2+2,(24-J)/2+2,ie-4,J-4));De.appendChild(Lt);var st=Ye.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);st.appendChild(Ye.createTSpan(R+":"+k)),De.appendChild(st);var Pt=st.getBBox();Ye.setAttributes(st,[["x",((24-Pt.width)/2).toString()],["y",((24-Pt.height)/2-Pt.y).toString()]]);var Ut=Ye.createPath(Ye.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Pt.width))/2,(24-Math.ceil(Pt.height))/2,Math.ceil(Pt.width),Math.ceil(Pt.height)));return ft.appendChild(Ut),Ye.setAttributes(Lt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(De),De.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}(),qt=function(Y){function R(k,z,ie){var J=Y.call(this,k,z)||this;return J.isDropdownOpen=!1,J.onClick=J.dropdownButtonClicked,J.dropdownButtons=ie,J}return Nt(R,Y),R.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(z){z.className=k.className,z.colorsClassName=k.colorsClassName,k.dropdownBlock.appendChild(z.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},R.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},R.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},R.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},R.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},R.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},R}(mt),Wt=function(){function Y(R,k){this.GRIP_SIZE=10,this.color=R,this.fillColor=k,this.visual=Ye.createGroup(),this.visual.appendChild(Ye.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ye.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(R){return R===this.visual||R===this.visual.childNodes[0]||R===this.visual.childNodes[1]},Y.prototype.setCenter=function(R,k){this.visual.childNodes.forEach(function(z){return Ye.setAttributes(z,[["cx",R.toString()],["cy",k.toString()]])})},Y}(),rn=function(){function Y(R,k,z,ie){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=R,this.canvasHeight=k,this.margin=z,this.container=ie,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(R){this._aspectRatio=R,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(R){this._isGridVisible=R,this.gridContainer&&Ye.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(R){this._zoomFactor=R,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Y.prototype.open=function(){var R=this;this.cropShadeElement=Ye.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ye.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var k=0;k<this.numberOfGridLines;k++)this.horizontalGridLines.push(Ye.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ye.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(z){return R.gridContainer.appendChild(z)}),this.verticalGridLines.forEach(function(z){return R.gridContainer.appendChild(z)}),this.cropRectElement=Ye.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Wt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Wt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Wt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Wt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},Y.prototype.setCropRectangle=function(R){this.cropRect=R;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),Ye.setAttributes(this.cropRectElement,[["x",k.x.toString()],["y",k.y.toString()],["width",k.width.toString()],["height",k.height.toString()]]);var z=k.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(J,De){var qe=k.y+z*(De+1);Ye.setAttributes(J,[["x1",""+k.x],["y1",""+qe],["x2",""+(k.x+k.width)],["y2",""+qe]])});var ie=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(J,De){var qe=k.x+ie*(De+1);Ye.setAttributes(J,[["x1",""+qe],["y1",""+k.y],["x2",""+qe],["y2",""+(k.y+k.height)]])}),Ye.setAttributes(this.cropShadeElement,[["d",Ye.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(R,k){var z=this.container.getBoundingClientRect();return{x:R-z.left+this.margin,y:k-z.top+this.margin}},Y.prototype.onPointerDown=function(R){this.container.setPointerCapture(R.pointerId),this.previousPoint=this.clientToLocalCoordinates(R.clientX,R.clientY),this.cropRectElement===R.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(R.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(R.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(R.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(R.target)&&(this.activeGrip=this.bottomRightGrip)},Y.prototype.onPointerMove=function(R){if(this.isMoving)this.move(this.clientToLocalCoordinates(R.clientX,R.clientY));else if(this.activeGrip){var k=this.clientToLocalCoordinates(R.clientX,R.clientY);this.resize(k)}R.preventDefault()},Y.prototype.onPointerUp=function(R){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(R.pointerId)},Y.prototype.move=function(R){var k=R.x-this.previousPoint.x,z=R.y-this.previousPoint.y;this.zoomFactor!==1&&(k=-k/this.zoomFactor,z=-z/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+z),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=R},Y.prototype.resize=function(R){var k=Object.assign({},this.cropRect),z=R.x-this.previousPoint.x,ie=R.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:k.x+z<this.margin&&(z=this.margin-k.x),k.x+=z,k.width=this.cropRect.x+this.cropRect.width-k.x;break;case this.bottomRightGrip:case this.topRightGrip:k.width+z>this.canvasWidth*this.zoomFactor&&(z=this.canvasWidth*this.zoomFactor-k.width),k.width+=z}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(z),k.height=this.aspectRatio.getVerticalLength(k.width)):(k.y+=ie,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+=ie}k.width<10&&(k.x=this.cropRect.x,k.width=10),k.height<10&&(k.y=this.cropRect.y,k.height=10),this.previousPoint=R,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 R=this.cropRect.x+this.cropRect.width/2,k=this.cropRect.y+this.cropRect.height/2,z=this.aspectRatio.getHorizontalLength(this.cropRect.height),ie=this.aspectRatio.getVerticalLength(this.cropRect.width);z/this.canvasWidth<ie/this.canvasHeight?this.cropRect.width=z:this.cropRect.height=ie,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=R-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(R,k,z,ie,J,De){var qe=z/R,ft=ie/k;return{x:(J.x-De)*qe+De,y:(J.y-De)*ft+De,width:J.width*qe,height:J.height*ft}},Y.prototype.scaleCanvas=function(R,k){var z=this.getRescaledRect(this.canvasWidth,this.canvasHeight,R,k,this.cropRect,this.margin);this.canvasWidth=R,this.canvasHeight=k,this.onCropChange&&this.onCropChange(z),this.setCropRectangle(z)},Y}(),On=function(){function Y(R){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=R,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(R){this._angle=R,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(R){this.controlContainer.setPointerCapture(R.pointerId),this.isDragging=!0,this.previousPoint={x:R.clientX,y:R.clientY}},Y.prototype.onPointerMove=function(R){this.isDragging&&(this.onAngleChange&&this.onAngleChange((R.clientX-this.previousPoint.x)/5),this.previousPoint.x=R.clientX)},Y.prototype.onPointerUp=function(R){this.isDragging&&this.onAngleChange&&this.onAngleChange((R.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(R.pointerId)},Y.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var R=this.angleLabelText.getBBox();Ye.setAttributes(this.angleLabelElement,[["x",((this.width-R.width)/2).toString()],["y",(this.height/2).toString()]])}},Y.prototype.positionScaleShape=function(){if(this.scaleShape){var R=this.scaleShape.transform.baseVal.getItem(0);R.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(R,0)}},Y.prototype.getVisual=function(){var R=document.createElementNS("http://www.w3.org/2000/svg","svg");R.setAttribute("xmlns","http://www.w3.org/2000/svg"),R.setAttribute("width",this.width+"px"),R.setAttribute("height",this.height+"px"),R.setAttribute("viewBox","0 0 "+this.width+" "+this.height),R.style.flexShrink="0",document.body.appendChild(R);for(var k="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,z=1;z<=this.width/5+10;z++){var ie=z%5==0?this.height/3:this.height/6;k+="h4v"+-ie+"h1v"+ie}k+="v1H0Z",this.scaleShape=Ye.createPath(k);var J=Ye.createTransform();this.scaleShape.transform.baseVal.appendItem(J),R.appendChild(this.scaleShape),this.angleLabelElement=Ye.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ye.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var De=Ye.createTSpan("");return De.innerHTML="&deg;",this.angleLabelElement.appendChild(De),R.appendChild(this.angleLabelElement),document.body.removeChild(R),R},Y}(),Ln=function(){function Y(){this.naturalSize=!1,this.imageType="image/png"}return Y.prototype.rasterize=function(R,k,z,ie,J,De,qe){var ft=this;return new Promise(function(Lt){var st=document.createElement("canvas");st.width=R.width.baseVal.value-2*ie,st.height=R.height.baseVal.value-2*ie;var Pt=1,Ut=1;ft.naturalSize===!0?(Pt=k.naturalWidth/(R.width.baseVal.value-2*ie)/De,Ut=k.naturalHeight/(R.height.baseVal.value-2*ie)/qe,st.width=k.naturalWidth/De,st.height=k.naturalHeight/qe):ft.width!==void 0&&ft.height!==void 0&&(Pt=ft.width/z.width,Ut=ft.height/z.height,st.width*=Pt,st.height*=Ut);var mn=st.getContext("2d");mn.translate(st.width/2,st.height/2),mn.rotate(J*Math.PI/180),mn.scale(De,qe),mn.translate(-st.width/2,-st.height/2),mn.drawImage(k,0,0,st.width,st.height);var Fn=document.createElement("canvas");Fn.width=z.width*Pt,Fn.height=z.height*Ut,Fn.getContext("2d").putImageData(mn.getImageData((z.x-ie)*Pt,(z.y-ie)*Ut,z.width*Pt,z.height*Ut),0,0),Lt(Fn.toDataURL(ft.imageType,ft.imageQuality))})},Y}(),Qe=function(){function Y(R){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 _t(this.instanceNo),this.target=R,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(R){this._zoomToCropEnabled=R,R?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(R){this._isGridVisible=R,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"gridLines",{get:function(){return this._gridLines},set:function(R){this._gridLines=R,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(R){this._rotationAngle=R,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 R;return(R=this._aspectRatio)!==null&&R!==void 0?R:this.aspectRatios[0]},set:function(R){this._aspectRatio=R},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(R){R===void 0&&(R=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),R||this.closeEventListeners.forEach(function(k){return k()}),this._isOpen=!1)},Y.prototype.addRenderEventListener=function(R){this.renderEventListeners.push(R)},Y.prototype.removeRenderEventListener=function(R){this.renderEventListeners.indexOf(R)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(R),1)},Y.prototype.addCloseEventListener=function(R){this.closeEventListeners.push(R)},Y.prototype.removeCloseEventListener=function(R){this.closeEventListeners.indexOf(R)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(R),1)},Y.prototype.setupResizeObserver=function(){var R=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){R.resize(R.target.clientWidth,R.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 R=1*this.target.clientWidth/this.target.clientHeight,k=this.contentDiv.clientWidth/R>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*R:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,z=k+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/R;this.resize(k,z)}},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",Ye.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(R,k){this.imageWidth=Math.round(R),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 R=document.createElement("canvas");R.width=this.target.naturalWidth,R.height=this.target.naturalHeight,R.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var k=R.toDataURL();Ye.setAttributes(this.editingTarget,[["href",k]]),this.setEditingTargetSize()},Y.prototype.setTopLeft=function(){var R=this.target.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=R.left-k.left-this.CANVAS_MARGIN,this.top=R.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=Ye.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ye.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ye.createGroup(),this.editingTargetRotationScaleContainer=Ye.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var R=Ye.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(R);var k=Ye.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(k),this.editingTargetContainer=Ye.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=Ye.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new rn(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 R=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=R+"px "+k+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-R+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(R){this.cropRect=R,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 R=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,k=this.target.offsetTop>R+this.CANVAS_MARGIN?this.target.offsetTop-(R+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 R=this;this.topToolbar=new vt,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 Rt;k.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(k);var z=[];this.aspectRatios.forEach(function(Ut){var mn=new mt(jt.getIcon(Ut.horizontal,Ut.vertical),Ut.horizontal===0&&Ut.vertical===0?"FREE":Ut.horizontal+":"+Ut.vertical);mn.onClick=function(){return R.ratioButtonClicked(Ut)},z.push(mn)}),this.aspectRatioButton=new qt(jt.getIcon(0,0),"Aspect ratio",z),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 ie=new mt('<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");ie.isActive=this.isGridVisible,ie.onClick=function(){R.isGridVisible=!R.isGridVisible,ie.isActive=R.isGridVisible},k.addButton(ie);var J=new mt('<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(J.isActive=this.zoomToCropEnabled,J.onClick=function(){R.zoomToCropEnabled=!R.zoomToCropEnabled,J.isActive=R.zoomToCropEnabled},k.addButton(J),!gt.isLicensed){var De=new ct;this.topToolbar.addElementBlock(De);var qe=document.createElement("div");qe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ft=document.createElement("a");ft.style.color="currentColor",ft.href="https://markerjs.com/products/cropro",ft.target="_blank",ft.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>',qe.appendChild(ft),De.addElement(qe)}var Lt=new Rt;Lt.minWidth=3*this.toolbarHeight+"px",Lt.contentAlign="end",this.topToolbar.addButtonBlock(Lt);var st=new mt('<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");st.onClick=this.startRenderAndClose,Lt.addButton(st),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(st.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Pt=new mt('<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");Pt.onClick=this.close,Lt.addButton(Pt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Pt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},Y.prototype.addBottomToolbar=function(){var R=this;this.bottomToolbar=new vt,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 Rt;k.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(k);var z=new mt('<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");z.onClick=this.rotateLeftButtonClicked,k.addButton(z);var ie=new mt('<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");ie.onClick=this.rotateRightButtonClicked,k.addButton(ie);var J=new ct;J.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(J),this.straightener=new On("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(Lt){R.rotateBy(Lt),R.straightener.angle=R.rotationAngle},J.addElement(this.straightener.getUI());var De=new Rt;De.minWidth=2*this.toolbarHeight+"px",De.contentAlign="end",this.bottomToolbar.addButtonBlock(De);var qe=new mt('<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");qe.onClick=this.flipHorizontallyButtonClicked,De.addButton(qe);var ft=new mt('<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");ft.onClick=this.flipVerticallyButtonClicked,De.addButton(ft)},Y.prototype.ratioButtonClicked=function(R){this.aspectRatio=R,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},Y.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=jt.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 Vt(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(R){if(R){var k=this.cropLayer.getRescaledRect(R.width,R.height,this.imageWidth,this.imageHeight,R.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(k),this.cropRectChanged(k),this.flippedHorizontally=R.flippedHorizontally,this.flippedVertically=R.flippedVertically,this.applyFlip(),this.rotationAngle=R.rotationAngle,this.applyRotation()}},Y.prototype.clientToLocalCoordinates=function(R,k){var z=this.cropImage.getBoundingClientRect();return{x:R-z.left,y:k-z.top}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var R=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=R+"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 R=this.rotationAngle-90;this.rotationAngle%90!=0&&(R+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(R)},Y.prototype.rotateRightButtonClicked=function(){var R=this.rotationAngle+90;this.rotationAngle%90!=0&&(R-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(R)},Y.prototype.rotateTo=function(R){R=(R=R>180?R-360:R)<=-180?R+360:R,this.rotationAngle=R,this.applyRotation()},Y.prototype.rotateBy=function(R){this.rotateTo((this.rotationAngle+R)%360)},Y.prototype.applyRotation=function(){var R=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 z=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/z.width,this.imageHeight/z.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=R},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 At(this,void 0,void 0,function(){var R,k;return It(this,function(z){switch(z.label){case 0:return[4,this.render()];case 1:return R=z.sent(),k=this.getState(),this.renderEventListeners.forEach(function(ie){return ie(R,k)}),this.close(!0),[2]}})})},Y.prototype.render=function(){return At(this,void 0,void 0,function(){var R;return It(this,function(k){switch(k.label){case 0:return(R=new Ln).naturalSize=this.renderAtNaturalSize,R.imageType=this.renderImageType,R.imageQuality=this.renderImageQuality,R.width=this.renderWidth,R.height=this.renderHeight,this.unzoomFromCrop(),Ye.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,R.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,R.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 Je("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 Je("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Je("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var R=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Je("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*R)+`px;
height: `+(this.toolbarHeight-2*R)+`px;
padding: `+R+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Je("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Je("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new $e("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new $e("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Je("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 Je("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Je("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 Je("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*R)+`px;
padding: `+R+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Je("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},Y.instanceCounter=0,Y}(),ht=H("8hTe"),Qt=H.n(ht),pn=/<pre[^>]*>/g;function _n(Y){var R=document.createElement("div");return R.innerHTML=Y,R.childNodes.length===0?"":R.childNodes[0].nodeValue}var fn=Ee.a=function(Y){var R=Y.value,k=R===void 0?"":R,z=Y.edit,ie=z===void 0?!1:z,J=Y.className,De=Y.showTextOnly,qe=Y.showLines,ft=Y.replaces,Lt=Y.zoomImg,st=Y.hasMask,Pt=Y.style,Ut=Pt===void 0?{}:Pt,mn=Y.stylesPrev,Fn=mn===void 0?{}:mn,kn=String(k),Tn=Object(D.useRef)(),er=Object(D.useRef)(),_r=Object(D.useState)(""),Kt=Object(G.a)(_r,2),Bt=Kt[0],zt=Kt[1],$t=Object(D.useState)("office"),Zt=Object(G.a)($t,2),an=Zt[0],bn=Zt[1],Pn=function(){var Xt=new Qe(er.current);Xt.displayMode="popup",Xt.addRenderEventListener(function(){var wn=Object(P.a)(n.a.mark(function Yt(sn){var on;return n.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:return Tn.current.style.display="none",Mn.next=3,Object(we.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:sn}});case 3:on=Mn.sent,on!=null&&on.id&&ft(er.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(on==null?void 0:on.id,"?type=").concat(on.content_type));case 5:case"end":return Mn.stop()}},Yt)}));return function(Yt){return wn.apply(this,arguments)}}()),Xt.show()},Un=function(){var Xt=new Tt(er.current);Xt.settings.displayMode="popup",Xt.addEventListener("render",function(){var wn=Object(P.a)(n.a.mark(function Yt(sn){var on;return n.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:if(Tn.current.style.display="none",!er.current){Mn.next=6;break}return Mn.next=4,Object(we.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:sn.dataUrl}});case 4:on=Mn.sent,on!=null&&on.id&&ft(er.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(on==null?void 0:on.id,"?type=").concat(on.content_type));case 6:case"end":return Mn.stop()}},Yt)}));return function(Yt){return wn.apply(this,arguments)}}()),Xt.show(),window.markerArea=Xt},Cn=Object(D.useMemo)(function(){Tn.current&&(Tn.current.style.zIndex=-1);try{var dn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Xt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,wn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;kn=kn.replace(dn,"("+Q.a.API_SERVER+"/api/attachments/").replace(Xt,'"'+Q.a.API_SERVER+"/api/attachments/").replace(wn,'"'+Q.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(rr){}var Yt=M(kn),sn=E();if(kn.match(/\[TOC\]/)&&(Yt=Yt.replace("<p>[TOC]</p>",L()),O()),Yt=Yt.replace(/(__special_katext_id_\d+__)/g,function(rr,Mn){var nn=sn[Mn],xr=nn.type,Qn=nn.expression;return Object(ne.renderToString)(_n(Qn)||"",{displayMode:xr==="block",throwOnError:!1,output:"html"})}),Yt=Yt.replace(/▁/g,"\u2581\u2581\u2581"),h(),De){var on=document.createElement("div");return on.innerHTML=Yt,on.innerText}return setTimeout(function(){return Er()},500),Yt},[kn]),Bn=Object(D.useRef)();w.WebkitLineClamp=qe,qe&&(Ut=Object(j.a)(Object(j.a)({},Ut),w));function tr(dn){var Xt=dn.target;if(Xt.tagName.toUpperCase()==="IMG"){if(Lt){var wn=Xt.getAttribute("src");zt(wn),bn("image")}}else if(Xt.tagName.toUpperCase()==="A"){var Yt=Xt.getAttribute("href");if(Yt.indexOf("office")>-1)dn.preventDefault(),zt(Yt),bn("office");else if(Yt.indexOf("application/pdf")>-1)dn.preventDefault(),zt(Yt),bn("pdf");else if(Yt.indexOf("text/html")>-1)dn.preventDefault(),zt(Yt),bn("html");else if(Yt.startsWith("#")){dn.preventDefault();var sn=document.getElementById(Yt.replace("#",""));sn&&sn.scrollIntoView(!0)}}}var Er=function(){var Xt,wn=(Xt=Bn.current)===null||Xt===void 0?void 0:Xt.querySelectorAll("video");wn==null||wn.forEach(function(Yt){if(Yt.oncontextmenu=function(){return!1},Yt.src.indexOf(".m3u8")>-1&&!Yt.canPlayType("application/vnd.apple.mpegurl")){if(K.a.isSupported()){var sn=new K.a;sn.loadSource(Yt.src),sn.attachMedia(Yt)}}})};Object(D.useEffect)(function(){if(Bn.current&&Cn&&(Cn.match(pn)&&window.PR.prettyPrint()),Bn.current)return Bn.current.addEventListener("click",tr),function(){Bn.current.removeEventListener("click",tr),h(),O()}},[Cn,Bn.current,tr]);var nr=function(Xt){if(!ie)return;Xt.target.nodeName==="IMG"?(Tn.current.style.zIndex=1,Tn.current.style.display="flex",Tn.current.style.width=Xt.target.clientWidth+"px",Tn.current.style.height=Xt.target.clientHeight+"px",Tn.current.style.top=Xt.target.offsetTop+"px",Tn.current.style.left=Xt.target.offsetLeft+"px",er.current.src=Xt.target.getAttribute("src")):Tn.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:Bn,style:Object(j.a)({},Ut),className:"".concat(J||""," markdown-body ").concat(Qt.a.mdBody),onMouseOver:nr,dangerouslySetInnerHTML:{__html:Cn}}),y.a.createElement("div",{ref:Tn,className:Qt.a.button},y.a.createElement(V.a,null,y.a.createElement($.a,{onClick:function(){return Pn()}},"\u88C1\u526A"),y.a.createElement($.a,{onClick:function(){return Un()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:er,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(fe.a,{close:!0,data:Bt,type:Bt!=null&&Bt.length?an:"",style:Object(j.a)({},Fn),onClose:function(){return zt("")}}))}},"9VGf":function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return N});var ee=H("q1tI"),V=H.n(ee);function N($,j){var P=Object(ee.useRef)();Object(ee.useEffect)(function(){P.current=$}),Object(ee.useEffect)(function(){function G(){P.current()}if(j!==null){var W=setInterval(G,j);return function(){return clearInterval(W)}}},[j])}},BU3w:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return P});var ee=H("MNnm"),V="rc-util-key";function N(G){if(G.attachTo)return G.attachTo;var W=document.querySelector("head");return W||document.body}function $(G){var W,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ee.a)())return null;var D=document.createElement("style");if((W=n.csp)===null||W===void 0?void 0:W.nonce){var y;D.nonce=(y=n.csp)===null||y===void 0?void 0:y.nonce}D.innerHTML=G;var g=N(n),p=g.firstChild;return n.prepend&&g.prepend?g.prepend(D):n.prepend&&p?g.insertBefore(D,p):g.appendChild(D),D}var j=new Map;function P(G,W){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=N(n);if(!j.has(D)){var y=$("",n),g=y.parentNode;j.set(D,g),g.removeChild(y)}var p=Array.from(j.get(D).children).find(function(d){return d.tagName==="STYLE"&&d[V]===W});if(p){var l,a;if(((l=n.csp)===null||l===void 0?void 0:l.nonce)&&p.nonce!==((a=n.csp)===null||a===void 0?void 0:a.nonce)){var f;p.nonce=(f=n.csp)===null||f===void 0?void 0:f.nonce}return p.innerHTML!==G&&(p.innerHTML=G),p}var u=$(G,n);return u[V]=W,u}},Bd2K:function(at,Ee,H){(function(ee){ee(H("VrN/"),H("osHv"))})(function(ee){ee.defineOption("autoCloseTags",!1,function(n,D,y){if(y!=ee.Init&&y&&n.removeKeyMap("autoCloseTags"),!D)return;var g={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(g["'/'"]=function(p){return P(p)}),(typeof D!="object"||D.whenOpening!==!1)&&(g["'>'"]=function(p){return $(p)}),n.addKeyMap(g)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],N=["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 $(n){if(n.getOption("disableInput"))return ee.Pass;for(var D=n.listSelections(),y=[],g=n.getOption("autoCloseTags"),p=0;p<D.length;p++){if(!D[p].empty())return ee.Pass;var l=D[p].head,a=n.getTokenAt(l),f=ee.innerMode(n.getMode(),a.state),u=f.state,d=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(u),i=d&&d.name;if(!i)return ee.Pass;var o=f.mode.configuration=="html",O=typeof g=="object"&&g.dontCloseTags||o&&V,w=typeof g=="object"&&g.indentTags||o&&N;a.end>l.ch&&(i=i.slice(0,i.length-a.end+l.ch));var C=i.toLowerCase();if(!i||a.type=="string"&&(a.end!=l.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||a.string.length==1)||a.type=="tag"&&d.close||a.string.indexOf("/")==l.ch-a.start-1||O&&G(O,C)>-1||W(n,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(u)||[],i,l,!0))return ee.Pass;var L=typeof g=="object"&&g.emptyTags;if(L&&G(L,i)>-1){y[p]={text:"/>",newPos:ee.Pos(l.line,l.ch+2)};continue}var A=w&&G(w,C)>-1;y[p]={indent:A,text:">"+(A?`
`:"")+"</"+i+">",newPos:A?ee.Pos(l.line+1,0):ee.Pos(l.line,l.ch+1)}}for(var _=typeof g=="object"&&g.dontIndentOnAutoClose,p=D.length-1;p>=0;p--){var T=y[p];n.replaceRange(T.text,D[p].head,D[p].anchor,"+insert");var v=n.listSelections().slice(0);v[p]={head:T.newPos,anchor:T.newPos},n.setSelections(v),!_&&T.indent&&(n.indentLine(T.newPos.line,null,!0),n.indentLine(T.newPos.line+1,null,!0))}}function j(n,D){for(var y=n.listSelections(),g=[],p=D?"/":"</",l=n.getOption("autoCloseTags"),a=typeof l=="object"&&l.dontIndentOnSlash,f=0;f<y.length;f++){if(!y[f].empty())return ee.Pass;var u=y[f].head,d=n.getTokenAt(u),i=ee.innerMode(n.getMode(),d.state),o=i.state;if(D&&(d.type=="string"||d.string.charAt(0)!="<"||d.start!=u.ch-1))return ee.Pass;var O,w=i.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(w&&i.mode.name=="javascript")O=p+"script";else if(w&&i.mode.name=="css")O=p+"style";else{var C=i.mode.xmlCurrentContext&&i.mode.xmlCurrentContext(o);if(!C||C.length&&W(n,C,C[C.length-1],u))return ee.Pass;O=p+C[C.length-1]}n.getLine(u.line).charAt(d.end)!=">"&&(O+=">"),g[f]=O}if(n.replaceSelections(g),y=n.listSelections(),!a)for(var f=0;f<y.length;f++)(f==y.length-1||y[f].head.line<y[f+1].head.line)&&n.indentLine(y[f].head.line)}function P(n){return n.getOption("disableInput")?ee.Pass:j(n,!0)}ee.commands.closeTag=function(n){return j(n)};function G(n,D){if(n.indexOf)return n.indexOf(D);for(var y=0,g=n.length;y<g;++y)if(n[y]==D)return y;return-1}function W(n,D,y,g,p){if(!ee.scanForClosingTag)return!1;var l=Math.min(n.lastLine()+1,g.line+500),a=ee.scanForClosingTag(n,g,null,l);if(!a||a.tag!=y)return!1;for(var f=p?1:0,u=D.length-1;u>=0&&D[u]==y;u--)++f;g=a.to;for(var u=1;u<f;u++){var d=ee.scanForClosingTag(n,g,null,l);if(!d||d.tag!=y)return!1;g=d.to}return!0}})},BjJ7:function(at,Ee,H){"use strict";H.d(Ee,"d",function(){return V}),H.d(Ee,"c",function(){return N}),H.d(Ee,"e",function(){return $}),H.d(Ee,"b",function(){return j}),H.d(Ee,"a",function(){return G});var ee=H("m3rI");function V(W){var n=!0;if(W.length>0){for(var D=0;D<W.length;D++)if(W[D].compile_success==0||!W[D].compile_success){n=!1;break}}else n=!1;return n}function N(W){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],y=0;y<W.length;y++){var g=W[y],p=n?"".concat(n,"/").concat(g.name):"".concat(g.name);D.push({title:g.name,isLeaf:!(g.type==="tree"),key:p})}return D}function $(W,n,D){for(var y=0;y<W.length;y++){var g=W[y];if(g.key===n){g.children=D;break}g.children&&$(g.children,n,D)}return W}function j(W,n,D){var y;return function(){var g=this,p=arguments,l=function(){y=null,D||W.apply(g,p)},a=D&&!y;clearTimeout(y),y=setTimeout(l,n),a&&W.apply(g,p)}}var P=!0,G=ee.a.API_SERVER},"C+DQ":function(at,Ee,H){},"C/vA":function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return ee});function ee(V){const N=this;let $=!1,j;return function(){return $||($=!0,j=V.apply(N,arguments)),j}}},"Cg/j":function(at,Ee,H){"use strict";H.d(Ee,"b",function(){return ee}),H.d(Ee,"a",function(){return V}),H.d(Ee,"c",function(){return $}),H.d(Ee,"d",function(){return j});var ee;(function(P){P.serviceIds=new Map,P.DI_TARGET="$di$target",P.DI_DEPENDENCIES="$di$dependencies";function G(W){return W[P.DI_DEPENDENCIES]||[]}P.getServiceDependencies=G})(ee||(ee={}));const V=$("instantiationService");function N(P,G,W,n){G[ee.DI_TARGET]===G?G[ee.DI_DEPENDENCIES].push({id:P,index:W,optional:n}):(G[ee.DI_DEPENDENCIES]=[{id:P,index:W,optional:n}],G[ee.DI_TARGET]=G)}function $(P){if(ee.serviceIds.has(P))return ee.serviceIds.get(P);const G=function(W,n,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");N(G,W,D,!1)};return G.toString=()=>P,ee.serviceIds.set(P,G),G}function j(P){return function(G,W,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");N(P,G,n,!0)}}},DlQD:function(at,Ee,H){(function(ee,V){at.exports=V()})(this,function(){"use strict";function ee(_e,ye){for(var ve=0;ve<ye.length;ve++){var ue=ye[ve];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(_e,ue.key,ue)}}function V(_e,ye,ve){return ye&&ee(_e.prototype,ye),ve&&ee(_e,ve),_e}function N(_e,ye){if(!_e)return;if(typeof _e=="string")return $(_e,ye);var ve=Object.prototype.toString.call(_e).slice(8,-1);if(ve==="Object"&&_e.constructor&&(ve=_e.constructor.name),ve==="Map"||ve==="Set")return Array.from(_e);if(ve==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ve))return $(_e,ye)}function $(_e,ye){(ye==null||ye>_e.length)&&(ye=_e.length);for(var ve=0,ue=new Array(ye);ve<ye;ve++)ue[ve]=_e[ve];return ue}function j(_e,ye){var ve;if(typeof Symbol=="undefined"||_e[Symbol.iterator]==null){if(Array.isArray(_e)||(ve=N(_e))||ye&&_e&&typeof _e.length=="number"){ve&&(_e=ve);var ue=0;return function(){return ue>=_e.length?{done:!0}:{done:!1,value:_e[ue++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return ve=_e[Symbol.iterator](),ve.next.bind(ve)}function P(_e,ye){return ye={exports:{}},_e(ye,ye.exports),ye.exports}var G=P(function(_e){function ye(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function ve(ue){_e.exports.defaults=ue}_e.exports={defaults:ye(),getDefaults:ye,changeDefaults:ve}}),W=G.defaults,n=G.getDefaults,D=G.changeDefaults,y=/[&<>"']/,g=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},f=function(ye){return a[ye]};function u(_e,ye){if(ye){if(y.test(_e))return _e.replace(g,f)}else if(p.test(_e))return _e.replace(l,f);return _e}var d=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(_e){return _e.replace(d,function(ye,ve){return ve=ve.toLowerCase(),ve==="colon"?":":ve.charAt(0)==="#"?ve.charAt(1)==="x"?String.fromCharCode(parseInt(ve.substring(2),16)):String.fromCharCode(+ve.substring(1)):""})}var o=/(^|[^\[])\^/g;function O(_e,ye){_e=_e.source||_e,ye=ye||"";var ve={replace:function(ce,be){return be=be.source||be,be=be.replace(o,"$1"),_e=_e.replace(ce,be),ve},getRegex:function(){return new RegExp(_e,ye)}};return ve}var w=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(_e,ye,ve){if(_e){var ue;try{ue=decodeURIComponent(i(ve)).replace(w,"").toLowerCase()}catch(ce){return null}if(ue.indexOf("javascript:")===0||ue.indexOf("vbscript:")===0||ue.indexOf("data:")===0)return null}ye&&!C.test(ve)&&(ve=c(ye,ve));try{ve=encodeURI(ve).replace(/%25/g,"%")}catch(ce){return null}return ve}var A={},_=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(_e,ye){A[" "+_e]||(_.test(_e)?A[" "+_e]=_e+"/":A[" "+_e]=U(_e,"/",!0)),_e=A[" "+_e];var ve=_e.indexOf(":")===-1;return ye.substring(0,2)==="//"?ve?ye:_e.replace(T,"$1")+ye:ye.charAt(0)==="/"?ve?ye:_e.replace(v,"$1")+ye:_e+ye}var E={exec:function(){}};function h(_e){for(var ye=1,ve,ue;ye<arguments.length;ye++){ve=arguments[ye];for(ue in ve)Object.prototype.hasOwnProperty.call(ve,ue)&&(_e[ue]=ve[ue])}return _e}function x(_e,ye){var ve=_e.replace(/\|/g,function(be,xe,Oe){for(var Ue=!1,Ke=xe;--Ke>=0&&Oe[Ke]==="\\";)Ue=!Ue;return Ue?"|":" |"}),ue=ve.split(/ \|/),ce=0;if(ue.length>ye)ue.splice(ye);else for(;ue.length<ye;)ue.push("");for(;ce<ue.length;ce++)ue[ce]=ue[ce].trim().replace(/\\\|/g,"|");return ue}function U(_e,ye,ve){var ue=_e.length;if(ue===0)return"";for(var ce=0;ce<ue;){var be=_e.charAt(ue-ce-1);if(be===ye&&!ve)ce++;else if(be!==ye&&ve)ce++;else break}return _e.substr(0,ue-ce)}function F(_e,ye){if(_e.indexOf(ye[1])===-1)return-1;for(var ve=_e.length,ue=0,ce=0;ce<ve;ce++)if(_e[ce]==="\\")ce++;else if(_e[ce]===ye[0])ue++;else if(_e[ce]===ye[1]&&(ue--,ue<0))return ce;return-1}function S(_e){_e&&_e.sanitize&&!_e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var M={escape:u,unescape:i,edit:O,cleanUrl:L,resolveUrl:c,noopTest:E,merge:h,splitCells:x,rtrim:U,findClosingBracket:F,checkSanitizeDeprecation:S},I=G.defaults,b=M.rtrim,K=M.splitCells,Q=M.escape,ne=M.findClosingBracket;function fe(_e,ye,ve){var ue=ye.href,ce=ye.title?Q(ye.title):null,be=_e[1].replace(/\\([\[\]])/g,"$1");return _e[0].charAt(0)!=="!"?{type:"link",raw:ve,href:ue,title:ce,text:be}:{type:"image",raw:ve,href:ue,title:ce,text:Q(be)}}function we(_e,ye){var ve=_e.match(/^(\s+)(?:```)/);if(ve===null)return ye;var ue=ve[1];return ye.split(`
`).map(function(ce){var be=ce.match(/^\s+/);if(be===null)return ce;var xe=be[0];return xe.length>=ue.length?ce.slice(ue.length):ce}).join(`
`)}var Se=function(){function _e(ve){this.options=ve||I}var ye=_e.prototype;return ye.space=function(ue){var ce=this.rules.block.newline.exec(ue);if(ce)return ce[0].length>1?{type:"space",raw:ce[0]}:{raw:`
`}},ye.code=function(ue,ce){var be=this.rules.block.code.exec(ue);if(be){var xe=ce[ce.length-1];if(xe&&xe.type==="paragraph")return{raw:be[0],text:be[0].trimRight()};var Oe=be[0].replace(/^ {4}/gm,"");return{type:"code",raw:be[0],codeBlockStyle:"indented",text:this.options.pedantic?Oe:b(Oe,`
`)}}},ye.fences=function(ue){var ce=this.rules.block.fences.exec(ue);if(ce){var be=ce[0],xe=we(be,ce[3]||"");return{type:"code",raw:be,lang:ce[2]?ce[2].trim():ce[2],text:xe}}},ye.heading=function(ue){var ce=this.rules.block.heading.exec(ue);if(ce)return{type:"heading",raw:ce[0],depth:ce[1].length,text:ce[2]}},ye.nptable=function(ue){var ce=this.rules.block.nptable.exec(ue);if(ce){var be={type:"table",header:K(ce[1].replace(/^ *| *\| *$/g,"")),align:ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ce[3]?ce[3].replace(/\n$/,"").split(`
`):[],raw:ce[0]};if(be.header.length===be.align.length){var xe=be.align.length,Oe;for(Oe=0;Oe<xe;Oe++)/^ *-+: *$/.test(be.align[Oe])?be.align[Oe]="right":/^ *:-+: *$/.test(be.align[Oe])?be.align[Oe]="center":/^ *:-+ *$/.test(be.align[Oe])?be.align[Oe]="left":be.align[Oe]=null;for(xe=be.cells.length,Oe=0;Oe<xe;Oe++)be.cells[Oe]=K(be.cells[Oe],be.header.length);return be}}},ye.hr=function(ue){var ce=this.rules.block.hr.exec(ue);if(ce)return{type:"hr",raw:ce[0]}},ye.blockquote=function(ue){var ce=this.rules.block.blockquote.exec(ue);if(ce){var be=ce[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ce[0],text:be}}},ye.list=function(ue){var ce=this.rules.block.list.exec(ue);if(ce){for(var be=ce[0],xe=ce[2],Oe=xe.length>1,Ue=xe[xe.length-1]===")",Ke={type:"list",raw:be,ordered:Oe,start:Oe?+xe.slice(0,-1):"",loose:!1,items:[]},et=ce[0].match(this.rules.block.item),it=!1,nt,yt,bt,dt,wt,Tt,Ct,Nt=et.length,At=0;At<Nt;At++)nt=et[At],be=nt,yt=nt.length,nt=nt.replace(/^ *([*+-]|\d+[.)]) */,""),~nt.indexOf(`
`)&&(yt-=nt.length,nt=this.options.pedantic?nt.replace(/^ {1,4}/gm,""):nt.replace(new RegExp("^ {1,"+yt+"}","gm"),"")),At!==Nt-1&&(bt=this.rules.block.bullet.exec(et[At+1])[0],(Oe?bt.length===1||!Ue&&bt[bt.length-1]===")":bt.length>1||this.options.smartLists&&bt!==xe)&&(dt=et.slice(At+1).join(`
`),Ke.raw=Ke.raw.substring(0,Ke.raw.length-dt.length),At=Nt-1)),wt=it||/\n\n(?!\s*$)/.test(nt),At!==Nt-1&&(it=nt.charAt(nt.length-1)===`
`,wt||(wt=it)),wt&&(Ke.loose=!0),Tt=/^\[[ xX]\] /.test(nt),Ct=void 0,Tt&&(Ct=nt[1]!==" ",nt=nt.replace(/^\[[ xX]\] +/,"")),Ke.items.push({type:"list_item",raw:be,task:Tt,checked:Ct,loose:wt,text:nt});return Ke}},ye.html=function(ue){var ce=this.rules.block.html.exec(ue);if(ce)return{type:this.options.sanitize?"paragraph":"html",raw:ce[0],pre:!this.options.sanitizer&&(ce[1]==="pre"||ce[1]==="script"||ce[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ce[0]):Q(ce[0]):ce[0]}},ye.def=function(ue){var ce=this.rules.block.def.exec(ue);if(ce){ce[3]&&(ce[3]=ce[3].substring(1,ce[3].length-1));var be=ce[1].toLowerCase().replace(/\s+/g," ");return{tag:be,raw:ce[0],href:ce[2],title:ce[3]}}},ye.table=function(ue){var ce=this.rules.block.table.exec(ue);if(ce){var be={type:"table",header:K(ce[1].replace(/^ *| *\| *$/g,"")),align:ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ce[3]?ce[3].replace(/\n$/,"").split(`
`):[]};if(be.header.length===be.align.length){be.raw=ce[0];var xe=be.align.length,Oe;for(Oe=0;Oe<xe;Oe++)/^ *-+: *$/.test(be.align[Oe])?be.align[Oe]="right":/^ *:-+: *$/.test(be.align[Oe])?be.align[Oe]="center":/^ *:-+ *$/.test(be.align[Oe])?be.align[Oe]="left":be.align[Oe]=null;for(xe=be.cells.length,Oe=0;Oe<xe;Oe++)be.cells[Oe]=K(be.cells[Oe].replace(/^ *\| *| *\| *$/g,""),be.header.length);return be}}},ye.lheading=function(ue){var ce=this.rules.block.lheading.exec(ue);if(ce)return{type:"heading",raw:ce[0],depth:ce[2].charAt(0)==="="?1:2,text:ce[1]}},ye.paragraph=function(ue){var ce=this.rules.block.paragraph.exec(ue);if(ce)return{type:"paragraph",raw:ce[0],text:ce[1].charAt(ce[1].length-1)===`
`?ce[1].slice(0,-1):ce[1]}},ye.text=function(ue,ce){var be=this.rules.block.text.exec(ue);if(be){var xe=ce[ce.length-1];return xe&&xe.type==="text"?{raw:be[0],text:be[0]}:{type:"text",raw:be[0],text:be[0]}}},ye.escape=function(ue){var ce=this.rules.inline.escape.exec(ue);if(ce)return{type:"escape",raw:ce[0],text:Q(ce[1])}},ye.tag=function(ue,ce,be){var xe=this.rules.inline.tag.exec(ue);if(xe)return!ce&&/^<a /i.test(xe[0])?ce=!0:ce&&/^<\/a>/i.test(xe[0])&&(ce=!1),!be&&/^<(pre|code|kbd|script)(\s|>)/i.test(xe[0])?be=!0:be&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(xe[0])&&(be=!1),{type:this.options.sanitize?"text":"html",raw:xe[0],inLink:ce,inRawBlock:be,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(xe[0]):Q(xe[0]):xe[0]}},ye.link=function(ue){var ce=this.rules.inline.link.exec(ue);if(ce){var be=ne(ce[2],"()");if(be>-1){var xe=ce[0].indexOf("!")===0?5:4,Oe=xe+ce[1].length+be;ce[2]=ce[2].substring(0,be),ce[0]=ce[0].substring(0,Oe).trim(),ce[3]=""}var Ue=ce[2],Ke="";if(this.options.pedantic){var et=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ue);et?(Ue=et[1],Ke=et[3]):Ke=""}else Ke=ce[3]?ce[3].slice(1,-1):"";Ue=Ue.trim().replace(/^<([\s\S]*)>$/,"$1");var it=fe(ce,{href:Ue&&Ue.replace(this.rules.inline._escapes,"$1"),title:Ke&&Ke.replace(this.rules.inline._escapes,"$1")},ce[0]);return it}},ye.reflink=function(ue,ce){var be;if((be=this.rules.inline.reflink.exec(ue))||(be=this.rules.inline.nolink.exec(ue))){var xe=(be[2]||be[1]).replace(/\s+/g," ");if(xe=ce[xe.toLowerCase()],!xe||!xe.href){var Oe=be[0].charAt(0);return{type:"text",raw:Oe,text:Oe}}var Ue=fe(be,xe,be[0]);return Ue}},ye.strong=function(ue,ce,be){be===void 0&&(be="");var xe=this.rules.inline.strong.start.exec(ue);if(xe&&(!xe[1]||xe[1]&&(be===""||this.rules.inline.punctuation.exec(be)))){ce=ce.slice(-1*ue.length);var Oe=xe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Oe.lastIndex=0;for(var Ue;(xe=Oe.exec(ce))!=null;)if(Ue=this.rules.inline.strong.middle.exec(ce.slice(0,xe.index+3)),Ue)return{type:"strong",raw:ue.slice(0,Ue[0].length),text:ue.slice(2,Ue[0].length-2)}}},ye.em=function(ue,ce,be){be===void 0&&(be="");var xe=this.rules.inline.em.start.exec(ue);if(xe&&(!xe[1]||xe[1]&&(be===""||this.rules.inline.punctuation.exec(be)))){ce=ce.slice(-1*ue.length);var Oe=xe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Oe.lastIndex=0;for(var Ue;(xe=Oe.exec(ce))!=null;)if(Ue=this.rules.inline.em.middle.exec(ce.slice(0,xe.index+2)),Ue)return{type:"em",raw:ue.slice(0,Ue[0].length),text:ue.slice(1,Ue[0].length-1)}}},ye.codespan=function(ue){var ce=this.rules.inline.code.exec(ue);if(ce){var be=ce[2].replace(/\n/g," "),xe=/[^ ]/.test(be),Oe=be.startsWith(" ")&&be.endsWith(" ");return xe&&Oe&&(be=be.substring(1,be.length-1)),be=Q(be,!0),{type:"codespan",raw:ce[0],text:be}}},ye.br=function(ue){var ce=this.rules.inline.br.exec(ue);if(ce)return{type:"br",raw:ce[0]}},ye.del=function(ue){var ce=this.rules.inline.del.exec(ue);if(ce)return{type:"del",raw:ce[0],text:ce[1]}},ye.autolink=function(ue,ce){var be=this.rules.inline.autolink.exec(ue);if(be){var xe,Oe;return be[2]==="@"?(xe=Q(this.options.mangle?ce(be[1]):be[1]),Oe="mailto:"+xe):(xe=Q(be[1]),Oe=xe),{type:"link",raw:be[0],text:xe,href:Oe,tokens:[{type:"text",raw:xe,text:xe}]}}},ye.url=function(ue,ce){var be;if(be=this.rules.inline.url.exec(ue)){var xe,Oe;if(be[2]==="@")xe=Q(this.options.mangle?ce(be[0]):be[0]),Oe="mailto:"+xe;else{var Ue;do Ue=be[0],be[0]=this.rules.inline._backpedal.exec(be[0])[0];while(Ue!==be[0]);xe=Q(be[0]),be[1]==="www."?Oe="http://"+xe:Oe=xe}return{type:"link",raw:be[0],text:xe,href:Oe,tokens:[{type:"text",raw:xe,text:xe}]}}},ye.inlineText=function(ue,ce,be){var xe=this.rules.inline.text.exec(ue);if(xe){var Oe;return ce?Oe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(xe[0]):Q(xe[0]):xe[0]:Oe=Q(this.options.smartypants?be(xe[0]):xe[0]),{type:"text",raw:xe[0],text:Oe}}},_e}(),he=M.noopTest,se=M.edit,me=M.merge,re={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:he,table:he,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};re._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,re._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,re.def=se(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,re.item=se(re.item,"gm").replace(/bull/g,re.bullet).getRegex(),re.list=se(re.list).replace(/bull/g,re.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+re.def.source+")").getRegex(),re._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",re._comment=/<!--(?!-?>)[\s\S]*?-->/,re.html=se(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=se(re._paragraph).replace("hr",re.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",re._tag).getRegex(),re.blockquote=se(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal=me({},re),re.gfm=me({},re.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*|$)"}),re.gfm.nptable=se(re.gfm.nptable).replace("hr",re.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",re._tag).getRegex(),re.gfm.table=se(re.gfm.table).replace("hr",re.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",re._tag).getRegex(),re.pedantic=me({},re.normal,{html:se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",re._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:he,paragraph:se(re.normal._paragraph).replace("hr",re.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",re.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var le={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:he,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:he,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};le._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",le.punctuation=se(le.punctuation).replace(/punctuation/g,le._punctuation).getRegex(),le._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",le._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",le.em.start=se(le.em.start).replace(/punctuation/g,le._punctuation).getRegex(),le.em.middle=se(le.em.middle).replace(/punctuation/g,le._punctuation).replace(/overlapSkip/g,le._overlapSkip).getRegex(),le.em.endAst=se(le.em.endAst,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.em.endUnd=se(le.em.endUnd,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.strong.start=se(le.strong.start).replace(/punctuation/g,le._punctuation).getRegex(),le.strong.middle=se(le.strong.middle).replace(/punctuation/g,le._punctuation).replace(/blockSkip/g,le._blockSkip).getRegex(),le.strong.endAst=se(le.strong.endAst,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.strong.endUnd=se(le.strong.endUnd,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.blockSkip=se(le._blockSkip,"g").getRegex(),le.overlapSkip=se(le._overlapSkip,"g").getRegex(),le._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,le._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,le._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])?)+(?![-_])/,le.autolink=se(le.autolink).replace("scheme",le._scheme).replace("email",le._email).getRegex(),le._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,le.tag=se(le.tag).replace("comment",re._comment).replace("attribute",le._attribute).getRegex(),le._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,le._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,le._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,le.link=se(le.link).replace("label",le._label).replace("href",le._href).replace("title",le._title).getRegex(),le.reflink=se(le.reflink).replace("label",le._label).getRegex(),le.reflinkSearch=se(le.reflinkSearch,"g").replace("reflink",le.reflink).replace("nolink",le.nolink).getRegex(),le.normal=me({},le),le.pedantic=me({},le.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:se(/^!?\[(label)\]\((.*?)\)/).replace("label",le._label).getRegex(),reflink:se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",le._label).getRegex()}),le.gfm=me({},le.normal,{escape:se(le.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),le.gfm.url=se(le.gfm.url,"i").replace("email",le.gfm._extended_email).getRegex(),le.breaks=me({},le.gfm,{br:se(le.br).replace("{2,}","*").getRegex(),text:se(le.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Z={block:re,inline:le},ae=G.defaults,oe=Z.block,ge=Z.inline;function Re(_e){return _e.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Te(_e){var ye="",ve,ue,ce=_e.length;for(ve=0;ve<ce;ve++)ue=_e.charCodeAt(ve),Math.random()>.5&&(ue="x"+ue.toString(16)),ye+="&#"+ue+";";return ye}var Me=function(){function _e(ve){this.tokens=[],this.tokens.links=Object.create(null),this.options=ve||ae,this.options.tokenizer=this.options.tokenizer||new Se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ue={block:oe.normal,inline:ge.normal};this.options.pedantic?(ue.block=oe.pedantic,ue.inline=ge.pedantic):this.options.gfm&&(ue.block=oe.gfm,this.options.breaks?ue.inline=ge.breaks:ue.inline=ge.gfm),this.tokenizer.rules=ue}_e.lex=function(ue,ce){var be=new _e(ce);return be.lex(ue)};var ye=_e.prototype;return ye.lex=function(ue){return ue=ue.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ue,this.tokens,!0),this.inline(this.tokens),this.tokens},ye.blockTokens=function(ue,ce,be){ce===void 0&&(ce=[]),be===void 0&&(be=!0),ue=ue.replace(/^ +$/gm,"");for(var xe,Oe,Ue,Ke;ue;){if(xe=this.tokenizer.space(ue)){ue=ue.substring(xe.raw.length),xe.type&&ce.push(xe);continue}if(xe=this.tokenizer.code(ue,ce)){ue=ue.substring(xe.raw.length),xe.type?ce.push(xe):(Ke=ce[ce.length-1],Ke.raw+=`
`+xe.raw,Ke.text+=`
`+xe.text);continue}if(xe=this.tokenizer.fences(ue)){ue=ue.substring(xe.raw.length),ce.push(xe);continue}if(xe=this.tokenizer.heading(ue)){ue=ue.substring(xe.raw.length),ce.push(xe);continue}if(xe=this.tokenizer.nptable(ue)){ue=ue.substring(xe.raw.length),ce.push(xe);continue}if(xe=this.tokenizer.hr(ue)){ue=ue.substring(xe.raw.length),ce.push(xe);continue}if(xe=this.tokenizer.blockquote(ue)){ue=ue.substring(xe.raw.length),xe.tokens=this.blockTokens(xe.text,[],be),ce.push(xe);continue}if(xe=this.tokenizer.list(ue)){for(ue=ue.substring(xe.raw.length),Ue=xe.items.length,Oe=0;Oe<Ue;Oe++)xe.items[Oe].tokens=this.blockTokens(xe.items[Oe].text,[],!1);ce.push(xe);continue}if(xe=this.tokenizer.html(ue)){ue=ue.substring(xe.raw.length),ce.push(xe);continue}if(be&&(xe=this.tokenizer.def(ue))){ue=ue.substring(xe.raw.length),this.tokens.links[xe.tag]||(this.tokens.links[xe.tag]={href:xe.href,title:xe.title});continue}if(xe=this.tokenizer.table(ue)){ue=ue.substring(xe.raw.length),ce.push(xe);continue}if(xe=this.tokenizer.lheading(ue)){ue=ue.substring(xe.raw.length),ce.push(xe);continue}if(be&&(xe=this.tokenizer.paragraph(ue))){ue=ue.substring(xe.raw.length),ce.push(xe);continue}if(xe=this.tokenizer.text(ue,ce)){ue=ue.substring(xe.raw.length),xe.type?ce.push(xe):(Ke=ce[ce.length-1],Ke.raw+=`
`+xe.raw,Ke.text+=`
`+xe.text);continue}if(ue){var et="Infinite loop on byte: "+ue.charCodeAt(0);if(this.options.silent){console.error(et);break}else throw new Error(et)}}return ce},ye.inline=function(ue){var ce,be,xe,Oe,Ue,Ke,et=ue.length;for(ce=0;ce<et;ce++){Ke=ue[ce];switch(Ke.type){case"paragraph":case"text":case"heading":{Ke.tokens=[],this.inlineTokens(Ke.text,Ke.tokens);break}case"table":{for(Ke.tokens={header:[],cells:[]},Oe=Ke.header.length,be=0;be<Oe;be++)Ke.tokens.header[be]=[],this.inlineTokens(Ke.header[be],Ke.tokens.header[be]);for(Oe=Ke.cells.length,be=0;be<Oe;be++)for(Ue=Ke.cells[be],Ke.tokens.cells[be]=[],xe=0;xe<Ue.length;xe++)Ke.tokens.cells[be][xe]=[],this.inlineTokens(Ue[xe],Ke.tokens.cells[be][xe]);break}case"blockquote":{this.inline(Ke.tokens);break}case"list":{for(Oe=Ke.items.length,be=0;be<Oe;be++)this.inline(Ke.items[be].tokens);break}}}return ue},ye.inlineTokens=function(ue,ce,be,xe,Oe){ce===void 0&&(ce=[]),be===void 0&&(be=!1),xe===void 0&&(xe=!1),Oe===void 0&&(Oe="");var Ue,Ke=ue,et;if(this.tokens.links){var it=Object.keys(this.tokens.links);if(it.length>0)for(;(et=this.tokenizer.rules.inline.reflinkSearch.exec(Ke))!=null;)it.includes(et[0].slice(et[0].lastIndexOf("[")+1,-1))&&(Ke=Ke.slice(0,et.index)+"["+"a".repeat(et[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(et=this.tokenizer.rules.inline.blockSkip.exec(Ke))!=null;)Ke=Ke.slice(0,et.index)+"["+"a".repeat(et[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ue;){if(Ue=this.tokenizer.escape(ue)){ue=ue.substring(Ue.raw.length),ce.push(Ue);continue}if(Ue=this.tokenizer.tag(ue,be,xe)){ue=ue.substring(Ue.raw.length),be=Ue.inLink,xe=Ue.inRawBlock,ce.push(Ue);continue}if(Ue=this.tokenizer.link(ue)){ue=ue.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,xe)),ce.push(Ue);continue}if(Ue=this.tokenizer.reflink(ue,this.tokens.links)){ue=ue.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,xe)),ce.push(Ue);continue}if(Ue=this.tokenizer.strong(ue,Ke,Oe)){ue=ue.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],be,xe),ce.push(Ue);continue}if(Ue=this.tokenizer.em(ue,Ke,Oe)){ue=ue.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],be,xe),ce.push(Ue);continue}if(Ue=this.tokenizer.codespan(ue)){ue=ue.substring(Ue.raw.length),ce.push(Ue);continue}if(Ue=this.tokenizer.br(ue)){ue=ue.substring(Ue.raw.length),ce.push(Ue);continue}if(Ue=this.tokenizer.del(ue)){ue=ue.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],be,xe),ce.push(Ue);continue}if(Ue=this.tokenizer.autolink(ue,Te)){ue=ue.substring(Ue.raw.length),ce.push(Ue);continue}if(!be&&(Ue=this.tokenizer.url(ue,Te))){ue=ue.substring(Ue.raw.length),ce.push(Ue);continue}if(Ue=this.tokenizer.inlineText(ue,xe,Re)){ue=ue.substring(Ue.raw.length),Oe=Ue.raw.slice(-1),ce.push(Ue);continue}if(ue){var nt="Infinite loop on byte: "+ue.charCodeAt(0);if(this.options.silent){console.error(nt);break}else throw new Error(nt)}}return ce},V(_e,null,[{key:"rules",get:function(){return{block:oe,inline:ge}}}]),_e}(),Be=G.defaults,pe=M.cleanUrl,Ce=M.escape,ke=function(){function _e(ve){this.options=ve||Be}var ye=_e.prototype;return ye.code=function(ue,ce,be){var xe=(ce||"").match(/\S*/)[0];if(this.options.highlight){var Oe=this.options.highlight(ue,xe);Oe!=null&&Oe!==ue&&(be=!0,ue=Oe)}return xe?'<pre><code class="'+this.options.langPrefix+Ce(xe,!0)+'">'+(be?ue:Ce(ue,!0))+`</code></pre>
`:"<pre><code>"+(be?ue:Ce(ue,!0))+`</code></pre>
`},ye.blockquote=function(ue){return`<blockquote>
`+ue+`</blockquote>
`},ye.html=function(ue){return ue},ye.heading=function(ue,ce,be,xe){return this.options.headerIds?"<h"+ce+' id="'+this.options.headerPrefix+xe.slug(be)+'">'+ue+"</h"+ce+`>
`:"<h"+ce+">"+ue+"</h"+ce+`>
`},ye.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ye.list=function(ue,ce,be){var xe=ce?"ol":"ul",Oe=ce&&be!==1?' start="'+be+'"':"";return"<"+xe+Oe+`>
`+ue+"</"+xe+`>
`},ye.listitem=function(ue){return"<li>"+ue+`</li>
`},ye.checkbox=function(ue){return"<input "+(ue?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ye.paragraph=function(ue){return"<p>"+ue+`</p>
`},ye.table=function(ue,ce){return ce&&(ce="<tbody>"+ce+"</tbody>"),`<table>
<thead>
`+ue+`</thead>
`+ce+`</table>
`},ye.tablerow=function(ue){return`<tr>
`+ue+`</tr>
`},ye.tablecell=function(ue,ce){var be=ce.header?"th":"td",xe=ce.align?"<"+be+' align="'+ce.align+'">':"<"+be+">";return xe+ue+"</"+be+`>
`},ye.strong=function(ue){return"<strong>"+ue+"</strong>"},ye.em=function(ue){return"<em>"+ue+"</em>"},ye.codespan=function(ue){return"<code>"+ue+"</code>"},ye.br=function(){return this.options.xhtml?"<br/>":"<br>"},ye.del=function(ue){return"<del>"+ue+"</del>"},ye.link=function(ue,ce,be){if(ue=pe(this.options.sanitize,this.options.baseUrl,ue),ue===null)return be;var xe='<a href="'+Ce(ue)+'"';return ce&&(xe+=' title="'+ce+'"'),xe+=">"+be+"</a>",xe},ye.image=function(ue,ce,be){if(ue=pe(this.options.sanitize,this.options.baseUrl,ue),ue===null)return be;var xe='<img src="'+ue+'" alt="'+be+'"';return ce&&(xe+=' title="'+ce+'"'),xe+=this.options.xhtml?"/>":">",xe},ye.text=function(ue){return ue},_e}(),Le=function(){function _e(){}var ye=_e.prototype;return ye.strong=function(ue){return ue},ye.em=function(ue){return ue},ye.codespan=function(ue){return ue},ye.del=function(ue){return ue},ye.html=function(ue){return ue},ye.text=function(ue){return ue},ye.link=function(ue,ce,be){return""+be},ye.image=function(ue,ce,be){return""+be},ye.br=function(){return""},_e}(),Ge=function(){function _e(){this.seen={}}var ye=_e.prototype;return ye.slug=function(ue){var ce=ue.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ce)){var be=ce;do this.seen[be]++,ce=be+"-"+this.seen[be];while(this.seen.hasOwnProperty(ce))}return this.seen[ce]=0,ce},_e}(),Ve=G.defaults,tt=M.unescape,rt=function(){function _e(ve){this.options=ve||Ve,this.options.renderer=this.options.renderer||new ke,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Le,this.slugger=new Ge}_e.parse=function(ue,ce){var be=new _e(ce);return be.parse(ue)};var ye=_e.prototype;return ye.parse=function(ue,ce){ce===void 0&&(ce=!0);var be="",xe,Oe,Ue,Ke,et,it,nt,yt,bt,dt,wt,Tt,Ct,Nt,At,It,gt,Ye,_t=ue.length;for(xe=0;xe<_t;xe++){dt=ue[xe];switch(dt.type){case"space":continue;case"hr":{be+=this.renderer.hr();continue}case"heading":{be+=this.renderer.heading(this.parseInline(dt.tokens),dt.depth,tt(this.parseInline(dt.tokens,this.textRenderer)),this.slugger);continue}case"code":{be+=this.renderer.code(dt.text,dt.lang,dt.escaped);continue}case"table":{for(yt="",nt="",Ke=dt.header.length,Oe=0;Oe<Ke;Oe++)nt+=this.renderer.tablecell(this.parseInline(dt.tokens.header[Oe]),{header:!0,align:dt.align[Oe]});for(yt+=this.renderer.tablerow(nt),bt="",Ke=dt.cells.length,Oe=0;Oe<Ke;Oe++){for(it=dt.tokens.cells[Oe],nt="",et=it.length,Ue=0;Ue<et;Ue++)nt+=this.renderer.tablecell(this.parseInline(it[Ue]),{header:!1,align:dt.align[Ue]});bt+=this.renderer.tablerow(nt)}be+=this.renderer.table(yt,bt);continue}case"blockquote":{bt=this.parse(dt.tokens),be+=this.renderer.blockquote(bt);continue}case"list":{for(wt=dt.ordered,Tt=dt.start,Ct=dt.loose,Ke=dt.items.length,bt="",Oe=0;Oe<Ke;Oe++)At=dt.items[Oe],It=At.checked,gt=At.task,Nt="",At.task&&(Ye=this.renderer.checkbox(It),Ct?At.tokens.length>0&&At.tokens[0].type==="text"?(At.tokens[0].text=Ye+" "+At.tokens[0].text,At.tokens[0].tokens&&At.tokens[0].tokens.length>0&&At.tokens[0].tokens[0].type==="text"&&(At.tokens[0].tokens[0].text=Ye+" "+At.tokens[0].tokens[0].text)):At.tokens.unshift({type:"text",text:Ye}):Nt+=Ye),Nt+=this.parse(At.tokens,Ct),bt+=this.renderer.listitem(Nt,gt,It);be+=this.renderer.list(bt,wt,Tt);continue}case"html":{be+=this.renderer.html(dt.text);continue}case"paragraph":{be+=this.renderer.paragraph(this.parseInline(dt.tokens));continue}case"text":{for(bt=dt.tokens?this.parseInline(dt.tokens):dt.text;xe+1<_t&&ue[xe+1].type==="text";)dt=ue[++xe],bt+=`
`+(dt.tokens?this.parseInline(dt.tokens):dt.text);be+=ce?this.renderer.paragraph(bt):bt;continue}default:{var $e='Token with "'+dt.type+'" type was not found.';if(this.options.silent){console.error($e);return}else throw new Error($e)}}}return be},ye.parseInline=function(ue,ce){ce=ce||this.renderer;var be="",xe,Oe,Ue=ue.length;for(xe=0;xe<Ue;xe++){Oe=ue[xe];switch(Oe.type){case"escape":{be+=ce.text(Oe.text);break}case"html":{be+=ce.html(Oe.text);break}case"link":{be+=ce.link(Oe.href,Oe.title,this.parseInline(Oe.tokens,ce));break}case"image":{be+=ce.image(Oe.href,Oe.title,Oe.text);break}case"strong":{be+=ce.strong(this.parseInline(Oe.tokens,ce));break}case"em":{be+=ce.em(this.parseInline(Oe.tokens,ce));break}case"codespan":{be+=ce.codespan(Oe.text);break}case"br":{be+=ce.br();break}case"del":{be+=ce.del(this.parseInline(Oe.tokens,ce));break}case"text":{be+=ce.text(Oe.text);break}default:{var Ke='Token with "'+Oe.type+'" type was not found.';if(this.options.silent){console.error(Ke);return}else throw new Error(Ke)}}}return be},_e}(),ut=M.merge,lt=M.checkSanitizeDeprecation,Ne=M.escape,Pe=G.getDefaults,ze=G.changeDefaults,Xe=G.defaults;function je(_e,ye,ve){if(typeof _e=="undefined"||_e===null)throw new Error("marked(): input parameter is undefined or null");if(typeof _e!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(_e)+", string expected");if(typeof ye=="function"&&(ve=ye,ye=null),ye=ut({},je.defaults,ye||{}),lt(ye),ve){var ue=ye.highlight,ce;try{ce=Me.lex(_e,ye)}catch(Ue){return ve(Ue)}var be=function(Ke){var et;if(!Ke)try{et=rt.parse(ce,ye)}catch(it){Ke=it}return ye.highlight=ue,Ke?ve(Ke):ve(null,et)};if(!ue||ue.length<3)return be();if(delete ye.highlight,!ce.length)return be();var xe=0;je.walkTokens(ce,function(Ue){Ue.type==="code"&&(xe++,setTimeout(function(){ue(Ue.text,Ue.lang,function(Ke,et){if(Ke)return be(Ke);et!=null&&et!==Ue.text&&(Ue.text=et,Ue.escaped=!0),xe--,xe===0&&be()})},0))}),xe===0&&be();return}try{var Oe=Me.lex(_e,ye);return ye.walkTokens&&je.walkTokens(Oe,ye.walkTokens),rt.parse(Oe,ye)}catch(Ue){if(Ue.message+=`
Please report this to https://github.com/markedjs/marked.`,ye.silent)return"<p>An error occurred:</p><pre>"+Ne(Ue.message+"",!0)+"</pre>";throw Ue}}je.options=je.setOptions=function(_e){return ut(je.defaults,_e),ze(je.defaults),je},je.getDefaults=Pe,je.defaults=Xe,je.use=function(_e){var ye=ut({},_e);if(_e.renderer&&function(){var ue=je.defaults.renderer||new ke,ce=function(Oe){var Ue=ue[Oe];ue[Oe]=function(){for(var Ke=arguments.length,et=new Array(Ke),it=0;it<Ke;it++)et[it]=arguments[it];var nt=_e.renderer[Oe].apply(ue,et);return nt===!1&&(nt=Ue.apply(ue,et)),nt}};for(var be in _e.renderer)ce(be);ye.renderer=ue}(),_e.tokenizer&&function(){var ue=je.defaults.tokenizer||new Se,ce=function(Oe){var Ue=ue[Oe];ue[Oe]=function(){for(var Ke=arguments.length,et=new Array(Ke),it=0;it<Ke;it++)et[it]=arguments[it];var nt=_e.tokenizer[Oe].apply(ue,et);return nt===!1&&(nt=Ue.apply(ue,et)),nt}};for(var be in _e.tokenizer)ce(be);ye.tokenizer=ue}(),_e.walkTokens){var ve=je.defaults.walkTokens;ye.walkTokens=function(ue){_e.walkTokens(ue),ve&&ve(ue)}}je.setOptions(ye)},je.walkTokens=function(_e,ye){for(var ve=j(_e),ue;!(ue=ve()).done;){var ce=ue.value;ye(ce);switch(ce.type){case"table":{for(var be=j(ce.tokens.header),xe;!(xe=be()).done;){var Oe=xe.value;je.walkTokens(Oe,ye)}for(var Ue=j(ce.tokens.cells),Ke;!(Ke=Ue()).done;)for(var et=Ke.value,it=j(et),nt;!(nt=it()).done;){var yt=nt.value;je.walkTokens(yt,ye)}break}case"list":{je.walkTokens(ce.items,ye);break}default:ce.tokens&&je.walkTokens(ce.tokens,ye)}}},je.Parser=rt,je.parser=rt.parse,je.Renderer=ke,je.TextRenderer=Le,je.Lexer=Me,je.lexer=Me.lex,je.Tokenizer=Se,je.Slugger=Ge,je.parse=je;var Fe=je;return Fe})},ELLl:function(at,Ee,H){(function(ee){ee(H("VrN/"))})(function(ee){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},N=ee.Pos;ee.defineOption("autoCloseBrackets",!1,function(a,f,u){u&&u!=ee.Init&&(a.removeKeyMap(j),a.state.closeBrackets=null),f&&(P($(f,"pairs")),a.state.closeBrackets=f,a.addKeyMap(j))});function $(a,f){return f=="pairs"&&typeof a=="string"?a:typeof a=="object"&&a[f]!=null?a[f]:V[f]}var j={Backspace:n,Enter:D};function P(a){for(var f=0;f<a.length;f++){var u=a.charAt(f),d="'"+u+"'";j[d]||(j[d]=G(u))}}P(V.pairs+"`");function G(a){return function(f){return g(f,a)}}function W(a){var f=a.state.closeBrackets;if(!f||f.override)return f;var u=a.getModeAt(a.getCursor());return u.closeBrackets||f}function n(a){var f=W(a);if(!f||a.getOption("disableInput"))return ee.Pass;for(var u=$(f,"pairs"),d=a.listSelections(),i=0;i<d.length;i++){if(!d[i].empty())return ee.Pass;var o=p(a,d[i].head);if(!o||u.indexOf(o)%2!=0)return ee.Pass}for(var i=d.length-1;i>=0;i--){var O=d[i].head;a.replaceRange("",N(O.line,O.ch-1),N(O.line,O.ch+1),"+delete")}}function D(a){var f=W(a),u=f&&$(f,"explode");if(!u||a.getOption("disableInput"))return ee.Pass;for(var d=a.listSelections(),i=0;i<d.length;i++){if(!d[i].empty())return ee.Pass;var o=p(a,d[i].head);if(!o||u.indexOf(o)%2!=0)return ee.Pass}a.operation(function(){var O=a.lineSeparator()||`
`;a.replaceSelection(O+O,null),a.execCommand("goCharLeft"),d=a.listSelections();for(var w=0;w<d.length;w++){var C=d[w].head.line;a.indentLine(C,null,!0),a.indentLine(C+1,null,!0)}})}function y(a){var f=ee.cmpPos(a.anchor,a.head)>0;return{anchor:new N(a.anchor.line,a.anchor.ch+(f?-1:1)),head:new N(a.head.line,a.head.ch+(f?1:-1))}}function g(a,f){var u=W(a);if(!u||a.getOption("disableInput"))return ee.Pass;var d=$(u,"pairs"),i=d.indexOf(f);if(i==-1)return ee.Pass;for(var o=$(u,"closeBefore"),O=$(u,"triples"),w=d.charAt(i+1)==f,C=a.listSelections(),L=i%2==0,A,_=0;_<C.length;_++){var T=C[_],v=T.head,c,E=a.getRange(v,N(v.line,v.ch+1));if(L&&!T.empty())c="surround";else if((w||!L)&&E==f)w&&l(a,v)?c="both":O.indexOf(f)>=0&&a.getRange(v,N(v.line,v.ch+3))==f+f+f?c="skipThree":c="skip";else if(w&&v.ch>1&&O.indexOf(f)>=0&&a.getRange(N(v.line,v.ch-2),v)==f+f){if(v.ch>2&&/\bstring/.test(a.getTokenTypeAt(N(v.line,v.ch-2))))return ee.Pass;c="addFour"}else if(w){var h=v.ch==0?" ":a.getRange(N(v.line,v.ch-1),v);if(!ee.isWordChar(E)&&h!=f&&!ee.isWordChar(h))c="both";else return ee.Pass}else if(L&&(E.length===0||/\s/.test(E)||o.indexOf(E)>-1))c="both";else return ee.Pass;if(!A)A=c;else if(A!=c)return ee.Pass}var x=i%2?d.charAt(i-1):f,U=i%2?f:d.charAt(i+1);a.operation(function(){if(A=="skip")a.execCommand("goCharRight");else if(A=="skipThree")for(var F=0;F<3;F++)a.execCommand("goCharRight");else if(A=="surround"){for(var S=a.getSelections(),F=0;F<S.length;F++)S[F]=x+S[F]+U;a.replaceSelections(S,"around"),S=a.listSelections().slice();for(var F=0;F<S.length;F++)S[F]=y(S[F]);a.setSelections(S)}else A=="both"?(a.replaceSelection(x+U,null),a.triggerElectric(x+U),a.execCommand("goCharLeft")):A=="addFour"&&(a.replaceSelection(x+x+x+x,"before"),a.execCommand("goCharRight"))})}function p(a,f){var u=a.getRange(N(f.line,f.ch-1),N(f.line,f.ch+1));return u.length==2?u:null}function l(a,f){var u=a.getTokenAt(N(f.line,f.ch+1));return/\bstring/.test(u.type)&&u.start==f.ch&&(f.ch==0||!/\bstring/.test(a.getTokenTypeAt(f)))}})},EgHG:function(at,Ee,H){at.exports={wrap:"wrap___2vVqS",modal:"modal___AcHKf",titleWrap:"titleWrap___YV24j",required:"required___3XHD4",title:"title___3yV4s",colorGray:"colorGray___2oRqv",choiceWrap:"choiceWrap___2ypJV",answer:"answer___1tmCF",activeAnswer:"activeAnswer___7NV4I",deleteIcon:"deleteIcon___3LBHf",addIcon:"addIcon___2MzTA",editorWrap:"editorWrap___1Xe94",htmlWrap:"htmlWrap___14WFO",radio:"radio___1kFzU",color333:"color333___1Kwa2",color999:"color999___4cmSp",fold:"fold___1JSf-",head:"head___-ebd0"}},FWmy:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return ee});function ee(V,N){if(!V)throw new Error(N?`Assertion failed (${N})`:"Assertion Failed")}},GfqC:function(at,Ee,H){"use strict";var ee=H("q1tI"),V=H.n(ee),N=H("TSYQ"),$=H.n(N);function j(M,I){var b="cannot "+M.method+" "+M.action+" "+I.status+"'",K=new Error(b);return K.status=I.status,K.method=M.method,K.url=M.action,K}function P(M){var I=M.responseText||M.response;if(!I)return I;try{return JSON.parse(I)}catch(b){return I}}function G(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 b=new FormData;M.data&&Object.keys(M.data).forEach(function(Q){var ne=M.data[Q];if(Array.isArray(ne)){ne.forEach(function(fe){b.append(Q+"[]",fe)});return}b.append(Q,M.data[Q])}),M.file instanceof Blob?b.append(M.filename,M.file,M.file.name):b.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),P(I)):M.onSuccess(P(I),I)},I.open(M.method,M.action,!0),M.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var K=M.headers||{};return K["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(K).forEach(function(Q){K[Q]!==null&&I.setRequestHeader(Q,K[Q])}),I.send(b),{abort:function(){I.abort()}}}var W=+new Date,n=0;function D(){return"rc-upload-"+W+"-"+ ++n}function y(M,I){return M.indexOf(I,M.length-I.length)!==-1}var g=function(M,I){if(M&&I){var b=Array.isArray(I)?I:I.split(","),K=M.name||"",Q=M.type||"",ne=Q.replace(/\/.*$/,"");return b.some(function(fe){var we=fe.trim();return we.charAt(0)==="."?y(K.toLowerCase(),we.toLowerCase()):/\/\*$/.test(we)?ne===we.replace(/\/.*$/,""):Q===we})}return!0};function p(M,I){var b=M.createReader(),K=[];function Q(){b.readEntries(function(ne){var fe=Array.prototype.slice.apply(ne);K=K.concat(fe);var we=!fe.length;we?I(K):Q()})}Q()}var l=function(I,b,K){var Q=function ne(fe,we){we=we||"",fe.isFile?fe.file(function(Se){K(Se)&&(fe.fullPath&&!Se.webkitRelativePath&&(Object.defineProperties(Se,{webkitRelativePath:{writable:!0}}),Se.webkitRelativePath=fe.fullPath.replace(/^\//,""),Object.defineProperties(Se,{webkitRelativePath:{writable:!1}})),b([Se]))}):fe.isDirectory&&p(fe,function(Se){Se.forEach(function(he){ne(he,""+we+fe.name+"/")})})};I.forEach(function(ne){Q(ne.webkitGetAsEntry())})},a=l,f=Object.assign||function(M){for(var I=1;I<arguments.length;I++){var b=arguments[I];for(var K in b)Object.prototype.hasOwnProperty.call(b,K)&&(M[K]=b[K])}return M},u=function(){function M(I,b){var K=[],Q=!0,ne=!1,fe=void 0;try{for(var we=I[Symbol.iterator](),Se;!(Q=(Se=we.next()).done)&&!(K.push(Se.value),b&&K.length===b);Q=!0);}catch(he){ne=!0,fe=he}finally{try{!Q&&we.return&&we.return()}finally{if(ne)throw fe}}return K}return function(I,b){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return M(I,b);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=function(){function M(I,b){for(var K=0;K<b.length;K++){var Q=b[K];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(I,Q.key,Q)}}return function(I,b,K){return b&&M(I.prototype,b),K&&M(I,K),I}}();function i(M,I,b){return I in M?Object.defineProperty(M,I,{value:b,enumerable:!0,configurable:!0,writable:!0}):M[I]=b,M}function o(M,I){var b={};for(var K in M){if(I.indexOf(K)>=0)continue;if(!Object.prototype.hasOwnProperty.call(M,K))continue;b[K]=M[K]}return b}function O(M,I){if(!(M instanceof I))throw new TypeError("Cannot call a class as a function")}function w(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 C(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 L=function(I){return Object.keys(I).reduce(function(b,K){return(K.substr(0,5)==="data-"||K.substr(0,5)==="aria-"||K==="role")&&(b[K]=I[K]),b},{})},A=function(M){C(I,M);function I(){var b,K,Q,ne;O(this,I);for(var fe=arguments.length,we=Array(fe),Se=0;Se<fe;Se++)we[Se]=arguments[Se];return ne=(K=(Q=w(this,(b=I.__proto__||Object.getPrototypeOf(I)).call.apply(b,[this].concat(we))),Q),Q.state={uid:D()},Q.reqs={},Q.onChange=function(he){var se=he.target.files;Q.uploadFiles(se),Q.reset()},Q.onClick=function(he){var se=Q.fileInput;if(!se)return;var me=Q.props,re=me.children,le=me.onClick;re&&re.type==="button"&&(se.parentNode.focus(),se.parentNode.querySelector("button").blur()),se.click(),le&&le(he)},Q.onKeyDown=function(he){he.key==="Enter"&&Q.onClick()},Q.onFileDrop=function(he){var se=Q.props.multiple;if(he.preventDefault(),he.type==="dragover")return;if(Q.props.directory)a(Array.prototype.slice.call(he.dataTransfer.items),Q.uploadFiles,function(re){return g(re,Q.props.accept)});else{var me=Array.prototype.slice.call(he.dataTransfer.files).filter(function(re){return g(re,Q.props.accept)});se===!1&&(me=me.slice(0,1)),Q.uploadFiles(me)}},Q.uploadFiles=function(he){var se=Array.prototype.slice.call(he);se.map(function(me){return me.uid=D(),me}).forEach(function(me){Q.upload(me,se)})},Q.saveFileInput=function(he){Q.fileInput=he},K),w(Q,ne)}return d(I,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(K,Q){var ne=this,fe=this.props;if(!fe.beforeUpload)return setTimeout(function(){return ne.post(K)},0);var we=fe.beforeUpload(K,Q);we&&we.then?we.then(function(Se){var he=Object.prototype.toString.call(Se);return he==="[object File]"||he==="[object Blob]"?ne.post(Se):ne.post(K)}).catch(function(Se){console.log(Se)}):we!==!1&&setTimeout(function(){return ne.post(K)},0);return}},{key:"post",value:function(K){var Q=this;if(!this._isMounted)return;var ne=this.props,fe=ne.onStart,we=ne.onProgress,Se=ne.transformFile,he=Se===void 0?function(se){return se}:Se;new Promise(function(se){var me=ne.action;return typeof me=="function"&&(me=me(K)),se(me)}).then(function(se){var me=K.uid,re=ne.customRequest||G,le=Promise.resolve(he(K)).then(function(Z){var ae=ne.data;return typeof ae=="function"&&(ae=ae(Z)),Promise.all([Z,ae])}).catch(function(Z){console.error(Z)});le.then(function(Z){var ae=u(Z,2),oe=ae[0],ge=ae[1],Re={action:se,filename:ne.name,data:ge,file:oe,headers:ne.headers,withCredentials:ne.withCredentials,method:ne.method||"post",onProgress:we?function(Te){we(Te,K)}:null,onSuccess:function(Me,Be){delete Q.reqs[me],ne.onSuccess(Me,K,Be)},onError:function(Me,Be){delete Q.reqs[me],ne.onError(Me,Be,K)}};fe(K),Q.reqs[me]=re(Re)})})}},{key:"reset",value:function(){this.setState({uid:D()})}},{key:"abort",value:function(K){var Q=this.reqs;if(K){var ne=K;K&&K.uid&&(ne=K.uid),Q[ne]&&Q[ne].abort&&Q[ne].abort(),delete Q[ne]}else Object.keys(Q).forEach(function(fe){Q[fe]&&Q[fe].abort&&Q[fe].abort(),delete Q[fe]})}},{key:"render",value:function(){var K,Q=this.props,ne=Q.component,fe=Q.prefixCls,we=Q.className,Se=Q.disabled,he=Q.id,se=Q.style,me=Q.multiple,re=Q.accept,le=Q.children,Z=Q.directory,ae=Q.openFileDialogOnClick,oe=Q.onMouseEnter,ge=Q.onMouseLeave,Re=o(Q,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),Te=$()((K={},i(K,fe,!0),i(K,fe+"-disabled",Se),i(K,we,we),K)),Me=Se?{}:{onClick:ae?this.onClick:function(){},onKeyDown:ae?this.onKeyDown:function(){},onMouseEnter:oe,onMouseLeave:ge,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return V.a.createElement(ne,f({},Me,{className:Te,role:"button",style:se}),V.a.createElement("input",f({},L(Re),{id:he,type:"file",ref:this.saveFileInput,onClick:function(pe){return pe.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:re,directory:Z?"directory":null,webkitdirectory:Z?"webkitdirectory":null,multiple:me,onChange:this.onChange})),le)}}]),I}(ee.Component),_=A,T=Object.assign||function(M){for(var I=1;I<arguments.length;I++){var b=arguments[I];for(var K in b)Object.prototype.hasOwnProperty.call(b,K)&&(M[K]=b[K])}return M},v=function(){function M(I,b){for(var K=0;K<b.length;K++){var Q=b[K];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(I,Q.key,Q)}}return function(I,b,K){return b&&M(I.prototype,b),K&&M(I,K),I}}();function c(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 h(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 x(){}var U=function(M){h(I,M);function I(){var b,K,Q,ne;c(this,I);for(var fe=arguments.length,we=Array(fe),Se=0;Se<fe;Se++)we[Se]=arguments[Se];return ne=(K=(Q=E(this,(b=I.__proto__||Object.getPrototypeOf(I)).call.apply(b,[this].concat(we))),Q),Q.saveUploader=function(he){Q.uploader=he},K),E(Q,ne)}return v(I,[{key:"abort",value:function(K){this.uploader.abort(K)}},{key:"render",value:function(){return V.a.createElement(_,T({},this.props,{ref:this.saveUploader}))}}]),I}(ee.Component);U.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:x,onError:x,onSuccess:x,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var F=U,S=Ee.a=F},HmJG:function(at,Ee,H){},IBYe:function(at,Ee,H){"use strict";function ee(V){return null}Ee.a=ee},JYp7:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return ee});var ee;(function(V){function N(o){return o&&typeof o=="object"&&typeof o[Symbol.iterator]=="function"}V.is=N;const $=Object.freeze([]);function j(){return $}V.empty=j;function*P(o){yield o}V.single=P;function G(o){return o||$}V.from=G;function W(o){return!o||o[Symbol.iterator]().next().done===!0}V.isEmpty=W;function n(o){return o[Symbol.iterator]().next().value}V.first=n;function D(o,O){for(const w of o)if(O(w))return!0;return!1}V.some=D;function y(o,O){for(const w of o)if(O(w))return w;return}V.find=y;function*g(o,O){for(const w of o)O(w)&&(yield w)}V.filter=g;function*p(o,O){let w=0;for(const C of o)yield O(C,w++)}V.map=p;function*l(...o){for(const O of o)for(const w of O)yield w}V.concat=l;function*a(o){for(const O of o)for(const w of O)yield w}V.concatNested=a;function f(o,O,w){let C=w;for(const L of o)C=O(C,L);return C}V.reduce=f;function*u(o,O,w=o.length){for(O<0&&(O+=o.length),w<0?w+=o.length:w>o.length&&(w=o.length);O<w;O++)yield o[O]}V.slice=u;function d(o,O=Number.POSITIVE_INFINITY){const w=[];if(O===0)return[w,o];const C=o[Symbol.iterator]();for(let L=0;L<O;L++){const A=C.next();if(A.done)return[w,V.empty()];w.push(A.value)}return[w,{[Symbol.iterator](){return C}}]}V.consume=d;function i(o,O,w=(C,L)=>C===L){const C=o[Symbol.iterator](),L=O[Symbol.iterator]();for(;;){const A=C.next(),_=L.next();if(A.done!==_.done)return!1;if(A.done)return!0;if(!w(A.value,_.value))return!1}}V.equals=i})(ee||(ee={}))},LdHM:function(at,Ee,H){"use strict";H.d(Ee,"b",function(){return o}),H.d(Ee,"a",function(){return w});var ee=H("1OyB"),V=H("vuIU"),N=H("Ji7U"),$=H("LK+K"),j=H("q1tI"),P=H("rePB"),G=H("Ff2n"),W=H("ODXe"),n=H("4IlW"),D=H("bX4T"),y=H("YrtM"),g=H("TSYQ"),p=H.n(g),l=H("+nKL"),a=H("8OUc"),f=function(K,Q){var ne=K.prefixCls,fe=K.id,we=K.flattenOptions,Se=K.childrenAsData,he=K.values,se=K.searchValue,me=K.multiple,re=K.defaultActiveFirstOption,le=K.height,Z=K.itemHeight,ae=K.notFoundContent,oe=K.open,ge=K.menuItemSelectedIcon,Re=K.virtual,Te=K.onSelect,Me=K.onToggleOpen,Be=K.onActiveValue,pe=K.onScroll,Ce=K.onMouseEnter,ke="".concat(ne,"-item"),Le=Object(y.a)(function(){return we},[oe,we],function(Fe,_e){return _e[0]&&Fe[1]!==_e[1]}),Ge=j.useRef(null),Ve=function(_e){_e.preventDefault()},tt=function(_e){Ge.current&&Ge.current.scrollTo({index:_e})},rt=function(_e){for(var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ve=Le.length,ue=0;ue<ve;ue+=1){var ce=(_e+ue*ye+ve)%ve,be=Le[ce],xe=be.group,Oe=be.data;if(!xe&&!Oe.disabled)return ce}return-1},ut=j.useState(function(){return rt(0)}),lt=Object(W.a)(ut,2),Ne=lt[0],Pe=lt[1],ze=function(_e){Pe(_e);var ye=Le[_e];if(!ye){Be(null,-1);return}Be(ye.data.value,_e)};j.useEffect(function(){ze(re!==!1?rt(0):-1)},[Le.length,se]),j.useEffect(function(){var Fe=setTimeout(function(){if(!me&&oe&&he.size===1){var _e=Array.from(he)[0],ye=Le.findIndex(function(ve){var ue=ve.data;return ue.value===_e});ze(ye),tt(ye)}});return function(){return clearTimeout(Fe)}},[oe]);var Xe=function(_e){_e!==void 0&&Te(_e,{selected:!he.has(_e)}),me||Me(!1)};if(j.useImperativeHandle(Q,function(){return{onKeyDown:function(_e){var ye=_e.which;switch(ye){case n.a.UP:case n.a.DOWN:{var ve=0;if(ye===n.a.UP?ve=-1:ye===n.a.DOWN&&(ve=1),ve!==0){var ue=rt(Ne+ve,ve);tt(ue),ze(ue)}break}case n.a.ENTER:{var ce=Le[Ne];ce&&!ce.data.disabled?Xe(ce.data.value):Xe(void 0),oe&&_e.preventDefault();break}case n.a.ESC:Me(!1)}},onKeyUp:function(){},scrollTo:function(_e){tt(_e)}}}),Le.length===0)return j.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),className:"".concat(ke,"-empty"),onMouseDown:Ve},ae);function je(Fe){var _e=Le[Fe];if(!_e)return null;var ye=_e.data||{},ve=ye.value,ue=ye.label,ce=ye.children,be=Object(D.a)(ye,!0),xe=Se?ce:ue;return _e?j.createElement("div",Object.assign({"aria-label":typeof xe=="string"?xe:null},be,{key:Fe,role:"option",id:"".concat(fe,"_list_").concat(Fe),"aria-selected":he.has(ve)}),ve):null}return j.createElement(j.Fragment,null,j.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),style:{height:0,width:0,overflow:"hidden"}},je(Ne-1),je(Ne),je(Ne+1)),j.createElement(l.a,{itemKey:"key",ref:Ge,data:Le,height:le,itemHeight:Z,fullHeight:!1,onMouseDown:Ve,onScroll:pe,virtual:Re,onMouseEnter:Ce},function(Fe,_e){var ye,ve=Fe.group,ue=Fe.groupOption,ce=Fe.data,be=ce.label,xe=ce.key;if(ve)return j.createElement("div",{className:p()(ke,"".concat(ke,"-group"))},be!==void 0?be:xe);var Oe=ce.disabled,Ue=ce.value,Ke=ce.title,et=ce.children,it=ce.style,nt=ce.className,yt=Object(G.a)(ce,["disabled","value","title","children","style","className"]),bt=he.has(Ue),dt="".concat(ke,"-option"),wt=p()(ke,dt,nt,(ye={},Object(P.a)(ye,"".concat(dt,"-grouped"),ue),Object(P.a)(ye,"".concat(dt,"-active"),Ne===_e&&!Oe),Object(P.a)(ye,"".concat(dt,"-disabled"),Oe),Object(P.a)(ye,"".concat(dt,"-selected"),bt),ye)),Tt=Se?et:be,Ct=!ge||typeof ge=="function"||bt;return j.createElement("div",Object.assign({},yt,{"aria-selected":bt,className:wt,title:Ke,onMouseMove:function(){if(Ne===_e||Oe)return;ze(_e)},onClick:function(){Oe||Xe(Ue)},style:it}),j.createElement("div",{className:"".concat(dt,"-content")},Tt||Ue),j.isValidElement(ge)||bt,Ct&&j.createElement(a.a,{className:"".concat(ke,"-option-state"),customizeIcon:ge,customizeIconProps:{isSelected:bt}},bt?"\u2713":null))}))},u=j.forwardRef(f);u.displayName="OptionList";var d=u,i=function(){return null};i.isSelectOption=!0;var o=i,O=function(){return null};O.isSelectOptGroup=!0;var w=O,C=H("VTBJ"),L=H("Zm9Q");function A(b){var K=b.key,Q=b.props,ne=Q.children,fe=Q.value,we=Object(G.a)(Q,["children","value"]);return Object(C.a)({key:K,value:fe!==void 0?fe:K,children:ne},we)}function _(b){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(b).map(function(Q,ne){if(!j.isValidElement(Q)||!Q.type)return null;var fe=Q.type.isSelectOptGroup,we=Q.key,Se=Q.props,he=Se.children,se=Object(G.a)(Se,["children"]);return K||!fe?A(Q):Object(C.a)(Object(C.a)({key:"__RC_SELECT_GRP__".concat(we===null?ne:we,"__"),label:we},se),{},{options:_(he)})}).filter(function(Q){return Q})}var T=H("2Qr1"),v=H("qNPg"),c=H("U8pU"),E=H("Kwbf"),h=H("WKfj");function x(b){var K=b.mode,Q=b.options,ne=b.children,fe=b.backfill,we=b.allowClear,Se=b.placeholder,he=b.getInputElement,se=b.showSearch,me=b.onSearch,re=b.defaultOpen,le=b.autoFocus,Z=b.labelInValue,ae=b.value,oe=b.inputValue,ge=b.optionLabelProp,Re=K==="multiple"||K==="tags",Te=se!==void 0?se:Re||K==="combobox",Me=Q||_(ne);if(Object(E.a)(K!=="tags"||Me.every(function(ke){return!ke.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),K==="tags"||K==="combobox"){var Be=Me.some(function(ke){return ke.options?ke.options.some(function(Le){return typeof("value"in Le?Le.value:Le.key)=="number"}):typeof("value"in ke?ke.value:ke.key)=="number"});Object(E.a)(!Be,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(K!=="combobox"||!ge,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(K==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(E.a)(K==="combobox"||!he,"`getInputElement` only work with `combobox` mode."),Object(E.b)(K!=="combobox"||!he||!we||!Se,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),me&&!Te&&K!=="combobox"&&K!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!re||le,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ae!=null){var pe=Object(h.d)(ae);Object(E.a)(!Z||pe.every(function(ke){return Object(c.a)(ke)==="object"&&("key"in ke||"value"in ke)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!Re||Array.isArray(ae),"`value` should be array when `mode` is `multiple` or `tags`")}if(ne){var Ce=null;Object(L.a)(ne).some(function(ke){if(!j.isValidElement(ke)||!ke.type)return!1;var Le=ke.type;if(Le.isSelectOption)return!1;if(Le.isSelectOptGroup){var Ge=Object(L.a)(ke.props.children).every(function(Ve){return!j.isValidElement(Ve)||!ke.type||Ve.type.isSelectOption?!0:(Ce=Ve.type,!1)});return!Ge}return Ce=Le,!0}),Ce&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ce.displayName||Ce.name||Ce,"`.")),Object(E.a)(oe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var U=x,F=Object(v.a)({prefixCls:"rc-select",components:{optionList:d},convertChildrenToData:_,flattenOptions:T.d,getLabeledValue:T.e,filterOptions:T.b,isValueDisabled:T.g,findValueOption:T.c,warningProps:U,fillOptionsWithMissingValue:T.a}),S=function(b){Object(N.a)(Q,b);var K=Object($.a)(Q);function Q(){var ne;return Object(ee.a)(this,Q),ne=K.apply(this,arguments),ne.selectRef=j.createRef(),ne.focus=function(){ne.selectRef.current.focus()},ne.blur=function(){ne.selectRef.current.blur()},ne}return Object(V.a)(Q,[{key:"render",value:function(){return j.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),Q}(j.Component);S.Option=o,S.OptGroup=w;var M=S,I=Ee.c=M},M8RZ:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return n});var ee=H("fWQN"),V=H("mtLc"),N=H("yKVA"),$=H("879j"),j=H("q1tI"),P=H.n(j),G=H("i8i4"),W=H.n(G),n=function(D){Object(N.a)(g,D);var y=Object($.a)(g);function g(p){var l;Object(ee.a)(this,g),l=y.call(this,p);var a=window.document;return l.node=a.createElement("div"),a.body.appendChild(l.node),l}return Object(V.a)(g,[{key:"render",value:function(){var l=this.props.children;return Object(G.createPortal)(l,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),g}(P.a.Component)},MI8n:function(at,Ee,H){"use strict";H.d(Ee,"c",function(){return j}),H.d(Ee,"b",function(){return n}),H.d(Ee,"e",function(){return D}),H.d(Ee,"a",function(){return y}),H.d(Ee,"d",function(){return g}),H.d(Ee,"f",function(){return p});var ee=H("/cxE"),V=H("pmY6"),N=H("24hK"),$=H("5Y4S"),j;(function(l){l.None=()=>V.a.None;function a(x){return(U,F=null,S)=>{let M=!1,I;return I=x(b=>M?void 0:(I?I.dispose():M=!0,U.call(F,b)),null,S),M&&I.dispose(),I}}l.once=a;function f(x,U){return w((F,S=null,M)=>x(I=>F.call(S,U(I)),null,M))}l.map=f;function u(x,U){return w((F,S=null,M)=>x(I=>{U(I),F.call(S,I)},null,M))}l.forEach=u;function d(x,U){return w((F,S=null,M)=>x(I=>U(I)&&F.call(S,I),null,M))}l.filter=d;function i(x){return x}l.signal=i;function o(...x){return(U,F=null,S)=>Object(V.e)(...x.map(M=>M(I=>U.call(F,I),null,S)))}l.any=o;function O(x,U,F){let S=F;return f(x,M=>(S=U(S,M),S))}l.reduce=O;function w(x){let U;const F=new n({onFirstListenerAdd(){U=x(F.fire,F)},onLastListenerRemove(){U.dispose()}});return F.event}function C(x,U,F=100,S=!1,M){let I,b,K,Q=0;const ne=new n({leakWarningThreshold:M,onFirstListenerAdd(){I=x(fe=>{Q++,b=U(b,fe),S&&!K&&(ne.fire(b),b=void 0),clearTimeout(K),K=setTimeout(()=>{const we=b;b=void 0,K=void 0,(!S||Q>1)&&ne.fire(we),Q=0},F)})},onLastListenerRemove(){I.dispose()}});return ne.event}l.debounce=C;function L(x,U=(F,S)=>F===S){let F=!0,S;return d(x,M=>{const I=F||!U(M,S);return F=!1,S=M,I})}l.latch=L;function A(x,U){return[l.filter(x,U),l.filter(x,F=>!U(F))]}l.split=A;function _(x,U=!1,F=[]){let S=F.slice(),M=x(K=>{S?S.push(K):b.fire(K)});const I=()=>{S&&S.forEach(K=>b.fire(K)),S=null},b=new n({onFirstListenerAdd(){M||(M=x(K=>b.fire(K)))},onFirstListenerDidAdd(){S&&(U?setTimeout(I):I())},onLastListenerRemove(){M&&M.dispose(),M=null}});return b.event}l.buffer=_;class T{constructor(x){this.event=x}map(x){return new T(f(this.event,x))}forEach(x){return new T(u(this.event,x))}filter(x){return new T(d(this.event,x))}reduce(x,U){return new T(O(this.event,x,U))}latch(){return new T(L(this.event))}debounce(x,U=100,F=!1,S){return new T(C(this.event,x,U,F,S))}on(x,U,F){return this.event(x,U,F)}once(x,U,F){return a(this.event)(x,U,F)}}function v(x){return new T(x)}l.chain=v;function c(x,U,F=S=>S){const S=(...K)=>b.fire(F(...K)),M=()=>x.on(U,S),I=()=>x.removeListener(U,S),b=new n({onFirstListenerAdd:M,onLastListenerRemove:I});return b.event}l.fromNodeEventEmitter=c;function E(x,U,F=S=>S){const S=(...K)=>b.fire(F(...K)),M=()=>x.addEventListener(U,S),I=()=>x.removeEventListener(U,S),b=new n({onFirstListenerAdd:M,onLastListenerRemove:I});return b.event}l.fromDOMEventEmitter=E;function h(x){return new Promise(U=>a(x)(U))}l.toPromise=h})(j||(j={}));class P{constructor(l){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${l}_${P._idPool++}`}start(l){this._stopWatch=new $.a(!0),this._listenerCount=l}stop(){if(this._stopWatch){const l=this._stopWatch.elapsed();this._elapsedOverall+=l,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${l.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}P._idPool=0;let G=-1;class W{constructor(l,a=Math.random().toString(18).slice(2,5)){this.customThreshold=l,this.name=a,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(l){let a=G;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||l<a)return;this._stacks||(this._stacks=new Map);const f=new Error().stack.split(`
`).slice(3).join(`
`),u=this._stacks.get(f)||0;if(this._stacks.set(f,u+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let d,i=0;for(const[o,O]of this._stacks)(!d||i<O)&&(d=o,i=O);console.warn(`[${this.name}] potential listener LEAK detected, having ${l} listeners already. MOST frequent listener (${i}):`),console.warn(d)}return()=>{const d=this._stacks.get(f)||0;this._stacks.set(f,d-1)}}}class n{constructor(l){var a;this._disposed=!1,this._options=l,this._leakageMon=G>0?new W(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((a=this._options)===null||a===void 0?void 0:a._profName)?new P(this._options._profName):void 0}get event(){return this._event||(this._event=(l,a,f)=>{var u;this._listeners||(this._listeners=new N.a);const d=this._listeners.isEmpty();d&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(a?[l,a]:l);d&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,l,a);const o=(u=this._leakageMon)===null||u===void 0?void 0:u.check(this._listeners.size),O=Object(V.i)(()=>{if(o&&o(),!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){const w=this._listeners&&!this._listeners.isEmpty();w||this._options.onLastListenerRemove(this)}});return f instanceof V.b?f.add(O):Array.isArray(f)&&f.push(O),O}),this._event}fire(l){var a,f;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new N.a);for(let u of this._listeners)this._deliveryQueue.push([u,l]);for((a=this._perfMon)===null||a===void 0||a.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[u,d]=this._deliveryQueue.shift();try{typeof u=="function"?u.call(void 0,d):u[0].call(u[1],d)}catch(i){Object(ee.f)(i)}}(f=this._perfMon)===null||f===void 0||f.stop()}}dispose(){var l,a,f,u,d;this._disposed||(this._disposed=!0,(l=this._listeners)===null||l===void 0||l.clear(),(a=this._deliveryQueue)===null||a===void 0||a.clear(),(u=(f=this._options)===null||f===void 0?void 0:f.onLastListenerRemove)===null||u===void 0||u.call(f),(d=this._leakageMon)===null||d===void 0||d.dispose())}}class D extends n{constructor(l){super(l);this._isPaused=0,this._eventQueue=new N.a,this._mergeFn=l==null?void 0:l.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const l=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(l))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(l){this._listeners&&(this._isPaused!==0?this._eventQueue.push(l):super.fire(l))}}class y extends D{constructor(l){var a;super(l);this._delay=(a=l.delay)!==null&&a!==void 0?a:100}fire(l){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(l)}}class g{constructor(){this.buffers=[]}wrapEvent(l){return(a,f,u)=>l(d=>{const i=this.buffers[this.buffers.length-1];i?i.push(()=>a.call(f,d)):a.call(f,d)},void 0,u)}bufferEvents(l){const a=[];this.buffers.push(a);const f=l();return this.buffers.pop(),a.forEach(u=>u()),f}}class p{constructor(){this.listening=!1,this.inputEvent=j.None,this.inputEventListener=V.a.None,this.emitter=new n({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(l){this.inputEvent=l,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=l(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(at,Ee,H){"use strict";(function(ee,V){H.d(Ee,"b",function(){return f}),H.d(Ee,"i",function(){return o}),H.d(Ee,"f",function(){return O}),H.d(Ee,"d",function(){return w}),H.d(Ee,"g",function(){return C}),H.d(Ee,"h",function(){return L}),H.d(Ee,"c",function(){return A}),H.d(Ee,"k",function(){return _}),H.d(Ee,"j",function(){return T}),H.d(Ee,"a",function(){return v}),H.d(Ee,"e",function(){return h});var N;const $="en";let j=!1,P=!1,G=!1,W=!1,n=!1,D=!1,y=!1,g,p=$,l,a;const f=typeof self=="object"?self:typeof ee=="object"?ee:{};let u;typeof f.vscode!="undefined"&&typeof f.vscode.process!="undefined"?u=f.vscode.process:typeof V!="undefined"&&(u=V);const d=typeof((N=u==null?void 0:u.versions)===null||N===void 0?void 0:N.electron)=="string"&&u.type==="renderer";if(typeof navigator=="object"&&!d)a=navigator.userAgent,j=a.indexOf("Windows")>=0,P=a.indexOf("Macintosh")>=0,y=(a.indexOf("Macintosh")>=0||a.indexOf("iPad")>=0||a.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=a.indexOf("Linux")>=0,D=!0,g=navigator.language,p=g;else if(typeof u=="object"){j=u.platform==="win32",P=u.platform==="darwin",G=u.platform==="linux",W=G&&!!u.env.SNAP&&!!u.env.SNAP_REVISION,g=$,p=$;const x=u.env.VSCODE_NLS_CONFIG;if(x)try{const U=JSON.parse(x),F=U.availableLanguages["*"];g=U.locale,p=F||$,l=U._translationsConfigFile}catch(U){}n=!0}else console.error("Unable to resolve platform.");let i=0;P?i=1:j?i=3:G&&(i=2);const o=j,O=P,w=G,C=n,L=D,A=y,_=a,T=function(){if(f.setImmediate)return f.setImmediate.bind(f);if(typeof f.postMessage=="function"&&!f.importScripts){let F=[];f.addEventListener("message",M=>{if(M.data&&M.data.vscodeSetImmediateId)for(let I=0,b=F.length;I<b;I++){const K=F[I];if(K.id===M.data.vscodeSetImmediateId){F.splice(I,1),K.callback();return}}});let S=0;return M=>{const I=++S;F.push({id:I,callback:M}),f.postMessage({vscodeSetImmediateId:I},"*")}}if(typeof(u==null?void 0:u.nextTick)=="function")return u.nextTick.bind(u);const U=Promise.resolve();return F=>U.then(F)}(),v=P||y?2:j?1:3;let c=!0,E=!1;function h(){if(!E){E=!0;const x=new Uint8Array(2);x[0]=1,x[1]=2;const U=new Uint16Array(x.buffer);c=U[0]===(2<<8)+1}return c}}).call(this,H("IyRk"),H("Q2Ig"))},N0LK:function(at,Ee,H){"use strict";H.d(Ee,"C",function(){return ee}),H.d(Ee,"v",function(){return N}),H.d(Ee,"s",function(){return $}),H.d(Ee,"t",function(){return j}),H.d(Ee,"U",function(){return P}),H.d(Ee,"J",function(){return G}),H.d(Ee,"O",function(){return W}),H.d(Ee,"p",function(){return n}),H.d(Ee,"T",function(){return D}),H.d(Ee,"q",function(){return y}),H.d(Ee,"N",function(){return g}),H.d(Ee,"M",function(){return p}),H.d(Ee,"Q",function(){return l}),H.d(Ee,"u",function(){return a}),H.d(Ee,"x",function(){return f}),H.d(Ee,"I",function(){return u}),H.d(Ee,"f",function(){return d}),H.d(Ee,"h",function(){return i}),H.d(Ee,"g",function(){return o}),H.d(Ee,"i",function(){return O}),H.d(Ee,"G",function(){return w}),H.d(Ee,"H",function(){return C}),H.d(Ee,"r",function(){return L}),H.d(Ee,"R",function(){return A}),H.d(Ee,"d",function(){return _}),H.d(Ee,"e",function(){return T}),H.d(Ee,"E",function(){return v}),H.d(Ee,"F",function(){return c}),H.d(Ee,"j",function(){return E}),H.d(Ee,"z",function(){return h}),H.d(Ee,"K",function(){return U}),H.d(Ee,"L",function(){return F}),H.d(Ee,"m",function(){return M}),H.d(Ee,"k",function(){return b}),H.d(Ee,"A",function(){return Q}),H.d(Ee,"a",function(){return ne}),H.d(Ee,"n",function(){return fe}),H.d(Ee,"l",function(){return we}),H.d(Ee,"D",function(){return Se}),H.d(Ee,"B",function(){return he}),H.d(Ee,"b",function(){return se}),H.d(Ee,"S",function(){return me}),H.d(Ee,"o",function(){return re}),H.d(Ee,"P",function(){return le}),H.d(Ee,"w",function(){return Z}),H.d(Ee,"c",function(){return ae}),H.d(Ee,"y",function(){return Re});function ee(pe){return!pe||typeof pe!="string"?!0:pe.trim().length===0}const V=/{(\d+)}/g;function N(pe,...Ce){return Ce.length===0?pe:pe.replace(V,function(ke,Le){const Ge=parseInt(Le,10);return isNaN(Ge)||Ge<0||Ge>=Ce.length?ke:Ce[Ge]})}function $(pe){return pe.replace(/[<>&]/g,function(Ce){switch(Ce){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Ce}})}function j(pe){return pe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function P(pe,Ce=" "){const ke=G(pe,Ce);return W(ke,Ce)}function G(pe,Ce){if(!pe||!Ce)return pe;const ke=Ce.length;if(ke===0||pe.length===0)return pe;let Le=0;for(;pe.indexOf(Ce,Le)===Le;)Le=Le+ke;return pe.substring(Le)}function W(pe,Ce){if(!pe||!Ce)return pe;const ke=Ce.length,Le=pe.length;if(ke===0||Le===0)return pe;let Ge=Le,Ve=-1;for(;!(Ve=pe.lastIndexOf(Ce,Ge-1),Ve===-1||Ve+ke!==Ge);){if(Ve===0)return"";Ge=Ve}return pe.substring(0,Ge)}function n(pe){return pe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(pe){return pe.replace(/\*/g,"")}function y(pe,Ce,ke={}){if(!pe)throw new Error("Cannot create regex from empty string");Ce||(pe=j(pe)),ke.wholeWord&&(/\B/.test(pe.charAt(0))||(pe="\\b"+pe),/\B/.test(pe.charAt(pe.length-1))||(pe=pe+"\\b"));let Le="";return ke.global&&(Le+="g"),ke.matchCase||(Le+="i"),ke.multiline&&(Le+="m"),ke.unicode&&(Le+="u"),new RegExp(pe,Le)}function g(pe){if(pe.source==="^"||pe.source==="^$"||pe.source==="$"||pe.source==="^\\s*$")return!1;const Ce=pe.exec("");return!!(Ce&&pe.lastIndex===0)}function p(pe){return(pe.global?"g":"")+(pe.ignoreCase?"i":"")+(pe.multiline?"m":"")+(pe.unicode?"u":"")}function l(pe){return pe.split(/\r\n|\r|\n/)}function a(pe){for(let Ce=0,ke=pe.length;Ce<ke;Ce++){const Le=pe.charCodeAt(Ce);if(Le!==32&&Le!==9)return Ce}return-1}function f(pe,Ce=0,ke=pe.length){for(let Le=Ce;Le<ke;Le++){const Ge=pe.charCodeAt(Le);if(Ge!==32&&Ge!==9)return pe.substring(Ce,Le)}return pe.substring(Ce,ke)}function u(pe,Ce=pe.length-1){for(let ke=Ce;ke>=0;ke--){const Le=pe.charCodeAt(ke);if(Le!==32&&Le!==9)return ke}return-1}function d(pe,Ce){return pe<Ce?-1:pe>Ce?1:0}function i(pe,Ce,ke=0,Le=pe.length,Ge=0,Ve=Ce.length){for(;ke<Le&&Ge<Ve;ke++,Ge++){let ut=pe.charCodeAt(ke),lt=Ce.charCodeAt(Ge);if(ut<lt)return-1;if(ut>lt)return 1}const tt=Le-ke,rt=Ve-Ge;return tt<rt?-1:tt>rt?1:0}function o(pe,Ce){return O(pe,Ce,0,pe.length,0,Ce.length)}function O(pe,Ce,ke=0,Le=pe.length,Ge=0,Ve=Ce.length){for(;ke<Le&&Ge<Ve;ke++,Ge++){let ut=pe.charCodeAt(ke),lt=Ce.charCodeAt(Ge);if(ut===lt)continue;if(ut>=128||lt>=128)return i(pe.toLowerCase(),Ce.toLowerCase(),ke,Le,Ge,Ve);w(ut)&&(ut-=32),w(lt)&&(lt-=32);const Ne=ut-lt;if(Ne===0)continue;return Ne}const tt=Le-ke,rt=Ve-Ge;return tt<rt?-1:tt>rt?1:0}function w(pe){return pe>=97&&pe<=122}function C(pe){return pe>=65&&pe<=90}function L(pe,Ce){return pe.length===Ce.length&&O(pe,Ce)===0}function A(pe,Ce){const ke=Ce.length;return Ce.length>pe.length?!1:O(pe,Ce,0,ke)===0}function _(pe,Ce){let ke,Le=Math.min(pe.length,Ce.length);for(ke=0;ke<Le;ke++)if(pe.charCodeAt(ke)!==Ce.charCodeAt(ke))return ke;return Le}function T(pe,Ce){let ke,Le=Math.min(pe.length,Ce.length);const Ge=pe.length-1,Ve=Ce.length-1;for(ke=0;ke<Le;ke++)if(pe.charCodeAt(Ge-ke)!==Ce.charCodeAt(Ve-ke))return ke;return Le}function v(pe){return 55296<=pe&&pe<=56319}function c(pe){return 56320<=pe&&pe<=57343}function E(pe,Ce){return(pe-55296<<10)+(Ce-56320)+65536}function h(pe,Ce,ke){const Le=pe.charCodeAt(ke);if(v(Le)&&ke+1<Ce){const Ge=pe.charCodeAt(ke+1);if(c(Ge))return E(Le,Ge)}return Le}function x(pe,Ce){const ke=pe.charCodeAt(Ce-1);if(c(ke)&&Ce>1){const Le=pe.charCodeAt(Ce-2);if(v(Le))return E(Le,ke)}return ke}function U(pe,Ce){const ke=oe.getInstance(),Le=Ce,Ge=pe.length,Ve=h(pe,Ge,Ce);Ce+=Ve>=65536?2:1;let tt=ke.getGraphemeBreakType(Ve);for(;Ce<Ge;){const rt=h(pe,Ge,Ce),ut=ke.getGraphemeBreakType(rt);if(ae(tt,ut))break;Ce+=rt>=65536?2:1,tt=ut}return Ce-Le}function F(pe,Ce){const ke=oe.getInstance(),Le=Ce,Ge=x(pe,Ce);Ce-=Ge>=65536?2:1;let Ve=ke.getGraphemeBreakType(Ge);for(;Ce>0;){const tt=x(pe,Ce),rt=ke.getGraphemeBreakType(tt);if(ae(rt,Ve))break;Ce-=tt>=65536?2:1,Ve=rt}return Le-Ce}const S=/(?:[\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(pe){return S.test(pe)}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 b(pe){return I.test(pe)}const K=/^[\t\n\r\x20-\x7E]*$/;function Q(pe){return K.test(pe)}const ne=/[\u2028\u2029]/;function fe(pe){return ne.test(pe)}function we(pe){for(let Ce=0,ke=pe.length;Ce<ke;Ce++)if(Se(pe.charCodeAt(Ce)))return!0;return!1}function Se(pe){return pe=+pe,pe>=11904&&pe<=55215||pe>=63744&&pe<=64255||pe>=65281&&pe<=65374}function he(pe){return pe>=127462&&pe<=127487||pe===8986||pe===8987||pe===9200||pe===9203||pe>=9728&&pe<=10175||pe===11088||pe===11093||pe>=127744&&pe<=128591||pe>=128640&&pe<=128764||pe>=128992&&pe<=129003||pe>=129280&&pe<=129535||pe>=129648&&pe<=129750}const se=String.fromCharCode(65279);function me(pe){return!!(pe&&pe.length>0&&pe.charCodeAt(0)===65279)}function re(pe,Ce=!1){return pe?(Ce&&(pe=pe.replace(/\\./g,"")),pe.toLowerCase()!==pe):!1}function le(pe){const Ce=90-65+1;return pe=pe%(2*Ce),pe<Ce?String.fromCharCode(97+pe):String.fromCharCode(65+pe-Ce)}function Z(pe){const Ce=oe.getInstance();return Ce.getGraphemeBreakType(pe)}function ae(pe,Ce){return pe===0?Ce!==5&&Ce!==7:pe===2&&Ce===3?!1:pe===4||pe===2||pe===3||(Ce===4||Ce===2||Ce===3)?!0:pe===8&&(Ce===8||Ce===9||Ce===11||Ce===12)||((pe===11||pe===9)&&(Ce===9||Ce===10)||((pe===12||pe===10)&&Ce===10||(Ce===5||Ce===13||(Ce===7||(pe===1||pe===13&&Ce===14)))))?!1:!(pe===6&&Ce===6)}class oe{constructor(){this._data=ge()}static getInstance(){return oe._INSTANCE||(oe._INSTANCE=new oe),oe._INSTANCE}getGraphemeBreakType(pe){if(pe<32)return pe===10?3:pe===13?2:4;if(pe<127)return 0;const Ce=this._data,ke=Ce.length/3;let Le=1;for(;Le<=ke;)if(pe<Ce[3*Le])Le=2*Le;else if(pe>Ce[3*Le+1])Le=2*Le+1;else return Ce[3*Le+2];return 0}}oe._INSTANCE=null;function ge(){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 Re(pe,Ce){if(pe===0)return 0;const ke=Te(pe,Ce);if(ke!==void 0)return ke;const Le=x(Ce,pe);return pe-=Me(Le),pe}function Te(pe,Ce){let ke=x(Ce,pe);for(pe-=Me(ke);Be(ke)||ke===65039||ke===8419;){if(pe===0)return;ke=x(Ce,pe),pe-=Me(ke)}if(!he(ke))return;if(pe>=0){const Le=x(Ce,pe);Le===8205&&(pe-=Me(Le))}return pe}function Me(pe){return pe>=65536?2:1}function Be(pe){return 127995<=pe&&pe<=127999}},NvD2:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return P});var ee=H("Kwbf");function V(G,W){var n=new Set;return G.forEach(function(D){W.has(D)||n.add(D)}),n}function N(G){var W=G||{},n=W.disabled,D=W.disableCheckbox,y=W.checkable;return!!(n||D)||y===!1}function $(G,W,n,D){for(var y=new Set(G),g=new Set,p=0;p<=n;p+=1){var l=W.get(p)||new Set;l.forEach(function(d){var i=d.key,o=d.node,O=d.children,w=O===void 0?[]:O;y.has(i)&&!D(o)&&w.filter(function(C){return!D(C.node)}).forEach(function(C){y.add(C.key)})})}for(var a=new Set,f=n;f>=0;f-=1){var u=W.get(f)||new Set;u.forEach(function(d){var i=d.parent,o=d.node;if(D(o)||!d.parent||a.has(d.parent.key))return;if(D(d.parent.node)){a.add(i.key);return}var O=!0,w=!1;(i.children||[]).filter(function(C){return!D(C.node)}).forEach(function(C){var L=C.key,A=y.has(L);O&&!A&&(O=!1),!w&&(A||g.has(L))&&(w=!0)}),O&&y.add(i.key),w&&g.add(i.key),a.add(i.key)})}return{checkedKeys:Array.from(y),halfCheckedKeys:Array.from(V(g,y))}}function j(G,W,n,D,y){for(var g=new Set(G),p=new Set(W),l=0;l<=D;l+=1){var a=n.get(l)||new Set;a.forEach(function(i){var o=i.key,O=i.node,w=i.children,C=w===void 0?[]:w;!g.has(o)&&!p.has(o)&&!y(O)&&C.filter(function(L){return!y(L.node)}).forEach(function(L){g.delete(L.key)})})}p=new Set;for(var f=new Set,u=D;u>=0;u-=1){var d=n.get(u)||new Set;d.forEach(function(i){var o=i.parent,O=i.node;if(y(O)||!i.parent||f.has(i.parent.key))return;if(y(i.parent.node)){f.add(o.key);return}var w=!0,C=!1;(o.children||[]).filter(function(L){return!y(L.node)}).forEach(function(L){var A=L.key,_=g.has(A);w&&!_&&(w=!1),!C&&(_||p.has(A))&&(C=!0)}),w||g.delete(o.key),C&&p.add(o.key),f.add(o.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(V(p,g))}}function P(G,W,n,D){var y=[],g;D?g=D:g=N;var p=new Set(G.filter(function(u){var d=!!n[u];return d||y.push(u),d})),l=new Map,a=0;Object.keys(n).forEach(function(u){var d=n[u],i=d.level,o=l.get(i);o||(o=new Set,l.set(i,o)),o.add(d),a=Math.max(a,i)}),Object(ee.a)(!y.length,"Tree missing follow keys: ".concat(y.slice(0,100).map(function(u){return"'".concat(u,"'")}).join(", ")));var f;return W===!0?f=$(p,l,a,g):f=j(p,W.halfCheckedKeys,l,a,g),f}},O2Wb:function(at,Ee,H){at.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OZM5:function(at,Ee,H){"use strict";H.d(Ee,"b",function(){return D}),H.d(Ee,"a",function(){return y}),H.d(Ee,"k",function(){return g}),H.d(Ee,"h",function(){return p}),H.d(Ee,"i",function(){return l}),H.d(Ee,"g",function(){return a}),H.d(Ee,"c",function(){return f}),H.d(Ee,"d",function(){return u}),H.d(Ee,"j",function(){return o}),H.d(Ee,"e",function(){return O}),H.d(Ee,"f",function(){return w});var ee=H("KQm4"),V=H("U8pU"),N=H("Ff2n"),$=H("q1tI"),j=H.n($),P=H("Kwbf"),G=H("WaYH"),W=.25,n=2;function D(C,L){var A=C.slice(),_=A.indexOf(L);return _>=0&&A.splice(_,1),A}function y(C,L){var A=C.slice();return A.indexOf(L)===-1&&A.push(L),A}function g(C){return C.split("-")}function p(C,L){return"".concat(C,"-").concat(L)}function l(C){return C&&C.type&&C.type.isTreeNode}function a(C,L){var A=[C],_=L[C];function T(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];v.forEach(function(c){var E=c.key,h=c.children;A.push(E),T(h)})}return T(_.children),A}function f(C,L){var A=C.clientY,_=L.selectHandle.getBoundingClientRect(),T=_.top,v=_.bottom,c=_.height,E=Math.max(c*W,n);return A<=T+E?-1:A>=v-E?1:0}function u(C,L){if(!C)return;var A=L.multiple;return A?C.slice():C.length?[C[0]]:C}var d=function(L){return L};function i(C,L){if(!C)return[];var A=L||{},_=A.processProps,T=_===void 0?d:_,v=Array.isArray(C)?C:[C];return v.map(function(c){var E=c.children,h=Object(N.a)(c,["children"]),x=i(E,L);return j.a.createElement(G.a,Object.assign({},T(h)),x)})}function o(C){if(!C)return null;var L;if(Array.isArray(C))L={checkedKeys:C,halfCheckedKeys:void 0};else if(Object(V.a)(C)==="object")L={checkedKeys:C.checked||void 0,halfCheckedKeys:C.halfChecked||void 0};else return Object(P.a)(!1,"`checkedKeys` is not an array or an object"),null;return L}function O(C,L){var A=new Set;function _(T){if(A.has(T))return;var v=L[T];if(!v)return;A.add(T);var c=v.parent,E=v.node;if(E.disabled)return;c&&_(c.key)}return(C||[]).forEach(function(T){_(T)}),Object(ee.a)(A)}function w(C){var L={};return Object.keys(C).forEach(function(A){(A.startsWith("data-")||A.startsWith("aria-"))&&(L[A]=C[A])}),L}},Ot1p:function(at,Ee,H){"use strict";var ee=H("2qtc"),V=H("kLXV"),N=H("rAM+"),$=H("miYZ"),j=H("tsqr"),P=H("9og8"),G=H("tJVT"),W=H("jrin"),n=H("WmNS"),D=H.n(n),y=H("q1tI"),g=H.n(y),p=H("VrN/"),l=H.n(p),a=H("bdgK"),f=H("p77/"),u=H("Bd2K"),d=H("ELLl"),i=H("19Vz"),o=H("lZu9"),O=H("+NIl"),w=H("kSUc"),C=H("9Bee"),L=function(Oe){var Ue=Oe.value,Ke=Ue===void 0?"":Ue,et=Oe.className,it=Oe.showTextOnly,nt=Oe.showLines,yt=Oe.style,bt=yt===void 0?{}:yt,dt=Object(y.useMemo)(function(){return""},[Ke]);return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{dangerouslySetInnerHTML:{__html:dt}}))},A=H("0Owb"),_=H("dejd"),T=H("C+DQ"),v=H("1vsH"),c=H("m3rI"),E=[{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 h(Oe){var Ue=Oe.onActionCallback,Ke=Oe.title,et=Oe.icon,it=Oe.actionName,nt=Oe.className,yt=nt===void 0?"":nt,bt=Oe.children;function dt(){Ue(it)}return g.a.createElement("a",{title:Ke,className:yt,onClick:dt},g.a.createElement("i",{className:"md-iconfont ".concat(et)}),bt)}var x=function(Oe){var Ue=Oe.watch,Ke=Oe.showNullButton,et=Oe.onActionCallback,it=Oe.fullScreen,nt=Oe.insertTemp,yt=Oe.hidetoolBar,bt=Oe.uuid,dt=Oe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(v.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(v.F)("_educoder_session"),"&key=").concat(bt,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var wt=[].concat(E,[{title:"".concat(Ue?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ue?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return g.a.createElement("ul",{className:"markdown-toolbar-container"},!yt&&wt.map(function(Tt,Ct){return g.a.createElement("li",{key:Ct},Tt.actionName?g.a.createElement(h,Object(A.a)({},Tt,{onActionCallback:et})):g.a.createElement("span",{className:"v-line"}))}),Ke?g.a.createElement("li",null,g.a.createElement(h,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:et},g.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,nt&&g.a.createElement("li",null,g.a.createElement(h,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(nt),onActionCallback:et},g.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),g.a.createElement("li",{className:"btn-full-screen"},g.a.createElement(h,{icon:"".concat(it?"icon-shrink":"icon-enlarge"),title:it?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:et})))},U=H("M8RZ"),F=H("+L6B"),S=H("2/Rp"),M=H("y8nQ"),I=H("Vl3Y"),b=H("5NDa"),K=H("5rEg"),Q={labelCol:{span:4},wrapperCol:{span:20}},ne=function(Oe){var Ue=Oe.callback,Ke=Oe.onCancel;function et(it){Ue(it)}return g.a.createElement(I.a,Object(A.a)({},Q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:et}),g.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},g.a.createElement(K.a,null)),g.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},g.a.createElement(K.a,null)),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(S.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(S.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))},fe=H("7ahc"),we=H("HmJG"),Se=H("BjJ7"),he=I.a.useForm,se={width:280,marginRight:10},me={labelCol:{span:5},wrapperCol:{span:19}},re=function(Oe){var Ue=Oe.callback,Ke=Oe.onCancel,et=he(),it=Object(G.a)(et,1),nt=it[0];function yt(wt){Ue(wt)}function bt(wt,Tt){if(wt.status===-1){j.b.error(wt.message);return}nt.setFieldsValue({src:"/api/attachments/".concat(wt.id),type:Tt.type})}function dt(wt){var Tt=wt.target.files[0];Z(Tt,bt)}return g.a.createElement(I.a,Object(A.a)({form:nt},me,{className:"upload-image-panel",onFinish:yt}),g.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},g.a.createElement("div",{className:"flex-container"},g.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},g.a.createElement(K.a,{style:se})),g.a.createElement(le,{onFileChange:dt}))),g.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},g.a.createElement(K.a,{style:{width:264}})),g.a.createElement(I.a.Item,{style:{textAlign:"right"}},g.a.createElement(S.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(S.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))};function le(Oe){var Ue=Oe.onFileChange;return g.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",g.a.createElement("input",{type:"file",onChange:Ue}))}function Z(Oe,Ue){if(!Oe)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ke=new FormData;Ke.append("editormd-image-file",Oe),Ke.append("file_param_name","editormd-image-file"),Ke.append("byxhr","true");var et=new window.XMLHttpRequest;et.withCredentials=!0,et.addEventListener("load",function(it){Ue(JSON.parse(it.target.responseText),Oe)},!1),et.addEventListener("error",function(it){console.error(it)},!1),et.open("POST","".concat(Se.a,"/api/attachments.json")),et.send(Ke)}var ae=H("giR+"),oe=H("fyUT"),ge=H("7Kak"),Re=H("9yH6"),Te=Re.a.Group,Me={margin:"0 8px"},Be=function(Oe){var Ue=Oe.callback,Ke=Oe.onCancel;function et(it){Ue(it)}return g.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:et},g.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},g.a.createElement("span",{style:Me},"\u5355\u5143\u683C\u6570\uFF1A"),g.a.createElement("span",{style:Me},"\u884C\u6570"),g.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},g.a.createElement(oe.a,null)),g.a.createElement("span",{style:Me},"\u5217\u6570"),g.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},g.a.createElement(oe.a,null))),g.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},g.a.createElement("span",{style:Me},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),g.a.createElement(I.a.Item,{name:"align"},g.a.createElement(Te,null,g.a.createElement(Re.a,{value:"default"},g.a.createElement("i",{className:"fa fa-align-justify"})),g.a.createElement(Re.a,{value:"left"},g.a.createElement("i",{className:"fa fa-align-left"})),g.a.createElement(Re.a,{value:"center"},g.a.createElement("i",{className:"fa fa-align-center"})),g.a.createElement(Re.a,{value:"right"},g.a.createElement("i",{className:"fa fa-align-right"}))))),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(S.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(S.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))},pe=H("ErOA"),Ce=H("7Cbv"),ke="link",Le="upload-image",Ge="code-block",Ve="add-table",tt="------------",rt={default:tt,left:":".concat(tt),center:":".concat(tt,":"),right:"".concat(tt,":")},ut=H("9VGf"),lt,Ne;function Pe(){}var ze=0,Xe=1e4,je="\u2581",Fe=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function _e(Oe){return/^\d+$/.test(Oe)?"".concat(Oe,"px"):Oe}var ye=navigator.platform.toUpperCase().indexOf("MAC")>=0,ve=ye?"Cmd":"Ctrl",ue=["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"],ce=(lt={},Object(W.a)(lt,ve+"-B","bold"),Object(W.a)(lt,ve+"-I","italic"),lt),be=(Ne={},Object(W.a)(Ne,ke,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(Ne,Ge,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(Ne,Le,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(Ne,Ve,"\u6DFB\u52A0\u8868\u683C"),Ne),xe=Ee.a=function(Oe){var Ue=Oe.defaultValue,Ke=Ue===void 0?"":Ue,et=Oe.onChange,it=Oe.width,nt=it===void 0?"100%":it,yt=Oe.height,bt=yt===void 0?400:yt,dt=Oe.miniToolbar,wt=dt===void 0?!1:dt,Tt=Oe.isFocus,Ct=Tt===void 0?!1:Tt,Nt=Oe.watch,At=Oe.insertTemp,It=Oe.mode,gt=It===void 0?"markdown":It,Ye=Oe.id,_t=Ye===void 0?"markdown-editor-id":Ye,$e=Oe.showResizeBar,Je=$e===void 0?!1:$e,vt=Oe.noStorage,St=vt===void 0?!1:vt,Rt=Oe.showNullButton,mt=Rt===void 0?!1:Rt,ct=Oe.hidetoolBar,Vt=ct===void 0?!1:ct,jt=Oe.fullScreen,qt=jt===void 0?!1:jt,Wt=Oe.onBlur,rn=Oe.onCMBeforeChange,On=Oe.onFullScreen,Ln=Oe.className,Qe=Ln===void 0?"":Ln,ht=Oe.disablePaste,Qt=ht===void 0?!1:ht,pn=Oe.placeholder,_n=pn===void 0?"":pn,fn=Oe.values,Y=fn===void 0?"":fn,R=Object(y.useState)(null),k=Object(G.a)(R,2),z=k[0],ie=k[1],J=Object(y.useState)(Ke),De=Object(G.a)(J,2),qe=De[0],ft=De[1],Lt=Object(y.useState)(Nt),st=Object(G.a)(Lt,2),Pt=st[0],Ut=st[1],mn=Object(y.useState)(qt),Fn=Object(G.a)(mn,2),kn=Fn[0],Tn=Fn[1],er=Object(y.useState)(""),_r=Object(G.a)(er,2),Kt=_r[0],Bt=_r[1],zt=Object(y.useState)(0),$t=Object(G.a)(zt,2),Zt=$t[0],an=$t[1],bn=Object(y.useState)(bt),Pn=Object(G.a)(bn,2),Un=Pn[0],Cn=Pn[1],Bn=Object(y.useState)(!1),tr=Object(G.a)(Bn,2),Er=tr[0],nr=tr[1],dn=Object(y.useRef)(Object(Ce.a)()),Xt=Object(y.useRef)(!1),wn=Object(y.useRef)(),Yt=Object(y.useRef)(),sn=Object(y.useRef)(),on=Object(y.useRef)(),rr=Object(y.useRef)(),Mn=function(){var kt=Object(P.a)(D.a.mark(function Gt(){var Mt,Jt;return D.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return En.next=2,Object(pe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:dn.current}});case 2:Jt=En.sent,Jt!=null&&(Mt=Jt.attachments)!==null&&Mt!==void 0&&Mt.length&&(console.log("cm:",z,Yt),Jt.attachments.map(function(ln){ln.content_type.indexOf("image")>-1?z.replaceSelection("![,](/api/attachments/".concat(ln.id,"?type=").concat(ln.content_type,")")):ln.content_type.indexOf("video")>-1?z.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):ln.content_type.indexOf("pdf")>-1?z.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(ln.id,"?type=").concat(ln.content_type,'&disposition=inline" target="_blank">').concat(ln.name,"</a>")):z.replaceSelection("[".concat(ln.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(ln.id,"?type=").concat(ln.content_type,")"))}));case 4:case"end":return En.stop()}},Gt)}));return function(){return kt.apply(this,arguments)}}();Object(y.useEffect)(function(){ft(Y),z==null||z.setValue(Y)},[Y]),Object(y.useEffect)(function(){On==null||On(kn)},[kn]),Object(y.useEffect)(function(){if(Yt.current){var kt=l.a.fromTextArea(Yt.current,{mode:gt,lineNumbers:!wt,lineWrapping:!0,value:Ke,autoCloseTags:!0,autoCloseBrackets:!0});Ct&&kt.focus();function Gt(Mt,Jt){if(Qt){Jt.preventDefault();return}var un=Jt.clipboardData;if(un){var En=un.types.toString(),ln=un.items;if(En==="Files"||un.types.indexOf("Files")>-1){if(Jt.preventDefault(),gt=="stex")return;try{var Dn,$n=ln[1];((Dn=ln[0])===null||Dn===void 0?void 0:Dn.kind)==="file"&&($n=ln[0]);var en=$n.getAsFile(),vr=en.name.split(".").pop();Z(en,function(gn){if(gn.id){var Kn,Gn,hr;(en==null||((Kn=en.type)===null||Kn===void 0)?void 0:Kn.indexOf("image"))>-1?kt.replaceSelection("![,](/api/attachments/".concat(gn.id,"?type=").concat(gn.content_type,")")):(en==null||((Gn=en.type)===null||Gn===void 0)?void 0:Gn.indexOf("video"))>-1?kt.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(gn.id,'"></video>')):(en==null||((hr=en.type)===null||hr===void 0)?void 0:hr.indexOf("pdf"))>-1?kt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(gn.id,"?type=").concat(en.type,'&disposition=inline" target="_blank">').concat(en.name,"</a>")):ue.includes(vr)?kt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(gn.id,'?type=office&disposition=inline" target="_blank">').concat(en.name,"</a>")):kt.replaceSelection("[".concat(en.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(gn.id,"?type=").concat(gn.content_type,")"))}else(gn==null?void 0:gn.status)===401&&(document.location.href="/user/login")})}catch(gn){j.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return kt.on("paste",Gt),kt.on("dragleave",function(Mt,Jt){sn.current.classList.remove("mouse-hover-md")}),kt.on("dragover",function(Mt,Jt){sn.current.classList.add("mouse-hover-md")}),kt.on("drop",function(Mt,Jt){sn.current.classList.add("mouse-hover-md");var un;if(un=Jt.dataTransfer.files,un.length>0){Jt.preventDefault(),Jt.stopPropagation();for(var En=function($n){var en=un[$n],vr=en.name.split(".").pop();Z(en,function(gn){if(gn.id){var Kn,Gn,hr;(en==null||((Kn=en.type)===null||Kn===void 0)?void 0:Kn.indexOf("image"))>-1?kt.replaceSelection("![,](/api/attachments/".concat(gn.id,"?type=").concat(gn.content_type,")")):(en==null||((Gn=en.type)===null||Gn===void 0)?void 0:Gn.indexOf("video"))>-1?kt.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(gn.id,'"></video>')):(en==null||((hr=en.type)===null||hr===void 0)?void 0:hr.indexOf("pdf"))>-1?kt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(gn.id,"?type=").concat(en.type,'&disposition=inline" target="_blank">').concat(en.name,"</a>")):ue.includes(vr)?kt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(gn.id,'?type=office&disposition=inline" target="_blank">').concat(en.name,"</a>")):kt.replaceSelection("[".concat(en.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(gn.id,"?type=").concat(gn.content_type,")"))}else(gn==null?void 0:gn.status)===401&&(document.location.href="/user/login")})},ln=0;ln<un.length;ln++)En(ln)}}),ie(kt),function(){kt.off("paste",Gt)}}},[]);var nn=Object(y.useCallback)(function(){if(sn.current)try{}catch(kt){console.log(kt,"---- to set md editor body height")}},[Un,sn,kn]);Object(y.useEffect)(function(){function kt(){var Mt=new a.default(function(Jt){var un=Object(N.a)(Jt),En;try{for(un.s();!(En=un.n()).done;){var ln=En.value;(ln.target.offsetHeight>0||ln.target.offsetWidth>0)&&(nn(),z.setSize("100%","100%"),z.refresh())}}catch(Dn){un.e(Dn)}finally{un.f()}});return Mt.observe(Yt.current.parentElement),Mt}if(z){var Gt=kt();return function(){Gt.unobserve(Yt.current.parentElement)}}},[z,nn]),Object(y.useEffect)(function(){if(z){for(var kt=[],Gt=function(){var ln=Jt[Mt];un=Object(G.a)(ln,2);var Dn=un[0],$n=un[1],en=Object(W.a)({},Dn,function(){xr($n)});kt.push(en),z.addKeyMap(en)},Mt=0,Jt=Object.entries(ce);Mt<Jt.length;Mt++){var un;Gt()}return wn.current=setInterval(function(){Xt.current&&Mn()},4e3),function(){clearInterval(wn.current);var En=Object(N.a)(kt),ln;try{for(En.s();!(ln=En.n()).done;){var Dn=ln.value;z.removeKeyMap(Dn)}}catch($n){En.e($n)}finally{En.f()}}}},[z]),Object(y.useEffect)(function(){qt!==kn&&Tn(qt)},[qt]),Object(ut.a)(function(){if(!St&&Zt>0){var kt=new Date().getTime(),Gt=window.sessionStorage.getItem(_t);kt>=Zt+Xe&&(!Gt||Gt!==qe)&&(window.sessionStorage.setItem(_t,qe),nr(!0))}},Xe),Object(y.useEffect)(function(){Ut(Nt)},[z,Nt]),Object(y.useEffect)(function(){z&&(Ct&&z.focus())},[z,Ct]),Object(y.useEffect)(function(){if(Pt&&z){var kt=z.getScrollerElement();function Gt(Mt){var Jt=Mt.target;if(rr.current){var un=Jt.scrollTop/Jt.scrollHeight;rr.current.scrollTop=rr.current.scrollHeight*un}}return kt.addEventListener("scroll",Gt),function(){kt.removeEventListener("scroll",Gt)}}},[z,Pt]),Object(y.useEffect)(function(){if(z&&rn){function kt(Gt,Mt){rn(Gt,Mt)}return z.on("beforeChange",kt),function(){z.off("beforeChange",kt)}}},[z,rn]),Object(y.useEffect)(function(){if(z&&Wt){function kt(){Wt(z.getValue())}return z.on("blur",kt),function(){z.off("blur",kt)}}},[z,Wt]),Object(y.useEffect)(function(){if(z){function kt(Gt){var Mt=Gt.getValue();ft(Mt),an(new Date().getTime()),Gt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),et&&et(Mt)}return z.on("change",kt),function(){z.off("change",kt)}}},[z,et]),Object(y.useEffect)(function(){z&&(Ke==null?(z.setValue(""),ft("")):Ke!==z.getValue()&&(z.setValue(Ke),ft(Ke),z.setCursor(z.lineCount(),0)))},[z,Ke]);var xr=Object(y.useCallback)(function(kt){var Gt=z.getCursor(),Mt=z.getSelection(),Jt=Mt.split(`
`);switch(kt){case"bold":return z.replaceSelection("**"+Mt+"**"),Mt===""&&z.setCursor(Gt.line,Gt.ch+2),z.focus();case"italic":return z.replaceSelection("*"+Mt+"*"),Mt===""&&z.setCursor(Gt.line,Gt.ch+1),z.focus();case"code":return z.replaceSelection("`"+Mt+"`"),Mt===""&&z.setCursor(Gt.line,Gt.ch+1),z.focus();case"inline-latex":return z.replaceSelection("`$$"+Mt+"$$`"),Mt===""&&z.setCursor(Gt.line,Gt.ch+3),z.focus();case"latex":return z.replaceSelection("```latex\n"+Mt+"\n```"),z.setCursor(Gt.line+1,Mt.length+1),z.focus();case"line-break":return z.replaceSelection(`<br/>
`),z.focus();case"list-ul":return Mt===""?z.replaceSelection("- "+Mt):z.replaceSelection(Jt.map(function(un){return un===""?"":"- ".concat(un)}).join(`
`)),z.focus();case"list-ol":return Mt===""?z.replaceSelection("1. "+Mt):z.replaceSelection(Jt.map(function(un,En){return un===""?"":"".concat(En+1,". ").concat(un)}).join(`
`)),z.focus();case"add-null-ch":return Mt===""&&z.setCursor(Gt.line,Gt.ch+1),z.replaceSelection(je),z.focus();case"inster-template-1":return Mt===""&&z.setCursor(Gt.line,Gt.ch),z.replaceSelection(Fe),z.focus();case"eraser":return z.setValue(""),z.focus();case"trigger-watch":return Ut(!Pt),z.focus();case"trigger-full-screen":return Tn(!kn),z.focus();case ke:Bt(ke);return;case Ge:Bt(Ge);return;case Le:Bt(Le);return;case Ve:Bt(Ve);return;default:throw new Error}},[z,Pt,kn]),Qn=Object(y.useCallback)(function(kt){Bt("");switch(Kt){case ke:var Gt=kt.title,Mt=kt.link;return z.replaceSelection("[".concat(Gt,"](").concat(Mt,")")),z.focus();case Ge:var Jt=kt.language,un=kt.content;return z.replaceSelection(["```"+Jt,un,"```"].join(`
`)),z.focus();case Le:var En=kt.src,ln=kt.alt;return ln?z.replaceSelection("![ ".concat(ln," ]( ").concat(En,' "').concat(ln,'" )')):z.replaceSelection("![,](".concat(En,")")),z.focus();case Ve:for(var Dn=kt.row,$n=kt.col,en=kt.align,vr=`
`,gn=0;gn<Dn;gn++){for(var Kn=[],Gn=[],hr=0;hr<$n;hr++)gn===1&&Gn.push(rt[en]),Kn.push(" ");gn===1&&(vr+="| ".concat(Gn.join(" | "),` |
`)),vr+="| ".concat(Kn.join($n===1?"":" | "),` |
`)}return z.replaceSelection(vr+`
`),z.focus();default:throw new Error}},[z,Kt]),Dr=Object(y.useMemo)(function(){switch(Kt){case ke:return g.a.createElement(ne,{callback:Qn,onCancel:wr});case Ge:return g.a.createElement(fe.b,{callback:Qn,onCancel:wr});case Le:return g.a.createElement(re,{callback:Qn,onCancel:wr});case Ve:return g.a.createElement(Be,{callback:Qn,onCancel:wr});default:return null}},[Kt]);function wr(){Bt("")}Object(y.useEffect)(function(){if(on.current){var kt=on.current,Gt=!1,Mt=0;function Jt(ln){Gt=!0,Mt=ln.pageY}function un(){Gt=!1}function En(ln){if(Gt){var Dn=ln.pageY-Mt;Dn<0&&(Dn=0),Dn>300&&(Dn=300);var $n=bt+Dn+"px";Cn($n)}}return kt.addEventListener("mousedown",Jt),document.addEventListener("mousemove",En),document.addEventListener("mouseup",un),function(){kt.removeEventListener("mousedown",Jt),document.removeEventListener("mousemove",En),document.removeEventListener("mouseup",un)}}},[z,on]),Object(y.useEffect)(function(){Cn(bt)},[bt]);var Tr=_e(nt),Mr=_e(Un),gr={width:Tr,height:Mr},Nr=Object(y.useMemo)(function(){if(Zt){var kt=new Date(Zt),Gt=kt.getHours(),Mt=kt.getMinutes(),Jt=kt.getSeconds();return Gt=Gt<10?"0"+Gt:Gt,Mt=Mt<10?"0"+Mt:Mt,Jt=Jt<10?"0"+Jt:Jt,"".concat(Gt,":").concat(Mt,":").concat(Jt)}return 0},[Zt]);function Fr(){window.sessionStorage.removeItem(_t),nr(!1),an(0)}function cr(){nr(!1),an(0),z.setValue(window.sessionStorage.getItem(_t))}function Yr(kt,Gt){var Mt=z.getValue();Mt=Mt.replace(kt,Gt),ft(Mt),z==null||z.setValue(Mt)}return g.a.createElement(y.Fragment,null,g.a.createElement("div",{className:"markdown-editor-wrapper",ref:sn},g.a.createElement("div",{className:"markdown-editor-container ".concat(Qe," ").concat(Pt?"on-preview":""," ").concat(wt?"mini":""," ").concat(kn?"full-screen":""),style:gr},g.a.createElement(x,{insertTemp:At,watch:Pt,fullScreen:kn,showNullButton:mt,onActionCallback:xr,hidetoolBar:Vt,uuid:dn.current,setOpenPhones:function(){Xt.current=!0}}),g.a.createElement("div",{className:"markdown-editor-body"},g.a.createElement("div",{className:"codemirror-container"},g.a.createElement("textarea",{ref:Yt,placeholder:_n})),Pt?g.a.createElement("div",{ref:rr,className:"preview-container"},gt==="stex"&&g.a.createElement(L,{value:qe}),gt!=="stex"&&g.a.createElement(C.a,{edit:!0,value:qe,replaces:Yr})):null))),Je?g.a.createElement("a",{ref:on,className:"editor-resize"}):null,g.a.createElement(U.a,null,be[Kt]?g.a.createElement(V.a,{centered:!0,title:be[Kt],visible:!0,onCancel:wr,footer:null,className:"markdown-popup-form"},Dr):null))}},"P/tu":function(at,Ee,H){"use strict";var ee=H("ozfa"),V=H("MJZm"),N=H("0Owb"),$=H("9og8"),j=H("tJVT"),P=H("PpiC"),G=H("WmNS"),W=H.n(G),n=H("q1tI"),D=H.n(n),y=H("WCUW"),g=H("spXi"),p=H.n(g),l=function(f){var u=f.value,d=f.onChange,i=f.defaultValue,o=f.disabled,O=Object(P.a)(f,["value","onChange","defaultValue","disabled"]),w=Object(n.useState)([]),C=Object(j.a)(w,2),L=C[0],A=C[1],_=Object(n.useState)("1"),T=Object(j.a)(_,2),v=T[0],c=T[1];Object(n.useEffect)(function(){E()},[]);var E=function(){var U=Object($.a)(W.a.mark(function F(){var S,M;return W.a.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,Object(y.A)({});case 2:S=b.sent,S!=null&&S.data&&(M=[{title:D.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:p.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:D.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:h(S.data||[])}],A(M),c("2"));case 4:case"end":return b.stop()}},F)}));return function(){return U.apply(this,arguments)}}(),h=function(F){function S(M){var I=M.children,b=Array.isArray(I)&&I.length>0,K=M==null?void 0:M.group_id;return{title:D.a.createElement("div",{title:M==null?void 0:M.name,className:p.a.name},M==null?void 0:M.name),value:K,key:K,icon:D.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:b?I==null?void 0:I.map(function(Q){return S(Q)}):[]}}return F==null?void 0:F.map(function(M){return S(M)})},x=i?{defaultExpandedKeys:[0]}:{selectedKeys:u,defaultExpandedKeys:u};return D.a.createElement("div",{className:p.a.customTree},D.a.createElement(V.a,Object(N.a)({key:v},x,{showIcon:!0,treeData:L,onSelect:d,disabled:o},O)))};Ee.a=l},RxwV:function(at,Ee,H){"use strict";var ee=H("q1tI"),V=H("uciX"),N=H("2W6z"),$=H.n(N),j=H("4IlW"),P=H("uK0f"),G=H.n(P);function W(se,me){if(se===me)return!0;if(!se||!me)return!1;var re=se.length;if(me.length!==re)return!1;for(var le=0;le<re;le++)if(se[le]!==me[le])return!1;return!0}function n(se){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?n=function(re){return typeof re}:n=function(re){return re&&typeof Symbol=="function"&&re.constructor===Symbol&&re!==Symbol.prototype?"symbol":typeof re},n(se)}function D(se,me){if(!(se instanceof me))throw new TypeError("Cannot call a class as a function")}function y(se,me){for(var re=0;re<me.length;re++){var le=me[re];le.enumerable=le.enumerable||!1,le.configurable=!0,"value"in le&&(le.writable=!0),Object.defineProperty(se,le.key,le)}}function g(se,me,re){return me&&y(se.prototype,me),re&&y(se,re),se}function p(se,me){if(typeof me!="function"&&me!==null)throw new TypeError("Super expression must either be null or a function");se.prototype=Object.create(me&&me.prototype,{constructor:{value:se,writable:!0,configurable:!0}}),me&&l(se,me)}function l(se,me){return l=Object.setPrototypeOf||function(le,Z){return le.__proto__=Z,le},l(se,me)}function a(se){var me=d();return function(){var re=i(se),le;if(me){var Z=i(this).constructor;le=Reflect.construct(re,arguments,Z)}else le=re.apply(this,arguments);return f(this,le)}}function f(se,me){return me&&(n(me)==="object"||typeof me=="function")?me:u(se)}function u(se){if(se===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return se}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(se){return!1}}function i(se){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(re){return re.__proto__||Object.getPrototypeOf(re)},i(se)}var o=function(){var se=function(me){p(le,me);var re=a(le);function le(){var Z;return D(this,le),Z=re.apply(this,arguments),Z.menuItems={},Z.saveMenuItem=function(ae){return function(oe){Z.menuItems[ae]=oe}},Z}return g(le,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(ae){!ae.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(ae){var oe=this.props,ge=oe.fieldNames,Re=oe.defaultFieldNames;return ge[ae]||Re[ae]}},{key:"getOption",value:function(ae,oe){var ge=this.props,Re=ge.prefixCls,Te=ge.expandTrigger,Me=ge.expandIcon,Be=ge.loadingIcon,pe=this.props.onSelect.bind(this,ae,oe),Ce=this.props.onItemDoubleClick.bind(this,ae,oe),ke={onClick:pe,onDoubleClick:Ce},Le="".concat(Re,"-menu-item"),Ge=null,Ve=ae[this.getFieldName("children")]&&ae[this.getFieldName("children")].length>0;(Ve||ae.isLeaf===!1)&&(Le+=" ".concat(Re,"-menu-item-expand"),ae.loading||(Ge=ee.createElement("span",{className:"".concat(Re,"-menu-item-expand-icon")},Me))),Te==="hover"&&(Ve||ae.isLeaf===!1)&&(ke={onMouseEnter:this.delayOnSelect.bind(this,pe),onMouseLeave:this.delayOnSelect.bind(this),onClick:pe}),this.isActiveOption(ae,oe)&&(Le+=" ".concat(Re,"-menu-item-active"),ke.ref=this.saveMenuItem(oe)),ae.disabled&&(Le+=" ".concat(Re,"-menu-item-disabled"));var tt=null;ae.loading&&(Le+=" ".concat(Re,"-menu-item-loading"),tt=Be||null);var rt="";return"title"in ae?rt=ae.title:typeof ae[this.getFieldName("label")]=="string"&&(rt=ae[this.getFieldName("label")]),ee.createElement("li",Object.assign({key:ae[this.getFieldName("value")],className:Le,title:rt},ke,{role:"menuitem",onMouseDown:function(lt){return lt.preventDefault()}}),ae[this.getFieldName("label")],Ge,tt)}},{key:"getActiveOptions",value:function(ae){var oe=this,ge=this.props.options,Re=ae||this.props.activeValue;return G()(ge,function(Te,Me){return Te[oe.getFieldName("value")]===Re[Me]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var ae=this,oe=this.props.options,ge=this.getActiveOptions().map(function(Re){return Re[ae.getFieldName("children")]}).filter(function(Re){return!!Re});return ge.unshift(oe),ge}},{key:"delayOnSelect",value:function(ae){for(var oe=this,ge=arguments.length,Re=new Array(ge>1?ge-1:0),Te=1;Te<ge;Te++)Re[Te-1]=arguments[Te];this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),typeof ae=="function"&&(this.delayTimer=window.setTimeout(function(){ae(Re),oe.delayTimer=null},150))}},{key:"scrollActiveItemToView",value:function(){for(var ae=this.getShowOptions().length,oe=0;oe<ae;oe++){var ge=this.menuItems[oe];ge&&ge.parentElement&&(ge.parentElement.scrollTop=ge.offsetTop)}}},{key:"isActiveOption",value:function(ae,oe){var ge=this.props.activeValue,Re=ge===void 0?[]:ge;return Re[oe]===ae[this.getFieldName("value")]}},{key:"render",value:function(){var ae=this,oe=this.props,ge=oe.prefixCls,Re=oe.dropdownMenuColumnStyle;return ee.createElement("div",null,this.getShowOptions().map(function(Te,Me){return ee.createElement("ul",{className:"".concat(ge,"-menu"),key:Me,style:Re},Te.map(function(Be){return ae.getOption(Be,Me)}))}))}}]),le}(ee.Component);return se.defaultProps={options:[],value:[],activeValue:[],onSelect:function(){},prefixCls:"rc-cascader-menus",visible:!1,expandTrigger:"click"},se}(),O=o,w={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}}},C=w;function L(se){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?L=function(re){return typeof re}:L=function(re){return re&&typeof Symbol=="function"&&re.constructor===Symbol&&re!==Symbol.prototype?"symbol":typeof re},L(se)}function A(se,me){if(se==null)return{};var re=_(se,me),le,Z;if(Object.getOwnPropertySymbols){var ae=Object.getOwnPropertySymbols(se);for(Z=0;Z<ae.length;Z++){if(le=ae[Z],me.indexOf(le)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(se,le))continue;re[le]=se[le]}}return re}function _(se,me){if(se==null)return{};var re={},le=Object.keys(se),Z,ae;for(ae=0;ae<le.length;ae++){if(Z=le[ae],me.indexOf(Z)>=0)continue;re[Z]=se[Z]}return re}function T(se){return h(se)||E(se)||c(se)||v()}function v(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(se,me){if(!se)return;if(typeof se=="string")return x(se,me);var re=Object.prototype.toString.call(se).slice(8,-1);if(re==="Object"&&se.constructor&&(re=se.constructor.name),re==="Map"||re==="Set")return Array.from(se);if(re==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(re))return x(se,me)}function E(se){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(se))return Array.from(se)}function h(se){if(Array.isArray(se))return x(se)}function x(se,me){(me==null||me>se.length)&&(me=se.length);for(var re=0,le=new Array(me);re<me;re++)le[re]=se[re];return le}function U(se,me){if(!(se instanceof me))throw new TypeError("Cannot call a class as a function")}function F(se,me){for(var re=0;re<me.length;re++){var le=me[re];le.enumerable=le.enumerable||!1,le.configurable=!0,"value"in le&&(le.writable=!0),Object.defineProperty(se,le.key,le)}}function S(se,me,re){return me&&F(se.prototype,me),re&&F(se,re),se}function M(se,me){if(typeof me!="function"&&me!==null)throw new TypeError("Super expression must either be null or a function");se.prototype=Object.create(me&&me.prototype,{constructor:{value:se,writable:!0,configurable:!0}}),me&&I(se,me)}function I(se,me){return I=Object.setPrototypeOf||function(le,Z){return le.__proto__=Z,le},I(se,me)}function b(se){var me=ne();return function(){var re=fe(se),le;if(me){var Z=fe(this).constructor;le=Reflect.construct(re,arguments,Z)}else le=re.apply(this,arguments);return K(this,le)}}function K(se,me){return me&&(L(me)==="object"||typeof me=="function")?me:Q(se)}function Q(se){if(se===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return se}function ne(){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(se){return!1}}function fe(se){return fe=Object.setPrototypeOf?Object.getPrototypeOf:function(re){return re.__proto__||Object.getPrototypeOf(re)},fe(se)}var we=function(){var se=function(me){M(le,me);var re=b(le);function le(Z){var ae;U(this,le),ae=re.call(this,Z),ae.setPopupVisible=function(ge){var Re=ae.state.value;"popupVisible"in ae.props||ae.setState({popupVisible:ge}),ge&&!ae.state.popupVisible&&ae.setState({activeValue:Re}),ae.props.onPopupVisibleChange(ge)},ae.handleChange=function(ge,Re,Te){var Me=Re.visible;(Te.type!=="keydown"||Te.keyCode===j.a.ENTER)&&(ae.props.onChange(ge.map(function(Be){return Be[ae.getFieldName("value")]}),ge),ae.setPopupVisible(Me))},ae.handlePopupVisibleChange=function(ge){ae.setPopupVisible(ge)},ae.handleMenuSelect=function(ge,Re,Te){var Me=ae.trigger.getRootDomNode();Me&&Me.focus&&Me.focus();var Be=ae.props,pe=Be.changeOnSelect,Ce=Be.loadData,ke=Be.expandTrigger;if(!ge||ge.disabled)return;var Le=ae.state.activeValue;Le=Le.slice(0,Re+1),Le[Re]=ge[ae.getFieldName("value")];var Ge=ae.getActiveOptions(Le);if(ge.isLeaf===!1&&!ge[ae.getFieldName("children")]&&Ce){pe&&ae.handleChange(Ge,{visible:!0},Te),ae.setState({activeValue:Le}),Ce(Ge);return}var Ve={};!ge[ae.getFieldName("children")]||!ge[ae.getFieldName("children")].length?(ae.handleChange(Ge,{visible:!1},Te),Ve.value=Le):pe&&(Te.type==="click"||Te.type==="keydown")&&(ke==="hover"?ae.handleChange(Ge,{visible:!1},Te):ae.handleChange(Ge,{visible:!0},Te),Ve.value=Le),Ve.activeValue=Le,("value"in ae.props||Te.type==="keydown"&&Te.keyCode!==j.a.ENTER)&&delete Ve.value,ae.setState(Ve)},ae.handleItemDoubleClick=function(){var ge=ae.props.changeOnSelect;ge&&ae.setPopupVisible(!1)},ae.handleKeyDown=function(ge){var Re=ae.props.children;if(Re&&Re.props.onKeyDown){Re.props.onKeyDown(ge);return}var Te=T(ae.state.activeValue),Me=Te.length-1<0?0:Te.length-1,Be=ae.getCurrentLevelOptions(),pe=Be.map(function(Ge){return Ge[ae.getFieldName("value")]}).indexOf(Te[Me]);if(ge.keyCode!==j.a.DOWN&&ge.keyCode!==j.a.UP&&ge.keyCode!==j.a.LEFT&&ge.keyCode!==j.a.RIGHT&&ge.keyCode!==j.a.ENTER&&ge.keyCode!==j.a.SPACE&&ge.keyCode!==j.a.BACKSPACE&&ge.keyCode!==j.a.ESC&&ge.keyCode!==j.a.TAB)return;if(!ae.state.popupVisible&&ge.keyCode!==j.a.BACKSPACE&&ge.keyCode!==j.a.LEFT&&ge.keyCode!==j.a.RIGHT&&ge.keyCode!==j.a.ESC&&ge.keyCode!==j.a.TAB){ae.setPopupVisible(!0);return}if(ge.keyCode===j.a.DOWN||ge.keyCode===j.a.UP){ge.preventDefault();var Ce=pe;Ce!==-1?ge.keyCode===j.a.DOWN?(Ce+=1,Ce=Ce>=Be.length?0:Ce):(Ce-=1,Ce=Ce<0?Be.length-1:Ce):Ce=0,Te[Me]=Be[Ce][ae.getFieldName("value")]}else if(ge.keyCode===j.a.LEFT||ge.keyCode===j.a.BACKSPACE)ge.preventDefault(),Te.splice(Te.length-1,1);else if(ge.keyCode===j.a.RIGHT)ge.preventDefault(),Be[pe]&&Be[pe][ae.getFieldName("children")]&&Te.push(Be[pe][ae.getFieldName("children")][0][ae.getFieldName("value")]);else if(ge.keyCode===j.a.ESC||ge.keyCode===j.a.TAB){ae.setPopupVisible(!1);return}(!Te||Te.length===0)&&ae.setPopupVisible(!1);var ke=ae.getActiveOptions(Te),Le=ke[ke.length-1];ae.handleMenuSelect(Le,ke.length-1,ge),ae.props.onKeyDown&&ae.props.onKeyDown(ge)},ae.saveTrigger=function(ge){ae.trigger=ge};var oe=[];return"value"in Z?oe=Z.value||[]:"defaultValue"in Z&&(oe=Z.defaultValue||[]),$()(!("filedNames"in Z),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),ae.state={popupVisible:Z.popupVisible,activeValue:oe,value:oe,prevProps:Z},ae.defaultFieldNames={label:"label",value:"value",children:"children"},ae}return S(le,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(ae){var oe=this.defaultFieldNames,ge=this.props,Re=ge.fieldNames,Te=ge.filedNames;return"filedNames"in this.props?Te[ae]||oe[ae]:Re[ae]||oe[ae]}},{key:"getFieldNames",value:function(){var ae=this.props,oe=ae.fieldNames,ge=ae.filedNames;return"filedNames"in this.props?ge:oe}},{key:"getCurrentLevelOptions",value:function(){var ae=this,oe=this.props.options,ge=oe===void 0?[]:oe,Re=this.state.activeValue,Te=Re===void 0?[]:Re,Me=G()(ge,function(Be,pe){return Be[ae.getFieldName("value")]===Te[pe]},{childrenKeyName:this.getFieldName("children")});return Me[Me.length-2]?Me[Me.length-2][this.getFieldName("children")]:T(ge).filter(function(Be){return!Be.disabled})}},{key:"getActiveOptions",value:function(ae){var oe=this;return G()(this.props.options||[],function(ge,Re){return ge[oe.getFieldName("value")]===ae[Re]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var ae=this.props,oe=ae.prefixCls,ge=ae.transitionName,Re=ae.popupClassName,Te=ae.options,Me=Te===void 0?[]:Te,Be=ae.disabled,pe=ae.builtinPlacements,Ce=ae.popupPlacement,ke=ae.children,Le=ae.dropdownRender,Ge=A(ae,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),Ve=ee.createElement("div",null),tt="";Me&&Me.length>0?Ve=ee.createElement(O,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):tt=" ".concat(oe,"-menus-empty");var rt=Ve;return Le&&(rt=Le(Ve)),ee.createElement(V.a,Object.assign({ref:this.saveTrigger},Ge,{popupPlacement:Ce,builtinPlacements:pe,popupTransitionName:ge,action:Be?[]:["click"],popupVisible:Be?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(oe,"-menus"),popupClassName:Re+tt,popup:rt}),ee.cloneElement(ke,{onKeyDown:this.handleKeyDown,tabIndex:Be?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(ae,oe){var ge=oe.prevProps,Re=ge===void 0?{}:ge,Te={prevProps:ae};return"value"in ae&&!W(Re.value,ae.value)&&(Te.value=ae.value||[],"loadData"in ae||(Te.activeValue=ae.value||[])),"popupVisible"in ae&&(Te.popupVisible=ae.popupVisible),Te}}]),le}(ee.Component);return se.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:C,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},se}(),Se=we,he=Ee.a=Se},"SA+Z":function(at,Ee,H){var ee=H("wTVA"),V=H("EbDI"),N=H("ZhPi"),$=H("wkBT");function j(P){return ee(P)||V(P)||N(P)||$()}at.exports=j,at.exports.__esModule=!0,at.exports.default=at.exports},SJMd:function(at,Ee){/**
* @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 H,ee,V,N=!1,$,j;window.PR_SHOULD_USE_CONTINUATION=!0;var P,G;(function(){var W=window,n=["break,continue,do,else,for,if,return,while"],D=[n,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],y=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],g=[y,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],p=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],l=[y,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],a="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",f=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],u="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",d=[n,"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"],i=[n,"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"],o=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],O=[g,l,p,f,u,d,i,o],w=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,C="str",L="kwd",A="com",_="typ",T="lit",v="pun",c="pln",E="tag",h="dec",x="src",U="atn",F="atv",S="nocode",M="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(Te){for(var Me=0,Be=!1,pe=!1,Ce=0,ke=Te.length;Ce<ke;++Ce){var Le=Te[Ce];if(Le.ignoreCase)pe=!0;else if(/[a-z]/i.test(Le.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Be=!0,pe=!1;break}}var Ge={b:8,t:9,n:10,v:11,f:12,r:13};function Ve(Ne){var Pe=Ne.charCodeAt(0);if(Pe!==92)return Pe;var ze=Ne.charAt(1);return Pe=Ge[ze],Pe||("0"<=ze&&ze<="7"?parseInt(Ne.substring(1),8):ze==="u"||ze==="x"?parseInt(Ne.substring(2),16):Ne.charCodeAt(1))}function tt(Ne){if(Ne<32)return(Ne<16?"\\x0":"\\x")+Ne.toString(16);var Pe=String.fromCharCode(Ne);return Pe==="\\"||Pe==="-"||Pe==="]"||Pe==="^"?"\\"+Pe:Pe}function rt(Ne){var Pe=Ne.substring(1,Ne.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")),ze=[],Xe=Pe[0]==="^",je=["["];Xe&&je.push("^");for(var Fe=Xe?1:0,_e=Pe.length;Fe<_e;++Fe){var ye=Pe[Fe];if(/\\[bdsw]/i.test(ye))je.push(ye);else{var ve=Ve(ye),ue;Fe+2<_e&&Pe[Fe+1]==="-"?(ue=Ve(Pe[Fe+2]),Fe+=2):ue=ve,ze.push([ve,ue]),ue<65||ve>122||(ue<65||ve>90||ze.push([Math.max(65,ve)|32,Math.min(ue,90)|32]),ue<97||ve>122||ze.push([Math.max(97,ve)&~32,Math.min(ue,122)&~32]))}}ze.sort(function(Oe,Ue){return Oe[0]-Ue[0]||Ue[1]-Oe[1]});for(var ce=[],be=[],Fe=0;Fe<ze.length;++Fe){var xe=ze[Fe];xe[0]<=be[1]+1?be[1]=Math.max(be[1],xe[1]):ce.push(be=xe)}for(var Fe=0;Fe<ce.length;++Fe){var xe=ce[Fe];je.push(tt(xe[0])),xe[1]>xe[0]&&(xe[1]+1>xe[0]&&je.push("-"),je.push(tt(xe[1])))}return je.push("]"),je.join("")}function ut(Ne){for(var Pe=Ne.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")),ze=Pe.length,Xe=[],je=0,Fe=0;je<ze;++je){var _e=Pe[je];if(_e==="(")++Fe;else if(_e.charAt(0)==="\\"){var ye=+_e.substring(1);ye&&(ye<=Fe?Xe[ye]=-1:Pe[je]=tt(ye))}}for(var je=1;je<Xe.length;++je)Xe[je]===-1&&(Xe[je]=++Me);for(var je=0,Fe=0;je<ze;++je){var _e=Pe[je];if(_e==="(")++Fe,Xe[Fe]||(Pe[je]="(?:");else if(_e.charAt(0)==="\\"){var ye=+_e.substring(1);ye&&ye<=Fe&&(Pe[je]="\\"+Xe[ye])}}for(var je=0;je<ze;++je)Pe[je]==="^"&&Pe[je+1]!=="^"&&(Pe[je]="");if(Ne.ignoreCase&&Be)for(var je=0;je<ze;++je){var _e=Pe[je],ve=_e.charAt(0);_e.length>=2&&ve==="["?Pe[je]=rt(_e):ve!=="\\"&&(Pe[je]=_e.replace(/[a-zA-Z]/g,function(be){var xe=be.charCodeAt(0);return"["+String.fromCharCode(xe&~32,xe|32)+"]"}))}return Pe.join("")}for(var lt=[],Ce=0,ke=Te.length;Ce<ke;++Ce){var Le=Te[Ce];if(Le.global||Le.multiline)throw new Error(""+Le);lt.push("(?:"+ut(Le)+")")}return new RegExp(lt.join("|"),pe?"gi":"g")}function b(Te,Me){var Be=/(?:^|\s)nocode(?:\s|$)/,pe=[],Ce=0,ke=[],Le=0;function Ge(Ve){var tt=Ve.nodeType;if(tt==1){if(Be.test(Ve.className))return;for(var rt=Ve.firstChild;rt;rt=rt.nextSibling)Ge(rt);var ut=Ve.nodeName.toLowerCase();(ut==="br"||ut==="li")&&(pe[Le]=`
`,ke[Le<<1]=Ce++,ke[Le++<<1|1]=Ve)}else if(tt==3||tt==4){var lt=Ve.nodeValue;lt.length&&(Me?lt=lt.replace(/\r\n?/g,`
`):lt=lt.replace(/[ \t\r\n]+/g," "),pe[Le]=lt,ke[Le<<1]=Ce,Ce+=lt.length,ke[Le++<<1|1]=Ve)}}return Ge(Te),{sourceCode:pe.join("").replace(/\n$/,""),spans:ke}}function K(Te,Me,Be,pe,Ce){if(!Be)return;var ke={sourceNode:Te,pre:1,langExtension:null,numberLines:null,sourceCode:Be,spans:null,basePos:Me,decorations:null};pe(ke),Ce.push.apply(Ce,ke.decorations)}var Q=/\S/;function ne(Te){for(var Me=void 0,Be=Te.firstChild;Be;Be=Be.nextSibling){var pe=Be.nodeType;Me=pe===1?Me?Te:Be:pe===3&&Q.test(Be.nodeValue)?Te:Me}return Me===Te?void 0:Me}function fe(Te,Me){var Be={},pe;(function(){for(var Le=Te.concat(Me),Ge=[],Ve={},tt=0,rt=Le.length;tt<rt;++tt){var ut=Le[tt],lt=ut[3];if(lt)for(var Ne=lt.length;--Ne>=0;)Be[lt.charAt(Ne)]=ut;var Pe=ut[1],ze=""+Pe;Ve.hasOwnProperty(ze)||(Ge.push(Pe),Ve[ze]=null)}Ge.push(/[\0-\uffff]/),pe=I(Ge)})();var Ce=Me.length,ke=function(Le){for(var Ge=Le.sourceCode,Ve=Le.basePos,tt=Le.sourceNode,rt=[Ve,c],ut=0,lt=Ge.match(pe)||[],Ne={},Pe=0,ze=lt.length;Pe<ze;++Pe){var Xe=lt[Pe],je=Ne[Xe],Fe=void 0,_e;if(typeof je=="string")_e=!1;else{var ye=Be[Xe.charAt(0)];if(ye)Fe=Xe.match(ye[1]),je=ye[0];else{for(var ve=0;ve<Ce;++ve)if(ye=Me[ve],Fe=Xe.match(ye[1]),Fe){je=ye[0];break}Fe||(je=c)}_e=je.length>=5&&je.substring(0,5)==="lang-",_e&&!(Fe&&typeof Fe[1]=="string")&&(_e=!1,je=x),_e||(Ne[Xe]=je)}var ue=ut;if(ut+=Xe.length,!_e)rt.push(Ve+ue,je);else{var ce=Fe[1],be=Xe.indexOf(ce),xe=be+ce.length;Fe[2]&&(xe=Xe.length-Fe[2].length,be=xe-ce.length);var Oe=je.substring(5);K(tt,Ve+ue,Xe.substring(0,be),ke,rt),K(tt,Ve+ue+be,ce,le(Oe,ce),rt),K(tt,Ve+ue+xe,Xe.substring(xe),ke,rt)}}Le.decorations=rt};return ke}function we(Te){var Me=[],Be=[];Te.tripleQuotedStrings?Me.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Te.multiLineStrings?Me.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Me.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Te.verbatimStrings&&Be.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var pe=Te.hashComments;pe&&(Te.cStyleComments?(pe>1?Me.push([A,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Me.push([A,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Be.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Me.push([A,/^#[^\r\n]*/,null,"#"])),Te.cStyleComments&&(Be.push([A,/^\/\/[^\r\n]*/,null]),Be.push([A,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ce=Te.regexLiterals;if(Ce){var ke=Ce>1?"":`
\r`,Le=ke?".":"[\\S\\s]",Ge="/(?=[^/*"+ke+"])(?:[^/\\x5B\\x5C"+ke+"]|\\x5C"+Le+"|\\x5B(?:[^\\x5C\\x5D"+ke+"]|\\x5C"+Le+")*(?:\\x5D|$))+/";Be.push(["lang-regex",RegExp("^"+M+"("+Ge+")")])}var Ve=Te.types;Ve&&Be.push([_,Ve]);var tt=(""+Te.keywords).replace(/^ | $/g,"");tt.length&&Be.push([L,new RegExp("^(?:"+tt.replace(/[\s,]+/g,"|")+")\\b"),null]),Me.push([c,/^\s+/,null,` \r
\xA0`]);var rt="^.[^\\s\\w.$@'\"`/\\\\]*";return Te.regexLiterals&&(rt+="(?!s*/)"),Be.push([T,/^@[a-z_$][a-z_$@0-9]*/i,null],[_,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[T,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[v,new RegExp(rt),null]),fe(Me,Be)}var Se=we({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function he(Te,Me,Be){for(var pe=/(?:^|\s)nocode(?:\s|$)/,Ce=/\r\n?|\n/,ke=Te.ownerDocument,Le=ke.createElement("li");Te.firstChild;)Le.appendChild(Te.firstChild);var Ge=[Le];function Ve(Pe){var ze=Pe.nodeType;if(ze==1&&!pe.test(Pe.className))if(Pe.nodeName==="br")tt(Pe),Pe.parentNode&&Pe.parentNode.removeChild(Pe);else for(var Xe=Pe.firstChild;Xe;Xe=Xe.nextSibling)Ve(Xe);else if((ze==3||ze==4)&&Be){var je=Pe.nodeValue,Fe=je.match(Ce);if(Fe){var _e=je.substring(0,Fe.index);Pe.nodeValue=_e;var ye=je.substring(Fe.index+Fe[0].length);if(ye){var ve=Pe.parentNode;ve.insertBefore(ke.createTextNode(ye),Pe.nextSibling)}tt(Pe),_e||Pe.parentNode.removeChild(Pe)}}}function tt(Pe){for(;!Pe.nextSibling;)if(Pe=Pe.parentNode,!Pe)return;function ze(Fe,_e){var ye=_e?Fe.cloneNode(!1):Fe,ve=Fe.parentNode;if(ve){var ue=ze(ve,1),ce=Fe.nextSibling;ue.appendChild(ye);for(var be=ce;be;be=ce)ce=be.nextSibling,ue.appendChild(be)}return ye}for(var Xe=ze(Pe.nextSibling,0),je;(je=Xe.parentNode)&&je.nodeType===1;)Xe=je;Ge.push(Xe)}for(var rt=0;rt<Ge.length;++rt)Ve(Ge[rt]);Me===(Me|0)&&Ge[0].setAttribute("value",Me);var ut=ke.createElement("ol");ut.className="linenums";for(var lt=Math.max(0,Me-1|0)||0,rt=0,Ne=Ge.length;rt<Ne;++rt)Le=Ge[rt],Le.className="L"+(rt+lt)%10,Le.firstChild||Le.appendChild(ke.createTextNode("\xA0")),ut.appendChild(Le);Te.appendChild(ut)}function se(Te){var Me=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Me=Me&&+Me[1]<=8;var Be=/\n/g,pe=Te.sourceCode,Ce=pe.length,ke=0,Le=Te.spans,Ge=Le.length,Ve=0,tt=Te.decorations,rt=tt.length,ut=0;tt[rt]=Ce;var lt,Ne;for(Ne=lt=0;Ne<rt;)tt[Ne]!==tt[Ne+2]?(tt[lt++]=tt[Ne++],tt[lt++]=tt[Ne++]):Ne+=2;for(rt=lt,Ne=lt=0;Ne<rt;){for(var Pe=tt[Ne],ze=tt[Ne+1],Xe=Ne+2;Xe+2<=rt&&tt[Xe+1]===ze;)Xe+=2;tt[lt++]=Pe,tt[lt++]=ze,Ne=Xe}rt=tt.length=lt;var je=Te.sourceNode,Fe="";je&&(Fe=je.style.display,je.style.display="none");try{for(var _e=null;Ve<Ge;){var ye=Le[Ve],ve=Le[Ve+2]||Ce,ue=tt[ut+2]||Ce,Xe=Math.min(ve,ue),ce=Le[Ve+1],be;if(ce.nodeType!==1&&(be=pe.substring(ke,Xe))){Me&&(be=be.replace(Be,"\r")),ce.nodeValue=be;var xe=ce.ownerDocument,Oe=xe.createElement("span");Oe.className=tt[ut+1];var Ue=ce.parentNode;Ue.replaceChild(Oe,ce),Oe.appendChild(ce),ke<ve&&(Le[Ve+1]=ce=xe.createTextNode(pe.substring(Xe,ve)),Ue.insertBefore(ce,Oe.nextSibling))}ke=Xe,ke>=ve&&(Ve+=2),ke>=ue&&(ut+=2)}}finally{je&&(je.style.display=Fe)}}var me={};function re(Te,Me){for(var Be=Me.length;--Be>=0;){var pe=Me[Be];me.hasOwnProperty(pe)?W.console&&console.warn("cannot override language handler %s",pe):me[pe]=Te}}function le(Te,Me){return Te&&me.hasOwnProperty(Te)||(Te=/^\s*</.test(Me)?"default-markup":"default-code"),me[Te]}re(Se,["default-code"]),re(fe([],[[c,/^[^<?]+/],[h,/^<!\w[^>]*(?:>|$)/],[A,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[v,/^(?:<[%?]|[%?]>)/],["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"]),re(fe([[c,/^[\s]+/,null,` \r
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[U,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[v,/^[=<>\/]+/],["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"]),re(fe([],[[F,/^[\s\S]+/]]),["uq.val"]),re(we({keywords:g,hashComments:!0,cStyleComments:!0,types:w}),["c","cc","cpp","cxx","cyc","m"]),re(we({keywords:"null,true,false"}),["json"]),re(we({keywords:l,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:w}),["cs"]),re(we({keywords:p,cStyleComments:!0}),["java"]),re(we({keywords:o,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),re(we({keywords:d,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),re(we({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),re(we({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),re(we({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),re(we({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),re(fe([],[[C,/^[\s\S]+/]]),["regex"]);function Z(Te){var Me=Te.langExtension;try{var Be=b(Te.sourceNode,Te.pre),pe=Be.sourceCode;Te.sourceCode=pe,Te.spans=Be.spans,Te.basePos=0,le(Me,pe)(Te),se(Te)}catch(Ce){W.console&&console.log(Ce&&Ce.stack||Ce)}}function ae(Te,Me,Be){var pe=Be||!1,Ce=Me||null,ke=document.createElement("div");ke.innerHTML="<pre>"+Te+"</pre>",ke=ke.firstChild,pe&&he(ke,pe,!0);var Le={langExtension:Ce,numberLines:pe,sourceNode:ke,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Z(Le),ke.innerHTML}function oe(Te,Me){var Be=Me||document.body,pe=Be.ownerDocument||document;function Ce(ye){return Be.getElementsByTagName(ye)}for(var ke=[Ce("pre"),Ce("code"),Ce("xmp")],Le=[],Ge=0;Ge<ke.length;++Ge)for(var Ve=0,tt=ke[Ge].length;Ve<tt;++Ve)Le.push(ke[Ge][Ve]);ke=null;var rt=Date;rt.now||(rt={now:function(){return+new Date}});var ut=0,lt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ne=/\bprettyprint\b/,Pe=/\bprettyprinted\b/,ze=/pre|xmp/i,Xe=/^code$/i,je=/^(?:pre|code|xmp)$/i,Fe={};function _e(){for(var ye=W.PR_SHOULD_USE_CONTINUATION?rt.now()+250:Infinity;ut<Le.length&&rt.now()<ye;ut++){for(var ve=Le[ut],ue=Fe,ce=ve;ce=ce.previousSibling;){var be=ce.nodeType,xe=(be===7||be===8)&&ce.nodeValue;if(xe?!/^\??prettify\b/.test(xe):be!==3||/\S/.test(ce.nodeValue))break;if(xe){ue={},xe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Nt,At,It){ue[At]=It});break}}var Oe=ve.className;if((ue!==Fe||Ne.test(Oe))&&!Pe.test(Oe)){for(var Ue=!1,Ke=ve.parentNode;Ke;Ke=Ke.parentNode){var et=Ke.tagName;if(je.test(et)&&Ke.className&&Ne.test(Ke.className)){Ue=!0;break}}if(!Ue){ve.className+=" prettyprinted";var it=ue.lang;if(!it){it=Oe.match(lt);var nt;!it&&(nt=ne(ve))&&Xe.test(nt.tagName)&&(it=nt.className.match(lt)),it&&(it=it[1])}var yt;if(ze.test(ve.tagName))yt=1;else{var bt=ve.currentStyle,dt=pe.defaultView,wt=bt?bt.whiteSpace:dt&&dt.getComputedStyle?dt.getComputedStyle(ve,null).getPropertyValue("white-space"):0;yt=wt&&wt.substring(0,3)==="pre"}var Tt=ue.linenums;(Tt=Tt==="true"||+Tt)||(Tt=Oe.match(/\blinenums\b(?::(\d+))?/),Tt=Tt?Tt[1]&&Tt[1].length?+Tt[1]:!0:!1),Tt&&he(ve,Tt,yt);var Ct={langExtension:it,sourceNode:ve,numberLines:Tt,pre:yt,sourceCode:null,basePos:null,spans:null,decorations:null};Z(Ct)}}}ut<Le.length?W.setTimeout(_e,250):typeof Te=="function"&&Te()}_e()}var ge=W.PR={createSimpleLexer:fe,registerLangHandler:re,sourceDecorator:we,PR_ATTRIB_NAME:U,PR_ATTRIB_VALUE:F,PR_COMMENT:A,PR_DECLARATION:h,PR_KEYWORD:L,PR_LITERAL:T,PR_NOCODE:S,PR_PLAIN:c,PR_PUNCTUATION:v,PR_SOURCE:x,PR_STRING:C,PR_TAG:E,PR_TYPE:_,prettyPrintOne:N?W.prettyPrintOne=ae:P=ae,prettyPrint:G=N?W.prettyPrint=oe:G=oe},Re=W.define;typeof Re=="function"&&Re.amd&&Re("google-code-prettify",[],function(){return ge})})()},T1X5:function(at,Ee){at.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAABsCAYAAACPZlfNAAALdklEQVR4Xu2dC2wc1RVAzx1nDXFiO4SEhqxtxS0JHzX94TS0FEKLALX8WkKbqrRVKQrh15Zfq0IqIaSGSOXb8ktANFJbKqUFWigEAUohfFRQDC1KxS8UR/7wDbZ3TRxix3urN951No7Xnt15M7Mbz0hRImXevffds/PmzXv33StU0KWqTlcfh6mwkCHmq8M8B5oUZosyS6EeOCD7x/Rsl/kjkFJhu8AHGWiXDNuoYqsoW5K1vCkimUpxg5SzoW+r1gylOUGErygci9IC1Fi2uR+hVeA5VZ6tquOpuSL9lnVYE1d2wNo+0jnVylLNcKYKx6EcaK23XgQJH4vyjDg8OCDc3zxd3vXSLKx7ygJYW5seOGUmZ6GcJ8IShaqwHDCeHoEhVTYh3LO7mweam+XjqO2KFNjWPp09VblUlQuAmVE7YwL93SKs2SncMr9WPojK1kiAdWzXpCa40oHlCtOi6nwpegV2ZOBuGeSGxlnSVYoMP21CBfZmnx5SneFagXPzZnJ+7I+y7S6FdQMO1xxWK++HZUgowNzpeIoVKqwCDgqrcyHp6RFlZbKetWF8HgQOrD2liwTuAHdKvj9frVVTuHDuNGkNspOBAWtt1cShC1ilcLlqecz6gnSkkS3CkMBN77zBypYWGQxCXyDAuvq1KTPIeuCYIIyuAJnPOwmWJWuk3bat1oF1pfWMjLKuAqbptn05Wl63I5ybrJOHbCqyCqw9ratEucqMDjaNrGBZqsLqpjpZaasPVhyrqlVdKe5Wcafr8TXKA6KsS9azXESG/DrHN7CODp0qdaxXON2vMftze4F/aJpljY2y008/fQFr69EZCYeH3ZX0+JrQA2ZHYDDDac0HSe+ENxe4oWRg2SfriRhWca53t3HSnFTqk1YSMPedleZv8TBYHKzc3WZ4TNbxrVLeaSUB6+zV38cTjNJgjUBT1jXMkB8XK6VoYNmp+9XFKorv39cDKlxX7JS/KGDZj+K/x99Z1n5+6gjfLObj2jOw7HLTv+MVDGuwcoK6nQSf97qM5QmYWcj9xHyensRrg9YpjRL4/HtbOd7LgrEnYF1p/U1G+XnQVk9m+Y5wfbJOfjGRDyYEZvazHOFfk2WLZCKHBfX/Zmsmo3ypqV42j6djXGBmp7gzzQuTYPMxKA7Fym1tqGPxeDvX4wLr7NULVdzd4vgKyQOiXNQwQ+4spK4gMBMwc0CG1/bDGIyQXF+ymp5dDkcUCuwpCKwzpXcqbrxgfIXsAYU1TfVy4VhqxwRm4gZJ8L/9IBQtZFdbU7eLQT41VtzjmMDaU3qzwKXW1MeCivaAwi1N9XLZ6Ib7AHPDpzO0hRmR+/L78Ict8J93IT1QdN+sN6irhs/NgR8uhM8eYl28J4EmwninQ/PosPB9gHWmdZUqoS3u/uUVuPEFKMcDWg5wxWL4zlGefGz9JhGuaxgVD7IXsOwpEhMvHsrBBPNknf9IecLKed9Au+vUyJ607t3dJPNPzewFrCOl3wPutf5TKSDwio3wdF7k3imfhMNnugGZkV2q8Ho3PPbWHhOOb4IbT4zMpHMa6+XPOe17A+vVjQhfC8u0E+/d884ysH69JCzNE+v51aY90Mw7beM5E7cJ5A7ln40zZOTnMgLMnHxMDNEZ5mG6RSbcNHv9tAV+sDCQLpck9I9b4Hd5UfKbIwrgM4cKB6toyJ0EHQHWkdJLgFtL6l2JjfKB/WwRfP/TJQoKoNmf/gu/zVuGjQqY6ZrjcEmyVm43/x4B1pnSxxVOCqDvBUXGwLx5W+CJhno5eQSYe1q/jw/DPgAeA/MGDOHjqloONtkN3CesI6XfAB7x2NzabV6B3fca3LoZ+ndbU+0KmpaAn7TA0iP2lVtOQ2LWulMb62WDC6wzrdfp8CGGUC+vwL56L3wU0ArI9Gp4cowZYLkBE2F1Q51cPfyEpXUTyvGh0gK8ArvgUXgxoGwZX5gDa79eAU+Y8HRjnSyR7K5yXwAZZibk7xXYjkHY2Abmb5uXGRJPnAfTqisAGPQ31FErnWldoMrrNh3hVZZXYF7l2byv3IZEd4YoHC4dfbqUDPfZ7KxXWTEwr57K3udwtnT06i8RVhfZ1MrtMbAi3ahcJe1pXSPKiiKbWrk9BlacG1VYa95hG1QZY55UnLBS7vYK7JXtwxuc/ZYnHTWJ4U3Ko2ZVxKTDvMMelY60bs7mISzF577aeAV25l/h7Y98qSrYeO50ePDblQHMzevYmVITDjAvGHeMLzUGVpzXBbZJR0p7gBnFNbVzt1dgr+aGRMtLUzVThofEI8cYEh9/C1ZuGu7n7BrYsMxOn31K6TXAdkTx0WwM9wrMZydLaj6UgTtegje64UefgaPnlCTGdqN+A8z8biPJAFrOwGx72pK8oRiYJU+GJMYFFg+JIXnbghp3SOyO6sCD1yFxxwBs3BbA4m91dvE3YcGV4YjoqYhp/YpH4aWAtlfMZGJNJMsGxRMentZXwIdzFBuYxbszhBbuh3MFLE25IQKtwSxNmRCBs8cIEQjB/UWrcJem4sXfvf32Qhdc8jjcdjIsThbt00AbuIu/8fZK5QDDbK/EG5gVBMxsYMYhApUDzA0RqIQgnEBfDKOEl/E7bDgIx9hb7mFuMTA3qH44zM04o9wDSWNgbsRUXiBpmYdq2wZmhr1C16sfwu0vwsVHw5EHF74vgin/nlDtcjgMEeb5sPw1zFJ/DKEePxp9GMIdFiM4bhTVCUyvT9gR4zxhx4T4Ub3PcSMDrKtPL85kuK3UX1wp7fyccTaHGE5uBhP5ZPMqx1nimAf6ojgy+/J7cP6G0rMILJ4Lt51iExeUG7CCR2bd6X3Ih9KNTj95OmZOhce+u38Do9ChdBdYyGkfcq4uJRPO9ARc9kU4Y8F+DgwKp30IO7GKXVfbkVZmQ+L4iVWyH9Ghpi6y42Z7UsoJ2ISpi0y3o0gOZs/d/iWVCzDPycFMl+P0e/7B+5XgOf2eO/mIE1z69bff9sUluMw+ZXdKnELWr+NLal90ClmjJU7SXJKvbTQqLUmzO2OM06DbAFCUjJLToBstcaGBonxt42Z/hQay77K4lIcNFBPIsFLKI6cjLpYTBjGub7RRLMeYGpejChyY3XJUxty44Ftg0OwXfMsbGs/IKHFJRXvsgiupmLMxLlpqkVbQRUtzpsZlgf1Dk7DKAme/z+LC2z6YhV54210g7tCpUkdc2r5IcJGUts/Z2NajMxIODyscW6Tdk/J2A2sww2nNB0lvqQ7wXTQj+6StVzi9VCMmQzszDGqaZY2NstNPf30DM8qfVJ0yP8VdKkRUP8GPC4JvayYYyXqWi8iQX21WgI2a8pvs3Fbl+u1khO1VhdVNo0pK+bHHumO70mo+rk1VlVBKWvnpfMBtux3h3GSdPGRTj3VgectY64FjbBpbQbKedxIsS9ZIXrEtO9YHAsyYZhaMD13AKoXLJ0uVdbNFInDTO2+wsqVFLOdPHQYeGLCR91pKFwlu8e4WO7+xspXSqnDRRKXp/VofODBjoNm57kqxQoVVUeW18uuocdr3iLIyWc/a8UrS29IfCrCcsSawpzrDtYI7/T/AVicikrNLYd2AwzWFqpoHYVeowHIdMHGPmuBKB5aHWX7YhgNNRG4G7pZBbhirMLYNHePJiARYziA3LFy5VJULKuAzoFuENTuFW0bXVg4aUr78SIHlDMmemjkL5TwRloRZh3OCX/OQKpsQ7tndzQP55XnDhFR2wPINMidBq5WlmuFMFY4Lu2qgqYYnyjPi8OCAcH+uWGhUgEbrLYsnrJAz3OwGaU5AOQ6HL2cLItRYdl6/m8AfnlPl2ao6njKlCy3rsCaurIGN7qX7edDHYSosZIj56jDPgSaF2aLM0uH8+6YaWG4GugsYEOhVYbvABxlolwzbqGKrKFuStbwZxnTcFrH/A8wNv8JI/KKJAAAAAElFTkSuQmCC"},T8No:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return G}),H.d(Ee,"e",function(){return W}),H.d(Ee,"c",function(){return v}),H.d(Ee,"b",function(){return c}),H.d(Ee,"d",function(){return E}),H.d(Ee,"f",function(){return U});var ee=H("MNsG"),V=H("N0LK"),N=H("Cg/j");let $=ee.k||"";const j=new Map;j.set("false",!1),j.set("true",!0),j.set("isMac",ee.f),j.set("isLinux",ee.d),j.set("isWindows",ee.i),j.set("isWeb",ee.h),j.set("isMacNative",ee.f&&!ee.h),j.set("isEdge",$.indexOf("Edg/")>=0),j.set("isFirefox",$.indexOf("Firefox")>=0),j.set("isChrome",$.indexOf("Chrome")>=0),j.set("isSafari",$.indexOf("Safari")>=0);const P=Object.prototype.hasOwnProperty;class G{static has(S){return g.create(S)}static equals(S,M){return p.create(S,M)}static regex(S,M){return C.create(S,M)}static not(S){return u.create(S)}static and(...S){return _.create(S,null)}static or(...S){return T.create(S,null,!0)}static deserialize(S,M=!1){return S?this._deserializeOrExpression(S,M):void 0}static _deserializeOrExpression(S,M){let I=S.split("||");return T.create(I.map(b=>this._deserializeAndExpression(b,M)),null,!0)}static _deserializeAndExpression(S,M){let I=S.split("&&");return _.create(I.map(b=>this._deserializeOne(b,M)),null)}static _deserializeOne(S,M){if(S=S.trim(),S.indexOf("!=")>=0){let I=S.split("!=");return f.create(I[0].trim(),this._deserializeValue(I[1],M))}if(S.indexOf("==")>=0){let I=S.split("==");return p.create(I[0].trim(),this._deserializeValue(I[1],M))}if(S.indexOf("=~")>=0){let I=S.split("=~");return C.create(I[0].trim(),this._deserializeRegexValue(I[1],M))}if(S.indexOf(" in ")>=0){let I=S.split(" in ");return l.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(S)){const I=S.split(">=");return o.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(S)){const I=S.split(">");return i.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(S)){const I=S.split("<=");return w.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(S)){const I=S.split("<");return O.create(I[0].trim(),I[1].trim())}return/^\!\s*/.test(S)?u.create(S.substr(1).trim()):g.create(S)}static _deserializeValue(S,M){if(S=S.trim(),S==="true")return!0;if(S==="false")return!1;let I=/^'([^']*)'$/.exec(S);return I?I[1].trim():S}static _deserializeRegexValue(S,M){if(Object(V.C)(S)){if(M)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let I=S.indexOf("/"),b=S.lastIndexOf("/");if(I===b||I<0){if(M)throw new Error(`bad regexp-value '${S}', missing /-enclosure`);return console.warn(`bad regexp-value '${S}', missing /-enclosure`),null}let K=S.slice(I+1,b),Q=S[b+1]==="i"?"i":"";try{return new RegExp(K,Q)}catch(ne){if(M)throw new Error(`bad regexp-value '${S}', parse error: ${ne}`);return console.warn(`bad regexp-value '${S}', parse error: ${ne}`),null}}}function W(S,M){const I=S?S.substituteConstants():void 0,b=M?M.substituteConstants():void 0;return!I&&!b?!0:!I||!b?!1:I.equals(b)}function n(S,M){return S.cmp(M)}class D{constructor(){this.type=0}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!1}serialize(){return"false"}keys(){return[]}negate(){return y.INSTANCE}}D.INSTANCE=new D;class y{constructor(){this.type=1}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!0}serialize(){return"true"}keys(){return[]}negate(){return D.INSTANCE}}y.INSTANCE=new y;class g{constructor(S,M){this.key=S,this.negated=M,this.type=2}static create(S,M=null){const I=j.get(S);return typeof I=="boolean"?I?y.INSTANCE:D.INSTANCE:new g(S,M)}cmp(S){return S.type!==this.type?this.type-S.type:h(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=j.get(this.key);return typeof S=="boolean"?S?y.INSTANCE:D.INSTANCE:this}evaluate(S){return!!S.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this)),this.negated}}class p{constructor(S,M,I){this.key=S,this.value=M,this.negated=I,this.type=4}static create(S,M,I=null){if(typeof M=="boolean")return M?g.create(S,I):u.create(S,I);const b=j.get(S);if(typeof b=="boolean"){const K=b?"true":"false";return M===K?y.INSTANCE:D.INSTANCE}return new p(S,M,I)}cmp(S){return S.type!==this.type?this.type-S.type:x(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=j.get(this.key);if(typeof S=="boolean"){const M=S?"true":"false";return this.value===M?y.INSTANCE:D.INSTANCE}return this}evaluate(S){return S.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this.value,this)),this.negated}}class l{constructor(S,M){this.key=S,this.valueKey=M,this.type=10,this.negated=null}static create(S,M){return new l(S,M)}cmp(S){return S.type!==this.type?this.type-S.type:x(this.key,this.valueKey,S.key,S.valueKey)}equals(S){return S.type===this.type?this.key===S.key&&this.valueKey===S.valueKey:!1}substituteConstants(){return this}evaluate(S){const M=S.getValue(this.valueKey),I=S.getValue(this.key);return Array.isArray(M)?M.indexOf(I)>=0:typeof I=="string"&&typeof M=="object"&&M!==null?P.call(M,I):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=a.create(this)),this.negated}}class a{constructor(S){this._actual=S,this.type=11}static create(S){return new a(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class f{constructor(S,M,I){this.key=S,this.value=M,this.negated=I,this.type=5}static create(S,M,I=null){if(typeof M=="boolean")return M?u.create(S,I):g.create(S,I);const b=j.get(S);if(typeof b=="boolean"){const K=b?"true":"false";return M===K?D.INSTANCE:y.INSTANCE}return new f(S,M,I)}cmp(S){return S.type!==this.type?this.type-S.type:x(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=j.get(this.key);if(typeof S=="boolean"){const M=S?"true":"false";return this.value===M?D.INSTANCE:y.INSTANCE}return this}evaluate(S){return S.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 u{constructor(S,M){this.key=S,this.negated=M,this.type=3}static create(S,M=null){const I=j.get(S);return typeof I=="boolean"?I?D.INSTANCE:y.INSTANCE:new u(S,M)}cmp(S){return S.type!==this.type?this.type-S.type:h(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=j.get(this.key);return typeof S=="boolean"?S?D.INSTANCE:y.INSTANCE:this}evaluate(S){return!S.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this)),this.negated}}function d(S,M){if(typeof S=="string"){const I=parseFloat(S);isNaN(I)||(S=I)}return typeof S=="string"||typeof S=="number"?M(S):D.INSTANCE}class i{constructor(S,M,I){this.key=S,this.value=M,this.negated=I,this.type=12}static create(S,M,I=null){return d(M,b=>new i(S,b,I))}cmp(S){return S.type!==this.type?this.type-S.type:x(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this.value,this)),this.negated}}class o{constructor(S,M,I){this.key=S,this.value=M,this.negated=I,this.type=13}static create(S,M,I=null){return d(M,b=>new o(S,b,I))}cmp(S){return S.type!==this.type?this.type-S.type:x(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=O.create(this.key,this.value,this)),this.negated}}class O{constructor(S,M,I){this.key=S,this.value=M,this.negated=I,this.type=14}static create(S,M,I=null){return d(M,b=>new O(S,b,I))}cmp(S){return S.type!==this.type?this.type-S.type:x(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class w{constructor(S,M,I){this.key=S,this.value=M,this.negated=I,this.type=15}static create(S,M,I=null){return d(M,b=>new w(S,b,I))}cmp(S){return S.type!==this.type?this.type-S.type:x(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class C{constructor(S,M){this.key=S,this.regexp=M,this.type=7,this.negated=null}static create(S,M){return new C(S,M)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.key<S.key)return-1;if(this.key>S.key)return 1;const M=this.regexp?this.regexp.source:"",I=S.regexp?S.regexp.source:"";return M<I?-1:M>I?1:0}equals(S){if(S.type===this.type){const M=this.regexp?this.regexp.source:"",I=S.regexp?S.regexp.source:"";return this.key===S.key&&M===I}return!1}substituteConstants(){return this}evaluate(S){let M=S.getValue(this.key);return this.regexp?this.regexp.test(M):!1}serialize(){const S=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${S}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this)),this.negated}}class L{constructor(S){this._actual=S,this.type=8}static create(S){return new L(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function A(S){let M=null;for(let I=0,b=S.length;I<b;I++){const K=S[I].substituteConstants();if(S[I]!==K&&M===null){M=[];for(let Q=0;Q<I;Q++)M[Q]=S[Q]}M!==null&&(M[I]=K)}return M===null?S:M}class _{constructor(S,M){this.expr=S,this.negated=M,this.type=6}static create(S,M){return _._normalizeArr(S,M)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let M=0,I=this.expr.length;M<I;M++){const b=n(this.expr[M],S.expr[M]);if(b!==0)return b}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].equals(S.expr[M]))return!1;return!0}return!1}substituteConstants(){const S=A(this.expr);return S===this.expr?this:_.create(S,this.negated)}evaluate(S){for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].evaluate(S))return!1;return!0}static _normalizeArr(S,M){const I=[];let b=!1;for(const K of S){if(!K)continue;if(K.type===1){b=!0;continue}if(K.type===0)return D.INSTANCE;if(K.type===6){I.push(...K.expr);continue}I.push(K)}if(I.length===0&&b)return y.INSTANCE;if(I.length===0)return;if(I.length===1)return I[0];I.sort(n);for(let K=1;K<I.length;K++)I[K-1].equals(I[K])&&(I.splice(K,1),K--);if(I.length===1)return I[0];for(;I.length>1;){const K=I[I.length-1];if(K.type!==9)break;I.pop();const Q=I.pop(),ne=I.length===0,fe=T.create(K.expr.map(we=>_.create([we,Q],null)),null,ne);fe&&(I.push(fe),I.sort(n))}return I.length===1?I[0]:new _(I,M)}serialize(){return this.expr.map(S=>S.serialize()).join(" && ")}keys(){const S=[];for(let M of this.expr)S.push(...M.keys());return S}negate(){if(!this.negated){const S=[];for(let M of this.expr)S.push(M.negate());this.negated=T.create(S,this,!0)}return this.negated}}class T{constructor(S,M){this.expr=S,this.negated=M,this.type=9}static create(S,M,I){return T._normalizeArr(S,M,I)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let M=0,I=this.expr.length;M<I;M++){const b=n(this.expr[M],S.expr[M]);if(b!==0)return b}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].equals(S.expr[M]))return!1;return!0}return!1}substituteConstants(){const S=A(this.expr);return S===this.expr?this:T.create(S,this.negated,!1)}evaluate(S){for(let M=0,I=this.expr.length;M<I;M++)if(this.expr[M].evaluate(S))return!0;return!1}static _normalizeArr(S,M,I){let b=[],K=!1;if(S){for(let Q=0,ne=S.length;Q<ne;Q++){const fe=S[Q];if(!fe)continue;if(fe.type===0){K=!0;continue}if(fe.type===1)return y.INSTANCE;if(fe.type===9){b=b.concat(fe.expr);continue}b.push(fe)}if(b.length===0&&K)return D.INSTANCE;b.sort(n)}if(b.length===0)return;if(b.length===1)return b[0];for(let Q=1;Q<b.length;Q++)b[Q-1].equals(b[Q])&&(b.splice(Q,1),Q--);if(b.length===1)return b[0];if(I){for(let Q=0;Q<b.length;Q++)for(let ne=Q+1;ne<b.length;ne++)U(b[Q],b[ne])&&(b.splice(ne,1),ne--);if(b.length===1)return b[0]}return new T(b,M)}serialize(){return this.expr.map(S=>S.serialize()).join(" || ")}keys(){const S=[];for(let M of this.expr)S.push(...M.keys());return S}negate(){if(!this.negated){let S=[];for(let M of this.expr)S.push(M.negate());for(;S.length>1;){const M=S.shift(),I=S.shift(),b=[];for(const Q of F(M))for(const ne of F(I))b.push(_.create([Q,ne],null));const K=S.length===0;S.unshift(T.create(b,null,K))}this.negated=S[0]}return this.negated}}class v extends g{constructor(S,M,I){super(S,null);this._defaultValue=M,typeof I=="object"?v._info.push(Object.assign(Object.assign({},I),{key:S})):I!==!0&&v._info.push({key:S,description:I,type:M!=null?typeof M:void 0})}static all(){return v._info.values()}bindTo(S){return S.createKey(this.key,this._defaultValue)}getValue(S){return S.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(S){return p.create(this.key,S)}}v._info=[];const c=Object(N.c)("contextKeyService"),E="setContext";function h(S,M){return S<M?-1:S>M?1:0}function x(S,M,I,b){return S<I?-1:S>I?1:M<b?-1:M>b?1:0}function U(S,M){if(M.type===6&&S.type!==9&&S.type!==6){for(const K of M.expr)if(S.equals(K))return!0}const I=S.negate(),b=F(I).concat(F(M));b.sort(n);for(let K=0;K<b.length;K++){const Q=b[K],ne=Q.negate();for(let fe=K+1;fe<b.length;fe++){const we=b[fe];if(ne.equals(we))return!0}}return!1}function F(S){return S.type===9?S.expr:[S]}},TXwP:function(at,Ee,H){var ee,V;(function(){var N;(function(){"use strict";var j=[,,function(n){function D(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var p=new D(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},D.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},D.prototype.has_match=function(p){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(p))return!0;return!1},D.prototype.set_indent=function(p,l){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(p){this.__items.push(p);var l=p.lastIndexOf(`
`);l!==-1?this.__character_count=p.length-l:this.__character_count+=p.length},D.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function y(p,l){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),l=l||"",p.indent_level>0&&(l=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}y.prototype.get_indent_size=function(p,l){var a=this.__base_string_length;return l=l||0,p<0&&(a=0),a+=p*this.__indent_size,a+=l,a},y.prototype.get_indent_string=function(p,l){var a=this.__base_string;return l=l||0,p<0&&(p=0,a=""),l+=p*this.__indent_size,this.__ensure_cache(l),a+=this.__cache[l],a},y.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var p=this.__cache.length,l=0,a="";this.__indent_size&&p>=this.__indent_size&&(l=Math.floor(p/this.__indent_size),p-=l*this.__indent_size,a=new Array(l+1).join(this.__indent_string)),p&&(a+=new Array(p+1).join(" ")),this.__cache.push(a)};function g(p,l){this.__indent_cache=new y(p,l),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(p,l){return this.__indent_cache.get_indent_string(p,l)},g.prototype.get_indent_size=function(p,l){return this.__indent_cache.get_indent_size(p,l)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(p){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return p!==`
`&&(a=a.replace(/[\n]/g,p)),a},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(p,l){return p=p||0,l=l||0,this.next_line.set_indent(p,l),this.__lines.length>1?(this.current_line.set_indent(p,l),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(p){for(var l=0;l<p.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.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()},g.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(" "))},g.prototype.remove_indent=function(p){for(var l=this.__lines.length;p<l;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},g.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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(p,l){for(var a=this.__lines.length-2;a>=0;){var f=this.__lines[a];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==l){this.__lines.splice(a+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},n.exports.Output=g},,,,function(n){function D(p,l){this.raw_options=y(p,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}D.prototype._get_array=function(p,l){var a=this.raw_options[p],f=l||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(f=a.concat()):typeof a=="string"&&(f=a.split(/[^a-zA-Z0-9_\/\-]+/)),f},D.prototype._get_boolean=function(p,l){var a=this.raw_options[p],f=a===void 0?!!l:!!a;return f},D.prototype._get_characters=function(p,l){var a=this.raw_options[p],f=l||"";return typeof a=="string"&&(f=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),f},D.prototype._get_number=function(p,l){var a=this.raw_options[p];l=parseInt(l,10),isNaN(l)&&(l=0);var f=parseInt(a,10);return isNaN(f)&&(f=l),f},D.prototype._get_selection=function(p,l,a){var f=this._get_selection_list(p,l,a);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[p]+"'");return f[0]},D.prototype._get_selection_list=function(p,l,a){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[l[0]],!this._is_valid_selection(a,l))throw new Error("Invalid Default Value!");var f=this._get_array(p,a);if(!this._is_valid_selection(f,l))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[p]+"'");return f},D.prototype._is_valid_selection=function(p,l){return p.length&&l.length&&!p.some(function(a){return l.indexOf(a)===-1})};function y(p,l){var a={};p=g(p);var f;for(f in p)f!==l&&(a[f]=p[f]);if(l&&p[l])for(f in p[l])a[f]=p[l][f];return a}function g(p){var l={},a;for(a in p){var f=a.replace(/-/g,"_");l[f]=p[a]}return l}n.exports.Options=D,n.exports.normalizeOpts=g,n.exports.mergeOpts=y},,function(n){var D=RegExp.prototype.hasOwnProperty("sticky");function y(g){this.__input=g||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},y.prototype.peek=function(g){var p=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(p=this.__input.charAt(g)),p},y.prototype.__match=function(g,p){g.lastIndex=p;var l=g.exec(this.__input);return l&&!(D&&g.sticky)&&(l.index!==p&&(l=null)),l},y.prototype.test=function(g,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(g,p):!1},y.prototype.testChar=function(g,p){var l=this.peek(p);return g.lastIndex=0,l!==null&&g.test(l)},y.prototype.match=function(g){var p=this.__match(g,this.__position);return p?this.__position+=p[0].length:p=null,p},y.prototype.read=function(g,p,l){var a="",f;return g&&(f=this.match(g),f&&(a+=f[0])),p&&(f||!g)&&(a+=this.readUntil(p,l)),a},y.prototype.readUntil=function(g,p){var l="",a=this.__position;g.lastIndex=this.__position;var f=g.exec(this.__input);return f?(a=f.index,p&&(a+=f[0].length)):a=this.__input_length,l=this.__input.substring(this.__position,a),this.__position=a,l},y.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},y.prototype.get_regexp=function(g,p){var l=null,a="g";return p&&D&&(a="y"),typeof g=="string"&&g!==""?l=new RegExp(g,a):g&&(l=new RegExp(g.source,a)),l},y.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(g){var p=this.__position,l=this.readUntilAfter(g);return this.__position=p,l},y.prototype.lookBack=function(g){var p=this.__position-1;return p>=g.length&&this.__input.substring(p-g.length,p).toLowerCase()===g},n.exports.InputScanner=y},,,,,function(n){function D(y,g){y=typeof y=="string"?y:y.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+g,"g")}D.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(y);p;)g[p[1]]=p[2],p=this.__directive_pattern.exec(y);return g},D.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=D},,function(n,D,y){var g=y(16).Beautifier,p=y(17).Options;function l(a,f){var u=new g(a,f);return u.beautify()}n.exports=l,n.exports.defaultOptions=function(){return new p}},function(n,D,y){var g=y(17).Options,p=y(2).Output,l=y(8).InputScanner,a=y(13).Directives,f=new a(/\/\*/,/\*\//),u=/\r\n|[\r\n]/,d=/\r\n|[\r\n]/g,i=/\s/,o=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,w=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function C(L,A){this._source_text=L||"",this._options=new g(A),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"]}C.prototype.eatString=function(L){var A="";for(this._ch=this._input.next();this._ch;){if(A+=this._ch,this._ch==="\\")A+=this._input.next();else if(L.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return A},C.prototype.eatWhitespace=function(L){for(var A=i.test(this._input.peek()),_=0;i.test(this._input.peek());)this._ch=this._input.next(),L&&this._ch===`
`&&((_===0||_<this._options.max_preserve_newlines)&&(_++,this._output.add_new_line(!0)));return A},C.prototype.foundNestedPseudoClass=function(){for(var L=0,A=1,_=this._input.peek(A);_;){if(_==="{")return!0;if(_==="(")L+=1;else if(_===")"){if(L===0)return!1;L-=1}else if(_===";"||_==="}")return!1;A++,_=this._input.peek(A)}return!1},C.prototype.print_string=function(L){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(L)},C.prototype.preserveSingleSpace=function(L){L&&(this._output.space_before_token=!0)},C.prototype.indent=function(){this._indentLevel++},C.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var L=this._source_text,A=this._options.eol;A==="auto"&&(A=`
`,L&&u.test(L||"")&&(A=L.match(u)[0])),L=L.replace(d,`
`);var _=L.match(/^[\t ]*/)[0];this._output=new p(this._options,_),this._input=new l(L),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var T=0,v=!1,c=!1,E=!1,h=!1,x=!1,U=!1,F=this._ch,S=!1,M,I,b;M=this._input.read(o),I=M!=="",b=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 K=this._input.read(O),Q=f.get_directives(K);Q&&Q.ignore==="start"&&(K+=f.readIgnored(this._input)),this.print_string(K),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(w)),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"?h=!0:ne==="import"&&(x=!0),ne in this.NESTED_AT_RULE?(this._nestedLevel+=1,ne in this.CONDITIONAL_GROUP_RULE&&(E=!0)):!v&&T===0&&ne.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(I),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),E?(E=!1,v=this._indentLevel>=this._nestedLevel):v=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&v&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(b==="("?this._output.space_before_token=!1:b!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),b==="{"&&this._output.trim(!0),x=!1,h=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),v=!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 fe=0;fe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;fe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[fe])){S=!0;break}(v||E)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!h&&T===0?(this.print_string(":"),c||(c=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var we=b==='"'||b==="'";this.preserveSingleSpace(we||I),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")S=!1,T===0?(c&&(this.outdent(),c=!1),h=!1,x=!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(),T++,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(")")),T&&(T--,this.outdent()));else{var Se=!1;this._input.lookBack("with")&&(Se=!0),this.preserveSingleSpace(I||Se),this.print_string(this._ch),c&&b==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),U=!0):(this.eatWhitespace(),T++,this.indent())}else if(this._ch===")")T&&(T--,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&&(!c||U)&&T===0&&!x&&!h?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&T===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&&i.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("="),i.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 he=b==='"'||b==="'";this.preserveSingleSpace(he||I),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&S&&this._output.add_new_line()}var se=this._output.get_code(A);return se},n.exports.Beautifier=C},function(n,D,y){var g=y(6).Options;function p(l){g.call(this,l,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var a=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||a;var f=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var u=0;u<f.length;u++)f[u]!=="expand"?this.brace_style="collapse":this.brace_style=f[u]}p.prototype=new g,n.exports.Options=p}],P={};function G(n){var D=P[n];if(D!==void 0)return D.exports;var y=P[n]={exports:{}};return j[n](y,y.exports,G),y.exports}var W=G(15);N=W})();var $=N;!(ee=[],V=function(){return{css_beautify:$}}.apply(Ee,ee),V!==void 0&&(at.exports=V))})()},Vhoy:function(at,Ee,H){"use strict";H.d(Ee,"d",function(){return $}),H.d(Ee,"e",function(){return j}),H.d(Ee,"c",function(){return P}),H.d(Ee,"b",function(){return G}),H.d(Ee,"a",function(){return W});var ee=H("MI8n");class V{constructor(){this._icons=new Map,this._onDidRegister=new ee.b}add(n){const D=this._icons.get(n.id);D?n.description?D.description=n.description:console.error(`Duplicate registration of codicon ${n.id}`):(this._icons.set(n.id,n),this._onDidRegister.fire(n))}get(n){return this._icons.get(n)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const N=new V,$=N;function j(n,D){return new G(n,D)}function P(n){return n?n.replace(/\$\((.*?)\)/g,(D,y)=>` ${y} `).trim():""}class G{constructor(n,D,y){this.id=n,this.definition=D,this.description=y,N.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var W;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const D=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function y(l){if(l instanceof G)return["codicon","codicon-"+l.id];const a=D.exec(l.id);if(!a)return y(G.error);let[,f,u]=a;const d=["codicon","codicon-"+f];return u&&d.push("codicon-modifier-"+u.substr(1)),d}n.asClassNameArray=y;function g(l){return y(l).join(" ")}n.asClassName=g;function p(l){return"."+y(l).join(".")}n.asCSSSelector=p})(W||(W={})),function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})}(G||(G={}))},"VrN/":function(at,Ee,H){(function(ee,V){at.exports=V()})(this,function(){"use strict";var ee=navigator.userAgent,V=navigator.platform,N=/gecko\/\d/i.test(ee),$=/MSIE \d/.test(ee),j=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ee),P=/Edge\/(\d+)/.exec(ee),G=$||j||P,W=G&&($?document.documentMode||6:+(P||j)[1]),n=!P&&/WebKit\//.test(ee),D=n&&/Qt\/\d+\.\d+/.test(ee),y=!P&&/Chrome\//.test(ee),g=/Opera\//.test(ee),p=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ee),a=/PhantomJS/.test(ee),f=!P&&/AppleWebKit/.test(ee)&&/Mobile\/\w+/.test(ee),u=/Android/.test(ee),d=f||u||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ee),i=f||/Mac/.test(V),o=/\bCrOS\b/.test(ee),O=/win/i.test(V),w=g&&ee.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(g=!1,n=!0);var C=i&&(D||g&&(w==null||w<12.11)),L=N||G&&W>=9;function A(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _=function(e,t){var s=e.className,r=A(t).exec(s);if(r){var m=s.slice(r.index+r[0].length);e.className=s.slice(0,r.index)+(m?r[1]+m:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function v(e,t){return T(e).appendChild(t)}function c(e,t,s,r){var m=document.createElement(e);if(s&&(m.className=s),r&&(m.style.cssText=r),typeof t=="string")m.appendChild(document.createTextNode(t));else if(t)for(var B=0;B<t.length;++B)m.appendChild(t[B]);return m}function E(e,t,s,r){var m=c(e,t,s,r);return m.setAttribute("role","presentation"),m}var h;document.createRange?h=function(e,t,s,r){var m=document.createRange();return m.setEnd(r||e,s),m.setStart(e,t),m}:h=function(e,t,s){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(m){return r}return r.collapse(!0),r.moveEnd("character",s),r.moveStart("character",t),r};function x(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 s=e.className;A(t).test(s)||(e.className+=(s?" ":"")+t)}function S(e,t){for(var s=e.split(" "),r=0;r<s.length;r++)s[r]&&!A(s[r]).test(t)&&(t+=" "+s[r]);return t}var M=function(e){e.select()};f?M=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:G&&(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 b(e,t,s){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(s!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function K(e,t,s,r,m){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var B=r||0,X=m||0;;){var q=e.indexOf(" ",B);if(q<0||q>=t)return X+(t-B);X+=q-B,X+=s-X%s,B=q+1}}var Q=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};Q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Q.prototype.set=function(e,t){this.f=t;var s=+new Date+e;(!this.id||s<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=s)};function ne(e,t){for(var s=0;s<e.length;++s)if(e[s]==t)return s;return-1}var fe=50,we={toString:function(){return"CodeMirror.Pass"}},Se={scroll:!1},he={origin:"*mouse"},se={origin:"+move"};function me(e,t,s){for(var r=0,m=0;;){var B=e.indexOf(" ",r);B==-1&&(B=e.length);var X=B-r;if(B==e.length||m+X>=t)return r+Math.min(X,t-m);if(m+=B-r,m+=s-m%s,r=B+1,m>=t)return r}}var re=[""];function le(e){for(;re.length<=e;)re.push(Z(re)+" ");return re[e]}function Z(e){return e[e.length-1]}function ae(e,t){for(var s=[],r=0;r<e.length;r++)s[r]=t(e[r],r);return s}function oe(e,t,s){for(var r=0,m=s(t);r<e.length&&s(e[r])<=m;)r++;e.splice(r,0,t)}function ge(){}function Re(e,t){var s;return Object.create?s=Object.create(e):(ge.prototype=e,s=new ge),t&&b(t,s),s}var Te=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Me(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Te.test(e))}function Be(e,t){return t?t.source.indexOf("\\w")>-1&&Me(e)?!0:t.test(e):Me(e)}function pe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ce=/[\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 ke(e){return e.charCodeAt(0)>=768&&Ce.test(e)}function Le(e,t,s){for(;(s<0?t>0:t<e.length)&&ke(e.charAt(t));)t+=s;return t}function Ge(e,t,s){for(var r=t>s?-1:1;;){if(t==s)return t;var m=(t+s)/2,B=r<0?Math.ceil(m):Math.floor(m);if(B==t)return e(B)?t:s;e(B)?s=B:t=B+r}}function Ve(e,t,s,r){if(!e)return r(t,s,"ltr",0);for(var m=!1,B=0;B<e.length;++B){var X=e[B];(X.from<s&&X.to>t||t==s&&X.to==t)&&(r(Math.max(X.from,t),Math.min(X.to,s),X.level==1?"rtl":"ltr",B),m=!0)}m||r(t,s,"ltr")}var tt=null;function rt(e,t,s){var r;tt=null;for(var m=0;m<e.length;++m){var B=e[m];if(B.from<t&&B.to>t)return m;B.to==t&&(B.from!=B.to&&s=="before"?r=m:tt=m),B.from==t&&(B.from!=B.to&&s!="before"?r=m:tt=m)}return r!=null?r:tt}var ut=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function s(de){return de<=247?e.charAt(de):1424<=de&&de<=1524?"R":1536<=de&&de<=1785?t.charAt(de-1536):1774<=de&&de<=2220?"r":8192<=de&&de<=8203?"w":de==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,m=/[stwN]/,B=/[LRr]/,X=/[Lb1n]/,q=/[1n]/;function te(de,Ae,Ie){this.level=de,this.from=Ae,this.to=Ie}return function(de,Ae){var Ie=Ae=="ltr"?"L":"R";if(de.length==0||Ae=="ltr"&&!r.test(de))return!1;for(var He=de.length,We=[],Ze=0;Ze<He;++Ze)We.push(s(de.charCodeAt(Ze)));for(var ot=0,pt=Ie;ot<He;++ot){var Et=We[ot];Et=="m"?We[ot]=pt:pt=Et}for(var Ot=0,xt=Ie;Ot<He;++Ot){var Dt=We[Ot];Dt=="1"&&xt=="r"?We[Ot]="n":B.test(Dt)&&(xt=Dt,Dt=="r"&&(We[Ot]="R"))}for(var Ht=1,Ft=We[0];Ht<He-1;++Ht){var tn=We[Ht];tn=="+"&&Ft=="1"&&We[Ht+1]=="1"?We[Ht]="1":tn==","&&Ft==We[Ht+1]&&(Ft=="1"||Ft=="n")&&(We[Ht]=Ft),Ft=tn}for(var Sn=0;Sn<He;++Sn){var Xn=We[Sn];if(Xn==",")We[Sn]="N";else if(Xn=="%"){var Rn=void 0;for(Rn=Sn+1;Rn<He&&We[Rn]=="%";++Rn);for(var mr=Sn&&We[Sn-1]=="!"||Rn<He&&We[Rn]=="1"?"1":"N",lr=Sn;lr<Rn;++lr)We[lr]=mr;Sn=Rn-1}}for(var jn=0,ur=Ie;jn<He;++jn){var Jn=We[jn];ur=="L"&&Jn=="1"?We[jn]="L":B.test(Jn)&&(ur=Jn)}for(var Hn=0;Hn<He;++Hn)if(m.test(We[Hn])){var Wn=void 0;for(Wn=Hn+1;Wn<He&&m.test(We[Wn]);++Wn);for(var In=(Hn?We[Hn-1]:Ie)=="L",dr=(Wn<He?We[Wn]:Ie)=="L",_i=In==dr?In?"L":"R":Ie,Xr=Hn;Xr<Wn;++Xr)We[Xr]=_i;Hn=Wn-1}for(var qn=[],Lr,Yn=0;Yn<He;)if(X.test(We[Yn])){var qa=Yn;for(++Yn;Yn<He&&X.test(We[Yn]);++Yn);qn.push(new te(0,qa,Yn))}else{var Pr=Yn,ri=qn.length,ii=Ae=="rtl"?1:0;for(++Yn;Yn<He&&We[Yn]!="L";++Yn);for(var ar=Pr;ar<Yn;)if(q.test(We[ar])){Pr<ar&&(qn.splice(ri,0,new te(1,Pr,ar)),ri+=ii);var Ei=ar;for(++ar;ar<Yn&&q.test(We[ar]);++ar);qn.splice(ri,0,new te(2,Ei,ar)),ri+=ii,Pr=ar}else++ar;Pr<Yn&&qn.splice(ri,0,new te(1,Pr,Yn))}return Ae=="ltr"&&(qn[0].level==1&&(Lr=de.match(/^\s+/))&&(qn[0].from=Lr[0].length,qn.unshift(new te(0,0,Lr[0].length))),Z(qn).level==1&&(Lr=de.match(/\s+$/))&&(Z(qn).to-=Lr[0].length,qn.push(new te(0,He-Lr[0].length,He)))),Ae=="rtl"?qn.reverse():qn}}();function lt(e,t){var s=e.order;return s==null&&(s=e.order=ut(e.text,t)),s}var Ne=[],Pe=function(e,t,s){if(e.addEventListener)e.addEventListener(t,s,!1);else if(e.attachEvent)e.attachEvent("on"+t,s);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Ne).concat(s)}};function ze(e,t){return e._handlers&&e._handlers[t]||Ne}function Xe(e,t,s){if(e.removeEventListener)e.removeEventListener(t,s,!1);else if(e.detachEvent)e.detachEvent("on"+t,s);else{var r=e._handlers,m=r&&r[t];if(m){var B=ne(m,s);B>-1&&(r[t]=m.slice(0,B).concat(m.slice(B+1)))}}}function je(e,t){var s=ze(e,t);if(!s.length)return;for(var r=Array.prototype.slice.call(arguments,2),m=0;m<s.length;++m)s[m].apply(null,r)}function Fe(e,t,s){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),je(e,s||t.type,e,t),be(t)||t.codemirrorIgnore}function _e(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var s=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)ne(s,t[r])==-1&&s.push(t[r])}function ye(e,t){return ze(e,t).length>0}function ve(e){e.prototype.on=function(t,s){Pe(this,t,s)},e.prototype.off=function(t,s){Xe(this,t,s)}}function ue(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ce(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function be(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function xe(e){ue(e),ce(e)}function Oe(e){return e.target||e.srcElement}function Ue(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),i&&e.ctrlKey&&t==1&&(t=3),t}var Ke=function(){if(G&&W<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),et;function it(e){if(et==null){var t=c("span","\u200B");v(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(et=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&W<8))}var s=et?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return s.setAttribute("cm-text",""),s}var nt;function yt(e){if(nt!=null)return nt;var t=v(e,document.createTextNode("A\u062EA")),s=h(t,0,1).getBoundingClientRect(),r=h(t,1,2).getBoundingClientRect();return T(e),!s||s.left==s.right?!1:nt=r.right-s.right<3}var bt=`
b`.split(/\n/).length!=3?function(e){for(var t=0,s=[],r=e.length;t<=r;){var m=e.indexOf(`
`,t);m==-1&&(m=e.length);var B=e.slice(t,e.charAt(m-1)=="\r"?m-1:m),X=B.indexOf("\r");X!=-1?(s.push(B.slice(0,X)),t+=X+1):(s.push(B),t=m+1)}return s}:function(e){return e.split(/\r\n?|\n/)},dt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(s){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},wt=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Tt=null;function Ct(e){if(Tt!=null)return Tt;var t=v(e,c("span","x")),s=t.getBoundingClientRect(),r=h(t,0,1).getBoundingClientRect();return Tt=Math.abs(s.left-r.left)>1}var Nt={},At={};function It(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Nt[e]=t}function gt(e,t){At[e]=t}function Ye(e){if(typeof e=="string"&&At.hasOwnProperty(e))e=At[e];else if(e&&typeof e.name=="string"&&At.hasOwnProperty(e.name)){var t=At[e.name];typeof t=="string"&&(t={name:t}),e=Re(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ye("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ye("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function _t(e,t){t=Ye(t);var s=Nt[t.name];if(!s)return _t(e,"text/plain");var r=s(e,t);if($e.hasOwnProperty(t.name)){var m=$e[t.name];for(var B in m){if(!m.hasOwnProperty(B))continue;r.hasOwnProperty(B)&&(r["_"+B]=r[B]),r[B]=m[B]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var X in t.modeProps)r[X]=t.modeProps[X];return r}var $e={};function Je(e,t){var s=$e.hasOwnProperty(e)?$e[e]:$e[e]={};b(t,s)}function vt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var s={};for(var r in t){var m=t[r];m instanceof Array&&(m=m.concat([])),s[r]=m}return s}function St(e,t){for(var s;e.innerMode&&!(s=e.innerMode(t),!s||s.mode==e);)t=s.state,e=s.mode;return s||{mode:e,state:t}}function Rt(e,t,s){return e.startState?e.startState(t,s):!0}var mt=function(e,t,s){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=s};mt.prototype.eol=function(){return this.pos>=this.string.length},mt.prototype.sol=function(){return this.pos==this.lineStart},mt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},mt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},mt.prototype.eat=function(e){var t=this.string.charAt(this.pos),s;if(typeof e=="string"?s=t==e:s=t&&(e.test?e.test(t):e(t)),s)return++this.pos,t},mt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},mt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},mt.prototype.skipToEnd=function(){this.pos=this.string.length},mt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},mt.prototype.backUp=function(e){this.pos-=e},mt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=K(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?K(this.string,this.lineStart,this.tabSize):0)},mt.prototype.indentation=function(){return K(this.string,null,this.tabSize)-(this.lineStart?K(this.string,this.lineStart,this.tabSize):0)},mt.prototype.match=function(e,t,s){if(typeof e=="string"){var r=function(X){return s?X.toLowerCase():X},m=this.string.substr(this.pos,e.length);if(r(m)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var B=this.string.slice(this.pos).match(e);return B&&B.index>0?null:(B&&t!==!1&&(this.pos+=B[0].length),B)}},mt.prototype.current=function(){return this.string.slice(this.start,this.pos)},mt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},mt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},mt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ct(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var s=e;!s.lines;)for(var r=0;;++r){var m=s.children[r],B=m.chunkSize();if(t<B){s=m;break}t-=B}return s.lines[t]}function Vt(e,t,s){var r=[],m=t.line;return e.iter(t.line,s.line+1,function(B){var X=B.text;m==s.line&&(X=X.slice(0,s.ch)),m==t.line&&(X=X.slice(t.ch)),r.push(X),++m}),r}function jt(e,t,s){var r=[];return e.iter(t,s,function(m){r.push(m.text)}),r}function qt(e,t){var s=t-e.height;if(s)for(var r=e;r;r=r.parent)r.height+=s}function Wt(e){if(e.parent==null)return null;for(var t=e.parent,s=ne(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var m=0;!(r.children[m]==t);++m)s+=r.children[m].chunkSize();return s+t.first}function rn(e,t){var s=e.first;e:do{for(var r=0;r<e.children.length;++r){var m=e.children[r],B=m.height;if(t<B){e=m;continue e}t-=B,s+=m.chunkSize()}return s}while(!e.lines);for(var X=0;X<e.lines.length;++X){var q=e.lines[X],te=q.height;if(t<te)break;t-=te}return s+X}function On(e,t){return t>=e.first&&t<e.first+e.size}function Ln(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Qe(e,t,s){if(s===void 0&&(s=null),!(this instanceof Qe))return new Qe(e,t,s);this.line=e,this.ch=t,this.sticky=s}function ht(e,t){return e.line-t.line||e.ch-t.ch}function Qt(e,t){return e.sticky==t.sticky&&ht(e,t)==0}function pn(e){return Qe(e.line,e.ch)}function _n(e,t){return ht(e,t)<0?t:e}function fn(e,t){return ht(e,t)<0?e:t}function Y(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function R(e,t){if(t.line<e.first)return Qe(e.first,0);var s=e.first+e.size-1;return t.line>s?Qe(s,ct(e,s).text.length):k(t,ct(e,t.line).text.length)}function k(e,t){var s=e.ch;return s==null||s>t?Qe(e.line,t):s<0?Qe(e.line,0):e}function z(e,t){for(var s=[],r=0;r<t.length;r++)s[r]=R(e,t[r]);return s}var ie=function(e,t){this.state=e,this.lookAhead=t},J=function(e,t,s,r){this.state=t,this.doc=e,this.line=s,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};J.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},J.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}},J.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},J.fromSaved=function(e,t,s){return t instanceof ie?new J(e,vt(e.mode,t.state),s,t.lookAhead):new J(e,vt(e.mode,t),s)},J.prototype.save=function(e){var t=e!==!1?vt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ie(t,this.maxLookAhead):t};function De(e,t,s,r){var m=[e.state.modeGen],B={};kn(e,t.text,e.doc.mode,s,function(de,Ae){return m.push(de,Ae)},B,r);for(var X=s.state,q=function(de){s.baseTokens=m;var Ae=e.state.overlays[de],Ie=1,He=0;s.state=!0,kn(e,t.text,Ae.mode,s,function(We,Ze){for(var ot=Ie;He<We;){var pt=m[Ie];pt>We&&m.splice(Ie,1,We,m[Ie+1],pt),Ie+=2,He=Math.min(We,pt)}if(!Ze)return;if(Ae.opaque)m.splice(ot,Ie-ot,We,"overlay "+Ze),Ie=ot+2;else for(;ot<Ie;ot+=2){var Et=m[ot+1];m[ot+1]=(Et?Et+" ":"")+"overlay "+Ze}},B),s.state=X,s.baseTokens=null,s.baseTokenPos=1},te=0;te<e.state.overlays.length;++te)q(te);return{styles:m,classes:B.bgClass||B.textClass?B:null}}function qe(e,t,s){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=ft(e,Wt(t)),m=t.text.length>e.options.maxHighlightLength&&vt(e.doc.mode,r.state),B=De(e,t,r);m&&(r.state=m),t.stateAfter=r.save(!m),t.styles=B.styles,B.classes?t.styleClasses=B.classes:t.styleClasses&&(t.styleClasses=null),s===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ft(e,t,s){var r=e.doc,m=e.display;if(!r.mode.startState)return new J(r,!0,t);var B=Tn(e,t,s),X=B>r.first&&ct(r,B-1).stateAfter,q=X?J.fromSaved(r,X,B):new J(r,Rt(r.mode),B);return r.iter(B,t,function(te){Lt(e,te.text,q);var de=q.line;te.stateAfter=de==t-1||de%5==0||de>=m.viewFrom&&de<m.viewTo?q.save():null,q.nextLine()}),s&&(r.modeFrontier=q.line),q}function Lt(e,t,s,r){var m=e.doc.mode,B=new mt(t,e.options.tabSize,s);for(B.start=B.pos=r||0,t==""&&st(m,s.state);!B.eol();)Pt(m,B,s.state),B.start=B.pos}function st(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var s=St(e,t);if(s.mode.blankLine)return s.mode.blankLine(s.state)}function Pt(e,t,s,r){for(var m=0;m<10;m++){r&&(r[0]=St(e,s).mode);var B=e.token(t,s);if(t.pos>t.start)return B}throw new Error("Mode "+e.name+" failed to advance stream.")}var Ut=function(e,t,s){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=s};function mn(e,t,s,r){var m=e.doc,B=m.mode,X;t=R(m,t);var q=ct(m,t.line),te=ft(e,t.line,s),de=new mt(q.text,e.options.tabSize,te),Ae;for(r&&(Ae=[]);(r||de.pos<t.ch)&&!de.eol();)de.start=de.pos,X=Pt(B,de,te.state),r&&Ae.push(new Ut(de,X,vt(m.mode,te.state)));return r?Ae:new Ut(de,X,te.state)}function Fn(e,t){if(e)for(;;){var s=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!s)break;e=e.slice(0,s.index)+e.slice(s.index+s[0].length);var r=s[1]?"bgClass":"textClass";t[r]==null?t[r]=s[2]:new RegExp("(?:^|\\s)"+s[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+s[2])}return e}function kn(e,t,s,r,m,B,X){var q=s.flattenSpans;q==null&&(q=e.options.flattenSpans);var te=0,de=null,Ae=new mt(t,e.options.tabSize,r),Ie,He=e.options.addModeClass&&[null];for(t==""&&Fn(st(s,r.state),B);!Ae.eol();){if(Ae.pos>e.options.maxHighlightLength?(q=!1,X&&Lt(e,t,r,Ae.pos),Ae.pos=t.length,Ie=null):Ie=Fn(Pt(s,Ae,r.state,He),B),He){var We=He[0].name;We&&(Ie="m-"+(Ie?We+" "+Ie:We))}if(!q||de!=Ie){for(;te<Ae.start;)te=Math.min(Ae.start,te+5e3),m(te,de);de=Ie}Ae.start=Ae.pos}for(;te<Ae.pos;){var Ze=Math.min(Ae.pos,te+5e3);m(Ze,de),te=Ze}}function Tn(e,t,s){for(var r,m,B=e.doc,X=s?-1:t-(e.doc.mode.innerMode?1e3:100),q=t;q>X;--q){if(q<=B.first)return B.first;var te=ct(B,q-1),de=te.stateAfter;if(de&&(!s||q+(de instanceof ie?de.lookAhead:0)<=B.modeFrontier))return q;var Ae=K(te.text,null,e.options.tabSize);(m==null||r>Ae)&&(m=q-1,r=Ae)}return m}function er(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var s=e.first,r=t-1;r>s;r--){var m=ct(e,r).stateAfter;if(m&&(!(m instanceof ie)||r+m.lookAhead<t)){s=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,s)}var _r=!1,Kt=!1;function Bt(){_r=!0}function zt(){Kt=!0}function $t(e,t,s){this.marker=e,this.from=t,this.to=s}function Zt(e,t){if(e)for(var s=0;s<e.length;++s){var r=e[s];if(r.marker==t)return r}}function an(e,t){for(var s,r=0;r<e.length;++r)e[r]!=t&&(s||(s=[])).push(e[r]);return s}function bn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Pn(e,t,s){var r;if(e)for(var m=0;m<e.length;++m){var B=e[m],X=B.marker,q=B.from==null||(X.inclusiveLeft?B.from<=t:B.from<t);if(q||B.from==t&&X.type=="bookmark"&&(!s||!B.marker.insertLeft)){var te=B.to==null||(X.inclusiveRight?B.to>=t:B.to>t);(r||(r=[])).push(new $t(X,B.from,te?null:B.to))}}return r}function Un(e,t,s){var r;if(e)for(var m=0;m<e.length;++m){var B=e[m],X=B.marker,q=B.to==null||(X.inclusiveRight?B.to>=t:B.to>t);if(q||B.from==t&&X.type=="bookmark"&&(!s||B.marker.insertLeft)){var te=B.from==null||(X.inclusiveLeft?B.from<=t:B.from<t);(r||(r=[])).push(new $t(X,te?null:B.from-t,B.to==null?null:B.to-t))}}return r}function Cn(e,t){if(t.full)return null;var s=On(e,t.from.line)&&ct(e,t.from.line).markedSpans,r=On(e,t.to.line)&&ct(e,t.to.line).markedSpans;if(!s&&!r)return null;var m=t.from.ch,B=t.to.ch,X=ht(t.from,t.to)==0,q=Pn(s,m,X),te=Un(r,B,X),de=t.text.length==1,Ae=Z(t.text).length+(de?m:0);if(q)for(var Ie=0;Ie<q.length;++Ie){var He=q[Ie];if(He.to==null){var We=Zt(te,He.marker);We?de&&(He.to=We.to==null?null:We.to+Ae):He.to=m}}if(te)for(var Ze=0;Ze<te.length;++Ze){var ot=te[Ze];if(ot.to!=null&&(ot.to+=Ae),ot.from==null){var pt=Zt(q,ot.marker);pt||(ot.from=Ae,de&&(q||(q=[])).push(ot))}else ot.from+=Ae,de&&(q||(q=[])).push(ot)}q&&(q=Bn(q)),te&&te!=q&&(te=Bn(te));var Et=[q];if(!de){var Ot=t.text.length-2,xt;if(Ot>0&&q)for(var Dt=0;Dt<q.length;++Dt)q[Dt].to==null&&(xt||(xt=[])).push(new $t(q[Dt].marker,null,null));for(var Ht=0;Ht<Ot;++Ht)Et.push(xt);Et.push(te)}return Et}function Bn(e){for(var t=0;t<e.length;++t){var s=e[t];s.from!=null&&s.from==s.to&&s.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function tr(e,t,s){var r=null;if(e.iter(t.line,s.line+1,function(We){if(We.markedSpans)for(var Ze=0;Ze<We.markedSpans.length;++Ze){var ot=We.markedSpans[Ze].marker;ot.readOnly&&(!r||ne(r,ot)==-1)&&(r||(r=[])).push(ot)}}),!r)return null;for(var m=[{from:t,to:s}],B=0;B<r.length;++B)for(var X=r[B],q=X.find(0),te=0;te<m.length;++te){var de=m[te];if(ht(de.to,q.from)<0||ht(de.from,q.to)>0)continue;var Ae=[te,1],Ie=ht(de.from,q.from),He=ht(de.to,q.to);(Ie<0||!X.inclusiveLeft&&!Ie)&&Ae.push({from:de.from,to:q.from}),(He>0||!X.inclusiveRight&&!He)&&Ae.push({from:q.to,to:de.to}),m.splice.apply(m,Ae),te+=Ae.length-3}return m}function Er(e){var t=e.markedSpans;if(!t)return;for(var s=0;s<t.length;++s)t[s].marker.detachLine(e);e.markedSpans=null}function nr(e,t){if(!t)return;for(var s=0;s<t.length;++s)t[s].marker.attachLine(e);e.markedSpans=t}function dn(e){return e.inclusiveLeft?-1:0}function Xt(e){return e.inclusiveRight?1:0}function wn(e,t){var s=e.lines.length-t.lines.length;if(s!=0)return s;var r=e.find(),m=t.find(),B=ht(r.from,m.from)||dn(e)-dn(t);if(B)return-B;var X=ht(r.to,m.to)||Xt(e)-Xt(t);return X||t.id-e.id}function Yt(e,t){var s=Kt&&e.markedSpans,r;if(s)for(var m=void 0,B=0;B<s.length;++B)m=s[B],m.marker.collapsed&&(t?m.from:m.to)==null&&(!r||wn(r,m.marker)<0)&&(r=m.marker);return r}function sn(e){return Yt(e,!0)}function on(e){return Yt(e,!1)}function rr(e,t){var s=Kt&&e.markedSpans,r;if(s)for(var m=0;m<s.length;++m){var B=s[m];B.marker.collapsed&&(B.from==null||B.from<t)&&(B.to==null||B.to>t)&&(!r||wn(r,B.marker)<0)&&(r=B.marker)}return r}function Mn(e,t,s,r,m){var B=ct(e,t),X=Kt&&B.markedSpans;if(X)for(var q=0;q<X.length;++q){var te=X[q];if(!te.marker.collapsed)continue;var de=te.marker.find(0),Ae=ht(de.from,s)||dn(te.marker)-dn(m),Ie=ht(de.to,r)||Xt(te.marker)-Xt(m);if(Ae>=0&&Ie<=0||Ae<=0&&Ie>=0)continue;if(Ae<=0&&(te.marker.inclusiveRight&&m.inclusiveLeft?ht(de.to,s)>=0:ht(de.to,s)>0)||Ae>=0&&(te.marker.inclusiveRight&&m.inclusiveLeft?ht(de.from,r)<=0:ht(de.from,r)<0))return!0}}function nn(e){for(var t;t=sn(e);)e=t.find(-1,!0).line;return e}function xr(e){for(var t;t=on(e);)e=t.find(1,!0).line;return e}function Qn(e){for(var t,s;t=on(e);)e=t.find(1,!0).line,(s||(s=[])).push(e);return s}function Dr(e,t){var s=ct(e,t),r=nn(s);return s==r?t:Wt(r)}function wr(e,t){if(t>e.lastLine())return t;var s=ct(e,t),r;if(!Tr(e,s))return t;for(;r=on(s);)s=r.find(1,!0).line;return Wt(s)+1}function Tr(e,t){var s=Kt&&t.markedSpans;if(s)for(var r=void 0,m=0;m<s.length;++m){if(r=s[m],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&Mr(e,t,r))return!0}}function Mr(e,t,s){if(s.to==null){var r=s.marker.find(1,!0);return Mr(e,r.line,Zt(r.line.markedSpans,s.marker))}if(s.marker.inclusiveRight&&s.to==t.text.length)return!0;for(var m=void 0,B=0;B<t.markedSpans.length;++B)if(m=t.markedSpans[B],m.marker.collapsed&&!m.marker.widgetNode&&m.from==s.to&&(m.to==null||m.to!=s.from)&&(m.marker.inclusiveLeft||s.marker.inclusiveRight)&&Mr(e,t,m))return!0}function gr(e){e=nn(e);for(var t=0,s=e.parent,r=0;r<s.lines.length;++r){var m=s.lines[r];if(m==e)break;t+=m.height}for(var B=s.parent;B;s=B,B=s.parent)for(var X=0;X<B.children.length;++X){var q=B.children[X];if(q==s)break;t+=q.height}return t}function Nr(e){if(e.height==0)return 0;for(var t=e.text.length,s,r=e;s=sn(r);){var m=s.find(0,!0);r=m.from.line,t+=m.from.ch-m.to.ch}for(r=e;s=on(r);){var B=s.find(0,!0);t-=r.text.length-B.from.ch,r=B.to.line,t+=r.text.length-B.to.ch}return t}function Fr(e){var t=e.display,s=e.doc;t.maxLine=ct(s,s.first),t.maxLineLength=Nr(t.maxLine),t.maxLineChanged=!0,s.iter(function(r){var m=Nr(r);m>t.maxLineLength&&(t.maxLineLength=m,t.maxLine=r)})}var cr=function(e,t,s){this.text=e,nr(this,t),this.height=s?s(this):1};cr.prototype.lineNo=function(){return Wt(this)},ve(cr);function Yr(e,t,s,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Er(e),nr(e,s);var m=r?r(e):1;m!=e.height&&qt(e,m)}function kt(e){e.parent=null,Er(e)}var Gt={},Mt={};function Jt(e,t){if(!e||/^\s*$/.test(e))return null;var s=t.addModeClass?Mt:Gt;return s[e]||(s[e]=e.replace(/\S+/g,"cm-$&"))}function un(e,t){var s=E("span",null,null,n?"padding-right: .1px":null),r={pre:E("pre",[s],"CodeMirror-line"),content:s,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var m=0;m<=(t.rest?t.rest.length:0);m++){var B=m?t.rest[m-1]:t.line,X=void 0;r.pos=0,r.addToken=ln,yt(e.display.measure)&&(X=lt(B,e.doc.direction))&&(r.addToken=$n(r.addToken,X)),r.map=[];var q=t!=e.display.externalMeasured&&Wt(B);vr(B,r,qe(e,B,q)),B.styleClasses&&(B.styleClasses.bgClass&&(r.bgClass=S(B.styleClasses.bgClass,r.bgClass||"")),B.styleClasses.textClass&&(r.textClass=S(B.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(it(e.display.measure))),m==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var te=r.content.lastChild;(/\bcm-tab\b/.test(te.className)||te.querySelector&&te.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return je(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=S(r.pre.className,r.textClass||"")),r}function En(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ln(e,t,s,r,m,B,X){if(!t)return;var q=e.splitSpaces?Dn(t,e.trailingSpace):t,te=e.cm.state.specialChars,de=!1,Ae;if(!te.test(t))e.col+=t.length,Ae=document.createTextNode(q),e.map.push(e.pos,e.pos+t.length,Ae),G&&W<9&&(de=!0),e.pos+=t.length;else{Ae=document.createDocumentFragment();for(var Ie=0;;){te.lastIndex=Ie;var He=te.exec(t),We=He?He.index-Ie:t.length-Ie;if(We){var Ze=document.createTextNode(q.slice(Ie,Ie+We));G&&W<9?Ae.appendChild(c("span",[Ze])):Ae.appendChild(Ze),e.map.push(e.pos,e.pos+We,Ze),e.col+=We,e.pos+=We}if(!He)break;Ie+=We+1;var ot=void 0;if(He[0]==" "){var pt=e.cm.options.tabSize,Et=pt-e.col%pt;ot=Ae.appendChild(c("span",le(Et),"cm-tab")),ot.setAttribute("role","presentation"),ot.setAttribute("cm-text"," "),e.col+=Et}else He[0]=="\r"||He[0]==`
`?(ot=Ae.appendChild(c("span",He[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ot.setAttribute("cm-text",He[0]),e.col+=1):(ot=e.cm.options.specialCharPlaceholder(He[0]),ot.setAttribute("cm-text",He[0]),G&&W<9?Ae.appendChild(c("span",[ot])):Ae.appendChild(ot),e.col+=1);e.map.push(e.pos,e.pos+1,ot),e.pos++}}if(e.trailingSpace=q.charCodeAt(t.length-1)==32,s||r||m||de||B||X){var Ot=s||"";r&&(Ot+=r),m&&(Ot+=m);var xt=c("span",[Ae],Ot,B);if(X)for(var Dt in X)X.hasOwnProperty(Dt)&&Dt!="style"&&Dt!="class"&&xt.setAttribute(Dt,X[Dt]);return e.content.appendChild(xt)}e.content.appendChild(Ae)}function Dn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var s=t,r="",m=0;m<e.length;m++){var B=e.charAt(m);B==" "&&s&&(m==e.length-1||e.charCodeAt(m+1)==32)&&(B="\xA0"),r+=B,s=B==" "}return r}function $n(e,t){return function(s,r,m,B,X,q,te){m=m?m+" cm-force-border":"cm-force-border";for(var de=s.pos,Ae=de+r.length;;){for(var Ie=void 0,He=0;He<t.length&&!(Ie=t[He],Ie.to>de&&Ie.from<=de);He++);if(Ie.to>=Ae)return e(s,r,m,B,X,q,te);e(s,r.slice(0,Ie.to-de),m,B,null,q,te),B=null,r=r.slice(Ie.to-de),de=Ie.to}}}function en(e,t,s,r){var m=!r&&s.widgetNode;m&&e.map.push(e.pos,e.pos+t,m),!r&&e.cm.display.input.needsContentAttribute&&(m||(m=e.content.appendChild(document.createElement("span"))),m.setAttribute("cm-marker",s.id)),m&&(e.cm.display.input.setUneditable(m),e.content.appendChild(m)),e.pos+=t,e.trailingSpace=!1}function vr(e,t,s){var r=e.markedSpans,m=e.text,B=0;if(!r){for(var X=1;X<s.length;X+=2)t.addToken(t,m.slice(B,B=s[X]),Jt(s[X+1],t.cm.options));return}for(var q=m.length,te=0,de=1,Ae="",Ie,He,We=0,Ze,ot,pt,Et,Ot;;){if(We==te){Ze=ot=pt=He="",Ot=null,Et=null,We=Infinity;for(var xt=[],Dt=void 0,Ht=0;Ht<r.length;++Ht){var Ft=r[Ht],tn=Ft.marker;if(tn.type=="bookmark"&&Ft.from==te&&tn.widgetNode)xt.push(tn);else if(Ft.from<=te&&(Ft.to==null||Ft.to>te||tn.collapsed&&Ft.to==te&&Ft.from==te)){if(Ft.to!=null&&Ft.to!=te&&We>Ft.to&&(We=Ft.to,ot=""),tn.className&&(Ze+=" "+tn.className),tn.css&&(He=(He?He+";":"")+tn.css),tn.startStyle&&Ft.from==te&&(pt+=" "+tn.startStyle),tn.endStyle&&Ft.to==We&&(Dt||(Dt=[])).push(tn.endStyle,Ft.to),tn.title&&((Ot||(Ot={})).title=tn.title),tn.attributes)for(var Sn in tn.attributes)(Ot||(Ot={}))[Sn]=tn.attributes[Sn];tn.collapsed&&(!Et||wn(Et.marker,tn)<0)&&(Et=Ft)}else Ft.from>te&&We>Ft.from&&(We=Ft.from)}if(Dt)for(var Xn=0;Xn<Dt.length;Xn+=2)Dt[Xn+1]==We&&(ot+=" "+Dt[Xn]);if(!Et||Et.from==te)for(var Rn=0;Rn<xt.length;++Rn)en(t,0,xt[Rn]);if(Et&&(Et.from||0)==te){if(en(t,(Et.to==null?q+1:Et.to)-te,Et.marker,Et.from==null),Et.to==null)return;Et.to==te&&(Et=!1)}}if(te>=q)break;for(var mr=Math.min(q,We);;){if(Ae){var lr=te+Ae.length;if(!Et){var jn=lr>mr?Ae.slice(0,mr-te):Ae;t.addToken(t,jn,Ie?Ie+Ze:Ze,pt,te+jn.length==We?ot:"",He,Ot)}if(lr>=mr){Ae=Ae.slice(mr-te),te=mr;break}te=lr,pt=""}Ae=m.slice(B,B=s[de++]),Ie=Jt(s[de++],t.cm.options)}}}function gn(e,t,s){this.line=t,this.rest=Qn(t),this.size=this.rest?Wt(Z(this.rest))-s+1:1,this.node=this.text=null,this.hidden=Tr(e,t)}function Kn(e,t,s){for(var r=[],m,B=t;B<s;B=m){var X=new gn(e.doc,ct(e.doc,B),B);m=B+X.size,r.push(X)}return r}var Gn=null;function hr(e){Gn?Gn.ops.push(e):e.ownsGroup=Gn={ops:[e],delayedCallbacks:[]}}function ma(e){var t=e.delayedCallbacks,s=0;do{for(;s<t.length;s++)t[s].call(null);for(var r=0;r<e.ops.length;r++){var m=e.ops[r];if(m.cursorActivityHandlers)for(;m.cursorActivityCalled<m.cursorActivityHandlers.length;)m.cursorActivityHandlers[m.cursorActivityCalled++].call(null,m.cm)}}while(s<t.length)}function vn(e,t){var s=e.ownsGroup;if(!s)return;try{ma(s)}finally{Gn=null,t(s)}}var cn=null;function hn(e,t){var s=ze(e,t);if(!s.length)return;var r=Array.prototype.slice.call(arguments,2),m;Gn?m=Gn.delayedCallbacks:cn?m=cn:(m=cn=[],setTimeout(fr,0));for(var B=function(q){m.push(function(){return s[q].apply(null,r)})},X=0;X<s.length;++X)B(X)}function fr(){var e=cn;cn=null;for(var t=0;t<e.length;++t)e[t]()}function Ur(e,t,s,r){for(var m=0;m<t.changes.length;m++){var B=t.changes[m];B=="text"?ga(e,t):B=="gutter"?ts(e,t,s,r):B=="class"?va(e,t):B=="widget"&&Mo(e,t,r)}t.changes=null}function Br(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),G&&W<8&&(e.node.style.zIndex=2)),e.node}function xi(e,t){var s=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(s&&(s+=" CodeMirror-linebackground"),t.background)s?t.background.className=s:(t.background.parentNode.removeChild(t.background),t.background=null);else if(s){var r=Br(t);t.background=r.insertBefore(c("div",null,s),r.firstChild),e.display.input.setUneditable(t.background)}}function Vi(e,t){var s=e.display.externalMeasured;return s&&s.line==t.line?(e.display.externalMeasured=null,t.measure=s.measure,s.built):un(e,t)}function ga(e,t){var s=t.text.className,r=Vi(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,va(e,t)):s&&(t.text.className=s)}function va(e,t){xi(e,t),t.line.wrapClass?Br(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var s=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=s||""}function ts(e,t,s,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var m=Br(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),m.insertBefore(t.gutterBackground,t.text)}var B=t.line.gutterMarkers;if(e.options.lineNumbers||B){var X=Br(t),q=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(q),X.insertBefore(q,t.text),t.line.gutterClass&&(q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!B||!B["CodeMirror-linenumbers"])&&(t.lineNumber=q.appendChild(c("div",Ln(e.options,s),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),B)for(var te=0;te<e.display.gutterSpecs.length;++te){var de=e.display.gutterSpecs[te].className,Ae=B.hasOwnProperty(de)&&B[de];Ae&&q.appendChild(c("div",[Ae],"CodeMirror-gutter-elt","left: "+r.gutterLeft[de]+"px; width: "+r.gutterWidth[de]+"px"))}}}function Mo(e,t,s){t.alignable&&(t.alignable=null);for(var r=A("CodeMirror-linewidget"),m=t.node.firstChild,B=void 0;m;m=B)B=m.nextSibling,r.test(m.className)&&t.node.removeChild(m);ns(e,t,s)}function No(e,t,s,r){var m=Vi(e,t);return t.text=t.node=m.pre,m.bgClass&&(t.bgClass=m.bgClass),m.textClass&&(t.textClass=m.textClass),va(e,t),ts(e,t,s,r),ns(e,t,r),t.node}function ns(e,t,s){if(rs(e,t.line,t,s,!0),t.rest)for(var r=0;r<t.rest.length;r++)rs(e,t.rest[r],t,s,!1)}function rs(e,t,s,r,m){if(!t.widgets)return;for(var B=Br(s),X=0,q=t.widgets;X<q.length;++X){var te=q[X],de=c("div",[te.node],"CodeMirror-linewidget"+(te.className?" "+te.className:""));te.handleMouseEvents||de.setAttribute("cm-ignore-events","true"),Fo(te,de,s,r),e.display.input.setUneditable(de),m&&te.above?B.insertBefore(de,s.gutter||s.text):B.appendChild(de),hn(te,"redraw")}}function Fo(e,t,s,r){if(e.noHScroll){(s.alignable||(s.alignable=[])).push(t);var m=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(m-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=m+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Ti(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!x(document.body,e.node)){var s="position: relative;";e.coverGutter&&(s+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(s+="width: "+t.display.wrapper.clientWidth+"px;"),v(t.display.measure,c("div",[e.node],null,s))}return e.height=e.node.parentNode.offsetHeight}function Ir(e,t){for(var s=Oe(t);s!=e.wrapper;s=s.parentNode)if(!s||s.nodeType==1&&s.getAttribute("cm-ignore-events")=="true"||s.parentNode==e.sizer&&s!=e.mover)return!0}function Xi(e){return e.lineSpace.offsetTop}function ya(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function is(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=v(e.measure,c("pre","x","CodeMirror-line-like")),s=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(s.paddingLeft),right:parseInt(s.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Ar(e){return fe-e.display.nativeBarWidth}function $r(e){return e.display.scroller.clientWidth-Ar(e)-e.display.barWidth}function ba(e){return e.display.scroller.clientHeight-Ar(e)-e.display.barHeight}function Uo(e,t,s){var r=e.options.lineWrapping,m=r&&$r(e);if(!t.measure.heights||r&&t.measure.width!=m){var B=t.measure.heights=[];if(r){t.measure.width=m;for(var X=t.text.firstChild.getClientRects(),q=0;q<X.length-1;q++){var te=X[q],de=X[q+1];Math.abs(te.bottom-de.bottom)>2&&B.push((te.bottom+de.top)/2-s.top)}}B.push(s.bottom-s.top)}}function as(e,t,s){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var m=0;m<e.rest.length;m++)if(Wt(e.rest[m])>s)return{map:e.measure.maps[m],cache:e.measure.caches[m],before:!0}}function Bo(e,t){t=nn(t);var s=Wt(t),r=e.display.externalMeasured=new gn(e.doc,t,s);r.lineN=s;var m=r.built=un(e,r);return r.text=m.pre,v(e.display.lineMeasure,m.pre),r}function ss(e,t,s,r){return Rr(e,ai(e,t),s,r)}function _a(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Zr(e,t)];var s=e.display.externalMeasured;if(s&&t>=s.lineN&&t<s.lineN+s.size)return s}function ai(e,t){var s=Wt(t),r=_a(e,s);r&&!r.text?r=null:r&&r.changes&&(Ur(e,r,s,Ca(e)),e.curOp.forceUpdate=!0),r||(r=Bo(e,t));var m=as(r,t,s);return{line:t,view:r,rect:null,map:m.map,cache:m.cache,before:m.before,hasHeights:!1}}function Rr(e,t,s,r,m){t.before&&(s=-1);var B=s+(r||""),X;return t.cache.hasOwnProperty(B)?X=t.cache[B]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Uo(e,t.view,t.rect),t.hasHeights=!0),X=Wo(e,t,s,r),X.bogus||(t.cache[B]=X)),{left:X.left,right:X.right,top:m?X.rtop:X.top,bottom:m?X.rbottom:X.bottom}}var os={left:0,right:0,top:0,bottom:0};function ls(e,t,s){for(var r,m,B,X,q,te,de=0;de<e.length;de+=3)if(q=e[de],te=e[de+1],t<q?(m=0,B=1,X="left"):t<te?(m=t-q,B=m+1):(de==e.length-3||t==te&&e[de+3]>t)&&(B=te-q,m=B-1,t>=te&&(X="right")),m!=null){if(r=e[de+2],q==te&&s==(r.insertLeft?"left":"right")&&(X=s),s=="left"&&m==0)for(;de&&e[de-2]==e[de-3]&&e[de-1].insertLeft;)r=e[(de-=3)+2],X="left";if(s=="right"&&m==te-q)for(;de<e.length-3&&e[de+3]==e[de+4]&&!e[de+5].insertLeft;)r=e[(de+=3)+2],X="right";break}return{node:r,start:m,end:B,collapse:X,coverStart:q,coverEnd:te}}function jo(e,t){var s=os;if(t=="left")for(var r=0;r<e.length&&!((s=e[r]).left!=s.right);r++);else for(var m=e.length-1;m>=0&&!((s=e[m]).left!=s.right);m--);return s}function Wo(e,t,s,r){var m=ls(t.map,s,r),B=m.node,X=m.start,q=m.end,te=m.collapse,de;if(B.nodeType==3){for(var Ae=0;Ae<4;Ae++){for(;X&&ke(t.line.text.charAt(m.coverStart+X));)--X;for(;m.coverStart+q<m.coverEnd&&ke(t.line.text.charAt(m.coverStart+q));)++q;if(G&&W<9&&X==0&&q==m.coverEnd-m.coverStart?de=B.parentNode.getBoundingClientRect():de=jo(h(B,X,q).getClientRects(),r),de.left||de.right||X==0)break;q=X,X=X-1,te="right"}G&&W<11&&(de=Ho(e.display.measure,de))}else{X>0&&(te=r="right");var Ie;e.options.lineWrapping&&(Ie=B.getClientRects()).length>1?de=Ie[r=="right"?Ie.length-1:0]:de=B.getBoundingClientRect()}if(G&&W<9&&!X&&(!de||!de.left&&!de.right)){var He=B.parentNode.getClientRects()[0];He?de={left:He.left,right:He.left+oi(e.display),top:He.top,bottom:He.bottom}:de=os}for(var We=de.top-t.rect.top,Ze=de.bottom-t.rect.top,ot=(We+Ze)/2,pt=t.view.measure.heights,Et=0;Et<pt.length-1&&!(ot<pt[Et]);Et++);var Ot=Et?pt[Et-1]:0,xt=pt[Et],Dt={left:(te=="right"?de.right:de.left)-t.rect.left,right:(te=="left"?de.left:de.right)-t.rect.left,top:Ot,bottom:xt};return!de.left&&!de.right&&(Dt.bogus=!0),e.options.singleCursorHeightPerLine||(Dt.rtop=We,Dt.rbottom=Ze),Dt}function Ho(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ct(e))return t;var s=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*s,right:t.right*s,top:t.top*r,bottom:t.bottom*r}}function us(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 ds(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)us(e.display.view[t])}function wi(e){ds(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function cs(){return y&&u?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function hs(){return y&&u?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ea(e){var t=0;if(e.widgets)for(var s=0;s<e.widgets.length;++s)e.widgets[s].above&&(t+=Ti(e.widgets[s]));return t}function Yi(e,t,s,r,m){if(!m){var B=Ea(t);s.top+=B,s.bottom+=B}if(r=="line")return s;r||(r="local");var X=gr(t);if(r=="local"?X+=Xi(e.display):X-=e.display.viewOffset,r=="page"||r=="window"){var q=e.display.lineSpace.getBoundingClientRect();X+=q.top+(r=="window"?0:hs());var te=q.left+(r=="window"?0:cs());s.left+=te,s.right+=te}return s.top+=X,s.bottom+=X,s}function fs(e,t,s){if(s=="div")return t;var r=t.left,m=t.top;if(s=="page")r-=cs(),m-=hs();else if(s=="local"||!s){var B=e.display.sizer.getBoundingClientRect();r+=B.left,m+=B.top}var X=e.display.lineSpace.getBoundingClientRect();return{left:r-X.left,top:m-X.top}}function xa(e,t,s,r,m){return r||(r=ct(e.doc,t.line)),Yi(e,r,ss(e,r,t.ch,m),s)}function Sr(e,t,s,r,m,B){r=r||ct(e.doc,t.line),m||(m=ai(e,r));function X(Ze,ot){var pt=Rr(e,m,Ze,ot?"right":"left",B);return ot?pt.left=pt.right:pt.right=pt.left,Yi(e,r,pt,s)}var q=lt(r,e.doc.direction),te=t.ch,de=t.sticky;if(te>=r.text.length?(te=r.text.length,de="before"):te<=0&&(te=0,de="after"),!q)return X(de=="before"?te-1:te,de=="before");function Ae(Ze,ot,pt){var Et=q[ot],Ot=Et.level==1;return X(pt?Ze-1:Ze,Ot!=pt)}var Ie=rt(q,te,de),He=tt,We=Ae(te,Ie,de=="before");return He!=null&&(We.other=Ae(te,He,de!="before")),We}function ps(e,t){var s=0;t=R(e.doc,t),e.options.lineWrapping||(s=oi(e.display)*t.ch);var r=ct(e.doc,t.line),m=gr(r)+Xi(e.display);return{left:s,right:s,top:m,bottom:m+r.height}}function Ta(e,t,s,r,m){var B=Qe(e,t,s);return B.xRel=m,r&&(B.outside=r),B}function wa(e,t,s){var r=e.doc;if(s+=e.display.viewOffset,s<0)return Ta(r.first,0,null,-1,-1);var m=rn(r,s),B=r.first+r.size-1;if(m>B)return Ta(r.first+r.size-1,ct(r,B).text.length,null,1,1);t<0&&(t=0);for(var X=ct(r,m);;){var q=Ko(e,X,m,t,s),te=rr(X,q.ch+(q.xRel>0||q.outside>0?1:0));if(!te)return q;var de=te.find(1);if(de.line==m)return de;X=ct(r,m=de.line)}}function ms(e,t,s,r){r-=Ea(t);var m=t.text.length,B=Ge(function(X){return Rr(e,s,X-1).bottom<=r},m,0);return m=Ge(function(X){return Rr(e,s,X).top>r},B,m),{begin:B,end:m}}function gs(e,t,s,r){s||(s=ai(e,t));var m=Yi(e,t,Rr(e,s,r),"line").top;return ms(e,t,s,m)}function Sa(e,t,s,r){return e.bottom<=s?!1:e.top>s?!0:(r?e.left:e.right)>t}function Ko(e,t,s,r,m){m-=gr(t);var B=ai(e,t),X=Ea(t),q=0,te=t.text.length,de=!0,Ae=lt(t,e.doc.direction);if(Ae){var Ie=(e.options.lineWrapping?zo:Go)(e,t,s,B,Ae,r,m);de=Ie.level!=1,q=de?Ie.from:Ie.to-1,te=de?Ie.to:Ie.from-1}var He=null,We=null,Ze=Ge(function(Ht){var Ft=Rr(e,B,Ht);return Ft.top+=X,Ft.bottom+=X,Sa(Ft,r,m,!1)?(Ft.top<=m&&Ft.left<=r&&(He=Ht,We=Ft),!0):!1},q,te),ot,pt,Et=!1;if(We){var Ot=r-We.left<We.right-r,xt=Ot==de;Ze=He+(xt?0:1),pt=xt?"after":"before",ot=Ot?We.left:We.right}else{!de&&(Ze==te||Ze==q)&&Ze++,pt=Ze==0?"after":Ze==t.text.length?"before":Rr(e,B,Ze-(de?1:0)).bottom+X<=m==de?"after":"before";var Dt=Sr(e,Qe(s,Ze,pt),"line",t,B);ot=Dt.left,Et=m<Dt.top?-1:m>=Dt.bottom?1:0}return Ze=Le(t.text,Ze,1),Ta(s,Ze,pt,Et,r-ot)}function Go(e,t,s,r,m,B,X){var q=Ge(function(Ie){var He=m[Ie],We=He.level!=1;return Sa(Sr(e,Qe(s,We?He.to:He.from,We?"before":"after"),"line",t,r),B,X,!0)},0,m.length-1),te=m[q];if(q>0){var de=te.level!=1,Ae=Sr(e,Qe(s,de?te.from:te.to,de?"after":"before"),"line",t,r);Sa(Ae,B,X,!0)&&Ae.top>X&&(te=m[q-1])}return te}function zo(e,t,s,r,m,B,X){var q=ms(e,t,r,X),te=q.begin,de=q.end;/\s/.test(t.text.charAt(de-1))&&de--;for(var Ae=null,Ie=null,He=0;He<m.length;He++){var We=m[He];if(We.from>=de||We.to<=te)continue;var Ze=We.level!=1,ot=Rr(e,r,Ze?Math.min(de,We.to)-1:Math.max(te,We.from)).right,pt=ot<B?B-ot+1e9:ot-B;(!Ae||Ie>pt)&&(Ae=We,Ie=pt)}return Ae||(Ae=m[m.length-1]),Ae.from<te&&(Ae={from:te,to:Ae.to,level:Ae.level}),Ae.to>de&&(Ae={from:Ae.from,to:de,level:Ae.level}),Ae}var Jr;function si(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Jr==null){Jr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Jr.appendChild(document.createTextNode("x")),Jr.appendChild(c("br"));Jr.appendChild(document.createTextNode("x"))}v(e.measure,Jr);var s=Jr.offsetHeight/50;return s>3&&(e.cachedTextHeight=s),T(e.measure),s||1}function oi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),s=c("pre",[t],"CodeMirror-line-like");v(e.measure,s);var r=t.getBoundingClientRect(),m=(r.right-r.left)/10;return m>2&&(e.cachedCharWidth=m),m||10}function Ca(e){for(var t=e.display,s={},r={},m=t.gutters.clientLeft,B=t.gutters.firstChild,X=0;B;B=B.nextSibling,++X){var q=e.display.gutterSpecs[X].className;s[q]=B.offsetLeft+B.clientLeft+m,r[q]=B.clientWidth}return{fixedPos:Oa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:s,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Oa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function vs(e){var t=si(e.display),s=e.options.lineWrapping,r=s&&Math.max(5,e.display.scroller.clientWidth/oi(e.display)-3);return function(m){if(Tr(e.doc,m))return 0;var B=0;if(m.widgets)for(var X=0;X<m.widgets.length;X++)m.widgets[X].height&&(B+=m.widgets[X].height);return s?B+(Math.ceil(m.text.length/r)||1)*t:B+t}}function Aa(e){var t=e.doc,s=vs(e);t.iter(function(r){var m=s(r);m!=r.height&&qt(r,m)})}function Qr(e,t,s,r){var m=e.display;if(!s&&Oe(t).getAttribute("cm-not-content")=="true")return null;var B,X,q=m.lineSpace.getBoundingClientRect();try{B=t.clientX-q.left,X=t.clientY-q.top}catch(Ie){return null}var te=wa(e,B,X),de;if(r&&te.xRel>0&&(de=ct(e.doc,te.line).text).length==te.ch){var Ae=K(de,de.length,e.options.tabSize)-de.length;te=Qe(te.line,Math.max(0,Math.round((B-is(e.display).left)/oi(e.display))-Ae))}return te}function Zr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var s=e.display.view,r=0;r<s.length;r++)if(t-=s[r].size,t<0)return r}function sr(e,t,s,r){t==null&&(t=e.doc.first),s==null&&(s=e.doc.first+e.doc.size),r||(r=0);var m=e.display;if(r&&s<m.viewTo&&(m.updateLineNumbers==null||m.updateLineNumbers>t)&&(m.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=m.viewTo)Kt&&Dr(e.doc,t)<m.viewTo&&Wr(e);else if(s<=m.viewFrom)Kt&&wr(e.doc,s+r)>m.viewFrom?Wr(e):(m.viewFrom+=r,m.viewTo+=r);else if(t<=m.viewFrom&&s>=m.viewTo)Wr(e);else if(t<=m.viewFrom){var B=$i(e,s,s+r,1);B?(m.view=m.view.slice(B.index),m.viewFrom=B.lineN,m.viewTo+=r):Wr(e)}else if(s>=m.viewTo){var X=$i(e,t,t,-1);X?(m.view=m.view.slice(0,X.index),m.viewTo=X.lineN):Wr(e)}else{var q=$i(e,t,t,-1),te=$i(e,s,s+r,1);q&&te?(m.view=m.view.slice(0,q.index).concat(Kn(e,q.lineN,te.lineN)).concat(m.view.slice(te.index)),m.viewTo+=r):Wr(e)}var de=m.externalMeasured;de&&(s<de.lineN?de.lineN+=r:t<de.lineN+de.size&&(m.externalMeasured=null))}function jr(e,t,s){e.curOp.viewChanged=!0;var r=e.display,m=e.display.externalMeasured;if(m&&t>=m.lineN&&t<m.lineN+m.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var B=r.view[Zr(e,t)];if(B.node==null)return;var X=B.changes||(B.changes=[]);ne(X,s)==-1&&X.push(s)}function Wr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function $i(e,t,s,r){var m=Zr(e,t),B,X=e.display.view;if(!Kt||s==e.doc.first+e.doc.size)return{index:m,lineN:s};for(var q=e.display.viewFrom,te=0;te<m;te++)q+=X[te].size;if(q!=t){if(r>0){if(m==X.length-1)return null;B=q+X[m].size-t,m++}else B=q-t;t+=B,s+=B}for(;Dr(e.doc,s)!=s;){if(m==(r<0?0:X.length-1))return null;s+=r*X[m-(r<0?1:0)].size,m+=r}return{index:m,lineN:s}}function Vo(e,t,s){var r=e.display,m=r.view;m.length==0||t>=r.viewTo||s<=r.viewFrom?(r.view=Kn(e,t,s),r.viewFrom=t):(r.viewFrom>t?r.view=Kn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Zr(e,t))),r.viewFrom=t,r.viewTo<s?r.view=r.view.concat(Kn(e,r.viewTo,s)):r.viewTo>s&&(r.view=r.view.slice(0,Zr(e,s)))),r.viewTo=s}function ys(e){for(var t=e.display.view,s=0,r=0;r<t.length;r++){var m=t[r];!m.hidden&&(!m.node||m.changes)&&++s}return s}function Si(e){e.display.input.showSelection(e.display.input.prepareSelection())}function bs(e,t){t===void 0&&(t=!0);for(var s=e.doc,r={},m=r.cursors=document.createDocumentFragment(),B=r.selection=document.createDocumentFragment(),X=0;X<s.sel.ranges.length;X++){if(!t&&X==s.sel.primIndex)continue;var q=s.sel.ranges[X];if(q.from().line>=e.display.viewTo||q.to().line<e.display.viewFrom)continue;var te=q.empty();(te||e.options.showCursorWhenSelecting)&&_s(e,q.head,m),te||Xo(e,q,B)}return r}function _s(e,t,s){var r=Sr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),m=s.appendChild(c("div","\xA0","CodeMirror-cursor"));if(m.style.left=r.left+"px",m.style.top=r.top+"px",m.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var B=s.appendChild(c("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));B.style.display="",B.style.left=r.other.left+"px",B.style.top=r.other.top+"px",B.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Ji(e,t){return e.top-t.top||e.left-t.left}function Xo(e,t,s){var r=e.display,m=e.doc,B=document.createDocumentFragment(),X=is(e.display),q=X.left,te=Math.max(r.sizerWidth,$r(e)-r.sizer.offsetLeft)-X.right,de=m.direction=="ltr";function Ae(xt,Dt,Ht,Ft){Dt<0&&(Dt=0),Dt=Math.round(Dt),Ft=Math.round(Ft),B.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+xt+`px;
top: `+Dt+"px; width: "+(Ht==null?te-xt:Ht)+`px;
height: `+(Ft-Dt)+"px"))}function Ie(xt,Dt,Ht){var Ft=ct(m,xt),tn=Ft.text.length,Sn,Xn;function Rn(jn,ur){return xa(e,Qe(xt,jn),"div",Ft,ur)}function mr(jn,ur,Jn){var Hn=gs(e,Ft,null,jn),Wn=ur=="ltr"==(Jn=="after")?"left":"right",In=Jn=="after"?Hn.begin:Hn.end-(/\s/.test(Ft.text.charAt(Hn.end-1))?2:1);return Rn(In,Wn)[Wn]}var lr=lt(Ft,m.direction);return Ve(lr,Dt||0,Ht==null?tn:Ht,function(jn,ur,Jn,Hn){var Wn=Jn=="ltr",In=Rn(jn,Wn?"left":"right"),dr=Rn(ur-1,Wn?"right":"left"),_i=Dt==null&&jn==0,Xr=Ht==null&&ur==tn,qn=Hn==0,Lr=!lr||Hn==lr.length-1;if(dr.top-In.top<=3){var Yn=(de?_i:Xr)&&qn,qa=(de?Xr:_i)&&Lr,Pr=Yn?q:(Wn?In:dr).left,ri=qa?te:(Wn?dr:In).right;Ae(Pr,In.top,ri-Pr,In.bottom)}else{var ii,ar,Ei,es;Wn?(ii=de&&_i&&qn?q:In.left,ar=de?te:mr(jn,Jn,"before"),Ei=de?q:mr(ur,Jn,"after"),es=de&&Xr&&Lr?te:dr.right):(ii=de?mr(jn,Jn,"before"):q,ar=!de&&_i&&qn?te:In.right,Ei=!de&&Xr&&Lr?q:dr.left,es=de?mr(ur,Jn,"after"):te),Ae(ii,In.top,ar-ii,In.bottom),In.bottom<dr.top&&Ae(q,In.bottom,null,dr.top),Ae(Ei,dr.top,es-Ei,dr.bottom)}(!Sn||Ji(In,Sn)<0)&&(Sn=In),Ji(dr,Sn)<0&&(Sn=dr),(!Xn||Ji(In,Xn)<0)&&(Xn=In),Ji(dr,Xn)<0&&(Xn=dr)}),{start:Sn,end:Xn}}var He=t.from(),We=t.to();if(He.line==We.line)Ie(He.line,He.ch,We.ch);else{var Ze=ct(m,He.line),ot=ct(m,We.line),pt=nn(Ze)==nn(ot),Et=Ie(He.line,He.ch,pt?Ze.text.length+1:null).end,Ot=Ie(We.line,pt?0:null,We.ch).start;pt&&(Et.top<Ot.top-2?(Ae(Et.right,Et.top,null,Et.bottom),Ae(q,Ot.top,Ot.left,Ot.bottom)):Ae(Et.right,Et.top,Ot.left-Et.right,Et.bottom)),Et.bottom<Ot.top&&Ae(q,Et.bottom,null,Ot.top)}s.appendChild(B)}function Ra(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var s=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||li(e),t.cursorDiv.style.visibility=(s=!s)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Es(e){e.state.focused||(e.display.input.focus(),La(e))}function xs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,li(e))},100)}function La(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(),n&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ra(e)}function li(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(je(e,"blur",e,t),e.state.focused=!1,_(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Qi(e){for(var t=e.display,s=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var m=t.view[r],B=e.options.lineWrapping,X=void 0,q=0;if(m.hidden)continue;if(G&&W<8){var te=m.node.offsetTop+m.node.offsetHeight;X=te-s,s=te}else{var de=m.node.getBoundingClientRect();X=de.bottom-de.top,!B&&m.text.firstChild&&(q=m.text.firstChild.getBoundingClientRect().right-de.left-1)}var Ae=m.line.height-X;if((Ae>.005||Ae<-.005)&&(qt(m.line,X),Ts(m.line),m.rest))for(var Ie=0;Ie<m.rest.length;Ie++)Ts(m.rest[Ie]);if(q>e.display.sizerWidth){var He=Math.ceil(q/oi(e.display));He>e.display.maxLineLength&&(e.display.maxLineLength=He,e.display.maxLine=m.line,e.display.maxLineChanged=!0)}}}function Ts(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var s=e.widgets[t],r=s.node.parentNode;r&&(s.height=r.offsetHeight)}}function Zi(e,t,s){var r=s&&s.top!=null?Math.max(0,s.top):e.scroller.scrollTop;r=Math.floor(r-Xi(e));var m=s&&s.bottom!=null?s.bottom:r+e.wrapper.clientHeight,B=rn(t,r),X=rn(t,m);if(s&&s.ensure){var q=s.ensure.from.line,te=s.ensure.to.line;q<B?(B=q,X=rn(t,gr(ct(t,q))+e.wrapper.clientHeight)):Math.min(te,t.lastLine())>=X&&(B=rn(t,gr(ct(t,te))-e.wrapper.clientHeight),X=te)}return{from:B,to:Math.max(X,B+1)}}function Yo(e,t){if(Fe(e,"scrollCursorIntoView"))return;var s=e.display,r=s.sizer.getBoundingClientRect(),m=null;if(t.top+r.top<0?m=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(m=!1),m!=null&&!a){var B=c("div","\u200B",null,`position: absolute;
top: `+(t.top-s.viewOffset-Xi(e.display))+`px;
height: `+(t.bottom-t.top+Ar(e)+s.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(B),B.scrollIntoView(m),e.display.lineSpace.removeChild(B)}}function $o(e,t,s,r){r==null&&(r=0);var m;!e.options.lineWrapping&&t==s&&(t=t.ch?Qe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,s=t.sticky=="before"?Qe(t.line,t.ch+1,"before"):t);for(var B=0;B<5;B++){var X=!1,q=Sr(e,t),te=!s||s==t?q:Sr(e,s);m={left:Math.min(q.left,te.left),top:Math.min(q.top,te.top)-r,right:Math.max(q.left,te.left),bottom:Math.max(q.bottom,te.bottom)+r};var de=Da(e,m),Ae=e.doc.scrollTop,Ie=e.doc.scrollLeft;if(de.scrollTop!=null&&(Oi(e,de.scrollTop),Math.abs(e.doc.scrollTop-Ae)>1&&(X=!0)),de.scrollLeft!=null&&(qr(e,de.scrollLeft),Math.abs(e.doc.scrollLeft-Ie)>1&&(X=!0)),!X)break}return m}function Jo(e,t){var s=Da(e,t);s.scrollTop!=null&&Oi(e,s.scrollTop),s.scrollLeft!=null&&qr(e,s.scrollLeft)}function Da(e,t){var s=e.display,r=si(e.display);t.top<0&&(t.top=0);var m=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:s.scroller.scrollTop,B=ba(e),X={};t.bottom-t.top>B&&(t.bottom=t.top+B);var q=e.doc.height+ya(s),te=t.top<r,de=t.bottom>q-r;if(t.top<m)X.scrollTop=te?0:t.top;else if(t.bottom>m+B){var Ae=Math.min(t.top,(de?q:t.bottom)-B);Ae!=m&&(X.scrollTop=Ae)}var Ie=e.options.fixedGutter?0:s.gutters.offsetWidth,He=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:s.scroller.scrollLeft-Ie,We=$r(e)-s.gutters.offsetWidth,Ze=t.right-t.left>We;return Ze&&(t.right=t.left+We),t.left<10?X.scrollLeft=0:t.left<He?X.scrollLeft=Math.max(0,t.left+Ie-(Ze?0:10)):t.right>We+He-3&&(X.scrollLeft=t.right+(Ze?0:10)-We),X}function Ia(e,t){if(t==null)return;qi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function ui(e){qi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ci(e,t,s){(t!=null||s!=null)&&qi(e),t!=null&&(e.curOp.scrollLeft=t),s!=null&&(e.curOp.scrollTop=s)}function Qo(e,t){qi(e),e.curOp.scrollToPos=t}function qi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var s=ps(e,t.from),r=ps(e,t.to);ws(e,s,r,t.margin)}}function ws(e,t,s,r){var m=Da(e,{left:Math.min(t.left,s.left),top:Math.min(t.top,s.top)-r,right:Math.max(t.right,s.right),bottom:Math.max(t.bottom,s.bottom)+r});Ci(e,m.scrollLeft,m.scrollTop)}function Oi(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;N||Pa(e,{top:t}),Ss(e,t,!0),N&&Pa(e),Li(e,100)}function Ss(e,t,s){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!s)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function qr(e,t,s,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(s?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,Ls(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Ai(e){var t=e.display,s=t.gutters.offsetWidth,r=Math.round(e.doc.height+ya(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?s:0,docHeight:r,scrollHeight:r+Ar(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:s}}var ei=function(e,t,s){this.cm=s;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),m=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=m.tabIndex=-1,e(r),e(m),Pe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Pe(m,"scroll",function(){m.clientWidth&&t(m.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&W<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ei.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,s=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(s){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var m=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+m)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=s?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var B=e.viewWidth-e.barLeft-(s?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+B)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:s?r:0,bottom:t?r:0}},ei.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ei.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ei.prototype.zeroWidthHack=function(){var e=i&&!l?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Q,this.disableVert=new Q},ei.prototype.enableZeroWidthBar=function(e,t,s){e.style.pointerEvents="auto";function r(){var m=e.getBoundingClientRect(),B=s=="vert"?document.elementFromPoint(m.right-1,(m.top+m.bottom)/2):document.elementFromPoint((m.right+m.left)/2,m.bottom-1);B!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},ei.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ri=function(){};Ri.prototype.update=function(){return{bottom:0,right:0}},Ri.prototype.setScrollLeft=function(){},Ri.prototype.setScrollTop=function(){},Ri.prototype.clear=function(){};function di(e,t){t||(t=Ai(e));var s=e.display.barWidth,r=e.display.barHeight;Cs(e,t);for(var m=0;m<4&&s!=e.display.barWidth||r!=e.display.barHeight;m++)s!=e.display.barWidth&&e.options.lineWrapping&&Qi(e),Cs(e,Ai(e)),s=e.display.barWidth,r=e.display.barHeight}function Cs(e,t){var s=e.display,r=s.scrollbars.update(t);s.sizer.style.paddingRight=(s.barWidth=r.right)+"px",s.sizer.style.paddingBottom=(s.barHeight=r.bottom)+"px",s.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(s.scrollbarFiller.style.display="block",s.scrollbarFiller.style.height=r.bottom+"px",s.scrollbarFiller.style.width=r.right+"px"):s.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(s.gutterFiller.style.display="block",s.gutterFiller.style.height=r.bottom+"px",s.gutterFiller.style.width=t.gutterWidth+"px"):s.gutterFiller.style.display=""}var Os={native:ei,null:Ri};function As(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&_(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Os[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Pe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,s){s=="horizontal"?qr(e,t):Oi(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function ti(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Zo},hr(e.curOp)}function ni(e){var t=e.curOp;t&&vn(t,function(s){for(var r=0;r<s.ops.length;r++)s.ops[r].cm.curOp=null;qo(s)})}function qo(e){for(var t=e.ops,s=0;s<t.length;s++)el(t[s]);for(var r=0;r<t.length;r++)tl(t[r]);for(var m=0;m<t.length;m++)nl(t[m]);for(var B=0;B<t.length;B++)rl(t[B]);for(var X=0;X<t.length;X++)il(t[X])}function el(e){var t=e.cm,s=t.display;sl(t),e.updateMaxLine&&Fr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<s.viewFrom||e.scrollToPos.to.line>=s.viewTo)||s.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ea(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&ka(e.cm,e.update)}function nl(e){var t=e.cm,s=t.display;e.updatedDisplay&&Qi(t),e.barMeasure=Ai(t),s.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ss(t,s.maxLine,s.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(s.scroller.clientWidth,s.sizer.offsetLeft+e.adjustWidthTo+Ar(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,s.sizer.offsetLeft+e.adjustWidthTo-$r(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=s.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&qr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var s=e.focus&&e.focus==U();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,s),(e.updatedDisplay||e.startHeight!=t.doc.height)&&di(t,e.barMeasure),e.updatedDisplay&&Na(t,e.barMeasure),e.selectionChanged&&Ra(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),s&&Es(e.cm)}function il(e){var t=e.cm,s=t.display,r=t.doc;if(e.updatedDisplay&&Rs(t,e.update),s.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(s.wheelStartX=s.wheelStartY=null),e.scrollTop!=null&&Ss(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&qr(t,e.scrollLeft,!0,!0),e.scrollToPos){var m=$o(t,R(r,e.scrollToPos.from),R(r,e.scrollToPos.to),e.scrollToPos.margin);Yo(t,m)}var B=e.maybeHiddenMarkers,X=e.maybeUnhiddenMarkers;if(B)for(var q=0;q<B.length;++q)B[q].lines.length||je(B[q],"hide");if(X)for(var te=0;te<X.length;++te)X[te].lines.length&&je(X[te],"unhide");s.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&je(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function pr(e,t){if(e.curOp)return t();ti(e);try{return t()}finally{ni(e)}}function zn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ti(e);try{return t.apply(e,arguments)}finally{ni(e)}}}function ir(e){return function(){if(this.curOp)return e.apply(this,arguments);ti(this);try{return e.apply(this,arguments)}finally{ni(this)}}}function Vn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ti(t);try{return e.apply(this,arguments)}finally{ni(t)}}}function Li(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 s=+new Date+e.options.workTime,r=ft(e,t.highlightFrontier),m=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(B){if(r.line>=e.display.viewFrom){var X=B.styles,q=B.text.length>e.options.maxHighlightLength?vt(t.mode,r.state):null,te=De(e,B,r,!0);q&&(r.state=q),B.styles=te.styles;var de=B.styleClasses,Ae=te.classes;Ae?B.styleClasses=Ae:de&&(B.styleClasses=null);for(var Ie=!X||X.length!=B.styles.length||de!=Ae&&(!de||!Ae||de.bgClass!=Ae.bgClass||de.textClass!=Ae.textClass),He=0;!Ie&&He<X.length;++He)Ie=X[He]!=B.styles[He];Ie&&m.push(r.line),B.stateAfter=r.save(),r.nextLine()}else B.text.length<=e.options.maxHighlightLength&&Lt(e,B.text,r),B.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>s)return Li(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),m.length&&pr(e,function(){for(var B=0;B<m.length;B++)jr(e,m[B],"text")})}var ea=function(e,t,s){var r=e.display;this.viewport=t,this.visible=Zi(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=$r(e),this.force=s,this.dims=Ca(e),this.events=[]};ea.prototype.signal=function(e,t){ye(e,t)&&this.events.push(arguments)},ea.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=Ar(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ar(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=U();if(!t||!x(e.display.lineDiv,t))return null;var s={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&x(e.display.lineDiv,r.anchorNode)&&(s.anchorNode=r.anchorNode,s.anchorOffset=r.anchorOffset,s.focusNode=r.focusNode,s.focusOffset=r.focusOffset)}return s}function ll(e){if(!e||!e.activeElt||e.activeElt==U())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&x(document.body,e.anchorNode)&&x(document.body,e.focusNode)){var t=window.getSelection(),s=document.createRange();s.setEnd(e.anchorNode,e.anchorOffset),s.collapse(!1),t.removeAllRanges(),t.addRange(s),t.extend(e.focusNode,e.focusOffset)}}function ka(e,t){var s=e.display,r=e.doc;if(t.editorIsHidden)return Wr(e),!1;if(!t.force&&t.visible.from>=s.viewFrom&&t.visible.to<=s.viewTo&&(s.updateLineNumbers==null||s.updateLineNumbers>=s.viewTo)&&s.renderedView==s.view&&ys(e)==0)return!1;Ds(e)&&(Wr(e),t.dims=Ca(e));var m=r.first+r.size,B=Math.max(t.visible.from-e.options.viewportMargin,r.first),X=Math.min(m,t.visible.to+e.options.viewportMargin);s.viewFrom<B&&B-s.viewFrom<20&&(B=Math.max(r.first,s.viewFrom)),s.viewTo>X&&s.viewTo-X<20&&(X=Math.min(m,s.viewTo)),Kt&&(B=Dr(e.doc,B),X=wr(e.doc,X));var q=B!=s.viewFrom||X!=s.viewTo||s.lastWrapHeight!=t.wrapperHeight||s.lastWrapWidth!=t.wrapperWidth;Vo(e,B,X),s.viewOffset=gr(ct(e.doc,s.viewFrom)),e.display.mover.style.top=s.viewOffset+"px";var te=ys(e);if(!q&&te==0&&!t.force&&s.renderedView==s.view&&(s.updateLineNumbers==null||s.updateLineNumbers>=s.viewTo))return!1;var de=ol(e);return te>4&&(s.lineDiv.style.display="none"),ul(e,s.updateLineNumbers,t.dims),te>4&&(s.lineDiv.style.display=""),s.renderedView=s.view,ll(de),T(s.cursorDiv),T(s.selectionDiv),s.gutters.style.height=s.sizer.style.minHeight=0,q&&(s.lastWrapHeight=t.wrapperHeight,s.lastWrapWidth=t.wrapperWidth,Li(e,400)),s.updateLineNumbers=null,!0}function Rs(e,t){for(var s=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==$r(e)){if(s&&s.top!=null&&(s={top:Math.min(e.doc.height+ya(e.display)-ba(e),s.top)}),t.visible=Zi(e.display,e.doc,s),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Zi(e.display,e.doc,s));if(!ka(e,t))break;Qi(e);var m=Ai(e);Si(e),di(e,m),Na(e,m),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 Pa(e,t){var s=new ea(e,t);if(ka(e,s)){Qi(e),Rs(e,s);var r=Ai(e);Si(e),di(e,r),Na(e,r),s.finish()}}function ul(e,t,s){var r=e.display,m=e.options.lineNumbers,B=r.lineDiv,X=B.firstChild;function q(Ze){var ot=Ze.nextSibling;return n&&i&&e.display.currentWheelTarget==Ze?Ze.style.display="none":Ze.parentNode.removeChild(Ze),ot}for(var te=r.view,de=r.viewFrom,Ae=0;Ae<te.length;Ae++){var Ie=te[Ae];if(!Ie.hidden)if(!Ie.node||Ie.node.parentNode!=B){var He=No(e,Ie,de,s);B.insertBefore(He,X)}else{for(;X!=Ie.node;)X=q(X);var We=m&&t!=null&&t<=de&&Ie.lineNumber;Ie.changes&&(ne(Ie.changes,"gutter")>-1&&(We=!1),Ur(e,Ie,de,s)),We&&(T(Ie.lineNumber),Ie.lineNumber.appendChild(document.createTextNode(Ln(e.options,de)))),X=Ie.node.nextSibling}de+=Ie.size}for(;X;)X=q(X)}function Ma(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Na(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ar(e)+"px"}function Ls(e){var t=e.display,s=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Oa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,m=t.gutters.offsetWidth,B=r+"px",X=0;X<s.length;X++)if(!s[X].hidden){e.options.fixedGutter&&(s[X].gutter&&(s[X].gutter.style.left=B),s[X].gutterBackground&&(s[X].gutterBackground.style.left=B));var q=s[X].alignable;if(q)for(var te=0;te<q.length;te++)q[te].style.left=B}e.options.fixedGutter&&(t.gutters.style.left=r+m+"px")}function Ds(e){if(!e.options.lineNumbers)return!1;var t=e.doc,s=Ln(e.options,t.first+t.size-1),r=e.display;if(s.length!=r.lineNumChars){var m=r.measure.appendChild(c("div",[c("div",s)],"CodeMirror-linenumber CodeMirror-gutter-elt")),B=m.firstChild.offsetWidth,X=m.offsetWidth-B;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(B,r.lineGutter.offsetWidth-X)+1,r.lineNumWidth=r.lineNumInnerWidth+X,r.lineNumChars=r.lineNumInnerWidth?s.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Ma(e.display),!0}return!1}function Fa(e,t){for(var s=[],r=!1,m=0;m<e.length;m++){var B=e[m],X=null;if(typeof B!="string"&&(X=B.style,B=B.className),B=="CodeMirror-linenumbers")if(t)r=!0;else continue;s.push({className:B,style:X})}return t&&!r&&s.push({className:"CodeMirror-linenumbers",style:null}),s}function Is(e){var t=e.gutters,s=e.gutterSpecs;T(t),e.lineGutter=null;for(var r=0;r<s.length;++r){var m=s[r],B=m.className,X=m.style,q=t.appendChild(c("div",null,"CodeMirror-gutter "+B));X&&(q.style.cssText=X),B=="CodeMirror-linenumbers"&&(e.lineGutter=q,q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=s.length?"":"none",Ma(e)}function Di(e){Is(e.display),sr(e),Ls(e)}function dl(e,t,s,r){var m=this;this.input=s,m.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),m.scrollbarFiller.setAttribute("cm-not-content","true"),m.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),m.gutterFiller.setAttribute("cm-not-content","true"),m.lineDiv=E("div",null,"CodeMirror-code"),m.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),m.cursorDiv=c("div",null,"CodeMirror-cursors"),m.measure=c("div",null,"CodeMirror-measure"),m.lineMeasure=c("div",null,"CodeMirror-measure"),m.lineSpace=E("div",[m.measure,m.lineMeasure,m.selectionDiv,m.cursorDiv,m.lineDiv],null,"position: relative; outline: none");var B=E("div",[m.lineSpace],"CodeMirror-lines");m.mover=c("div",[B],null,"position: relative"),m.sizer=c("div",[m.mover],"CodeMirror-sizer"),m.sizerWidth=null,m.heightForcer=c("div",null,null,"position: absolute; height: "+fe+"px; width: 1px;"),m.gutters=c("div",null,"CodeMirror-gutters"),m.lineGutter=null,m.scroller=c("div",[m.sizer,m.heightForcer,m.gutters],"CodeMirror-scroll"),m.scroller.setAttribute("tabIndex","-1"),m.wrapper=c("div",[m.scrollbarFiller,m.gutterFiller,m.scroller],"CodeMirror"),G&&W<8&&(m.gutters.style.zIndex=-1,m.scroller.style.paddingRight=0),!n&&!(N&&d)&&(m.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(m.wrapper):e(m.wrapper)),m.viewFrom=m.viewTo=t.first,m.reportedViewFrom=m.reportedViewTo=t.first,m.view=[],m.renderedView=null,m.externalMeasured=null,m.viewOffset=0,m.lastWrapHeight=m.lastWrapWidth=0,m.updateLineNumbers=null,m.nativeBarWidth=m.barHeight=m.barWidth=0,m.scrollbarsClipped=!1,m.lineNumWidth=m.lineNumInnerWidth=m.lineNumChars=null,m.alignWidgets=!1,m.cachedCharWidth=m.cachedTextHeight=m.cachedPaddingH=null,m.maxLine=null,m.maxLineLength=0,m.maxLineChanged=!1,m.wheelDX=m.wheelDY=m.wheelStartX=m.wheelStartY=null,m.shift=!1,m.selForContextMenu=null,m.activeTouch=null,m.gutterSpecs=Fa(r.gutters,r.lineNumbers),Is(m),s.init(m)}var ta=0,yr=null;G?yr=-.53:N?yr=15:y?yr=-.7:p&&(yr=-1/3);function ks(e){var t=e.wheelDeltaX,s=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),s==null&&e.detail&&e.axis==e.VERTICAL_AXIS?s=e.detail:s==null&&(s=e.wheelDelta),{x:t,y:s}}function cl(e){var t=ks(e);return t.x*=yr,t.y*=yr,t}function Ps(e,t){var s=ks(t),r=s.x,m=s.y,B=e.display,X=B.scroller,q=X.scrollWidth>X.clientWidth,te=X.scrollHeight>X.clientHeight;if(!(r&&q||m&&te))return;if(m&&i&&n){e:for(var de=t.target,Ae=B.view;de!=X;de=de.parentNode)for(var Ie=0;Ie<Ae.length;Ie++)if(Ae[Ie].node==de){e.display.currentWheelTarget=de;break e}}if(r&&!N&&!g&&yr!=null){m&&te&&Oi(e,Math.max(0,X.scrollTop+m*yr)),qr(e,Math.max(0,X.scrollLeft+r*yr)),(!m||m&&te)&&ue(t),B.wheelStartX=null;return}if(m&&yr!=null){var He=m*yr,We=e.doc.scrollTop,Ze=We+B.wrapper.clientHeight;He<0?We=Math.max(0,We+He-50):Ze=Math.min(e.doc.height,Ze+He+50),Pa(e,{top:We,bottom:Ze})}ta<20&&(B.wheelStartX==null?(B.wheelStartX=X.scrollLeft,B.wheelStartY=X.scrollTop,B.wheelDX=r,B.wheelDY=m,setTimeout(function(){if(B.wheelStartX==null)return;var ot=X.scrollLeft-B.wheelStartX,pt=X.scrollTop-B.wheelStartY,Et=pt&&B.wheelDY&&pt/B.wheelDY||ot&&B.wheelDX&&ot/B.wheelDX;if(B.wheelStartX=B.wheelStartY=null,!Et)return;yr=(yr*ta+Et)/(ta+1),++ta},200)):(B.wheelDX+=r,B.wheelDY+=m))}var br=function(e,t){this.ranges=e,this.primIndex=t};br.prototype.primary=function(){return this.ranges[this.primIndex]},br.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 s=this.ranges[t],r=e.ranges[t];if(!Qt(s.anchor,r.anchor)||!Qt(s.head,r.head))return!1}return!0},br.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new yn(pn(this.ranges[t].anchor),pn(this.ranges[t].head));return new br(e,this.primIndex)},br.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},br.prototype.contains=function(e,t){t||(t=e);for(var s=0;s<this.ranges.length;s++){var r=this.ranges[s];if(ht(t,r.from())>=0&&ht(e,r.to())<=0)return s}return-1};var yn=function(e,t){this.anchor=e,this.head=t};yn.prototype.from=function(){return fn(this.anchor,this.head)},yn.prototype.to=function(){return _n(this.anchor,this.head)},yn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Cr(e,t,s){var r=e&&e.options.selectionsMayTouch,m=t[s];t.sort(function(He,We){return ht(He.from(),We.from())}),s=ne(t,m);for(var B=1;B<t.length;B++){var X=t[B],q=t[B-1],te=ht(q.to(),X.from());if(r&&!X.empty()?te>0:te>=0){var de=fn(q.from(),X.from()),Ae=_n(q.to(),X.to()),Ie=q.empty()?X.from()==X.head:q.from()==q.head;B<=s&&--s,t.splice(--B,2,new yn(Ie?Ae:de,Ie?de:Ae))}}return new br(t,s)}function Hr(e,t){return new br([new yn(e,t||e)],0)}function Kr(e){return e.text?Qe(e.from.line+e.text.length-1,Z(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ms(e,t){if(ht(e,t.from)<0)return e;if(ht(e,t.to)<=0)return Kr(t);var s=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Kr(t).ch-t.to.ch),Qe(s,r)}function Ua(e,t){for(var s=[],r=0;r<e.sel.ranges.length;r++){var m=e.sel.ranges[r];s.push(new yn(Ms(m.anchor,t),Ms(m.head,t)))}return Cr(e.cm,s,e.sel.primIndex)}function Ns(e,t,s){return e.line==t.line?Qe(s.line,e.ch-t.ch+s.ch):Qe(s.line+(e.line-t.line),e.ch)}function hl(e,t,s){for(var r=[],m=Qe(e.first,0),B=m,X=0;X<t.length;X++){var q=t[X],te=Ns(q.from,m,B),de=Ns(Kr(q),m,B);if(m=q.to,B=de,s=="around"){var Ae=e.sel.ranges[X],Ie=ht(Ae.head,Ae.anchor)<0;r[X]=new yn(Ie?de:te,Ie?te:de)}else r[X]=new yn(te,te)}return new br(r,e.sel.primIndex)}function Ba(e){e.doc.mode=_t(e.options,e.doc.modeOption),Ii(e)}function Ii(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,Li(e,100),e.state.modeGen++,e.curOp&&sr(e)}function Fs(e,t){return t.from.ch==0&&t.to.ch==0&&Z(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ja(e,t,s,r){function m(Ot){return s?s[Ot]:null}function B(Ot,xt,Dt){Yr(Ot,xt,Dt,r),hn(Ot,"change",Ot,t)}function X(Ot,xt){for(var Dt=[],Ht=Ot;Ht<xt;++Ht)Dt.push(new cr(de[Ht],m(Ht),r));return Dt}var q=t.from,te=t.to,de=t.text,Ae=ct(e,q.line),Ie=ct(e,te.line),He=Z(de),We=m(de.length-1),Ze=te.line-q.line;if(t.full)e.insert(0,X(0,de.length)),e.remove(de.length,e.size-de.length);else if(Fs(e,t)){var ot=X(0,de.length-1);B(Ie,Ie.text,We),Ze&&e.remove(q.line,Ze),ot.length&&e.insert(q.line,ot)}else if(Ae==Ie)if(de.length==1)B(Ae,Ae.text.slice(0,q.ch)+He+Ae.text.slice(te.ch),We);else{var pt=X(1,de.length-1);pt.push(new cr(He+Ae.text.slice(te.ch),We,r)),B(Ae,Ae.text.slice(0,q.ch)+de[0],m(0)),e.insert(q.line+1,pt)}else if(de.length==1)B(Ae,Ae.text.slice(0,q.ch)+de[0]+Ie.text.slice(te.ch),m(0)),e.remove(q.line+1,Ze);else{B(Ae,Ae.text.slice(0,q.ch)+de[0],m(0)),B(Ie,He+Ie.text.slice(te.ch),We);var Et=X(1,de.length-1);Ze>1&&e.remove(q.line+1,Ze-1),e.insert(q.line+1,Et)}hn(e,"change",e,t)}function Gr(e,t,s){function r(m,B,X){if(m.linked)for(var q=0;q<m.linked.length;++q){var te=m.linked[q];if(te.doc==B)continue;var de=X&&te.sharedHist;if(s&&!de)continue;t(te.doc,de),r(te.doc,m,de)}}r(e,null,!0)}function Us(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Aa(e),Ba(e),Bs(e),e.options.lineWrapping||Fr(e),e.options.mode=t.modeOption,sr(e)}function Bs(e){(e.doc.direction=="rtl"?F:_)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){pr(e,function(){Bs(e),sr(e)})}function na(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 Wa(e,t){var s={from:pn(t.from),to:Kr(t),text:Vt(e,t.from,t.to)};return Hs(e,s,t.from.line,t.to.line+1),Gr(e,function(r){return Hs(r,s,t.from.line,t.to.line+1)},!0),s}function js(e){for(;e.length;){var t=Z(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return js(e.done),Z(e.done);if(e.done.length&&!Z(e.done).ranges)return Z(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Z(e.done)}function Ws(e,t,s,r){var m=e.history;m.undone.length=0;var B=+new Date,X,q;if((m.lastOp==r||m.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&m.lastModTime>B-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(X=pl(m,m.lastOp==r)))q=Z(X.changes),ht(t.from,t.to)==0&&ht(t.from,q.to)==0?q.to=Kr(t):X.changes.push(Wa(e,t));else{var te=Z(m.done);for((!te||!te.ranges)&&ra(e.sel,m.done),X={changes:[Wa(e,t)],generation:m.generation},m.done.push(X);m.done.length>m.undoDepth;)m.done.shift(),m.done[0].ranges||m.done.shift()}m.done.push(s),m.generation=++m.maxGeneration,m.lastModTime=m.lastSelTime=B,m.lastOp=m.lastSelOp=r,m.lastOrigin=m.lastSelOrigin=t.origin,q||je(e,"historyAdded")}function ml(e,t,s,r){var m=t.charAt(0);return m=="*"||m=="+"&&s.ranges.length==r.ranges.length&&s.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,s,r){var m=e.history,B=r&&r.origin;s==m.lastSelOp||B&&m.lastSelOrigin==B&&(m.lastModTime==m.lastSelTime&&m.lastOrigin==B||ml(e,B,Z(m.done),t))?m.done[m.done.length-1]=t:ra(t,m.done),m.lastSelTime=+new Date,m.lastSelOrigin=B,m.lastSelOp=s,r&&r.clearRedo!==!1&&js(m.undone)}function ra(e,t){var s=Z(t);s&&s.ranges&&s.equals(e)||t.push(e)}function Hs(e,t,s,r){var m=t["spans_"+e.id],B=0;e.iter(Math.max(e.first,s),Math.min(e.first+e.size,r),function(X){X.markedSpans&&((m||(m=t["spans_"+e.id]={}))[B]=X.markedSpans),++B})}function vl(e){if(!e)return null;for(var t,s=0;s<e.length;++s)e[s].marker.explicitlyCleared?t||(t=e.slice(0,s)):t&&t.push(e[s]);return t?t.length?t:null:e}function yl(e,t){var s=t["spans_"+e.id];if(!s)return null;for(var r=[],m=0;m<t.text.length;++m)r.push(vl(s[m]));return r}function Ks(e,t){var s=yl(e,t),r=Cn(e,t);if(!s)return r;if(!r)return s;for(var m=0;m<s.length;++m){var B=s[m],X=r[m];if(B&&X){e:for(var q=0;q<X.length;++q){for(var te=X[q],de=0;de<B.length;++de)if(B[de].marker==te.marker)continue e;B.push(te)}}else X&&(s[m]=X)}return s}function ci(e,t,s){for(var r=[],m=0;m<e.length;++m){var B=e[m];if(B.ranges){r.push(s?br.prototype.deepCopy.call(B):B);continue}var X=B.changes,q=[];r.push({changes:q});for(var te=0;te<X.length;++te){var de=X[te],Ae=void 0;if(q.push({from:de.from,to:de.to,text:de.text}),t)for(var Ie in de)(Ae=Ie.match(/^spans_(\d+)$/))&&(ne(t,Number(Ae[1]))>-1&&(Z(q)[Ie]=de[Ie],delete de[Ie]))}}return r}function Ha(e,t,s,r){if(r){var m=e.anchor;if(s){var B=ht(t,m)<0;B!=ht(s,m)<0?(m=t,t=s):B!=ht(t,s)<0&&(t=s)}return new yn(m,t)}else return new yn(s||t,t)}function ia(e,t,s,r,m){m==null&&(m=e.cm&&(e.cm.display.shift||e.extend)),Zn(e,new br([Ha(e.sel.primary(),t,s,m)],0),r)}function Gs(e,t,s){for(var r=[],m=e.cm&&(e.cm.display.shift||e.extend),B=0;B<e.sel.ranges.length;B++)r[B]=Ha(e.sel.ranges[B],t[B],null,m);var X=Cr(e.cm,r,e.sel.primIndex);Zn(e,X,s)}function Ka(e,t,s,r){var m=e.sel.ranges.slice(0);m[t]=s,Zn(e,Cr(e.cm,m,e.sel.primIndex),r)}function zs(e,t,s,r){Zn(e,Hr(t,s),r)}function bl(e,t,s){var r={ranges:t.ranges,update:function(m){this.ranges=[];for(var B=0;B<m.length;B++)this.ranges[B]=new yn(R(e,m[B].anchor),R(e,m[B].head))},origin:s&&s.origin};return je(e,"beforeSelectionChange",e,r),e.cm&&je(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Cr(e.cm,r.ranges,r.ranges.length-1):t}function Vs(e,t,s){var r=e.history.done,m=Z(r);m&&m.ranges?(r[r.length-1]=t,aa(e,t,s)):Zn(e,t,s)}function Zn(e,t,s){aa(e,t,s),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,s)}function aa(e,t,s){(ye(e,"beforeSelectionChange")||e.cm&&ye(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,s));var r=s&&s.bias||(ht(t.primary().head,e.sel.primary().head)<0?-1:1);Xs(e,$s(e,t,r,!0)),!(s&&s.scroll===!1)&&e.cm&&ui(e.cm)}function Xs(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,_e(e.cm)),hn(e,"cursorActivity",e)}function Ys(e){Xs(e,$s(e,e.sel,null,!1))}function $s(e,t,s,r){for(var m,B=0;B<t.ranges.length;B++){var X=t.ranges[B],q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[B],te=sa(e,X.anchor,q&&q.anchor,s,r),de=sa(e,X.head,q&&q.head,s,r);(m||te!=X.anchor||de!=X.head)&&(m||(m=t.ranges.slice(0,B)),m[B]=new yn(te,de))}return m?Cr(e.cm,m,t.primIndex):t}function hi(e,t,s,r,m){var B=ct(e,t.line);if(B.markedSpans)for(var X=0;X<B.markedSpans.length;++X){var q=B.markedSpans[X],te=q.marker,de="selectLeft"in te?!te.selectLeft:te.inclusiveLeft,Ae="selectRight"in te?!te.selectRight:te.inclusiveRight;if((q.from==null||(de?q.from<=t.ch:q.from<t.ch))&&(q.to==null||(Ae?q.to>=t.ch:q.to>t.ch))){if(m&&(je(te,"beforeCursorEnter"),te.explicitlyCleared))if(B.markedSpans){--X;continue}else break;if(!te.atomic)continue;if(s){var Ie=te.find(r<0?1:-1),He=void 0;if((r<0?Ae:de)&&(Ie=Js(e,Ie,-r,Ie&&Ie.line==t.line?B:null)),Ie&&Ie.line==t.line&&(He=ht(Ie,s))&&(r<0?He<0:He>0))return hi(e,Ie,t,r,m)}var We=te.find(r<0?-1:1);return(r<0?de:Ae)&&(We=Js(e,We,r,We.line==t.line?B:null)),We?hi(e,We,t,r,m):null}}return t}function sa(e,t,s,r,m){var B=r||1,X=hi(e,t,s,B,m)||!m&&hi(e,t,s,B,!0)||hi(e,t,s,-B,m)||!m&&hi(e,t,s,-B,!0);return X||(e.cantEdit=!0,Qe(e.first,0))}function Js(e,t,s,r){return s<0&&t.ch==0?t.line>e.first?R(e,Qe(t.line-1)):null:s>0&&t.ch==(r||ct(e,t.line)).text.length?t.line<e.first+e.size-1?Qe(t.line+1,0):null:new Qe(t.line,t.ch+s)}function Qs(e){e.setSelection(Qe(e.firstLine(),0),Qe(e.lastLine()),Se)}function Zs(e,t,s){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return s&&(r.update=function(m,B,X,q){m&&(r.from=R(e,m)),B&&(r.to=R(e,B)),X&&(r.text=X),q!==void 0&&(r.origin=q)}),je(e,"beforeChange",e,r),e.cm&&je(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function fi(e,t,s){if(e.cm){if(!e.cm.curOp)return zn(e.cm,fi)(e,t,s);if(e.cm.state.suppressEdits)return}if((ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"))&&(t=Zs(e,t,!0),!t))return;var r=_r&&!s&&tr(e,t.from,t.to);if(r)for(var m=r.length-1;m>=0;--m)qs(e,{from:r[m].from,to:r[m].to,text:m?[""]:t.text,origin:t.origin});else qs(e,t)}function qs(e,t){if(t.text.length==1&&t.text[0]==""&&ht(t.from,t.to)==0)return;var s=Ua(e,t);Ws(e,t,s,e.cm?e.cm.curOp.id:NaN),ki(e,t,s,Cn(e,t));var r=[];Gr(e,function(m,B){!B&&ne(r,m.history)==-1&&(ro(m.history,t),r.push(m.history)),ki(m,t,null,Cn(m,t))})}function oa(e,t,s){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!s)return;for(var m=e.history,B,X=e.sel,q=t=="undo"?m.done:m.undone,te=t=="undo"?m.undone:m.done,de=0;de<q.length&&!(B=q[de],s?B.ranges&&!B.equals(e.sel):!B.ranges);de++);if(de==q.length)return;for(m.lastOrigin=m.lastSelOrigin=null;;)if(B=q.pop(),B.ranges){if(ra(B,te),s&&!B.equals(e.sel)){Zn(e,B,{clearRedo:!1});return}X=B}else if(r){q.push(B);return}else break;var Ae=[];ra(X,te),te.push({changes:Ae,generation:m.generation}),m.generation=B.generation||++m.maxGeneration;for(var Ie=ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"),He=function(ot){var pt=B.changes[ot];if(pt.origin=t,Ie&&!Zs(e,pt,!1))return q.length=0,{};Ae.push(Wa(e,pt));var Et=ot?Ua(e,pt):Z(q);ki(e,pt,Et,Ks(e,pt)),!ot&&e.cm&&e.cm.scrollIntoView({from:pt.from,to:Kr(pt)});var Ot=[];Gr(e,function(xt,Dt){!Dt&&ne(Ot,xt.history)==-1&&(ro(xt.history,pt),Ot.push(xt.history)),ki(xt,pt,null,Ks(xt,pt))})},We=B.changes.length-1;We>=0;--We){var Ze=He(We);if(Ze)return Ze.v}}function eo(e,t){if(t==0)return;if(e.first+=t,e.sel=new br(ae(e.sel.ranges,function(m){return new yn(Qe(m.anchor.line+t,m.anchor.ch),Qe(m.head.line+t,m.head.ch))}),e.sel.primIndex),e.cm){sr(e.cm,e.first,e.first-t,t);for(var s=e.cm.display,r=s.viewFrom;r<s.viewTo;r++)jr(e.cm,r,"gutter")}}function ki(e,t,s,r){if(e.cm&&!e.cm.curOp)return zn(e.cm,ki)(e,t,s,r);if(t.to.line<e.first){eo(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 m=t.text.length-1-(e.first-t.from.line);eo(e,m),t={from:Qe(e.first,0),to:Qe(t.to.line+m,t.to.ch),text:[Z(t.text)],origin:t.origin}}var B=e.lastLine();t.to.line>B&&(t={from:t.from,to:Qe(B,ct(e,B).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Vt(e,t.from,t.to),s||(s=Ua(e,t)),e.cm?_l(e.cm,t,r):ja(e,t,r),aa(e,s,Se),e.cantEdit&&sa(e,Qe(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,s){var r=e.doc,m=e.display,B=t.from,X=t.to,q=!1,te=B.line;e.options.lineWrapping||(te=Wt(nn(ct(r,B.line))),r.iter(te,X.line+1,function(We){if(We==m.maxLine)return q=!0,!0})),r.sel.contains(t.from,t.to)>-1&&_e(e),ja(r,t,s,vs(e)),e.options.lineWrapping||(r.iter(te,B.line+t.text.length,function(We){var Ze=Nr(We);Ze>m.maxLineLength&&(m.maxLine=We,m.maxLineLength=Ze,m.maxLineChanged=!0,q=!1)}),q&&(e.curOp.updateMaxLine=!0)),er(r,B.line),Li(e,400);var de=t.text.length-(X.line-B.line)-1;t.full?sr(e):B.line==X.line&&t.text.length==1&&!Fs(e.doc,t)?jr(e,B.line,"text"):sr(e,B.line,X.line+1,de);var Ae=ye(e,"changes"),Ie=ye(e,"change");if(Ie||Ae){var He={from:B,to:X,text:t.text,removed:t.removed,origin:t.origin};Ie&&hn(e,"change",e,He),Ae&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(He)}e.display.selForContextMenu=null}function pi(e,t,s,r,m){var B;r||(r=s),ht(r,s)<0&&(B=[r,s],s=B[0],r=B[1]),typeof t=="string"&&(t=e.splitLines(t)),fi(e,{from:s,to:r,text:t,origin:m})}function to(e,t,s,r){s<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function no(e,t,s,r){for(var m=0;m<e.length;++m){var B=e[m],X=!0;if(B.ranges){B.copied||(B=e[m]=B.deepCopy(),B.copied=!0);for(var q=0;q<B.ranges.length;q++)to(B.ranges[q].anchor,t,s,r),to(B.ranges[q].head,t,s,r);continue}for(var te=0;te<B.changes.length;++te){var de=B.changes[te];if(s<de.from.line)de.from=Qe(de.from.line+r,de.from.ch),de.to=Qe(de.to.line+r,de.to.ch);else if(t<=de.to.line){X=!1;break}}X||(e.splice(0,m+1),m=0)}}function ro(e,t){var s=t.from.line,r=t.to.line,m=t.text.length-(r-s)-1;no(e.done,s,r,m),no(e.undone,s,r,m)}function Pi(e,t,s,r){var m=t,B=t;return typeof t=="number"?B=ct(e,Y(e,t)):m=Wt(t),m==null?null:(r(B,m)&&e.cm&&jr(e.cm,m,s),B)}function Mi(e){this.lines=e,this.parent=null;for(var t=0,s=0;s<e.length;++s)e[s].parent=this,t+=e[s].height;this.height=t}Mi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var s=e,r=e+t;s<r;++s){var m=this.lines[s];this.height-=m.height,kt(m),hn(m,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,s){this.height+=s,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,s){for(var r=e+t;e<r;++e)if(s(this.lines[e]))return!0}};function Ni(e){this.children=e;for(var t=0,s=0,r=0;r<e.length;++r){var m=e[r];t+=m.chunkSize(),s+=m.height,m.parent=this}this.size=t,this.height=s,this.parent=null}Ni.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var s=0;s<this.children.length;++s){var r=this.children[s],m=r.chunkSize();if(e<m){var B=Math.min(t,m-e),X=r.height;if(r.removeInner(e,B),this.height-=X-r.height,m==B&&(this.children.splice(s--,1),r.parent=null),(t-=B)==0)break;e=0}else e-=m}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Mi))){var q=[];this.collapse(q),this.children=[new Mi(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,s){this.size+=t.length,this.height+=s;for(var r=0;r<this.children.length;++r){var m=this.children[r],B=m.chunkSize();if(e<=B){if(m.insertInner(e,t,s),m.lines&&m.lines.length>50){for(var X=m.lines.length%25+25,q=X;q<m.lines.length;){var te=new Mi(m.lines.slice(q,q+=25));m.height-=te.height,this.children.splice(++r,0,te),te.parent=this}m.lines=m.lines.slice(0,X),this.maybeSpill()}break}e-=B}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),s=new Ni(t);if(e.parent){e.size-=s.size,e.height-=s.height;var m=ne(e.parent.children,e);e.parent.children.splice(m+1,0,s)}else{var r=new Ni(e.children);r.parent=e,e.children=[r,s],e=r}s.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,s){for(var r=0;r<this.children.length;++r){var m=this.children[r],B=m.chunkSize();if(e<B){var X=Math.min(t,B-e);if(m.iterN(e,X,s))return!0;if((t-=X)==0)break;e=0}else e-=B}}};var Fi=function(e,t,s){if(s)for(var r in s)s.hasOwnProperty(r)&&(this[r]=s[r]);this.doc=e,this.node=t};Fi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,s=this.line,r=Wt(s);if(r==null||!t)return;for(var m=0;m<t.length;++m)t[m]==this&&t.splice(m--,1);t.length||(s.widgets=null);var B=Ti(this);qt(s,Math.max(0,s.height-B)),e&&(pr(e,function(){io(e,s,-B),jr(e,r,"widget")}),hn(e,"lineWidgetCleared",e,this,r))},Fi.prototype.changed=function(){var e=this,t=this.height,s=this.doc.cm,r=this.line;this.height=null;var m=Ti(this)-t;if(!m)return;Tr(this.doc,r)||qt(r,r.height+m),s&&pr(s,function(){s.curOp.forceUpdate=!0,io(s,r,m),hn(s,"lineWidgetChanged",s,e,Wt(r))})},ve(Fi);function io(e,t,s){gr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ia(e,s)}function El(e,t,s,r){var m=new Fi(e,s,r),B=e.cm;return B&&m.noHScroll&&(B.display.alignWidgets=!0),Pi(e,t,"widget",function(X){var q=X.widgets||(X.widgets=[]);if(m.insertAt==null?q.push(m):q.splice(Math.min(q.length-1,Math.max(0,m.insertAt)),0,m),m.line=X,B&&!Tr(e,X)){var te=gr(X)<e.scrollTop;qt(X,X.height+Ti(m)),te&&Ia(B,m.height),B.curOp.forceUpdate=!0}return!0}),B&&hn(B,"lineWidgetAdded",B,m,typeof t=="number"?t:Wt(t)),m}var ao=0,zr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ao};zr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&ti(e),ye(this,"clear")){var s=this.find();s&&hn(this,"clear",s.from,s.to)}for(var r=null,m=null,B=0;B<this.lines.length;++B){var X=this.lines[B],q=Zt(X.markedSpans,this);e&&!this.collapsed?jr(e,Wt(X),"text"):e&&(q.to!=null&&(m=Wt(X)),q.from!=null&&(r=Wt(X))),X.markedSpans=an(X.markedSpans,q),q.from==null&&this.collapsed&&!Tr(this.doc,X)&&e&&qt(X,si(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var te=0;te<this.lines.length;++te){var de=nn(this.lines[te]),Ae=Nr(de);Ae>e.display.maxLineLength&&(e.display.maxLine=de,e.display.maxLineLength=Ae,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&sr(e,r,m+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ys(e.doc)),e&&hn(e,"markerCleared",e,this,r,m),t&&ni(e),this.parent&&this.parent.clear()},zr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var s,r,m=0;m<this.lines.length;++m){var B=this.lines[m],X=Zt(B.markedSpans,this);if(X.from!=null&&(s=Qe(t?B:Wt(B),X.from),e==-1))return s;if(X.to!=null&&(r=Qe(t?B:Wt(B),X.to),e==1))return r}return s&&{from:s,to:r}},zr.prototype.changed=function(){var e=this,t=this.find(-1,!0),s=this,r=this.doc.cm;if(!t||!r)return;pr(r,function(){var m=t.line,B=Wt(t.line),X=_a(r,B);if(X&&(us(X),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Tr(s.doc,m)&&s.height!=null){var q=s.height;s.height=null;var te=Ti(s)-q;te&&qt(m,m.height+te)}hn(r,"markerChanged",r,e)})},zr.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)},zr.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)}},ve(zr);function mi(e,t,s,r,m){if(r&&r.shared)return xl(e,t,s,r,m);if(e.cm&&!e.cm.curOp)return zn(e.cm,mi)(e,t,s,r,m);var B=new zr(e,m),X=ht(t,s);if(r&&b(r,B,!1),X>0||X==0&&B.clearWhenEmpty!==!1)return B;if(B.replacedWith&&(B.collapsed=!0,B.widgetNode=E("span",[B.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||B.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(B.widgetNode.insertLeft=!0)),B.collapsed){if(Mn(e,t.line,t,s,B)||t.line!=s.line&&Mn(e,s.line,t,s,B))throw new Error("Inserting collapsed marker partially overlapping an existing one");zt()}B.addToHistory&&Ws(e,{from:t,to:s,origin:"markText"},e.sel,NaN);var q=t.line,te=e.cm,de;if(e.iter(q,s.line+1,function(Ie){te&&B.collapsed&&!te.options.lineWrapping&&nn(Ie)==te.display.maxLine&&(de=!0),B.collapsed&&q!=t.line&&qt(Ie,0),bn(Ie,new $t(B,q==t.line?t.ch:null,q==s.line?s.ch:null)),++q}),B.collapsed&&e.iter(t.line,s.line+1,function(Ie){Tr(e,Ie)&&qt(Ie,0)}),B.clearOnEnter&&Pe(B,"beforeCursorEnter",function(){return B.clear()}),B.readOnly&&(Bt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),B.collapsed&&(B.id=++ao,B.atomic=!0),te){if(de&&(te.curOp.updateMaxLine=!0),B.collapsed)sr(te,t.line,s.line+1);else if(B.className||B.startStyle||B.endStyle||B.css||B.attributes||B.title)for(var Ae=t.line;Ae<=s.line;Ae++)jr(te,Ae,"text");B.atomic&&Ys(te.doc),hn(te,"markerAdded",te,B)}return B}var Ui=function(e,t){this.markers=e,this.primary=t;for(var s=0;s<e.length;++s)e[s].parent=this};Ui.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();hn(this,"clear")},Ui.prototype.find=function(e,t){return this.primary.find(e,t)},ve(Ui);function xl(e,t,s,r,m){r=b(r),r.shared=!1;var B=[mi(e,t,s,r,m)],X=B[0],q=r.widgetNode;return Gr(e,function(te){q&&(r.widgetNode=q.cloneNode(!0)),B.push(mi(te,R(te,t),R(te,s),r,m));for(var de=0;de<te.linked.length;++de)if(te.linked[de].isParent)return;X=Z(B)}),new Ui(B,X)}function so(e){return e.findMarks(Qe(e.first,0),e.clipPos(Qe(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var s=0;s<t.length;s++){var r=t[s],m=r.find(),B=e.clipPos(m.from),X=e.clipPos(m.to);if(ht(B,X)){var q=mi(e,B,X,r.primary,r.primary.type);r.markers.push(q),q.parent=r}}}function wl(e){for(var t=function(r){var m=e[r],B=[m.primary.doc];Gr(m.primary.doc,function(te){return B.push(te)});for(var X=0;X<m.markers.length;X++){var q=m.markers[X];ne(B,q.doc)==-1&&(q.parent=null,m.markers.splice(X--,1))}},s=0;s<e.length;s++)t(s)}var Sl=0,or=function(e,t,s,r,m){if(!(this instanceof or))return new or(e,t,s,r,m);s==null&&(s=0),Ni.call(this,[new Mi([new cr("",null)])]),this.first=s,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=s;var B=Qe(s,0);this.sel=Hr(B),this.history=new na(null),this.id=++Sl,this.modeOption=t,this.lineSep=r,this.direction=m=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ja(this,{from:B,to:B,text:e}),Zn(this,Hr(B),Se)};or.prototype=Re(Ni.prototype,{constructor:or,iter:function(e,t,s){s?this.iterN(e-this.first,t-e,s):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var s=0,r=0;r<t.length;++r)s+=t[r].height;this.insertInner(e-this.first,t,s)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=jt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Vn(function(e){var t=Qe(this.first,0),s=this.first+this.size-1;fi(this,{from:t,to:Qe(s,ct(this,s).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ci(this.cm,0,0),Zn(this,Hr(t),Se)}),replaceRange:function(e,t,s,r){t=R(this,t),s=s?R(this,s):t,pi(this,e,t,s,r)},getRange:function(e,t,s){var r=Vt(this,R(this,e),R(this,t));return s===!1?r:r.join(s||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(On(this,e))return ct(this,e)},getLineNumber:function(e){return Wt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ct(this,e)),nn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return R(this,e)},getCursor:function(e){var t=this.sel.primary(),s;return e==null||e=="head"?s=t.head:e=="anchor"?s=t.anchor:e=="end"||e=="to"||e===!1?s=t.to():s=t.from(),s},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Vn(function(e,t,s){zs(this,R(this,typeof e=="number"?Qe(e,t||0):e),null,s)}),setSelection:Vn(function(e,t,s){zs(this,R(this,e),R(this,t||e),s)}),extendSelection:Vn(function(e,t,s){ia(this,R(this,e),t&&R(this,t),s)}),extendSelections:Vn(function(e,t){Gs(this,z(this,e),t)}),extendSelectionsBy:Vn(function(e,t){var s=ae(this.sel.ranges,e);Gs(this,z(this,s),t)}),setSelections:Vn(function(e,t,s){if(!e.length)return;for(var r=[],m=0;m<e.length;m++)r[m]=new yn(R(this,e[m].anchor),R(this,e[m].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Zn(this,Cr(this.cm,r,t),s)}),addSelection:Vn(function(e,t,s){var r=this.sel.ranges.slice(0);r.push(new yn(R(this,e),R(this,t||e))),Zn(this,Cr(this.cm,r,r.length-1),s)}),getSelection:function(e){for(var t=this.sel.ranges,s,r=0;r<t.length;r++){var m=Vt(this,t[r].from(),t[r].to());s=s?s.concat(m):m}return e===!1?s:s.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],s=this.sel.ranges,r=0;r<s.length;r++){var m=Vt(this,s[r].from(),s[r].to());e!==!1&&(m=m.join(e||this.lineSeparator())),t[r]=m}return t},replaceSelection:function(e,t,s){for(var r=[],m=0;m<this.sel.ranges.length;m++)r[m]=e;this.replaceSelections(r,t,s||"+input")},replaceSelections:Vn(function(e,t,s){for(var r=[],m=this.sel,B=0;B<m.ranges.length;B++){var X=m.ranges[B];r[B]={from:X.from(),to:X.to(),text:this.splitLines(e[B]),origin:s}}for(var q=t&&t!="end"&&hl(this,r,t),te=r.length-1;te>=0;te--)fi(this,r[te]);q?Vs(this,q):this.cm&&ui(this.cm)}),undo:Vn(function(){oa(this,"undo")}),redo:Vn(function(){oa(this,"redo")}),undoSelection:Vn(function(){oa(this,"undo",!0)}),redoSelection:Vn(function(){oa(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,s=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var m=0;m<e.undone.length;m++)e.undone[m].ranges||++s;return{undo:t,redo:s}},clearHistory:function(){var e=this;this.history=new na(this.history.maxGeneration),Gr(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:ci(this.history.done),undone:ci(this.history.undone)}},setHistory:function(e){var t=this.history=new na(this.history.maxGeneration);t.done=ci(e.done.slice(0),null,!0),t.undone=ci(e.undone.slice(0),null,!0)},setGutterMarker:Vn(function(e,t,s){return Pi(this,e,"gutter",function(r){var m=r.gutterMarkers||(r.gutterMarkers={});return m[t]=s,!s&&pe(m)&&(r.gutterMarkers=null),!0})}),clearGutter:Vn(function(e){var t=this;this.iter(function(s){s.gutterMarkers&&s.gutterMarkers[e]&&Pi(t,s,"gutter",function(){return s.gutterMarkers[e]=null,pe(s.gutterMarkers)&&(s.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!On(this,e))return null;if(t=e,e=ct(this,e),!e)return null}else if(t=Wt(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:Vn(function(e,t,s){return Pi(this,e,t=="gutter"?"gutter":"class",function(r){var m=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[m])r[m]=s;else{if(A(s).test(r[m]))return!1;r[m]+=" "+s}return!0})}),removeLineClass:Vn(function(e,t,s){return Pi(this,e,t=="gutter"?"gutter":"class",function(r){var m=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",B=r[m];if(B)if(s==null)r[m]=null;else{var X=B.match(A(s));if(!X)return!1;var q=X.index+X[0].length;r[m]=B.slice(0,X.index)+(!X.index||q==B.length?"":" ")+B.slice(q)||null}else return!1;return!0})}),addLineWidget:Vn(function(e,t,s){return El(this,e,t,s)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,s){return mi(this,R(this,e),R(this,t),s,s&&s.type||"range")},setBookmark:function(e,t){var s={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=R(this,e),mi(this,e,e,s,"bookmark")},findMarksAt:function(e){e=R(this,e);var t=[],s=ct(this,e.line).markedSpans;if(s)for(var r=0;r<s.length;++r){var m=s[r];(m.from==null||m.from<=e.ch)&&(m.to==null||m.to>=e.ch)&&t.push(m.marker.parent||m.marker)}return t},findMarks:function(e,t,s){e=R(this,e),t=R(this,t);var r=[],m=e.line;return this.iter(e.line,t.line+1,function(B){var X=B.markedSpans;if(X)for(var q=0;q<X.length;q++){var te=X[q];!(te.to!=null&&m==e.line&&e.ch>=te.to||te.from==null&&m!=e.line||te.from!=null&&m==t.line&&te.from>=t.ch)&&(!s||s(te.marker))&&r.push(te.marker.parent||te.marker)}++m}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var s=t.markedSpans;if(s)for(var r=0;r<s.length;++r)s[r].from!=null&&e.push(s[r].marker)}),e},posFromIndex:function(e){var t,s=this.first,r=this.lineSeparator().length;return this.iter(function(m){var B=m.text.length+r;if(B>e)return t=e,!0;e-=B,++s}),R(this,Qe(s,t))},indexFromPos:function(e){e=R(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var s=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+s}),t},copy:function(e){var t=new or(jt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,s=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<s&&(s=e.to);var r=new or(jt(this,t,s),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(r,so(this)),r},unlinkDoc:function(e){if(e instanceof An&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var s=this.linked[t];if(s.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(so(this));break}if(e.history==this.history){var r=[e.id];Gr(e,function(m){return r.push(m.id)},!0),e.history=new na(null),e.history.done=ci(this.history.done,r),e.history.undone=ci(this.history.undone,r)}},iterLinkedDocs:function(e){Gr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):bt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Vn(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)})}),or.prototype.eachLine=or.prototype.iter;var oo=0;function Cl(e){var t=this;if(lo(t),Fe(t,e)||Ir(t.display,e))return;ue(e),G&&(oo=+new Date);var s=Qr(t,e,!0),r=e.dataTransfer.files;if(!s||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var m=r.length,B=Array(m),X=0,q=function(){++X==m&&zn(t,function(){s=R(t.doc,s);var We={from:s,to:s,text:t.doc.splitLines(B.filter(function(Ze){return Ze!=null}).join(t.doc.lineSeparator())),origin:"paste"};fi(t.doc,We),Vs(t.doc,Hr(R(t.doc,s),R(t.doc,Kr(We))))})()},te=function(We,Ze){if(t.options.allowDropFileTypes&&ne(t.options.allowDropFileTypes,We.type)==-1){q();return}var ot=new FileReader;ot.onerror=function(){return q()},ot.onload=function(){var pt=ot.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(pt)){q();return}B[Ze]=pt,q()},ot.readAsText(We)},de=0;de<r.length;de++)te(r[de],de);else{if(t.state.draggingText&&t.doc.sel.contains(s)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Ae=e.dataTransfer.getData("Text");if(Ae){var Ie;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ie=t.listSelections()),aa(t.doc,Hr(s,s)),Ie)for(var He=0;He<Ie.length;++He)pi(t.doc,"",Ie[He].anchor,Ie[He].head,"drag");t.replaceSelection(Ae,"around","paste"),t.display.input.focus()}}catch(We){}}}function Ol(e,t){if(G&&(!e.state.draggingText||+new Date-oo<100)){xe(t);return}if(Fe(e,t)||Ir(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var s=c("img",null,null,"position: fixed; left: 0; top: 0;");s.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(s.width=s.height=1,e.display.wrapper.appendChild(s),s._top=s.offsetTop),t.dataTransfer.setDragImage(s,0,0),g&&s.parentNode.removeChild(s)}}function Al(e,t){var s=Qr(e,t);if(!s)return;var r=document.createDocumentFragment();_s(e,s,r),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),v(e.display.dragCursor,r)}function lo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function uo(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),s=[],r=0;r<t.length;r++){var m=t[r].CodeMirror;m&&s.push(m)}s.length&&s[0].operation(function(){for(var B=0;B<s.length;B++)e(s[B])})}var co=!1;function Rl(){if(co)return;Ll(),co=!0}function Ll(){var e;Pe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,uo(Dl)},100))}),Pe(window,"blur",function(){return uo(li)})}function Dl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Vr={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"},Bi=0;Bi<10;Bi++)Vr[Bi+48]=Vr[Bi+96]=String(Bi);for(var la=65;la<=90;la++)Vr[la]=String.fromCharCode(la);for(var ji=1;ji<=12;ji++)Vr[ji+111]=Vr[ji+63235]="F"+ji;var kr={};kr.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"},kr.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"},kr.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"},kr.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"]},kr.default=i?kr.macDefault:kr.pcDefault;function Il(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var s,r,m,B,X=0;X<t.length-1;X++){var q=t[X];if(/^(cmd|meta|m)$/i.test(q))B=!0;else if(/^a(lt)?$/i.test(q))s=!0;else if(/^(c|ctrl|control)$/i.test(q))r=!0;else if(/^s(hift)?$/i.test(q))m=!0;else throw new Error("Unrecognized modifier name: "+q)}return s&&(e="Alt-"+e),r&&(e="Ctrl-"+e),B&&(e="Cmd-"+e),m&&(e="Shift-"+e),e}function kl(e){var t={};for(var s in e)if(e.hasOwnProperty(s)){var r=e[s];if(/^(name|fallthrough|(de|at)tach)$/.test(s))continue;if(r=="..."){delete e[s];continue}for(var m=ae(s.split(" "),Il),B=0;B<m.length;B++){var X=void 0,q=void 0;B==m.length-1?(q=m.join(" "),X=r):(q=m.slice(0,B+1).join(" "),X="...");var te=t[q];if(!te)t[q]=X;else if(te!=X)throw new Error("Inconsistent bindings for "+q)}delete e[s]}for(var de in t)e[de]=t[de];return e}function gi(e,t,s,r){t=ua(t);var m=t.call?t.call(e,r):t[e];if(m===!1)return"nothing";if(m==="...")return"multi";if(m!=null&&s(m))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return gi(e,t.fallthrough,s,r);for(var B=0;B<t.fallthrough.length;B++){var X=gi(e,t.fallthrough[B],s,r);if(X)return X}}}function ho(e){var t=typeof e=="string"?e:Vr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function fo(e,t,s){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!s&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function po(e,t){if(g&&e.keyCode==34&&e.char)return!1;var s=Vr[e.keyCode];return s==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(s=e.code),fo(s,e,t))}function ua(e){return typeof e=="string"?kr[e]:e}function vi(e,t){for(var s=e.doc.sel.ranges,r=[],m=0;m<s.length;m++){for(var B=t(s[m]);r.length&&ht(B.from,Z(r).to)<=0;){var X=r.pop();if(ht(X.from,B.from)<0){B.from=X.from;break}}r.push(B)}pr(e,function(){for(var q=r.length-1;q>=0;q--)pi(e.doc,"",r[q].from,r[q].to,"+delete");ui(e)})}function Ga(e,t,s){var r=Le(e.text,t+s,s);return r<0||r>e.text.length?null:r}function za(e,t,s){var r=Ga(e,t.ch,s);return r==null?null:new Qe(t.line,r,s<0?"after":"before")}function Va(e,t,s,r,m){if(e){t.doc.direction=="rtl"&&(m=-m);var B=lt(s,t.doc.direction);if(B){var X=m<0?Z(B):B[0],q=m<0==(X.level==1),te=q?"after":"before",de;if(X.level>0||t.doc.direction=="rtl"){var Ae=ai(t,s);de=m<0?s.text.length-1:0;var Ie=Rr(t,Ae,de).top;de=Ge(function(He){return Rr(t,Ae,He).top==Ie},m<0==(X.level==1)?X.from:X.to-1,de),te=="before"&&(de=Ga(s,de,1))}else de=m<0?X.to:X.from;return new Qe(r,de,te)}}return new Qe(r,m<0?s.text.length:0,m<0?"before":"after")}function Pl(e,t,s,r){var m=lt(t,e.doc.direction);if(!m)return za(t,s,r);s.ch>=t.text.length?(s.ch=t.text.length,s.sticky="before"):s.ch<=0&&(s.ch=0,s.sticky="after");var B=rt(m,s.ch,s.sticky),X=m[B];if(e.doc.direction=="ltr"&&X.level%2==0&&(r>0?X.to>s.ch:X.from<s.ch))return za(t,s,r);var q=function(Et,Ot){return Ga(t,Et instanceof Qe?Et.ch:Et,Ot)},te,de=function(Et){return e.options.lineWrapping?(te=te||ai(e,t),gs(e,t,te,Et)):{begin:0,end:t.text.length}},Ae=de(s.sticky=="before"?q(s,-1):s.ch);if(e.doc.direction=="rtl"||X.level==1){var Ie=X.level==1==r<0,He=q(s,Ie?1:-1);if(He!=null&&(Ie?He<=X.to&&He<=Ae.end:He>=X.from&&He>=Ae.begin)){var We=Ie?"before":"after";return new Qe(s.line,He,We)}}var Ze=function(Et,Ot,xt){for(var Dt=function(Sn,Xn){return Xn?new Qe(s.line,q(Sn,1),"before"):new Qe(s.line,Sn,"after")};Et>=0&&Et<m.length;Et+=Ot){var Ht=m[Et],Ft=Ot>0==(Ht.level!=1),tn=Ft?xt.begin:q(xt.end,-1);if(Ht.from<=tn&&tn<Ht.to)return Dt(tn,Ft);if(tn=Ft?Ht.from:q(Ht.to,-1),xt.begin<=tn&&tn<xt.end)return Dt(tn,Ft)}},ot=Ze(B+r,r,Ae);if(ot)return ot;var pt=r>0?Ae.end:q(Ae.begin,-1);return pt!=null&&!(r>0&&pt==t.text.length)&&(ot=Ze(r>0?0:m.length-1,r,de(pt)),ot)?ot:null}var Wi={selectAll:Qs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Se)},killLine:function(e){return vi(e,function(t){if(t.empty()){var s=ct(e.doc,t.head.line).text.length;return t.head.ch==s&&t.head.line<e.lastLine()?{from:t.head,to:Qe(t.head.line+1,0)}:{from:t.head,to:Qe(t.head.line,s)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return vi(e,function(t){return{from:Qe(t.from().line,0),to:R(e.doc,Qe(t.to().line+1,0))}})},delLineLeft:function(e){return vi(e,function(t){return{from:Qe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return vi(e,function(t){var s=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:s},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return vi(e,function(t){var s=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:s},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Qe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Qe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return mo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return go(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Ml(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var s=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:s},"div")},se)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var s=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:s},"div")},se)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var s=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:s},"div");return r.ch<e.getLine(r.line).search(/\S/)?go(e,t.head):r},se)},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=[],s=e.listSelections(),r=e.options.tabSize,m=0;m<s.length;m++){var B=s[m].from(),X=K(e.getLine(B.line),B.ch,r);t.push(le(r-X%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return pr(e,function(){for(var t=e.listSelections(),s=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var m=t[r].head,B=ct(e.doc,m.line).text;if(B){if(m.ch==B.length&&(m=new Qe(m.line,m.ch-1)),m.ch>0)m=new Qe(m.line,m.ch+1),e.replaceRange(B.charAt(m.ch-1)+B.charAt(m.ch-2),Qe(m.line,m.ch-2),m,"+transpose");else if(m.line>e.doc.first){var X=ct(e.doc,m.line-1).text;X&&(m=new Qe(m.line,1),e.replaceRange(B.charAt(0)+e.doc.lineSeparator()+X.charAt(X.length-1),Qe(m.line-1,X.length-1),m,"+transpose"))}}s.push(new yn(m,m))}e.setSelections(s)})},newlineAndIndent:function(e){return pr(e,function(){for(var t=e.listSelections(),s=t.length-1;s>=0;s--)e.replaceRange(e.doc.lineSeparator(),t[s].anchor,t[s].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);ui(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function mo(e,t){var s=ct(e.doc,t),r=nn(s);return r!=s&&(t=Wt(r)),Va(!0,e,r,t,1)}function Ml(e,t){var s=ct(e.doc,t),r=xr(s);return r!=s&&(t=Wt(r)),Va(!0,e,s,t,-1)}function go(e,t){var s=mo(e,t.line),r=ct(e.doc,s.line),m=lt(r,e.doc.direction);if(!m||m[0].level==0){var B=Math.max(s.ch,r.text.search(/\S/)),X=t.line==s.line&&t.ch<=B&&t.ch;return Qe(s.line,X?0:B,s.sticky)}return s}function da(e,t,s){if(typeof t=="string"&&(t=Wi[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,m=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),s&&(e.display.shift=!1),m=t(e)!=we}finally{e.display.shift=r,e.state.suppressEdits=!1}return m}function Nl(e,t,s){for(var r=0;r<e.state.keyMaps.length;r++){var m=gi(t,e.state.keyMaps[r],s,e);if(m)return m}return e.options.extraKeys&&gi(t,e.options.extraKeys,s,e)||gi(t,e.options.keyMap,s,e)}var Fl=new Q;function Hi(e,t,s,r){var m=e.state.keySeq;if(m){if(ho(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==m&&(e.state.keySeq=null,e.display.input.reset())}),vo(e,m+" "+t,s,r))return!0}return vo(e,t,s,r)}function vo(e,t,s,r){var m=Nl(e,t,r);return m=="multi"&&(e.state.keySeq=t),m=="handled"&&hn(e,"keyHandled",e,t,s),(m=="handled"||m=="multi")&&(ue(s),Ra(e)),!!m}function yo(e,t){var s=po(t,!0);return s?t.shiftKey&&!e.state.keySeq?Hi(e,"Shift-"+s,t,function(r){return da(e,r,!0)})||Hi(e,s,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return da(e,r)}):Hi(e,s,t,function(r){return da(e,r)}):!1}function Ul(e,t,s){return Hi(e,"'"+s+"'",t,function(r){return da(e,r,!0)})}var Xa=null;function bo(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=U(),Fe(t,e))return;G&&W<11&&e.keyCode==27&&(e.returnValue=!1);var s=e.keyCode;t.display.shift=s==16||e.shiftKey;var r=yo(t,e);g&&(Xa=r?s:null,!r&&s==88&&!wt&&(i?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),N&&!i&&!r&&s==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),s==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;F(t,"CodeMirror-crosshair");function s(r){(r.keyCode==18||!r.altKey)&&(_(t,"CodeMirror-crosshair"),Xe(document,"keyup",s),Xe(document,"mouseover",s))}Pe(document,"keyup",s),Pe(document,"mouseover",s)}function _o(e){e.keyCode==16&&(this.doc.sel.shift=!1),Fe(this,e)}function Eo(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Ir(t.display,e)||Fe(t,e)||e.ctrlKey&&!e.altKey||i&&e.metaKey)return;var s=e.keyCode,r=e.charCode;if(g&&s==Xa){Xa=null,ue(e);return}if(g&&(!e.which||e.which<10)&&yo(t,e))return;var m=String.fromCharCode(r==null?s:r);if(m=="\b")return;if(Ul(t,e,m))return;t.display.input.onKeyPress(e)}var jl=400,Ya=function(e,t,s){this.time=e,this.pos=t,this.button=s};Ya.prototype.compare=function(e,t,s){return this.time+jl>e&&ht(t,this.pos)==0&&s==this.button};var Ki,Gi;function Wl(e,t){var s=+new Date;return Gi&&Gi.compare(s,e,t)?(Ki=Gi=null,"triple"):Ki&&Ki.compare(s,e,t)?(Gi=new Ya(s,e,t),Ki=null,"double"):(Ki=new Ya(s,e,t),Gi=null,"single")}function xo(e){var t=this,s=t.display;if(Fe(t,e)||s.activeTouch&&s.input.supportsTouch())return;if(s.input.ensurePolled(),s.shift=e.shiftKey,Ir(s,e)){n||(s.scroller.draggable=!1,setTimeout(function(){return s.scroller.draggable=!0},100));return}if($a(t,e))return;var r=Qr(t,e),m=Ue(e),B=r?Wl(r,m):"single";if(window.focus(),m==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,m,r,B,e))return;m==1?r?Gl(t,r,B,e):Oe(e)==s.scroller&&ue(e):m==2?(r&&ia(t.doc,r),setTimeout(function(){return s.input.focus()},20)):m==3&&(L?t.display.input.onContextMenu(e):xs(t))}function Hl(e,t,s,r,m){var B="Click";return r=="double"?B="Double"+B:r=="triple"&&(B="Triple"+B),B=(t==1?"Left":t==2?"Middle":"Right")+B,Hi(e,fo(B,m),m,function(X){if(typeof X=="string"&&(X=Wi[X]),!X)return!1;var q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),q=X(e,s)!=we}finally{e.state.suppressEdits=!1}return q})}function Kl(e,t,s){var r=e.getOption("configureMouse"),m=r?r(e,t,s):{};if(m.unit==null){var B=o?s.shiftKey&&s.metaKey:s.altKey;m.unit=B?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(m.extend==null||e.doc.extend)&&(m.extend=e.doc.extend||s.shiftKey),m.addNew==null&&(m.addNew=i?s.metaKey:s.ctrlKey),m.moveOnDrag==null&&(m.moveOnDrag=!(i?s.altKey:s.ctrlKey)),m}function Gl(e,t,s,r){G?setTimeout(I(Es,e),0):e.curOp.focus=U();var m=Kl(e,s,r),B=e.doc.sel,X;e.options.dragDrop&&Ke&&!e.isReadOnly()&&s=="single"&&(X=B.contains(t))>-1&&(ht((X=B.ranges[X]).from(),t)<0||t.xRel>0)&&(ht(X.to(),t)>0||t.xRel<0)?zl(e,r,t,m):Vl(e,r,t,m)}function zl(e,t,s,r){var m=e.display,B=!1,X=zn(e,function(de){n&&(m.scroller.draggable=!1),e.state.draggingText=!1,Xe(m.wrapper.ownerDocument,"mouseup",X),Xe(m.wrapper.ownerDocument,"mousemove",q),Xe(m.scroller,"dragstart",te),Xe(m.scroller,"drop",X),B||(ue(de),r.addNew||ia(e.doc,s,null,null,r.extend),n&&!p||G&&W==9?setTimeout(function(){m.wrapper.ownerDocument.body.focus({preventScroll:!0}),m.input.focus()},20):m.input.focus())}),q=function(de){B=B||Math.abs(t.clientX-de.clientX)+Math.abs(t.clientY-de.clientY)>=10},te=function(){return B=!0};n&&(m.scroller.draggable=!0),e.state.draggingText=X,X.copy=!r.moveOnDrag,m.scroller.dragDrop&&m.scroller.dragDrop(),Pe(m.wrapper.ownerDocument,"mouseup",X),Pe(m.wrapper.ownerDocument,"mousemove",q),Pe(m.scroller,"dragstart",te),Pe(m.scroller,"drop",X),xs(e),setTimeout(function(){return m.input.focus()},20)}function To(e,t,s){if(s=="char")return new yn(t,t);if(s=="word")return e.findWordAt(t);if(s=="line")return new yn(Qe(t.line,0),R(e.doc,Qe(t.line+1,0)));var r=s(e,t);return new yn(r.from,r.to)}function Vl(e,t,s,r){var m=e.display,B=e.doc;ue(t);var X,q,te=B.sel,de=te.ranges;if(r.addNew&&!r.extend?(q=B.sel.contains(s),q>-1?X=de[q]:X=new yn(s,s)):(X=B.sel.primary(),q=B.sel.primIndex),r.unit=="rectangle")r.addNew||(X=new yn(s,s)),s=Qr(e,t,!0,!0),q=-1;else{var Ae=To(e,s,r.unit);r.extend?X=Ha(X,Ae.anchor,Ae.head,r.extend):X=Ae}r.addNew?q==-1?(q=de.length,Zn(B,Cr(e,de.concat([X]),q),{scroll:!1,origin:"*mouse"})):de.length>1&&de[q].empty()&&r.unit=="char"&&!r.extend?(Zn(B,Cr(e,de.slice(0,q).concat(de.slice(q+1)),0),{scroll:!1,origin:"*mouse"}),te=B.sel):Ka(B,q,X,he):(q=0,Zn(B,new br([X],0),he),te=B.sel);var Ie=s;function He(xt){if(ht(Ie,xt)==0)return;if(Ie=xt,r.unit=="rectangle"){for(var Dt=[],Ht=e.options.tabSize,Ft=K(ct(B,s.line).text,s.ch,Ht),tn=K(ct(B,xt.line).text,xt.ch,Ht),Sn=Math.min(Ft,tn),Xn=Math.max(Ft,tn),Rn=Math.min(s.line,xt.line),mr=Math.min(e.lastLine(),Math.max(s.line,xt.line));Rn<=mr;Rn++){var lr=ct(B,Rn).text,jn=me(lr,Sn,Ht);Sn==Xn?Dt.push(new yn(Qe(Rn,jn),Qe(Rn,jn))):lr.length>jn&&Dt.push(new yn(Qe(Rn,jn),Qe(Rn,me(lr,Xn,Ht))))}Dt.length||Dt.push(new yn(s,s)),Zn(B,Cr(e,te.ranges.slice(0,q).concat(Dt),q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(xt)}else{var ur=X,Jn=To(e,xt,r.unit),Hn=ur.anchor,Wn;ht(Jn.anchor,Hn)>0?(Wn=Jn.head,Hn=fn(ur.from(),Jn.anchor)):(Wn=Jn.anchor,Hn=_n(ur.to(),Jn.head));var In=te.ranges.slice(0);In[q]=Xl(e,new yn(R(B,Hn),Wn)),Zn(B,Cr(e,In,q),he)}}var We=m.wrapper.getBoundingClientRect(),Ze=0;function ot(xt){var Dt=++Ze,Ht=Qr(e,xt,!0,r.unit=="rectangle");if(!Ht)return;if(ht(Ht,Ie)!=0){e.curOp.focus=U(),He(Ht);var Ft=Zi(m,B);(Ht.line>=Ft.to||Ht.line<Ft.from)&&setTimeout(zn(e,function(){Ze==Dt&&ot(xt)}),150)}else{var tn=xt.clientY<We.top?-20:xt.clientY>We.bottom?20:0;tn&&setTimeout(zn(e,function(){if(Ze!=Dt)return;m.scroller.scrollTop+=tn,ot(xt)}),50)}}function pt(xt){e.state.selectingText=!1,Ze=Infinity,xt&&(ue(xt),m.input.focus()),Xe(m.wrapper.ownerDocument,"mousemove",Et),Xe(m.wrapper.ownerDocument,"mouseup",Ot),B.history.lastSelOrigin=null}var Et=zn(e,function(xt){xt.buttons===0||!Ue(xt)?pt(xt):ot(xt)}),Ot=zn(e,pt);e.state.selectingText=Ot,Pe(m.wrapper.ownerDocument,"mousemove",Et),Pe(m.wrapper.ownerDocument,"mouseup",Ot)}function Xl(e,t){var s=t.anchor,r=t.head,m=ct(e.doc,s.line);if(ht(s,r)==0&&s.sticky==r.sticky)return t;var B=lt(m);if(!B)return t;var X=rt(B,s.ch,s.sticky),q=B[X];if(q.from!=s.ch&&q.to!=s.ch)return t;var te=X+(q.from==s.ch==(q.level!=1)?0:1);if(te==0||te==B.length)return t;var de;if(r.line!=s.line)de=(r.line-s.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ae=rt(B,r.ch,r.sticky),Ie=Ae-X||(r.ch-s.ch)*(q.level==1?-1:1);Ae==te-1||Ae==te?de=Ie<0:de=Ie>0}var He=B[te+(de?-1:0)],We=de==(He.level==1),Ze=We?He.from:He.to,ot=We?"after":"before";return s.ch==Ze&&s.sticky==ot?t:new yn(new Qe(s.line,Ze,ot),r)}function wo(e,t,s,r){var m,B;if(t.touches)m=t.touches[0].clientX,B=t.touches[0].clientY;else try{m=t.clientX,B=t.clientY}catch(He){return!1}if(m>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ue(t);var X=e.display,q=X.lineDiv.getBoundingClientRect();if(B>q.bottom||!ye(e,s))return be(t);B-=q.top-X.viewOffset;for(var te=0;te<e.display.gutterSpecs.length;++te){var de=X.gutters.childNodes[te];if(de&&de.getBoundingClientRect().right>=m){var Ae=rn(e.doc,B),Ie=e.display.gutterSpecs[te];return je(e,s,e,Ae,Ie.className,t),be(t)}}}function $a(e,t){return wo(e,t,"gutterClick",!0)}function So(e,t){if(Ir(e.display,t)||Yl(e,t))return;if(Fe(e,t,"contextmenu"))return;L||e.display.input.onContextMenu(t)}function Yl(e,t){return ye(e,"gutterContextMenu")?wo(e,t,"gutterContextMenu",!1):!1}function Co(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),wi(e)}var yi={toString:function(){return"CodeMirror.Init"}},Oo={},ca={};function $l(e){var t=e.optionHandlers;function s(r,m,B,X){e.defaults[r]=m,B&&(t[r]=X?function(q,te,de){de!=yi&&B(q,te,de)}:B)}e.defineOption=s,e.Init=yi,s("value","",function(r,m){return r.setValue(m)},!0),s("mode",null,function(r,m){r.doc.modeOption=m,Ba(r)},!0),s("indentUnit",2,Ba,!0),s("indentWithTabs",!1),s("smartIndent",!0),s("tabSize",4,function(r){Ii(r),wi(r),sr(r)},!0),s("lineSeparator",null,function(r,m){if(r.doc.lineSep=m,!m)return;var B=[],X=r.doc.first;r.doc.iter(function(te){for(var de=0;;){var Ae=te.text.indexOf(m,de);if(Ae==-1)break;de=Ae+m.length,B.push(Qe(X,Ae))}X++});for(var q=B.length-1;q>=0;q--)pi(r.doc,m,B[q],Qe(B[q].line,B[q].ch+m.length))}),s("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,m,B){r.state.specialChars=new RegExp(m.source+(m.test(" ")?"":"| "),"g"),B!=yi&&r.refresh()}),s("specialCharPlaceholder",En,function(r){return r.refresh()},!0),s("electricChars",!0),s("inputStyle",d?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),s("spellcheck",!1,function(r,m){return r.getInputField().spellcheck=m},!0),s("autocorrect",!1,function(r,m){return r.getInputField().autocorrect=m},!0),s("autocapitalize",!1,function(r,m){return r.getInputField().autocapitalize=m},!0),s("rtlMoveVisually",!O),s("wholeLineUpdateBefore",!0),s("theme","default",function(r){Co(r),Di(r)},!0),s("keyMap","default",function(r,m,B){var X=ua(m),q=B!=yi&&ua(B);q&&q.detach&&q.detach(r,X),X.attach&&X.attach(r,q||null)}),s("extraKeys",null),s("configureMouse",null),s("lineWrapping",!1,Ql,!0),s("gutters",[],function(r,m){r.display.gutterSpecs=Fa(m,r.options.lineNumbers),Di(r)},!0),s("fixedGutter",!0,function(r,m){r.display.gutters.style.left=m?Oa(r.display)+"px":"0",r.refresh()},!0),s("coverGutterNextToScrollbar",!1,function(r){return di(r)},!0),s("scrollbarStyle","native",function(r){As(r),di(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),s("lineNumbers",!1,function(r,m){r.display.gutterSpecs=Fa(r.options.gutters,m),Di(r)},!0),s("firstLineNumber",1,Di,!0),s("lineNumberFormatter",function(r){return r},Di,!0),s("showCursorWhenSelecting",!1,Si,!0),s("resetSelectionOnContextMenu",!0),s("lineWiseCopyCut",!0),s("pasteLinesPerSelection",!0),s("selectionsMayTouch",!1),s("readOnly",!1,function(r,m){m=="nocursor"&&(li(r),r.display.input.blur()),r.display.input.readOnlyChanged(m)}),s("screenReaderLabel",null,function(r,m){m=m===""?null:m,r.display.input.screenReaderLabelChanged(m)}),s("disableInput",!1,function(r,m){m||r.display.input.reset()},!0),s("dragDrop",!0,Jl),s("allowDropFileTypes",null),s("cursorBlinkRate",530),s("cursorScrollMargin",0),s("cursorHeight",1,Si,!0),s("singleCursorHeightPerLine",!0,Si,!0),s("workTime",100),s("workDelay",100),s("flattenSpans",!0,Ii,!0),s("addModeClass",!1,Ii,!0),s("pollInterval",100),s("undoDepth",200,function(r,m){return r.doc.history.undoDepth=m}),s("historyEventDelay",1250),s("viewportMargin",10,function(r){return r.refresh()},!0),s("maxHighlightLength",1e4,Ii,!0),s("moveInputWithCursor",!0,function(r,m){m||r.display.input.resetPosition()}),s("tabindex",null,function(r,m){return r.display.input.getField().tabIndex=m||""}),s("autofocus",null),s("direction","ltr",function(r,m){return r.doc.setDirection(m)},!0),s("phrases",null)}function Jl(e,t,s){var r=s&&s!=yi;if(!t!=!r){var m=e.display.dragFunctions,B=t?Pe:Xe;B(e.display.scroller,"dragstart",m.start),B(e.display.scroller,"dragenter",m.enter),B(e.display.scroller,"dragover",m.over),B(e.display.scroller,"dragleave",m.leave),B(e.display.scroller,"drop",m.drop)}}function Ql(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(_(e.display.wrapper,"CodeMirror-wrap"),Fr(e)),Aa(e),sr(e),wi(e),setTimeout(function(){return di(e)},100)}function An(e,t){var s=this;if(!(this instanceof An))return new An(e,t);this.options=t=t?b(t):{},b(Oo,t,!1);var r=t.value;typeof r=="string"?r=new or(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var m=new An.inputStyles[t.inputStyle](this),B=this.display=new dl(e,r,m,t);B.wrapper.CodeMirror=this,Co(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),As(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 Q,keySeq:null,specialChars:null},t.autofocus&&!d&&B.input.focus(),G&&W<11&&setTimeout(function(){return s.display.input.reset(!0)},20),Zl(this),Rl(),ti(this),this.curOp.forceUpdate=!0,Us(this,r),t.autofocus&&!d||this.hasFocus()?setTimeout(function(){s.hasFocus()&&!s.state.focused&&La(s)},20):li(this);for(var X in ca)ca.hasOwnProperty(X)&&ca[X](this,t[X],yi);Ds(this),t.finishInit&&t.finishInit(this);for(var q=0;q<Ja.length;++q)Ja[q](this);ni(this),n&&t.lineWrapping&&getComputedStyle(B.lineDiv).textRendering=="optimizelegibility"&&(B.lineDiv.style.textRendering="auto")}An.defaults=Oo,An.optionHandlers=ca;function Zl(e){var t=e.display;Pe(t.scroller,"mousedown",zn(e,xo)),G&&W<11?Pe(t.scroller,"dblclick",zn(e,function(te){if(Fe(e,te))return;var de=Qr(e,te);if(!de||$a(e,te)||Ir(e.display,te))return;ue(te);var Ae=e.findWordAt(de);ia(e.doc,Ae.anchor,Ae.head)})):Pe(t.scroller,"dblclick",function(te){return Fe(e,te)||ue(te)}),Pe(t.scroller,"contextmenu",function(te){return So(e,te)}),Pe(t.input.getField(),"contextmenu",function(te){t.scroller.contains(te.target)||So(e,te)});var s,r={end:0};function m(){t.activeTouch&&(s=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function B(te){if(te.touches.length!=1)return!1;var de=te.touches[0];return de.radiusX<=1&&de.radiusY<=1}function X(te,de){if(de.left==null)return!0;var Ae=de.left-te.left,Ie=de.top-te.top;return Ae*Ae+Ie*Ie>20*20}Pe(t.scroller,"touchstart",function(te){if(!Fe(e,te)&&!B(te)&&!$a(e,te)){t.input.ensurePolled(),clearTimeout(s);var de=+new Date;t.activeTouch={start:de,moved:!1,prev:de-r.end<=300?r:null},te.touches.length==1&&(t.activeTouch.left=te.touches[0].pageX,t.activeTouch.top=te.touches[0].pageY)}}),Pe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Pe(t.scroller,"touchend",function(te){var de=t.activeTouch;if(de&&!Ir(t,te)&&de.left!=null&&!de.moved&&new Date-de.start<300){var Ae=e.coordsChar(t.activeTouch,"page"),Ie;!de.prev||X(de,de.prev)?Ie=new yn(Ae,Ae):!de.prev.prev||X(de,de.prev.prev)?Ie=e.findWordAt(Ae):Ie=new yn(Qe(Ae.line,0),R(e.doc,Qe(Ae.line+1,0))),e.setSelection(Ie.anchor,Ie.head),e.focus(),ue(te)}m()}),Pe(t.scroller,"touchcancel",m),Pe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Oi(e,t.scroller.scrollTop),qr(e,t.scroller.scrollLeft,!0),je(e,"scroll",e))}),Pe(t.scroller,"mousewheel",function(te){return Ps(e,te)}),Pe(t.scroller,"DOMMouseScroll",function(te){return Ps(e,te)}),Pe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(te){Fe(e,te)||xe(te)},over:function(te){Fe(e,te)||(Al(e,te),xe(te))},start:function(te){return Ol(e,te)},drop:zn(e,Cl),leave:function(te){Fe(e,te)||lo(e)}};var q=t.input.getField();Pe(q,"keyup",function(te){return _o.call(e,te)}),Pe(q,"keydown",zn(e,bo)),Pe(q,"keypress",zn(e,Eo)),Pe(q,"focus",function(te){return La(e,te)}),Pe(q,"blur",function(te){return li(e,te)})}var Ja=[];An.defineInitHook=function(e){return Ja.push(e)};function zi(e,t,s,r){var m=e.doc,B;s==null&&(s="add"),s=="smart"&&(m.mode.indent?B=ft(e,t).state:s="prev");var X=e.options.tabSize,q=ct(m,t),te=K(q.text,null,X);q.stateAfter&&(q.stateAfter=null);var de=q.text.match(/^\s*/)[0],Ae;if(!r&&!/\S/.test(q.text))Ae=0,s="not";else if(s=="smart"&&(Ae=m.mode.indent(B,q.text.slice(de.length),q.text),Ae==we||Ae>150)){if(!r)return;s="prev"}s=="prev"?t>m.first?Ae=K(ct(m,t-1).text,null,X):Ae=0:s=="add"?Ae=te+e.options.indentUnit:s=="subtract"?Ae=te-e.options.indentUnit:typeof s=="number"&&(Ae=te+s),Ae=Math.max(0,Ae);var Ie="",He=0;if(e.options.indentWithTabs)for(var We=Math.floor(Ae/X);We;--We)He+=X,Ie+=" ";if(He<Ae&&(Ie+=le(Ae-He)),Ie!=de)return pi(m,Ie,Qe(t,0),Qe(t,de.length),"+input"),q.stateAfter=null,!0;for(var Ze=0;Ze<m.sel.ranges.length;Ze++){var ot=m.sel.ranges[Ze];if(ot.head.line==t&&ot.head.ch<de.length){var pt=Qe(t,de.length);Ka(m,Ze,new yn(pt,pt));break}}}var Or=null;function ha(e){Or=e}function Qa(e,t,s,r,m){var B=e.doc;e.display.shift=!1,r||(r=B.sel);var X=+new Date-200,q=m=="paste"||e.state.pasteIncoming>X,te=bt(t),de=null;if(q&&r.ranges.length>1)if(Or&&Or.text.join(`
`)==t){if(r.ranges.length%Or.text.length==0){de=[];for(var Ae=0;Ae<Or.text.length;Ae++)de.push(B.splitLines(Or.text[Ae]))}}else te.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(de=ae(te,function(Et){return[Et]}));for(var Ie=e.curOp.updateInput,He=r.ranges.length-1;He>=0;He--){var We=r.ranges[He],Ze=We.from(),ot=We.to();We.empty()&&(s&&s>0?Ze=Qe(Ze.line,Ze.ch-s):e.state.overwrite&&!q?ot=Qe(ot.line,Math.min(ct(B,ot.line).text.length,ot.ch+Z(te).length)):q&&Or&&Or.lineWise&&Or.text.join(`
`)==te.join(`
`)&&(Ze=ot=Qe(Ze.line,0)));var pt={from:Ze,to:ot,text:de?de[He%de.length]:te,origin:m||(q?"paste":e.state.cutIncoming>X?"cut":"+input")};fi(e.doc,pt),hn(e,"inputRead",e,pt)}t&&!q&&Ro(e,t),ui(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ie),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ao(e,t){var s=e.clipboardData&&e.clipboardData.getData("Text");if(s)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&pr(t,function(){return Qa(t,s,0,null,"paste")}),!0}function Ro(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var s=e.doc.sel,r=s.ranges.length-1;r>=0;r--){var m=s.ranges[r];if(m.head.ch>100||r&&s.ranges[r-1].head.line==m.head.line)continue;var B=e.getModeAt(m.head),X=!1;if(B.electricChars){for(var q=0;q<B.electricChars.length;q++)if(t.indexOf(B.electricChars.charAt(q))>-1){X=zi(e,m.head.line,"smart");break}}else B.electricInput&&(B.electricInput.test(ct(e.doc,m.head.line).text.slice(0,m.head.ch))&&(X=zi(e,m.head.line,"smart")));X&&hn(e,"electricInput",e,m.head.line)}}function Lo(e){for(var t=[],s=[],r=0;r<e.doc.sel.ranges.length;r++){var m=e.doc.sel.ranges[r].head.line,B={anchor:Qe(m,0),head:Qe(m+1,0)};s.push(B),t.push(e.getRange(B.anchor,B.head))}return{text:t,ranges:s}}function Do(e,t,s,r){e.setAttribute("autocorrect",s?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Io(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),f&&(e.style.border="1px solid black"),Do(e),t}function ql(e){var t=e.optionHandlers,s=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,m){var B=this.options,X=B[r];if(B[r]==m&&r!="mode")return;B[r]=m,t.hasOwnProperty(r)&&zn(this,t[r])(this,m,X),je(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,m){this.state.keyMaps[m?"push":"unshift"](ua(r))},removeKeyMap:function(r){for(var m=this.state.keyMaps,B=0;B<m.length;++B)if(m[B]==r||m[B].name==r)return m.splice(B,1),!0},addOverlay:ir(function(r,m){var B=r.token?r:e.getMode(this.options,r);if(B.startState)throw new Error("Overlays may not be stateful.");oe(this.state.overlays,{mode:B,modeSpec:r,opaque:m&&m.opaque,priority:m&&m.priority||0},function(X){return X.priority}),this.state.modeGen++,sr(this)}),removeOverlay:ir(function(r){for(var m=this.state.overlays,B=0;B<m.length;++B){var X=m[B].modeSpec;if(X==r||typeof r=="string"&&X.name==r){m.splice(B,1),this.state.modeGen++,sr(this);return}}}),indentLine:ir(function(r,m,B){typeof m!="string"&&typeof m!="number"&&(m==null?m=this.options.smartIndent?"smart":"prev":m=m?"add":"subtract"),On(this.doc,r)&&zi(this,r,m,B)}),indentSelection:ir(function(r){for(var m=this.doc.sel.ranges,B=-1,X=0;X<m.length;X++){var q=m[X];if(q.empty())q.head.line>B&&(zi(this,q.head.line,r,!0),B=q.head.line,X==this.doc.sel.primIndex&&ui(this));else{var te=q.from(),de=q.to(),Ae=Math.max(B,te.line);B=Math.min(this.lastLine(),de.line-(de.ch?0:1))+1;for(var Ie=Ae;Ie<B;++Ie)zi(this,Ie,r);var He=this.doc.sel.ranges;te.ch==0&&m.length==He.length&&He[X].from().ch>0&&Ka(this.doc,X,new yn(te,He[X].to()),Se)}}}),getTokenAt:function(r,m){return mn(this,r,m)},getLineTokens:function(r,m){return mn(this,Qe(r),m,!0)},getTokenTypeAt:function(r){r=R(this.doc,r);var m=qe(this,ct(this.doc,r.line)),B=0,X=(m.length-1)/2,q=r.ch,te;if(q==0)te=m[2];else for(;;){var de=B+X>>1;if((de?m[de*2-1]:0)>=q)X=de;else if(m[de*2+1]<q)B=de+1;else{te=m[de*2+2];break}}var Ae=te?te.indexOf("overlay "):-1;return Ae<0?te:Ae==0?null:te.slice(0,Ae-1)},getModeAt:function(r){var m=this.doc.mode;return m.innerMode?e.innerMode(m,this.getTokenAt(r).state).mode:m},getHelper:function(r,m){return this.getHelpers(r,m)[0]},getHelpers:function(r,m){var B=[];if(!s.hasOwnProperty(m))return B;var X=s[m],q=this.getModeAt(r);if(typeof q[m]=="string")X[q[m]]&&B.push(X[q[m]]);else if(q[m])for(var te=0;te<q[m].length;te++){var de=X[q[m][te]];de&&B.push(de)}else q.helperType&&X[q.helperType]?B.push(X[q.helperType]):X[q.name]&&B.push(X[q.name]);for(var Ae=0;Ae<X._global.length;Ae++){var Ie=X._global[Ae];Ie.pred(q,this)&&ne(B,Ie.val)==-1&&B.push(Ie.val)}return B},getStateAfter:function(r,m){var B=this.doc;return r=Y(B,r==null?B.first+B.size-1:r),ft(this,r+1,m).state},cursorCoords:function(r,m){var B,X=this.doc.sel.primary();return r==null?B=X.head:typeof r=="object"?B=R(this.doc,r):B=r?X.from():X.to(),Sr(this,B,m||"page")},charCoords:function(r,m){return xa(this,R(this.doc,r),m||"page")},coordsChar:function(r,m){return r=fs(this,r,m||"page"),wa(this,r.left,r.top)},lineAtHeight:function(r,m){return r=fs(this,{top:r,left:0},m||"page").top,rn(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,m,B){var X=!1,q;if(typeof r=="number"){var te=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>te&&(r=te,X=!0),q=ct(this.doc,r)}else q=r;return Yi(this,q,{top:0,left:0},m||"page",B||X).top+(X?this.doc.height-gr(q):0)},defaultTextHeight:function(){return si(this.display)},defaultCharWidth:function(){return oi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,m,B,X,q){var te=this.display;r=Sr(this,R(this.doc,r));var de=r.bottom,Ae=r.left;if(m.style.position="absolute",m.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(m),te.sizer.appendChild(m),X=="over")de=r.top;else if(X=="above"||X=="near"){var Ie=Math.max(te.wrapper.clientHeight,this.doc.height),He=Math.max(te.sizer.clientWidth,te.lineSpace.clientWidth);(X=="above"||r.bottom+m.offsetHeight>Ie)&&r.top>m.offsetHeight?de=r.top-m.offsetHeight:r.bottom+m.offsetHeight<=Ie&&(de=r.bottom),Ae+m.offsetWidth>He&&(Ae=He-m.offsetWidth)}m.style.top=de+"px",m.style.left=m.style.right="",q=="right"?(Ae=te.sizer.clientWidth-m.offsetWidth,m.style.right="0px"):(q=="left"?Ae=0:q=="middle"&&(Ae=(te.sizer.clientWidth-m.offsetWidth)/2),m.style.left=Ae+"px"),B&&Jo(this,{left:Ae,top:de,right:Ae+m.offsetWidth,bottom:de+m.offsetHeight})},triggerOnKeyDown:ir(bo),triggerOnKeyPress:ir(Eo),triggerOnKeyUp:_o,triggerOnMouseDown:ir(xo),execCommand:function(r){if(Wi.hasOwnProperty(r))return Wi[r].call(null,this)},triggerElectric:ir(function(r){Ro(this,r)}),findPosH:function(r,m,B,X){var q=1;m<0&&(q=-1,m=-m);for(var te=R(this.doc,r),de=0;de<m&&!(te=Za(this.doc,te,q,B,X),te.hitSide);++de);return te},moveH:ir(function(r,m){var B=this;this.extendSelectionsBy(function(X){return B.display.shift||B.doc.extend||X.empty()?Za(B.doc,X.head,r,m,B.options.rtlMoveVisually):r<0?X.from():X.to()},se)}),deleteH:ir(function(r,m){var B=this.doc.sel,X=this.doc;B.somethingSelected()?X.replaceSelection("",null,"+delete"):vi(this,function(q){var te=Za(X,q.head,r,m,!1);return r<0?{from:te,to:q.head}:{from:q.head,to:te}})}),findPosV:function(r,m,B,X){var q=1,te=X;m<0&&(q=-1,m=-m);for(var de=R(this.doc,r),Ae=0;Ae<m;++Ae){var Ie=Sr(this,de,"div");if(te==null?te=Ie.left:Ie.left=te,de=ko(this,Ie,q,B),de.hitSide)break}return de},moveV:ir(function(r,m){var B=this,X=this.doc,q=[],te=!this.display.shift&&!X.extend&&X.sel.somethingSelected();if(X.extendSelectionsBy(function(Ae){if(te)return r<0?Ae.from():Ae.to();var Ie=Sr(B,Ae.head,"div");Ae.goalColumn!=null&&(Ie.left=Ae.goalColumn),q.push(Ie.left);var He=ko(B,Ie,r,m);return m=="page"&&Ae==X.sel.primary()&&Ia(B,xa(B,He,"div").top-Ie.top),He},se),q.length)for(var de=0;de<X.sel.ranges.length;de++)X.sel.ranges[de].goalColumn=q[de]}),findWordAt:function(r){var m=this.doc,B=ct(m,r.line).text,X=r.ch,q=r.ch;if(B){var te=this.getHelper(r,"wordChars");(r.sticky=="before"||q==B.length)&&X?--X:++q;for(var de=B.charAt(X),Ae=Be(de,te)?function(Ie){return Be(Ie,te)}:/\s/.test(de)?function(Ie){return/\s/.test(Ie)}:function(Ie){return!/\s/.test(Ie)&&!Be(Ie)};X>0&&Ae(B.charAt(X-1));)--X;for(;q<B.length&&Ae(B.charAt(q));)++q}return new yn(Qe(r.line,X),Qe(r.line,q))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):_(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:ir(function(r,m){Ci(this,r,m)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Ar(this)-this.display.barHeight,width:r.scrollWidth-Ar(this)-this.display.barWidth,clientHeight:ba(this),clientWidth:$r(this)}},scrollIntoView:ir(function(r,m){r==null?(r={from:this.doc.sel.primary().head,to:null},m==null&&(m=this.options.cursorScrollMargin)):typeof r=="number"?r={from:Qe(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=m||0,r.from.line!=null?Qo(this,r):ws(this,r.from,r.to,r.margin)}),setSize:ir(function(r,m){var B=this,X=function(te){return typeof te=="number"||/^\d+$/.test(String(te))?te+"px":te};r!=null&&(this.display.wrapper.style.width=X(r)),m!=null&&(this.display.wrapper.style.height=X(m)),this.options.lineWrapping&&ds(this);var q=this.display.viewFrom;this.doc.iter(q,this.display.viewTo,function(te){if(te.widgets){for(var de=0;de<te.widgets.length;de++)if(te.widgets[de].noHScroll){jr(B,q,"widget");break}}++q}),this.curOp.forceUpdate=!0,je(this,"refresh",this)}),operation:function(r){return pr(this,r)},startOperation:function(){return ti(this)},endOperation:function(){return ni(this)},refresh:ir(function(){var r=this.display.cachedTextHeight;sr(this),this.curOp.forceUpdate=!0,wi(this),Ci(this,this.doc.scrollLeft,this.doc.scrollTop),Ma(this.display),(r==null||Math.abs(r-si(this.display))>.5||this.options.lineWrapping)&&Aa(this),je(this,"refresh",this)}),swapDoc:ir(function(r){var m=this.doc;return m.cm=null,this.state.selectingText&&this.state.selectingText(),Us(this,r),wi(this),this.display.input.reset(),Ci(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,hn(this,"swapDoc",this,m),m}),phrase:function(r){var m=this.options.phrases;return m&&Object.prototype.hasOwnProperty.call(m,r)?m[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ve(e),e.registerHelper=function(r,m,B){s.hasOwnProperty(r)||(s[r]=e[r]={_global:[]}),s[r][m]=B},e.registerGlobalHelper=function(r,m,B,X){e.registerHelper(r,m,X),s[r]._global.push({pred:B,val:X})}}function Za(e,t,s,r,m){var B=t,X=s,q=ct(e,t.line),te=m&&e.direction=="rtl"?-s:s;function de(){var Ot=t.line+te;return Ot<e.first||Ot>=e.first+e.size?!1:(t=new Qe(Ot,t.ch,t.sticky),q=ct(e,Ot))}function Ae(Ot){var xt;if(r=="codepoint"){var Dt=q.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(Dt)?xt=null:xt=new Qe(t.line,Math.max(0,Math.min(q.text.length,t.ch+s*(Dt>=55296&&Dt<56320?2:1))),-s)}else m?xt=Pl(e.cm,q,t,s):xt=za(q,t,s);if(xt==null)if(!Ot&&de())t=Va(m,e.cm,q,t.line,te);else return!1;else t=xt;return!0}if(r=="char"||r=="codepoint")Ae();else if(r=="column")Ae(!0);else if(r=="word"||r=="group")for(var Ie=null,He=r=="group",We=e.cm&&e.cm.getHelper(t,"wordChars"),Ze=!0;!(s<0&&!Ae(!Ze));Ze=!1){var ot=q.text.charAt(t.ch)||`
`,pt=Be(ot,We)?"w":He&&ot==`
`?"n":!He||/\s/.test(ot)?null:"p";if(He&&!Ze&&!pt&&(pt="s"),Ie&&Ie!=pt){s<0&&(s=1,Ae(),t.sticky="after");break}if(pt&&(Ie=pt),s>0&&!Ae(!Ze))break}var Et=sa(e,t,B,X,!0);return Qt(B,Et)&&(Et.hitSide=!0),Et}function ko(e,t,s,r){var m=e.doc,B=t.left,X;if(r=="page"){var q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),te=Math.max(q-.5*si(e.display),3);X=(s>0?t.bottom:t.top)+s*te}else r=="line"&&(X=s>0?t.bottom+3:t.top-3);for(var de;!(de=wa(e,B,X),!de.outside);){if(s<0?X<=0:X>=m.height){de.hitSide=!0;break}X+=s*5}return de}var xn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};xn.prototype.init=function(e){var t=this,s=this,r=s.cm,m=s.div=e.lineDiv;Do(m,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function B(q){for(var te=q.target;te;te=te.parentNode){if(te==m)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(te.className))break}return!1}Pe(m,"paste",function(q){if(!B(q)||Fe(r,q)||Ao(q,r))return;W<=11&&setTimeout(zn(r,function(){return t.updateFromDOM()}),20)}),Pe(m,"compositionstart",function(q){t.composing={data:q.data,done:!1}}),Pe(m,"compositionupdate",function(q){t.composing||(t.composing={data:q.data,done:!1})}),Pe(m,"compositionend",function(q){t.composing&&(q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Pe(m,"touchstart",function(){return s.forceCompositionEnd()}),Pe(m,"input",function(){t.composing||t.readFromDOMSoon()});function X(q){if(!B(q)||Fe(r,q))return;if(r.somethingSelected())ha({lineWise:!1,text:r.getSelections()}),q.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var te=Lo(r);ha({lineWise:!0,text:te.text}),q.type=="cut"&&r.operation(function(){r.setSelections(te.ranges,0,Se),r.replaceSelection("",null,"cut")})}else return;if(q.clipboardData){q.clipboardData.clearData();var de=Or.text.join(`
`);if(q.clipboardData.setData("Text",de),q.clipboardData.getData("Text")==de){q.preventDefault();return}}var Ae=Io(),Ie=Ae.firstChild;r.display.lineSpace.insertBefore(Ae,r.display.lineSpace.firstChild),Ie.value=Or.text.join(`
`);var He=document.activeElement;M(Ie),setTimeout(function(){r.display.lineSpace.removeChild(Ae),He.focus(),He==m&&s.showPrimarySelection()},50)}Pe(m,"copy",X),Pe(m,"cut",X)},xn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},xn.prototype.prepareSelection=function(){var e=bs(this.cm,!1);return e.focus=document.activeElement==this.div,e},xn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},xn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},xn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,s=t.doc.sel.primary(),r=s.from(),m=s.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||m.line<t.display.viewFrom){e.removeAllRanges();return}var B=fa(t,e.anchorNode,e.anchorOffset),X=fa(t,e.focusNode,e.focusOffset);if(B&&!B.bad&&X&&!X.bad&&ht(fn(B,X),r)==0&&ht(_n(B,X),m)==0)return;var q=t.display.view,te=r.line>=t.display.viewFrom&&Po(t,r)||{node:q[0].measure.map[2],offset:0},de=m.line<t.display.viewTo&&Po(t,m);if(!de){var Ae=q[q.length-1].measure,Ie=Ae.maps?Ae.maps[Ae.maps.length-1]:Ae.map;de={node:Ie[Ie.length-1],offset:Ie[Ie.length-2]-Ie[Ie.length-3]}}if(!te||!de){e.removeAllRanges();return}var He=e.rangeCount&&e.getRangeAt(0),We;try{We=h(te.node,te.offset,de.offset,de.node)}catch(Ze){}We&&(!N&&t.state.focused?(e.collapse(te.node,te.offset),We.collapsed||(e.removeAllRanges(),e.addRange(We))):(e.removeAllRanges(),e.addRange(We)),He&&e.anchorNode==null?e.addRange(He):N&&this.startGracePeriod()),this.rememberSelection()},xn.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)},xn.prototype.showMultipleSelections=function(e){v(this.cm.display.cursorDiv,e.cursors),v(this.cm.display.selectionDiv,e.selection)},xn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},xn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return x(this.div,t)},xn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},xn.prototype.blur=function(){this.div.blur()},xn.prototype.getField=function(){return this.div},xn.prototype.supportsTouch=function(){return!0},xn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():pr(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)},xn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},xn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(u&&y&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var s=fa(t,e.anchorNode,e.anchorOffset),r=fa(t,e.focusNode,e.focusOffset);s&&r&&pr(t,function(){Zn(t.doc,Hr(s,r),Se),(s.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},xn.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,s=e.doc.sel.primary(),r=s.from(),m=s.to();if(r.ch==0&&r.line>e.firstLine()&&(r=Qe(r.line-1,ct(e.doc,r.line-1).length)),m.ch==ct(e.doc,m.line).text.length&&m.line<e.lastLine()&&(m=Qe(m.line+1,0)),r.line<t.viewFrom||m.line>t.viewTo-1)return!1;var B,X,q;r.line==t.viewFrom||(B=Zr(e,r.line))==0?(X=Wt(t.view[0].line),q=t.view[0].node):(X=Wt(t.view[B].line),q=t.view[B-1].node.nextSibling);var te=Zr(e,m.line),de,Ae;if(te==t.view.length-1?(de=t.viewTo-1,Ae=t.lineDiv.lastChild):(de=Wt(t.view[te+1].line)-1,Ae=t.view[te+1].node.previousSibling),!q)return!1;for(var Ie=e.doc.splitLines(tu(e,q,Ae,X,de)),He=Vt(e.doc,Qe(X,0),Qe(de,ct(e.doc,de).text.length));Ie.length>1&&He.length>1;)if(Z(Ie)==Z(He))Ie.pop(),He.pop(),de--;else if(Ie[0]==He[0])Ie.shift(),He.shift(),X++;else break;for(var We=0,Ze=0,ot=Ie[0],pt=He[0],Et=Math.min(ot.length,pt.length);We<Et&&ot.charCodeAt(We)==pt.charCodeAt(We);)++We;for(var Ot=Z(Ie),xt=Z(He),Dt=Math.min(Ot.length-(Ie.length==1?We:0),xt.length-(He.length==1?We:0));Ze<Dt&&Ot.charCodeAt(Ot.length-Ze-1)==xt.charCodeAt(xt.length-Ze-1);)++Ze;if(Ie.length==1&&He.length==1&&X==r.line)for(;We&&We>r.ch&&Ot.charCodeAt(Ot.length-Ze-1)==xt.charCodeAt(xt.length-Ze-1);)We--,Ze++;Ie[Ie.length-1]=Ot.slice(0,Ot.length-Ze).replace(/^\u200b+/,""),Ie[0]=Ie[0].slice(We).replace(/\u200b+$/,"");var Ht=Qe(X,We),Ft=Qe(de,He.length?Z(He).length-Ze:0);if(Ie.length>1||Ie[0]||ht(Ht,Ft))return pi(e.doc,Ie,Ht,Ft,"+input"),!0},xn.prototype.ensurePolled=function(){this.forceCompositionEnd()},xn.prototype.reset=function(){this.forceCompositionEnd()},xn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},xn.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)},xn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&pr(this.cm,function(){return sr(e.cm)})},xn.prototype.setUneditable=function(e){e.contentEditable="false"},xn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||zn(this.cm,Qa)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},xn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},xn.prototype.onContextMenu=function(){},xn.prototype.resetPosition=function(){},xn.prototype.needsContentAttribute=!0;function Po(e,t){var s=_a(e,t.line);if(!s||s.hidden)return null;var r=ct(e.doc,t.line),m=as(s,r,t.line),B=lt(r,e.doc.direction),X="left";if(B){var q=rt(B,t.ch);X=q%2?"right":"left"}var te=ls(m.map,t.ch,X);return te.offset=te.collapse=="right"?te.end:te.start,te}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function bi(e,t){return t&&(e.bad=!0),e}function tu(e,t,s,r,m){var B="",X=!1,q=e.doc.lineSeparator(),te=!1;function de(We){return function(Ze){return Ze.id==We}}function Ae(){X&&(B+=q,te&&(B+=q),X=te=!1)}function Ie(We){We&&(Ae(),B+=We)}function He(We){if(We.nodeType==1){var Ze=We.getAttribute("cm-text");if(Ze){Ie(Ze);return}var ot=We.getAttribute("cm-marker"),pt;if(ot){var Et=e.findMarks(Qe(r,0),Qe(m+1,0),de(+ot));Et.length&&(pt=Et[0].find(0))&&Ie(Vt(e.doc,pt.from,pt.to).join(q));return}if(We.getAttribute("contenteditable")=="false")return;var Ot=/^(pre|div|p|li|table|br)$/i.test(We.nodeName);if(!/^br$/i.test(We.nodeName)&&We.textContent.length==0)return;Ot&&Ae();for(var xt=0;xt<We.childNodes.length;xt++)He(We.childNodes[xt]);/^(pre|p)$/i.test(We.nodeName)&&(te=!0),Ot&&(X=!0)}else We.nodeType==3&&Ie(We.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(He(t),t==s);)t=t.nextSibling,te=!1;return B}function fa(e,t,s){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[s],!r)return bi(e.clipPos(Qe(e.display.viewTo-1)),!0);t=null,s=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var m=0;m<e.display.view.length;m++){var B=e.display.view[m];if(B.node==r)return nu(B,t,s)}}function nu(e,t,s){var r=e.text.firstChild,m=!1;if(!t||!x(r,t))return bi(Qe(Wt(e.line),0),!0);if(t==r&&(m=!0,t=r.childNodes[s],s=0,!t)){var B=e.rest?Z(e.rest):e.line;return bi(Qe(Wt(B),B.text.length),m)}var X=t.nodeType==3?t:null,q=t;for(!X&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(X=t.firstChild,s&&(s=X.nodeValue.length));q.parentNode!=r;)q=q.parentNode;var te=e.measure,de=te.maps;function Ae(pt,Et,Ot){for(var xt=-1;xt<(de?de.length:0);xt++)for(var Dt=xt<0?te.map:de[xt],Ht=0;Ht<Dt.length;Ht+=3){var Ft=Dt[Ht+2];if(Ft==pt||Ft==Et){var tn=Wt(xt<0?e.line:e.rest[xt]),Sn=Dt[Ht]+Ot;return(Ot<0||Ft!=pt)&&(Sn=Dt[Ht+(Ot?1:0)]),Qe(tn,Sn)}}}var Ie=Ae(X,q,s);if(Ie)return bi(Ie,m);for(var He=q.nextSibling,We=X?X.nodeValue.length-s:0;He;He=He.nextSibling){if(Ie=Ae(He,He.firstChild,0),Ie)return bi(Qe(Ie.line,Ie.ch-We),m);We+=He.textContent.length}for(var Ze=q.previousSibling,ot=s;Ze;Ze=Ze.previousSibling){if(Ie=Ae(Ze,Ze.firstChild,-1),Ie)return bi(Qe(Ie.line,Ie.ch+ot),m);ot+=Ze.textContent.length}}var Nn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Q,this.hasSelection=!1,this.composing=null};Nn.prototype.init=function(e){var t=this,s=this,r=this.cm;this.createField(e);var m=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),f&&(m.style.width="0px"),Pe(m,"input",function(){G&&W>=9&&t.hasSelection&&(t.hasSelection=null),s.poll()}),Pe(m,"paste",function(X){if(Fe(r,X)||Ao(X,r))return;r.state.pasteIncoming=+new Date,s.fastPoll()});function B(X){if(Fe(r,X))return;if(r.somethingSelected())ha({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var q=Lo(r);ha({lineWise:!0,text:q.text}),X.type=="cut"?r.setSelections(q.ranges,null,Se):(s.prevInput="",m.value=q.text.join(`
`),M(m))}else return;X.type=="cut"&&(r.state.cutIncoming=+new Date)}Pe(m,"cut",B),Pe(m,"copy",B),Pe(e.scroller,"paste",function(X){if(Ir(e,X)||Fe(r,X))return;if(!m.dispatchEvent){r.state.pasteIncoming=+new Date,s.focus();return}var q=new Event("paste");q.clipboardData=X.clipboardData,m.dispatchEvent(q)}),Pe(e.lineSpace,"selectstart",function(X){Ir(e,X)||ue(X)}),Pe(m,"compositionstart",function(){var X=r.getCursor("from");s.composing&&s.composing.range.clear(),s.composing={start:X,range:r.markText(X,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Pe(m,"compositionend",function(){s.composing&&(s.poll(),s.composing.range.clear(),s.composing=null)})},Nn.prototype.createField=function(e){this.wrapper=Io(),this.textarea=this.wrapper.firstChild},Nn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Nn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,s=e.doc,r=bs(e);if(e.options.moveInputWithCursor){var m=Sr(e,s.sel.primary().head,"div"),B=t.wrapper.getBoundingClientRect(),X=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,m.top+X.top-B.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,m.left+X.left-B.left))}return r},Nn.prototype.showSelection=function(e){var t=this.cm,s=t.display;v(s.cursorDiv,e.cursors),v(s.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Nn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var s=t.getSelection();this.textarea.value=s,t.state.focused&&M(this.textarea),G&&W>=9&&(this.hasSelection=s)}else e||(this.prevInput=this.textarea.value="",G&&W>=9&&(this.hasSelection=null))},Nn.prototype.getField=function(){return this.textarea},Nn.prototype.supportsTouch=function(){return!1},Nn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!d||U()!=this.textarea))try{this.textarea.focus()}catch(e){}},Nn.prototype.blur=function(){this.textarea.blur()},Nn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Nn.prototype.receivedFocus=function(){this.slowPoll()},Nn.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()})},Nn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function s(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,s)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,s)},Nn.prototype.poll=function(){var e=this,t=this.cm,s=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||dt(s)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var m=s.value;if(m==r&&!t.somethingSelected())return!1;if(G&&W>=9&&this.hasSelection===m||i&&/[\uf700-\uf7ff]/.test(m))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var B=m.charCodeAt(0);if(B==8203&&!r&&(r="\u200B"),B==8666)return this.reset(),this.cm.execCommand("undo")}for(var X=0,q=Math.min(r.length,m.length);X<q&&r.charCodeAt(X)==m.charCodeAt(X);)++X;return pr(t,function(){Qa(t,m.slice(X),r.length-X,null,e.composing?"*compose":null),m.length>1e3||m.indexOf(`
`)>-1?s.value=e.prevInput="":e.prevInput=m,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Nn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Nn.prototype.onKeyPress=function(){G&&W>=9&&(this.hasSelection=null),this.fastPoll()},Nn.prototype.onContextMenu=function(e){var t=this,s=t.cm,r=s.display,m=t.textarea;t.contextMenuPending&&t.contextMenuPending();var B=Qr(s,e),X=r.scroller.scrollTop;if(!B||g)return;var q=s.options.resetSelectionOnContextMenu;q&&s.doc.sel.contains(B)==-1&&zn(s,Zn)(s.doc,Hr(B),Se);var te=m.style.cssText,de=t.wrapper.style.cssText,Ae=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",m.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Ae.top-5)+"px; left: "+(e.clientX-Ae.left-5)+`px;
z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ie;n&&(Ie=window.scrollY),r.input.focus(),n&&window.scrollTo(null,Ie),r.input.reset(),s.somethingSelected()||(m.value=t.prevInput=" "),t.contextMenuPending=We,r.selForContextMenu=s.doc.sel,clearTimeout(r.detectingSelectAll);function He(){if(m.selectionStart!=null){var ot=s.somethingSelected(),pt="\u200B"+(ot?m.value:"");m.value="\u21DA",m.value=pt,t.prevInput=ot?"":"\u200B",m.selectionStart=1,m.selectionEnd=pt.length,r.selForContextMenu=s.doc.sel}}function We(){if(t.contextMenuPending!=We)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=de,m.style.cssText=te,G&&W<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=X),m.selectionStart!=null){(!G||G&&W<9)&&He();var ot=0,pt=function(){r.selForContextMenu==s.doc.sel&&m.selectionStart==0&&m.selectionEnd>0&&t.prevInput=="\u200B"?zn(s,Qs)(s):ot++<10?r.detectingSelectAll=setTimeout(pt,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(pt,200)}}if(G&&W>=9&&He(),L){xe(e);var Ze=function(){Xe(window,"mouseup",Ze),setTimeout(We,20)};Pe(window,"mouseup",Ze)}else setTimeout(We,50)},Nn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Nn.prototype.setUneditable=function(){},Nn.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?b(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var s=U();t.autofocus=s==e||e.getAttribute("autofocus")!=null&&s==document.body}function r(){e.value=q.getValue()}var m;if(e.form&&(Pe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var B=e.form;m=B.submit;try{var X=B.submit=function(){r(),B.submit=m,B.submit(),B.submit=X}}catch(te){}}t.finishInit=function(te){te.save=r,te.getTextArea=function(){return e},te.toTextArea=function(){te.toTextArea=isNaN,r(),e.parentNode.removeChild(te.getWrapperElement()),e.style.display="",e.form&&(Xe(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=m))}},e.style.display="none";var q=An(function(te){return e.parentNode.insertBefore(te,e.nextSibling)},t);return q}function iu(e){e.off=Xe,e.on=Pe,e.wheelEventPixels=cl,e.Doc=or,e.splitLines=bt,e.countColumn=K,e.findColumn=me,e.isWordChar=Me,e.Pass=we,e.signal=je,e.Line=cr,e.changeEnd=Kr,e.scrollbarModel=Os,e.Pos=Qe,e.cmpPos=ht,e.modes=Nt,e.mimeModes=At,e.resolveMode=Ye,e.getMode=_t,e.modeExtensions=$e,e.extendMode=Je,e.copyState=vt,e.startState=Rt,e.innerMode=St,e.commands=Wi,e.keyMap=kr,e.keyName=po,e.isModifierKey=ho,e.lookupKey=gi,e.normalizeKeyMap=kl,e.StringStream=mt,e.SharedTextMarker=Ui,e.TextMarker=zr,e.LineWidget=Fi,e.e_preventDefault=ue,e.e_stopPropagation=ce,e.e_stop=xe,e.addClass=F,e.contains=x,e.rmClass=_,e.keyNames=Vr}$l(An),ql(An);var au="iter insert remove copy getEditor constructor".split(" ");for(var pa in or.prototype)or.prototype.hasOwnProperty(pa)&&ne(au,pa)<0&&(An.prototype[pa]=function(e){return function(){return e.apply(this.doc,arguments)}}(or.prototype[pa]));return ve(or),An.inputStyles={textarea:Nn,contenteditable:xn},An.defineMode=function(e){!An.defaults.mode&&e!="null"&&(An.defaults.mode=e),It.apply(this,arguments)},An.defineMIME=gt,An.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),An.defineMIME("text/plain","null"),An.defineExtension=function(e,t){An.prototype[e]=t},An.defineDocExtension=function(e,t){or.prototype[e]=t},An.fromTextArea=ru,iu(An),An.version="5.58.2",An})},WaYH:function(at,Ee,H){"use strict";var ee=H("rePB"),V=H("Ff2n"),N=H("VTBJ"),$=H("1OyB"),j=H("vuIU"),P=H("JX7q"),G=H("Ji7U"),W=H("LK+K"),n=H("q1tI"),D=H("TSYQ"),y=H.n(D),g=H("sboe"),p=H("OZM5"),l=function(L){var A=L.prefixCls,_=L.level,T=L.isStart,v=L.isEnd;if(!_)return null;for(var c="".concat(A,"-indent-unit"),E=[],h=0;h<_;h+=1){var x;E.push(n.createElement("span",{key:h,className:y()(c,(x={},Object(ee.a)(x,"".concat(c,"-start"),T[h+1]),Object(ee.a)(x,"".concat(c,"-end"),v[h+1]),Object(ee.a)(x,"".concat(c,"-end-first-level"),!h&&v[0]),x))}))}return n.createElement("span",{"aria-hidden":"true",className:"".concat(A,"-indent")},E)},a=l,f=H("815F"),u="open",d="close",i="---",o=function(C){Object(G.a)(A,C);var L=Object(W.a)(A);function A(){var _;return Object($.a)(this,A),_=L.apply(this,arguments),_.state={dragNodeHighlight:!1},_.onSelectorClick=function(T){var v=_.props.context.onNodeClick;v(T,Object(f.b)(_.props)),_.isSelectable()?_.onSelect(T):_.onCheck(T)},_.onSelectorDoubleClick=function(T){var v=_.props.context.onNodeDoubleClick;v(T,Object(f.b)(_.props))},_.onSelect=function(T){if(_.isDisabled())return;var v=_.props.context.onNodeSelect;T.preventDefault(),v(T,Object(f.b)(_.props))},_.onCheck=function(T){if(_.isDisabled())return;var v=_.props,c=v.disableCheckbox,E=v.checked,h=_.props.context.onNodeCheck;if(!_.isCheckable()||c)return;T.preventDefault();var x=!E;h(T,Object(f.b)(_.props),x)},_.onMouseEnter=function(T){var v=_.props.context.onNodeMouseEnter;v(T,Object(f.b)(_.props))},_.onMouseLeave=function(T){var v=_.props.context.onNodeMouseLeave;v(T,Object(f.b)(_.props))},_.onContextMenu=function(T){var v=_.props.context.onNodeContextMenu;v(T,Object(f.b)(_.props))},_.onDragStart=function(T){var v=_.props.context.onNodeDragStart;T.stopPropagation(),_.setState({dragNodeHighlight:!0}),v(T,Object(P.a)(_));try{T.dataTransfer.setData("text/plain","")}catch(c){}},_.onDragEnter=function(T){var v=_.props.context.onNodeDragEnter;T.preventDefault(),T.stopPropagation(),v(T,Object(P.a)(_))},_.onDragOver=function(T){var v=_.props.context.onNodeDragOver;T.preventDefault(),T.stopPropagation(),v(T,Object(P.a)(_))},_.onDragLeave=function(T){var v=_.props.context.onNodeDragLeave;T.stopPropagation(),v(T,Object(P.a)(_))},_.onDragEnd=function(T){var v=_.props.context.onNodeDragEnd;T.stopPropagation(),_.setState({dragNodeHighlight:!1}),v(T,Object(P.a)(_))},_.onDrop=function(T){var v=_.props.context.onNodeDrop;T.preventDefault(),T.stopPropagation(),_.setState({dragNodeHighlight:!1}),v(T,Object(P.a)(_))},_.onExpand=function(T){var v=_.props.context.onNodeExpand;v(T,Object(f.b)(_.props))},_.setSelectHandle=function(T){_.selectHandle=T},_.getNodeState=function(){var T=_.props.expanded;return _.isLeaf()?null:T?u:d},_.hasChildren=function(){var T=_.props.eventKey,v=_.props.context.keyEntities,c=v[T]||{},E=c.children;return!!(E||[]).length},_.isLeaf=function(){var T=_.props,v=T.isLeaf,c=T.loaded,E=_.props.context.loadData,h=_.hasChildren();return v===!1?!1:v||!E&&!h||E&&c&&!h},_.isDisabled=function(){var T=_.props.disabled,v=_.props.context.disabled;return!!(v||T)},_.isCheckable=function(){var T=_.props.checkable,v=_.props.context.checkable;return!v||T===!1?!1:v},_.syncLoadData=function(T){var v=T.expanded,c=T.loading,E=T.loaded,h=_.props.context,x=h.loadData,U=h.onNodeLoad;if(c)return;x&&v&&!_.isLeaf()&&(!_.hasChildren()&&!E&&U(Object(f.b)(_.props)))},_.renderSwitcher=function(){var T=_.props,v=T.expanded,c=T.switcherIcon,E=_.props.context,h=E.prefixCls,x=E.switcherIcon,U=c||x;if(_.isLeaf())return n.createElement("span",{className:y()("".concat(h,"-switcher"),"".concat(h,"-switcher-noop"))},typeof U=="function"?U(Object(N.a)(Object(N.a)({},_.props),{},{isLeaf:!0})):U);var F=y()("".concat(h,"-switcher"),"".concat(h,"-switcher_").concat(v?u:d));return n.createElement("span",{onClick:_.onExpand,className:F},typeof U=="function"?U(Object(N.a)(Object(N.a)({},_.props),{},{isLeaf:!1})):U)},_.renderCheckbox=function(){var T=_.props,v=T.checked,c=T.halfChecked,E=T.disableCheckbox,h=_.props.context.prefixCls,x=_.isDisabled(),U=_.isCheckable();if(!U)return null;var F=typeof U!="boolean"?U:null;return n.createElement("span",{className:y()("".concat(h,"-checkbox"),v&&"".concat(h,"-checkbox-checked"),!v&&c&&"".concat(h,"-checkbox-indeterminate"),(x||E)&&"".concat(h,"-checkbox-disabled")),onClick:_.onCheck},F)},_.renderIcon=function(){var T=_.props.loading,v=_.props.context.prefixCls;return n.createElement("span",{className:y()("".concat(v,"-iconEle"),"".concat(v,"-icon__").concat(_.getNodeState()||"docu"),T&&"".concat(v,"-icon_loading"))})},_.renderSelector=function(){var T=_.state.dragNodeHighlight,v=_.props,c=v.title,E=v.selected,h=v.icon,x=v.loading,U=v.data,F=_.props.context,S=F.prefixCls,M=F.showIcon,I=F.icon,b=F.draggable,K=F.loadData,Q=F.titleRender,ne=_.isDisabled(),fe="".concat(S,"-node-content-wrapper"),we;if(M){var Se=h||I;we=Se?n.createElement("span",{className:y()("".concat(S,"-iconEle"),"".concat(S,"-icon__customize"))},typeof Se=="function"?Se(_.props):Se):_.renderIcon()}else K&&x&&(we=_.renderIcon());var he;typeof c=="function"?he=c(U):Q?he=Q(U):he=c;var se=n.createElement("span",{className:"".concat(S,"-title")},he);return n.createElement("span",{ref:_.setSelectHandle,title:typeof c=="string"?c:"",className:y()("".concat(fe),"".concat(fe,"-").concat(_.getNodeState()||"normal"),!ne&&(E||T)&&"".concat(S,"-node-selected"),!ne&&b&&"draggable"),draggable:!ne&&b||void 0,"aria-grabbed":!ne&&b||void 0,onMouseEnter:_.onMouseEnter,onMouseLeave:_.onMouseLeave,onContextMenu:_.onContextMenu,onClick:_.onSelectorClick,onDoubleClick:_.onSelectorDoubleClick,onDragStart:b?_.onDragStart:void 0},we,se)},_}return Object(j.a)(A,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var T=this.props.selectable,v=this.props.context.selectable;return typeof T=="boolean"?T:v}},{key:"render",value:function(){var T,v=this.props,c=v.eventKey,E=v.className,h=v.style,x=v.dragOver,U=v.dragOverGapTop,F=v.dragOverGapBottom,S=v.isLeaf,M=v.isStart,I=v.isEnd,b=v.expanded,K=v.selected,Q=v.checked,ne=v.halfChecked,fe=v.loading,we=v.domRef,Se=v.active,he=v.onMouseMove,se=Object(V.a)(v,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),me=this.props.context,re=me.prefixCls,le=me.filterTreeNode,Z=me.draggable,ae=me.keyEntities,oe=this.isDisabled(),ge=Object(p.f)(se),Re=ae[c]||{},Te=Re.level,Me=I[I.length-1];return n.createElement("div",Object.assign({ref:we,className:y()(E,"".concat(re,"-treenode"),(T={},Object(ee.a)(T,"".concat(re,"-treenode-disabled"),oe),Object(ee.a)(T,"".concat(re,"-treenode-switcher-").concat(b?"open":"close"),!S),Object(ee.a)(T,"".concat(re,"-treenode-checkbox-checked"),Q),Object(ee.a)(T,"".concat(re,"-treenode-checkbox-indeterminate"),ne),Object(ee.a)(T,"".concat(re,"-treenode-selected"),K),Object(ee.a)(T,"".concat(re,"-treenode-loading"),fe),Object(ee.a)(T,"".concat(re,"-treenode-active"),Se),Object(ee.a)(T,"".concat(re,"-treenode-leaf-last"),Me),Object(ee.a)(T,"drag-over",!oe&&x),Object(ee.a)(T,"drag-over-gap-top",!oe&&U),Object(ee.a)(T,"drag-over-gap-bottom",!oe&&F),Object(ee.a)(T,"filter-node",le&&le(Object(f.b)(this.props))),T)),style:h,onDragEnter:Z?this.onDragEnter:void 0,onDragOver:Z?this.onDragOver:void 0,onDragLeave:Z?this.onDragLeave:void 0,onDrop:Z?this.onDrop:void 0,onDragEnd:Z?this.onDragEnd:void 0,onMouseMove:he},ge),n.createElement(a,{prefixCls:re,level:Te,isStart:M,isEnd:I}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),A}(n.Component),O=function(L){return n.createElement(g.a.Consumer,null,function(A){return n.createElement(o,Object.assign({},L,{context:A}))})};O.displayName="TreeNode",O.defaultProps={title:i},O.isTreeNode=1;var w=Ee.a=O},XIdC:function(at,Ee,H){"use strict";var ee=H("rePB"),V=H("ODXe"),N=H("Ff2n"),$=H("q1tI"),j=H.n($),P=H("TSYQ"),G=H.n(P),W=H("6cGi"),n=H("4IlW"),D=$.forwardRef(function(y,g){var p,l=y.prefixCls,a=l===void 0?"rc-switch":l,f=y.className,u=y.checked,d=y.defaultChecked,i=y.disabled,o=y.loadingIcon,O=y.checkedChildren,w=y.unCheckedChildren,C=y.onClick,L=y.onChange,A=y.onKeyDown,_=Object(N.a)(y,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),T=Object(W.a)(!1,{value:u,defaultValue:d}),v=Object(V.a)(T,2),c=v[0],E=v[1];function h(S,M){var I=c;return i||(I=S,E(I),L==null||L(I,M)),I}function x(S){S.which===n.a.LEFT?h(!1,S):S.which===n.a.RIGHT&&h(!0,S),A==null||A(S)}function U(S){var M=h(!c,S);C==null||C(M,S)}var F=G()(a,f,(p={},Object(ee.a)(p,"".concat(a,"-checked"),c),Object(ee.a)(p,"".concat(a,"-disabled"),i),p));return $.createElement("button",Object.assign({},_,{type:"button",role:"switch","aria-checked":c,disabled:i,className:F,ref:g,onKeyDown:x,onClick:U}),o,$.createElement("span",{className:"".concat(a,"-inner")},c?O:w))});D.displayName="Switch",Ee.a=D},Y1PL:function(at,Ee,H){"use strict";H.r(Ee),H.d(Ee,"ResizableTextArea",function(){return ne});var ee=H("wx14"),V=H("1OyB"),N=H("vuIU"),$=H("Ji7U"),j=H("LK+K"),P=H("q1tI"),G=H("VTBJ"),W=H("rePB"),n=H("Zm9Q"),D=H("Kwbf"),y=H("c+Xe"),g=H("m+aA"),p=H("bdgK"),l=new Map;function a(Se){Se.forEach(function(he){var se,me=he.target;(se=l.get(me))===null||se===void 0||se.forEach(function(re){return re(me)})})}var f=new p.default(a),u=null,d=null;function i(Se,he){l.has(Se)||(l.set(Se,new Set),f.observe(Se)),l.get(Se).add(he)}function o(Se,he){l.has(Se)&&(l.get(Se).delete(he),l.get(Se).size||(f.unobserve(Se),l.delete(Se)))}var O=function(Se){Object($.a)(se,Se);var he=Object(j.a)(se);function se(){return Object(V.a)(this,se),he.apply(this,arguments)}return Object(N.a)(se,[{key:"render",value:function(){return this.props.children}}]),se}(P.Component),w=P.createContext(null);function C(Se){var he=Se.children,se=Se.onBatchResize,me=P.useRef(0),re=P.useRef([]),le=P.useContext(w),Z=P.useCallback(function(ae,oe,ge){me.current+=1;var Re=me.current;re.current.push({size:ae,element:oe,data:ge}),Promise.resolve().then(function(){Re===me.current&&(se==null||se(re.current),re.current=[])}),le==null||le(ae,oe,ge)},[se,le]);return P.createElement(w.Provider,{value:Z},he)}function L(Se){var he=Se.children,se=Se.disabled,me=P.useRef(null),re=P.useRef(null),le=P.useContext(w),Z=P.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ae=P.isValidElement(he)&&Object(y.c)(he),oe=ae?he.ref:null,ge=P.useMemo(function(){return Object(y.a)(oe,me)},[oe,me]),Re=P.useRef(Se);Re.current=Se;var Te=P.useCallback(function(Me){var Be=Re.current,pe=Be.onResize,Ce=Be.data,ke=Me.getBoundingClientRect(),Le=ke.width,Ge=ke.height,Ve=Me.offsetWidth,tt=Me.offsetHeight,rt=Math.floor(Le),ut=Math.floor(Ge);if(Z.current.width!==rt||Z.current.height!==ut||Z.current.offsetWidth!==Ve||Z.current.offsetHeight!==tt){var lt={width:rt,height:ut,offsetWidth:Ve,offsetHeight:tt};Z.current=lt;var Ne=Ve===Math.round(Le)?Le:Ve,Pe=tt===Math.round(Ge)?Ge:tt,ze=Object(G.a)(Object(G.a)({},lt),{},{offsetWidth:Ne,offsetHeight:Pe});le==null||le(ze,Me,Ce),pe&&Promise.resolve().then(function(){pe(ze,Me)})}},[]);return P.useEffect(function(){var Me=Object(g.a)(me.current)||Object(g.a)(re.current);return Me&&!se&&i(Me,Te),function(){return o(Me,Te)}},[me.current,se]),P.createElement(O,{ref:re},ae?P.cloneElement(he,{ref:ge}):he)}var A="rc-observer-key";function _(Se){var he=Se.children,se=Object(n.a)(he);return se.map(function(me,re){var le=(me==null?void 0:me.key)||"".concat(A,"-").concat(re);return P.createElement(L,Object(ee.a)({},Se,{key:le}),me)})}_.Collection=C;var T=_,v=H("bT9E"),c=H("TSYQ"),E=H.n(c),h=`
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
`,x=["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 S(Se){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,se=Se.getAttribute("id")||Se.getAttribute("data-reactid")||Se.getAttribute("name");if(he&&U[se])return U[se];var me=window.getComputedStyle(Se),re=me.getPropertyValue("box-sizing")||me.getPropertyValue("-moz-box-sizing")||me.getPropertyValue("-webkit-box-sizing"),le=parseFloat(me.getPropertyValue("padding-bottom"))+parseFloat(me.getPropertyValue("padding-top")),Z=parseFloat(me.getPropertyValue("border-bottom-width"))+parseFloat(me.getPropertyValue("border-top-width")),ae=x.map(function(ge){return"".concat(ge,":").concat(me.getPropertyValue(ge))}).join(";"),oe={sizingStyle:ae,paddingSize:le,borderSize:Z,boxSizing:re};return he&&se&&(U[se]=oe),oe}function M(Se){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,me=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)),Se.getAttribute("wrap")?F.setAttribute("wrap",Se.getAttribute("wrap")):F.removeAttribute("wrap");var re=S(Se,he),le=re.paddingSize,Z=re.borderSize,ae=re.boxSizing,oe=re.sizingStyle;F.setAttribute("style","".concat(oe,";").concat(h)),F.value=Se.value||Se.placeholder||"";var ge=Number.MIN_SAFE_INTEGER,Re=Number.MAX_SAFE_INTEGER,Te=F.scrollHeight,Me;if(ae==="border-box"?Te+=Z:ae==="content-box"&&(Te-=le),se!==null||me!==null){F.value=" ";var Be=F.scrollHeight-le;se!==null&&(ge=Be*se,ae==="border-box"&&(ge=ge+le+Z),Te=Math.max(ge,Te)),me!==null&&(Re=Be*me,ae==="border-box"&&(Re=Re+le+Z),Me=Te>Re?"":"hidden",Te=Math.min(Re,Te))}return{height:Te,minHeight:ge,maxHeight:Re,overflowY:Me,resize:"none"}}var I=H("Gytx"),b=H.n(I),K;(function(Se){Se[Se.NONE=0]="NONE",Se[Se.RESIZING=1]="RESIZING",Se[Se.RESIZED=2]="RESIZED"})(K||(K={}));var Q=function(Se){Object($.a)(se,Se);var he=Object(j.a)(se);function se(me){var re;return Object(V.a)(this,se),re=he.call(this,me),re.nextFrameActionId=void 0,re.resizeFrameId=void 0,re.textArea=void 0,re.saveTextArea=function(le){re.textArea=le},re.handleResize=function(le){var Z=re.state.resizeStatus,ae=re.props,oe=ae.autoSize,ge=ae.onResize;if(Z!==K.NONE)return;typeof ge=="function"&&ge(le),oe&&re.resizeOnNextFrame()},re.resizeOnNextFrame=function(){cancelAnimationFrame(re.nextFrameActionId),re.nextFrameActionId=requestAnimationFrame(re.resizeTextarea)},re.resizeTextarea=function(){var le=re.props.autoSize;if(!le||!re.textArea)return;var Z=le.minRows,ae=le.maxRows,oe=M(re.textArea,!1,Z,ae);re.setState({textareaStyles:oe,resizeStatus:K.RESIZING},function(){cancelAnimationFrame(re.resizeFrameId),re.resizeFrameId=requestAnimationFrame(function(){re.setState({resizeStatus:K.RESIZED},function(){re.resizeFrameId=requestAnimationFrame(function(){re.setState({resizeStatus:K.NONE}),re.fixFirefoxAutoScroll()})})})})},re.renderTextArea=function(){var le=re.props,Z=le.prefixCls,ae=Z===void 0?"rc-textarea":Z,oe=le.autoSize,ge=le.onResize,Re=le.className,Te=le.disabled,Me=re.state,Be=Me.textareaStyles,pe=Me.resizeStatus,Ce=Object(v.a)(re.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ke=E()(ae,Re,Object(W.a)({},"".concat(ae,"-disabled"),Te));"value"in Ce&&(Ce.value=Ce.value||"");var Le=Object(G.a)(Object(G.a)(Object(G.a)({},re.props.style),Be),pe===K.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return P.createElement(T,{onResize:re.handleResize,disabled:!(oe||ge)},P.createElement("textarea",Object(ee.a)({},Ce,{className:ke,style:Le,ref:re.saveTextArea})))},re.state={textareaStyles:{},resizeStatus:K.NONE},re}return Object(N.a)(se,[{key:"componentDidUpdate",value:function(re){(re.value!==this.props.value||!b()(re.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 re=this.textArea.selectionStart,le=this.textArea.selectionEnd;this.textArea.setSelectionRange(re,le)}}catch(Z){}}},{key:"render",value:function(){return this.renderTextArea()}}]),se}(P.Component),ne=Q,fe=function(Se){Object($.a)(se,Se);var he=Object(j.a)(se);function se(me){var re;Object(V.a)(this,se),re=he.call(this,me),re.resizableTextArea=void 0,re.focus=function(){re.resizableTextArea.textArea.focus()},re.saveTextArea=function(Z){re.resizableTextArea=Z},re.handleChange=function(Z){var ae=re.props.onChange;re.setValue(Z.target.value,function(){re.resizableTextArea.resizeTextarea()}),ae&&ae(Z)},re.handleKeyDown=function(Z){var ae=re.props,oe=ae.onPressEnter,ge=ae.onKeyDown;Z.keyCode===13&&oe&&oe(Z),ge&&ge(Z)};var le=typeof me.value=="undefined"||me.value===null?me.defaultValue:me.value;return re.state={value:le},re}return Object(N.a)(se,[{key:"setValue",value:function(re,le){"value"in this.props||this.setState({value:re},le)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return P.createElement(ne,Object(ee.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(re){return"value"in re?{value:re.value}:null}}]),se}(P.Component),we=Ee.default=fe},Z9P2:function(at,Ee,H){"use strict";var ee=H("+BJd"),V=H("mr32"),N=H("14J3"),$=H("BMrR"),j=H("5NDa"),P=H("5rEg"),G=H("oBTY"),W=H("5Dmo"),n=H("3S7+"),D=H("miYZ"),y=H("tsqr"),g=H("tJVT"),p=H("q1tI"),l=H.n(p),a=function(u){var d,i,o=u.value,O=o===void 0?[[],[]]:o,w=u.onChange,C=Object(p.useState)(""),L=Object(g.a)(C,2),A=L[0],_=L[1],T=Object(p.useState)(""),v=Object(g.a)(T,2),c=v[0],E=v[1],h=function(U){if(!U)return!1;var F=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return F.test(U)?(y.b.warn("\u5173\u952E\u8BCD\u4E0D\u80FD\u542B\u6709\u7279\u6B8A\u5B57\u7B26\uFF01"),!1):U==="|"?(y.b.warn("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0};return l.a.createElement("div",null,l.a.createElement("p",{className:"font14"},"\u5173\u952E\u8BCD",l.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5173\u952E\u8BCD\u53EF\u7528\u4E8E\u81EA\u52A8\u5224\u5206\uFF09"),l.a.createElement(n.a,{overlayStyle:{maxWidth:350},title:l.a.createElement("div",null,l.a.createElement("div",null,"\u6BCF\u4E2A\u6838\u5FC3\u5173\u952E\u8BCD\u7684\u5206\u6570\u662F\u666E\u901A\u5173\u952E\u8BCD\u5206\u6570\u7684\u4E24\u500D"),l.a.createElement("div",null,"\u4F8B\u5982\uFF1A"),l.a.createElement("div",null,"\u672C\u989810\u5206\uFF0C\u666E\u901A\u5173\u952E\u8BCD1\u4E2A\uFF0C\u6838\u5FC3\u5173\u952E\u8BCD2\u4E2A\uFF0C\u5219\u6BCF\u4E2A"),l.a.createElement("div",null,"\u666E\u901A\u5173\u952E\u8BCD2\u5206\uFF0C\u6BCF\u4E2A\u6838\u5FC3\u5173\u952E\u8BCD4\u5206"))},l.a.createElement("span",{className:"iconfont icon-a-wenhaobeifen2 font14"}))),l.a.createElement($.a,{align:"middle",className:"font14"},"\u666E\u901A\u5173\u952E\u8BCD\uFF1A",l.a.createElement(P.a,{value:A,onChange:function(U){_(U.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(U){var F,S=(F=U.target)===null||F===void 0?void 0:F.value;if(h(S)){var M,I;(M=O[0])===null||M===void 0||M.push(S==null||((I=S.split("|"))===null||I===void 0)?void 0:I.filter(function(b){return!!b})),w(Object(G.a)(O)),_("")}},style:{width:800},className:"ml5 mr10",placeholder:"\u652F\u6301\u4FDD\u5B58\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u7528\u201D|\u201D\u5206\u5272\u3002"}),l.a.createElement("span",{className:"c-grey-999"},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),l.a.createElement("div",{style:{paddingLeft:89},className:"mt10"},O==null||((d=O[0])===null||d===void 0)?void 0:d.map(function(x,U){return l.a.createElement(V.a,{className:"mb10",key:U,closable:!0,onClose:function(S){var M;S.preventDefault(),O[0]=(M=O[0])===null||M===void 0?void 0:M.filter(function(I,b){return b!==U}),w(Object(G.a)(O))}},x==null?void 0:x.join(" \u6216 "))})),l.a.createElement($.a,{align:"middle",className:"font14"},"\u6838\u5FC3\u5173\u952E\u8BCD\uFF1A",l.a.createElement(P.a,{value:c,onChange:function(U){E(U.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(U){var F,S=(F=U.target)===null||F===void 0?void 0:F.value;if(h(S)){var M,I;(M=O[1])===null||M===void 0||M.push(S==null||((I=S.split("|"))===null||I===void 0)?void 0:I.filter(function(b){return!!b})),w(Object(G.a)(O)),E("")}},style:{width:800},className:"ml5 mr10",placeholder:"\u652F\u6301\u4FDD\u5B58\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u7528\u201D|\u201D\u5206\u5272\u3002"}),l.a.createElement("span",{className:"c-grey-999"},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),l.a.createElement("div",{style:{paddingLeft:89},className:"mt10"},O==null||((i=O[1])===null||i===void 0)?void 0:i.map(function(x,U){return l.a.createElement(V.a,{className:"mb10",key:U,closable:!0,onClose:function(S){var M;S.preventDefault(),O[1]=(M=O[1])===null||M===void 0?void 0:M.filter(function(I,b){return b!==U}),w(Object(G.a)(O))}},x==null?void 0:x.join(" \u6216 "))})))};Ee.a=a},ZW9T:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return I});var ee=H("k1fw"),V=H("oBTY"),N=H("miYZ"),$=H("tsqr"),j=H("rAM+"),P=H("tJVT"),G=H("PpiC"),W=H("q1tI"),n=H.n(W),D=H("bdgK"),y=H("9og8"),g=H("WmNS"),p=H.n(g),l={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},a={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},f={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},u={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(`
`)}]},d=H("5VLF"),i=H.n(d),o={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"]}},O=function(K,Q){return Q.map(function(ne){return{label:ne,kind:K.languages.CompletionItemKind.Keyword,insertText:ne}})},w=function(K){return Object.keys(o.tables).map(function(Q){return{label:Q,kind:K.languages.CompletionItemKind.Variable,insertText:Q}})},C=function(K,Q){var ne=o.tables[K];return ne?ne.map(function(fe){return{label:fe,kind:Q.languages.CompletionItemKind.Field,insertText:fe}}):[]};function L(b,K,Q,ne,fe){var we=K.getWordUntilPosition(Q),Se={startLineNumber:Q.lineNumber,endLineNumber:Q.lineNumber,startColumn:we.startColumn,endColumn:we.endColumn},he=ne.map(function(se){return{label:se,kind:b.languages.CompletionItemKind.Keyword,insertText:se,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}});return fe.map(function(se){he.push(Object(ee.a)(Object(ee.a)({},se),{},{range:Se}))}),he}var A=function(b){o.languages.map(function(fe){return b.languages.registerDocumentFormattingEditProvider(fe,{provideDocumentFormattingEdits:function(Se,he,se){return Object(y.a)(p.a.mark(function me(){var re;return p.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return re=i()(Se.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}),Z.abrupt("return",[{range:Se.getFullModelRange(),text:re}]);case 2:case"end":return Z.stop()}},me)}))()}}),fe});var K=f.quickKey.map(function(fe){return{label:fe.label,kind:b.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Q=u.quickKey.map(function(fe){return{label:fe.label,kind:b.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ne=a.quickKey.map(function(fe){return{label:fe.label,kind:b.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}});b.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(we,Se){var he=we.getWordUntilPosition(Se),se={startLineNumber:Se.lineNumber,endLineNumber:Se.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},me=we.getLineContent(Se.lineNumber).substring(he.startColumn-2,he.endColumn);return{suggestions:[].concat(Object(V.a)(f.keywords.map(function(re){return{label:re,kind:b.languages.CompletionItemKind.Function,documentation:re,insertText:re,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}})),Object(V.a)(f.quickKey.map(function(re){return{label:re.label,kind:b.languages.CompletionItemKind.Function,documentation:re.content,insertText:me.startsWith("#")?re.content.replace(/#/,""):re.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}})))}}}),b.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(we,Se){var he=we.getWordUntilPosition(Se),se={startLineNumber:Se.lineNumber,endLineNumber:Se.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn};return{suggestions:Object(V.a)(l.keywords.map(function(me){return{label:me,kind:b.languages.CompletionItemKind.Function,documentation:me,insertText:me,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}}))}}}),b.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(we,Se){var he=we.getWordUntilPosition(Se),se={startLineNumber:Se.lineNumber,endLineNumber:Se.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},me=we.getLineContent(Se.lineNumber).substring(he.startColumn-2,he.endColumn);return{suggestions:[].concat(Object(V.a)(a.keywords.map(function(re){return{label:re,kind:b.languages.CompletionItemKind.Function,documentation:re,insertText:re,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}})),Object(V.a)(a.quickKey.map(function(re){return{label:re.label,kind:b.languages.CompletionItemKind.Function,documentation:re.content,insertText:me.startsWith("#")?re.content.replace(/#/,""):re.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}})))}}}),b.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(we,Se){var he=we.getWordUntilPosition(Se),se={startLineNumber:Se.lineNumber,endLineNumber:Se.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},me=we.getLineContent(Se.lineNumber).substring(he.startColumn-2,he.endColumn);return{suggestions:[].concat(Object(V.a)(u.keywords.map(function(re){return{label:re,kind:b.languages.CompletionItemKind.Function,documentation:re,insertText:re,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}})),Object(V.a)(u.quickKey.map(function(re){return{label:re.label,kind:b.languages.CompletionItemKind.Function,documentation:re.content,insertText:me.startsWith("#")?re.content.replace(/#/,""):re.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}})))}}})},_="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",T=H("fjLI"),v=H("LvDl"),c=H("+ua5");function E(b){return/^\d+$/.test(b)?"".concat(b,"px"):b}function h(){}var x=!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 b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],K=b;if(Array.isArray(b)){for(var Q=0;Q<b.length;Q++){var ne=U[b[Q]];if(ne)return ne}return K[0]}return U[K]||K}var S=null,M=Ee.b=function(b){var K=b.width,Q=K===void 0?"100%":K,ne=b.height,fe=ne===void 0?"100%":ne,we=b.value,Se=b.language,he=Se===void 0?"javascript":Se,se=b.style,me=se===void 0?{}:se,re=b.options,le=re===void 0?{}:re,Z=b.overrideServices,ae=Z===void 0?{}:Z,oe=b.theme,ge=oe===void 0?"vs-dark":oe,Re=b.onEditBlur,Te=b.onSave,Me=b.autoHeight,Be=Me===void 0?!1:Me,pe=b.forbidCopy,Ce=pe===void 0?!1:pe,ke=b.onChange,Le=ke===void 0?h:ke,Ge=b.editorDidMount,Ve=Ge===void 0?h:Ge,tt=b.onFocus,rt=tt===void 0?h:tt,ut=b.filename,lt=ut===void 0?"educoder.txt":ut,Ne=b.errorLine,Pe=b.errorContent,ze=Pe===void 0?"":Pe,Xe=Object(G.a)(b,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),je=Object(W.useRef)(),Fe=Object(W.useRef)({}),_e=Object(W.useRef)(),ye=Object(W.useRef)(),ve=Object(W.useRef)(!1),ue=Object(W.useRef)(),ce=Object(W.useState)(!1),be=Object(P.a)(ce,2),xe=be[0],Oe=be[1];function Ue(){var $e;return je.current&&($e=new D.default(function(Je){var vt=Object(j.a)(Je),St;try{for(vt.s();!(St=vt.n()).done;){var Rt=St.value;(Rt.target.offsetHeight>0||Rt.target.offsetWidth>0)&&Fe.current.instance.layout()}}catch(mt){vt.e(mt)}finally{vt.f()}}),$e.observe(je.current)),$e}function Ke(){$.b.warn(decodeURIComponent(_))}var et=function(){var Je=Fe.current.instance;if(we!=null&&Je&&xe){var vt=Je.getModel();vt&&we!==vt.getValue()&&(x=!0,vt.setValue(we),Je.layout(),x=!1)}};Object(W.useEffect)(function(){ye.current&&clearTimeout(ye.current),ye.current=setTimeout(function(){et()},500)},[we,xe,Fe.current]),Object(W.useEffect)(function(){if(Ne&&Fe.current&&Fe.current.instance){var $e=Fe.current.instance;$e.changeViewZones(function(vt){var St=document.createElement("div");St.style.padding="10px 20px",St.style.width="calc(100% - 20px)",St.className="my-error-line-wrp",St.innerHTML=ze,vt.addZone({afterLineNumber:Ne||11,heightInLines:3,domNode:St})});var Je={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}};$e.addOverlayWidget(Je),$e.revealPositionInCenter({lineNumber:20,column:1})}},[Ne,Fe.current,xe]);function it(){var $e=Fe.current.instance;if($e){var Je=$e.getSelection(),vt=Fe.current.pastePos||{},St=new S.Range(vt.startLineNumber||Je.endLineNumber,vt.startColumn||Je.endColumn,vt.endLineNumber||Je.endLineNumber,vt.endColumn||Je.endColumn);setTimeout(function(){$e.executeEdits("",[{range:St,text:""}])},300)}}function nt($e){(window.navigator.platform.match("Mac")?$e.metaKey:$e.ctrlKey)&&$e.keyCode==83&&($e.preventDefault(),Te())}var yt=function(){if(Be&&Fe.current.instance){var Je=Fe.current.instance.getContentHeight();Ye(Je<fe?fe:Je)}else Ye(fe)};function bt($e){var Je=document.createEvent("MouseEvents");Je.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),$e.dispatchEvent(Je)}function dt($e,Je){var vt=window.URL||window.webkitURL||window,St=new Blob([Je]),Rt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Rt.href=vt.createObjectURL(St),Rt.download=$e,bt(Rt)}Object(W.useEffect)(function(){yt()},[yt]),Object(W.useEffect)(function(){je.current&&!xe&&Promise.all([H.e(16),H.e(28)]).then(H.t.bind(null,"M/lh",7)).then(function($e){try{S=$e,Fe.current.instance=S.editor.create(je.current,{value:we,language:F(he),theme:ge,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},ae);var Je=Fe.current.instance,vt=T.d._menuItems,St=Object(V.a)(vt).find(function(jt){return jt[0]._debugName=="EditorContext"}),Rt=St[1],mt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],ct=function(qt,Wt){var rn=qt._first;do{var On,Ln,Qe=Wt.includes((On=rn.element)===null||On===void 0||((Ln=On.command)===null||Ln===void 0)?void 0:Ln.id);Qe&&qt._remove(rn)}while(rn=rn.next)};if(Ve(Je,S),setTimeout(function(){yt(),Fe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){dt(lt||"educoder.txt",Je.getValue())}}),Je.getDomNode().addEventListener("input",function(){_e.current.autoFormat&&Je.getAction("editor.action.formatDocument").run()})},500),Fe.current.subscription=Je.onDidChangeModelContent(function(jt){ve.current?clearTimeout(ue.current):(yt(),Le(Je.getValue(),jt)),ue.current=setTimeout(function(){ve.current=!1},500)}),window.Monaco||A(S,F(he)),Ce&&(ct(Rt,mt),je.current.classList.add("noCopyPaste"),Je.onKeyDown(function(jt){var qt=jt.keyCode,Wt=jt.ctrlKey,rn=jt.metaKey;(qt===33||qt===52)&&(rn||Wt)&&(Ke(),jt.preventDefault())})),window.Monaco=S,Re&&Je.onDidBlurEditorWidget(function(){Re(Je.getValue())}),rt&&Je.onDidFocusEditorText(function(){rt(Je.getValue())}),Ce){Je.addCommand(S.KeyMod.CtrlCmd|S.KeyCode.KEY_V,function(){return Ke(),null}),Je.onDidPaste(function(jt){Fe.current.pastePos=jt});try{window.addEventListener("paste",it)}catch(jt){}}var Vt=Ue();return Oe(!0),function(){var jt=Fe.current.instance;jt.dispose();var qt=jt.getModel();qt&&qt.dispose(),Fe.current.subscription&&Fe.current.subscription.dispose(),Ce&&window.removeEventListener("paste",it),Vt.unobserve(je.current)}}catch(jt){}})},[]),Object(W.useEffect)(function(){var $e=Fe.current.instance;if($e&&xe)return document.addEventListener("keydown",nt,!1),function(){document.removeEventListener("keydown",nt)}},[Te,xe]),Object(W.useEffect)(function(){var $e=Fe.current.instance;if($e&&xe){var Je=F(he);S.editor.setModelLanguage($e.getModel(),Je),console.log("language:",he,$e.getModel(),Je)}},[he,xe]),Object(W.useEffect)(function(){var $e=Fe.current.instance;$e&&xe&&S.editor.setTheme(ge)},[ge,xe]),Object(W.useEffect)(function(){var $e=Fe.current.instance;_e.current=le,$e&&xe&&($e.updateOptions(Object(ee.a)({},le)),setTimeout(function(){$e.getModel().updateOptions(Object(ee.a)({},le))},200))},[JSON.stringify(le),xe]),Object(W.useEffect)(function(){var $e=Fe.current.instance;$e&&xe&&$e.layout()},[Q,fe,xe]);var wt=Object(W.useState)(E(Q)),Tt=Object(P.a)(wt,2),Ct=Tt[0],Nt=Tt[1],At=Object(W.useState)(E(fe)),It=Object(P.a)(At,2),gt=It[0],Ye=It[1],_t=Object(ee.a)(Object(ee.a)({},me),{},{width:Ct,height:gt});return n.a.createElement("div",{className:"my-monaco-editor",ref:je,style:_t})};function I(b){var K=b.width,Q=K===void 0?"100%":K,ne=b.height,fe=ne===void 0?"100%":ne,we=b.original,Se=b.modified,he=b.language,se=b.options,me=se===void 0?{}:se,re=Object(W.useRef)(),le=Object(W.useState)(null),Z=Object(P.a)(le,2),ae=Z[0],oe=Z[1];function ge(Be){var pe;return re.current&&(pe=new D.default(function(Ce){var ke=Object(j.a)(Ce),Le;try{for(ke.s();!(Le=ke.n()).done;){var Ge=Le.value;(Ge.target.offsetHeight>0||Ge.target.offsetWidth>0)&&Be.layout()}}catch(Ve){ke.e(Ve)}finally{ke.f()}}),pe.observe(re.current)),pe}Object(W.useEffect)(function(){re.current&&Promise.all([H.e(16),H.e(28)]).then(H.t.bind(null,"M/lh",7)).then(function(Be){S=Be;var pe=S.editor.createDiffEditor(re.current,Object(ee.a)(Object(ee.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},me),{},{wordWrap:!0}));oe(pe);var Ce=ge(pe);return function(){pe.dispose();var ke=pe.getModel();ke&&ke.dispose(),Ce.unobserve(re.current)}})},[]),Object(W.useEffect)(function(){ae&&ae.setModel({original:S.editor.createModel(we,he),modified:S.editor.createModel(Se,he)})},[we,Se,he,ae]);var Re=E(Q),Te=E(fe),Me={width:Re,height:Te};return n.a.createElement("div",{className:"my-diff-editor",ref:re,style:Me})}},ZpRC:function(at,Ee,H){"use strict";function ee(y){return typeof y=="object"&&y!=null&&y.nodeType===1}function V(y,g){return(!g||y!=="hidden")&&y!=="visible"&&y!=="clip"}function N(y,g){if(y.clientHeight<y.scrollHeight||y.clientWidth<y.scrollWidth){var p=getComputedStyle(y,null);return V(p.overflowY,g)||V(p.overflowX,g)||function(l){var a=function(f){if(!f.ownerDocument||!f.ownerDocument.defaultView)return null;try{return f.ownerDocument.defaultView.frameElement}catch(u){return null}}(l);return!!a&&(a.clientHeight<l.scrollHeight||a.clientWidth<l.scrollWidth)}(y)}return!1}function $(y,g,p,l,a,f,u,d){return f<y&&u>g||f>y&&u<g?0:f<=y&&d<=p||u>=g&&d>=p?f-y-l:u>g&&d<p||f<y&&d>p?u-g+a:0}var j=function(y,g){var p=window,l=g.scrollMode,a=g.block,f=g.inline,u=g.boundary,d=g.skipOverflowHiddenElements,i=typeof u=="function"?u:function(Be){return Be!==u};if(!ee(y))throw new TypeError("Invalid target");for(var o=document.scrollingElement||document.documentElement,O=[],w=y;ee(w)&&i(w);){if((w=w.parentElement)===o){O.push(w);break}w!=null&&w===document.body&&N(w)&&!N(document.documentElement)||w!=null&&N(w,d)&&O.push(w)}for(var C=p.visualViewport?p.visualViewport.width:innerWidth,L=p.visualViewport?p.visualViewport.height:innerHeight,A=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,T=y.getBoundingClientRect(),v=T.height,c=T.width,E=T.top,h=T.right,x=T.bottom,U=T.left,F=a==="start"||a==="nearest"?E:a==="end"?x:E+v/2,S=f==="center"?U+c/2:f==="end"?h:U,M=[],I=0;I<O.length;I++){var b=O[I],K=b.getBoundingClientRect(),Q=K.height,ne=K.width,fe=K.top,we=K.right,Se=K.bottom,he=K.left;if(l==="if-needed"&&E>=0&&U>=0&&x<=L&&h<=C&&E>=fe&&x<=Se&&U>=he&&h<=we)return M;var se=getComputedStyle(b),me=parseInt(se.borderLeftWidth,10),re=parseInt(se.borderTopWidth,10),le=parseInt(se.borderRightWidth,10),Z=parseInt(se.borderBottomWidth,10),ae=0,oe=0,ge="offsetWidth"in b?b.offsetWidth-b.clientWidth-me-le:0,Re="offsetHeight"in b?b.offsetHeight-b.clientHeight-re-Z:0;if(o===b)ae=a==="start"?F:a==="end"?F-L:a==="nearest"?$(_,_+L,L,re,Z,_+F,_+F+v,v):F-L/2,oe=f==="start"?S:f==="center"?S-C/2:f==="end"?S-C:$(A,A+C,C,me,le,A+S,A+S+c,c),ae=Math.max(0,ae+_),oe=Math.max(0,oe+A);else{ae=a==="start"?F-fe-re:a==="end"?F-Se+Z+Re:a==="nearest"?$(fe,Se,Q,re,Z+Re,F,F+v,v):F-(fe+Q/2)+Re/2,oe=f==="start"?S-he-me:f==="center"?S-(he+ne/2)+ge/2:f==="end"?S-we+le+ge:$(he,we,ne,me,le+ge,S,S+c,c);var Te=b.scrollLeft,Me=b.scrollTop;F+=Me-(ae=Math.max(0,Math.min(Me+ae,b.scrollHeight-Q+Re))),S+=Te-(oe=Math.max(0,Math.min(Te+oe,b.scrollWidth-ne+ge)))}M.push({el:b,top:ae,left:oe})}return M};function P(y){return y===Object(y)&&Object.keys(y).length!==0}function G(y,g){g===void 0&&(g="auto");var p="scrollBehavior"in document.body.style;y.forEach(function(l){var a=l.el,f=l.top,u=l.left;a.scroll&&p?a.scroll({top:f,left:u,behavior:g}):(a.scrollTop=f,a.scrollLeft=u)})}function W(y){return y===!1?{block:"end",inline:"nearest"}:P(y)?y:{block:"start",inline:"nearest"}}function n(y,g){var p=!y.ownerDocument.documentElement.contains(y);if(P(g)&&typeof g.behavior=="function")return g.behavior(p?[]:j(y,g));if(p)return;var l=W(g);return G(j(y,l),l.behavior)}var D=Ee.a=n},Zss7:function(at,Ee,H){var ee;(function(V){var N=/^\s+/,$=/\s+$/,j=0,P=V.round,G=V.min,W=V.max,n=V.random;function D(Z,ae){if(Z=Z||"",ae=ae||{},Z instanceof D)return Z;if(!(this instanceof D))return new D(Z,ae);var oe=y(Z);this._originalInput=Z,this._r=oe.r,this._g=oe.g,this._b=oe.b,this._a=oe.a,this._roundA=P(100*this._a)/100,this._format=ae.format||oe.format,this._gradientType=ae.gradientType,this._r<1&&(this._r=P(this._r)),this._g<1&&(this._g=P(this._g)),this._b<1&&(this._b=P(this._b)),this._ok=oe.ok,this._tc_id=j++}D.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 Z=this.toRgb();return(Z.r*299+Z.g*587+Z.b*114)/1e3},getLuminance:function(){var Z=this.toRgb(),ae,oe,ge,Re,Te,Me;return ae=Z.r/255,oe=Z.g/255,ge=Z.b/255,ae<=.03928?Re=ae/12.92:Re=V.pow((ae+.055)/1.055,2.4),oe<=.03928?Te=oe/12.92:Te=V.pow((oe+.055)/1.055,2.4),ge<=.03928?Me=ge/12.92:Me=V.pow((ge+.055)/1.055,2.4),.2126*Re+.7152*Te+.0722*Me},setAlpha:function(Z){return this._a=M(Z),this._roundA=P(100*this._a)/100,this},toHsv:function(){var Z=a(this._r,this._g,this._b);return{h:Z.h*360,s:Z.s,v:Z.v,a:this._a}},toHsvString:function(){var Z=a(this._r,this._g,this._b),ae=P(Z.h*360),oe=P(Z.s*100),ge=P(Z.v*100);return this._a==1?"hsv("+ae+", "+oe+"%, "+ge+"%)":"hsva("+ae+", "+oe+"%, "+ge+"%, "+this._roundA+")"},toHsl:function(){var Z=p(this._r,this._g,this._b);return{h:Z.h*360,s:Z.s,l:Z.l,a:this._a}},toHslString:function(){var Z=p(this._r,this._g,this._b),ae=P(Z.h*360),oe=P(Z.s*100),ge=P(Z.l*100);return this._a==1?"hsl("+ae+", "+oe+"%, "+ge+"%)":"hsla("+ae+", "+oe+"%, "+ge+"%, "+this._roundA+")"},toHex:function(Z){return u(this._r,this._g,this._b,Z)},toHexString:function(Z){return"#"+this.toHex(Z)},toHex8:function(Z){return d(this._r,this._g,this._b,this._a,Z)},toHex8String:function(Z){return"#"+this.toHex8(Z)},toRgb:function(){return{r:P(this._r),g:P(this._g),b:P(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+P(this._r)+", "+P(this._g)+", "+P(this._b)+")":"rgba("+P(this._r)+", "+P(this._g)+", "+P(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:P(I(this._r,255)*100)+"%",g:P(I(this._g,255)*100)+"%",b:P(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+P(I(this._r,255)*100)+"%, "+P(I(this._g,255)*100)+"%, "+P(I(this._b,255)*100)+"%)":"rgba("+P(I(this._r,255)*100)+"%, "+P(I(this._g,255)*100)+"%, "+P(I(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:F[u(this._r,this._g,this._b,!0)]||!1},toFilter:function(Z){var ae="#"+i(this._r,this._g,this._b,this._a),oe=ae,ge=this._gradientType?"GradientType = 1, ":"";if(Z){var Re=D(Z);oe="#"+i(Re._r,Re._g,Re._b,Re._a)}return"progid:DXImageTransform.Microsoft.gradient("+ge+"startColorstr="+ae+",endColorstr="+oe+")"},toString:function(Z){var ae=!!Z;Z=Z||this._format;var oe=!1,ge=this._a<1&&this._a>=0,Re=!ae&&ge&&(Z==="hex"||Z==="hex6"||Z==="hex3"||Z==="hex4"||Z==="hex8"||Z==="name");return Re?Z==="name"&&this._a===0?this.toName():this.toRgbString():(Z==="rgb"&&(oe=this.toRgbString()),Z==="prgb"&&(oe=this.toPercentageRgbString()),(Z==="hex"||Z==="hex6")&&(oe=this.toHexString()),Z==="hex3"&&(oe=this.toHexString(!0)),Z==="hex4"&&(oe=this.toHex8String(!0)),Z==="hex8"&&(oe=this.toHex8String()),Z==="name"&&(oe=this.toName()),Z==="hsl"&&(oe=this.toHslString()),Z==="hsv"&&(oe=this.toHsvString()),oe||this.toHexString())},clone:function(){return D(this.toString())},_applyModification:function(Z,ae){var oe=Z.apply(null,[this].concat([].slice.call(ae)));return this._r=oe._r,this._g=oe._g,this._b=oe._b,this.setAlpha(oe._a),this},lighten:function(){return this._applyModification(C,arguments)},brighten:function(){return this._applyModification(L,arguments)},darken:function(){return this._applyModification(A,arguments)},desaturate:function(){return this._applyModification(o,arguments)},saturate:function(){return this._applyModification(O,arguments)},greyscale:function(){return this._applyModification(w,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(Z,ae){return Z.apply(null,[this].concat([].slice.call(ae)))},analogous:function(){return this._applyCombination(h,arguments)},complement:function(){return this._applyCombination(T,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(E,arguments)},triad:function(){return this._applyCombination(v,arguments)},tetrad:function(){return this._applyCombination(c,arguments)}},D.fromRatio=function(Z,ae){if(typeof Z=="object"){var oe={};for(var ge in Z)Z.hasOwnProperty(ge)&&(ge==="a"?oe[ge]=Z[ge]:oe[ge]=we(Z[ge]));Z=oe}return D(Z,ae)};function y(Z){var ae={r:0,g:0,b:0},oe=1,ge=null,Re=null,Te=null,Me=!1,Be=!1;return typeof Z=="string"&&(Z=re(Z)),typeof Z=="object"&&(me(Z.r)&&me(Z.g)&&me(Z.b)?(ae=g(Z.r,Z.g,Z.b),Me=!0,Be=String(Z.r).substr(-1)==="%"?"prgb":"rgb"):me(Z.h)&&me(Z.s)&&me(Z.v)?(ge=we(Z.s),Re=we(Z.v),ae=f(Z.h,ge,Re),Me=!0,Be="hsv"):me(Z.h)&&me(Z.s)&&me(Z.l)&&(ge=we(Z.s),Te=we(Z.l),ae=l(Z.h,ge,Te),Me=!0,Be="hsl"),Z.hasOwnProperty("a")&&(oe=Z.a)),oe=M(oe),{ok:Me,format:Z.format||Be,r:G(255,W(ae.r,0)),g:G(255,W(ae.g,0)),b:G(255,W(ae.b,0)),a:oe}}function g(Z,ae,oe){return{r:I(Z,255)*255,g:I(ae,255)*255,b:I(oe,255)*255}}function p(Z,ae,oe){Z=I(Z,255),ae=I(ae,255),oe=I(oe,255);var ge=W(Z,ae,oe),Re=G(Z,ae,oe),Te,Me,Be=(ge+Re)/2;if(ge==Re)Te=Me=0;else{var pe=ge-Re;Me=Be>.5?pe/(2-ge-Re):pe/(ge+Re);switch(ge){case Z:Te=(ae-oe)/pe+(ae<oe?6:0);break;case ae:Te=(oe-Z)/pe+2;break;case oe:Te=(Z-ae)/pe+4;break}Te/=6}return{h:Te,s:Me,l:Be}}function l(Z,ae,oe){var ge,Re,Te;Z=I(Z,360),ae=I(ae,100),oe=I(oe,100);function Me(Ce,ke,Le){return Le<0&&(Le+=1),Le>1&&(Le-=1),Le<1/6?Ce+(ke-Ce)*6*Le:Le<1/2?ke:Le<2/3?Ce+(ke-Ce)*(2/3-Le)*6:Ce}if(ae===0)ge=Re=Te=oe;else{var Be=oe<.5?oe*(1+ae):oe+ae-oe*ae,pe=2*oe-Be;ge=Me(pe,Be,Z+1/3),Re=Me(pe,Be,Z),Te=Me(pe,Be,Z-1/3)}return{r:ge*255,g:Re*255,b:Te*255}}function a(Z,ae,oe){Z=I(Z,255),ae=I(ae,255),oe=I(oe,255);var ge=W(Z,ae,oe),Re=G(Z,ae,oe),Te,Me,Be=ge,pe=ge-Re;if(Me=ge===0?0:pe/ge,ge==Re)Te=0;else{switch(ge){case Z:Te=(ae-oe)/pe+(ae<oe?6:0);break;case ae:Te=(oe-Z)/pe+2;break;case oe:Te=(Z-ae)/pe+4;break}Te/=6}return{h:Te,s:Me,v:Be}}function f(Z,ae,oe){Z=I(Z,360)*6,ae=I(ae,100),oe=I(oe,100);var ge=V.floor(Z),Re=Z-ge,Te=oe*(1-ae),Me=oe*(1-Re*ae),Be=oe*(1-(1-Re)*ae),pe=ge%6,Ce=[oe,Me,Te,Te,Be,oe][pe],ke=[Be,oe,oe,Me,Te,Te][pe],Le=[Te,Te,Be,oe,oe,Me][pe];return{r:Ce*255,g:ke*255,b:Le*255}}function u(Z,ae,oe,ge){var Re=[fe(P(Z).toString(16)),fe(P(ae).toString(16)),fe(P(oe).toString(16))];return ge&&Re[0].charAt(0)==Re[0].charAt(1)&&Re[1].charAt(0)==Re[1].charAt(1)&&Re[2].charAt(0)==Re[2].charAt(1)?Re[0].charAt(0)+Re[1].charAt(0)+Re[2].charAt(0):Re.join("")}function d(Z,ae,oe,ge,Re){var Te=[fe(P(Z).toString(16)),fe(P(ae).toString(16)),fe(P(oe).toString(16)),fe(Se(ge))];return Re&&Te[0].charAt(0)==Te[0].charAt(1)&&Te[1].charAt(0)==Te[1].charAt(1)&&Te[2].charAt(0)==Te[2].charAt(1)&&Te[3].charAt(0)==Te[3].charAt(1)?Te[0].charAt(0)+Te[1].charAt(0)+Te[2].charAt(0)+Te[3].charAt(0):Te.join("")}function i(Z,ae,oe,ge){var Re=[fe(Se(ge)),fe(P(Z).toString(16)),fe(P(ae).toString(16)),fe(P(oe).toString(16))];return Re.join("")}D.equals=function(Z,ae){return!Z||!ae?!1:D(Z).toRgbString()==D(ae).toRgbString()},D.random=function(){return D.fromRatio({r:n(),g:n(),b:n()})};function o(Z,ae){ae=ae===0?0:ae||10;var oe=D(Z).toHsl();return oe.s-=ae/100,oe.s=b(oe.s),D(oe)}function O(Z,ae){ae=ae===0?0:ae||10;var oe=D(Z).toHsl();return oe.s+=ae/100,oe.s=b(oe.s),D(oe)}function w(Z){return D(Z).desaturate(100)}function C(Z,ae){ae=ae===0?0:ae||10;var oe=D(Z).toHsl();return oe.l+=ae/100,oe.l=b(oe.l),D(oe)}function L(Z,ae){ae=ae===0?0:ae||10;var oe=D(Z).toRgb();return oe.r=W(0,G(255,oe.r-P(255*-(ae/100)))),oe.g=W(0,G(255,oe.g-P(255*-(ae/100)))),oe.b=W(0,G(255,oe.b-P(255*-(ae/100)))),D(oe)}function A(Z,ae){ae=ae===0?0:ae||10;var oe=D(Z).toHsl();return oe.l-=ae/100,oe.l=b(oe.l),D(oe)}function _(Z,ae){var oe=D(Z).toHsl(),ge=(oe.h+ae)%360;return oe.h=ge<0?360+ge:ge,D(oe)}function T(Z){var ae=D(Z).toHsl();return ae.h=(ae.h+180)%360,D(ae)}function v(Z){var ae=D(Z).toHsl(),oe=ae.h;return[D(Z),D({h:(oe+120)%360,s:ae.s,l:ae.l}),D({h:(oe+240)%360,s:ae.s,l:ae.l})]}function c(Z){var ae=D(Z).toHsl(),oe=ae.h;return[D(Z),D({h:(oe+90)%360,s:ae.s,l:ae.l}),D({h:(oe+180)%360,s:ae.s,l:ae.l}),D({h:(oe+270)%360,s:ae.s,l:ae.l})]}function E(Z){var ae=D(Z).toHsl(),oe=ae.h;return[D(Z),D({h:(oe+72)%360,s:ae.s,l:ae.l}),D({h:(oe+216)%360,s:ae.s,l:ae.l})]}function h(Z,ae,oe){ae=ae||6,oe=oe||30;var ge=D(Z).toHsl(),Re=360/oe,Te=[D(Z)];for(ge.h=(ge.h-(Re*ae>>1)+720)%360;--ae;)ge.h=(ge.h+Re)%360,Te.push(D(ge));return Te}function x(Z,ae){ae=ae||6;for(var oe=D(Z).toHsv(),ge=oe.h,Re=oe.s,Te=oe.v,Me=[],Be=1/ae;ae--;)Me.push(D({h:ge,s:Re,v:Te})),Te=(Te+Be)%1;return Me}D.mix=function(Z,ae,oe){oe=oe===0?0:oe||50;var ge=D(Z).toRgb(),Re=D(ae).toRgb(),Te=oe/100,Me={r:(Re.r-ge.r)*Te+ge.r,g:(Re.g-ge.g)*Te+ge.g,b:(Re.b-ge.b)*Te+ge.b,a:(Re.a-ge.a)*Te+ge.a};return D(Me)},D.readability=function(Z,ae){var oe=D(Z),ge=D(ae);return(V.max(oe.getLuminance(),ge.getLuminance())+.05)/(V.min(oe.getLuminance(),ge.getLuminance())+.05)},D.isReadable=function(Z,ae,oe){var ge=D.readability(Z,ae),Re,Te;Te=!1,Re=le(oe);switch(Re.level+Re.size){case"AAsmall":case"AAAlarge":Te=ge>=4.5;break;case"AAlarge":Te=ge>=3;break;case"AAAsmall":Te=ge>=7;break}return Te},D.mostReadable=function(Z,ae,oe){var ge=null,Re=0,Te,Me,Be,pe;oe=oe||{},Me=oe.includeFallbackColors,Be=oe.level,pe=oe.size;for(var Ce=0;Ce<ae.length;Ce++)Te=D.readability(Z,ae[Ce]),Te>Re&&(Re=Te,ge=D(ae[Ce]));return D.isReadable(Z,ge,{level:Be,size:pe})||!Me?ge:(oe.includeFallbackColors=!1,D.mostReadable(Z,["#fff","#000"],oe))};var U=D.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=D.hexNames=S(U);function S(Z){var ae={};for(var oe in Z)Z.hasOwnProperty(oe)&&(ae[Z[oe]]=oe);return ae}function M(Z){return Z=parseFloat(Z),(isNaN(Z)||Z<0||Z>1)&&(Z=1),Z}function I(Z,ae){Q(Z)&&(Z="100%");var oe=ne(Z);return Z=G(ae,W(0,parseFloat(Z))),oe&&(Z=parseInt(Z*ae,10)/100),V.abs(Z-ae)<1e-6?1:Z%ae/parseFloat(ae)}function b(Z){return G(1,W(0,Z))}function K(Z){return parseInt(Z,16)}function Q(Z){return typeof Z=="string"&&Z.indexOf(".")!=-1&&parseFloat(Z)===1}function ne(Z){return typeof Z=="string"&&Z.indexOf("%")!=-1}function fe(Z){return Z.length==1?"0"+Z:""+Z}function we(Z){return Z<=1&&(Z=Z*100+"%"),Z}function Se(Z){return V.round(parseFloat(Z)*255).toString(16)}function he(Z){return K(Z)/255}var se=function(){var Z="[-\\+]?\\d+%?",ae="[-\\+]?\\d*\\.\\d+%?",oe="(?:"+ae+")|(?:"+Z+")",ge="[\\s|\\(]+("+oe+")[,|\\s]+("+oe+")[,|\\s]+("+oe+")\\s*\\)?",Re="[\\s|\\(]+("+oe+")[,|\\s]+("+oe+")[,|\\s]+("+oe+")[,|\\s]+("+oe+")\\s*\\)?";return{CSS_UNIT:new RegExp(oe),rgb:new RegExp("rgb"+ge),rgba:new RegExp("rgba"+Re),hsl:new RegExp("hsl"+ge),hsla:new RegExp("hsla"+Re),hsv:new RegExp("hsv"+ge),hsva:new RegExp("hsva"+Re),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 me(Z){return!!se.CSS_UNIT.exec(Z)}function re(Z){Z=Z.replace(N,"").replace($,"").toLowerCase();var ae=!1;if(U[Z])Z=U[Z],ae=!0;else if(Z=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var oe;return(oe=se.rgb.exec(Z))?{r:oe[1],g:oe[2],b:oe[3]}:(oe=se.rgba.exec(Z))?{r:oe[1],g:oe[2],b:oe[3],a:oe[4]}:(oe=se.hsl.exec(Z))?{h:oe[1],s:oe[2],l:oe[3]}:(oe=se.hsla.exec(Z))?{h:oe[1],s:oe[2],l:oe[3],a:oe[4]}:(oe=se.hsv.exec(Z))?{h:oe[1],s:oe[2],v:oe[3]}:(oe=se.hsva.exec(Z))?{h:oe[1],s:oe[2],v:oe[3],a:oe[4]}:(oe=se.hex8.exec(Z))?{r:K(oe[1]),g:K(oe[2]),b:K(oe[3]),a:he(oe[4]),format:ae?"name":"hex8"}:(oe=se.hex6.exec(Z))?{r:K(oe[1]),g:K(oe[2]),b:K(oe[3]),format:ae?"name":"hex"}:(oe=se.hex4.exec(Z))?{r:K(oe[1]+""+oe[1]),g:K(oe[2]+""+oe[2]),b:K(oe[3]+""+oe[3]),a:he(oe[4]+""+oe[4]),format:ae?"name":"hex8"}:(oe=se.hex3.exec(Z))?{r:K(oe[1]+""+oe[1]),g:K(oe[2]+""+oe[2]),b:K(oe[3]+""+oe[3]),format:ae?"name":"hex"}:!1}function le(Z){var ae,oe;return Z=Z||{level:"AA",size:"small"},ae=(Z.level||"AA").toUpperCase(),oe=(Z.size||"small").toLowerCase(),ae!=="AA"&&ae!=="AAA"&&(ae="AA"),oe!=="small"&&oe!=="large"&&(oe="small"),{level:ae,size:oe}}at.exports?at.exports=D:!(ee=function(){return D}.call(Ee,H,Ee,at),ee!==void 0&&(at.exports=ee))})(Math)},bT9E:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return V});var ee=H("VTBJ");function V(N,$){var j=Object(ee.a)({},N);return Array.isArray($)&&$.forEach(function(P){delete j[P]}),j}},biw7:function(at,Ee,H){"use strict";var ee=H("q1tI"),V=H.n(ee),N=ee.createContext(null);Ee.a=N},c5Ni:function(at,Ee,H){},dejd:function(at,Ee,H){},dmUQ:function(at,Ee,H){"use strict";var ee=H("Ff2n"),V=H("rePB"),N=H("1OyB"),$=H("vuIU"),j=H("Ji7U"),P=H("md7G"),G=H("foSv"),W=H("q1tI"),n=H.n(W),D=H("TSYQ"),y=H.n(D),g=H("4IlW");function p(v,c){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(v);c&&(h=h.filter(function(x){return Object.getOwnPropertyDescriptor(v,x).enumerable})),E.push.apply(E,h)}return E}function l(v){for(var c=1;c<arguments.length;c++){var E=arguments[c]!=null?arguments[c]:{};c%2?p(Object(E),!0).forEach(function(h){Object(V.a)(v,h,E[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):p(Object(E)).forEach(function(h){Object.defineProperty(v,h,Object.getOwnPropertyDescriptor(E,h))})}return v}function a(v){var c=f();return function(){var h=Object(G.a)(v),x;if(c){var U=Object(G.a)(this).constructor;x=Reflect.construct(h,arguments,U)}else x=h.apply(this,arguments);return Object(P.a)(this,x)}}function f(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(v){return!1}}function u(){}function d(v){v.preventDefault()}var i=function(c){return c.replace(/[^\w.-]+/g,"")},o=200,O=600,w=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,C=function(c){return c!=null},L=function(c,E){return E===c||typeof E=="number"&&typeof c=="number"&&isNaN(E)&&isNaN(c)},A=function(v){Object(j.a)(E,v);var c=a(E);function E(h){var x;Object(N.a)(this,E),x=c.call(this,h),x.onKeyDown=function(S){var M=x.props,I=M.onKeyDown,b=M.onPressEnter;if(S.keyCode===g.a.UP){var K=x.getRatio(S);x.up(S,K,null),x.stop()}else if(S.keyCode===g.a.DOWN){var Q=x.getRatio(S);x.down(S,Q,null),x.stop()}else S.keyCode===g.a.ENTER&&b&&b(S);if(x.recordCursorPosition(),x.lastKeyCode=S.keyCode,I){for(var ne=arguments.length,fe=new Array(ne>1?ne-1:0),we=1;we<ne;we++)fe[we-1]=arguments[we];I.apply(void 0,[S].concat(fe))}},x.onKeyUp=function(S){var M=x.props.onKeyUp;if(x.stop(),x.recordCursorPosition(),M){for(var I=arguments.length,b=new Array(I>1?I-1:0),K=1;K<I;K++)b[K-1]=arguments[K];M.apply(void 0,[S].concat(b))}},x.onChange=function(S){var M=x.props.onChange;x.state.focused&&(x.inputting=!0),x.rawInput=x.props.parser(x.getValueFromEvent(S)),x.setState({inputValue:x.rawInput}),M(x.toNumber(x.rawInput))},x.onMouseUp=function(){var S=x.props.onMouseUp;x.recordCursorPosition(),S&&S.apply(void 0,arguments)},x.onFocus=function(){var S;x.setState({focused:!0}),(S=x.props).onFocus.apply(S,arguments)},x.onBlur=function(){var S=x.props.onBlur;x.inputting=!1,x.setState({focused:!1});var M=x.getCurrentValidValue(x.state.inputValue),I=x.setValue(M,u);if(S){var b=x.input.value,K=x.getInputDisplayValue({focus:!1,value:I});x.input.value=K&&Number(K),S.apply(void 0,arguments),x.input.value=b}},x.getRatio=function(S){var M=1;return S.metaKey||S.ctrlKey?M=.1:S.shiftKey&&(M=10),M},x.getFullNum=function(S){return isNaN(S)?S:/e/i.test(String(S))?Number(S).toFixed(18).replace(/\.?0+$/,""):S},x.getPrecision=function(S){if(C(x.props.precision))return x.props.precision;var M=String(S);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},x.getInputDisplayValue=function(S){var M=S||x.state,I=M.focused,b=M.inputValue,K=M.value,Q;I?Q=b:Q=x.toPrecisionAsStep(K),Q==null&&(Q="");var ne=x.formatWrapper(Q);return C(x.props.decimalSeparator)&&(ne=ne.toString().replace(".",x.props.decimalSeparator)),ne},x.recordCursorPosition=function(){try{x.cursorStart=x.input.selectionStart,x.cursorEnd=x.input.selectionEnd,x.currentValue=x.input.value,x.cursorBefore=x.input.value.substring(0,x.cursorStart),x.cursorAfter=x.input.value.substring(x.cursorEnd)}catch(S){}},x.restoreByAfter=function(S){if(S===void 0)return!1;var M=x.input.value,I=M.lastIndexOf(S);if(I===-1)return!1;var b=x.cursorBefore.length;return x.lastKeyCode===g.a.DELETE&&x.cursorBefore.charAt(b-1)===S[0]?(x.fixCaret(b,b),!0):I+S.length===M.length?(x.fixCaret(I,I),!0):!1},x.partRestoreByAfter=function(S){return S===void 0?!1:Array.prototype.some.call(S,function(M,I){var b=S.substring(I);return x.restoreByAfter(b)})},x.isNotCompleteNumber=function(S){return isNaN(S)||S===""||S===null||S&&S.toString().indexOf(".")===S.toString().length-1},x.stop=function(){x.autoStepTimer&&clearTimeout(x.autoStepTimer)},x.down=function(S,M,I){x.pressingUpOrDown=!0,x.step("down",S,M,I)},x.up=function(S,M,I){x.pressingUpOrDown=!0,x.step("up",S,M,I)},x.saveInput=function(S){x.input=S};var U=h.value;U===void 0&&(U=h.defaultValue),x.state={focused:h.autoFocus};var F=x.getValidValue(x.toNumber(U));return x.state=l(l({},x.state),{},{inputValue:x.toPrecisionAsStep(F),value:F}),x}return Object($.a)(E,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(x){var U=this.props,F=U.value,S=U.onChange,M=U.max,I=U.min,b=this.state.focused;if(x){if(!L(x.value,F)||!L(x.max,M)||!L(x.min,I)){var K=b?F:this.getValidValue(F),Q;this.pressingUpOrDown?Q=K:this.inputting?Q=this.rawInput:Q=this.toPrecisionAsStep(K),this.setState({value:K,inputValue:Q})}var ne="value"in this.props?F:this.state.value;"max"in this.props&&x.max!==M&&typeof ne=="number"&&ne>M&&S&&S(M),"min"in this.props&&x.min!==I&&typeof ne=="number"&&ne<I&&S&&S(I)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var fe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===g.a.BACKSPACE?fe=this.cursorStart-1:this.lastKeyCode===g.a.DELETE&&(fe=this.cursorStart):fe=this.input.value.length,this.fixCaret(fe,fe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case g.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case g.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(x){var U=x;return U===""?U="":this.isNotCompleteNumber(parseFloat(U))?U=this.state.value:U=this.getValidValue(U),this.toNumber(U)}},{key:"getValueFromEvent",value:function(x){var U=x.target.value.trim().replace(/。/g,".");return C(this.props.decimalSeparator)&&(U=U.replace(this.props.decimalSeparator,".")),U}},{key:"getValidValue",value:function(x){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,S=parseFloat(x);return isNaN(S)?x:(S<U&&(S=U),S>F&&(S=F),S)}},{key:"setValue",value:function(x,U){var F=this.props.precision,S=this.isNotCompleteNumber(parseFloat(x))?null:parseFloat(x),M=this.state.value,I=M===void 0?null:M,b=this.state.inputValue,K=b===void 0?null:b,Q=typeof S=="number"?S.toFixed(F):"".concat(S),ne=S!==I||Q!=="".concat(K);return"value"in this.props?(K=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:K},U)):this.setState({value:S,inputValue:this.toPrecisionAsStep(x)},U),ne&&this.props.onChange(S),S}},{key:"getMaxPrecision",value:function(x){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,S=F.precision,M=F.step;if(C(S))return S;var I=this.getPrecision(U),b=this.getPrecision(M),K=this.getPrecision(x);return x?Math.max(K,I+b):I+b}},{key:"getPrecisionFactor",value:function(x){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(x,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(x){return this.props.formatter?this.props.formatter(x):x}},{key:"toPrecisionAsStep",value:function(x){if(this.isNotCompleteNumber(x)||x==="")return x;var U=Math.abs(this.getMaxPrecision(x));return isNaN(U)?x.toString():Number(x).toFixed(U)}},{key:"toNumber",value:function(x){var U=this.props.precision,F=this.state.focused,S=x&&x.length>16&&F;return this.isNotCompleteNumber(x)||S?x:C(U)?Math.round(x*Math.pow(10,U))/Math.pow(10,U):Number(x)}},{key:"upStep",value:function(x,U){var F=this.props.step,S=this.getPrecisionFactor(x,U),M=Math.abs(this.getMaxPrecision(x,U)),I=((S*x+S*F*U)/S).toFixed(M);return this.toNumber(I)}},{key:"downStep",value:function(x,U){var F=this.props.step,S=this.getPrecisionFactor(x,U),M=Math.abs(this.getMaxPrecision(x,U)),I=((S*x-S*F*U)/S).toFixed(M);return this.toNumber(I)}},{key:"step",value:function(x,U){var F=this,S=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 b=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(b))return;var K=this["".concat(x,"Step")](b,S),Q=K>I.max||K<I.min;if(K>I.max?K=I.max:K<I.min&&(K=I.min),this.setValue(K,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),Q)return;this.autoStepTimer=setTimeout(function(){F[x](U,S,!0)},M?o:O)}},{key:"fixCaret",value:function(x,U){if(x===void 0||U===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,S=this.input.selectionEnd;(x!==F||U!==S)&&this.input.setSelectionRange(x,U)}catch(M){}}},{key:"render",value:function(){var x,U=this.props,F=U.prefixCls,S=U.disabled,M=U.readOnly,I=U.useTouch,b=U.autoComplete,K=U.upHandler,Q=U.downHandler,ne=U.className,fe=U.max,we=U.min,Se=U.style,he=U.title,se=U.onMouseEnter,me=U.onMouseLeave,re=U.onMouseOver,le=U.onMouseOut,Z=U.required,ae=U.onClick,oe=U.tabIndex,ge=U.type,Re=U.placeholder,Te=U.id,Me=U.inputMode,Be=U.pattern,pe=U.step,Ce=U.maxLength,ke=U.autoFocus,Le=U.name,Ge=U.onPaste,Ve=U.onInput,tt=Object(ee.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"]),rt=this.state,ut=rt.value,lt=rt.focused,Ne=y()(F,(x={},Object(V.a)(x,ne,!!ne),Object(V.a)(x,"".concat(F,"-disabled"),S),Object(V.a)(x,"".concat(F,"-focused"),lt),x)),Pe={};Object.keys(tt).forEach(function(xe){(xe.substr(0,5)==="data-"||xe.substr(0,5)==="aria-"||xe==="role")&&(Pe[xe]=tt[xe])});var ze=!M&&!S,Xe=this.getInputDisplayValue(null),je=(ut||ut===0)&&(isNaN(ut)||Number(ut)>=fe),Fe=(ut||ut===0)&&(isNaN(ut)||Number(ut)<=we),_e=je||S||M,ye=Fe||S||M,ve=y()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(V.a)({},"".concat(F,"-handler-up-disabled"),_e)),ue=y()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(V.a)({},"".concat(F,"-handler-down-disabled"),ye)),ce=I?{onTouchStart:_e?u:this.up,onTouchEnd:this.stop}:{onMouseDown:_e?u:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},be=I?{onTouchStart:ye?u:this.down,onTouchEnd:this.stop}:{onMouseDown:ye?u:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:Ne,style:Se,title:he,onMouseEnter:se,onMouseLeave:me,onMouseOver:re,onMouseOut:le,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(F,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},ce,{role:"button","aria-label":"Increase Value","aria-disabled":_e,className:ve}),K||n.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:d})),n.a.createElement("span",Object.assign({unselectable:"on"},be,{role:"button","aria-label":"Decrease Value","aria-disabled":ye,className:ue}),Q||n.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:d}))),n.a.createElement("div",{className:"".concat(F,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":we,"aria-valuemax":fe,"aria-valuenow":ut,required:Z,type:ge,placeholder:Re,onPaste:Ge,onClick:ae,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:oe,autoComplete:b,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ze?this.onKeyDown:u,onKeyUp:ze?this.onKeyUp:u,autoFocus:ke,maxLength:Ce,readOnly:M,disabled:S,max:fe,min:we,step:pe,name:Le,title:he,id:Te,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Xe),pattern:Be,inputMode:Me,onInput:Ve},Pe))))}}]),E}(n.a.Component);A.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:w,min:-w,step:1,style:{},onChange:u,onKeyDown:u,onPressEnter:u,onFocus:u,onBlur:u,parser:i,required:!1,autoComplete:"off"};var _=A,T=Ee.a=_},fAei:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return o.a});var ee=H("rePB"),V=H("VTBJ"),N=H("KQm4"),$=H("1OyB"),j=H("vuIU"),P=H("Ji7U"),G=H("LK+K"),W=H("q1tI"),n=H("4IlW"),D=H("Kwbf"),y=H("TSYQ"),g=H.n(y),p=H("sboe"),l=H("OZM5"),a=H("815F"),f=H("ODXe"),u=H("Ff2n"),d=H("+nKL"),i=H("8XRh"),o=H("WaYH"),O=function(we,Se){var he=we.className,se=we.style,me=we.motion,re=we.motionNodes,le=we.motionType,Z=we.onMotionStart,ae=we.onMotionEnd,oe=we.active,ge=we.treeNodeRequiredProps,Re=Object(u.a)(we,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),Te=W.useState(!0),Me=Object(f.a)(Te,2),Be=Me[0],pe=Me[1],Ce=W.useContext(p.a),ke=Ce.prefixCls,Le=W.useRef(!1),Ge=function(){Le.current||ae(),Le.current=!0};return Object(W.useEffect)(function(){re&&le==="hide"&&Be&&pe(!1)},[re]),Object(W.useEffect)(function(){return re&&Z(),function(){re&&Ge()}},[]),re?W.createElement(i.default,Object.assign({ref:Se,visible:Be},me,{motionAppear:le==="show",onAppearEnd:Ge,onLeaveEnd:Ge}),function(Ve,tt){var rt=Ve.className,ut=Ve.style;return W.createElement("div",{ref:tt,className:g()("".concat(ke,"-treenode-motion"),rt),style:ut},re.map(function(lt){var Ne=lt.data,Pe=Ne.key,ze=Object(u.a)(Ne,["key"]),Xe=lt.isStart,je=lt.isEnd;delete ze.children;var Fe=Object(a.f)(Pe,ge);return W.createElement(o.a,Object.assign({},ze,Fe,{active:oe,data:lt.data,key:Pe,isStart:Xe,isEnd:je}))}))}):W.createElement(o.a,Object.assign({domRef:Se,className:he,style:se},Re,{active:oe}))};O.displayName="MotionTreeNode";var w=W.forwardRef(O),C=w;function L(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Se=fe.length,he=we.length;if(Math.abs(Se-he)!==1)return{add:!1,key:null};function se(me,re){var le=new Map;me.forEach(function(ae){le.set(ae,!0)});var Z=re.filter(function(ae){return!le.has(ae)});return Z.length===1?Z[0]:null}return Se<he?{add:!0,key:se(fe,we)}:{add:!1,key:se(we,fe)}}function A(fe,we,Se){var he=fe.findIndex(function(le){var Z=le.data;return Z.key===Se}),se=fe[he+1],me=we.findIndex(function(le){var Z=le.data;return Z.key===Se});if(se){var re=we.findIndex(function(le){var Z=le.data;return Z.key===se.data.key});return we.slice(me+1,re)}return we.slice(me+1)}var _={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},T=function(){},v="RC_TREE_MOTION_".concat(Math.random()),c={key:v},E={key:v,level:0,index:0,pos:"0",node:c},h={parent:null,children:[],pos:E.pos,data:c,isStart:[],isEnd:[]};function x(fe,we,Se,he){return we===!1||!Se?fe:fe.slice(0,Math.ceil(Se/he)+1)}function U(fe){var we=fe.data.key,Se=fe.pos;return Object(a.e)(we,Se)}function F(fe){for(var we=String(fe.data.key),Se=fe;Se.parent;)Se=Se.parent,we="".concat(Se.data.key," > ").concat(we);return we}var S=function(we,Se){var he=we.prefixCls,se=we.data,me=we.selectable,re=we.checkable,le=we.expandedKeys,Z=we.selectedKeys,ae=we.checkedKeys,oe=we.loadedKeys,ge=we.loadingKeys,Re=we.halfCheckedKeys,Te=we.keyEntities,Me=we.disabled,Be=we.dragging,pe=we.dragOverNodeKey,Ce=we.dropPosition,ke=we.motion,Le=we.height,Ge=we.itemHeight,Ve=we.virtual,tt=we.focusable,rt=we.activeItem,ut=we.focused,lt=we.tabIndex,Ne=we.onKeyDown,Pe=we.onFocus,ze=we.onBlur,Xe=we.onActiveChange,je=we.onListChangeStart,Fe=we.onListChangeEnd,_e=Object(u.a)(we,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),ye=W.useRef(null);W.useImperativeHandle(Se,function(){return{scrollTo:function(Je){ye.current.scrollTo(Je)}}});var ve=W.useState(le),ue=Object(f.a)(ve,2),ce=ue[0],be=ue[1],xe=W.useState(se),Oe=Object(f.a)(xe,2),Ue=Oe[0],Ke=Oe[1],et=W.useState(se),it=Object(f.a)(et,2),nt=it[0],yt=it[1],bt=W.useState([]),dt=Object(f.a)(bt,2),wt=dt[0],Tt=dt[1],Ct=W.useState(null),Nt=Object(f.a)(Ct,2),At=Nt[0],It=Nt[1];function gt(){Ke(se),yt(se),Tt([]),It(null),Fe()}W.useEffect(function(){be(le);var $e=L(ce,le);if($e.key!==null)if($e.add){var Je=Ue.findIndex(function(Vt){var jt=Vt.data.key;return jt===$e.key}),vt=x(A(Ue,se,$e.key),Ve,Le,Ge),St=Ue.slice();St.splice(Je+1,0,h),yt(St),Tt(vt),It("show")}else{var Rt=se.findIndex(function(Vt){var jt=Vt.data.key;return jt===$e.key}),mt=x(A(se,Ue,$e.key),Ve,Le,Ge),ct=se.slice();ct.splice(Rt+1,0,h),yt(ct),Tt(mt),It("hide")}else Ue!==se&&(Ke(se),yt(se))},[le,se]),W.useEffect(function(){Be||gt()},[Be]);var Ye=ke?nt:se,_t={expandedKeys:le,selectedKeys:Z,loadedKeys:oe,loadingKeys:ge,checkedKeys:ae,halfCheckedKeys:Re,dragOverNodeKey:pe,dropPosition:Ce,keyEntities:Te};return W.createElement(W.Fragment,null,ut&&rt&&W.createElement("span",{style:_,"aria-live":"assertive"},F(rt)),W.createElement("div",{role:"tree"},W.createElement("input",{style:_,disabled:tt===!1||Me,tabIndex:tt!==!1?lt:null,onKeyDown:Ne,onFocus:Pe,onBlur:ze,value:"",onChange:T})),W.createElement(d.a,Object.assign({},_e,{data:Ye,itemKey:U,height:Le,fullHeight:!1,virtual:Ve,itemHeight:Ge,prefixCls:"".concat(he,"-list"),ref:ye}),function($e){var Je=$e.pos,vt=$e.data,St=vt.key,Rt=Object(u.a)(vt,["key"]),mt=$e.isStart,ct=$e.isEnd,Vt=Object(a.e)(St,Je);delete Rt.children;var jt=Object(a.f)(Vt,_t);return W.createElement(C,Object.assign({},Rt,jt,{active:rt&&St===rt.data.key,pos:Je,data:$e.data,isStart:mt,isEnd:ct,motion:ke,motionNodes:St===v?wt:null,motionType:At,onMotionStart:je,onMotionEnd:gt,treeNodeRequiredProps:_t,onMouseMove:function(){Xe(null)}}))}))},M=W.forwardRef(S);M.displayName="NodeList";var I=M,b=H("NvD2"),K=function(fe){Object(P.a)(Se,fe);var we=Object(G.a)(Se);function Se(){var he;return Object($.a)(this,Se),he=we.apply(this,arguments),he.destroyed=!1,he.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},he.listRef=W.createRef(),he.onNodeDragStart=function(se,me){var re=he.state,le=re.expandedKeys,Z=re.keyEntities,ae=he.props.onDragStart,oe=me.props.eventKey;he.dragNode=me;var ge=Object(l.b)(le,oe);he.setState({dragging:!0,dragNodesKeys:Object(l.g)(oe,Z)}),he.setExpandedKeys(ge),ae&&ae({event:se,node:Object(a.b)(me.props)})},he.onNodeDragEnter=function(se,me){var re=he.state,le=re.expandedKeys,Z=re.keyEntities,ae=re.dragNodesKeys,oe=he.props.onDragEnter,ge=me.props,Re=ge.pos,Te=ge.eventKey;if(!he.dragNode||ae.indexOf(Te)!==-1)return;var Me=Object(l.c)(se,me);if(he.dragNode.props.eventKey===Te&&Me===0){he.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){he.setState({dragOverNodeKey:Te,dropPosition:Me}),he.delayedDragEnterLogic||(he.delayedDragEnterLogic={}),Object.keys(he.delayedDragEnterLogic).forEach(function(Be){clearTimeout(he.delayedDragEnterLogic[Be])}),he.delayedDragEnterLogic[Re]=window.setTimeout(function(){if(!he.state.dragging)return;var Be=Object(N.a)(le),pe=Z[Te];pe&&(pe.children||[]).length&&(Be=Object(l.a)(le,Te)),"expandedKeys"in he.props||he.setExpandedKeys(Be),oe&&oe({event:se,node:Object(a.b)(me.props),expandedKeys:Be})},400)},0)},he.onNodeDragOver=function(se,me){var re=he.state.dragNodesKeys,le=he.props.onDragOver,Z=me.props.eventKey;if(re.indexOf(Z)!==-1)return;if(he.dragNode&&Z===he.state.dragOverNodeKey){var ae=Object(l.c)(se,me);if(ae===he.state.dropPosition)return;he.setState({dropPosition:ae})}le&&le({event:se,node:Object(a.b)(me.props)})},he.onNodeDragLeave=function(se,me){var re=he.props.onDragLeave;he.setState({dragOverNodeKey:""}),re&&re({event:se,node:Object(a.b)(me.props)})},he.onNodeDragEnd=function(se,me){var re=he.props.onDragEnd;he.setState({dragOverNodeKey:""}),he.cleanDragState(),re&&re({event:se,node:Object(a.b)(me.props)}),he.dragNode=null},he.onNodeDrop=function(se,me){var re=he.state,le=re.dragNodesKeys,Z=le===void 0?[]:le,ae=re.dropPosition,oe=he.props.onDrop,ge=me.props,Re=ge.eventKey,Te=ge.pos;if(he.setState({dragOverNodeKey:""}),he.cleanDragState(),Z.indexOf(Re)!==-1){Object(D.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Me=Object(l.k)(Te),Be={event:se,node:Object(a.b)(me.props),dragNode:he.dragNode?Object(a.b)(he.dragNode.props):null,dragNodesKeys:Z.slice(),dropPosition:ae+Number(Me[Me.length-1]),dropToGap:!1};ae!==0&&(Be.dropToGap=!0),oe&&oe(Be),he.dragNode=null},he.cleanDragState=function(){var se=he.state.dragging;se&&he.setState({dragging:!1})},he.onNodeClick=function(se,me){var re=he.props.onClick;re&&re(se,me)},he.onNodeDoubleClick=function(se,me){var re=he.props.onDoubleClick;re&&re(se,me)},he.onNodeSelect=function(se,me){var re=he.state.selectedKeys,le=he.state.keyEntities,Z=he.props,ae=Z.onSelect,oe=Z.multiple,ge=me.selected,Re=me.key,Te=!ge;Te?oe?re=Object(l.a)(re,Re):re=[Re]:re=Object(l.b)(re,Re);var Me=re.map(function(Be){var pe=le[Be];return pe?pe.node:null}).filter(function(Be){return Be});he.setUncontrolledState({selectedKeys:re}),ae&&ae(re,{event:"select",selected:Te,node:me,selectedNodes:Me,nativeEvent:se.nativeEvent})},he.onNodeCheck=function(se,me,re){var le=he.state,Z=le.keyEntities,ae=le.checkedKeys,oe=le.halfCheckedKeys,ge=he.props,Re=ge.checkStrictly,Te=ge.onCheck,Me=me.key,Be,pe={event:"check",node:me,checked:re,nativeEvent:se.nativeEvent};if(Re){var Ce=re?Object(l.a)(ae,Me):Object(l.b)(ae,Me),ke=Object(l.b)(oe,Me);Be={checked:Ce,halfChecked:ke},pe.checkedNodes=Ce.map(function(ut){return Z[ut]}).filter(function(ut){return ut}).map(function(ut){return ut.node}),he.setUncontrolledState({checkedKeys:Ce})}else{var Le=Object(b.a)([].concat(Object(N.a)(ae),[Me]),!0,Z),Ge=Le.checkedKeys,Ve=Le.halfCheckedKeys;if(!re){var tt=new Set(Ge);tt.delete(Me);var rt=Object(b.a)(Array.from(tt),{checked:!1,halfCheckedKeys:Ve},Z);Ge=rt.checkedKeys,Ve=rt.halfCheckedKeys}Be=Ge,pe.checkedNodes=[],pe.checkedNodesPositions=[],pe.halfCheckedKeys=Ve,Ge.forEach(function(ut){var lt=Z[ut];if(!lt)return;var Ne=lt.node,Pe=lt.pos;pe.checkedNodes.push(Ne),pe.checkedNodesPositions.push({node:Ne,pos:Pe})}),he.setUncontrolledState({checkedKeys:Ge},!1,{halfCheckedKeys:Ve})}Te&&Te(Be,pe)},he.onNodeLoad=function(se){return new Promise(function(me){he.setState(function(re){var le=re.loadedKeys,Z=le===void 0?[]:le,ae=re.loadingKeys,oe=ae===void 0?[]:ae,ge=he.props,Re=ge.loadData,Te=ge.onLoad,Me=se.key;if(!Re||Z.indexOf(Me)!==-1||oe.indexOf(Me)!==-1)return{};var Be=Re(se);return Be.then(function(){var pe=he.state,Ce=pe.loadedKeys,ke=pe.loadingKeys,Le=Object(l.a)(Ce,Me),Ge=Object(l.b)(ke,Me);Te&&Te(Le,{event:"load",node:se}),he.setUncontrolledState({loadedKeys:Le}),he.setState({loadingKeys:Ge}),me()}),{loadingKeys:Object(l.a)(oe,Me)}})})},he.onNodeMouseEnter=function(se,me){var re=he.props.onMouseEnter;re&&re({event:se,node:me})},he.onNodeMouseLeave=function(se,me){var re=he.props.onMouseLeave;re&&re({event:se,node:me})},he.onNodeContextMenu=function(se,me){var re=he.props.onRightClick;re&&(se.preventDefault(),re({event:se,node:me}))},he.onFocus=function(){var se=he.props.onFocus;he.setState({focused:!0}),se&&se.apply(void 0,arguments)},he.onBlur=function(){var se=he.props.onBlur;he.setState({focused:!1}),he.onActiveChange(null),se&&se.apply(void 0,arguments)},he.getTreeNodeRequiredProps=function(){var se=he.state,me=se.expandedKeys,re=se.selectedKeys,le=se.loadedKeys,Z=se.loadingKeys,ae=se.checkedKeys,oe=se.halfCheckedKeys,ge=se.dragOverNodeKey,Re=se.dropPosition,Te=se.keyEntities;return{expandedKeys:me||[],selectedKeys:re||[],loadedKeys:le||[],loadingKeys:Z||[],checkedKeys:ae||[],halfCheckedKeys:oe||[],dragOverNodeKey:ge,dropPosition:Re,keyEntities:Te}},he.setExpandedKeys=function(se){var me=he.state.treeData,re=Object(a.d)(me,se);he.setUncontrolledState({expandedKeys:se,flattenNodes:re},!0)},he.onNodeExpand=function(se,me){var re=he.state.expandedKeys,le=he.state.listChanging,Z=he.props,ae=Z.onExpand,oe=Z.loadData,ge=me.key,Re=me.expanded;if(le)return;var Te=re.indexOf(ge),Me=!Re;if(Object(D.a)(Re&&Te!==-1||!Re&&Te===-1,"Expand state not sync with index check"),Me?re=Object(l.a)(re,ge):re=Object(l.b)(re,ge),he.setExpandedKeys(re),ae&&ae(re,{node:me,expanded:Me,nativeEvent:se.nativeEvent}),Me&&oe){var Be=he.onNodeLoad(me);Be&&Be.then(function(){var pe=Object(a.d)(he.state.treeData,re);he.setUncontrolledState({flattenNodes:pe})})}},he.onListChangeStart=function(){he.setUncontrolledState({listChanging:!0})},he.onListChangeEnd=function(){setTimeout(function(){he.setUncontrolledState({listChanging:!1})})},he.onActiveChange=function(se){var me=he.state.activeKey,re=he.props.onActiveChange;if(me===se)return;he.setState({activeKey:se}),se!==null&&he.scrollTo({key:se}),re&&re(se)},he.getActiveItem=function(){var se=he.state,me=se.activeKey,re=se.flattenNodes;return me===null?null:re.find(function(le){var Z=le.data.key;return Z===me})||null},he.offsetActiveKey=function(se){var me=he.state,re=me.flattenNodes,le=me.activeKey,Z=re.findIndex(function(ge){var Re=ge.data.key;return Re===le});Z===-1&&se<0&&(Z=re.length),Z=(Z+se+re.length)%re.length;var ae=re[Z];if(ae){var oe=ae.data.key;he.onActiveChange(oe)}else he.onActiveChange(null)},he.onKeyDown=function(se){var me=he.state,re=me.activeKey,le=me.expandedKeys,Z=me.checkedKeys,ae=he.props,oe=ae.onKeyDown,ge=ae.checkable,Re=ae.selectable;switch(se.which){case n.a.UP:{he.offsetActiveKey(-1),se.preventDefault();break}case n.a.DOWN:{he.offsetActiveKey(1),se.preventDefault();break}}var Te=he.getActiveItem();if(Te&&Te.data){var Me=he.getTreeNodeRequiredProps(),Be=Te.data.isLeaf===!1||!!(Te.data.children||[]).length,pe=Object(a.b)(Object(V.a)(Object(V.a)({},Object(a.f)(re,Me)),{},{data:Te.data,active:!0}));switch(se.which){case n.a.LEFT:{Be&&le.includes(re)?he.onNodeExpand({},pe):Te.parent&&he.onActiveChange(Te.parent.data.key),se.preventDefault();break}case n.a.RIGHT:{Be&&!le.includes(re)?he.onNodeExpand({},pe):Te.children&&Te.children.length&&he.onActiveChange(Te.children[0].data.key),se.preventDefault();break}case n.a.ENTER:case n.a.SPACE:{ge&&!pe.disabled&&pe.checkable!==!1&&!pe.disableCheckbox?he.onNodeCheck({},pe,!Z.includes(re)):!ge&&Re&&!pe.disabled&&pe.selectable!==!1&&he.onNodeSelect({},pe);break}}}oe&&oe(se)},he.setUncontrolledState=function(se){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(he.destroyed)return;var le=!1,Z=!0,ae={};Object.keys(se).forEach(function(oe){if(oe in he.props){Z=!1;return}le=!0,ae[oe]=se[oe]}),le&&(!me||Z)&&he.setState(Object(V.a)(Object(V.a)({},ae),re))},he.scrollTo=function(se){he.listRef.current.scrollTo(se)},he}return Object(j.a)(Se,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var se,me=this.state,re=me.focused,le=me.flattenNodes,Z=me.keyEntities,ae=me.dragging,oe=me.activeKey,ge=this.props,Re=ge.prefixCls,Te=ge.className,Me=ge.style,Be=ge.showLine,pe=ge.focusable,Ce=ge.tabIndex,ke=Ce===void 0?0:Ce,Le=ge.selectable,Ge=ge.showIcon,Ve=ge.icon,tt=ge.switcherIcon,rt=ge.draggable,ut=ge.checkable,lt=ge.checkStrictly,Ne=ge.disabled,Pe=ge.motion,ze=ge.loadData,Xe=ge.filterTreeNode,je=ge.height,Fe=ge.itemHeight,_e=ge.virtual,ye=ge.titleRender,ve=ge.onContextMenu,ue=Object(l.f)(this.props);return W.createElement(p.a.Provider,{value:{prefixCls:Re,selectable:Le,showIcon:Ge,icon:Ve,switcherIcon:tt,draggable:rt,checkable:ut,checkStrictly:lt,disabled:Ne,keyEntities:Z,loadData:ze,filterTreeNode:Xe,titleRender:ye,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},W.createElement("div",{className:g()(Re,Te,(se={},Object(ee.a)(se,"".concat(Re,"-show-line"),Be),Object(ee.a)(se,"".concat(Re,"-focused"),re),Object(ee.a)(se,"".concat(Re,"-active-focused"),oe!==null),se))},W.createElement(I,Object.assign({ref:this.listRef,prefixCls:Re,style:Me,data:le,disabled:Ne,selectable:Le,checkable:!!ut,motion:Pe,dragging:ae,height:je,itemHeight:Fe,virtual:_e,focusable:pe,focused:re,tabIndex:ke,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ve},this.getTreeNodeRequiredProps(),ue))))}}],[{key:"getDerivedStateFromProps",value:function(se,me){var re=me.prevProps,le={prevProps:se};function Z(Ve){return!re&&Ve in se||re&&re[Ve]!==se[Ve]}var ae;if(Z("treeData")?ae=se.treeData:Z("children")&&(Object(D.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),ae=Object(a.c)(se.children)),ae){le.treeData=ae;var oe=Object(a.a)(ae);le.keyEntities=Object(V.a)(Object(ee.a)({},v,E),oe.keyEntities)}var ge=le.keyEntities||me.keyEntities;if(Z("expandedKeys")||re&&Z("autoExpandParent"))le.expandedKeys=se.autoExpandParent||!re&&se.defaultExpandParent?Object(l.e)(se.expandedKeys,ge):se.expandedKeys;else if(!re&&se.defaultExpandAll){var Re=Object(V.a)({},ge);delete Re[v],le.expandedKeys=Object.keys(Re).map(function(Ve){return Re[Ve].key})}else!re&&se.defaultExpandedKeys&&(le.expandedKeys=se.autoExpandParent||se.defaultExpandParent?Object(l.e)(se.defaultExpandedKeys,ge):se.defaultExpandedKeys);if(le.expandedKeys||delete le.expandedKeys,ae||le.expandedKeys){var Te=Object(a.d)(ae||me.treeData,le.expandedKeys||me.expandedKeys);le.flattenNodes=Te}if(se.selectable&&(Z("selectedKeys")?le.selectedKeys=Object(l.d)(se.selectedKeys,se):!re&&se.defaultSelectedKeys&&(le.selectedKeys=Object(l.d)(se.defaultSelectedKeys,se))),se.checkable){var Me;if(Z("checkedKeys")?Me=Object(l.j)(se.checkedKeys)||{}:!re&&se.defaultCheckedKeys?Me=Object(l.j)(se.defaultCheckedKeys)||{}:ae&&(Me=Object(l.j)(se.checkedKeys)||{checkedKeys:me.checkedKeys,halfCheckedKeys:me.halfCheckedKeys}),Me){var Be=Me,pe=Be.checkedKeys,Ce=pe===void 0?[]:pe,ke=Be.halfCheckedKeys,Le=ke===void 0?[]:ke;if(!se.checkStrictly){var Ge=Object(b.a)(Ce,!0,ge);Ce=Ge.checkedKeys,Le=Ge.halfCheckedKeys}le.checkedKeys=Ce,le.halfCheckedKeys=Le}}return Z("loadedKeys")&&(le.loadedKeys=se.loadedKeys),le}}]),Se}(W.Component);K.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},K.TreeNode=o.a;var Q=K,ne=Ee.b=Q},fjLI:function(at,Ee,H){"use strict";H.d(Ee,"f",function(){return p}),H.d(Ee,"b",function(){return l}),H.d(Ee,"a",function(){return a}),H.d(Ee,"d",function(){return f}),H.d(Ee,"e",function(){return u}),H.d(Ee,"c",function(){return d});var ee=H("8HAY"),V=H("Vhoy"),N=H("MI8n"),$=H("JYp7"),j=H("pmY6"),P=H("24hK"),G=H("nnTU"),W=H("T8No"),n=H("Cg/j"),D=H("t9D7"),y=function(i,o,O,w){var C=arguments.length,L=C<3?o:w===null?w=Object.getOwnPropertyDescriptor(o,O):w,A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(i,o,O,w);else for(var _=i.length-1;_>=0;_--)(A=i[_])&&(L=(C<3?A(L):C>3?A(o,O,L):A(o,O))||L);return C>3&&L&&Object.defineProperty(o,O,L),L},g=function(i,o){return function(O,w){o(O,w,i)}};function p(i){return i.command!==void 0}class l{constructor(i){this.id=l._idPool++,this._debugName=i}}l._idPool=0,l.CommandPalette=new l("CommandPalette"),l.EditorContext=new l("EditorContext"),l.SimpleEditorContext=new l("SimpleEditorContext"),l.EditorContextCopy=new l("EditorContextCopy"),l.EditorContextPeek=new l("EditorContextPeek"),l.MenubarEditMenu=new l("MenubarEditMenu"),l.MenubarCopy=new l("MenubarCopy"),l.MenubarGoMenu=new l("MenubarGoMenu"),l.MenubarSelectionMenu=new l("MenubarSelectionMenu"),l.InlineCompletionsActions=new l("InlineCompletionsActions");const a=Object(n.c)("menuService"),f=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new N.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:i=>i===l.CommandPalette}}addCommand(i){return this.addCommands($.a.single(i))}addCommands(i){for(const o of i)this._commands.set(o.id,o);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(j.i)(()=>{let o=!1;for(const O of i)o=this._commands.delete(O.id)||o;o&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((o,O)=>i.set(O,o)),i}appendMenuItem(i,o){return this.appendMenuItems($.a.single({id:i,item:o}))}appendMenuItems(i){const o=new Set,O=new P.a;for(const{id:w,item:C}of i){let L=this._menuItems.get(w);L||(L=new P.a,this._menuItems.set(w,L)),O.push(L.push(C)),o.add(w)}return this._onDidChangeMenu.fire(o),Object(j.i)(()=>{if(O.size>0){for(let w of O)w();this._onDidChangeMenu.fire(o),O.clear()}})}getMenuItems(i){let o;return this._menuItems.has(i)?o=[...this._menuItems.get(i)]:o=[],i===l.CommandPalette&&this._appendImplicitItems(o),o}_appendImplicitItems(i){const o=new Set;for(const O of i)p(O)&&(o.add(O.command.id),O.alt&&o.add(O.alt.id));this._commands.forEach((O,w)=>{o.has(w)||i.push({command:O})})}};class u extends ee.e{constructor(i,o,O,w){super(`submenuitem.${i.submenu.id}`,typeof i.title=="string"?i.title:i.title.value,[],"submenu");this.item=i,this._menuService=o,this._contextKeyService=O,this._options=w}get actions(){const i=[],o=this._menuService.createMenu(this.item.submenu,this._contextKeyService),O=o.getActions(this._options);o.dispose();for(const[,w]of O)w.length>0&&(i.push(...w),i.push(new ee.d));return i.length&&i.pop(),i}}let d=class i{constructor(o,O,w,C,L){var A,_;if(this._commandService=L,this.id=o.id,this.label=(w==null?void 0:w.renderShortTitle)&&o.shortTitle?typeof o.shortTitle=="string"?o.shortTitle:o.shortTitle.value:typeof o.title=="string"?o.title:o.title.value,this.tooltip=(_=typeof o.tooltip=="string"?o.tooltip:(A=o.tooltip)===null||A===void 0?void 0:A.value)!==null&&_!==void 0?_:"",this.enabled=!o.precondition||C.contextMatchesRules(o.precondition),this.checked=void 0,o.toggled){const T=o.toggled.condition?o.toggled:{condition:o.toggled};this.checked=C.contextMatchesRules(T.condition),this.checked&&T.tooltip&&(this.tooltip=typeof T.tooltip=="string"?T.tooltip:T.tooltip.value),T.title&&(this.label=typeof T.title=="string"?T.title:T.title.value)}this.item=o,this.alt=O?new i(O,void 0,w,C,L):void 0,this._options=w,D.d.isThemeIcon(o.icon)&&(this.class=V.a.asClassName(o.icon))}dispose(){}run(...o){var O,w;let C=[];return((O=this._options)===null||O===void 0?void 0:O.arg)&&(C=[...C,this._options.arg]),((w=this._options)===null||w===void 0?void 0:w.shouldForwardArgs)&&(C=[...C,...o]),this._commandService.executeCommand(this.id,...C)}};d=y([g(3,W.b),g(4,G.b)],d)},fyJ8:function(at,Ee,H){"use strict";var ee=H("rePB"),V=H("VTBJ"),N=H("Ff2n"),$=H("U8pU"),j=H("q1tI"),P=H.n(j),G=H("TSYQ"),W=H.n(G),n=H("c+Xe"),D=H("sR1s");function y(f){return f&&Object($.a)(f)==="object"&&!Array.isArray(f)&&!j.isValidElement(f)}function g(f){return typeof f=="string"?!0:Object(n.c)(f)}function p(f,u){var d,i=f.prefixCls,o=f.className,O=f.record,w=f.index,C=f.dataIndex,L=f.render,A=f.children,_=f.component,T=_===void 0?"td":_,v=f.colSpan,c=f.rowSpan,E=f.fixLeft,h=f.fixRight,x=f.firstFixLeft,U=f.lastFixLeft,F=f.firstFixRight,S=f.lastFixRight,M=f.appendNode,I=f.additionalProps,b=I===void 0?{}:I,K=f.ellipsis,Q=f.align,ne=f.rowType,fe=f.isSticky,we="".concat(i,"-cell"),Se,he;if(A)he=A;else{var se=Object(D.b)(O,C);if(he=se,L){var me=L(se,O,w);y(me)?(he=me.children,Se=me.props):he=me}}Object($.a)(he)==="object"&&!Array.isArray(he)&&!j.isValidElement(he)&&(he=null),K&&(U||F)&&(he=j.createElement("span",{className:"".concat(we,"-content")},he));var re=Se||{},le=re.colSpan,Z=re.rowSpan,ae=re.style,oe=re.className,ge=Object(N.a)(re,["colSpan","rowSpan","style","className"]),Re=le!==void 0?le:v,Te=Z!==void 0?Z:c;if(Re===0||Te===0)return null;var Me={},Be=typeof E=="number",pe=typeof h=="number";Be&&(Me.position="sticky",Me.left=E),pe&&(Me.position="sticky",Me.right=h);var Ce={};Q&&(Ce.textAlign=Q);var ke,Le=K===!0?{showTitle:!0}:K;Le&&(Le.showTitle||ne==="header")&&(typeof he=="string"||typeof he=="number"?ke=he.toString():j.isValidElement(he)&&typeof he.props.children=="string"&&(ke=he.props.children));var Ge=Object(V.a)(Object(V.a)(Object(V.a)({title:ke},ge),b),{},{colSpan:Re&&Re!==1?Re:null,rowSpan:Te&&Te!==1?Te:null,className:W()(we,o,(d={},Object(ee.a)(d,"".concat(we,"-fix-left"),Be),Object(ee.a)(d,"".concat(we,"-fix-left-first"),x),Object(ee.a)(d,"".concat(we,"-fix-left-last"),U),Object(ee.a)(d,"".concat(we,"-fix-right"),pe),Object(ee.a)(d,"".concat(we,"-fix-right-first"),F),Object(ee.a)(d,"".concat(we,"-fix-right-last"),S),Object(ee.a)(d,"".concat(we,"-ellipsis"),K),Object(ee.a)(d,"".concat(we,"-with-append"),M),Object(ee.a)(d,"".concat(we,"-fix-sticky"),(Be||pe)&&fe),d),b.className,oe),style:Object(V.a)(Object(V.a)(Object(V.a)(Object(V.a)({},b.style),Ce),Me),ae),ref:g(T)?u:null});return j.createElement(T,Object.assign({},Ge),M,he)}var l=j.forwardRef(p);l.displayName="Cell";var a=j.memo(l,function(f,u){return u.shouldCellUpdate?!u.shouldCellUpdate(u.record,f.record):!1});Ee.a=a},h78n:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return x});var ee=H("q1tI"),V=H.n(ee),N=H("TSYQ"),$=H.n(N),j={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},P=function(S){var M=S.map(function(){return Object(ee.useRef)()}),I=Object(ee.useRef)();return Object(ee.useEffect)(function(){var b=Date.now(),K=!1;Object.keys(M).forEach(function(Q){var ne=M[Q].current;if(!ne)return;K=!0;var fe=ne.style;fe.transitionDuration=".3s, .3s, .3s, .06s",I.current&&b-I.current<100&&(fe.transitionDuration="0s, 0s")}),K&&(I.current=Date.now())}),[M]};function G(){return G=Object.assign||function(F){for(var S=1;S<arguments.length;S++){var M=arguments[S];for(var I in M)Object.prototype.hasOwnProperty.call(M,I)&&(F[I]=M[I])}return F},G.apply(this,arguments)}function W(F,S){return p(F)||g(F,S)||D(F,S)||n()}function n(){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 D(F,S){if(!F)return;if(typeof F=="string")return y(F,S);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 y(F,S)}function y(F,S){(S==null||S>F.length)&&(S=F.length);for(var M=0,I=new Array(S);M<S;M++)I[M]=F[M];return I}function g(F,S){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var M=[],I=!0,b=!1,K=void 0;try{for(var Q=F[Symbol.iterator](),ne;!(I=(ne=Q.next()).done)&&!(M.push(ne.value),S&&M.length===S);I=!0);}catch(fe){b=!0,K=fe}finally{try{!I&&Q.return!=null&&Q.return()}finally{if(b)throw K}}return M}function p(F){if(Array.isArray(F))return F}function l(F,S){if(F==null)return{};var M=a(F,S),I,b;if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(F);for(b=0;b<K.length;b++){if(I=K[b],S.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;M[I]=F[I]}}return M}function a(F,S){if(F==null)return{};var M={},I=Object.keys(F),b,K;for(K=0;K<I.length;K++){if(b=I[K],S.indexOf(b)>=0)continue;M[b]=F[b]}return M}var f=function(S){var M=S.className,I=S.percent,b=S.prefixCls,K=S.strokeColor,Q=S.strokeLinecap,ne=S.strokeWidth,fe=S.style,we=S.trailColor,Se=S.trailWidth,he=S.transition,se=l(S,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete se.gapPosition;var me=Array.isArray(I)?I:[I],re=Array.isArray(K)?K:[K],le=P(me),Z=W(le,1),ae=Z[0],oe=ne/2,ge=100-ne/2,Re="M ".concat(Q==="round"?oe:0,",").concat(oe,`
L `).concat(Q==="round"?ge:100,",").concat(oe),Te="0 0 100 ".concat(ne),Me=0;return V.a.createElement("svg",G({className:$()("".concat(b,"-line"),M),viewBox:Te,preserveAspectRatio:"none",style:fe},se),V.a.createElement("path",{className:"".concat(b,"-line-trail"),d:Re,strokeLinecap:Q,stroke:we,strokeWidth:Se||ne,fillOpacity:"0"}),me.map(function(Be,pe){var Ce={strokeDasharray:"".concat(Be,"px, 100px"),strokeDashoffset:"-".concat(Me,"px"),transition:he||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},ke=re[pe]||re[re.length-1];return Me+=Be,V.a.createElement("path",{key:pe,className:"".concat(b,"-line-path"),d:Re,strokeLinecap:Q,stroke:ke,strokeWidth:ne,fillOpacity:"0",ref:ae[pe],style:Ce})}))};f.defaultProps=j;var u=f;function d(){return d=Object.assign||function(F){for(var S=1;S<arguments.length;S++){var M=arguments[S];for(var I in M)Object.prototype.hasOwnProperty.call(M,I)&&(F[I]=M[I])}return F},d.apply(this,arguments)}function i(F,S){return L(F)||C(F,S)||O(F,S)||o()}function o(){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 O(F,S){if(!F)return;if(typeof F=="string")return w(F,S);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 w(F,S)}function w(F,S){(S==null||S>F.length)&&(S=F.length);for(var M=0,I=new Array(S);M<S;M++)I[M]=F[M];return I}function C(F,S){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var M=[],I=!0,b=!1,K=void 0;try{for(var Q=F[Symbol.iterator](),ne;!(I=(ne=Q.next()).done)&&!(M.push(ne.value),S&&M.length===S);I=!0);}catch(fe){b=!0,K=fe}finally{try{!I&&Q.return!=null&&Q.return()}finally{if(b)throw K}}return M}function L(F){if(Array.isArray(F))return F}function A(F,S){if(F==null)return{};var M=_(F,S),I,b;if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(F);for(b=0;b<K.length;b++){if(I=K[b],S.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;M[I]=F[I]}}return M}function _(F,S){if(F==null)return{};var M={},I=Object.keys(F),b,K;for(K=0;K<I.length;K++){if(b=I[K],S.indexOf(b)>=0)continue;M[b]=F[b]}return M}var T=0;function v(F){return+F.replace("%","")}function c(F){return Array.isArray(F)?F:[F]}function E(F,S,M,I){var b=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,K=arguments.length>5?arguments[5]:void 0,Q=50-I/2,ne=0,fe=-Q,we=0,Se=-2*Q;switch(K){case"left":ne=-Q,fe=0,we=2*Q,Se=0;break;case"right":ne=Q,fe=0,we=-2*Q,Se=0;break;case"bottom":fe=Q,Se=2*Q;break;default:}var he="M 50,50 m ".concat(ne,",").concat(fe,`
a `).concat(Q,",").concat(Q," 0 1 1 ").concat(we,",").concat(-Se,`
a `).concat(Q,",").concat(Q," 0 1 1 ").concat(-we,",").concat(Se),se=Math.PI*2*Q,me={stroke:M,strokeDasharray:"".concat(S/100*(se-b),"px ").concat(se,"px"),strokeDashoffset:"-".concat(b/2+F/100*(se-b),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:he,pathStyle:me}}var h=function(S){var M=S.prefixCls,I=S.strokeWidth,b=S.trailWidth,K=S.gapDegree,Q=S.gapPosition,ne=S.trailColor,fe=S.strokeLinecap,we=S.style,Se=S.className,he=S.strokeColor,se=S.percent,me=A(S,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),re=Object(ee.useMemo)(function(){return T+=1,T},[]),le=E(0,100,ne,I,K,Q),Z=le.pathString,ae=le.pathStyle,oe=c(se),ge=c(he),Re=ge.find(function(Ce){return Object.prototype.toString.call(Ce)==="[object Object]"}),Te=P(oe),Me=i(Te,1),Be=Me[0],pe=function(){var ke=0;return oe.map(function(Le,Ge){var Ve=ge[Ge]||ge[ge.length-1],tt=Object.prototype.toString.call(Ve)==="[object Object]"?"url(#".concat(M,"-gradient-").concat(re,")"):"",rt=E(ke,Le,Ve,I,K,Q);return ke+=Le,V.a.createElement("path",{key:Ge,className:"".concat(M,"-circle-path"),d:rt.pathString,stroke:tt,strokeLinecap:fe,strokeWidth:I,opacity:Le===0?0:1,fillOpacity:"0",style:rt.pathStyle,ref:Be[Ge]})})};return V.a.createElement("svg",d({className:$()("".concat(M,"-circle"),Se),viewBox:"0 0 100 100",style:we},me),Re&&V.a.createElement("defs",null,V.a.createElement("linearGradient",{id:"".concat(M,"-gradient-").concat(re),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Re).sort(function(Ce,ke){return v(Ce)-v(ke)}).map(function(Ce,ke){return V.a.createElement("stop",{key:ke,offset:Ce,stopColor:Re[Ce]})}))),V.a.createElement("path",{className:"".concat(M,"-circle-trail"),d:Z,stroke:ne,strokeLinecap:fe,strokeWidth:b||I,fillOpacity:"0",style:ae}),pe().reverse())};h.defaultProps=j;var x=h,U={Line:u,Circle:x}},hW8S:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return $}),H.d(Ee,"c",function(){return j}),H.d(Ee,"b",function(){return P});var ee=H("VTBJ"),V=H("Ff2n"),N=H("Kwbf"),$="RC_TABLE_INTERNAL_COL_DEFINE";function j(G){var W=G.expandable,n=Object(V.a)(G,["expandable"]);return"expandable"in G?Object(ee.a)(Object(ee.a)({},n),W):n}function P(G){return Object.keys(G).reduce(function(W,n){return(n.substr(0,5)==="data-"||n.substr(0,5)==="aria-")&&(W[n]=G[n]),W},{})}},i58Z:function(at,Ee,H){at.exports={wrap:"wrap___Yg2Z9",addKnowledge:"addKnowledge___2FlI0",disabled:"disabled___1_wxN"}},ic2d:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return $});var ee=H("FWmy"),V=H("746U");class N{constructor(){this.data=new Map}add(j,P){ee.a(V.l(j)),ee.a(V.k(P)),ee.a(!this.data.has(j),"There is already an extension with this id"),this.data.set(j,P)}as(j){return this.data.get(j)||null}}const $=new N},kSUc:function(at,Ee,H){},kqOp:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return D});var ee=H("0Owb"),V=H("fWQN"),N=H("mtLc"),$=H("yKVA"),j=H("879j"),P=H("q1tI"),G=H.n(P),W=H("Ot1p"),n="\u2581",D=function(y){Object($.a)(p,y);var g=Object(j.a)(p);function p(){var l;Object(V.a)(this,p);for(var a=arguments.length,f=new Array(a),u=0;u<a;u++)f[u]=arguments[u];return l=g.call.apply(g,[this].concat(f)),l.getChCountBeforeCursor=function(d,i){for(var o=i.line,O=0,w=0;w<o;w++)O+=d.getLine(w).split(n).length-1;var C=d.getLine(o).substring(0,i.ch);return O+=C.split(n).length-1,O},l.onCMBeforeChange=function(d,i){var o=d.getRange(i.from,i.to),O=0;if(i.text.forEach(function(A){O+=A.split(n).length-1}),o&&o.indexOf(n)!=-1){var w=o.split(n).length-1,C=l.getChCountBeforeCursor(d,i.from);console.log("\u5220\u9664".concat(w,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(C,"\u4E2A\uFF0C\u65B0\u589E").concat(O,"\u4E2A")),l.props.deleteEmptyDisabled?i.cancel():l.props.onPlaceholderChange&&l.props.onPlaceholderChange(C,w,O)}else if(O){var L=l.getChCountBeforeCursor(d,i.from);console.log("\u65B0\u589E".concat(O,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(L,"\u4E2A")),l.props.onPlaceholderChange&&l.props.onPlaceholderChange(L,0,O)}},l}return Object(N.a)(p,[{key:"render",value:function(){return G.a.createElement(W.a,Object(ee.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),p}(P.Component)},lZu9:function(at,Ee,H){(function(ee){ee(H("VrN/"),H("1eCo"),H("8EBN"))})(function(ee){"use strict";ee.defineMode("markdown",function(V,N){var $=ee.getMode(V,"text/html"),j=$.name=="null";function P(I){if(ee.findModeByName){var b=ee.findModeByName(I);b&&(I=b.mime||b.mimes[0])}var K=ee.getMode(V,I);return K.name=="null"?null:K}N.highlightFormatting===void 0&&(N.highlightFormatting=!1),N.maxBlockquoteDepth===void 0&&(N.maxBlockquoteDepth=0),N.taskLists===void 0&&(N.taskLists=!1),N.strikethrough===void 0&&(N.strikethrough=!1),N.emoji===void 0&&(N.emoji=!1),N.fencedCodeBlockHighlighting===void 0&&(N.fencedCodeBlockHighlighting=!0),N.fencedCodeBlockDefaultMode===void 0&&(N.fencedCodeBlockDefaultMode="text/plain"),N.xml===void 0&&(N.xml=!0),N.tokenTypeOverrides===void 0&&(N.tokenTypeOverrides={});var G={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var W in G)G.hasOwnProperty(W)&&N.tokenTypeOverrides[W]&&(G[W]=N.tokenTypeOverrides[W]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,g=N.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,l=/^[^#!\[\]*_\\<>` "'(~:]+/,a=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,u=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,d=" ";function i(I,b,K){return b.f=b.inline=K,K(I,b)}function o(I,b,K){return b.f=b.block=K,K(I,b)}function O(I){return!I||!/\S/.test(I.string)}function w(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==L){var b=j;if(!b){var K=ee.innerMode($,I.htmlState);b=K.mode.name=="xml"&&K.state.tagStart===null&&!K.state.context&&K.state.tokenize.isInText}b&&(I.f=v,I.block=C,I.htmlState=null)}return I.trailingSpace=0,I.trailingSpaceNewLine=!1,I.prevLine=I.thisLine,I.thisLine={stream:null},null}function C(I,b){var K=I.column()===b.indentation,Q=O(b.prevLine.stream),ne=b.indentedCode,fe=b.prevLine.hr,we=b.list!==!1,Se=(b.listStack[b.listStack.length-1]||0)+3;b.indentedCode=!1;var he=b.indentation;if(b.indentationDiff===null&&(b.indentationDiff=b.indentation,we)){for(b.list=null;he<b.listStack[b.listStack.length-1];)b.listStack.pop(),b.listStack.length?b.indentation=b.listStack[b.listStack.length-1]:b.list=!1;b.list!==!1&&(b.indentationDiff=he-b.listStack[b.listStack.length-1])}var se=!Q&&!fe&&!b.prevLine.header&&(!we||!ne)&&!b.prevLine.fencedCodeEnd,me=(b.list===!1||fe||Q)&&b.indentation<=Se&&I.match(n),re=null;if(b.indentationDiff>=4&&(ne||b.prevLine.fencedCodeEnd||b.prevLine.header||Q))return I.skipToEnd(),b.indentedCode=!0,G.code;if(I.eatSpace())return null;if(K&&b.indentation<=Se&&(re=I.match(g))&&re[1].length<=6)return b.quote=0,b.header=re[1].length,b.thisLine.header=!0,N.highlightFormatting&&(b.formatting="header"),b.f=b.inline,_(b);if(b.indentation<=Se&&I.eat(">"))return b.quote=K?1:b.quote+1,N.highlightFormatting&&(b.formatting="quote"),I.eatSpace(),_(b);if(!me&&!b.setext&&K&&b.indentation<=Se&&(re=I.match(D))){var le=re[1]?"ol":"ul";return b.indentation=he+I.current().length,b.list=!0,b.quote=0,b.listStack.push(b.indentation),b.em=!1,b.strong=!1,b.code=!1,b.strikethrough=!1,N.taskLists&&I.match(y,!1)&&(b.taskList=!0),b.f=b.inline,N.highlightFormatting&&(b.formatting=["list","list-"+le]),_(b)}else{if(K&&b.indentation<=Se&&(re=I.match(a,!0)))return b.quote=0,b.fencedEndRE=new RegExp(re[1]+"+ *$"),b.localMode=N.fencedCodeBlockHighlighting&&P(re[2]||N.fencedCodeBlockDefaultMode),b.localMode&&(b.localState=ee.startState(b.localMode)),b.f=b.block=A,N.highlightFormatting&&(b.formatting="code-block"),b.code=-1,_(b);if(b.setext||(!se||!we)&&!b.quote&&b.list===!1&&!b.code&&!me&&!f.test(I.string)&&(re=I.lookAhead(1))&&(re=re.match(p)))return b.setext?(b.header=b.setext,b.setext=0,I.skipToEnd(),N.highlightFormatting&&(b.formatting="header")):(b.header=re[0].charAt(0)=="="?1:2,b.setext=b.header),b.thisLine.header=!0,b.f=b.inline,_(b);if(me)return I.skipToEnd(),b.hr=!0,b.thisLine.hr=!0,G.hr;if(I.peek()==="[")return i(I,b,U)}return i(I,b,b.inline)}function L(I,b){var K=$.token(I,b.htmlState);if(!j){var Q=ee.innerMode($,b.htmlState);(Q.mode.name=="xml"&&Q.state.tagStart===null&&!Q.state.context&&Q.state.tokenize.isInText||b.md_inside&&I.current().indexOf(">")>-1)&&(b.f=v,b.block=C,b.htmlState=null)}return K}function A(I,b){var K=b.listStack[b.listStack.length-1]||0,Q=b.indentation<K,ne=K+3;if(b.fencedEndRE&&b.indentation<=ne&&(Q||I.match(b.fencedEndRE))){N.highlightFormatting&&(b.formatting="code-block");var fe;return Q||(fe=_(b)),b.localMode=b.localState=null,b.block=C,b.f=v,b.fencedEndRE=null,b.code=0,b.thisLine.fencedCodeEnd=!0,Q?o(I,b,b.block):fe}else return b.localMode?b.localMode.token(I,b.localState):(I.skipToEnd(),G.code)}function _(I){var b=[];if(I.formatting){b.push(G.formatting),typeof I.formatting=="string"&&(I.formatting=[I.formatting]);for(var K=0;K<I.formatting.length;K++)b.push(G.formatting+"-"+I.formatting[K]),I.formatting[K]==="header"&&b.push(G.formatting+"-"+I.formatting[K]+"-"+I.header),I.formatting[K]==="quote"&&(!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=I.quote?b.push(G.formatting+"-"+I.formatting[K]+"-"+I.quote):b.push("error"))}if(I.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(I.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(I.linkHref?b.push(G.linkHref,"url"):(I.strong&&b.push(G.strong),I.em&&b.push(G.em),I.strikethrough&&b.push(G.strikethrough),I.emoji&&b.push(G.emoji),I.linkText&&b.push(G.linkText),I.code&&b.push(G.code),I.image&&b.push(G.image),I.imageAltText&&b.push(G.imageAltText,"link"),I.imageMarker&&b.push(G.imageMarker)),I.header&&b.push(G.header,G.header+"-"+I.header),I.quote&&(b.push(G.quote),!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=I.quote?b.push(G.quote+"-"+I.quote):b.push(G.quote+"-"+N.maxBlockquoteDepth)),I.list!==!1){var Q=(I.listStack.length-1)%3;Q?Q===1?b.push(G.list2):b.push(G.list3):b.push(G.list1)}return I.trailingSpaceNewLine?b.push("trailing-space-new-line"):I.trailingSpace&&b.push("trailing-space-"+(I.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function T(I,b){return I.match(l,!0)?_(b):void 0}function v(I,b){var K=b.text(I,b);if(typeof K!="undefined")return K;if(b.list)return b.list=null,_(b);if(b.taskList){var Q=I.match(y,!0)[1]===" ";return Q?b.taskOpen=!0:b.taskClosed=!0,N.highlightFormatting&&(b.formatting="task"),b.taskList=!1,_(b)}if(b.taskOpen=!1,b.taskClosed=!1,b.header&&I.match(/^#+$/,!0))return N.highlightFormatting&&(b.formatting="header"),_(b);var ne=I.next();if(b.linkTitle){b.linkTitle=!1;var fe=ne;ne==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var we="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(I.match(new RegExp(we),!0))return G.linkHref}if(ne==="`"){var Se=b.formatting;N.highlightFormatting&&(b.formatting="code"),I.eatWhile("`");var he=I.current().length;if(b.code==0&&(!b.quote||he==1))return b.code=he,_(b);if(he==b.code){var se=_(b);return b.code=0,se}else return b.formatting=Se,_(b)}else if(b.code)return _(b);if(ne==="\\"&&(I.next(),N.highlightFormatting)){var me=_(b),re=G.formatting+"-escape";return me?me+" "+re:re}if(ne==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.imageMarker=!0,b.image=!0,N.highlightFormatting&&(b.formatting="image"),_(b);if(ne==="["&&b.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return b.imageMarker=!1,b.imageAltText=!0,N.highlightFormatting&&(b.formatting="image"),_(b);if(ne==="]"&&b.imageAltText){N.highlightFormatting&&(b.formatting="image");var me=_(b);return b.imageAltText=!1,b.image=!1,b.inline=b.f=E,me}if(ne==="["&&!b.image)return b.linkText&&I.match(/^.*?\]/)||(b.linkText=!0,N.highlightFormatting&&(b.formatting="link")),_(b);if(ne==="]"&&b.linkText){N.highlightFormatting&&(b.formatting="link");var me=_(b);return b.linkText=!1,b.inline=b.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?E:v,me}if(ne==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=c,N.highlightFormatting&&(b.formatting="link");var me=_(b);return me?me+=" ":me="",me+G.linkInline}if(ne==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=c,N.highlightFormatting&&(b.formatting="link");var me=_(b);return me?me+=" ":me="",me+G.linkEmail}if(N.xml&&ne==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var le=I.string.indexOf(">",I.pos);if(le!=-1){var Z=I.string.substring(I.start,le);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Z)&&(b.md_inside=!0)}return I.backUp(1),b.htmlState=ee.startState($),o(I,b,L)}if(N.xml&&ne==="<"&&I.match(/^\/\w*?>/))return b.md_inside=!1,"tag";if(ne==="*"||ne==="_"){for(var ae=1,oe=I.pos==1?" ":I.string.charAt(I.pos-2);ae<3&&I.eat(ne);)ae++;var ge=I.peek()||" ",Re=!/\s/.test(ge)&&(!u.test(ge)||/\s/.test(oe)||u.test(oe)),Te=!/\s/.test(oe)&&(!u.test(oe)||/\s/.test(ge)||u.test(ge)),Me=null,Be=null;if(ae%2&&(!b.em&&Re&&(ne==="*"||!Te||u.test(oe))?Me=!0:b.em==ne&&Te&&(ne==="*"||!Re||u.test(ge))&&(Me=!1)),ae>1&&(!b.strong&&Re&&(ne==="*"||!Te||u.test(oe))?Be=!0:b.strong==ne&&Te&&(ne==="*"||!Re||u.test(ge))&&(Be=!1)),Be!=null||Me!=null){N.highlightFormatting&&(b.formatting=Me==null?"strong":Be==null?"em":"strong em"),Me===!0&&(b.em=ne),Be===!0&&(b.strong=ne);var se=_(b);return Me===!1&&(b.em=!1),Be===!1&&(b.strong=!1),se}}else if(ne===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return _(b);I.backUp(1)}if(N.strikethrough){if(ne==="~"&&I.eatWhile(ne)){if(b.strikethrough){N.highlightFormatting&&(b.formatting="strikethrough");var se=_(b);return b.strikethrough=!1,se}else if(I.match(/^[^\s]/,!1))return b.strikethrough=!0,N.highlightFormatting&&(b.formatting="strikethrough"),_(b)}else if(ne===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return _(b);I.backUp(2)}}if(N.emoji&&ne===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){b.emoji=!0,N.highlightFormatting&&(b.formatting="emoji");var pe=_(b);return b.emoji=!1,pe}return ne===" "&&(I.match(/^ +$/,!1)?b.trailingSpace++:b.trailingSpace&&(b.trailingSpaceNewLine=!0)),_(b)}function c(I,b){var K=I.next();if(K===">"){b.f=b.inline=v,N.highlightFormatting&&(b.formatting="link");var Q=_(b);return Q?Q+=" ":Q="",Q+G.linkInline}return I.match(/^[^>]+/,!0),G.linkInline}function E(I,b){if(I.eatSpace())return null;var K=I.next();return K==="("||K==="["?(b.f=b.inline=x(K==="("?")":"]"),N.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,_(b)):"error"}var h={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function x(I){return function(b,K){var Q=b.next();if(Q===I){K.f=K.inline=v,N.highlightFormatting&&(K.formatting="link-string");var ne=_(K);return K.linkHref=!1,ne}return b.match(h[I]),K.linkHref=!0,_(K)}}function U(I,b){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=F,I.next(),N.highlightFormatting&&(b.formatting="link"),b.linkText=!0,_(b)):i(I,b,v)}function F(I,b){if(I.match(/^\]:/,!0)){b.f=b.inline=S,N.highlightFormatting&&(b.formatting="link");var K=_(b);return b.linkText=!1,K}return I.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function S(I,b){return I.eatSpace()?null:(I.match(/^[^\s]+/,!0),I.peek()===void 0?b.linkTitle=!0:I.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),b.f=b.inline=v,G.linkHref+" url")}var M={startState:function(){return{f:C,prevLine:{stream:null},thisLine:{stream:null},block:C,htmlState:null,indentation:0,inline:v,text:T,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&&ee.copyState($,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?ee.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,b){if(b.formatting=!1,I!=b.thisLine.stream){if(b.header=0,b.hr=!1,I.match(/^\s*$/,!0))return w(b),null;if(b.prevLine=b.thisLine,b.thisLine={stream:I},b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,!b.localState&&(b.f=b.block,b.f!=L)){var K=I.match(/^\s*/,!0)[0].replace(/\t/g,d).length;if(b.indentation=K,b.indentationDiff=null,K>0)return null}}return b.f(I,b)},innerMode:function(I){return I.block==L?{state:I.htmlState,mode:$}:I.localState?{state:I.localState,mode:I.localMode}:{state:I,mode:M}},indent:function(I,b,K){return I.block==L&&$.indent?$.indent(I.htmlState,b,K):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,b,K):ee.Pass},blankLine:w,getType:_,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return M},"xml"),ee.defineMIME("text/markdown","markdown"),ee.defineMIME("text/x-markdown","markdown")})},n6Qo:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return W});var ee=H("q1tI"),V=H("biw7"),N=H("fyJ8");function $(n){var D=n.className,y=n.index,g=n.children,p=n.colSpan,l=n.rowSpan,a=ee.useContext(V.a),f=a.prefixCls,u=a.fixedInfoList,d=u[y];return ee.createElement(N.a,Object.assign({className:D,index:y,component:"td",prefixCls:f,record:null,dataIndex:null,render:function(){return{children:g,props:{colSpan:p,rowSpan:l}}}},d))}function j(n){return ee.createElement("tr",Object.assign({},n))}function P(n){var D=n.children,y=ee.useContext(V.a),g=y.prefixCls;return ee.createElement("tfoot",{className:"".concat(g,"-summary")},D)}var G=Ee.b=P,W={Cell:$,Row:j}},nEHx:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return ee});var ee;(function(V){V.DARK="dark",V.LIGHT="light",V.HIGH_CONTRAST="hc"})(ee||(ee={}))},nnTU:function(at,Ee,H){"use strict";H.d(Ee,"b",function(){return G}),H.d(Ee,"a",function(){return W});var ee=H("MI8n"),V=H("JYp7"),N=H("pmY6"),$=H("24hK"),j=H("746U"),P=H("Cg/j");const G=Object(P.c)("commandService"),W=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ee.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,D){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!D)throw new Error("invalid command");return this.registerCommand({id:n,handler:D})}if(n.description){const a=[];for(let u of n.description.args)a.push(u.constraint);const f=n.handler;n.handler=function(u,...d){return Object(j.o)(d,a),f(u,...d)}}const{id:y}=n;let g=this._commands.get(y);g||(g=new $.a,this._commands.set(y,g));let p=g.unshift(n),l=Object(N.i)(()=>{p();const a=this._commands.get(y);(a==null?void 0:a.isEmpty())&&this._commands.delete(y)});return this._onDidRegisterCommand.fire(y),l}registerCommandAlias(n,D){return W.registerCommand(n,(y,...g)=>y.get(G).executeCommand(D,...g))}getCommand(n){const D=this._commands.get(n);return!D||D.isEmpty()?void 0:V.a.first(D)}getCommands(){const n=new Map;for(const D of this._commands.keys()){const y=this.getCommand(D);y&&n.set(D,y)}return n}};W.registerCommand("noop",()=>{})},osHv:function(at,Ee,H){(function(ee){ee(H("VrN/"))})(function(ee){"use strict";var V=ee.Pos;function N(u,d){return u.line-d.line||u.ch-d.ch}var $="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=$+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",P=new RegExp("<(/?)(["+$+"]["+j+"]*)","g");function G(u,d,i,o){this.line=d,this.ch=i,this.cm=u,this.text=u.getLine(d),this.min=o?Math.max(o.from,u.firstLine()):u.firstLine(),this.max=o?Math.min(o.to-1,u.lastLine()):u.lastLine()}function W(u,d){var i=u.cm.getTokenTypeAt(V(u.line,d));return i&&/\btag\b/.test(i)}function n(u){return u.line>=u.max?void 0:(u.ch=0,u.text=u.cm.getLine(++u.line),!0)}function D(u){return u.line<=u.min?void 0:(u.text=u.cm.getLine(--u.line),u.ch=u.text.length,!0)}function y(u){for(;;){var d=u.text.indexOf(">",u.ch);if(d==-1){if(n(u))continue;return}if(!W(u,d+1)){u.ch=d+1;continue}var i=u.text.lastIndexOf("/",d),o=i>-1&&!/\S/.test(u.text.slice(i+1,d));return u.ch=d+1,o?"selfClose":"regular"}}function g(u){for(;;){var d=u.ch?u.text.lastIndexOf("<",u.ch-1):-1;if(d==-1){if(D(u))continue;return}if(!W(u,d+1)){u.ch=d;continue}P.lastIndex=d,u.ch=d;var i=P.exec(u.text);if(i&&i.index==d)return i}}function p(u){for(;;){P.lastIndex=u.ch;var d=P.exec(u.text);if(!d){if(n(u))continue;return}if(!W(u,d.index+1)){u.ch=d.index+1;continue}return u.ch=d.index+d[0].length,d}}function l(u){for(;;){var d=u.ch?u.text.lastIndexOf(">",u.ch-1):-1;if(d==-1){if(D(u))continue;return}if(!W(u,d+1)){u.ch=d;continue}var i=u.text.lastIndexOf("/",d),o=i>-1&&!/\S/.test(u.text.slice(i+1,d));return u.ch=d+1,o?"selfClose":"regular"}}function a(u,d){for(var i=[];;){var o=p(u),O,w=u.line,C=u.ch-(o?o[0].length:0);if(!o||!(O=y(u)))return;if(O=="selfClose")continue;if(o[1]){for(var L=i.length-1;L>=0;--L)if(i[L]==o[2]){i.length=L;break}if(L<0&&(!d||d==o[2]))return{tag:o[2],from:V(w,C),to:V(u.line,u.ch)}}else i.push(o[2])}}function f(u,d){for(var i=[];;){var o=l(u);if(!o)return;if(o=="selfClose"){g(u);continue}var O=u.line,w=u.ch,C=g(u);if(!C)return;if(C[1])i.push(C[2]);else{for(var L=i.length-1;L>=0;--L)if(i[L]==C[2]){i.length=L;break}if(L<0&&(!d||d==C[2]))return{tag:C[2],from:V(u.line,u.ch),to:V(O,w)}}}}ee.registerHelper("fold","xml",function(u,d){for(var i=new G(u,d.line,0);;){var o=p(i);if(!o||i.line!=d.line)return;var O=y(i);if(!O)return;if(!o[1]&&O!="selfClose"){var w=V(i.line,i.ch),C=a(i,o[2]);return C&&N(C.from,w)>0?{from:w,to:C.from}:null}}}),ee.findMatchingTag=function(u,d,i){var o=new G(u,d.line,d.ch,i);if(o.text.indexOf(">")==-1&&o.text.indexOf("<")==-1)return;var O=y(o),w=O&&V(o.line,o.ch),C=O&&g(o);if(!O||!C||N(o,d)>0)return;var L={from:V(o.line,o.ch),to:w,tag:C[2]};return O=="selfClose"?{open:L,close:null,at:"open"}:C[1]?{open:f(o,C[2]),close:L,at:"close"}:(o=new G(u,w.line,w.ch,i),{open:L,close:a(o,C[2]),at:"open"})},ee.findEnclosingTag=function(u,d,i,o){for(var O=new G(u,d.line,d.ch,i);;){var w=f(O,o);if(!w)break;var C=new G(u,d.line,d.ch,i),L=a(C,w.tag);if(L)return{open:w,close:L}}},ee.scanForClosingTag=function(u,d,i,o){var O=new G(u,d.line,d.ch,o?{from:0,to:o}:null);return a(O,i)}})},p5ED:function(at,Ee,H){"use strict";var ee=H("+L6B"),V=H("2/Rp"),N=H("5Dmo"),$=H("3S7+"),j=H("k1fw"),P=H("9og8"),G=H("tJVT"),W=H("WmNS"),n=H.n(W),D=H("q1tI"),y=H.n(D),g=H("vHTk"),p=H.n(g),l=H("yEEn"),a=H("ZW9T"),f=H("1vsH"),u=H("V0Rq"),d=H("m3rI");Ee.a=function(i){var o,O,w,C,L,A,_,T=i.editOffice,v=T===void 0?"view":T,c=i.data,E=i.theme,h=i.type,x=i.filename,U=i.monacoEditor,F=i.className,S=i.style,M=i.close,I=i.onClose,b=i.hasMask,K=i.disabledDownload,Q=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ne=Object(G.a)(Q,2),fe=ne[0],we=ne[1],Se=Object(D.useState)(""),he=Object(G.a)(Se,2),se=he[0],me=he[1],re=Object(D.useState)(),le=Object(G.a)(re,2),Z=le[0],ae=le[1],oe=window.ENV==="build"?"/react/build":"",ge=d.a.PROXY_SERVER||location.origin,Re,Te=1024*1024,Me=10*Te,Be=Object(D.useRef)();(o=c)!==null&&o!==void 0&&o.startsWith("/api")&&h!=="txt"&&(c=d.a.API_SERVER+c),h==="office"&&(Re=Object(f.T)(c).filesize,Re>Me&&(h="other")),x&&U&&(U.filename=x),Object(D.useEffect)(function(){var Le,Ge,Ve=(Le=document.cookie)===null||Le===void 0||((Ge=Le.replace(/\s/g,""))===null||Ge===void 0)?void 0:Ge.split(";");Ve==null||Ve.map(function(tt){var rt=tt.split("=");rt[0]==="_educoder_session"&&me(rt[1])})},[]),Object(D.useEffect)(function(){h==="office"&&pe()},[h,c]);var pe=function(){var Le=Object(P.a)(n.a.mark(function Ge(){var Ve,tt,rt;return n.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:return console.log("data:",c),Ve=c,c.startsWith("http")||(Ve=location.origin+Ve),tt=new URL(Ve).pathname.split("/").pop(),lt.next=6,Object(u.V)({attachment_id:tt});case 6:rt=lt.sent,ae(rt);case 8:case"end":return lt.stop()}},Ge)}));return function(){return Le.apply(this,arguments)}}(),Ce=function(){if(c.startsWith("http")||c.startsWith("blob:")){ke();return}Object(f.z)(x||"educoder",c,x)},ke=function(){Object(f.x)(x||"educoder",decodeURIComponent(c))};return y.a.createElement("div",{style:Object(j.a)({},S||{}),className:"".concat(b&&p.a.bgBlack," ").concat(h?p.a.wrp:"hide")},M&&y.a.createElement("div",{className:p.a.close,ref:Be},!K&&y.a.createElement($.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Be.current}},y.a.createElement("span",{onClick:ke},y.a.createElement("i",{className:"icon-quxiaozhiding"}))),y.a.createElement($.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Be.current}},y.a.createElement("span",{className:"",onClick:I},y.a.createElement("i",{className:"icon-guanbi1"})))),y.a.createElement("div",{className:"".concat(p.a[F]," ").concat(F," ").concat(p.a.monaco," ").concat(h==="txt"?"show":"hide")},h==="txt"&&y.a.createElement(a.b,U)),h==="audio"&&y.a.createElement("audio",{src:"".concat(((O=c)===null||O===void 0?void 0:O.indexOf("http://"))>-1||((w=c)===null||w===void 0?void 0:w.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(c),autoPlay:!0}),h==="video"&&y.a.createElement(y.a.Fragment,null,((C=c)===null||C===void 0?void 0:C.indexOf("http"))>-1?y.a.createElement("video",{controls:!0,src:"".concat(c),autoPlay:!0}):y.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(c),autoPlay:!0})),h==="office"&&Z&&y.a.createElement("iframe",{src:"".concat(oe,"/office.html?key=").concat(Z.key,"&url=").concat(ge+Z.url,"&callbackUrl=").concat(ge+Z.callbackUrl,"&fileType=").concat(Z.fileType,"&title=").concat(Z.title,"&model=").concat(v,"&officeServer=").concat(d.a.OFFICE_SERVER,"&disabledDownload=").concat(!!K)}),h==="html"&&y.a.createElement("iframe",{src:c+"&disposition=inline"}),h==="pdf"&&y.a.createElement("iframe",{src:"".concat(oe,"/js/pdfview/index.html?url=").concat(c,"&disabledDownload=").concat(!!K)}),h==="image"&&y.a.createElement("img",{src:"".concat(((L=c)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((A=c)===null||A===void 0?void 0:A.indexOf("https://"))>-1||(_=c)!==null&&_!==void 0&&_.startsWith("/api")?"":"data:image/png;base64,").concat(c)}),h==="other"&&y.a.createElement("div",null,y.a.createElement(V.a,{type:"primary",size:"large",onClick:Ce},y.a.createElement(l.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),h==="download"&&y.a.createElement(V.a,{type:"primary",size:"large",onClick:Ce},y.a.createElement(l.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(at,Ee,H){},pmY6:function(at,Ee,H){"use strict";H.d(Ee,"h",function(){return D}),H.d(Ee,"g",function(){return g}),H.d(Ee,"f",function(){return p}),H.d(Ee,"e",function(){return l}),H.d(Ee,"i",function(){return a}),H.d(Ee,"b",function(){return f}),H.d(Ee,"a",function(){return u}),H.d(Ee,"d",function(){return d}),H.d(Ee,"c",function(){return i});var ee=H("C/vA"),V=H("JYp7");const N=!1;let $=null;function j(o){$=o}if(N){const o="__is_disposable_tracked__";j(new class{trackDisposable(O){const w=new Error("Potentially leaked disposable").stack;setTimeout(()=>{O[o]||console.log(w)},3e3)}setParent(O,w){if(O&&O!==u.None)try{O[o]=!0}catch(C){}}markAsDisposed(O){if(O&&O!==u.None)try{O[o]=!0}catch(w){}}markAsSingleton(O){}})}function P(o){return $==null||$.trackDisposable(o),o}function G(o){$==null||$.markAsDisposed(o)}function W(o,O){$==null||$.setParent(o,O)}function n(o,O){if(!$)return;for(const w of o)$.setParent(w,O)}function D(o){return $==null||$.markAsSingleton(o),o}class y extends Error{constructor(o){super(`Encountered errors while disposing of store. Errors: [${o.join(", ")}]`);this.errors=o}}function g(o){return typeof o.dispose=="function"&&o.dispose.length===0}function p(o){if(V.a.is(o)){let O=[];for(const w of o)if(w)try{w.dispose()}catch(C){O.push(C)}if(O.length===1)throw O[0];if(O.length>1)throw new y(O);return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function l(...o){const O=a(()=>p(o));return n(o,O),O}function a(o){const O=P({dispose:Object(ee.a)(()=>{G(O),o()})});return O}class f{constructor(){this._toDispose=new Set,this._isDisposed=!1,P(this)}dispose(){if(this._isDisposed)return;G(this),this._isDisposed=!0,this.clear()}clear(){try{p(this._toDispose.values())}finally{this._toDispose.clear()}}add(o){if(!o)return o;if(o===this)throw new Error("Cannot register a disposable on itself!");return W(o,this),this._isDisposed?f.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(o),o}}f.DISABLE_DISPOSED_WARNING=!1;class u{constructor(){this._store=new f,P(this),W(this._store,this)}dispose(){G(this),this._store.dispose()}_register(o){if(o===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(o)}}u.None=Object.freeze({dispose(){}});class d{constructor(){this._isDisposed=!1,P(this)}get value(){return this._isDisposed?void 0:this._value}set value(o){var O;if(this._isDisposed||o===this._value)return;(O=this._value)===null||O===void 0||O.dispose(),o&&W(o,this),this._value=o}clear(){this.value=void 0}dispose(){var o;this._isDisposed=!0,G(this),(o=this._value)===null||o===void 0||o.dispose(),this._value=void 0}clearAndLeak(){const o=this._value;return this._value=void 0,o&&W(o,null),o}}class i{constructor(o){this.object=o}dispose(){}}},psGv:function(at,Ee,H){var ee,V;(function(){var N;(function(){"use strict";var G=[,,function(y){function g(a){this.__parent=a,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}g.prototype.clone_empty=function(){var a=new g(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},g.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},g.prototype.has_match=function(a){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(a))return!0;return!1},g.prototype.set_indent=function(a,f){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},g.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)},g.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},g.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var a=this.__parent.current_line;return a.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),a.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),a.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,a.__items[0]===" "&&(a.__items.splice(0,1),a.__character_count-=1),!0}return!1},g.prototype.is_empty=function(){return this.__items.length===0},g.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},g.prototype.push=function(a){this.__items.push(a);var f=a.lastIndexOf(`
`);f!==-1?this.__character_count=a.length-f:this.__character_count+=a.length},g.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},g.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},g.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},g.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},g.prototype.toString=function(){var a="";return this.is_empty()?this.__parent.indent_empty_lines&&(a=this.__parent.get_indent_string(this.__indent_count)):(a=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),a+=this.__items.join("")),a};function p(a,f){this.__cache=[""],this.__indent_size=a.indent_size,this.__indent_string=a.indent_char,a.indent_with_tabs||(this.__indent_string=new Array(a.indent_size+1).join(a.indent_char)),f=f||"",a.indent_level>0&&(f=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}p.prototype.get_indent_size=function(a,f){var u=this.__base_string_length;return f=f||0,a<0&&(u=0),u+=a*this.__indent_size,u+=f,u},p.prototype.get_indent_string=function(a,f){var u=this.__base_string;return f=f||0,a<0&&(a=0,u=""),f+=a*this.__indent_size,this.__ensure_cache(f),u+=this.__cache[f],u},p.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var a=this.__cache.length,f=0,u="";this.__indent_size&&a>=this.__indent_size&&(f=Math.floor(a/this.__indent_size),a-=f*this.__indent_size,u=new Array(f+1).join(this.__indent_string)),a&&(u+=new Array(a+1).join(" ")),this.__cache.push(u)};function l(a,f){this.__indent_cache=new p(a,f),this.raw=!1,this._end_with_newline=a.end_with_newline,this.indent_size=a.indent_size,this.wrap_line_length=a.wrap_line_length,this.indent_empty_lines=a.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new g(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}l.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},l.prototype.get_line_number=function(){return this.__lines.length},l.prototype.get_indent_string=function(a,f){return this.__indent_cache.get_indent_string(a,f)},l.prototype.get_indent_size=function(a,f){return this.__indent_cache.get_indent_size(a,f)},l.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},l.prototype.add_new_line=function(a){return this.is_empty()||!a&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},l.prototype.get_code=function(a){this.trim(!0);var f=this.current_line.pop();f&&(f[f.length-1]===`
`&&(f=f.replace(/\n+$/g,"")),this.current_line.push(f)),this._end_with_newline&&this.__add_outputline();var u=this.__lines.join(`
`);return a!==`
`&&(u=u.replace(/[\n]/g,a)),u},l.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},l.prototype.set_indent=function(a,f){return a=a||0,f=f||0,this.next_line.set_indent(a,f),this.__lines.length>1?(this.current_line.set_indent(a,f),!0):(this.current_line.set_indent(),!1)},l.prototype.add_raw_token=function(a){for(var f=0;f<a.newlines;f++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(a.whitespace_before),this.current_line.push(a.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},l.prototype.add_token=function(a){this.__add_space_before_token(),this.current_line.push(a),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},l.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},l.prototype.remove_indent=function(a){for(var f=this.__lines.length;a<f;)this.__lines[a]._remove_indent(),a++;this.current_line._remove_wrap_indent()},l.prototype.trim=function(a){for(a=a===void 0?!1:a,this.current_line.trim();a&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},l.prototype.just_added_newline=function(){return this.current_line.is_empty()},l.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},l.prototype.ensure_empty_line_above=function(a,f){for(var u=this.__lines.length-2;u>=0;){var d=this.__lines[u];if(d.is_empty())break;if(d.item(0).indexOf(a)!==0&&d.item(-1)!==f){this.__lines.splice(u+1,0,new g(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},y.exports.Output=l},function(y){function g(p,l,a,f){this.type=p,this.text=l,this.comments_before=null,this.newlines=a||0,this.whitespace_before=f||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}y.exports.Token=g},,,function(y){function g(a,f){this.raw_options=p(a,f),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}g.prototype._get_array=function(a,f){var u=this.raw_options[a],d=f||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(d=u.concat()):typeof u=="string"&&(d=u.split(/[^a-zA-Z0-9_\/\-]+/)),d},g.prototype._get_boolean=function(a,f){var u=this.raw_options[a],d=u===void 0?!!f:!!u;return d},g.prototype._get_characters=function(a,f){var u=this.raw_options[a],d=f||"";return typeof u=="string"&&(d=u.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),d},g.prototype._get_number=function(a,f){var u=this.raw_options[a];f=parseInt(f,10),isNaN(f)&&(f=0);var d=parseInt(u,10);return isNaN(d)&&(d=f),d},g.prototype._get_selection=function(a,f,u){var d=this._get_selection_list(a,f,u);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
`+f+`
You passed in: '`+this.raw_options[a]+"'");return d[0]},g.prototype._get_selection_list=function(a,f,u){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(u=u||[f[0]],!this._is_valid_selection(u,f))throw new Error("Invalid Default Value!");var d=this._get_array(a,u);if(!this._is_valid_selection(d,f))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
`+f+`
You passed in: '`+this.raw_options[a]+"'");return d},g.prototype._is_valid_selection=function(a,f){return a.length&&f.length&&!a.some(function(u){return f.indexOf(u)===-1})};function p(a,f){var u={};a=l(a);var d;for(d in a)d!==f&&(u[d]=a[d]);if(f&&a[f])for(d in a[f])u[d]=a[f][d];return u}function l(a){var f={},u;for(u in a){var d=u.replace(/-/g,"_");f[d]=a[u]}return f}y.exports.Options=g,y.exports.normalizeOpts=l,y.exports.mergeOpts=p},,function(y){var g=RegExp.prototype.hasOwnProperty("sticky");function p(l){this.__input=l||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var l=null;return this.hasNext()&&(l=this.__input.charAt(this.__position),this.__position+=1),l},p.prototype.peek=function(l){var a=null;return l=l||0,l+=this.__position,l>=0&&l<this.__input_length&&(a=this.__input.charAt(l)),a},p.prototype.__match=function(l,a){l.lastIndex=a;var f=l.exec(this.__input);return f&&!(g&&l.sticky)&&(f.index!==a&&(f=null)),f},p.prototype.test=function(l,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(l,a):!1},p.prototype.testChar=function(l,a){var f=this.peek(a);return l.lastIndex=0,f!==null&&l.test(f)},p.prototype.match=function(l){var a=this.__match(l,this.__position);return a?this.__position+=a[0].length:a=null,a},p.prototype.read=function(l,a,f){var u="",d;return l&&(d=this.match(l),d&&(u+=d[0])),a&&(d||!l)&&(u+=this.readUntil(a,f)),u},p.prototype.readUntil=function(l,a){var f="",u=this.__position;l.lastIndex=this.__position;var d=l.exec(this.__input);return d?(u=d.index,a&&(u+=d[0].length)):u=this.__input_length,f=this.__input.substring(this.__position,u),this.__position=u,f},p.prototype.readUntilAfter=function(l){return this.readUntil(l,!0)},p.prototype.get_regexp=function(l,a){var f=null,u="g";return a&&g&&(u="y"),typeof l=="string"&&l!==""?f=new RegExp(l,u):l&&(f=new RegExp(l.source,u)),f},p.prototype.get_literal_regexp=function(l){return RegExp(l.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(l){var a=this.__position,f=this.readUntilAfter(l);return this.__position=a,f},p.prototype.lookBack=function(l){var a=this.__position-1;return a>=l.length&&this.__input.substring(a-l.length,a).toLowerCase()===l},y.exports.InputScanner=p},function(y,g,p){var l=p(8).InputScanner,a=p(3).Token,f=p(10).TokenStream,u=p(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(o,O){this._input=new l(o),this._options=O||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new u(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new f,this._reset();for(var o,O=new a(d.START,""),w=null,C=[],L=new f;O.type!==d.EOF;){for(o=this._get_next_token(O,w);this._is_comment(o);)L.add(o),o=this._get_next_token(O,w);L.isEmpty()||(o.comments_before=L,L=new f),o.parent=w,this._is_opening(o)?(C.push(w),w=o):w&&this._is_closing(o,w)&&(o.opened=w,w.closed=o,w=C.pop(),o.parent=w),o.previous=O,O.next=o,this.__tokens.add(o),O=o}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(o,O){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(d.RAW,w):this._create_token(d.EOF,"")},i.prototype._is_comment=function(o){return!1},i.prototype._is_opening=function(o){return!1},i.prototype._is_closing=function(o,O){return!1},i.prototype._create_token=function(o,O){var w=new a(o,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},y.exports.Tokenizer=i,y.exports.TOKEN=d},function(y){function g(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}g.prototype.restart=function(){this.__position=0},g.prototype.isEmpty=function(){return this.__tokens_length===0},g.prototype.hasNext=function(){return this.__position<this.__tokens_length},g.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},g.prototype.peek=function(p){var l=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(l=this.__tokens[p]),l},g.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},y.exports.TokenStream=g},function(y,g,p){var l=p(12).Pattern;function a(f,u){l.call(this,f,u),u?this._line_regexp=this._input.get_regexp(u._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}a.prototype=new l,a.prototype.__set_whitespace_patterns=function(f,u){f+="\\t ",u+="\\n\\r",this._match_pattern=this._input.get_regexp("["+f+u+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+u+"]")},a.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var f=this._input.read(this._match_pattern);if(f===" ")this.whitespace_before_token=" ";else if(f){var u=this.__split(this._newline_regexp,f);this.newline_count=u.length-1,this.whitespace_before_token=u[this.newline_count]}return f},a.prototype.matching=function(f,u){var d=this._create();return d.__set_whitespace_patterns(f,u),d._update(),d},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(f,u){f.lastIndex=0;for(var d=0,i=[],o=f.exec(u);o;)i.push(u.substring(d,o.index)),d=o.index+o[0].length,o=f.exec(u);return d<u.length?i.push(u.substring(d,u.length)):i.push(""),i},y.exports.WhitespacePattern=a},function(y){function g(p,l){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,l&&(this._starting_pattern=this._input.get_regexp(l._starting_pattern,!0),this._match_pattern=this._input.get_regexp(l._match_pattern,!0),this._until_pattern=this._input.get_regexp(l._until_pattern),this._until_after=l._until_after)}g.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},g.prototype.read_match=function(){return this._input.match(this._match_pattern)},g.prototype.until_after=function(p){var l=this._create();return l._until_after=!0,l._until_pattern=this._input.get_regexp(p),l._update(),l},g.prototype.until=function(p){var l=this._create();return l._until_after=!1,l._until_pattern=this._input.get_regexp(p),l._update(),l},g.prototype.starting_with=function(p){var l=this._create();return l._starting_pattern=this._input.get_regexp(p,!0),l._update(),l},g.prototype.matching=function(p){var l=this._create();return l._match_pattern=this._input.get_regexp(p,!0),l._update(),l},g.prototype._create=function(){return new g(this._input,this)},g.prototype._update=function(){},y.exports.Pattern=g},function(y){function g(p,l){p=typeof p=="string"?p:p.source,l=typeof l=="string"?l:l.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+l,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+l,"g")}g.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var l={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(p);a;)l[a[1]]=a[2],a=this.__directive_pattern.exec(p);return l},g.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},y.exports.Directives=g},function(y,g,p){var l=p(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function f(u,d){l.call(this,u,d),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),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 i=new l(u);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}f.prototype=new l,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(u){var d=this._create();return d._disabled[u]=!0,d._update(),d},f.prototype.read_options=function(u){var d=this._create();for(var i in a)d._disabled[i]=u.templating.indexOf(i)===-1;return d._update(),d},f.prototype.exclude=function(u){var d=this._create();return d._excluded[u]=!0,d._update(),d},f.prototype.read=function(){var u="";this._match_pattern?u=this._input.read(this._starting_pattern):u=this._input.read(this._starting_pattern,this.__template_pattern);for(var d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),u+=d,d=this._read_template();return this._until_after&&(u+=this._input.readUntilAfter(this._until_pattern)),u},f.prototype.__set_templated_pattern=function(){var u=[];this._disabled.php||u.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||u.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||u.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(u.push(this.__patterns.django._starting_pattern.source),u.push(this.__patterns.django_value._starting_pattern.source),u.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||u.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&u.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+u.join("|")+")")},f.prototype._read_template=function(){var u="",d=this._input.peek();if(d==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(u=u||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(u=u||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(u=u||this.__patterns.handlebars_comment.read(),u=u||this.__patterns.handlebars_unescaped.read(),u=u||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(u=u||this.__patterns.django_value.read()),this._excluded.django||(u=u||this.__patterns.django_comment.read(),u=u||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(u=u||this.__patterns.smarty_comment.read(),u=u||this.__patterns.smarty_literal.read(),u=u||this.__patterns.smarty.read()));return u},y.exports.TemplatablePattern=f},,,,function(y,g,p){var l=p(19).Beautifier,a=p(20).Options;function f(u,d,i,o){var O=new l(u,d,i,o);return O.beautify()}y.exports=f,y.exports.defaultOptions=function(){return new a}},function(y,g,p){var l=p(20).Options,a=p(2).Output,f=p(21).Tokenizer,u=p(21).TOKEN,d=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,o=function(E,h){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=E.max_preserve_newlines,this.preserve_newlines=E.preserve_newlines,this._output=new a(E,h)};o.prototype.current_line_has_match=function(E){return this._output.current_line.has_match(E)},o.prototype.set_space_before_token=function(E,h){this._output.space_before_token=E,this._output.non_breaking_space=h},o.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},o.prototype.add_raw_token=function(E){this._output.add_raw_token(E)},o.prototype.print_preserved_newlines=function(E){var h=0;E.type!==u.TEXT&&E.previous.type!==u.TEXT&&(h=E.newlines?1:0),this.preserve_newlines&&(h=E.newlines<this.max_preserve_newlines+1?E.newlines:this.max_preserve_newlines+1);for(var x=0;x<h;x++)this.print_newline(x>0);return h!==0},o.prototype.traverse_whitespace=function(E){return E.whitespace_before||E.newlines?(this.print_preserved_newlines(E)||(this._output.space_before_token=!0),!0):!1},o.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},o.prototype.print_newline=function(E){this._output.add_new_line(E)},o.prototype.print_token=function(E){E.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(E.text))},o.prototype.indent=function(){this.indent_level++},o.prototype.get_full_indent=function(E){return E=this.indent_level+(E||0),E<1?"":this._output.get_indent_string(E)};var O=function(E){for(var h=null,x=E.next;x.type!==u.EOF&&E.closed!==x;){if(x.type===u.ATTRIBUTE&&x.text==="type"){x.next&&x.next.type===u.EQUALS&&x.next.next&&x.next.next.type===u.VALUE&&(h=x.next.next.text);break}x=x.next}return h},w=function(E,h){var x=null,U=null;return h.closed?(E==="script"?x="text/javascript":E==="style"&&(x="text/css"),x=O(h)||x,x.search("text/css")>-1?U="css":x.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?U="javascript":x.search(/(text|application|dojo)\/(x-)?(html)/)>-1?U="html":x.search(/test\/null/)>-1&&(U="null"),U):null};function C(E,h){return h.indexOf(E)!==-1}function L(E,h,x){this.parent=E||null,this.tag=h?h.tag_name:"",this.indent_level=x||0,this.parser_token=h||null}function A(E){this._printer=E,this._current_frame=null}A.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},A.prototype.record_tag=function(E){var h=new L(this._current_frame,E,this._printer.indent_level);this._current_frame=h},A.prototype._try_pop_frame=function(E){var h=null;return E&&(h=E.parser_token,this._printer.indent_level=E.indent_level,this._current_frame=E.parent),h},A.prototype._get_frame=function(E,h){for(var x=this._current_frame;x&&!(E.indexOf(x.tag)!==-1);){if(h&&h.indexOf(x.tag)!==-1){x=null;break}x=x.parent}return x},A.prototype.try_pop=function(E,h){var x=this._get_frame([E],h);return this._try_pop_frame(x)},A.prototype.indent_to_tag=function(E){var h=this._get_frame(E);h&&(this._printer.indent_level=h.indent_level)};function _(E,h,x,U){this._source_text=E||"",h=h||{},this._js_beautify=x,this._css_beautify=U,this._tag_stack=null;var F=new l(h,"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"}_.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,h=this._options.eol;this._options.eol==="auto"&&(h=`
`,E&&d.test(E)&&(h=E.match(d)[0])),E=E.replace(i,`
`);var x=E.match(/^[\t ]*/)[0],U={text:"",type:""},F=new T,S=new o(this._options,x),M=new f(E,this._options).tokenize();this._tag_stack=new A(S);for(var I=null,b=M.next();b.type!==u.EOF;)b.type===u.TAG_OPEN||b.type===u.COMMENT?(I=this._handle_tag_open(S,b,F,U),F=I):b.type===u.ATTRIBUTE||b.type===u.EQUALS||b.type===u.VALUE||b.type===u.TEXT&&!F.tag_complete?I=this._handle_inside_tag(S,b,F,M):b.type===u.TAG_CLOSE?I=this._handle_tag_close(S,b,F):b.type===u.TEXT?I=this._handle_text(S,b,F):S.add_raw_token(b),U=I,b=M.next();var K=S._output.get_code(h);return K},_.prototype._handle_tag_close=function(E,h,x){var U={text:h.text,type:h.type};return E.alignment_size=0,x.tag_complete=!0,E.set_space_before_token(h.newlines||h.whitespace_before!=="",!0),x.is_unformatted?E.add_raw_token(h):(x.tag_start_char==="<"&&(E.set_space_before_token(h.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&x.has_wrapped_attrs&&E.print_newline(!1)),E.print_token(h)),x.indent_content&&!(x.is_unformatted||x.is_content_unformatted)&&(E.indent(),x.indent_content=!1),!x.is_inline_element&&!(x.is_unformatted||x.is_content_unformatted)&&E.set_wrap_point(),U},_.prototype._handle_inside_tag=function(E,h,x,U){var F=x.has_wrapped_attrs,S={text:h.text,type:h.type};if(E.set_space_before_token(h.newlines||h.whitespace_before!=="",!0),x.is_unformatted)E.add_raw_token(h);else if(x.tag_start_char==="{"&&h.type===u.TEXT)E.print_preserved_newlines(h)?(h.newlines=0,E.add_raw_token(h)):E.print_token(h);else{if(h.type===u.ATTRIBUTE?(E.set_space_before_token(!0),x.attr_count+=1):(h.type===u.EQUALS||h.type===u.VALUE&&h.previous.type===u.EQUALS)&&E.set_space_before_token(!1),h.type===u.ATTRIBUTE&&x.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(E.traverse_whitespace(h),F=F||h.newlines!==0),this._is_wrap_attributes_force)){var M=x.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&x.attr_count===1){var I=!0,b=0,K;do{if(K=U.peek(b),K.type===u.ATTRIBUTE){I=!1;break}b+=1}while(b<4&&K.type!==u.EOF&&K.type!==u.TAG_CLOSE);M=!I}M&&(E.print_newline(!1),F=!0)}E.print_token(h),F=F||E.previous_token_wrapped(),x.has_wrapped_attrs=F}return S},_.prototype._handle_text=function(E,h,x){var U={text:h.text,type:"TK_CONTENT"};return x.custom_beautifier_name?this._print_custom_beatifier_text(E,h,x):x.is_unformatted||x.is_content_unformatted?E.add_raw_token(h):(E.traverse_whitespace(h),E.print_token(h)),U},_.prototype._print_custom_beatifier_text=function(E,h,x){var U=this;if(h.text!==""){var F=h.text,S,M=1,I="",b="";x.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?S=this._js_beautify:x.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?S=this._css_beautify:x.custom_beautifier_name==="html"&&(S=function(Se,he){var se=new _(Se,he,U._js_beautify,U._css_beautify);return se.beautify()}),this._options.indent_scripts==="keep"?M=0:this._options.indent_scripts==="separate"&&(M=-E.indent_level);var K=E.get_full_indent(M);if(F=F.replace(/\n[ \t]*$/,""),x.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var Q=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!Q){E.add_raw_token(h);return}I=K+Q[1]+`
`,F=Q[4],Q[5]&&(b=K+Q[5]),F=F.replace(/\n[ \t]*$/,""),(Q[2]||Q[3].indexOf(`
`)!==-1)&&(Q=Q[3].match(/[ \t]+$/),Q&&(h.whitespace_before=Q[0]))}if(F)if(S){var ne=function(){this.eol=`
`};ne.prototype=this._options.raw_options;var fe=new ne;F=S(K+F,fe)}else{var we=h.whitespace_before;we&&(F=F.replace(new RegExp(`
(`+we+")?","g"),`
`)),F=K+F.replace(/\n/g,`
`+K)}I&&(F?F=I+F+`
`+b:F=I+b),E.print_newline(!1),F&&(h.text=F,h.whitespace_before="",h.newlines=0,E.add_raw_token(h),E.print_newline(!0))}},_.prototype._handle_tag_open=function(E,h,x,U){var F=this._get_tag_open_token(h);return(x.is_unformatted||x.is_content_unformatted)&&!x.is_empty_element&&h.type===u.TAG_OPEN&&h.text.indexOf("</")===0?(E.add_raw_token(h),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(E.traverse_whitespace(h),this._set_tag_position(E,h,F,x,U),F.is_inline_element||E.set_wrap_point(),E.print_token(h)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(F.alignment_size=h.text.length+1),!F.tag_complete&&!F.is_unformatted&&(E.alignment_size=F.alignment_size),F};var T=function(E,h){if(this.parent=E||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="",!h)this.tag_complete=!0;else{var x;this.tag_start_char=h.text[0],this.text=h.text,this.tag_start_char==="<"?(x=h.text.match(/^<([^\s>]*)/),this.tag_check=x?x[1]:""):(x=h.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=x?x[1]:"",(h.text.startsWith("{{#>")||h.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&h.next!==null?this.tag_check=h.next.text.split(" ")[0]:this.tag_check=h.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),h.type===u.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||h.closed&&h.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)))}};_.prototype._get_tag_open_token=function(E){var h=new T(this._tag_stack.get_parser_token(),E);return h.alignment_size=this._options.wrap_attributes_indent_size,h.is_end_tag=h.is_end_tag||C(h.tag_check,this._options.void_elements),h.is_empty_element=h.tag_complete||h.is_start_tag&&h.is_end_tag,h.is_unformatted=!h.tag_complete&&C(h.tag_check,this._options.unformatted),h.is_content_unformatted=!h.is_empty_element&&C(h.tag_check,this._options.content_unformatted),h.is_inline_element=C(h.tag_name,this._options.inline)||h.tag_name.includes("-")||h.tag_start_char==="{",h},_.prototype._set_tag_position=function(E,h,x,U,F){if(x.is_empty_element||(x.is_end_tag?x.start_tag_token=this._tag_stack.try_pop(x.tag_name):(this._do_optional_end_element(x)&&(x.is_inline_element||E.print_newline(!1)),this._tag_stack.record_tag(x),(x.tag_name==="script"||x.tag_name==="style")&&!(x.is_unformatted||x.is_content_unformatted)&&(x.custom_beautifier_name=w(x.tag_check,h)))),C(x.tag_check,this._options.extra_liners)&&(E.print_newline(!1),E._output.just_added_blankline()||E.print_newline(!0)),x.is_empty_element){if(x.tag_start_char==="{"&&x.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),x.indent_content=!0;var S=E.current_line_has_match(/{{#if/);S||E.print_newline(!1)}x.tag_name==="!--"&&F.type===u.TAG_CLOSE&&U.is_end_tag&&x.text.indexOf(`
`)===-1||(x.is_inline_element||x.is_unformatted||E.print_newline(!1),this._calcluate_parent_multiline(E,x))}else if(x.is_end_tag){var M=!1;M=x.start_tag_token&&x.start_tag_token.multiline_content,M=M||!x.is_inline_element&&!(U.is_inline_element||U.is_unformatted)&&!(F.type===u.TAG_CLOSE&&x.start_tag_token===U)&&F.type!=="TK_CONTENT",(x.is_content_unformatted||x.is_unformatted)&&(M=!1),M&&E.print_newline(!1)}else x.indent_content=!x.custom_beautifier_name,x.tag_start_char==="<"&&(x.tag_name==="html"?x.indent_content=this._options.indent_inner_html:x.tag_name==="head"?x.indent_content=this._options.indent_head_inner_html:x.tag_name==="body"&&(x.indent_content=this._options.indent_body_inner_html)),!(x.is_inline_element||x.is_unformatted)&&(F.type!=="TK_CONTENT"||x.is_content_unformatted)&&E.print_newline(!1),this._calcluate_parent_multiline(E,x)},_.prototype._calcluate_parent_multiline=function(E,h){h.parent&&E._output.just_added_newline()&&!((h.is_inline_element||h.is_unformatted)&&h.parent.is_inline_element)&&(h.parent.multiline_content=!0)};var v=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],c=["a","audio","del","ins","map","noscript","video"];_.prototype._do_optional_end_element=function(E){var h=null;if(E.is_empty_element||!E.is_start_tag||!E.parent)return;if(E.tag_name==="body")h=h||this._tag_stack.try_pop("head");else if(E.tag_name==="li")h=h||this._tag_stack.try_pop("li",["ol","ul"]);else if(E.tag_name==="dd"||E.tag_name==="dt")h=h||this._tag_stack.try_pop("dt",["dl"]),h=h||this._tag_stack.try_pop("dd",["dl"]);else if(E.parent.tag_name==="p"&&v.indexOf(E.tag_name)!==-1){var x=E.parent.parent;(!x||c.indexOf(x.tag_name)===-1)&&(h=h||this._tag_stack.try_pop("p"))}else E.tag_name==="rp"||E.tag_name==="rt"?(h=h||this._tag_stack.try_pop("rt",["ruby","rtc"]),h=h||this._tag_stack.try_pop("rp",["ruby","rtc"])):E.tag_name==="optgroup"?h=h||this._tag_stack.try_pop("optgroup",["select"]):E.tag_name==="option"?h=h||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):E.tag_name==="colgroup"?h=h||this._tag_stack.try_pop("caption",["table"]):E.tag_name==="thead"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"])):E.tag_name==="tbody"||E.tag_name==="tfoot"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"]),h=h||this._tag_stack.try_pop("thead",["table"]),h=h||this._tag_stack.try_pop("tbody",["table"])):E.tag_name==="tr"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"]),h=h||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(E.tag_name==="th"||E.tag_name==="td")&&(h=h||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),h=h||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return E.parent=this._tag_stack.get_parser_token(),h},y.exports.Beautifier=_},function(y,g,p){var l=p(6).Options;function a(f){l.call(this,f,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}a.prototype=new l,y.exports.Options=a},function(y,g,p){var l=p(9).Tokenizer,a=p(9).TOKEN,f=p(13).Directives,u=p(14).TemplatablePattern,d=p(12).Pattern,i={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:a.START,RAW:a.RAW,EOF:a.EOF},o=new f(/<\!--/,/-->/),O=function(w,C){l.call(this,w,C),this._current_tag_name="";var L=new u(this._input).read_options(this._options),A=new d(this._input);if(this.__patterns={word:L.until(/[\n\r\t <]/),single_quote:L.until_after(/'/),double_quote:L.until_after(/"/),attribute:L.until(/[\n\r\t =>]|\/>/),element_name:L.until(/[\n\r\t >\/]/),handlebars_comment:A.starting_with(/{{!--/).until_after(/--}}/),handlebars:A.starting_with(/{{/).until_after(/}}/),handlebars_open:A.until(/[\n\r\t }]/),handlebars_raw_close:A.until(/}}/),comment:A.starting_with(/<!--/).until_after(/-->/),cdata:A.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:A.starting_with(/<!\[/).until_after(/]>/),processing:A.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 _=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=A.matching(_).until_after(_)}};O.prototype=new l,O.prototype._is_comment=function(w){return!1},O.prototype._is_opening=function(w){return w.type===i.TAG_OPEN},O.prototype._is_closing=function(w,C){return w.type===i.TAG_CLOSE&&C&&((w.text===">"||w.text==="/>")&&C.text[0]==="<"||w.text==="}}"&&C.text[0]==="{"&&C.text[1]==="{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(w,C){var L=null;this._readWhitespace();var A=this._input.peek();return A===null?this._create_token(i.EOF,""):(L=L||this._read_open_handlebars(A,C),L=L||this._read_attribute(A,w,C),L=L||this._read_close(A,C),L=L||this._read_raw_content(A,w,C),L=L||this._read_content_word(A),L=L||this._read_comment_or_cdata(A),L=L||this._read_processing(A),L=L||this._read_open(A,C),L=L||this._create_token(i.UNKNOWN,this._input.next()),L)},O.prototype._read_comment_or_cdata=function(w){var C=null,L=null,A=null;if(w==="<"){var _=this._input.peek(1);_==="!"&&(L=this.__patterns.comment.read(),L?(A=o.get_directives(L),A&&A.ignore==="start"&&(L+=o.readIgnored(this._input))):L=this.__patterns.cdata.read()),L&&(C=this._create_token(i.COMMENT,L),C.directives=A)}return C},O.prototype._read_processing=function(w){var C=null,L=null,A=null;if(w==="<"){var _=this._input.peek(1);(_==="!"||_==="?")&&(L=this.__patterns.conditional_comment.read(),L=L||this.__patterns.processing.read()),L&&(C=this._create_token(i.COMMENT,L),C.directives=A)}return C},O.prototype._read_open=function(w,C){var L=null,A=null;return C||w==="<"&&(L=this._input.next(),this._input.peek()==="/"&&(L+=this._input.next()),L+=this.__patterns.element_name.read(),A=this._create_token(i.TAG_OPEN,L)),A},O.prototype._read_open_handlebars=function(w,C){var L=null,A=null;return C||this._options.indent_handlebars&&w==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(L=this.__patterns.handlebars_comment.read(),L=L||this.__patterns.handlebars.read(),A=this._create_token(i.COMMENT,L)):(L=this.__patterns.handlebars_open.read(),A=this._create_token(i.TAG_OPEN,L))),A},O.prototype._read_close=function(w,C){var L=null,A=null;return C&&(C.text[0]==="<"&&(w===">"||w==="/"&&this._input.peek(1)===">")?(L=this._input.next(),w==="/"&&(L+=this._input.next()),A=this._create_token(i.TAG_CLOSE,L)):C.text[0]==="{"&&w==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),A=this._create_token(i.TAG_CLOSE,"}}"))),A},O.prototype._read_attribute=function(w,C,L){var A=null,_="";if(L&&L.text[0]==="<")if(w==="=")A=this._create_token(i.EQUALS,this._input.next());else if(w==='"'||w==="'"){var T=this._input.next();w==='"'?T+=this.__patterns.double_quote.read():T+=this.__patterns.single_quote.read(),A=this._create_token(i.VALUE,T)}else _=this.__patterns.attribute.read(),_&&(C.type===i.EQUALS?A=this._create_token(i.VALUE,_):A=this._create_token(i.ATTRIBUTE,_));return A},O.prototype._is_content_unformatted=function(w){return this._options.void_elements.indexOf(w)===-1&&(this._options.content_unformatted.indexOf(w)!==-1||this._options.unformatted.indexOf(w)!==-1)},O.prototype._read_raw_content=function(w,C,L){var A="";if(L&&L.text[0]==="{")A=this.__patterns.handlebars_raw_close.read();else if(C.type===i.TAG_CLOSE&&C.opened.text[0]==="<"&&C.text[0]!=="/"){var _=C.opened.text.substr(1).toLowerCase();if(_==="script"||_==="style"){var T=this._read_comment_or_cdata(w);if(T)return T.type=i.TEXT,T;A=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(_)&&(A=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig")))}return A?this._create_token(i.TEXT,A):null},O.prototype._read_content_word=function(w){var C="";if(this._options.unformatted_content_delimiter&&(w===this._options.unformatted_content_delimiter[0]&&(C=this.__patterns.unformatted_content_delimiter.read())),C||(C=this.__patterns.word.read()),C)return this._create_token(i.TEXT,C)},y.exports.Tokenizer=O,y.exports.TOKEN=i}],W={};function n(y){var g=W[y];if(g!==void 0)return g.exports;var p=W[y]={exports:{}};return G[y](p,p.exports,n),p.exports}var D=n(18);N=D})();var $=N;if(!0)!(ee=[H,H("6UM0"),H("TXwP")],V=function(G){var W=H("6UM0"),n=H("TXwP");return{html_beautify:function(D,y){return $(D,y,W.js_beautify,n.css_beautify)}}}.apply(Ee,ee),V!==void 0&&(at.exports=V));else var j,P})()},"rAM+":function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return V});var ee=H("Qw5x");function V(N,$){var j;if(typeof Symbol=="undefined"||N[Symbol.iterator]==null){if(Array.isArray(N)||(j=Object(ee.a)(N))||$&&N&&typeof N.length=="number"){j&&(N=j);var P=0,G=function(){};return{s:G,n:function(){return P>=N.length?{done:!0}:{done:!1,value:N[P++]}},e:function(g){throw g},f:G}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var W=!0,n=!1,D;return{s:function(){j=N[Symbol.iterator]()},n:function(){var g=j.next();return W=g.done,g},e:function(g){n=!0,D=g},f:function(){try{!W&&j.return!=null&&j.return()}finally{if(n)throw D}}}}},rUJ1:function(at,Ee){const H=/[&<>"']/,ee=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,$={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},j=A=>$[A];function P(A,_){if(_){if(H.test(A))return A.replace(ee,j)}else if(V.test(A))return A.replace(N,j);return A}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(A){return A.replace(G,(_,T)=>(T=T.toLowerCase(),T==="colon"?":":T.charAt(0)==="#"?T.charAt(1)==="x"?String.fromCharCode(parseInt(T.substring(2),16)):String.fromCharCode(+T.substring(1)):""))}const n=/(^|[^\[])\^/g;function D(A,_){A=A.source||A,_=_||"";const T={replace:(v,c)=>(c=c.source||c,c=c.replace(n,"$1"),A=A.replace(v,c),T),getRegex:()=>new RegExp(A,_)};return T}const y=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(A,_,T){if(A){let v;try{v=decodeURIComponent(W(T)).replace(y,"").toLowerCase()}catch(c){return null}if(v.indexOf("javascript:")===0||v.indexOf("vbscript:")===0||v.indexOf("data:")===0)return null}_&&!g.test(T)&&(T=d(_,T));try{T=encodeURI(T).replace(/%25/g,"%")}catch(v){return null}return T}const l={},a=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(A,_){l[" "+A]||(a.test(A)?l[" "+A]=A+"/":l[" "+A]=w(A,"/",!0)),A=l[" "+A];const T=A.indexOf(":")===-1;return _.substring(0,2)==="//"?T?_:A.replace(f,"$1")+_:_.charAt(0)==="/"?T?_:A.replace(u,"$1")+_:A+_}const i={exec:function(){}};function o(A){let _=1,T,v;for(;_<arguments.length;_++){T=arguments[_];for(v in T)Object.prototype.hasOwnProperty.call(T,v)&&(A[v]=T[v])}return A}function O(A,_){const T=A.replace(/\|/g,(E,h,x)=>{let U=!1,F=h;for(;--F>=0&&x[F]==="\\";)U=!U;return U?"|":" |"}),v=T.split(/ \|/);let c=0;if(v.length>_)v.splice(_);else for(;v.length<_;)v.push("");for(;c<v.length;c++)v[c]=v[c].trim().replace(/\\\|/g,"|");return v}function w(A,_,T){const v=A.length;if(v===0)return"";let c=0;for(;c<v;){const E=A.charAt(v-c-1);if(E===_&&!T)c++;else if(E!==_&&T)c++;else break}return A.substr(0,v-c)}function C(A,_){if(A.indexOf(_[1])===-1)return-1;const T=A.length;let v=0,c=0;for(;c<T;c++)if(A[c]==="\\")c++;else if(A[c]===_[0])v++;else if(A[c]===_[1]&&(v--,v<0))return c;return-1}function L(A){A&&A.sanitize&&!A.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")}at.exports={escape:P,unescape:W,edit:D,cleanUrl:p,resolveUrl:d,noopTest:i,merge:o,splitCells:O,rtrim:w,findClosingBracket:C,checkSanitizeDeprecation:L}},sR1s:function(at,Ee,H){"use strict";H.d(Ee,"b",function(){return $}),H.d(Ee,"a",function(){return j}),H.d(Ee,"c",function(){return P}),H.d(Ee,"d",function(){return G});var ee=H("U8pU"),V="RC_TABLE_KEY";function N(W){return W==null?[]:Array.isArray(W)?W:[W]}function $(W,n){if(!n&&typeof n!="number")return W;for(var D=N(n),y=W,g=0;g<D.length;g+=1){if(!y)return null;var p=D[g];y=y[p]}return y}function j(W){var n=[],D={};return W.forEach(function(y){for(var g=y||{},p=g.key,l=g.dataIndex,a=p||N(l).join("-")||V;D[a];)a="".concat(a,"_next");D[a]=!0,n.push(a)}),n}function P(){var W={};function n(p,l){l&&Object.keys(l).forEach(function(a){var f=l[a];f&&Object(ee.a)(f)==="object"?(p[a]=p[a]||{},n(p[a],f)):p[a]=f})}for(var D=arguments.length,y=new Array(D),g=0;g<D;g++)y[g]=arguments[g];return y.forEach(function(p){n(W,p)}),W}function G(W){return W!=null}},sboe:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return N});var ee=H("q1tI"),V=H.n(ee),N=ee.createContext(null)},spXi:function(at,Ee,H){at.exports={flex_box_center:"flex_box_center___2B_Y7",flex_space_between:"flex_space_between___2olzC",flex_box_vertical_center:"flex_box_vertical_center___2Z4dV",flex_box_center_end:"flex_box_center_end___3FiwX",flex_box_column:"flex_box_column___8kyK-",customTree:"customTree___1KOYx",name:"name___3pqs4"}},t23M:function(at,Ee,H){"use strict";var ee=H("VTBJ"),V=H("1OyB"),N=H("vuIU"),$=H("Ji7U"),j=H("LK+K"),P=H("q1tI"),G=H.n(P),W=H("m+aA"),n=H("Zm9Q"),D=H("Kwbf"),y=H("c+Xe"),g=H("bdgK"),p="rc-observer-key",l=function(a){Object($.a)(u,a);var f=Object(j.a)(u);function u(){var d;return Object(V.a)(this,u),d=f.apply(this,arguments),d.resizeObserver=null,d.childNode=null,d.currentElement=null,d.state={width:0,height:0,offsetHeight:0,offsetWidth:0},d.onResize=function(i){var o=d.props.onResize,O=i[0].target,w=O.getBoundingClientRect(),C=w.width,L=w.height,A=O.offsetWidth,_=O.offsetHeight,T=Math.floor(C),v=Math.floor(L);if(d.state.width!==T||d.state.height!==v||d.state.offsetWidth!==A||d.state.offsetHeight!==_){var c={width:T,height:v,offsetWidth:A,offsetHeight:_};d.setState(c),o&&Promise.resolve().then(function(){o(Object(ee.a)(Object(ee.a)({},c),{},{offsetWidth:A,offsetHeight:_}))})}},d.setChildNode=function(i){d.childNode=i},d}return Object(N.a)(u,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var i=this.props.disabled;if(i){this.destroyObserver();return}var o=Object(W.a)(this.childNode||this),O=o!==this.currentElement;O&&(this.destroyObserver(),this.currentElement=o),!this.resizeObserver&&o&&(this.resizeObserver=new g.default(this.onResize),this.resizeObserver.observe(o))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var i=this.props.children,o=Object(n.a)(i);if(o.length>1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(o.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var O=o[0];if(P.isValidElement(O)&&Object(y.c)(O)){var w=O.ref;o[0]=P.cloneElement(O,{ref:Object(y.a)(w,this.setChildNode)})}return o.length===1?o[0]:o.map(function(C,L){return!P.isValidElement(C)||"key"in C&&C.key!==null?C:P.cloneElement(C,{key:"".concat(p,"-").concat(L)})})}}]),u}(P.Component);l.displayName="ResizeObserver",Ee.a=l},t9D7:function(at,Ee,H){"use strict";H.d(Ee,"b",function(){return G}),H.d(Ee,"g",function(){return n}),H.d(Ee,"d",function(){return D}),H.d(Ee,"e",function(){return y}),H.d(Ee,"a",function(){return g}),H.d(Ee,"f",function(){return a}),H.d(Ee,"c",function(){return f});var ee=H("Vhoy"),V=H("MI8n"),N=H("pmY6"),$=H("Cg/j"),j=H("ic2d"),P=H("nEHx");const G=Object($.c)("themeService");var W;(function(u){function d(i){return i&&typeof i=="object"&&typeof i.id=="string"}u.isThemeColor=d})(W||(W={}));function n(u){return{id:u}}var D;(function(u){function d(L){return L&&typeof L=="object"&&typeof L.id=="string"&&(typeof L.color=="undefined"||W.isThemeColor(L.color))}u.isThemeIcon=d;const i=new RegExp(`^\\$\\((${ee.a.iconNameExpression}(?:${ee.a.iconModifierExpression})?)\\)$`);function o(L){const A=i.exec(L);if(!A)return;let[,_]=A;return{id:_}}u.fromString=o;function O(L,A){let _=L.id;const T=_.lastIndexOf("~");return T!==-1&&(_=_.substring(0,T)),A&&(_=`${_}~${A}`),{id:_}}u.modify=O;function w(L,A){var _,T;return L.id===A.id&&((_=L.color)===null||_===void 0?void 0:_.id)===((T=A.color)===null||T===void 0?void 0:T.id)}u.isEqual=w;function C(L,A){return{id:L.id,color:A?n(A):void 0}}u.asThemeIcon=C,u.asClassNameArray=ee.a.asClassNameArray,u.asClassName=ee.a.asClassName,u.asCSSSelector=ee.a.asCSSSelector})(D||(D={}));function y(u){switch(u){case P.a.DARK:return"vs-dark";case P.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const g={ThemingContribution:"base.contributions.theming"};class p{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new V.b}onColorThemeChange(u){return this.themingParticipants.push(u),this.onThemingParticipantAddedEmitter.fire(u),Object(N.i)(()=>{const d=this.themingParticipants.indexOf(u);this.themingParticipants.splice(d,1)})}getThemingParticipants(){return this.themingParticipants}}let l=new p;j.a.add(g.ThemingContribution,l);function a(u){return l.onColorThemeChange(u)}class f extends N.a{constructor(u){super();this.themeService=u,this.theme=u.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(d=>this.onThemeChange(d)))}onThemeChange(u){this.theme=u,this.updateStyles()}updateStyles(){}}},u2Z1:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return w});var ee=H("miYZ"),V=H("tsqr"),N=H("9og8"),$=H("5NDa"),j=H("5rEg"),P=H("2qtc"),G=H("kLXV"),W=H("oBTY"),n=H("tJVT"),D=H("OaEy"),y=H("2fM7"),g=H("WmNS"),p=H.n(g),l=H("q1tI"),a=H.n(l),f=H("ErOA"),u=H("i58Z"),d=H.n(u),i=H("T1X5"),o=H.n(i),O=y.a.Option,w=function(L){var A=L.subId,_=L.value,T=L.selectvalues,v=L.disabled,c=L.knowledgeOptions,E=c===void 0?[]:c,h=L.onChange,x=h===void 0?function(){}:h,U=L.onAddKnowledgeFinish,F=U===void 0?function(){}:U,S=Object(l.useRef)(),M=Object(l.useState)([]),I=Object(n.a)(M,2),b=I[0],K=I[1];_=_||[];var Q=function(we,Se){we?(K([Se.key]),x([Se.key])):(K([]),x([]))};Object(l.useEffect)(function(){(T==null?void 0:T.length)>0&&(K(Object(W.a)(T)),x(Object(W.a)(T)))},[E]),Object(l.useEffect)(function(){var fe;((fe=_)===null||fe===void 0?void 0:fe.length)>0&&x(Object(W.a)(_))},[E]);var ne=function(we){we.preventDefault(),S.current="",G.a.confirm({centered:!0,width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",icon:null,title:"\u65B0\u5EFA\u77E5\u8BC6\u70B9",className:"custom-modal-divider",content:a.a.createElement("div",{className:"font14"},a.a.createElement("div",{style:{display:"flex",marginTop:"48px",marginBottom:"36px"}},a.a.createElement("img",{src:o.a,style:{width:"108px",height:"108px",marginRight:"29px"}}),"\u60A8\u586B\u5199\u7684\u77E5\u8BC6\u70B9\u6682\u65F6\u4EC5\u5BF9\u672C\u4EBA\u53EF\u89C1\uFF0C\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u540E\u5C06\u5217\u5165\u516C\u5F00\u77E5\u8BC6\u70B9\uFF0C\u5BF9\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF1B",a.a.createElement("br",null),"\u5E73\u53F0\u5BA1\u6838\u8FC7\u7A0B\u4E2D\u6709\u6743\u5220\u9664\u4E0D\u5408\u9002\u7684\u77E5\u8BC6\u70B9\uFF08\u5305\u62EC\u4F46\u4E0D\u9650\u4E8E\u9519\u8BEF\u3001\u975E\u6CD5\u3001\u4E0D\u96C5\u3001\u4E0D\u5339\u914D\u5F53\u524D\u8BFE\u7A0B\u7B49\u60C5\u5F62\uFF09\uFF0C\u5220\u9664\u540E\u53EF\u80FD\u5F71\u54CD\u60A8\u7684\u8BD5\u9898\u7684\u6B63\u5E38\u4F7F\u7528\u3002",a.a.createElement("br",null),"\u8BF7\u8BA4\u771F\u586B\u5199\u4E0E\u6559\u5B66\u5185\u5BB9\u76F8\u5173\u7684\u771F\u5B9E\u77E5\u8BC6\u70B9 ",a.a.createElement("br",null)),a.a.createElement(j.a,{className:"mt5",maxLength:20,style:{marginBottom:"42px"},placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0",defaultValue:S.current,onChange:function(he){S.current=he.target.value}})),onOk:function(){return new Promise(function(){var he=Object(N.a)(p.a.mark(function se(me,re){var le,Z;return p.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:if(S.current){oe.next=3;break}return V.b.warn("\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0"),oe.abrupt("return",re());case 3:if(!(S.current.length>20)){oe.next=6;break}return V.b.warn("\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0"),oe.abrupt("return",re());case 6:return oe.next=8,Object(f.a)("/api/tag_disciplines.json",{method:"post",body:{name:S.current,sub_discipline_id:A}});case 8:return le=oe.sent,(le==null?void 0:le.status)===0&&(F({id:le.tag_discipline_id,name:S.current,type:"personal"}),Z=[],Z.push(le.tag_discipline_id),x([].concat(Z)),K([le.tag_discipline_id]),x([].concat(Z))),oe.abrupt("return",me());case 11:case"end":return oe.stop()}},se)}));return function(se,me){return he.apply(this,arguments)}}())}})};return a.a.createElement("div",{className:d.a.wrap},a.a.createElement(y.a,{disabled:!A||v,className:"mr5",style:{width:"242px"},onChange:Q,showSearch:!0,allowClear:!0,value:E==null?void 0:E.filter(function(fe){return(b==null?void 0:b.includes(fe==null?void 0:fe.id))||(b==null?void 0:b.includes((fe==null?void 0:fe.id)+""))}).map(function(fe){return fe.name})},E==null?void 0:E.map(function(fe){return a.a.createElement(O,{key:fe.id,value:fe.name},a.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},a.a.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},fe.name),a.a.createElement("span",null,fe.type==="personal"?"\uFF08\u81EA\u7528\uFF09":"")))})),a.a.createElement("button",{disabled:!A,className:"".concat(d.a.addKnowledge," ").concat(A?"":d.a.disabled),onClick:ne},"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))}},uK0f:function(at,Ee,H){(function(ee,V){at.exports=V()})(this,function(){"use strict";function ee(V,N,$){$=$||{},$.childrenKeyName=$.childrenKeyName||"children";var j=V||[],P=[],G=0;do{var W=j.filter(function(n){return N(n,G)})[0];if(!W)break;P.push(W),j=W[$.childrenKeyName]||[],G+=1}while(j.length>0);return P}return ee})},ulZh:function(at,Ee,H){typeof window!="undefined"&&function(V,N){at.exports=N()}(this,function(){return function(ee){var V={};function N($){if(V[$])return V[$].exports;var j=V[$]={i:$,l:!1,exports:{}};return ee[$].call(j.exports,j,j.exports,N),j.l=!0,j.exports}return N.m=ee,N.c=V,N.d=function($,j,P){N.o($,j)||Object.defineProperty($,j,{enumerable:!0,get:P})},N.r=function($){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty($,Symbol.toStringTag,{value:"Module"}),Object.defineProperty($,"__esModule",{value:!0})},N.t=function($,j){if(j&1&&($=N($)),j&8)return $;if(j&4&&typeof $=="object"&&$&&$.__esModule)return $;var P=Object.create(null);if(N.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:$}),j&2&&typeof $!="string")for(var G in $)N.d(P,G,function(W){return $[W]}.bind(null,G));return P},N.n=function($){var j=$&&$.__esModule?function(){return $.default}:function(){return $};return N.d(j,"a",j),j},N.o=function($,j){return Object.prototype.hasOwnProperty.call($,j)},N.p="/dist/",N(N.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ee,V,N){"use strict";var $=Object.prototype.hasOwnProperty,j="~";function P(){}Object.create&&(P.prototype=Object.create(null),new P().__proto__||(j=!1));function G(y,g,p){this.fn=y,this.context=g,this.once=p||!1}function W(y,g,p,l,a){if(typeof p!="function")throw new TypeError("The listener must be a function");var f=new G(p,l||y,a),u=j?j+g:g;return y._events[u]?y._events[u].fn?y._events[u]=[y._events[u],f]:y._events[u].push(f):(y._events[u]=f,y._eventsCount++),y}function n(y,g){--y._eventsCount===0?y._events=new P:delete y._events[g]}function D(){this._events=new P,this._eventsCount=0}D.prototype.eventNames=function(){var g=[],p,l;if(this._eventsCount===0)return g;for(l in p=this._events)$.call(p,l)&&g.push(j?l.slice(1):l);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(p)):g},D.prototype.listeners=function(g){var p=j?j+g:g,l=this._events[p];if(!l)return[];if(l.fn)return[l.fn];for(var a=0,f=l.length,u=new Array(f);a<f;a++)u[a]=l[a].fn;return u},D.prototype.listenerCount=function(g){var p=j?j+g:g,l=this._events[p];return l?l.fn?1:l.length:0},D.prototype.emit=function(g,p,l,a,f,u){var d=j?j+g:g;if(!this._events[d])return!1;var i=this._events[d],o=arguments.length,O,w;if(i.fn){i.once&&this.removeListener(g,i.fn,void 0,!0);switch(o){case 1:return i.fn.call(i.context),!0;case 2:return i.fn.call(i.context,p),!0;case 3:return i.fn.call(i.context,p,l),!0;case 4:return i.fn.call(i.context,p,l,a),!0;case 5:return i.fn.call(i.context,p,l,a,f),!0;case 6:return i.fn.call(i.context,p,l,a,f,u),!0}for(w=1,O=new Array(o-1);w<o;w++)O[w-1]=arguments[w];i.fn.apply(i.context,O)}else{var C=i.length,L;for(w=0;w<C;w++){i[w].once&&this.removeListener(g,i[w].fn,void 0,!0);switch(o){case 1:i[w].fn.call(i[w].context);break;case 2:i[w].fn.call(i[w].context,p);break;case 3:i[w].fn.call(i[w].context,p,l);break;case 4:i[w].fn.call(i[w].context,p,l,a);break;default:if(!O)for(L=1,O=new Array(o-1);L<o;L++)O[L-1]=arguments[L];i[w].fn.apply(i[w].context,O)}}}return!0},D.prototype.on=function(g,p,l){return W(this,g,p,l,!1)},D.prototype.once=function(g,p,l){return W(this,g,p,l,!0)},D.prototype.removeListener=function(g,p,l,a){var f=j?j+g:g;if(!this._events[f])return this;if(!p)return n(this,f),this;var u=this._events[f];if(u.fn)u.fn===p&&(!a||u.once)&&(!l||u.context===l)&&n(this,f);else{for(var d=0,i=[],o=u.length;d<o;d++)(u[d].fn!==p||a&&!u[d].once||l&&u[d].context!==l)&&i.push(u[d]);i.length?this._events[f]=i.length===1?i[0]:i:n(this,f)}return this},D.prototype.removeAllListeners=function(g){var p;return g?(p=j?j+g:g,this._events[p]&&n(this,p)):(this._events=new P,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=j,D.EventEmitter=D,ee.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(ee,V,N){(function($){var j=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,P=/^([^\/?#]*)([^]*)$/,G=/(?:\/|^)\.(?=\/)/g,W=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(D,y,g){if(g=g||{},D=D.trim(),y=y.trim(),!y){if(!g.alwaysNormalize)return D;var p=n.parseURL(D);if(!p)throw new Error("Error trying to parse base URL.");return p.path=n.normalizePath(p.path),n.buildURLFromParts(p)}var l=n.parseURL(y);if(!l)throw new Error("Error trying to parse relative URL.");if(l.scheme)return g.alwaysNormalize?(l.path=n.normalizePath(l.path),n.buildURLFromParts(l)):y;var a=n.parseURL(D);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var f=P.exec(a.path);a.netLoc=f[1],a.path=f[2]}a.netLoc&&!a.path&&(a.path="/");var u={scheme:a.scheme,netLoc:l.netLoc,path:null,params:l.params,query:l.query,fragment:l.fragment};if(!l.netLoc&&(u.netLoc=a.netLoc,l.path[0]!=="/"))if(!l.path)u.path=a.path,l.params||(u.params=a.params,l.query||(u.query=a.query));else{var d=a.path,i=d.substring(0,d.lastIndexOf("/")+1)+l.path;u.path=n.normalizePath(i)}return u.path===null&&(u.path=g.alwaysNormalize?n.normalizePath(l.path):l.path),n.buildURLFromParts(u)},parseURL:function(D){var y=j.exec(D);return y?{scheme:y[1]||"",netLoc:y[2]||"",path:y[3]||"",params:y[4]||"",query:y[5]||"",fragment:y[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace(G,"");D.length!==(D=D.replace(W,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};ee.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(ee,V,N){function $(g){var p={};function l(f){if(p[f])return p[f].exports;var u=p[f]={i:f,l:!1,exports:{}};return g[f].call(u.exports,u,u.exports,l),u.l=!0,u.exports}l.m=g,l.c=p,l.i=function(f){return f},l.d=function(f,u,d){l.o(f,u)||Object.defineProperty(f,u,{configurable:!1,enumerable:!0,get:d})},l.r=function(f){Object.defineProperty(f,"__esModule",{value:!0})},l.n=function(f){var u=f&&f.__esModule?function(){return f.default}:function(){return f};return l.d(u,"a",u),u},l.o=function(f,u){return Object.prototype.hasOwnProperty.call(f,u)},l.p="/",l.oe=function(f){throw console.error(f),f};var a=l(l.s=ENTRY_MODULE);return a.default||a}var j="[\\.|\\-|\\+|\\w|/|@]+",P="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+j+").*?\\)";function G(g){return(g+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function W(g){return!isNaN(1*g)}function n(g,p,l){var a={};a[l]=[];var f=p.toString(),u=f.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return a;for(var d=u[1],i=new RegExp("(\\\\n|\\W)"+G(d)+P,"g"),o;o=i.exec(f);){if(o[3]==="dll-reference")continue;a[l].push(o[3])}for(i=new RegExp("\\("+G(d)+'\\("(dll-reference\\s('+j+'))"\\)\\)'+P,"g");o=i.exec(f);)g[o[2]]||(a[l].push(o[1]),g[o[2]]=N(o[1]).m),a[o[2]]=a[o[2]]||[],a[o[2]].push(o[4]);for(var O=Object.keys(a),w=0;w<O.length;w++)for(var C=0;C<a[O[w]].length;C++)W(a[O[w]][C])&&(a[O[w]][C]=1*a[O[w]][C]);return a}function D(g){var p=Object.keys(g);return p.reduce(function(l,a){return l||g[a].length>0},!1)}function y(g,p){for(var l={main:[p]},a={main:[]},f={main:{}};D(l);)for(var u=Object.keys(l),d=0;d<u.length;d++){var i=u[d],o=l[i],O=o.pop();if(f[i]=f[i]||{},f[i][O]||!g[i][O])continue;f[i][O]=!0,a[i]=a[i]||[],a[i].push(O);for(var w=n(g,g[i][O],i),C=Object.keys(w),L=0;L<C.length;L++)l[C[L]]=l[C[L]]||[],l[C[L]]=l[C[L]].concat(w[C[L]])}return a}ee.exports=function(g,p){p=p||{};var l={main:N.m},a=p.all?{main:Object.keys(l.main)}:y(l,g),f="";Object.keys(a).filter(function(O){return O!=="main"}).forEach(function(O){for(var w=0;a[O][w];)w++;a[O].push(w),l[O][w]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",f=f+"var "+O+" = ("+$.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+a[O].map(function(C){return""+JSON.stringify(C)+": "+l[O][C].toString()}).join(",")+`});
`}),f=f+"new (("+$.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+a.main.map(function(O){return""+JSON.stringify(O)+": "+l.main[O].toString()}).join(",")+"}))(self);";var u=new window.Blob([f],{type:"text/javascript"});if(p.bare)return u;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,i=d.createObjectURL(u),o=new window.Worker(i);return o.objectURL=i,o}},"./src/config.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"hlsDefaultConfig",function(){return L}),N.d(V,"mergeConfig",function(){return _}),N.d(V,"enableStreamingMode",function(){return T});var $=N("./src/controller/abr-controller.ts"),j=N("./src/controller/audio-stream-controller.ts"),P=N("./src/controller/audio-track-controller.ts"),G=N("./src/controller/subtitle-stream-controller.ts"),W=N("./src/controller/subtitle-track-controller.ts"),n=N("./src/controller/buffer-controller.ts"),D=N("./src/controller/timeline-controller.ts"),y=N("./src/controller/cap-level-controller.ts"),g=N("./src/controller/fps-controller.ts"),p=N("./src/controller/eme-controller.ts"),l=N("./src/controller/cmcd-controller.ts"),a=N("./src/utils/xhr-loader.ts"),f=N("./src/utils/fetch-loader.ts"),u=N("./src/utils/cues.ts"),d=N("./src/utils/mediakeys-helper.ts"),i=N("./src/utils/logger.ts");function o(){return o=Object.assign||function(v){for(var c=1;c<arguments.length;c++){var E=arguments[c];for(var h in E)Object.prototype.hasOwnProperty.call(E,h)&&(v[h]=E[h])}return v},o.apply(this,arguments)}function O(v,c){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(v);c&&(h=h.filter(function(x){return Object.getOwnPropertyDescriptor(v,x).enumerable})),E.push.apply(E,h)}return E}function w(v){for(var c=1;c<arguments.length;c++){var E=arguments[c]!=null?arguments[c]:{};c%2?O(Object(E),!0).forEach(function(h){C(v,h,E[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):O(Object(E)).forEach(function(h){Object.defineProperty(v,h,Object.getOwnPropertyDescriptor(E,h))})}return v}function C(v,c,E){return c in v?Object.defineProperty(v,c,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[c]=E,v}var L=w(w({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:a.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:$.default,bufferController:n.default,capLevelController:y.default,fpsController:g.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:d.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},A()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:W.default,timelineController:D.TimelineController,audioStreamController:j.default,audioTrackController:P.default,emeController:p.default,cmcdController:l.default});function A(){return{cueHandler:u.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 _(v,c){if((c.liveSyncDurationCount||c.liveMaxLatencyDurationCount)&&(c.liveSyncDuration||c.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(c.liveMaxLatencyDurationCount!==void 0&&(c.liveSyncDurationCount===void 0||c.liveMaxLatencyDurationCount<=c.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(c.liveMaxLatencyDuration!==void 0&&(c.liveSyncDuration===void 0||c.liveMaxLatencyDuration<=c.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return o({},v,c)}function T(v){var c=v.loader;if(c!==f.default&&c!==a.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),v.progressive=!1;else{var E=Object(f.fetchSupported)();E&&(v.loader=f.default,v.progressive=!0,v.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/polyfills/number.ts"),j=N("./src/utils/ewma-bandwidth-estimator.ts"),P=N("./src/events.ts"),G=N("./src/utils/buffer-helper.ts"),W=N("./src/errors.ts"),n=N("./src/types/loader.ts"),D=N("./src/utils/logger.ts");function y(l,a){for(var f=0;f<a.length;f++){var u=a[f];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(l,u.key,u)}}function g(l,a,f){return a&&y(l.prototype,a),f&&y(l,f),l}var p=function(){function l(f){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=f;var u=f.config;this.bwEstimator=new j.default(u.abrEwmaSlowVoD,u.abrEwmaFastVoD,u.abrEwmaDefaultEstimate),this.registerListeners()}var a=l.prototype;return a.registerListeners=function(){var u=this.hls;u.on(P.Events.FRAG_LOADING,this.onFragLoading,this),u.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(P.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var u=this.hls;u.off(P.Events.FRAG_LOADING,this.onFragLoading,this),u.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(P.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},a.onFragLoading=function(u,d){var i=d.frag;if(i.type===n.PlaylistLevelType.MAIN&&!this.timer){var o;this.fragCurrent=i,this.partCurrent=(o=d.part)!=null?o:null,this.timer=self.setInterval(this.onCheck,100)}},a.onLevelLoaded=function(u,d){var i=this.hls.config;d.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},a._abandonRulesCheck=function(){var u=this.fragCurrent,d=this.partCurrent,i=this.hls,o=i.autoLevelEnabled,O=i.config,w=i.media;if(!u||!w)return;var C=d?d.stats:u.stats,L=d?d.duration:u.duration;if(C.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!o||w.paused||!w.playbackRate||!w.readyState)return;var A=performance.now()-C.loading.start,_=Math.abs(w.playbackRate);if(A<=500*L/_)return;var T=i.levels,v=i.minAutoLevel,c=T[u.level],E=C.total||Math.max(C.loaded,Math.round(L*c.maxBitrate/8)),h=Math.max(1,C.bwEstimate?C.bwEstimate/8:C.loaded*1e3/A),x=(E-C.loaded)/h,U=w.currentTime,F=(G.BufferHelper.bufferInfo(w,U,O.maxBufferHole).end-U)/_;if(F>=2*L/_||x<=F)return;var S=Number.POSITIVE_INFINITY,M;for(M=u.level-1;M>v;M--){var I=T[M].maxBitrate;if(S=L*I/(8*.8*h),S<F)break}if(S>=x)return;var b=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+u.sn+(d?" part "+d.index:"")+" of level "+u.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+M+`
Current BW estimate: `+(Object($.isFiniteNumber)(b)?(b/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+x.toFixed(3)+` s
Estimated load time for the next fragment: `+S.toFixed(3)+` s
Time to underbuffer: `+F.toFixed(3)+" s"),i.nextLoadLevel=M,this.bwEstimator.sample(A,C.loaded),this.clearTimer(),u.loader&&(this.fragCurrent=this.partCurrent=null,u.loader.abort()),i.trigger(P.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:u,part:d,stats:C})},a.onFragLoaded=function(u,d){var i=d.frag,o=d.part;if(i.type===n.PlaylistLevelType.MAIN&&Object($.isFiniteNumber)(i.sn)){var O=o?o.stats:i.stats,w=o?o.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var C=this.hls.levels[i.level],L=(C.loaded?C.loaded.bytes:0)+O.loaded,A=(C.loaded?C.loaded.duration:0)+w;C.loaded={bytes:L,duration:A},C.realBitrate=Math.round(8*L/A)}if(i.bitrateTest){var _={stats:O,frag:i,part:o,id:i.type};this.onFragBuffered(P.Events.FRAG_BUFFERED,_),i.bitrateTest=!1}}},a.onFragBuffered=function(u,d){var i=d.frag,o=d.part,O=o?o.stats:i.stats;if(O.aborted)return;if(i.type!==n.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var w=O.parsing.end-O.loading.start;this.bwEstimator.sample(w,O.loaded),O.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=w/1e3:this.bitrateTestDelay=0},a.onError=function(u,d){switch(d.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var u=this.fragCurrent,d=this.partCurrent,i=this.hls,o=i.maxAutoLevel,O=i.config,w=i.minAutoLevel,C=i.media,L=d?d.duration:u?u.duration:0,A=C?C.currentTime:0,_=C&&C.playbackRate!==0?Math.abs(C.playbackRate):1,T=this.bwEstimator?this.bwEstimator.getEstimate():O.abrEwmaDefaultEstimate,v=(G.BufferHelper.bufferInfo(C,A,O.maxBufferHole).end-A)/_,c=this.findBestLevel(T,w,o,v,O.abrBandWidthFactor,O.abrBandWidthUpFactor);if(c>=0)return c;D.logger.trace((v?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=L?Math.min(L,O.maxStarvationDelay):O.maxStarvationDelay,h=O.abrBandWidthFactor,x=O.abrBandWidthUpFactor;if(!v){var U=this.bitrateTestDelay;if(U){var F=L?Math.min(L,O.maxLoadingDelay):O.maxLoadingDelay;E=F-U,D.logger.trace("bitrate test took "+Math.round(1e3*U)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),h=x=1}}return c=this.findBestLevel(T,w,o,v+E,h,x),Math.max(c,0)},a.findBestLevel=function(u,d,i,o,O,w){for(var C,L=this.fragCurrent,A=this.partCurrent,_=this.lastLoadedFragLevel,T=this.hls.levels,v=T[_],c=!!(v!=null&&(C=v.details)!==null&&C!==void 0&&C.live),E=v==null?void 0:v.codecSet,h=A?A.duration:L?L.duration:0,x=i;x>=d;x--){var U=T[x];if(!U||E&&U.codecSet!==E)continue;var F=U.details,S=(A?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||h,M=void 0;x<=_?M=O*u:M=w*u;var I=T[x].maxBitrate,b=I*S/M;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+x+"/"+Math.round(M)+"/"+I+"/"+S+"/"+o+"/"+b),M>I&&(!b||c&&!this.bitrateTestDelay||b<o))return x}return-1},g(l,[{key:"nextAutoLevel",get:function(){var u=this._nextAutoLevel,d=this.bwEstimator;if(u!==-1&&(!d||!d.canEstimate()))return u;var i=this.getNextABRAutoLevel();return u!==-1&&(i=Math.min(u,i)),i},set:function(u){this._nextAutoLevel=u}}]),l}();V.default=p},"./src/controller/audio-stream-controller.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/polyfills/number.ts"),j=N("./src/controller/base-stream-controller.ts"),P=N("./src/events.ts"),G=N("./src/utils/buffer-helper.ts"),W=N("./src/controller/fragment-tracker.ts"),n=N("./src/types/level.ts"),D=N("./src/types/loader.ts"),y=N("./src/loader/fragment.ts"),g=N("./src/demux/chunk-cache.ts"),p=N("./src/demux/transmuxer-interface.ts"),l=N("./src/types/transmuxer.ts"),a=N("./src/controller/fragment-finders.ts"),f=N("./src/utils/discontinuities.ts"),u=N("./src/errors.ts"),d=N("./src/utils/logger.ts");function i(){return i=Object.assign||function(L){for(var A=1;A<arguments.length;A++){var _=arguments[A];for(var T in _)Object.prototype.hasOwnProperty.call(_,T)&&(L[T]=_[T])}return L},i.apply(this,arguments)}function o(L,A){L.prototype=Object.create(A.prototype),L.prototype.constructor=L,O(L,A)}function O(L,A){return O=Object.setPrototypeOf||function(T,v){return T.__proto__=v,T},O(L,A)}var w=100,C=function(L){o(A,L);function A(T,v){var c;return c=L.call(this,T,v,"[audio-stream-controller]")||this,c.videoBuffer=null,c.videoTrackCC=-1,c.waitingVideoCC=-1,c.audioSwitch=!1,c.trackId=-1,c.waitingData=null,c.mainDetails=null,c.bufferFlushed=!1,c._registerListeners(),c}var _=A.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var v=this.hls;v.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.on(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),v.on(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.on(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),v.on(P.Events.ERROR,this.onError,this),v.on(P.Events.BUFFER_RESET,this.onBufferReset,this),v.on(P.Events.BUFFER_CREATED,this.onBufferCreated,this),v.on(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),v.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var v=this.hls;v.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.off(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),v.off(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.off(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),v.off(P.Events.ERROR,this.onError,this),v.off(P.Events.BUFFER_RESET,this.onBufferReset,this),v.off(P.Events.BUFFER_CREATED,this.onBufferCreated,this),v.off(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),v.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onInitPtsFound=function(v,c){var E=c.frag,h=c.id,x=c.initPTS;if(h==="main"){var U=E.cc;this.initPTS[E.cc]=x,this.log("InitPTS for cc: "+U+" found from main: "+x),this.videoTrackCC=U,this.state===j.State.WAITING_INIT_PTS&&this.tick()}},_.startLoad=function(v){if(!this.levels){this.startPosition=v,this.state=j.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(w),this.fragLoadError=0,c>0&&v===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=j.State.IDLE):(this.loadedmetadata=!1,this.state=j.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=v,this.tick()},_.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_TRACK:{var v,c=this.levels,E=this.trackId,h=c==null||((v=c[E])===null||v===void 0)?void 0:v.details;if(h){if(this.waitForCdnTuneIn(h))break;this.state=j.State.WAITING_INIT_PTS}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var x,U=performance.now(),F=this.retryDate;(!F||U>=F||(x=this.media)!==null&&x!==void 0&&x.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=j.State.IDLE);break}case j.State.WAITING_INIT_PTS:{var S=this.waitingData;if(S){var M=S.frag,I=S.part,b=S.cache,K=S.complete;if(this.initPTS[M.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.FRAG_LOADING;var Q=b.flush(),ne={frag:M,part:I,payload:Q,networkDetails:null};this._handleFragmentLoadProgress(ne),K&&L.prototype._handleFragmentLoadComplete.call(this,ne)}else if(this.videoTrackCC!==this.waitingVideoCC)d.logger.log("Waiting fragment cc ("+M.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var fe=this.getLoadPosition(),we=G.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),Se=Object(a.fragmentWithinToleranceTest)(we.end,this.config.maxFragLookUpTolerance,M);Se<0&&(d.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()},_.clearWaitingFragment=function(){var v=this.waitingData;v&&(this.fragmentTracker.removeFragment(v.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.IDLE)},_.onTickEnd=function(){var v=this.media;if(!v||!v.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:v,E=c.buffered;!this.loadedmetadata&&E.length&&(this.loadedmetadata=!0),this.lastCurrentTime=v.currentTime},_.doTickIdle=function(){var v,c,E=this.hls,h=this.levels,x=this.media,U=this.trackId,F=E.config;if(!h||!h[U])return;if(!x&&(this.startFragRequested||!F.startFragPrefetch))return;var S=h[U],M=S.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,y.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(I===null)return;var b=I.len,K=this.getMaxBufferLength(),Q=this.audioSwitch;if(b>=K&&!Q)return;if(!Q&&this._streamEnded(I,M)){E.trigger(P.Events.BUFFER_EOS,{type:"audio"}),this.state=j.State.ENDED;return}var ne=M.fragments,fe=ne[0].start,we=I.end;if(Q){var Se=this.getLoadPosition();we=Se,M.PTSKnown&&Se<fe&&((I.end>fe||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),x.currentTime=fe+.05))}var he=this.getNextFragment(we,M);if(!he){this.bufferFlushed=!0;return}((v=he.decryptdata)===null||v===void 0?void 0:v.keyFormat)==="identity"&&!((c=he.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(he,M):this.loadFragment(he,M,we)},_.getMaxBufferLength=function(){var v=L.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return c===null?v:Math.max(v,c.len)},_.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},_.onAudioTracksUpdated=function(v,c){var E=c.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(h){return new n.Level(h)})},_.onAudioTrackSwitching=function(v,c){var E=!!c.url;this.trackId=c.id;var h=this.fragCurrent;h!=null&&h.loader&&h.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),E?this.setInterval(w):this.resetTransmuxer(),E?(this.audioSwitch=!0,this.state=j.State.IDLE):this.state=j.State.STOPPED,this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},_.onLevelLoaded=function(v,c){this.mainDetails=c.details},_.onAudioTrackLoaded=function(v,c){var E,h=this.levels,x=c.details,U=c.id;if(!h){this.warn("Audio tracks were reset while loading level "+U);return}this.log("Track "+U+" loaded ["+x.startSN+","+x.endSN+"],duration:"+x.totalduration);var F=h[U],S=0;if(x.live||(E=F.details)!==null&&E!==void 0&&E.live){var M=this.mainDetails;if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed||!M)return;!F.details&&x.hasProgramDateTime&&M.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(x,M),S=x.fragments[0].start):S=this.alignPlaylists(x,F.details)}F.details=x,this.levelLastLoaded=U,!this.startFragRequested&&(this.mainDetails||!x.live)&&this.setStartPosition(F.details,S),this.state===j.State.WAITING_TRACK&&!this.waitForCdnTuneIn(x)&&(this.state=j.State.IDLE),this.tick()},_._handleFragmentLoadProgress=function(v){var c,E=v.frag,h=v.part,x=v.payload,U=this.config,F=this.trackId,S=this.levels;if(!S){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var M=S[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 b=U.defaultAudioCodec||M.audioCodec||"mp4a.40.2",K=this.transmuxer;K||(K=this.transmuxer=new p.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Q=this.initPTS[E.cc],ne=(c=E.initSegment)===null||c===void 0?void 0:c.data;if(Q!==void 0){var fe=!1,we=h?h.index:-1,Se=we!==-1,he=new l.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,x.byteLength,we,Se);K.push(x,ne,b,"",E,h,I.totalduration,fe,he,Q)}else{d.logger.log("Unknown video PTS for cc "+E.cc+", waiting for video PTS before demuxing audio frag "+E.sn+" of ["+I.startSN+" ,"+I.endSN+"],track "+F);var se=this.waitingData=this.waitingData||{frag:E,part:h,cache:new g.default,complete:!1},me=se.cache;me.push(new Uint8Array(x)),this.waitingVideoCC=this.videoTrackCC,this.state=j.State.WAITING_INIT_PTS}},_._handleFragmentLoadComplete=function(v){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,v)},_.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},_.onBufferCreated=function(v,c){var E=c.tracks.audio;E&&(this.mediaBuffer=E.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},_.onFragBuffered=function(v,c){var E=c.frag,h=c.part;if(E.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(h?" p: "+h.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}E.sn!=="initSegment"&&(this.fragPrevious=E,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(E,h)},_.onError=function(v,c){switch(c.details){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:case u.ErrorDetails.KEY_LOAD_ERROR:case u.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,c);break;case u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case u.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==j.State.ERROR&&this.state!==j.State.STOPPED&&(this.state=c.fatal?j.State.ERROR:j.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case u.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var E=!0,h=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);h&&h.len>.5&&(E=!this.reduceMaxBufferLength(h.len)),E&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},_.onBufferFlushed=function(v,c){var E=c.type;E===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},_._handleTransmuxComplete=function(v){var c,E="audio",h=this.hls,x=v.remuxResult,U=v.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 S=F.frag,M=F.part,I=x.audio,b=x.text,K=x.id3,Q=x.initSegment;if(this.fragContextChanged(S))return;if(this.state=j.State.PARSING,this.audioSwitch&&I&&this.completeAudioSwitch(),Q!=null&&Q.tracks&&(this._bufferInitSegment(Q.tracks,S,U),h.trigger(P.Events.FRAG_PARSING_INIT_SEGMENT,{frag:S,id:E,tracks:Q.tracks})),I){var ne=I.startPTS,fe=I.endPTS,we=I.startDTS,Se=I.endDTS;M&&(M.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:ne,endPTS:fe,startDTS:we,endDTS:Se}),S.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,ne,fe,we,Se),this.bufferFragmentData(I,S,M,U)}if(K!=null&&(c=K.samples)!==null&&c!==void 0&&c.length){var he=i({frag:S,id:E},K);h.trigger(P.Events.FRAG_PARSING_METADATA,he)}if(b){var se=i({frag:S,id:E},b);h.trigger(P.Events.FRAG_PARSING_USERDATA,se)}},_._bufferInitSegment=function(v,c,E){if(this.state!==j.State.PARSING)return;v.video&&delete v.video;var h=v.audio;if(!h)return;h.levelCodec=h.codec,h.id="audio",this.log("Init audio buffer, container:"+h.container+", codecs[parsed]=["+h.codec+"]"),this.hls.trigger(P.Events.BUFFER_CODECS,v);var x=h.initSegment;if(x!=null&&x.byteLength){var U={type:"audio",frag:c,part:null,chunkMeta:E,parent:c.type,data:x};this.hls.trigger(P.Events.BUFFER_APPENDING,U)}this.tick()},_.loadFragment=function(v,c,E){var h=this.fragmentTracker.getState(v);this.fragCurrent=v,(this.audioSwitch||h===W.FragmentState.NOT_LOADED||h===W.FragmentState.PARTIAL)&&(v.sn==="initSegment"?this._loadInitSegment(v):c.live&&!Object($.isFiniteNumber)(this.initPTS[v.cc])?(this.log("Waiting for video PTS in continuity counter "+v.cc+" of live stream before loading audio fragment "+v.sn+" of level "+this.trackId),this.state=j.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,v,c,E)))},_.completeAudioSwitch=function(){var v=this.hls,c=this.media,E=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,v.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:E})},A}(j.default);V.default=C},"./src/controller/audio-track-controller.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/events.ts"),j=N("./src/errors.ts"),P=N("./src/controller/base-playlist-controller.ts"),G=N("./src/types/loader.ts");function W(p,l){for(var a=0;a<l.length;a++){var f=l[a];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(p,f.key,f)}}function n(p,l,a){return l&&W(p.prototype,l),a&&W(p,a),p}function D(p,l){p.prototype=Object.create(l.prototype),p.prototype.constructor=p,y(p,l)}function y(p,l){return y=Object.setPrototypeOf||function(f,u){return f.__proto__=u,f},y(p,l)}var g=function(p){D(l,p);function l(f){var u;return u=p.call(this,f,"[audio-track-controller]")||this,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.trackName="",u.selectDefaultTrack=!0,u.registerListeners(),u}var a=l.prototype;return a.registerListeners=function(){var u=this.hls;u.on($.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on($.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on($.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on($.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var u=this.hls;u.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off($.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off($.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off($.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},a.onManifestParsed=function(u,d){this.tracks=d.audioTracks||[]},a.onAudioTrackLoaded=function(u,d){var i=d.id,o=d.details,O=this.tracksInGroup[i];if(!O){this.warn("Invalid audio track id "+i);return}var w=O.details;O.details=d.details,this.log("audioTrack "+i+" loaded ["+o.startSN+"-"+o.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,d,w))},a.onLevelLoading=function(u,d){this.switchLevel(d.level)},a.onLevelSwitching=function(u,d){this.switchLevel(d.level)},a.switchLevel=function(u){var d=this.hls.levels[u];if(!(d!=null&&d.audioGroupIds))return;var i=d.audioGroupIds[d.urlId];if(this.groupId!==i){this.groupId=i;var o=this.tracks.filter(function(w){return!i||w.groupId===i});this.selectDefaultTrack&&!o.some(function(w){return w.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=o;var O={audioTracks:o};this.log("Updating audio tracks, "+o.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger($.Events.AUDIO_TRACKS_UPDATED,O),this.selectInitialTrack()}},a.onError=function(u,d){if(p.prototype.onError.call(this,u,d),d.fatal||!d.context)return;d.context.type===G.PlaylistContextType.AUDIO_TRACK&&d.context.id===this.trackId&&d.context.groupId===this.groupId&&this.retryLoadingOrFail(d)},a.setAudioTrack=function(u){var d=this.tracksInGroup;if(u<0||u>=d.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var i=d[this.trackId];this.log("Now switching to audio-track index "+u);var o=d[u],O=o.id,w=o.groupId,C=w===void 0?"":w,L=o.name,A=o.type,_=o.url;if(this.trackId=u,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger($.Events.AUDIO_TRACK_SWITCHING,{id:O,groupId:C,name:L,type:A,url:_}),o.details&&!o.details.live)return;var T=this.switchParams(o.url,i==null?void 0:i.details);this.loadPlaylist(T)},a.selectInitialTrack=function(){var u=this.tracksInGroup;console.assert(u.length,"Initial audio track should be selected when tracks are known");var d=this.trackName,i=this.findTrackId(d)||this.findTrackId();i!==-1?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger($.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(u){for(var d=this.tracksInGroup,i=0;i<d.length;i++){var o=d[i];if((!this.selectDefaultTrack||o.default)&&(!u||u===o.name))return o.id}return-1},a.loadPlaylist=function(u){var d=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(d)){var i=d.id,o=d.groupId,O=d.url;if(u)try{O=u.addDirectives(O)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger($.Events.AUDIO_TRACK_LOADING,{url:O,id:i,groupId:o,deliveryDirectives:u||null})}},n(l,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1,this.setAudioTrack(u)}}]),l}(P.default);V.default=g},"./src/controller/base-playlist-controller.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return n});var $=N("./src/polyfills/number.ts"),j=N("./src/types/level.ts"),P=N("./src/controller/level-helper.ts"),G=N("./src/utils/logger.ts"),W=N("./src/errors.ts"),n=function(){function D(g,p){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=G.logger.log.bind(G.logger,p+":"),this.warn=G.logger.warn.bind(G.logger,p+":"),this.hls=g}var y=D.prototype;return y.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},y.onError=function(p,l){l.fatal&&l.type===W.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},y.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},y.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},y.stopLoad=function(){this.canLoad=!1,this.clearTimer()},y.switchParams=function(p,l){var a=l==null?void 0:l.renditionReports;if(a)for(var f=0;f<a.length;f++){var u=a[f],d=""+u.URI;if(d===p.substr(-d.length)){var i=parseInt(u["LAST-MSN"]),o=parseInt(u["LAST-PART"]);if(l&&this.hls.config.lowLatencyMode){var O=Math.min(l.age-l.partTarget,l.targetduration);o!==void 0&&O>l.partTarget&&(o+=1)}if(Object($.isFiniteNumber)(i))return new j.HlsUrlParameters(i,Object($.isFiniteNumber)(o)?o:void 0,j.HlsSkip.No)}}},y.loadPlaylist=function(p){},y.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},y.playlistLoaded=function(p,l,a){var f=this,u=l.details,d=l.stats,i=d.loading.end?Math.max(0,self.performance.now()-d.loading.end):0;if(u.advancedDateTime=Date.now()-i,u.live||a!=null&&a.live){if(u.reloaded(a),a&&this.log("live playlist "+p+" "+(u.advanced?"REFRESHED "+u.lastPartSn+"-"+u.lastPartIndex:"MISSED")),a&&u.fragments.length>0&&Object(P.mergeDetails)(a,u),!this.canLoad||!u.live)return;var o,O=void 0,w=void 0;if(u.canBlockReload&&u.endSN&&u.advanced){var C=this.hls.config.lowLatencyMode,L=u.lastPartSn,A=u.endSN,_=u.lastPartIndex,T=_!==-1,v=L===A,c=C?0:_;T?(O=v?A+1:L,w=v?c:_+1):O=A+1;var E=u.age,h=E+u.ageHeader,x=Math.min(h-u.partTarget,u.targetduration*1.5);if(x>0){if(a&&x>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+x+" with playlist age: "+u.age),x=0;else{var U=Math.floor(x/u.targetduration);if(O+=U,w!==void 0){var F=Math.round(x%u.targetduration/u.partTarget);w+=F}this.log("CDN Tune-in age: "+u.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+x+" skip sn "+U+" to part "+w)}u.tuneInGoal=x}if(o=this.getDeliveryDirectives(u,l.deliveryDirectives,O,w),C||!v){this.loadPlaylist(o);return}}else o=this.getDeliveryDirectives(u,l.deliveryDirectives,O,w);var S=Object(P.computeReloadInterval)(u,d);O!==void 0&&u.canBlockReload&&(S-=u.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(S)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(o)},S)}else this.clearTimer()},y.getDeliveryDirectives=function(p,l,a,f){var u=Object(j.getSkipValue)(p,a);return l!=null&&l.skip&&p.deltaUpdateFailed&&(a=l.msn,f=l.part,u=j.HlsSkip.No),new j.HlsUrlParameters(a,f,u)},y.retryLoadingOrFail=function(p){var l=this,a=this.hls.config,f=this.retryCount<a.levelLoadingMaxRetry;if(f){var u;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(u=p.context)!==null&&u!==void 0&&u.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var d=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return l.loadPlaylist()},d),this.warn("retry playlist loading #"+this.retryCount+" in "+d+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return f},D}()},"./src/controller/base-stream-controller.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"State",function(){return A}),N.d(V,"default",function(){return _});var $=N("./src/polyfills/number.ts"),j=N("./src/task-loop.ts"),P=N("./src/controller/fragment-tracker.ts"),G=N("./src/utils/buffer-helper.ts"),W=N("./src/utils/logger.ts"),n=N("./src/events.ts"),D=N("./src/errors.ts"),y=N("./src/types/transmuxer.ts"),g=N("./src/utils/mp4-tools.ts"),p=N("./src/utils/discontinuities.ts"),l=N("./src/controller/fragment-finders.ts"),a=N("./src/controller/level-helper.ts"),f=N("./src/loader/fragment-loader.ts"),u=N("./src/crypt/decrypter.ts"),d=N("./src/utils/time-ranges.ts"),i=N("./src/types/loader.ts");function o(T,v){for(var c=0;c<v.length;c++){var E=v[c];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(T,E.key,E)}}function O(T,v,c){return v&&o(T.prototype,v),c&&o(T,c),T}function w(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function C(T,v){T.prototype=Object.create(v.prototype),T.prototype.constructor=T,L(T,v)}function L(T,v){return L=Object.setPrototypeOf||function(E,h){return E.__proto__=h,E},L(T,v)}var A={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"},_=function(T){C(v,T);function v(E,h,x){var U;return U=T.call(this)||this,U.hls=void 0,U.fragPrevious=null,U.fragCurrent=null,U.fragmentTracker=void 0,U.transmuxer=null,U._state=A.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=x,U.log=W.logger.log.bind(W.logger,x+":"),U.warn=W.logger.warn.bind(W.logger,x+":"),U.hls=E,U.fragmentLoader=new f.default(E.config),U.fragmentTracker=h,U.config=E.config,U.decrypter=new u.default(E,E.config),E.on(n.Events.KEY_LOADED,U.onKeyLoaded,w(U)),U}var c=v.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(h){},c.stopLoad=function(){this.fragmentLoader.abort();var h=this.fragCurrent;h&&this.fragmentTracker.removeFragment(h),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=A.STOPPED},c._streamEnded=function(h,x){var U=this.fragCurrent,F=this.fragmentTracker;if(!x.live&&U&&U.sn===x.endSN&&!h.nextStart){var S=F.getState(U);return S===P.FragmentState.PARTIAL||S===P.FragmentState.OK}return!1},c.onMediaAttached=function(h,x){var U=this.media=this.mediaBuffer=x.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===A.STOPPED&&this.startLoad(F.startPosition)},c.onMediaDetaching=function(){var h=this.media;h!=null&&h.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),h&&(h.removeEventListener("seeking",this.onvseeking),h.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},c.onMediaSeeking=function(){var h=this.config,x=this.fragCurrent,U=this.media,F=this.mediaBuffer,S=this.state,M=U?U.currentTime:0,I=G.BufferHelper.bufferInfo(F||U,M,h.maxBufferHole);if(this.log("media seeking to "+(Object($.isFiniteNumber)(M)?M.toFixed(3):M)+", state: "+S),S===A.ENDED)this.resetLoadingState();else if(x&&!I.len){var b=h.maxFragLookUpTolerance,K=x.start-b,Q=x.start+x.duration+b,ne=M>Q;(M<K||ne)&&(ne&&x.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),x.loader.abort()),this.resetLoadingState())}U&&(this.lastCurrentTime=M),!this.loadedmetadata&&!I.len&&(this.nextLoadPosition=this.startPosition=M),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(h,x){if(this.state!==A.KEY_LOADING||x.frag!==this.fragCurrent||!this.levels)return;this.state=A.IDLE;var U=this.levels[x.frag.level].details;U&&this.loadFragment(x.frag,U,x.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),T.prototype.onHandlerDestroying.call(this)},c.onHandlerDestroyed=function(){this.state=A.STOPPED,this.hls.off(n.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,T.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(h,x){this.log("Loading key for "+h.sn+" of ["+x.startSN+"-"+x.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+h.level),this.state=A.KEY_LOADING,this.fragCurrent=h,this.hls.trigger(n.Events.KEY_LOADING,{frag:h})},c.loadFragment=function(h,x,U){this._loadFragForPlayback(h,x,U)},c._loadFragForPlayback=function(h,x,U){var F=this,S=function(I){if(F.fragContextChanged(h)){F.warn("Fragment "+h.sn+(I.part?" p: "+I.part.index:"")+" of level "+h.level+" was dropped during download."),F.fragmentTracker.removeFragment(h);return}h.stats.chunkCount++,F._handleFragmentLoadProgress(I)};this._doFragLoad(h,x,U,S).then(function(M){if(!M)return;F.fragLoadError=0;var I=F.state;if(F.fragContextChanged(h)){(I===A.FRAG_LOADING||I===A.BACKTRACKING||!F.fragCurrent&&I===A.PARSING)&&(F.fragmentTracker.removeFragment(h),F.state=A.IDLE);return}if("payload"in M&&(F.log("Loaded fragment "+h.sn+" of level "+h.level),F.hls.trigger(n.Events.FRAG_LOADED,M),F.state===A.BACKTRACKING)){F.fragmentTracker.backtrack(h,M),F.resetFragmentLoading(h);return}F._handleFragmentLoadComplete(M)}).catch(function(M){F.warn(M),F.resetFragmentLoading(h)})},c.flushMainBuffer=function(h,x,U){if(U===void 0&&(U=null),!(h-x))return;var F={startOffset:h,endOffset:x,type:U};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,F)},c._loadInitSegment=function(h){var x=this;this._doFragLoad(h).then(function(U){if(!U||x.fragContextChanged(h)||!x.levels)throw new Error("init load aborted");return U}).then(function(U){var F=x.hls,S=U.payload,M=h.decryptdata;if(S&&S.byteLength>0&&M&&M.key&&M.iv&&M.method==="AES-128"){var I=self.performance.now();return x.decrypter.webCryptoDecrypt(new Uint8Array(S),M.key.buffer,M.iv.buffer).then(function(b){var K=self.performance.now();return F.trigger(n.Events.FRAG_DECRYPTED,{frag:h,payload:b,stats:{tstart:I,tdecrypt:K}}),U.payload=b,U})}return U}).then(function(U){var F=x.fragCurrent,S=x.hls,M=x.levels;if(!M)throw new Error("init load aborted, missing levels");var I=M[h.level].details;console.assert(I,"Level details are defined when init segment is loaded");var b=h.stats;x.state=A.IDLE,x.fragLoadError=0,h.data=new Uint8Array(U.payload),b.parsing.start=b.buffering.start=self.performance.now(),b.parsing.end=b.buffering.end=self.performance.now(),U.frag===F&&S.trigger(n.Events.FRAG_BUFFERED,{stats:b,frag:F,part:null,id:h.type}),x.tick()}).catch(function(U){x.warn(U),x.resetFragmentLoading(h)})},c.fragContextChanged=function(h){var x=this.fragCurrent;return!h||!x||h.level!==x.level||h.sn!==x.sn||h.urlId!==x.urlId},c.fragBufferedComplete=function(h,x){var U=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+h.type+" sn: "+h.sn+(x?" part: "+x.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+h.level+" "+d.default.toString(G.BufferHelper.getBuffered(U))),this.state=A.IDLE,this.tick()},c._handleFragmentLoadComplete=function(h){var x=this.transmuxer;if(!x)return;var U=h.frag,F=h.part,S=h.partsLoaded,M=!S||S.length===0||S.some(function(b){return!b}),I=new y.ChunkMetadata(U.level,U.sn,U.stats.chunkCount+1,0,F?F.index:-1,!M);x.flush(I)},c._handleFragmentLoadProgress=function(h){},c._doFragLoad=function(h,x,U,F){var S=this;if(U===void 0&&(U=null),!this.levels)throw new Error("frag load aborted, missing levels");if(U=Math.max(h.start,U||0),this.config.lowLatencyMode&&x){var M=x.partList;if(M&&F){U>h.end&&x.fragmentHint&&(h=x.fragmentHint);var I=this.getNextPart(M,h,U);if(I>-1){var b=M[I];return this.log("Loading part sn: "+h.sn+" p: "+b.index+" cc: "+h.cc+" of playlist ["+x.startSN+"-"+x.endSN+"] parts [0-"+I+"-"+(M.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+h.level+", target: "+parseFloat(U.toFixed(3))),this.nextLoadPosition=b.start+b.duration,this.state=A.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:h,part:M[I],targetBufferTime:U}),this.doFragPartsLoad(h,M,I,F).catch(function(K){return S.handleFragLoadError(K)})}else if(!h.url||this.loadedEndOfParts(M,U))return Promise.resolve(null)}}return this.log("Loading fragment "+h.sn+" cc: "+h.cc+" "+(x?"of ["+x.startSN+"-"+x.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+h.level+", target: "+parseFloat(U.toFixed(3))),Object($.isFiniteNumber)(h.sn)&&!this.bitrateTest&&(this.nextLoadPosition=h.start+h.duration),this.state=A.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:h,targetBufferTime:U}),this.fragmentLoader.load(h,F).catch(function(K){return S.handleFragLoadError(K)})},c.doFragPartsLoad=function(h,x,U,F){var S=this;return new Promise(function(M,I){var b=[],K=function Q(ne){var fe=x[ne];S.fragmentLoader.loadPart(h,fe,F).then(function(we){b[fe.index]=we;var Se=we.part;S.hls.trigger(n.Events.FRAG_LOADED,we);var he=x[ne+1];if(he&&he.fragment===h)Q(ne+1);else return M({frag:h,part:Se,partsLoaded:b})}).catch(I)};K(U)})},c.handleFragLoadError=function(h){var x=h.data;return x&&x.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(x.frag,x.part):this.hls.trigger(n.Events.ERROR,x),null},c._handleTransmuxerFlush=function(h){var x=this.getCurrentContext(h);if(!x||this.state!==A.PARSING){this.fragCurrent||(this.state=A.IDLE);return}var U=x.frag,F=x.part,S=x.level,M=self.performance.now();U.stats.parsing.end=M,F&&(F.stats.parsing.end=M),this.updateLevelTiming(U,F,S,h.partial)},c.getCurrentContext=function(h){var x=this.levels,U=h.level,F=h.sn,S=h.part;if(!x||!x[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=x[U],I=S>-1?Object(a.getPartWith)(M,F,S):null,b=I?I.fragment:Object(a.getFragmentWithSN)(M,F,this.fragCurrent);return b?{frag:b,part:I,level:M}:null},c.bufferFragmentData=function(h,x,U,F){if(!h||this.state!==A.PARSING)return;var S=h.data1,M=h.data2,I=S;if(S&&M&&(I=Object(g.appendUint8Array)(S,M)),!I||!I.length)return;var b={type:h.type,frag:x,part:U,chunkMeta:F,parent:x.type,data:I};this.hls.trigger(n.Events.BUFFER_APPENDING,b),h.dropped&&h.independent&&!U&&this.flushBufferGap(x)},c.flushBufferGap=function(h){var x=this.media;if(!x)return;if(!G.BufferHelper.isBuffered(x,x.currentTime)){this.flushMainBuffer(0,h.start);return}var U=x.currentTime,F=G.BufferHelper.bufferInfo(x,U,0),S=h.duration,M=Math.min(this.config.maxFragLookUpTolerance*2,S*.25),I=Math.max(Math.min(h.start-M,F.end-M),U+M);h.start-I>M&&this.flushMainBuffer(I,h.start)},c.getFwdBufferInfo=function(h,x){var U=this.config,F=this.getLoadPosition();if(!Object($.isFiniteNumber)(F))return null;var S=G.BufferHelper.bufferInfo(h,F,U.maxBufferHole);if(S.len===0&&S.nextStart!==void 0){var M=this.fragmentTracker.getBufferedFrag(F,x);if(M&&S.nextStart<M.end)return G.BufferHelper.bufferInfo(h,F,Math.max(S.nextStart,U.maxBufferHole))}return S},c.getMaxBufferLength=function(h){var x=this.config,U;return h?U=Math.max(8*x.maxBufferSize/h,x.maxBufferLength):U=x.maxBufferLength,Math.min(U,x.maxMaxBufferLength)},c.reduceMaxBufferLength=function(h){var x=this.config,U=h||x.maxBufferLength;return x.maxMaxBufferLength>=U?(x.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+x.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(h,x){var U,F,S=x.fragments,M=S.length;if(!M)return null;var I=this.config,b=S[0].start,K;if(x.live){var Q=I.initialLiveManifestSize;if(M<Q)return this.warn("Not enough fragments to start playback (have: "+M+", need: "+Q+")"),null;!x.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(K=this.getInitialLiveFragment(x,S),this.startPosition=K?this.hls.liveSyncPosition||K.start:h)}else h<=b&&(K=S[0]);if(!K){var ne=I.lowLatencyMode?x.partEnd:x.fragmentEnd;K=this.getFragmentAtPosition(h,ne,x)}return(U=K)!==null&&U!==void 0&&U.initSegment&&!((F=K)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(K=K.initSegment),K},c.getNextPart=function(h,x,U){for(var F=-1,S=!1,M=!0,I=0,b=h.length;I<b;I++){var K=h[I];if(M=M&&!K.independent,F>-1&&U<K.start)break;var Q=K.loaded;!Q&&(S||K.independent||M)&&K.fragment===x&&(F=I),S=Q}return F},c.loadedEndOfParts=function(h,x){var U=h[h.length-1];return U&&x>U.start&&U.loaded},c.getInitialLiveFragment=function(h,x){var U=this.fragPrevious,F=null;if(U){if(h.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+U.programDateTime),F=Object(l.findFragmentByPDT)(x,U.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var S=U.sn+1;if(S>=h.startSN&&S<=h.endSN){var M=x[S-h.startSN];U.cc===M.cc&&(F=M,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(l.findFragWithCC)(x,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?h.fragmentEnd:h.edge,h))}return F},c.getFragmentAtPosition=function(h,x,U){var F=this.config,S=this.fragPrevious,M=U.fragments,I=U.endSN,b=U.fragmentHint,K=F.maxFragLookUpTolerance,Q=!!(F.lowLatencyMode&&U.partList&&b);Q&&b&&!this.bitrateTest&&(M=M.concat(b),I=b.sn);var ne;if(h<x){var fe=h>x-K?0:K;ne=Object(l.findFragmentByPTS)(S,M,h,fe)}else ne=M[M.length-1];if(ne){var we=ne.sn-U.startSN,Se=S&&ne.level===S.level,he=M[we+1],se=this.fragmentTracker.getState(ne);if(se===P.FragmentState.BACKTRACKED){ne=null;for(var me=we;M[me]&&this.fragmentTracker.getState(M[me])===P.FragmentState.BACKTRACKED;)S?ne=M[me--]:ne=M[--me];ne||(ne=he)}else S&&ne.sn===S.sn&&!Q&&(Se&&(ne.sn<I&&this.fragmentTracker.getState(he)!==P.FragmentState.OK?(this.log("SN "+ne.sn+" just loaded, load next one: "+he.sn),ne=he):ne=null))}return ne},c.synchronizeToLiveEdge=function(h){var x=this.config,U=this.media;if(!U)return;var F=this.hls.liveSyncPosition,S=U.currentTime,M=h.fragments[0].start,I=h.edge,b=S>=M-x.maxFragLookUpTolerance&&S<=I;if(F!==null&&U.duration>F&&(S<F||!b)){var K=x.liveMaxLatencyDuration!==void 0?x.liveMaxLatencyDuration:x.liveMaxLatencyDurationCount*h.targetduration;(!b&&U.readyState<4||S<I-K)&&(this.loadedmetadata||(this.nextLoadPosition=F),U.readyState&&(this.warn("Playback: "+S.toFixed(3)+" is located too far from the end of live sliding playlist: "+I+", reset currentTime to : "+F.toFixed(3)),U.currentTime=F))}},c.alignPlaylists=function(h,x){var U=this.levels,F=this.levelLastLoaded,S=this.fragPrevious,M=F!==null?U[F]:null,I=h.fragments.length;if(!I)return this.warn("No fragments in live playlist"),0;var b=h.fragments[0].start,K=!x,Q=h.alignedSliding&&Object($.isFiniteNumber)(b);if(K||!Q&&!b){Object(p.alignStream)(S,M,h);var ne=h.fragments[0].start;return this.log("Live playlist sliding: "+ne.toFixed(2)+" start-sn: "+(x?x.startSN:"na")+"->"+h.startSN+" prev-sn: "+(S?S.sn:"na")+" fragments: "+I),ne}return b},c.waitForCdnTuneIn=function(h){var x=3;return h.live&&h.canBlockReload&&h.tuneInGoal>Math.max(h.partHoldBack,h.partTarget*x)},c.setStartPosition=function(h,x){var U=this.startPosition;if(U<x&&(U=-1),U===-1||this.lastCurrentTime===-1){var F=h.startTimeOffset;Object($.isFiniteNumber)(F)?(U=x+F,F<0&&(U+=h.totalduration),U=Math.min(Math.max(x,U),x+h.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+U),this.startPosition=U):h.live?U=this.hls.liveSyncPosition||x:this.startPosition=U=0,this.lastCurrentTime=U}this.nextLoadPosition=U},c.getLoadPosition=function(){var h=this.media,x=0;return this.loadedmetadata&&h?x=h.currentTime:this.nextLoadPosition&&(x=this.nextLoadPosition),x},c.handleFragLoadAborted=function(h,x){this.transmuxer&&h.sn!=="initSegment"&&h.stats.aborted&&(this.warn("Fragment "+h.sn+(x?" part"+x.index:"")+" of level "+h.level+" was aborted"),this.resetFragmentLoading(h))},c.resetFragmentLoading=function(h){(!this.fragCurrent||!this.fragContextChanged(h))&&(this.state=A.IDLE)},c.onFragmentOrKeyLoadError=function(h,x){if(x.fatal)return;var U=x.frag;if(!U||U.type!==h)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 S=this.config;if(this.fragLoadError+1<=S.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(U.level))return;var M=Math.min(Math.pow(2,this.fragLoadError)*S.fragLoadingRetryDelay,S.fragLoadingMaxRetryTimeout);this.warn("Fragment "+U.sn+" of "+h+" "+U.level+" failed to load, retrying in "+M+"ms"),this.retryDate=self.performance.now()+M,this.fragLoadError++,this.state=A.FRAG_LOADING_WAITING_RETRY}else x.levelRetry?(h===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=A.IDLE):(W.logger.error(x.details+" reaches max retry, redispatch as fatal ..."),x.fatal=!0,this.hls.stopLoad(),this.state=A.ERROR)},c.afterBufferFlushed=function(h,x,U){if(!h)return;var F=G.BufferHelper.getBuffered(h);this.fragmentTracker.detectEvictedFragments(x,F,U),this.state===A.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=A.IDLE},c.resetLiveStartWhenNotLoaded=function(h){if(!this.loadedmetadata){this.startFragRequested=!1;var x=this.levels?this.levels[h].details:null;if(x!=null&&x.live)return this.startPosition=-1,this.setStartPosition(x,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(h,x,U,F){var S=this,M=U.details;console.assert(!!M,"level.details must be defined");var I=Object.keys(h.elementaryStreams).reduce(function(b,K){var Q=h.elementaryStreams[K];if(Q){var ne=Q.endPTS-Q.startPTS;if(ne<=0)return S.warn("Could not parse fragment "+h.sn+" "+K+" duration reliably ("+ne+") resetting transmuxer to fallback to playlist timing"),S.resetTransmuxer(),b||!1;var fe=F?0:Object(a.updateFragPTSDTS)(M,h,Q.startPTS,Q.endPTS,Q.startDTS,Q.endDTS);return S.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:M,level:U,drift:fe,type:K,frag:h,start:Q.startPTS,end:Q.endPTS}),!0}return b},!1);I?(this.state=A.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:h,part:x})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},O(v,[{key:"state",get:function(){return this._state},set:function(h){var x=this._state;x!==h&&(this._state=h,this.log(x+"->"+h))}}]),v}(j.default)},"./src/controller/buffer-controller.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return l});var $=N("./src/polyfills/number.ts"),j=N("./src/events.ts"),P=N("./src/utils/logger.ts"),G=N("./src/errors.ts"),W=N("./src/utils/buffer-helper.ts"),n=N("./src/utils/mediasource-helper.ts"),D=N("./src/loader/fragment.ts"),y=N("./src/controller/buffer-operation-queue.ts"),g=Object(n.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,l=function(){function a(u){var d=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 i=d.hls,o=d.media,O=d.mediaSource;P.logger.log("[buffer-controller]: Media source opened"),o&&(d.updateMediaElementDuration(),i.trigger(j.Events.MEDIA_ATTACHED,{media:o})),O&&O.removeEventListener("sourceopen",d._onMediaSourceOpen),d.checkPendingTracks()},this._onMediaSourceClose=function(){P.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){P.logger.log("[buffer-controller]: Media source ended")},this.hls=u,this._initSourceBuffer(),this.registerListeners()}var f=a.prototype;return f.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},f.destroy=function(){this.unregisterListeners(),this.details=null},f.registerListeners=function(){var d=this.hls;d.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(j.Events.BUFFER_RESET,this.onBufferReset,this),d.on(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),d.on(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.on(j.Events.BUFFER_EOS,this.onBufferEos,this),d.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),d.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),d.on(j.Events.FRAG_PARSED,this.onFragParsed,this),d.on(j.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var d=this.hls;d.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(j.Events.BUFFER_RESET,this.onBufferReset,this),d.off(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),d.off(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.off(j.Events.BUFFER_EOS,this.onBufferEos,this),d.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),d.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),d.off(j.Events.FRAG_PARSED,this.onFragParsed,this),d.off(j.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new y.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(d,i){var o=2;(i.audio&&!i.video||!i.altAudio)&&(o=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=o,this.details=null,P.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(d,i){var o=this.media=i.media;if(o&&g){var O=this.mediaSource=new g;O.addEventListener("sourceopen",this._onMediaSourceOpen),O.addEventListener("sourceended",this._onMediaSourceEnded),O.addEventListener("sourceclose",this._onMediaSourceClose),o.src=self.URL.createObjectURL(O),this._objectUrl=o.src}},f.onMediaDetaching=function(){var d=this.media,i=this.mediaSource,o=this._objectUrl;if(i){if(P.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(O){P.logger.warn("[buffer-controller]: onMediaDetaching: "+O.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),d&&(o&&self.URL.revokeObjectURL(o),d.src===o?(d.removeAttribute("src"),d.load()):P.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)},f.onBufferReset=function(){var d=this;this.getSourceBufferTypes().forEach(function(i){var o=d.sourceBuffer[i];try{o&&(d.removeBufferListeners(i),d.mediaSource&&d.mediaSource.removeSourceBuffer(o),d.sourceBuffer[i]=void 0)}catch(O){P.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",O)}}),this._initSourceBuffer()},f.onBufferCodecs=function(d,i){var o=this,O=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(w){if(O){var C=o.tracks[w];if(C&&typeof C.buffer.changeType=="function"){var L=i[w],A=L.codec,_=L.levelCodec,T=L.container,v=(C.levelCodec||C.codec).replace(p,"$1"),c=(_||A).replace(p,"$1");if(v!==c){var E=T+";codecs="+(_||A);o.appendChangeType(w,E)}}}else o.pendingTracks[w]=i[w]}),O)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(d,i){var o=this,O=this.operationQueue,w={execute:function(){var L=o.sourceBuffer[d];L&&(P.logger.log("[buffer-controller]: changing "+d+" sourceBuffer type to "+i),L.changeType(i)),O.shiftAndExecuteNext(d)},onStart:function(){},onComplete:function(){},onError:function(L){P.logger.warn("[buffer-controller]: Failed to change "+d+" SourceBuffer type",L)}};O.append(w,d)},f.onBufferAppending=function(d,i){var o=this,O=this.hls,w=this.operationQueue,C=this.tracks,L=i.data,A=i.type,_=i.frag,T=i.part,v=i.chunkMeta,c=v.buffering[A],E=self.performance.now();c.start=E;var h=_.stats.buffering,x=T?T.stats.buffering:null;h.start===0&&(h.start=E),x&&x.start===0&&(x.start=E);var U=C.audio,F=A==="audio"&&v.id===1&&(U==null?void 0:U.container)==="audio/mpeg",S={execute:function(){if(c.executeStart=self.performance.now(),F){var I=o.sourceBuffer[A];if(I){var b=_.start-I.timestampOffset;Math.abs(b)>=.1&&(P.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+_.start+" (delta: "+b+") sn: "+_.sn+")"),I.timestampOffset=_.start)}}o.appendExecutor(L,A)},onStart:function(){},onComplete:function(){var I=self.performance.now();c.executeEnd=c.end=I,h.first===0&&(h.first=I),x&&x.first===0&&(x.first=I);var b=o.sourceBuffer,K={};for(var Q in b)K[Q]=W.BufferHelper.getBuffered(b[Q]);o.appendError=0,o.hls.trigger(j.Events.BUFFER_APPENDED,{type:A,frag:_,part:T,chunkMeta:v,parent:_.type,timeRanges:K})},onError:function(I){P.logger.error("[buffer-controller]: Error encountered while trying to append to the "+A+" SourceBuffer",I);var b={type:G.ErrorTypes.MEDIA_ERROR,parent:_.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:I,fatal:!1};I.code===DOMException.QUOTA_EXCEEDED_ERR?b.details=G.ErrorDetails.BUFFER_FULL_ERROR:(o.appendError++,b.details=G.ErrorDetails.BUFFER_APPEND_ERROR,o.appendError>O.config.appendErrorMaxRetry&&(P.logger.error("[buffer-controller]: Failed "+O.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),b.fatal=!0)),O.trigger(j.Events.ERROR,b)}};w.append(S,A)},f.onBufferFlushing=function(d,i){var o=this,O=this.operationQueue,w=function(L){return{execute:o.removeExecutor.bind(o,L,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){o.hls.trigger(j.Events.BUFFER_FLUSHED,{type:L})},onError:function(_){P.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",_)}}};i.type?O.append(w(i.type),i.type):this.getSourceBufferTypes().forEach(function(C){O.append(w(C),C)})},f.onFragParsed=function(d,i){var o=this,O=i.frag,w=i.part,C=[],L=w?w.elementaryStreams:O.elementaryStreams;L[D.ElementaryStreamTypes.AUDIOVIDEO]?C.push("audiovideo"):(L[D.ElementaryStreamTypes.AUDIO]&&C.push("audio"),L[D.ElementaryStreamTypes.VIDEO]&&C.push("video"));var A=function(){var T=self.performance.now();O.stats.buffering.end=T,w&&(w.stats.buffering.end=T);var v=w?w.stats:O.stats;o.hls.trigger(j.Events.FRAG_BUFFERED,{frag:O,part:w,stats:v,id:O.type})};C.length===0&&P.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+O.type+" level: "+O.level+" sn: "+O.sn),this.blockBuffers(A,C)},f.onFragChanged=function(d,i){this.flushBackBuffer()},f.onBufferEos=function(d,i){var o=this,O=this.getSourceBufferTypes().reduce(function(w,C){var L=o.sourceBuffer[C];return(!i.type||i.type===C)&&(L&&!L.ended&&(L.ended=!0,P.logger.log("[buffer-controller]: "+C+" sourceBuffer now EOS"))),w&&!!(!L||L.ended)},!0);O&&this.blockBuffers(function(){var w=o.mediaSource;if(!w||w.readyState!=="open")return;w.endOfStream()})},f.onLevelUpdated=function(d,i){var o=i.details;if(!o.fragments.length)return;this.details=o,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},f.flushBackBuffer=function(){var d=this.hls,i=this.details,o=this.media,O=this.sourceBuffer;if(!o||i===null)return;var w=this.getSourceBufferTypes();if(!w.length)return;var C=i.live&&d.config.liveBackBufferLength!==null?d.config.liveBackBufferLength:d.config.backBufferLength;if(!Object($.isFiniteNumber)(C)||C<0)return;var L=o.currentTime,A=i.levelTargetDuration,_=Math.max(C,A),T=Math.floor(L/A)*A-_;w.forEach(function(v){var c=O[v];if(c){var E=W.BufferHelper.getBuffered(c);E.length>0&&T>E.start(0)&&(d.trigger(j.Events.BACK_BUFFER_REACHED,{bufferEnd:T}),i.live&&d.trigger(j.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:T}),d.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:T,type:v}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var d=this.details,i=this.hls,o=this.media,O=this.mediaSource,w=d.fragments[0].start+d.totalduration,C=o.duration,L=Object($.isFiniteNumber)(O.duration)?O.duration:0;d.live&&i.config.liveDurationInfinity?(P.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),O.duration=Infinity,this.updateSeekableRange(d)):(w>L&&w>C||!Object($.isFiniteNumber)(C))&&(P.logger.log("[buffer-controller]: Updating Media Source duration to "+w.toFixed(3)),O.duration=w)},f.updateSeekableRange=function(d){var i=this.mediaSource,o=d.fragments,O=o.length;if(O&&d.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var w=Math.max(0,o[0].start),C=Math.max(w,w+d.totalduration);i.setLiveSeekableRange(w,C)}},f.checkPendingTracks=function(){var d=this.bufferCodecEventsExpected,i=this.operationQueue,o=this.pendingTracks,O=Object.keys(o).length;if(O&&!d||O===2){this.createSourceBuffers(o),this.pendingTracks={};var w=this.getSourceBufferTypes();if(w.length===0){this.hls.trigger(j.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}w.forEach(function(C){i.executeNext(C)})}},f.createSourceBuffers=function(d){var i=this.sourceBuffer,o=this.mediaSource;if(!o)throw Error("createSourceBuffers called when mediaSource was null");var O=0;for(var w in d)if(!i[w]){var C=d[w];if(!C)throw Error("source buffer exists for track "+w+", however track does not");var L=C.levelCodec||C.codec,A=C.container+";codecs="+L;P.logger.log("[buffer-controller]: creating sourceBuffer("+A+")");try{var _=i[w]=o.addSourceBuffer(A),T=w;this.addBufferListener(T,"updatestart",this._onSBUpdateStart),this.addBufferListener(T,"updateend",this._onSBUpdateEnd),this.addBufferListener(T,"error",this._onSBUpdateError),this.tracks[w]={buffer:_,codec:L,container:C.container,levelCodec:C.levelCodec,id:C.id},O++}catch(v){P.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+v.message),this.hls.trigger(j.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:v,mimeType:A})}}O&&this.hls.trigger(j.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(d){var i=this.operationQueue,o=i.current(d);o.onStart()},f._onSBUpdateEnd=function(d){var i=this.operationQueue,o=i.current(d);o.onComplete(),i.shiftAndExecuteNext(d)},f._onSBUpdateError=function(d,i){P.logger.error("[buffer-controller]: "+d+" SourceBuffer error",i),this.hls.trigger(j.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var o=this.operationQueue.current(d);o&&o.onError(i)},f.removeExecutor=function(d,i,o){var O=this.media,w=this.mediaSource,C=this.operationQueue,L=this.sourceBuffer,A=L[d];if(!O||!w||!A){P.logger.warn("[buffer-controller]: Attempting to remove from the "+d+" SourceBuffer, but it does not exist"),C.shiftAndExecuteNext(d);return}var _=Object($.isFiniteNumber)(O.duration)?O.duration:Infinity,T=Object($.isFiniteNumber)(w.duration)?w.duration:Infinity,v=Math.max(0,i),c=Math.min(o,_,T);c>v?(P.logger.log("[buffer-controller]: Removing ["+v+","+c+"] from the "+d+" SourceBuffer"),console.assert(!A.updating,d+" sourceBuffer must not be updating"),A.remove(v,c)):C.shiftAndExecuteNext(d)},f.appendExecutor=function(d,i){var o=this.operationQueue,O=this.sourceBuffer,w=O[i];if(!w){P.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),o.shiftAndExecuteNext(i);return}w.ended=!1,console.assert(!w.updating,i+" sourceBuffer must not be updating"),w.appendBuffer(d)},f.blockBuffers=function(d,i){var o=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){P.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(d);return}var O=this.operationQueue,w=i.map(function(C){return O.appendBlocker(C)});Promise.all(w).then(function(){d(),i.forEach(function(C){var L=o.sourceBuffer[C];(!L||!L.updating)&&O.shiftAndExecuteNext(C)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(d,i,o){var O=this.sourceBuffer[d];if(!O)return;var w=o.bind(this,d);this.listeners[d].push({event:i,listener:w}),O.addEventListener(i,w)},f.removeBufferListeners=function(d){var i=this.sourceBuffer[d];if(!i)return;this.listeners[d].forEach(function(o){i.removeEventListener(o.event,o.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return j});var $=N("./src/utils/logger.ts"),j=function(){function P(W){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=W}var G=P.prototype;return G.append=function(n,D){var y=this.queues[D];y.push(n),y.length===1&&this.buffers[D]&&this.executeNext(D)},G.insertAbort=function(n,D){var y=this.queues[D];y.unshift(n),this.executeNext(D)},G.appendBlocker=function(n){var D,y=new Promise(function(p){D=p}),g={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(g,n),y},G.executeNext=function(n){var D=this.buffers,y=this.queues,g=D[n],p=y[n];if(p.length){var l=p[0];try{l.execute()}catch(a){$.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),l.onError(a),(!g||!g.updating)&&(p.shift(),this.executeNext(n))}}},G.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},G.current=function(n){return this.queues[n][0]},P}()},"./src/controller/cap-level-controller.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/events.ts");function j(W,n){for(var D=0;D<n.length;D++){var y=n[D];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(W,y.key,y)}}function P(W,n,D){return n&&j(W.prototype,n),D&&j(W,D),W}var G=function(){function W(D){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=D,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var n=W.prototype;return n.setStreamController=function(y){this.streamController=y},n.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},n.registerListeners=function(){var y=this.hls;y.on($.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.on($.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on($.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var y=this.hls;y.off($.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.off($.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off($.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(y,g){W.isLevelAllowed(g.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(g.droppedLevel)},n.onMediaAttaching=function(y,g){this.media=g.media instanceof HTMLVideoElement?g.media:null},n.onManifestParsed=function(y,g){var p=this.hls;this.restrictedLevels=[],this.firstLevel=g.firstLevel,p.config.capLevelToPlayerSize&&g.video&&this.startCapping()},n.onBufferCodecs=function(y,g){var p=this.hls;p.config.capLevelToPlayerSize&&g.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var y=this.hls.levels;if(y.length){var g=this.hls;g.autoLevelCapping=this.getMaxLevel(y.length-1),g.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=g.autoLevelCapping}}},n.getMaxLevel=function(y){var g=this,p=this.hls.levels;if(!p.length)return-1;var l=p.filter(function(a,f){return W.isLevelAllowed(f,g.restrictedLevels)&&f<=y});return this.clientRect=null,W.getMaxLevelByMediaSize(l,this.mediaWidth,this.mediaHeight)},n.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()},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var y=this.media,g={width:0,height:0};if(y){var p=y.getBoundingClientRect();g.width=p.width,g.height=p.height,!g.width&&!g.height&&(g.width=p.right-p.left||y.width||0,g.height=p.bottom-p.top||y.height||0)}return this.clientRect=g,g},W.isLevelAllowed=function(y,g){return g===void 0&&(g=[]),g.indexOf(y)===-1},W.getMaxLevelByMediaSize=function(y,g,p){if(!y||!y.length)return-1;for(var l=function(i,o){return o?i.width!==o.width||i.height!==o.height:!0},a=y.length-1,f=0;f<y.length;f+=1){var u=y[f];if((u.width>=g||u.height>=p)&&l(u,y[f+1])){a=f;break}}return a},P(W,[{key:"mediaWidth",get:function(){return this.getDimensions().width*W.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*W.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var y=1;try{y=self.devicePixelRatio}catch(g){}return y}}]),W}();V.default=G},"./src/controller/cmcd-controller.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return l});var $=N("./src/events.ts"),j=N("./src/types/cmcd.ts"),P=N("./src/utils/buffer-helper.ts"),G=N("./src/utils/logger.ts");function W(a,f){for(var u=0;u<f.length;u++){var d=f[u];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}function n(a,f,u){return f&&W(a.prototype,f),u&&W(a,u),a}function D(a,f){var u=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(u)return(u=u.call(a)).next.bind(u);if(Array.isArray(a)||(u=y(a))||f&&a&&typeof a.length=="number"){u&&(a=u);var d=0;return function(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y(a,f){if(!a)return;if(typeof a=="string")return g(a,f);var u=Object.prototype.toString.call(a).slice(8,-1);if(u==="Object"&&a.constructor&&(u=a.constructor.name),u==="Map"||u==="Set")return Array.from(a);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return g(a,f)}function g(a,f){(f==null||f>a.length)&&(f=a.length);for(var u=0,d=new Array(f);u<f;u++)d[u]=a[u];return d}function p(){return p=Object.assign||function(a){for(var f=1;f<arguments.length;f++){var u=arguments[f];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(a[d]=u[d])}return a},p.apply(this,arguments)}var l=function(){function a(u){var d=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(){d.initialized&&(d.starved=!0),d.buffering=!0},this.onPlaying=function(){d.initialized||(d.initialized=!0),d.buffering=!1},this.applyPlaylistData=function(O){try{d.apply(O,{ot:j.CMCDObjectType.MANIFEST,su:!d.initialized})}catch(w){G.logger.warn("Could not generate manifest CMCD data.",w)}},this.applyFragmentData=function(O){try{var w=O.frag,C=d.hls.levels[w.level],L=d.getObjectType(w),A={d:w.duration*1e3,ot:L};(L===j.CMCDObjectType.VIDEO||L===j.CMCDObjectType.AUDIO||L==j.CMCDObjectType.MUXED)&&(A.br=C.bitrate/1e3,A.tb=d.getTopBandwidth(L),A.bl=d.getBufferLength(L)),d.apply(O,A)}catch(_){G.logger.warn("Could not generate segment CMCD data.",_)}},this.hls=u;var i=this.config=u.config,o=i.cmcd;o!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=o.sessionId||a.uuid(),this.cid=o.contentId,this.useHeaders=o.useHeaders===!0,this.registerListeners())}var f=a.prototype;return f.registerListeners=function(){var d=this.hls;d.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on($.Events.MEDIA_DETACHED,this.onMediaDetached,this),d.on($.Events.BUFFER_CREATED,this.onBufferCreated,this)},f.unregisterListeners=function(){var d=this.hls;d.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off($.Events.MEDIA_DETACHED,this.onMediaDetached,this),d.off($.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},f.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},f.onMediaAttached=function(d,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},f.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},f.onBufferCreated=function(d,i){var o,O;this.audioBuffer=(o=i.tracks.audio)===null||o===void 0?void 0:o.buffer,this.videoBuffer=(O=i.tracks.video)===null||O===void 0?void 0:O.buffer},f.createData=function(){var d;return{v:j.CMCDVersion,sf:j.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(d=this.media)===null||d===void 0?void 0:d.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},f.apply=function(d,i){i===void 0&&(i={}),p(i,this.createData());var o=i.ot===j.CMCDObjectType.INIT||i.ot===j.CMCDObjectType.VIDEO||i.ot===j.CMCDObjectType.MUXED;if(this.starved&&o&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering),this.useHeaders){var O=a.toHeaders(i);if(!Object.keys(O).length)return;d.headers||(d.headers={}),p(d.headers,O)}else{var w=a.toQuery(i);if(!w)return;d.url=a.appendQueryToUri(d.url,w)}},f.getObjectType=function(d){var i=d.type;return i==="subtitle"?j.CMCDObjectType.TIMED_TEXT:d.sn==="initSegment"?j.CMCDObjectType.INIT:i==="audio"?j.CMCDObjectType.AUDIO:i==="main"?this.hls.audioTracks.length?j.CMCDObjectType.VIDEO:j.CMCDObjectType.MUXED:void 0},f.getTopBandwidth=function(d){for(var i=0,o=d===j.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,O=D(o),w;!(w=O()).done;){var C=w.value;C.bitrate>i&&(i=C.bitrate)}return i>0?i:NaN},f.getBufferLength=function(d){var i=this.hls.media,o=d===j.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!o||!i)return NaN;var O=P.BufferHelper.bufferInfo(o,i.currentTime,this.config.maxBufferHole);return O.len*1e3},f.createPlaylistLoader=function(){var d=this.config.pLoader,i=this.applyPlaylistData,o=d||this.config.loader;return function(){function O(C){this.loader=void 0,this.loader=new o(C)}var w=O.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(L,A,_){i(L),this.loader.load(L,A,_)},n(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},f.createFragmentLoader=function(){var d=this.config.fLoader,i=this.applyFragmentData,o=d||this.config.loader;return function(){function O(C){this.loader=void 0,this.loader=new o(C)}var w=O.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(L,A,_){i(L),this.loader.load(L,A,_)},n(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},a.uuid=function(){var d=URL.createObjectURL(new Blob),i=d.toString();return URL.revokeObjectURL(d),i.substr(i.lastIndexOf("/")+1)},a.serialize=function(d){for(var i=[],o=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},O=function(F){return Math.round(F)},w=function(F){return O(F/100)*100},C=function(F){return encodeURIComponent(F)},L={br:O,d:O,bl:w,dl:w,mtp:w,nor:C,rtp:w,tb:O},A=Object.keys(d||{}).sort(),_=D(A),T;!(T=_()).done;){var v=T.value,c=d[v];if(!o(c))continue;if(v==="v"&&c===1)continue;if(v=="pr"&&c===1)continue;var E=L[v];E&&(c=E(c));var h=typeof c,x=void 0;v==="ot"||v==="sf"||v==="st"?x=v+"="+c:h==="boolean"?x=v:h==="number"?x=v+"="+c:x=v+"="+JSON.stringify(c),i.push(x)}return i.join(",")},a.toHeaders=function(d){for(var i=Object.keys(d),o={},O=["Object","Request","Session","Status"],w=[{},{},{},{}],C={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},L=0,A=i;L<A.length;L++){var _=A[L],T=C[_]!=null?C[_]:1;w[T][_]=d[_]}for(var v=0;v<w.length;v++){var c=a.serialize(w[v]);c&&(o["CMCD-"+O[v]]=c)}return o},a.toQuery=function(d){return"CMCD="+encodeURIComponent(a.serialize(d))},a.appendQueryToUri=function(d,i){if(!i)return d;var o=d.includes("?")?"&":"?";return""+d+o+i},a}()},"./src/controller/eme-controller.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/events.ts"),j=N("./src/errors.ts"),P=N("./src/utils/logger.ts"),G=N("./src/utils/mediakeys-helper.ts");function W(l,a){for(var f=0;f<a.length;f++){var u=a[f];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(l,u.key,u)}}function n(l,a,f){return a&&W(l.prototype,a),f&&W(l,f),l}var D=3,y=function(a,f,u){var d={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(i){d.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:u.audioRobustness||""})}),f.forEach(function(i){d.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:u.videoRobustness||""})}),[d]},g=function(a,f,u,d){switch(a){case G.KeySystems.WIDEVINE:return y(f,u,d);default:throw new Error("Unknown key-system: "+a)}},p=function(){function l(f){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=f,this._config=f.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var a=l.prototype;return a.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},a._registerListeners=function(){this.hls.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on($.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a._unregisterListeners=function(){this.hls.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off($.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a.getLicenseServerUrl=function(u){switch(u){case G.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+u+'"')},a._attemptKeySystemAccess=function(u,d,i){var o=this,O=g(u,d,i,this._drmSystemOptions);P.logger.log("Requesting encrypted media key-system access");var w=this.requestMediaKeySystemAccess(u,O);this.mediaKeysPromise=w.then(function(C){return o._onMediaKeySystemAccessObtained(u,C)}),w.catch(function(C){P.logger.error('Failed to obtain key-system "'+u+'" access:',C)})},a._onMediaKeySystemAccessObtained=function(u,d){var i=this;P.logger.log('Access for key-system "'+u+'" obtained');var o={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:d,mediaKeySystemDomain:u};this._mediaKeysList.push(o);var O=Promise.resolve().then(function(){return d.createMediaKeys()}).then(function(w){return o.mediaKeys=w,P.logger.log('Media-keys created for key-system "'+u+'"'),i._onMediaKeysCreated(),w});return O.catch(function(w){P.logger.error("Failed to create media-keys:",w)}),O},a._onMediaKeysCreated=function(){var u=this;this._mediaKeysList.forEach(function(d){d.mediaKeysSession||(d.mediaKeysSession=d.mediaKeys.createSession(),u._onNewMediaKeySession(d.mediaKeysSession))})},a._onNewMediaKeySession=function(u){var d=this;P.logger.log("New key-system session "+u.sessionId),u.addEventListener("message",function(i){d._onKeySessionMessage(u,i.message)},!1)},a._onKeySessionMessage=function(u,d){P.logger.log("Got EME message event, creating license request"),this._requestLicense(d,function(i){P.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),u.update(i)})},a.onMediaEncrypted=function(u){var d=this;if(P.logger.log('Media is encrypted using "'+u.initDataType+'" init data type'),!this.mediaKeysPromise){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger($.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var i=function(O){if(!d._media)return;d._attemptSetMediaKeys(O),d._generateRequestWithPreferredKeySession(u.initDataType,u.initData)};this.mediaKeysPromise.then(i).catch(i)},a._attemptSetMediaKeys=function(u){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var d=this._mediaKeysList[0];if(!d||!d.mediaKeys){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger($.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}P.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(d.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(u,d){var i=this,o=this._mediaKeysList[0];if(!o){P.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger($.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(o.mediaKeysSessionInitialized){P.logger.warn("Key-Session already initialized but requested again");return}var O=o.mediaKeysSession;if(!O){P.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger($.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!d){P.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger($.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}P.logger.log('Generating key-session request for "'+u+'" init data type'),o.mediaKeysSessionInitialized=!0,O.generateRequest(u,d).then(function(){P.logger.debug("Key-session generation succeeded")}).catch(function(w){P.logger.error("Error generating key-session request:",w),i.hls.trigger($.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._createLicenseXhr=function(u,d,i){var o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,o,u,d,i);var O=this._licenseXhrSetup;if(O)try{O.call(this.hls,o,u),O=void 0}catch(w){P.logger.error(w)}try{o.readyState||o.open("POST",u,!0),O&&O.call(this.hls,o,u)}catch(w){throw new Error("issue setting up KeySystem license XHR "+w)}return o},a._onLicenseRequestReadyStageChange=function(u,d,i,o){switch(u.readyState){case 4:if(u.status===200){this._requestLicenseFailureCount=0,P.logger.log("License request succeeded");var O=u.response,w=this._licenseResponseCallback;if(w)try{O=w.call(this.hls,u,d)}catch(L){P.logger.error(L)}o(O)}else{if(P.logger.error("License Request XHR failed ("+d+"). Status: "+u.status+" ("+u.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger($.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var C=D-this._requestLicenseFailureCount+1;P.logger.warn("Retrying license request, "+C+" attempts left"),this._requestLicense(i,o)}break}},a._generateLicenseRequestChallenge=function(u,d){switch(u.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return d}throw new Error("unsupported key-system: "+u.mediaKeySystemDomain)},a._requestLicense=function(u,d){P.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){P.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger($.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var o=this.getLicenseServerUrl(i.mediaKeySystemDomain),O=this._createLicenseXhr(o,u,d);P.logger.log("Sending license request to URL: "+o);var w=this._generateLicenseRequestChallenge(i,u);O.send(w)}catch(C){P.logger.error("Failure requesting DRM license: "+C),this.hls.trigger($.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(u,d){if(!this._emeEnabled)return;var i=d.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},a.onMediaDetached=function(){var u=this._media,d=this._mediaKeysList;if(!u)return;u.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(d.map(function(i){if(i.mediaKeysSession)return i.mediaKeysSession.close().catch(function(){})})).then(function(){return u.setMediaKeys(null)}).catch(function(){})},a.onManifestParsed=function(u,d){if(!this._emeEnabled)return;var i=d.levels.map(function(O){return O.audioCodec}).filter(function(O){return!!O}),o=d.levels.map(function(O){return O.videoCodec}).filter(function(O){return!!O});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,i,o)},n(l,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),l}();V.default=p},"./src/controller/fps-controller.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/events.ts"),j=N("./src/utils/logger.ts"),P=function(){function G(n){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=n,this.registerListeners()}var W=G.prototype;return W.setStreamController=function(D){this.streamController=D},W.registerListeners=function(){this.hls.on($.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},W.unregisterListeners=function(){this.hls.off($.Events.MEDIA_ATTACHING,this.onMediaAttaching)},W.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},W.onMediaAttaching=function(D,y){var g=this.hls.config;if(g.capLevelOnFPSDrop){var p=y.media instanceof self.HTMLVideoElement?y.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),g.fpsDroppedMonitoringPeriod)}},W.checkFPS=function(D,y,g){var p=performance.now();if(y){if(this.lastTime){var l=p-this.lastTime,a=g-this.lastDroppedFrames,f=y-this.lastDecodedFrames,u=1e3*a/l,d=this.hls;if(d.trigger($.Events.FPS_DROP,{currentDropped:a,currentDecoded:f,totalDroppedFrames:g}),u>0&&a>d.config.fpsDroppedMonitoringThreshold*f){var i=d.currentLevel;j.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(d.autoLevelCapping===-1||d.autoLevelCapping>=i)&&(i=i-1,d.trigger($.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:d.currentLevel}),d.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=g,this.lastDecodedFrames=y}},W.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var y=D.getVideoPlaybackQuality();this.checkFPS(D,y.totalVideoFrames,y.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},G}();V.default=P},"./src/controller/fragment-finders.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"findFragmentByPDT",function(){return P}),N.d(V,"findFragmentByPTS",function(){return G}),N.d(V,"fragmentWithinToleranceTest",function(){return W}),N.d(V,"pdtWithinToleranceTest",function(){return n}),N.d(V,"findFragWithCC",function(){return D});var $=N("./src/polyfills/number.ts"),j=N("./src/utils/binary-search.ts");function P(y,g,p){if(g===null||!Array.isArray(y)||!y.length||!Object($.isFiniteNumber)(g))return null;var l=y[0].programDateTime;if(g<(l||0))return null;var a=y[y.length-1].endProgramDateTime;if(g>=(a||0))return null;p=p||0;for(var f=0;f<y.length;++f){var u=y[f];if(n(g,p,u))return u}return null}function G(y,g,p,l){p===void 0&&(p=0),l===void 0&&(l=0);var a=null;if(y?a=g[y.sn-g[0].sn+1]||null:p===0&&g[0].start===0&&(a=g[0]),a&&W(p,l,a)===0)return a;var f=j.default.search(g,W.bind(null,p,l));return f||a}function W(y,g,p){y===void 0&&(y=0),g===void 0&&(g=0);var l=Math.min(g,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-l<=y?1:p.start-l>y&&p.start?-1:0}function n(y,g,p){var l=Math.min(g,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,a=p.endProgramDateTime||0;return a-l>y}function D(y,g){return j.default.search(y,function(p){return p.cc<g?1:p.cc>g?-1:0})}},"./src/controller/fragment-tracker.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"FragmentState",function(){return P}),N.d(V,"FragmentTracker",function(){return G});var $=N("./src/events.ts"),j=N("./src/types/loader.ts"),P;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(P||(P={}));var G=function(){function D(g){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=g,this._registerListeners()}var y=D.prototype;return y._registerListeners=function(){var p=this.hls;p.on($.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on($.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on($.Events.FRAG_LOADED,this.onFragLoaded,this)},y._unregisterListeners=function(){var p=this.hls;p.off($.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off($.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off($.Events.FRAG_LOADED,this.onFragLoaded,this)},y.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},y.getAppendedFrag=function(p,l){if(l===j.PlaylistLevelType.MAIN){var a=this.activeFragment,f=this.activeParts;if(!a)return null;if(f)for(var u=f.length;u--;){var d=f[u],i=d?d.end:a.appendedPTS;if(d.start<=p&&i!==void 0&&p<=i)return u>9&&(this.activeParts=f.slice(u-9)),d}else if(a.start<=p&&a.appendedPTS!==void 0&&p<=a.appendedPTS)return a}return this.getBufferedFrag(p,l)},y.getBufferedFrag=function(p,l){for(var a=this.fragments,f=Object.keys(a),u=f.length;u--;){var d=a[f[u]];if((d==null?void 0:d.body.type)===l&&d.buffered){var i=d.body;if(i.start<=p&&p<=i.end)return i}}return null},y.detectEvictedFragments=function(p,l,a){var f=this;Object.keys(this.fragments).forEach(function(u){var d=f.fragments[u];if(!d)return;if(!d.buffered){d.body.type===a&&f.removeFragment(d.body);return}var i=d.range[p];if(!i)return;i.time.some(function(o){var O=!f.isTimeBuffered(o.startPTS,o.endPTS,l);return O&&f.removeFragment(d.body),O})})},y.detectPartialFragments=function(p){var l=this,a=this.timeRanges,f=p.frag,u=p.part;if(!a||f.sn==="initSegment")return;var d=n(f),i=this.fragments[d];if(!i)return;Object.keys(a).forEach(function(o){var O=f.elementaryStreams[o];if(!O)return;var w=a[o],C=u!==null||O.partial===!0;i.range[o]=l.getBufferedTimes(f,u,C,w)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},y.fragBuffered=function(p){var l=n(p),a=this.fragments[l];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},y.getBufferedTimes=function(p,l,a,f){for(var u={time:[],partial:a},d=l?l.start:p.start,i=l?l.end:p.end,o=p.minEndPTS||i,O=p.maxStartPTS||d,w=0;w<f.length;w++){var C=f.start(w)-this.bufferPadding,L=f.end(w)+this.bufferPadding;if(O>=C&&o<=L){u.time.push({startPTS:Math.max(d,f.start(w)),endPTS:Math.min(i,f.end(w))});break}else if(d<L&&i>C)u.partial=!0,u.time.push({startPTS:Math.max(d,f.start(w)),endPTS:Math.min(i,f.end(w))});else if(i<=C)break}return u},y.getPartialFragment=function(p){var l=null,a,f,u,d=0,i=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach(function(O){var w=o[O];if(!w)return;W(w)&&(f=w.body.start-i,u=w.body.end+i,p>=f&&p<=u&&(a=Math.min(p-f,u-p),d<=a&&(l=w.body,d=a)))}),l},y.getState=function(p){var l=n(p),a=this.fragments[l];return a?a.buffered?W(a)?P.PARTIAL:P.OK:a.backtrack?P.BACKTRACKED:P.APPENDING:P.NOT_LOADED},y.backtrack=function(p,l){var a=n(p),f=this.fragments[a];if(!f||f.backtrack)return null;var u=f.backtrack=l||f.loaded;return f.loaded=null,u},y.getBacktrackData=function(p){var l=n(p),a=this.fragments[l];if(a){var f,u=a.backtrack;if(u!=null&&(f=u.payload)!==null&&f!==void 0&&f.byteLength)return u;this.removeFragment(p)}return null},y.isTimeBuffered=function(p,l,a){for(var f,u,d=0;d<a.length;d++){if(f=a.start(d)-this.bufferPadding,u=a.end(d)+this.bufferPadding,p>=f&&l<=u)return!0;if(l<=f)return!1}return!1},y.onFragLoaded=function(p,l){var a=l.frag,f=l.part;if(a.sn==="initSegment"||a.bitrateTest||f)return;var u=n(a);this.fragments[u]={body:a,loaded:l,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(p,l){var a=this,f=l.frag,u=l.part,d=l.timeRanges;if(f.type===j.PlaylistLevelType.MAIN)if(this.activeFragment=f,u){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(u)}else this.activeParts=null;this.timeRanges=d,Object.keys(d).forEach(function(o){var O=d[o];if(a.detectEvictedFragments(o,O),!u)for(var w=0;w<O.length;w++)f.appendedPTS=Math.max(O.end(w),f.appendedPTS||0)})},y.onFragBuffered=function(p,l){this.detectPartialFragments(l)},y.hasFragment=function(p){var l=n(p);return!!this.fragments[l]},y.removeFragmentsInRange=function(p,l,a){var f=this;Object.keys(this.fragments).forEach(function(u){var d=f.fragments[u];if(!d)return;if(d.buffered){var i=d.body;i.type===a&&i.start<l&&i.end>p&&f.removeFragment(i)}})},y.removeFragment=function(p){var l=n(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[l]},y.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function W(D){var y,g;return D.buffered&&(((y=D.range.video)===null||y===void 0?void 0:y.partial)||((g=D.range.audio)===null||g===void 0?void 0:g.partial))}function n(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"STALL_MINIMUM_DURATION_MS",function(){return W}),N.d(V,"MAX_START_GAP_JUMP",function(){return n}),N.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),N.d(V,"SKIP_BUFFER_RANGE_START",function(){return y}),N.d(V,"default",function(){return g});var $=N("./src/utils/buffer-helper.ts"),j=N("./src/errors.ts"),P=N("./src/events.ts"),G=N("./src/utils/logger.ts"),W=250,n=2,D=.1,y=.05,g=function(){function p(a,f,u,d){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=a,this.media=f,this.fragmentTracker=u,this.hls=d}var l=p.prototype;return l.destroy=function(){this.hls=this.fragmentTracker=this.media=null},l.poll=function(f){var u=this.config,d=this.media,i=this.stalled,o=d.currentTime,O=d.seeking,w=this.seeking&&!O,C=!this.seeking&&O;if(this.seeking=O,o!==f){if(this.moved=!0,i!==null){if(this.stallReported){var L=self.performance.now()-i;G.logger.warn("playback not stuck anymore @"+o+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((C||w)&&(this.stalled=null),d.paused||d.ended||d.playbackRate===0||!$.BufferHelper.getBuffered(d).length)return;var A=$.BufferHelper.bufferInfo(d,o,0),_=A.len>0,T=A.nextStart||0;if(!_&&!T)return;if(O){var v=A.len>n,c=!T||T-o>n&&!this.fragmentTracker.getPartialFragment(o);if(v||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,h=Math.max(T,A.start||0)-o,x=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,U=x==null||((E=x.details)===null||E===void 0)?void 0:E.live,F=U?x.details.targetduration*2:n;if(h>0&&h<=F){this._trySkipBufferHole(null);return}}var S=self.performance.now();if(i===null){this.stalled=S;return}var M=S-i;!O&&M>=W&&this._reportStall(A.len);var I=$.BufferHelper.bufferInfo(d,o,u.maxBufferHole);this._tryFixBufferStall(I,M)},l._tryFixBufferStall=function(f,u){var d=this.config,i=this.fragmentTracker,o=this.media,O=o.currentTime,w=i.getPartialFragment(O);if(w){var C=this._trySkipBufferHole(w);if(C)return}f.len>d.maxBufferHole&&u>d.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},l._reportStall=function(f){var u=this.hls,d=this.media,i=this.stallReported;i||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+d.currentTime+" due to low buffer (buffer="+f+")"),u.trigger(P.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},l._trySkipBufferHole=function(f){for(var u=this.config,d=this.hls,i=this.media,o=i.currentTime,O=0,w=$.BufferHelper.getBuffered(i),C=0;C<w.length;C++){var L=w.start(C);if(o+u.maxBufferHole>=O&&o<L){var A=Math.max(L+y,i.currentTime+D);return G.logger.warn("skipping hole, adjusting currentTime from "+o+" to "+A),this.moved=!0,this.stalled=null,i.currentTime=A,f&&d.trigger(P.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+o+" to "+A,frag:f}),A}O=w.end(C)}return 0},l._tryNudgeBuffer=function(){var f=this.config,u=this.hls,d=this.media,i=d.currentTime,o=(this.nudgeRetry||0)+1;if(this.nudgeRetry=o,o<f.nudgeMaxRetry){var O=i+o*f.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+i+" to "+O),d.currentTime=O,u.trigger(P.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else G.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+f.nudgeMaxRetry+" nudges"),u.trigger(P.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/events.ts"),j=N("./src/utils/texttrack-utils.ts"),P=N("./src/demux/id3.ts"),G=.25,W=function(){function n(y){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=y,this._registerListeners()}var D=n.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var g=this.hls;g.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on($.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.on($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var g=this.hls;g.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off($.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.off($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(g,p){this.media=p.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(j.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(g){if(!this.media)return;for(var p=0;p<g.length;p++){var l=g[p];if(l.kind==="metadata"&&l.label==="id3")return Object(j.sendAddTrackEvent)(l,this.media),l}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(g,p){if(!this.media)return;var l=p.frag,a=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var f=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,u=0;u<a.length;u++){var d=P.getID3Frames(a[u].data);if(d){var i=a[u].pts,o=u<a.length-1?a[u+1].pts:l.end,O=o-i;O<=0&&(o=i+G);for(var w=0;w<d.length;w++){var C=d[w];if(!P.isTimeStampFrame(C)){var L=new f(i,o,"");L.value=C,this.id3Track.addCue(L)}}}}},D.onBufferFlushing=function(g,p){var l=p.startOffset,a=p.endOffset,f=p.type;if(!f||f==="audio"){var u=this.id3Track;u&&Object(j.removeCuesInRange)(u,l,a)}},n}();V.default=W},"./src/controller/latency-controller.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return n});var $=N("./src/errors.ts"),j=N("./src/events.ts"),P=N("./src/utils/logger.ts");function G(D,y){for(var g=0;g<y.length;g++){var p=y[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(D,p.key,p)}}function W(D,y,g){return y&&G(D.prototype,y),g&&G(D,g),D}var n=function(){function D(g){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=g,this.config=g.config,this.registerListeners()}var y=D.prototype;return y.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},y.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)},y.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)},y.onMediaAttached=function(p,l){this.media=l.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},y.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},y.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},y.onLevelUpdated=function(p,l){var a=l.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},y.onError=function(p,l){if(l.details!==$.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,P.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},y.timeupdate=function(){var p=this.media,l=this.levelDetails;if(!p||!l)return;this.currentTime=p.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var f=this.config,u=f.lowLatencyMode,d=f.maxLiveSyncPlaybackRate;if(!u||d===1)return;var i=this.targetLatency;if(i===null)return;var o=a-i,O=Math.min(this.maxLatency,i+l.targetduration),w=o<O;if(l.live&&w&&o>.05&&this.forwardBufferLength>1){var C=Math.min(2,Math.max(1,d)),L=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;p.playbackRate=Math.min(C,Math.max(1,L))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},y.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},y.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},W(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,l=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:l?p.liveMaxLatencyDurationCount*l.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var l=p.holdBack,a=p.partHoldBack,f=p.targetduration,u=this.config,d=u.liveSyncDuration,i=u.liveSyncDurationCount,o=u.lowLatencyMode,O=this.hls.userConfig,w=o&&a||l;(O.liveSyncDuration||O.liveSyncDurationCount||w===0)&&(w=d!==void 0?d:i*f);var C=f,L=1;return w+Math.min(this.stallCount*L,C)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),l=this.targetLatency,a=this.levelDetails;if(p===null||l===null||a===null)return null;var f=a.edge,u=p-l-this.edgeStalled,d=f-a.totalduration,i=f-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(d,u),i)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var l=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-l,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,l=this.levelDetails;if(!p||!l)return 0;var a=p.buffered.length;return a?p.buffered.end(a-1):l.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return u});var $=N("./src/types/level.ts"),j=N("./src/events.ts"),P=N("./src/errors.ts"),G=N("./src/utils/codecs.ts"),W=N("./src/controller/level-helper.ts"),n=N("./src/controller/base-playlist-controller.ts"),D=N("./src/types/loader.ts");function y(){return y=Object.assign||function(d){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var O in o)Object.prototype.hasOwnProperty.call(o,O)&&(d[O]=o[O])}return d},y.apply(this,arguments)}function g(d,i){for(var o=0;o<i.length;o++){var O=i[o];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(d,O.key,O)}}function p(d,i,o){return i&&g(d.prototype,i),o&&g(d,o),d}function l(d,i){d.prototype=Object.create(i.prototype),d.prototype.constructor=d,a(d,i)}function a(d,i){return a=Object.setPrototypeOf||function(O,w){return O.__proto__=w,O},a(d,i)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),u=function(d){l(i,d);function i(O){var w;return w=d.call(this,O,"[level-controller]")||this,w._levels=[],w._firstLevel=-1,w._startLevel=void 0,w.currentLevelIndex=-1,w.manualLevelIndex=-1,w.onParsedComplete=void 0,w._registerListeners(),w}var o=i.prototype;return o._registerListeners=function(){var w=this.hls;w.on(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),w.on(j.Events.ERROR,this.onError,this)},o._unregisterListeners=function(){var w=this.hls;w.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),w.off(j.Events.ERROR,this.onError,this)},o.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,d.prototype.destroy.call(this)},o.startLoad=function(){var w=this._levels;w.forEach(function(C){C.loadError=0}),d.prototype.startLoad.call(this)},o.onManifestLoaded=function(w,C){var L=[],A=[],_=[],T,v={},c,E=!1,h=!1,x=!1;if(C.levels.forEach(function(M){var I=M.attrs;E=E||!!(M.width&&M.height),h=h||!!M.videoCodec,x=x||!!M.audioCodec,f&&M.audioCodec&&M.audioCodec.indexOf("mp4a.40.34")!==-1&&(M.audioCodec=void 0);var b=M.bitrate+"-"+M.attrs.RESOLUTION+"-"+M.attrs.CODECS;c=v[b],c?c.url.push(M.url):(c=new $.Level(M),v[b]=c,L.push(c)),I&&(I.AUDIO&&Object(W.addGroupId)(c,"audio",I.AUDIO),I.SUBTITLES&&Object(W.addGroupId)(c,"text",I.SUBTITLES))}),(E||h)&&x&&(L=L.filter(function(M){var I=M.videoCodec,b=M.width,K=M.height;return!!I||!!(b&&K)})),L=L.filter(function(M){var I=M.audioCodec,b=M.videoCodec;return(!I||Object(G.isCodecSupportedInMp4)(I,"audio"))&&(!b||Object(G.isCodecSupportedInMp4)(b,"video"))}),C.audioTracks&&(A=C.audioTracks.filter(function(M){return!M.audioCodec||Object(G.isCodecSupportedInMp4)(M.audioCodec,"audio")}),Object(W.assignTrackIdsByGroup)(A)),C.subtitles&&(_=C.subtitles,Object(W.assignTrackIdsByGroup)(_)),L.length>0){T=L[0].bitrate,L.sort(function(M,I){return M.bitrate-I.bitrate}),this._levels=L;for(var U=0;U<L.length;U++)if(L[U].bitrate===T){this._firstLevel=U,this.log("manifest loaded, "+L.length+" level(s) found, first bitrate: "+T);break}var F=x&&!h,S={levels:L,audioTracks:A,subtitleTracks:_,firstLevel:this._firstLevel,stats:C.stats,audio:x,video:h,altAudio:!F&&A.some(function(M){return!!M.url})};this.hls.trigger(j.Events.MANIFEST_PARSED,S),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(j.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:C.url,reason:"no level with compatible codecs found in manifest"})},o.onError=function(w,C){if(d.prototype.onError.call(this,w,C),C.fatal)return;var L=C.context,A=this._levels[this.currentLevelIndex];if(L&&(L.type===D.PlaylistContextType.AUDIO_TRACK&&A.audioGroupIds&&L.groupId===A.audioGroupIds[A.urlId]||L.type===D.PlaylistContextType.SUBTITLE_TRACK&&A.textGroupIds&&L.groupId===A.textGroupIds[A.urlId])){this.redundantFailover(this.currentLevelIndex);return}var _=!1,T=!0,v;switch(C.details){case P.ErrorDetails.FRAG_LOAD_ERROR:case P.ErrorDetails.FRAG_LOAD_TIMEOUT:case P.ErrorDetails.KEY_LOAD_ERROR:case P.ErrorDetails.KEY_LOAD_TIMEOUT:if(C.frag){var c=this._levels[C.frag.level];c?(c.fragmentError++,c.fragmentError>this.hls.config.fragLoadingMaxRetry&&(v=C.frag.level)):v=C.frag.level}break;case P.ErrorDetails.LEVEL_LOAD_ERROR:case P.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(T=!1),v=L.level),_=!0;break;case P.ErrorDetails.REMUX_ALLOC_ERROR:v=C.level,_=!0;break}v!==void 0&&this.recoverLevel(C,v,_,T)},o.recoverLevel=function(w,C,L,A){var _=w.details,T=this._levels[C];if(T.loadError++,L){var v=this.retryLoadingOrFail(w);if(v)w.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(A){var c=T.url.length;if(c>1&&T.loadError<c)w.levelRetry=!0,this.redundantFailover(C);else if(this.manualLevelIndex===-1){var E=C===0?this._levels.length-1:C-1;this.currentLevelIndex!==E&&this._levels[E].loadError===0&&(this.warn(_+": switch to "+E),w.levelRetry=!0,this.hls.nextAutoLevel=E)}}},o.redundantFailover=function(w){var C=this._levels[w],L=C.url.length;if(L>1){var A=(C.urlId+1)%L;this.warn("Switching to redundant URL-id "+A),this._levels.forEach(function(_){_.urlId=A}),this.level=w}},o.onFragLoaded=function(w,C){var L=C.frag;if(L!==void 0&&L.type===D.PlaylistLevelType.MAIN){var A=this._levels[L.level];A!==void 0&&(A.fragmentError=0,A.loadError=0)}},o.onLevelLoaded=function(w,C){var L,A=C.level,_=C.details,T=this._levels[A];if(!T){var v;this.warn("Invalid level index "+A),(v=C.deliveryDirectives)!==null&&v!==void 0&&v.skip&&(_.deltaUpdateFailed=!0);return}A===this.currentLevelIndex?(T.fragmentError===0&&(T.loadError=0,this.retryCount=0),this.playlistLoaded(A,C,T.details)):(L=C.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(_.deltaUpdateFailed=!0)},o.onAudioTrackSwitched=function(w,C){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var A=-1,_=this.hls.audioTracks[C.id].groupId,T=0;T<L.audioGroupIds.length;T++)if(L.audioGroupIds[T]===_){A=T;break}A!==L.urlId&&(L.urlId=A,this.startLoad())}},o.loadPlaylist=function(w){var C=this.currentLevelIndex,L=this._levels[C];if(this.canLoad&&L&&L.url.length>0){var A=L.urlId,_=L.url[A];if(w)try{_=w.addDirectives(_)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Attempt loading level index "+C+(w?" at sn "+w.msn+" part "+w.part:"")+" with URL-id "+A+" "+_),this.clearTimer(),this.hls.trigger(j.Events.LEVEL_LOADING,{url:_,level:C,id:A,deliveryDirectives:w||null})}},o.removeLevel=function(w,C){var L=function(T,v){return v!==C},A=this._levels.filter(function(_,T){return T!==w?!0:_.url.length>1&&C!==void 0?(_.url=_.url.filter(L),_.audioGroupIds&&(_.audioGroupIds=_.audioGroupIds.filter(L)),_.textGroupIds&&(_.textGroupIds=_.textGroupIds.filter(L)),_.urlId=0,!0):!1}).map(function(_,T){var v=_.details;return v!=null&&v.fragments&&v.fragments.forEach(function(c){c.level=T}),_});this._levels=A,this.hls.trigger(j.Events.LEVELS_UPDATED,{levels:A})},p(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(w){var C,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===w&&(C=L[w])!==null&&C!==void 0&&C.details)return;if(w<0||w>=L.length){var A=w<0;if(this.hls.trigger(j.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.LEVEL_SWITCH_ERROR,level:w,fatal:A,reason:"invalid level idx"}),A)return;w=Math.min(w,L.length-1)}this.clearTimer();var _=this.currentLevelIndex,T=L[_],v=L[w];this.log("switching to level "+w+" from "+_),this.currentLevelIndex=w;var c=y({},v,{level:w,maxBitrate:v.maxBitrate,uri:v.uri,urlId:v.urlId});delete c._urlId,this.hls.trigger(j.Events.LEVEL_SWITCHING,c);var E=v.details;if(!E||E.live){var h=this.switchParams(v.uri,T==null?void 0:T.details);this.loadPlaylist(h)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(w){this.manualLevelIndex=w,this._startLevel===void 0&&(this._startLevel=w),w!==-1&&(this.level=w)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(w){this._firstLevel=w}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var w=this.hls.config.startLevel;return w!==void 0?w:this._firstLevel}else return this._startLevel},set:function(w){this._startLevel=w}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(w){this.level=w,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=w)}}]),i}(n.default)},"./src/controller/level-helper.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"addGroupId",function(){return P}),N.d(V,"assignTrackIdsByGroup",function(){return G}),N.d(V,"updatePTS",function(){return W}),N.d(V,"updateFragPTSDTS",function(){return D}),N.d(V,"mergeDetails",function(){return y}),N.d(V,"mapPartIntersection",function(){return g}),N.d(V,"mapFragmentIntersection",function(){return p}),N.d(V,"adjustSliding",function(){return l}),N.d(V,"addSliding",function(){return a}),N.d(V,"computeReloadInterval",function(){return f}),N.d(V,"getFragmentWithSN",function(){return u}),N.d(V,"getPartWith",function(){return d});var $=N("./src/polyfills/number.ts"),j=N("./src/utils/logger.ts");function P(i,o,O){switch(o){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(O);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(O);break}}function G(i){var o={};i.forEach(function(O){var w=O.groupId||"";O.id=o[w]=o[w]||0,o[w]++})}function W(i,o,O){var w=i[o],C=i[O];n(w,C)}function n(i,o){var O=o.startPTS;if(Object($.isFiniteNumber)(O)){var w=0,C;o.sn>i.sn?(w=O-i.start,C=i):(w=i.start-O,C=o),C.duration!==w&&(C.duration=w)}else if(o.sn>i.sn){var L=i.cc===o.cc;L&&i.minEndPTS?o.start=i.start+(i.minEndPTS-i.start):o.start=i.start+i.duration}else o.start=Math.max(i.start-o.duration,0)}function D(i,o,O,w,C,L){var A=w-O;A<=0&&(j.logger.warn("Fragment should have a positive duration",o),w=O+o.duration,L=C+o.duration);var _=O,T=w,v=o.startPTS,c=o.endPTS;if(Object($.isFiniteNumber)(v)){var E=Math.abs(v-O);Object($.isFiniteNumber)(o.deltaPTS)?o.deltaPTS=Math.max(E,o.deltaPTS):o.deltaPTS=E,_=Math.max(O,v),O=Math.min(O,v),C=Math.min(C,o.startDTS),T=Math.min(w,c),w=Math.max(w,c),L=Math.max(L,o.endDTS)}o.duration=w-O;var h=O-o.start;o.appendedPTS=w,o.start=o.startPTS=O,o.maxStartPTS=_,o.startDTS=C,o.endPTS=w,o.minEndPTS=T,o.endDTS=L;var x=o.sn;if(!i||x<i.startSN||x>i.endSN)return 0;var U,F=x-i.startSN,S=i.fragments;for(S[F]=o,U=F;U>0;U--)n(S[U],S[U-1]);for(U=F;U<S.length-1;U++)n(S[U],S[U+1]);return i.fragmentHint&&n(S[S.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,h}function y(i,o){for(var O=null,w=i.fragments,C=w.length-1;C>=0;C--){var L=w[C].initSegment;if(L){O=L;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var A=0,_;if(p(i,o,function(U,F){U.relurl&&(A=U.cc-F.cc),Object($.isFiniteNumber)(U.startPTS)&&Object($.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&&(_=F),o.PTSKnown=o.alignedSliding=!0),F.elementaryStreams=U.elementaryStreams,F.loader=U.loader,F.stats=U.stats,F.urlId=U.urlId,U.initSegment&&(F.initSegment=U.initSegment,O=U.initSegment)}),O){var T=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments;T.forEach(function(U){var F;(!U.initSegment||U.initSegment.relurl===((F=O)===null||F===void 0?void 0:F.relurl))&&(U.initSegment=O)})}if(o.skippedSegments&&(o.deltaUpdateFailed=o.fragments.some(function(U){return!U}),o.deltaUpdateFailed)){j.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var v=o.skippedSegments;v--;)o.fragments.shift();o.startSN=o.fragments[0].sn,o.startCC=o.fragments[0].cc}var c=o.fragments;if(A){j.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E<c.length;E++)c[E].cc+=A}o.skippedSegments&&(o.startCC=o.fragments[0].cc),g(i.partList,o.partList,function(U,F){F.elementaryStreams=U.elementaryStreams,F.stats=U.stats}),_?D(o,_,_.startPTS,_.endPTS,_.startDTS,_.endDTS):l(i,o),c.length&&(o.totalduration=o.edge-c[0].start),o.driftStartTime=i.driftStartTime,o.driftStart=i.driftStart;var h=o.advancedDateTime;if(o.advanced&&h){var x=o.edge;o.driftStart||(o.driftStartTime=h,o.driftStart=x),o.driftEndTime=h,o.driftEnd=x}else o.driftEndTime=i.driftEndTime,o.driftEnd=i.driftEnd,o.advancedDateTime=i.advancedDateTime}function g(i,o,O){if(i&&o)for(var w=0,C=0,L=i.length;C<=L;C++){var A=i[C],_=o[C+w];A&&_&&A.index===_.index&&A.fragment.sn===_.fragment.sn?O(A,_):w--}}function p(i,o,O){for(var w=o.skippedSegments,C=Math.max(i.startSN,o.startSN)-o.startSN,L=(i.fragmentHint?1:0)+(w?o.endSN:Math.min(i.endSN,o.endSN))-o.startSN,A=o.startSN-i.startSN,_=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,T=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,v=C;v<=L;v++){var c=T[A+v],E=_[v];w&&!E&&v<w&&(E=o.fragments[v]=c),c&&E&&O(c,E)}}function l(i,o){var O=o.startSN+o.skippedSegments-i.startSN,w=i.fragments;if(O<0||O>=w.length)return;a(o,w[O].start)}function a(i,o){if(o){for(var O=i.fragments,w=i.skippedSegments;w<O.length;w++)O[w].start+=o;i.fragmentHint&&(i.fragmentHint.start+=o)}}function f(i,o){var O=1e3*i.levelTargetDuration,w=O/2,C=i.age,L=C>0&&C<O*3,A=o.loading.end-o.loading.start,_,T=i.availabilityDelay;if(i.updated===!1)if(L){var v=333*i.misses;_=Math.max(Math.min(w,A*2),v),i.availabilityDelay=(i.availabilityDelay||0)+_}else _=w;else L?(T=Math.min(T||O/2,C),i.availabilityDelay=T,_=T+O-C):_=O-A;return Math.round(_)}function u(i,o,O){if(!i||!i.details)return null;var w=i.details,C=w.fragments[o-w.startSN];return C||(C=w.fragmentHint,C&&C.sn===o?C:o<w.startSN&&O&&O.sn===o?O:null)}function d(i,o,O){if(!i||!i.details)return null;var w=i.details.partList;if(w)for(var C=w.length;C--;){var L=w[C];if(L.index===O&&L.fragment.sn===o)return L}return null}},"./src/controller/stream-controller.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return w});var $=N("./src/polyfills/number.ts"),j=N("./src/controller/base-stream-controller.ts"),P=N("./src/is-supported.ts"),G=N("./src/events.ts"),W=N("./src/utils/buffer-helper.ts"),n=N("./src/controller/fragment-tracker.ts"),D=N("./src/types/loader.ts"),y=N("./src/loader/fragment.ts"),g=N("./src/demux/transmuxer-interface.ts"),p=N("./src/types/transmuxer.ts"),l=N("./src/controller/gap-controller.ts"),a=N("./src/errors.ts"),f=N("./src/utils/logger.ts");function u(C,L){for(var A=0;A<L.length;A++){var _=L[A];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(C,_.key,_)}}function d(C,L,A){return L&&u(C.prototype,L),A&&u(C,A),C}function i(C,L){C.prototype=Object.create(L.prototype),C.prototype.constructor=C,o(C,L)}function o(C,L){return o=Object.setPrototypeOf||function(_,T){return _.__proto__=T,_},o(C,L)}var O=100,w=function(C){i(L,C);function L(_,T){var v;return v=C.call(this,_,T,"[stream-controller]")||this,v.audioCodecSwap=!1,v.gapController=null,v.level=-1,v._forceStartLoad=!1,v.altAudio=!1,v.audioOnly=!1,v.fragPlaying=null,v.onvplaying=null,v.onvseeked=null,v.fragLastKbps=0,v.stalled=!1,v.couldBacktrack=!1,v.audioCodecSwitch=!1,v.videoBuffer=null,v._registerListeners(),v}var A=L.prototype;return A._registerListeners=function(){var T=this.hls;T.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),T.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),T.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),T.on(G.Events.ERROR,this.onError,this),T.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),T.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),T.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var T=this.hls;T.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),T.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),T.off(G.Events.ERROR,this.onError,this),T.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),T.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),T.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},A.startLoad=function(T){if(this.levels){var v=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(O),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var E=c.startLevel;E===-1&&(c.config.testBandwidth?(E=0,this.bitrateTest=!0):E=c.nextAutoLevel),this.level=c.nextLoadLevel=E,this.loadedmetadata=!1}v>0&&T===-1&&(this.log("Override startPosition with lastCurrentTime @"+v.toFixed(3)),T=v),this.state=j.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=T,this.tick()}else this._forceStartLoad=!0,this.state=j.State.STOPPED},A.stopLoad=function(){this._forceStartLoad=!1,C.prototype.stopLoad.call(this)},A.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_LEVEL:{var T,v=this.levels,c=this.level,E=v==null||((T=v[c])===null||T===void 0)?void 0:T.details;if(E&&(!E.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(E))break;this.state=j.State.IDLE;break}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var h,x=self.performance.now(),U=this.retryDate;(!U||x>=U||(h=this.media)!==null&&h!==void 0&&h.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=j.State.IDLE)}break;default:break}this.onTickEnd()},A.onTickEnd=function(){C.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},A.doTickIdle=function(){var T,v,c=this.hls,E=this.levelLastLoaded,h=this.levels,x=this.media,U=c.config,F=c.nextLoadLevel;if(E===null||!x&&(this.startFragRequested||!U.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!h||!h[F])return;var S=h[F];this.level=c.nextLoadLevel=F;var M=S.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:x,D.PlaylistLevelType.MAIN);if(I===null)return;var b=I.len,K=this.getMaxBufferLength(S.maxBitrate);if(b>=K)return;if(this._streamEnded(I,M)){var Q={};this.altAudio&&(Q.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,Q),this.state=j.State.ENDED;return}var ne=I.end,fe=this.getNextFragment(ne,M);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var we=fe.sn-M.startSN;we>1&&(fe=M.fragments[we-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===n.FragmentState.OK&&this.nextLoadPosition>ne){var Se=this.audioOnly&&!this.altAudio?y.ElementaryStreamTypes.AUDIO:y.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(x,Se,D.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,M)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((T=fe.decryptdata)===null||T===void 0?void 0:T.keyFormat)==="identity"&&!((v=fe.decryptdata)!==null&&v!==void 0&&v.key)?this.loadKey(fe,M):this.loadFragment(fe,M,ne)},A.loadFragment=function(T,v,c){var E,h=this.fragmentTracker.getState(T);if(this.fragCurrent=T,h===n.FragmentState.BACKTRACKED){var x=this.fragmentTracker.getBacktrackData(T);if(x){this._handleFragmentLoadProgress(x),this._handleFragmentLoadComplete(x);return}else h=n.FragmentState.NOT_LOADED}h===n.FragmentState.NOT_LOADED||h===n.FragmentState.PARTIAL?T.sn==="initSegment"?this._loadInitSegment(T):this.bitrateTest?(T.bitrateTest=!0,this.log("Fragment "+T.sn+" of level "+T.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(T)):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,T,v,c)):h===n.FragmentState.APPENDING?this.reduceMaxBufferLength(T.duration)&&this.fragmentTracker.removeFragment(T):((E=this.media)===null||E===void 0?void 0:E.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},A.getAppendedFrag=function(T){var v=this.fragmentTracker.getAppendedFrag(T,D.PlaylistLevelType.MAIN);return v&&"fragment"in v?v.fragment:v},A.getBufferedFrag=function(T){return this.fragmentTracker.getBufferedFrag(T,D.PlaylistLevelType.MAIN)},A.followingBufferedFrag=function(T){return T?this.getBufferedFrag(T.end+.5):null},A.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},A.nextLevelSwitch=function(){var T=this.levels,v=this.media;if(v!=null&&v.readyState){var c,E=this.getAppendedFrag(v.currentTime);if(E&&E.start>1&&this.flushMainBuffer(0,E.start-1),!v.paused&&T){var h=this.hls.nextLoadLevel,x=T[h],U=this.fragLastKbps;U&&this.fragCurrent?c=this.fragCurrent.duration*x.maxBitrate/(1e3*U)+1:c=0}else c=0;var F=this.getBufferedFrag(v.currentTime+c);if(F){var S=this.followingBufferedFrag(F);if(S){this.abortCurrentFrag();var M=S.maxStartPTS?S.maxStartPTS:S.start,I=S.duration,b=Math.max(F.end,M+Math.min(Math.max(I-this.config.maxFragLookUpTolerance,I*.5),I*.75));this.flushMainBuffer(b,Number.POSITIVE_INFINITY)}}}},A.abortCurrentFrag=function(){var T=this.fragCurrent;this.fragCurrent=null,T!=null&&T.loader&&T.loader.abort(),this.state===j.State.KEY_LOADING&&(this.state=j.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},A.flushMainBuffer=function(T,v){C.prototype.flushMainBuffer.call(this,T,v,this.altAudio?"video":null)},A.onMediaAttached=function(T,v){C.prototype.onMediaAttached.call(this,T,v);var c=v.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new l.default(this.config,c,this.fragmentTracker,this.hls)},A.onMediaDetaching=function(){var T=this.media;T&&(T.removeEventListener("playing",this.onvplaying),T.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),C.prototype.onMediaDetaching.call(this)},A.onMediaPlaying=function(){this.tick()},A.onMediaSeeked=function(){var T=this.media,v=T?T.currentTime:null;Object($.isFiniteNumber)(v)&&this.log("Media seeked to "+v.toFixed(3)),this.tick()},A.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},A.onManifestParsed=function(T,v){var c=!1,E=!1,h;v.levels.forEach(function(x){h=x.audioCodec,h&&(h.indexOf("mp4a.40.2")!==-1&&(c=!0),h.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=c&&E&&!Object(P.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=v.levels,this.startFragRequested=!1},A.onLevelLoading=function(T,v){var c=this.levels;if(!c||this.state!==j.State.IDLE)return;var E=c[v.level];(!E.details||E.details.live&&this.levelLastLoaded!==v.level||this.waitForCdnTuneIn(E.details))&&(this.state=j.State.WAITING_LEVEL)},A.onLevelLoaded=function(T,v){var c,E=this.levels,h=v.level,x=v.details,U=x.totalduration;if(!E){this.warn("Levels were reset while loading level "+h);return}this.log("Level "+h+" loaded ["+x.startSN+","+x.endSN+"], cc ["+x.startCC+", "+x.endCC+"] duration:"+U);var F=this.fragCurrent;F&&(this.state===j.State.FRAG_LOADING||this.state===j.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==v.level&&F.loader&&(this.state=j.State.IDLE,F.loader.abort()));var S=E[h],M=0;if(x.live||(c=S.details)!==null&&c!==void 0&&c.live){if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed)return;M=this.alignPlaylists(x,S.details)}if(S.details=x,this.levelLastLoaded=h,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:x,level:h}),this.state===j.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(x))return;this.state=j.State.IDLE}this.startFragRequested?x.live&&this.synchronizeToLiveEdge(x):this.setStartPosition(x,M),this.tick()},A._handleFragmentLoadProgress=function(T){var v,c=T.frag,E=T.part,h=T.payload,x=this.levels;if(!x){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var U=x[c.level],F=U.details;if(!F){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var S=U.videoCodec,M=F.PTSKnown||!F.live,I=(v=c.initSegment)===null||v===void 0?void 0:v.data,b=this._getAudioCodec(U),K=this.transmuxer=this.transmuxer||new g.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Q=E?E.index:-1,ne=Q!==-1,fe=new p.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,h.byteLength,Q,ne),we=this.initPTS[c.cc];K.push(h,I,b,S,c,E,F.totalduration,M,fe,we)},A.onAudioTrackSwitching=function(T,v){var c=this.altAudio,E=!!v.url,h=v.id;if(!E){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var x=this.fragCurrent;x!=null&&x.loader&&(this.log("Switching to main audio track, cancel main fragment load"),x.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var U=this.hls;c&&U.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),U.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:h})}},A.onAudioTrackSwitched=function(T,v){var c=v.id,E=!!this.hls.audioTracks[c].url;if(E){var h=this.videoBuffer;h&&this.mediaBuffer!==h&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=h)}this.altAudio=E,this.tick()},A.onBufferCreated=function(T,v){var c=v.tracks,E,h,x=!1;for(var U in c){var F=c[U];if(F.id==="main"){if(h=U,E=F,U==="video"){var S=c[U];S&&(this.videoBuffer=S.buffer)}}else x=!0}x&&E?(this.log("Alternate track found, use "+h+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},A.onFragBuffered=function(T,v){var c=v.frag,E=v.part;if(c&&c.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(E?" p: "+E.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===j.State.PARSED&&(this.state=j.State.IDLE);return}var h=E?E.stats:c.stats;this.fragLastKbps=Math.round(8*h.total/(h.buffering.end-h.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,E)},A.onError=function(T,v){switch(v.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,v);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==j.State.ERROR&&(v.fatal?(this.warn(""+v.details),this.state=j.State.ERROR):!v.levelRetry&&this.state===j.State.WAITING_LEVEL&&(this.state=j.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(v.parent==="main"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var c=!0,E=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);E&&E.len>.5&&(c=!this.reduceMaxBufferLength(E.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},A.checkBuffer=function(){var T=this.media,v=this.gapController;if(!T||!v||!T.readyState)return;var c=W.BufferHelper.getBuffered(T);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):v.poll(this.lastCurrentTime),this.lastCurrentTime=T.currentTime},A.onFragLoadEmergencyAborted=function(){this.state=j.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},A.onBufferFlushed=function(T,v){var c=v.type;if(c!==y.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var E=(c===y.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(E,c,D.PlaylistLevelType.MAIN)}},A.onLevelsUpdated=function(T,v){this.levels=v.levels},A.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},A.seekToStartPos=function(){var T=this.media,v=T.currentTime,c=this.startPosition;if(c>=0&&v<c){if(T.seeking){f.logger.log("could not seek to "+c+", already seeking at "+v);return}var E=W.BufferHelper.getBuffered(T),h=E.length?E.start(0):0,x=h-c;x>0&&(x<this.config.maxBufferHole||x<this.config.maxFragLookUpTolerance)&&(f.logger.log("adjusting start position by "+x+" to match buffer start"),c+=x,this.startPosition=c),this.log("seek to target start position "+c+" from current time "+v),T.currentTime=c}},A._getAudioCodec=function(T){var v=this.config.defaultAudioCodec||T.audioCodec;return this.audioCodecSwap&&v&&(this.log("Swapping audio codec"),v.indexOf("mp4a.40.5")!==-1?v="mp4a.40.2":v="mp4a.40.5"),v},A._loadBitrateTestFrag=function(T){var v=this;this._doFragLoad(T).then(function(c){var E=v.hls;if(!c||E.nextLoadLevel||v.fragContextChanged(T))return;v.fragLoadError=0,v.state=j.State.IDLE,v.startFragRequested=!1,v.bitrateTest=!1;var h=T.stats;h.parsing.start=h.parsing.end=h.buffering.start=h.buffering.end=self.performance.now(),E.trigger(G.Events.FRAG_LOADED,c)})},A._handleTransmuxComplete=function(T){var v,c="main",E=this.hls,h=T.remuxResult,x=T.chunkMeta,U=this.getCurrentContext(x);if(!U){this.warn("The loading context changed while buffering fragment "+x.sn+" of level "+x.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(x.level);return}var F=U.frag,S=U.part,M=U.level,I=h.video,b=h.text,K=h.id3,Q=h.initSegment,ne=this.altAudio?void 0:h.audio;if(this.fragContextChanged(F))return;if(this.state=j.State.PARSING,Q){Q.tracks&&(this._bufferInitSegment(M,Q.tracks,F,x),E.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:c,tracks:Q.tracks}));var fe=Q.initPTS,we=Q.timescale;Object($.isFiniteNumber)(fe)&&(this.initPTS[F.cc]=fe,E.trigger(G.Events.INIT_PTS_FOUND,{frag:F,id:c,initPTS:fe,timescale:we}))}if(I&&h.independent!==!1){if(M.details){var Se=I.startPTS,he=I.endPTS,se=I.startDTS,me=I.endDTS;if(S)S.elementaryStreams[I.type]={startPTS:Se,endPTS:he,startDTS:se,endDTS:me};else if(I.firstKeyFrame&&I.independent&&(this.couldBacktrack=!0),I.dropped&&I.independent){var re=this.getLoadPosition()+this.config.maxBufferHole;if(re<Se){this.backtrack(F);return}F.setElementaryStreamInfo(I.type,F.start,he,F.start,me,!0)}F.setElementaryStreamInfo(I.type,Se,he,se,me),this.bufferFragmentData(I,F,S,x)}}else if(h.independent===!1){this.backtrack(F);return}if(ne){var le=ne.startPTS,Z=ne.endPTS,ae=ne.startDTS,oe=ne.endDTS;S&&(S.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:le,endPTS:Z,startDTS:ae,endDTS:oe}),F.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,le,Z,ae,oe),this.bufferFragmentData(ne,F,S,x)}if(K!=null&&(v=K.samples)!==null&&v!==void 0&&v.length){var ge={frag:F,id:c,samples:K.samples};E.trigger(G.Events.FRAG_PARSING_METADATA,ge)}if(b){var Re={frag:F,id:c,samples:b.samples};E.trigger(G.Events.FRAG_PARSING_USERDATA,Re)}},A._bufferInitSegment=function(T,v,c,E){var h=this;if(this.state!==j.State.PARSING)return;this.audioOnly=!!v.audio&&!v.video,this.altAudio&&!this.audioOnly&&delete v.audio;var x=v.audio,U=v.video,F=v.audiovideo;if(x){var S=T.audioCodec,M=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(S&&(S.indexOf("mp4a.40.5")!==-1?S="mp4a.40.2":S="mp4a.40.5"),x.metadata.channelCount!==1&&M.indexOf("firefox")===-1&&(S="mp4a.40.5")),M.indexOf("android")!==-1&&x.container!=="audio/mpeg"&&(S="mp4a.40.2",this.log("Android: force audio codec to "+S)),T.audioCodec&&T.audioCodec!==S&&this.log('Swapping manifest audio codec "'+T.audioCodec+'" for "'+S+'"'),x.levelCodec=S,x.id="main",this.log("Init audio buffer, container:"+x.container+", codecs[selected/level/parsed]=["+(S||"")+"/"+(T.audioCodec||"")+"/"+x.codec+"]")}U&&(U.levelCodec=T.videoCodec,U.id="main",this.log("Init video buffer, container:"+U.container+", codecs[level/parsed]=["+(T.videoCodec||"")+"/"+U.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(T.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(G.Events.BUFFER_CODECS,v),Object.keys(v).forEach(function(I){var b=v[I],K=b.initSegment;K!=null&&K.byteLength&&h.hls.trigger(G.Events.BUFFER_APPENDING,{type:I,data:K,frag:c,part:null,chunkMeta:E,parent:c.type})}),this.tick()},A.backtrack=function(T){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(T);var v=this.fragmentTracker.backtrack(T);this.fragPrevious=null,this.nextLoadPosition=T.start,v?this.resetFragmentLoading(T):this.state=j.State.BACKTRACKING},A.checkFragmentChanged=function(){var T=this.media,v=null;if(T&&T.readyState>1&&T.seeking===!1){var c=T.currentTime;if(W.BufferHelper.isBuffered(T,c)?v=this.getAppendedFrag(c):W.BufferHelper.isBuffered(T,c+.1)&&(v=this.getAppendedFrag(c+.1)),v){var E=this.fragPlaying,h=v.level;(!E||v.sn!==E.sn||E.level!==h||v.urlId!==E.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:v}),(!E||E.level!==h)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:h}),this.fragPlaying=v)}}},d(L,[{key:"nextLevel",get:function(){var T=this.nextBufferedFrag;return T?T.level:-1}},{key:"currentLevel",get:function(){var T=this.media;if(T){var v=this.getAppendedFrag(T.currentTime);if(v)return v.level}return-1}},{key:"nextBufferedFrag",get:function(){var T=this.media;if(T){var v=this.getAppendedFrag(T.currentTime);return this.followingBufferedFrag(v)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(j.default)},"./src/controller/subtitle-stream-controller.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"SubtitleStreamController",function(){return i});var $=N("./src/events.ts"),j=N("./src/utils/logger.ts"),P=N("./src/utils/buffer-helper.ts"),G=N("./src/controller/fragment-finders.ts"),W=N("./src/utils/discontinuities.ts"),n=N("./src/controller/level-helper.ts"),D=N("./src/controller/fragment-tracker.ts"),y=N("./src/controller/base-stream-controller.ts"),g=N("./src/types/loader.ts"),p=N("./src/types/level.ts");function l(o,O){for(var w=0;w<O.length;w++){var C=O[w];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(o,C.key,C)}}function a(o,O,w){return O&&l(o.prototype,O),w&&l(o,w),o}function f(o,O){o.prototype=Object.create(O.prototype),o.prototype.constructor=o,u(o,O)}function u(o,O){return u=Object.setPrototypeOf||function(C,L){return C.__proto__=L,C},u(o,O)}var d=500,i=function(o){f(O,o);function O(C,L){var A;return A=o.call(this,C,L,"[subtitle-stream-controller]")||this,A.levels=[],A.currentTrackId=-1,A.tracksBuffered=[],A.mainDetails=null,A._registerListeners(),A}var w=O.prototype;return w.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},w._registerListeners=function(){var L=this.hls;L.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.on($.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.on($.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.on($.Events.ERROR,this.onError,this),L.on($.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.on($.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.on($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.on($.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.on($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w._unregisterListeners=function(){var L=this.hls;L.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.off($.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.off($.Events.ERROR,this.onError,this),L.off($.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.off($.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.off($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.off($.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.off($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w.startLoad=function(){this.stopLoad(),this.state=y.State.IDLE,this.setInterval(d),this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},w.onLevelLoaded=function(L,A){this.mainDetails=A.details},w.onSubtitleFragProcessed=function(L,A){var _=A.frag,T=A.success;if(this.fragPrevious=_,this.state=y.State.IDLE,!T)return;var v=this.tracksBuffered[this.currentTrackId];if(!v)return;for(var c,E=_.start,h=0;h<v.length;h++)if(E>=v[h].start&&E<=v[h].end){c=v[h];break}var x=_.start+_.duration;c?c.end=x:(c={start:E,end:x},v.push(c)),this.fragmentTracker.fragBuffered(_)},w.onBufferFlushing=function(L,A){var _=A.startOffset,T=A.endOffset;if(_===0&&T!==Number.POSITIVE_INFINITY){var v=this.currentTrackId,c=this.levels;if(!c.length||!c[v]||!c[v].details)return;var E=c[v].details,h=E.targetduration,x=T-h;if(x<=0)return;A.endOffsetSubtitles=Math.max(0,x),this.tracksBuffered.forEach(function(U){for(var F=0;F<U.length;){if(U[F].end<=x){U.shift();continue}else if(U[F].start<x)U[F].start=x;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(_,x,g.PlaylistLevelType.SUBTITLE)}},w.onError=function(L,A){var _,T=A.frag;if(!T||T.type!==g.PlaylistLevelType.SUBTITLE)return;(_=this.fragCurrent)!==null&&_!==void 0&&_.loader&&this.fragCurrent.loader.abort(),this.state=y.State.IDLE},w.onSubtitleTracksUpdated=function(L,A){var _=this,T=A.subtitleTracks;this.tracksBuffered=[],this.levels=T.map(function(v){return new p.Level(v)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(v){_.tracksBuffered[v.id]=[]}),this.mediaBuffer=null},w.onSubtitleTrackSwitch=function(L,A){if(this.currentTrackId=A.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var _=this.levels[this.currentTrackId];_!=null&&_.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,_&&this.setInterval(d)},w.onSubtitleTrackLoaded=function(L,A){var _,T=A.details,v=A.id,c=this.currentTrackId,E=this.levels;if(!E.length)return;var h=E[c];if(v>=E.length||v!==c||!h)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,T.live||(_=h.details)!==null&&_!==void 0&&_.live){var x=this.mainDetails;if(T.deltaUpdateFailed||!x)return;var U=x.fragments[0];if(!h.details)T.hasProgramDateTime&&x.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(T,x):U&&Object(n.addSliding)(T,U.start);else{var F=this.alignPlaylists(T,h.details);F===0&&U&&Object(n.addSliding)(T,U.start)}}if(h.details=T,this.levelLastLoaded=v,this.tick(),T.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var S=Object(G.findFragmentByPTS)(null,T.fragments,this.media.currentTime,0);S||(this.warn("Subtitle playlist not aligned with playback"),h.details=void 0)}},w._handleFragmentLoadComplete=function(L){var A=L.frag,_=L.payload,T=A.decryptdata,v=this.hls;if(this.fragContextChanged(A))return;if(_&&_.byteLength>0&&T&&T.key&&T.iv&&T.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(_),T.key.buffer,T.iv.buffer).then(function(E){var h=performance.now();v.trigger($.Events.FRAG_DECRYPTED,{frag:A,payload:E,stats:{tstart:c,tdecrypt:h}})})}},w.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var L,A=this.currentTrackId,_=this.levels;if(!_.length||!_[A]||!_[A].details)return;var T=_[A].details,v=T.targetduration,c=this.config,E=this.media,h=P.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-v,c.maxBufferHole),x=h.end,U=h.len,F=this.getMaxBufferLength()+v;if(U>F)return;console.assert(T,"Subtitle track details are defined on idle subtitle stream controller tick");var S=T.fragments,M=S.length,I=T.edge,b,K=this.fragPrevious;if(x<I){var Q=c.maxFragLookUpTolerance;K&&T.hasProgramDateTime&&(b=Object(G.findFragmentByPDT)(S,K.endProgramDateTime,Q)),b||(b=Object(G.findFragmentByPTS)(K,S,x,Q),!b&&K&&K.start<S[0].start&&(b=S[0]))}else b=S[M-1];(L=b)!==null&&L!==void 0&&L.encrypted?(j.logger.log("Loading key for "+b.sn),this.state=y.State.KEY_LOADING,this.hls.trigger($.Events.KEY_LOADING,{frag:b})):b&&this.fragmentTracker.getState(b)===D.FragmentState.NOT_LOADED&&this.loadFragment(b,T,x)}},w.loadFragment=function(L,A,_){this.fragCurrent=L,o.prototype.loadFragment.call(this,L,A,_)},a(O,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),O}(y.default)},"./src/controller/subtitle-track-controller.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/events.ts"),j=N("./src/utils/texttrack-utils.ts"),P=N("./src/controller/base-playlist-controller.ts"),G=N("./src/types/loader.ts");function W(l,a){for(var f=0;f<a.length;f++){var u=a[f];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(l,u.key,u)}}function n(l,a,f){return a&&W(l.prototype,a),f&&W(l,f),l}function D(l,a){l.prototype=Object.create(a.prototype),l.prototype.constructor=l,y(l,a)}function y(l,a){return y=Object.setPrototypeOf||function(u,d){return u.__proto__=d,u},y(l,a)}var g=function(l){D(a,l);function a(u){var d;return d=l.call(this,u,"[subtitle-track-controller]")||this,d.media=null,d.tracks=[],d.groupId=null,d.tracksInGroup=[],d.trackId=-1,d.selectDefaultTrack=!0,d.queuedDefaultTrack=-1,d.trackChangeListener=function(){return d.onTextTracksChanged()},d.asyncPollTrackChange=function(){return d.pollTrackChange(0)},d.useTextTrackPolling=!1,d.subtitlePollingInterval=-1,d.subtitleDisplay=!0,d.registerListeners(),d}var f=a.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,l.prototype.destroy.call(this)},f.registerListeners=function(){var d=this.hls;d.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on($.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on($.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.on($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),d.on($.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var d=this.hls;d.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off($.Events.LEVEL_LOADING,this.onLevelLoading,this),d.off($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.off($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),d.off($.Events.ERROR,this.onError,this)},f.onMediaAttached=function(d,i){if(this.media=i.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},f.pollTrackChange=function(d){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,d)},f.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var d=p(this.media.textTracks);d.forEach(function(i){Object(j.clearCurrentCues)(i)}),this.subtitleTrack=-1,this.media=null},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(d,i){this.tracks=i.subtitleTracks},f.onSubtitleTrackLoaded=function(d,i){var o=i.id,O=i.details,w=this.trackId,C=this.tracksInGroup[w];if(!C){this.warn("Invalid subtitle track id "+o);return}var L=C.details;C.details=i.details,this.log("subtitle track "+o+" loaded ["+O.startSN+"-"+O.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,i,L))},f.onLevelLoading=function(d,i){this.switchLevel(i.level)},f.onLevelSwitching=function(d,i){this.switchLevel(i.level)},f.switchLevel=function(d){var i=this.hls.levels[d];if(!(i!=null&&i.textGroupIds))return;var o=i.textGroupIds[i.urlId];if(this.groupId!==o){var O=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,w=this.tracks.filter(function(A){return!o||A.groupId===o});this.tracksInGroup=w;var C=this.findTrackId(O==null?void 0:O.name)||this.findTrackId();this.groupId=o;var L={subtitleTracks:w};this.log("Updating subtitle tracks, "+w.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger($.Events.SUBTITLE_TRACKS_UPDATED,L),C!==-1&&this.setSubtitleTrack(C,O)}},f.findTrackId=function(d){for(var i=this.tracksInGroup,o=0;o<i.length;o++){var O=i[o];if((!this.selectDefaultTrack||O.default)&&(!d||d===O.name))return O.id}return-1},f.onError=function(d,i){if(l.prototype.onError.call(this,d,i),i.fatal||!i.context)return;i.context.type===G.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},f.loadPlaylist=function(d){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var o=i.id,O=i.groupId,w=i.url;if(d)try{w=d.addDirectives(w)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Loading subtitle playlist for id "+o),this.hls.trigger($.Events.SUBTITLE_TRACK_LOADING,{url:w,id:o,groupId:O,deliveryDirectives:d||null})}},f.toggleTrackModes=function(d){var i=this,o=this.media,O=this.subtitleDisplay,w=this.trackId;if(!o)return;var C=p(o.textTracks),L=C.filter(function(T){return T.groupId===i.groupId});if(d===-1)[].slice.call(C).forEach(function(T){T.mode="disabled"});else{var A=L[w];A&&(A.mode="disabled")}var _=L[d];_&&(_.mode=O?"showing":"hidden")},f.setSubtitleTrack=function(d,i){var o,O=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=d;return}if(this.trackId!==d&&this.toggleTrackModes(d),this.trackId===d&&(d===-1||(o=O[d])!==null&&o!==void 0&&o.details)||d<-1||d>=O.length)return;this.clearTimer();var w=O[d];if(this.log("Switching to subtitle track "+d),this.trackId=d,w){var C=w.id,L=w.groupId,A=L===void 0?"":L,_=w.name,T=w.type,v=w.url;this.hls.trigger($.Events.SUBTITLE_TRACK_SWITCH,{id:C,groupId:A,name:_,type:T,url:v});var c=this.switchParams(w.url,i==null?void 0:i.details);this.loadPlaylist(c)}else this.hls.trigger($.Events.SUBTITLE_TRACK_SWITCH,{id:d})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var d=-1,i=p(this.media.textTracks),o=0;o<i.length;o++)if(i[o].mode==="hidden")d=o;else if(i[o].mode==="showing"){d=o;break}this.subtitleTrack!==d&&(this.subtitleTrack=d)},n(a,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(d){this.selectDefaultTrack=!1;var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(d,i)}}]),a}(P.default);function p(l){for(var a=[],f=0;f<l.length;f++){var u=l[f];u.kind==="subtitles"&&u.label&&a.push(l[f])}return a}V.default=g},"./src/controller/timeline-controller.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"TimelineController",function(){return p});var $=N("./src/polyfills/number.ts"),j=N("./src/events.ts"),P=N("./src/utils/cea-608-parser.ts"),G=N("./src/utils/output-filter.ts"),W=N("./src/utils/webvtt-parser.ts"),n=N("./src/utils/texttrack-utils.ts"),D=N("./src/utils/imsc1-ttml-parser.ts"),y=N("./src/types/loader.ts"),g=N("./src/utils/logger.ts"),p=function(){function u(i){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),this.captionsProperties=void 0,this.hls=i,this.config=i.config,this.Cues=i.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 o=new G.default(this,"textTrack1"),O=new G.default(this,"textTrack2"),w=new G.default(this,"textTrack3"),C=new G.default(this,"textTrack4");this.cea608Parser1=new P.default(1,o,O),this.cea608Parser2=new P.default(3,w,C)}i.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.on(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.on(j.Events.FRAG_LOADING,this.onFragLoading,this),i.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.on(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.on(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var d=u.prototype;return d.destroy=function(){var o=this.hls;o.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.off(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.off(j.Events.FRAG_LOADING,this.onFragLoading,this),o.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.off(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.off(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.off(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},d.addCues=function(o,O,w,C,L){for(var A=!1,_=L.length;_--;){var T=L[_],v=a(T[0],T[1],O,w);if(v>=0&&(T[0]=Math.min(T[0],O),T[1]=Math.max(T[1],w),A=!0,v/(w-O)>.5))return}if(A||L.push([O,w]),this.config.renderTextTracksNatively){var c=this.captionsTracks[o];this.Cues.newCue(c,O,w,C)}else{var E=this.Cues.newCue(null,O,w,C);this.hls.trigger(j.Events.CUES_PARSED,{type:"captions",cues:E,track:o})}},d.onInitPtsFound=function(o,O){var w=this,C=O.frag,L=O.id,A=O.initPTS,_=O.timescale,T=this.unparsedVttFrags;L==="main"&&(this.initPTS[C.cc]=A,this.timescale[C.cc]=_),T.length&&(this.unparsedVttFrags=[],T.forEach(function(v){w.onFragLoaded(j.Events.FRAG_LOADED,v)}))},d.getExistingTrack=function(o){var O=this.media;if(O)for(var w=0;w<O.textTracks.length;w++){var C=O.textTracks[w];if(C[o])return C}return null},d.createCaptionsTrack=function(o){this.config.renderTextTracksNatively?this.createNativeTrack(o):this.createNonNativeTrack(o)},d.createNativeTrack=function(o){if(this.captionsTracks[o])return;var O=this.captionsProperties,w=this.captionsTracks,C=this.media,L=O[o],A=L.label,_=L.languageCode,T=this.getExistingTrack(o);if(T)w[o]=T,Object(n.clearCurrentCues)(w[o]),Object(n.sendAddTrackEvent)(w[o],C);else{var v=this.createTextTrack("captions",A,_);v&&(v[o]=!0,w[o]=v)}},d.createNonNativeTrack=function(o){if(this.nonNativeCaptionsTracks[o])return;var O=this.captionsProperties[o];if(!O)return;var w=O.label,C={_id:o,label:w,kind:"captions",default:O.media?!!O.media.default:!1,closedCaptions:O.media};this.nonNativeCaptionsTracks[o]=C,this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[C]})},d.createTextTrack=function(o,O,w){var C=this.media;return C?C.addTextTrack(o,O,w):void 0},d.onMediaAttaching=function(o,O){this.media=O.media,this._cleanTracks()},d.onMediaDetaching=function(){var o=this.captionsTracks;Object.keys(o).forEach(function(O){Object(n.clearCurrentCues)(o[O]),delete o[O]}),this.nonNativeCaptionsTracks={}},d.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},d._cleanTracks=function(){var o=this.media;if(!o)return;var O=o.textTracks;if(O)for(var w=0;w<O.length;w++)Object(n.clearCurrentCues)(O[w])},d.onSubtitleTracksUpdated=function(o,O){var w=this;this.textTracks=[];var C=O.subtitleTracks||[],L=C.some(function(v){return v.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var A=this.tracks&&C&&this.tracks.length===C.length;if(this.tracks=C||[],this.config.renderTextTracksNatively){var _=this.media?this.media.textTracks:[];this.tracks.forEach(function(v,c){var E;if(c<_.length){for(var h=null,x=0;x<_.length;x++)if(l(_[x],v)){h=_[x];break}h&&(E=h)}E?Object(n.clearCurrentCues)(E):(E=w.createTextTrack("subtitles",v.name,v.lang),E&&(E.mode="disabled")),E&&(E.groupId=v.groupId,w.textTracks.push(E))})}else if(!A&&this.tracks&&this.tracks.length){var T=this.tracks.map(function(v){return{label:v.name,kind:v.type.toLowerCase(),default:v.default,subtitleTrack:v}});this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:T})}}},d.onManifestLoaded=function(o,O){var w=this;this.config.enableCEA708Captions&&O.captions&&O.captions.forEach(function(C){var L=/(?:CC|SERVICE)([1-4])/.exec(C.instreamId);if(!L)return;var A="textTrack"+L[1],_=w.captionsProperties[A];if(!_)return;_.label=C.name,C.lang&&(_.languageCode=C.lang),_.media=C})},d.onFragLoading=function(o,O){var w=this.cea608Parser1,C=this.cea608Parser2,L=this.lastSn,A=this.lastPartIndex;if(!this.enabled||!(w&&C))return;if(O.frag.type===y.PlaylistLevelType.MAIN){var _,T,v=O.frag.sn,c=(_=O==null||((T=O.part)===null||T===void 0)?void 0:T.index)!=null?_:-1;v===L+1||v===L&&c===A+1||(w.reset(),C.reset()),this.lastSn=v,this.lastPartIndex=c}},d.onFragLoaded=function(o,O){var w=O.frag,C=O.payload,L=this.initPTS,A=this.unparsedVttFrags;if(w.type===y.PlaylistLevelType.SUBTITLE)if(C.byteLength){if(!Object($.isFiniteNumber)(L[w.cc])){A.push(O),L.length&&this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Missing initial subtitle PTS")});return}var _=w.decryptdata;if(_==null||_.key==null||_.method!=="AES-128"){var T=this.tracks[w.level],v=this.vttCCs;v[w.cc]||(v[w.cc]={start:w.start,prevCC:this.prevCC,new:!0},this.prevCC=w.cc),T&&T.textCodec===D.IMSC1_CODEC?this._parseIMSC1(w,C):this._parseVTTs(w,C,v)}}else this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Empty subtitle payload")})},d._parseIMSC1=function(o,O){var w=this,C=this.hls;Object(D.parseIMSC1)(O,this.initPTS[o.cc],this.timescale[o.cc],function(L){w._appendCues(L,o.level),C.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(L){g.logger.log("Failed to parse IMSC1: "+L),C.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:L})})},d._parseVTTs=function(o,O,w){var C=this,L=this.hls;Object(W.parseWebVTT)(O,this.initPTS[o.cc],this.timescale[o.cc],w,o.cc,o.start,function(A){C._appendCues(A,o.level),L.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(A){C._fallbackToIMSC1(o,O),g.logger.log("Failed to parse VTT cue: "+A),L.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:A})})},d._fallbackToIMSC1=function(o,O){var w=this,C=this.tracks[o.level];C.textCodec||Object(D.parseIMSC1)(O,this.initPTS[o.cc],this.timescale[o.cc],function(){C.textCodec=D.IMSC1_CODEC,w._parseIMSC1(o,O)},function(){C.textCodec="wvtt"})},d._appendCues=function(o,O){var w=this.hls;if(this.config.renderTextTracksNatively){var C=this.textTracks[O];if(C.mode==="disabled")return;o.forEach(function(_){return Object(n.addCueToTrack)(C,_)})}else{var L=this.tracks[O],A=L.default?"default":"subtitles"+O;w.trigger(j.Events.CUES_PARSED,{type:"subtitles",cues:o,track:A})}},d.onFragDecrypted=function(o,O){var w=O.frag;if(w.type===y.PlaylistLevelType.SUBTITLE){if(!Object($.isFiniteNumber)(this.initPTS[w.cc])){this.unparsedVttFrags.push(O);return}this.onFragLoaded(j.Events.FRAG_LOADED,O)}},d.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},d.onFragParsingUserdata=function(o,O){var w=this.cea608Parser1,C=this.cea608Parser2;if(!this.enabled||!(w&&C))return;for(var L=0;L<O.samples.length;L++){var A=O.samples[L].bytes;if(A){var _=this.extractCea608Data(A);w.addData(O.samples[L].pts,_[0]),C.addData(O.samples[L].pts,_[1])}}},d.onBufferFlushing=function(o,O){var w=O.startOffset,C=O.endOffset,L=O.endOffsetSubtitles,A=O.type,_=this.media;if(!_||_.currentTime<C)return;if(!A||A==="video"){var T=this.captionsTracks;Object.keys(T).forEach(function(c){return Object(n.removeCuesInRange)(T[c],w,C)})}if(this.config.renderTextTracksNatively&&(w===0&&L!==void 0)){var v=this.textTracks;Object.keys(v).forEach(function(c){return Object(n.removeCuesInRange)(v[c],w,L)})}},d.extractCea608Data=function(o){for(var O=o[0]&31,w=2,C=[[],[]],L=0;L<O;L++){var A=o[w++],_=127&o[w++],T=127&o[w++],v=(4&A)!==0,c=3&A;if(_===0&&T===0)continue;v&&((c===0||c===1)&&(C[c].push(_),C[c].push(T)))}return C},u}();function l(u,d){return u&&u.label===d.name&&!(u.textTrack1||u.textTrack2)}function a(u,d,i,o){return Math.min(d,o)-Math.max(u,i)}function f(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return $});var $=function(){function j(G,W){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=W}var P=j.prototype;return P.decrypt=function(W,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,W)},j}()},"./src/crypt/aes-decryptor.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"removePadding",function(){return j}),N.d(V,"default",function(){return P});var $=N("./src/utils/typed-array.ts");function j(G){var W=G.byteLength,n=W&&new DataView(G.buffer).getUint8(W-1);return n?Object($.sliceUint8)(G,0,W-n):G}var P=function(){function G(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var W=G.prototype;return W.uint8ArrayToUint32Array_=function(D){for(var y=new DataView(D),g=new Uint32Array(4),p=0;p<4;p++)g[p]=y.getUint32(p*4);return g},W.initTable=function(){var D=this.sBox,y=this.invSBox,g=this.subMix,p=g[0],l=g[1],a=g[2],f=g[3],u=this.invSubMix,d=u[0],i=u[1],o=u[2],O=u[3],w=new Uint32Array(256),C=0,L=0,A=0;for(A=0;A<256;A++)A<128?w[A]=A<<1:w[A]=A<<1^283;for(A=0;A<256;A++){var _=L^L<<1^L<<2^L<<3^L<<4;_=_>>>8^_&255^99,D[C]=_,y[_]=C;var T=w[C],v=w[T],c=w[v],E=w[_]*257^_*16843008;p[C]=E<<24|E>>>8,l[C]=E<<16|E>>>16,a[C]=E<<8|E>>>24,f[C]=E,E=c*16843009^v*65537^T*257^C*16843008,d[_]=E<<24|E>>>8,i[_]=E<<16|E>>>16,o[_]=E<<8|E>>>24,O[_]=E,C?(C=T^w[w[w[c^T]]],L^=w[w[L]]):C=L=1}},W.expandKey=function(D){for(var y=this.uint8ArrayToUint32Array_(D),g=!0,p=0;p<y.length&&g;)g=y[p]===this.key[p],p++;if(g)return;this.key=y;var l=this.keySize=y.length;if(l!==4&&l!==6&&l!==8)throw new Error("Invalid aes key size="+l);var a=this.ksRows=(l+6+1)*4,f,u,d=this.keySchedule=new Uint32Array(a),i=this.invKeySchedule=new Uint32Array(a),o=this.sBox,O=this.rcon,w=this.invSubMix,C=w[0],L=w[1],A=w[2],_=w[3],T,v;for(f=0;f<a;f++){if(f<l){T=d[f]=y[f];continue}v=T,f%l===0?(v=v<<8|v>>>24,v=o[v>>>24]<<24|o[v>>>16&255]<<16|o[v>>>8&255]<<8|o[v&255],v^=O[f/l|0]<<24):l>6&&f%l===4&&(v=o[v>>>24]<<24|o[v>>>16&255]<<16|o[v>>>8&255]<<8|o[v&255]),d[f]=T=(d[f-l]^v)>>>0}for(u=0;u<a;u++)f=a-u,u&3?v=d[f]:v=d[f-4],u<4||f<=4?i[u]=v:i[u]=C[o[v>>>24]]^L[o[v>>>16&255]]^A[o[v>>>8&255]]^_[o[v&255]],i[u]=i[u]>>>0},W.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},W.decrypt=function(D,y,g){for(var p=this.keySize+6,l=this.invKeySchedule,a=this.invSBox,f=this.invSubMix,u=f[0],d=f[1],i=f[2],o=f[3],O=this.uint8ArrayToUint32Array_(g),w=O[0],C=O[1],L=O[2],A=O[3],_=new Int32Array(D),T=new Int32Array(_.length),v,c,E,h,x,U,F,S,M,I,b,K,Q,ne,fe=this.networkToHostOrderSwap;y<_.length;){for(M=fe(_[y]),I=fe(_[y+1]),b=fe(_[y+2]),K=fe(_[y+3]),x=M^l[0],U=K^l[1],F=b^l[2],S=I^l[3],Q=4,ne=1;ne<p;ne++)v=u[x>>>24]^d[U>>16&255]^i[F>>8&255]^o[S&255]^l[Q],c=u[U>>>24]^d[F>>16&255]^i[S>>8&255]^o[x&255]^l[Q+1],E=u[F>>>24]^d[S>>16&255]^i[x>>8&255]^o[U&255]^l[Q+2],h=u[S>>>24]^d[x>>16&255]^i[U>>8&255]^o[F&255]^l[Q+3],x=v,U=c,F=E,S=h,Q=Q+4;v=a[x>>>24]<<24^a[U>>16&255]<<16^a[F>>8&255]<<8^a[S&255]^l[Q],c=a[U>>>24]<<24^a[F>>16&255]<<16^a[S>>8&255]<<8^a[x&255]^l[Q+1],E=a[F>>>24]<<24^a[S>>16&255]<<16^a[x>>8&255]<<8^a[U&255]^l[Q+2],h=a[S>>>24]<<24^a[x>>16&255]<<16^a[U>>8&255]<<8^a[F&255]^l[Q+3],T[y]=fe(v^w),T[y+1]=fe(h^C),T[y+2]=fe(E^L),T[y+3]=fe(c^A),w=M,C=I,L=b,A=K,y=y+4}return T.buffer},G}()},"./src/crypt/decrypter.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return y});var $=N("./src/crypt/aes-crypto.ts"),j=N("./src/crypt/fast-aes-key.ts"),P=N("./src/crypt/aes-decryptor.ts"),G=N("./src/utils/logger.ts"),W=N("./src/utils/mp4-tools.ts"),n=N("./src/utils/typed-array.ts"),D=16,y=function(){function g(l,a,f){var u=f===void 0?{}:f,d=u.removePKCS7Padding,i=d===void 0?!0:d;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=l,this.config=a,this.removePKCS7Padding=i,i)try{var o=self.crypto;o&&(this.subtle=o.subtle||o.webkitSubtle)}catch(O){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=g.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var f=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(P.removePadding)(f):f},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(a,f,u,d){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),f,u);var i=this.flush();i&&d(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),f,u).then(d)},p.softwareDecrypt=function(a,f,u){var d=this.currentIV,i=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(a=Object(W.appendUint8Array)(o,a),this.remainderData=null);var O=this.getValidChunk(a);if(!O.length)return null;d&&(u=d);var w=this.softwareDecrypter;w||(w=this.softwareDecrypter=new P.default),w.expandKey(f);var C=i;return this.currentResult=w.decrypt(O.buffer,0,u),this.currentIV=Object(n.sliceUint8)(O,-16).buffer,C||null},p.webCryptoDecrypt=function(a,f,u){var d=this,i=this.subtle;return(this.key!==f||!this.fastAesKey)&&(this.key=f,this.fastAesKey=new j.default(i,f)),this.fastAesKey.expandKey().then(function(o){if(!i)return Promise.reject(new Error("web crypto not initialized"));var O=new $.default(i,u);return O.decrypt(a.buffer,o)}).catch(function(o){return d.onWebCryptoError(o,a,f,u)})},p.onWebCryptoError=function(a,f,u,d){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(f,u,d)},p.getValidChunk=function(a){var f=a,u=a.length-a.length%D;return u!==a.length&&(f=Object(n.sliceUint8)(a,0,u),this.remainderData=Object(n.sliceUint8)(a,u)),f},p.logOnce=function(a){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},g}()},"./src/crypt/fast-aes-key.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return $});var $=function(){function j(G,W){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=W}var P=j.prototype;return P.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},j}()},"./src/demux/aacdemuxer.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/demux/base-audio-demuxer.ts"),j=N("./src/demux/adts.ts"),P=N("./src/utils/logger.ts"),G=N("./src/demux/id3.ts");function W(y,g){y.prototype=Object.create(g.prototype),y.prototype.constructor=y,n(y,g)}function n(y,g){return n=Object.setPrototypeOf||function(l,a){return l.__proto__=a,l},n(y,g)}var D=function(y){W(g,y);function g(l,a){var f;return f=y.call(this)||this,f.observer=void 0,f.config=void 0,f.observer=l,f.config=a,f}var p=g.prototype;return p.resetInitSegment=function(a,f,u){y.prototype.resetInitSegment.call(this,a,f,u),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:u,inputTimeScale:9e4,dropped:0}},g.probe=function(a){if(!a)return!1;for(var f=G.getID3Data(a,0)||[],u=f.length,d=a.length;u<d;u++)if(j.probe(a,u))return P.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(a,f){return j.canParse(a,f)},p.appendFrame=function(a,f,u){j.initTrackConfig(a,this.observer,f,u,a.manifestCodec);var d=j.appendFrame(a,f,u,this.initPTS,this.frameIndex);if(d&&d.missing===0)return d},g}($.default);D.minProbeByteLength=9,V.default=D},"./src/demux/adts.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"getAudioConfig",function(){return G}),N.d(V,"isHeaderPattern",function(){return W}),N.d(V,"getHeaderLength",function(){return n}),N.d(V,"getFullFrameLength",function(){return D}),N.d(V,"canGetFrameLength",function(){return y}),N.d(V,"isHeader",function(){return g}),N.d(V,"canParse",function(){return p}),N.d(V,"probe",function(){return l}),N.d(V,"initTrackConfig",function(){return a}),N.d(V,"getFrameDuration",function(){return f}),N.d(V,"parseFrameHeader",function(){return u}),N.d(V,"appendFrame",function(){return d});var $=N("./src/utils/logger.ts"),j=N("./src/errors.ts"),P=N("./src/events.ts");function G(i,o,O,w){var C,L,A,_,T=navigator.userAgent.toLowerCase(),v=w,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];C=((o[O+2]&192)>>>6)+1;var E=(o[O+2]&60)>>>2;if(E>c.length-1){i.trigger(P.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return A=(o[O+2]&1)<<2,A|=(o[O+3]&192)>>>6,$.logger.log("manifest codec:"+w+", ADTS type:"+C+", samplingIndex:"+E),/firefox/i.test(T)?E>=6?(C=5,_=new Array(4),L=E-3):(C=2,_=new Array(2),L=E):T.indexOf("android")!==-1?(C=2,_=new Array(2),L=E):(C=5,_=new Array(4),w&&(w.indexOf("mp4a.40.29")!==-1||w.indexOf("mp4a.40.5")!==-1)||!w&&E>=6?L=E-3:((w&&w.indexOf("mp4a.40.2")!==-1&&(E>=6&&A===1||/vivaldi/i.test(T))||!w&&A===1)&&(C=2,_=new Array(2)),L=E)),_[0]=C<<3,_[0]|=(E&14)>>1,_[1]|=(E&1)<<7,_[1]|=A<<3,C===5&&(_[1]|=(L&14)>>1,_[2]=(L&1)<<7,_[2]|=2<<2,_[3]=0),{config:_,samplerate:c[E],channelCount:A,codec:"mp4a.40."+C,manifestCodec:v}}function W(i,o){return i[o]===255&&(i[o+1]&246)===240}function n(i,o){return i[o+1]&1?7:9}function D(i,o){return(i[o+3]&3)<<11|i[o+4]<<3|(i[o+5]&224)>>>5}function y(i,o){return o+5<i.length}function g(i,o){return o+1<i.length&&W(i,o)}function p(i,o){return y(i,o)&&W(i,o)&&D(i,o)<=i.length-o}function l(i,o){if(g(i,o)){var O=n(i,o);if(o+O>=i.length)return!1;var w=D(i,o);if(w<=O)return!1;var C=o+w;return C===i.length||g(i,C)}return!1}function a(i,o,O,w,C){if(!i.samplerate){var L=G(o,O,w,C);if(!L)return;i.config=L.config,i.samplerate=L.samplerate,i.channelCount=L.channelCount,i.codec=L.codec,i.manifestCodec=L.manifestCodec,$.logger.log("parsed codec:"+i.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function f(i){return 1024*9e4/i}function u(i,o,O,w,C){var L=n(i,o),A=D(i,o);if(A-=L,A>0){var _=O+w*C;return{headerLength:L,frameLength:A,stamp:_}}}function d(i,o,O,w,C){var L=f(i.samplerate),A=u(o,O,w,C,L);if(A){var _=A.frameLength,T=A.headerLength,v=A.stamp,c=T+_,E=Math.max(0,O+c-o.length),h;E?(h=new Uint8Array(c-T),h.set(o.subarray(O+T,o.length),0)):h=o.subarray(O+T,O+c);var x={unit:h,pts:v};return E||i.samples.push(x),{sample:x,length:c,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"initPTSFn",function(){return D});var $=N("./src/polyfills/number.ts"),j=N("./src/demux/id3.ts"),P=N("./src/demux/dummy-demuxed-track.ts"),G=N("./src/utils/mp4-tools.ts"),W=N("./src/utils/typed-array.ts"),n=function(){function y(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var g=y.prototype;return g.resetInitSegment=function(l,a,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},g.resetTimeStamp=function(){},g.resetContiguity=function(){},g.canParse=function(l,a){return!1},g.appendFrame=function(l,a,f){},g.demux=function(l,a){this.cachedData&&(l=Object(G.appendUint8Array)(this.cachedData,l),this.cachedData=null);var f=j.getID3Data(l,0),u=f?f.length:0,d,i,o=this._audioTrack,O=this._id3Track,w=f?j.getTimeStamp(f):void 0,C=l.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(w,a)),f&&f.length>0&&O.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),i=this.initPTS;u<C;){if(this.canParse(l,u)){var L=this.appendFrame(o,l,u);L?(this.frameIndex++,i=L.sample.pts,u+=L.length,d=u):u=C}else j.canParse(l,u)?(f=j.getID3Data(l,u),O.samples.push({pts:i,dts:i,data:f}),u+=f.length,d=u):u++;if(u===C&&d!==C){var A=Object(W.sliceUint8)(l,d);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,A):this.cachedData=A}}return{audioTrack:o,avcTrack:Object(P.dummyTrack)(),id3Track:O,textTrack:Object(P.dummyTrack)()}},g.demuxSampleAes=function(l,a,f){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},g.flush=function(l){var a=this.cachedData;return a&&(this.cachedData=null,this.demux(a,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(P.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(P.dummyTrack)()}},g.destroy=function(){},y}(),D=function(g,p){return Object($.isFiniteNumber)(g)?g*90:p*9e4};V.default=n},"./src/demux/chunk-cache.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return $});var $=function(){function P(){this.chunks=[],this.dataLength=0}var G=P.prototype;return G.push=function(n){this.chunks.push(n),this.dataLength+=n.length},G.flush=function(){var n=this.chunks,D=this.dataLength,y;if(n.length)n.length===1?y=n[0]:y=j(n,D);else return new Uint8Array(0);return this.reset(),y},G.reset=function(){this.chunks.length=0,this.dataLength=0},P}();function j(P,G){for(var W=new Uint8Array(G),n=0,D=0;D<P.length;D++){var y=P[D];W.set(y,n),n+=y.length}return W}},"./src/demux/dummy-demuxed-track.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"dummyTrack",function(){return $});function $(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/utils/logger.ts"),j=function(){function P(W){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=W,this.bytesAvailable=W.byteLength,this.word=0,this.bitsAvailable=0}var G=P.prototype;return G.loadWord=function(){var n=this.data,D=this.bytesAvailable,y=n.byteLength-D,g=new Uint8Array(4),p=Math.min(4,D);if(p===0)throw new Error("no bytes available");g.set(n.subarray(y,y+p)),this.word=new DataView(g.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},G.skipBits=function(n){var D;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,D=n>>3,n-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},G.readBits=function(n){var D=Math.min(this.bitsAvailable,n),y=this.word>>>32-D;return n>32&&$.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=n-D,D>0&&this.bitsAvailable?y<<D|this.readBits(D):y},G.skipLZ=function(){var n;for(n=0;n<this.bitsAvailable;++n)if((this.word&2147483648>>>n)!==0)return this.word<<=n,this.bitsAvailable-=n,n;return this.loadWord(),n+this.skipLZ()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},G.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(n){for(var D=8,y=8,g,p=0;p<n;p++)y!==0&&(g=this.readEG(),y=(D+g+256)%256),D=y===0?D:y},G.readSPS=function(){var n=0,D=0,y=0,g=0,p,l,a,f=this.readUByte.bind(this),u=this.readBits.bind(this),d=this.readUEG.bind(this),i=this.readBoolean.bind(this),o=this.skipBits.bind(this),O=this.skipEG.bind(this),w=this.skipUEG.bind(this),C=this.skipScalingList.bind(this);f();var L=f();if(u(5),o(3),f(),w(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var A=d();if(A===3&&o(1),w(),w(),o(1),i())for(l=A!==3?8:12,a=0;a<l;a++)i()&&(a<6?C(16):C(64))}w();var _=d();if(_===0)d();else if(_===1)for(o(1),O(),O(),p=d(),a=0;a<p;a++)O();w(),o(1);var T=d(),v=d(),c=u(1);c===0&&o(1),o(1),i()&&(n=d(),D=d(),y=d(),g=d());var E=[1,1];if(i()&&i()){var h=f();switch(h){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:{E=[f()<<8|f(),f()<<8|f()];break}}}return{width:Math.ceil((T+1)*16-n*2-D*2),height:(2-c)*(v+1)*16-(c?2:4)*(y+g),pixelRatio:E}},G.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},P}();V.default=j},"./src/demux/id3.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"isHeader",function(){return $}),N.d(V,"isFooter",function(){return j}),N.d(V,"getID3Data",function(){return P}),N.d(V,"canParse",function(){return W}),N.d(V,"getTimeStamp",function(){return n}),N.d(V,"isTimeStampFrame",function(){return D}),N.d(V,"getID3Frames",function(){return g}),N.d(V,"decodeFrame",function(){return p}),N.d(V,"utf8ArrayToStr",function(){return d}),N.d(V,"testables",function(){return i});var $=function(C,L){return L+10<=C.length&&(C[L]===73&&C[L+1]===68&&C[L+2]===51&&(C[L+3]<255&&C[L+4]<255&&(C[L+6]<128&&C[L+7]<128&&C[L+8]<128&&C[L+9]<128)))},j=function(C,L){return L+10<=C.length&&(C[L]===51&&C[L+1]===68&&C[L+2]===73&&(C[L+3]<255&&C[L+4]<255&&(C[L+6]<128&&C[L+7]<128&&C[L+8]<128&&C[L+9]<128)))},P=function(C,L){for(var A=L,_=0;$(C,L);){_+=10;var T=G(C,L+6);_+=T,j(C,L+10)&&(_+=10),L+=_}return _>0?C.subarray(A,A+_):void 0},G=function(C,L){var A=0;return A=(C[L]&127)<<21,A|=(C[L+1]&127)<<14,A|=(C[L+2]&127)<<7,A|=C[L+3]&127,A},W=function(C,L){return $(C,L)&&G(C,L+6)+10<=C.length-L},n=function(C){for(var L=g(C),A=0;A<L.length;A++){var _=L[A];if(D(_))return u(_)}return},D=function(C){return C&&C.key==="PRIV"&&C.info==="com.apple.streaming.transportStreamTimestamp"},y=function(C){var L=String.fromCharCode(C[0],C[1],C[2],C[3]),A=G(C,4),_=10;return{type:L,size:A,data:C.subarray(_,_+A)}},g=function(C){for(var L=0,A=[];$(C,L);){var _=G(C,L+6);L+=10;for(var T=L+_;L+8<T;){var v=y(C.subarray(L)),c=p(v);c&&A.push(c),L+=v.size+10}j(C,L)&&(L+=10)}return A},p=function(C){return C.type==="PRIV"?l(C):C.type[0]==="W"?f(C):a(C)},l=function(C){if(C.size<2)return;var L=d(C.data,!0),A=new Uint8Array(C.data.subarray(L.length+1));return{key:C.type,info:L,data:A.buffer}},a=function(C){if(C.size<2)return;if(C.type==="TXXX"){var L=1,A=d(C.data.subarray(L),!0);L+=A.length+1;var _=d(C.data.subarray(L));return{key:C.type,info:A,data:_}}var T=d(C.data.subarray(1));return{key:C.type,data:T}},f=function(C){if(C.type==="WXXX"){if(C.size<2)return;var L=1,A=d(C.data.subarray(L),!0);L+=A.length+1;var _=d(C.data.subarray(L));return{key:C.type,info:A,data:_}}var T=d(C.data);return{key:C.type,data:T}},u=function(C){if(C.data.byteLength===8){var L=new Uint8Array(C.data),A=L[3]&1,_=(L[4]<<23)+(L[5]<<15)+(L[6]<<7)+L[7];return _/=45,A&&(_+=4772185884e-2),Math.round(_)}return},d=function(C,L){L===void 0&&(L=!1);var A=O();if(A){var _=A.decode(C);if(L){var T=_.indexOf("\0");return T!==-1?_.substring(0,T):_}return _.replace(/\0/g,"")}for(var v=C.length,c,E,h,x="",U=0;U<v;){if(c=C[U++],c===0&&L)return x;if(c===0||c===3)continue;switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:x+=String.fromCharCode(c);break;case 12:case 13:E=C[U++],x+=String.fromCharCode((c&31)<<6|E&63);break;case 14:E=C[U++],h=C[U++],x+=String.fromCharCode((c&15)<<12|(E&63)<<6|(h&63)<<0);break;default:}}return x},i={decodeTextFrame:a},o;function O(){return!o&&typeof self.TextDecoder!="undefined"&&(o=new self.TextDecoder("utf-8")),o}},"./src/demux/mp3demuxer.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/demux/base-audio-demuxer.ts"),j=N("./src/demux/id3.ts"),P=N("./src/utils/logger.ts"),G=N("./src/demux/mpegaudio.ts");function W(y,g){y.prototype=Object.create(g.prototype),y.prototype.constructor=y,n(y,g)}function n(y,g){return n=Object.setPrototypeOf||function(l,a){return l.__proto__=a,l},n(y,g)}var D=function(y){W(g,y);function g(){return y.apply(this,arguments)||this}var p=g.prototype;return p.resetInitSegment=function(a,f,u){y.prototype.resetInitSegment.call(this,a,f,u),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:u,inputTimeScale:9e4,dropped:0}},g.probe=function(a){if(!a)return!1;for(var f=j.getID3Data(a,0)||[],u=f.length,d=a.length;u<d;u++)if(G.probe(a,u))return P.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(a,f){return G.canParse(a,f)},p.appendFrame=function(a,f,u){return this.initPTS===null?void 0:G.appendFrame(a,f,u,this.initPTS,this.frameIndex)},g}($.default);D.minProbeByteLength=4,V.default=D},"./src/demux/mp4demuxer.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/utils/mp4-tools.ts"),j=N("./src/demux/dummy-demuxed-track.ts"),P=function(){function G(n,D){this.remainderData=null,this.config=void 0,this.config=D}var W=G.prototype;return W.resetTimeStamp=function(){},W.resetInitSegment=function(){},W.resetContiguity=function(){},G.probe=function(D){return Object($.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},W.demux=function(D){var y=D,g=Object(j.dummyTrack)();if(this.config.progressive){this.remainderData&&(y=Object($.appendUint8Array)(this.remainderData,D));var p=Object($.segmentValidRange)(y);this.remainderData=p.remainder,g.samples=p.valid||new Uint8Array}else g.samples=y;return{audioTrack:Object(j.dummyTrack)(),avcTrack:g,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},W.flush=function(){var D=Object(j.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(j.dummyTrack)(),avcTrack:D,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},W.demuxSampleAes=function(D,y,g){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},W.destroy=function(){},G}();P.minProbeByteLength=1024,V.default=P},"./src/demux/mpegaudio.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"appendFrame",function(){return n}),N.d(V,"parseHeader",function(){return D}),N.d(V,"isHeaderPattern",function(){return y}),N.d(V,"isHeader",function(){return g}),N.d(V,"canParse",function(){return p}),N.d(V,"probe",function(){return l});var $=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],P=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],G=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],W=[0,1,1,4];function n(a,f,u,d,i){if(u+24>f.length)return;var o=D(f,u);if(o&&u+o.frameLength<=f.length){var O=o.samplesPerFrame*9e4/o.sampleRate,w=d+i*O,C={unit:f.subarray(u,u+o.frameLength),pts:w,dts:w};return a.config=[],a.channelCount=o.channelCount,a.samplerate=o.sampleRate,a.samples.push(C),{sample:C,length:o.frameLength,missing:0}}}function D(a,f){var u=a[f+1]>>3&3,d=a[f+1]>>1&3,i=a[f+2]>>4&15,o=a[f+2]>>2&3;if(u!==1&&i!==0&&i!==15&&o!==3){var O=a[f+2]>>1&1,w=a[f+3]>>6,C=u===3?3-d:d===3?3:4,L=j[C*14+i-1]*1e3,A=u===3?0:u===2?1:2,_=P[A*3+o],T=w===3?1:2,v=G[u][d],c=W[d],E=v*8*c,h=Math.floor(v*L/_+O)*c;if($===null){var x=navigator.userAgent||"",U=x.match(/Chrome\/(\d+)/i);$=U?parseInt(U[1]):0}var F=!!$&&$<=87;return F&&d===2&&L>=224e3&&w===0&&(a[f+3]=a[f+3]|128),{sampleRate:_,channelCount:T,frameLength:h,samplesPerFrame:E}}}function y(a,f){return a[f]===255&&(a[f+1]&224)===224&&(a[f+1]&6)!==0}function g(a,f){return f+1<a.length&&y(a,f)}function p(a,f){var u=4;return y(a,f)&&u<=a.length-f}function l(a,f){if(f+1<a.length&&y(a,f)){var u=4,d=D(a,f),i=u;d!=null&&d.frameLength&&(i=d.frameLength);var o=f+i;return o===a.length||g(a,o)}return!1}},"./src/demux/sample-aes.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/crypt/decrypter.ts"),j=N("./src/demux/tsdemuxer.ts"),P=function(){function G(n,D,y){this.keyData=void 0,this.decrypter=void 0,this.keyData=y,this.decrypter=new $.default(n,D,{removePKCS7Padding:!1})}var W=G.prototype;return W.decryptBuffer=function(D,y){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,y)},W.decryptAacSample=function(D,y,g,p){var l=D[y].unit,a=l.subarray(16,l.length-l.length%16),f=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),u=this;this.decryptBuffer(f,function(d){var i=new Uint8Array(d);l.set(i,16),p||u.decryptAacSamples(D,y+1,g)})},W.decryptAacSamples=function(D,y,g){for(;;y++){if(y>=D.length){g();return}if(D[y].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(D,y,g,p),!p)return}},W.getAvcEncryptedData=function(D){for(var y=Math.floor((D.length-48)/160)*16+16,g=new Int8Array(y),p=0,l=32;l<=D.length-16;l+=160,p+=16)g.set(D.subarray(l,l+16),p);return g},W.getAvcDecryptedUnit=function(D,y){for(var g=new Uint8Array(y),p=0,l=32;l<=D.length-16;l+=160,p+=16)D.set(g.subarray(p,p+16),l);return D},W.decryptAvcSample=function(D,y,g,p,l,a){var f=Object(j.discardEPB)(l.data),u=this.getAvcEncryptedData(f),d=this;this.decryptBuffer(u.buffer,function(i){l.data=d.getAvcDecryptedUnit(f,i),a||d.decryptAvcSamples(D,y,g+1,p)})},W.decryptAvcSamples=function(D,y,g,p){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;y++,g=0){if(y>=D.length){p();return}for(var l=D[y].units;!(g>=l.length);g++){var a=l[g];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(D,y,g,p,a,f),!f)return}}},G}();V.default=P},"./src/demux/transmuxer-interface.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return l});var $=N("./node_modules/webworkify-webpack/index.js"),j=N.n($),P=N("./src/events.ts"),G=N("./src/demux/transmuxer.ts"),W=N("./src/utils/logger.ts"),n=N("./src/errors.ts"),D=N("./src/utils/mediasource-helper.ts"),y=N("./node_modules/eventemitter3/index.js"),g=N.n(y),p=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},l=function(){function a(u,d,i,o){var O=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=u,this.id=d,this.onTransmuxComplete=i,this.onFlush=o;var w=u.config,C=function(v,c){c=c||{},c.frag=O.frag,c.id=O.id,u.trigger(v,c)};this.observer=new y.EventEmitter,this.observer.on(P.Events.FRAG_DECRYPTED,C),this.observer.on(P.Events.ERROR,C);var L={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},A=navigator.vendor;if(w.enableWorker&&typeof Worker!="undefined"){W.logger.log("demuxing in webworker");var _;try{_=this.worker=$("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),_.addEventListener("message",this.onwmsg),_.onerror=function(T){u.trigger(P.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(T.message+" ("+T.filename+":"+T.lineno+")")})},_.postMessage({cmd:"init",typeSupported:L,vendor:A,id:d,config:JSON.stringify(w)})}catch(T){W.logger.warn("Error in worker:",T),W.logger.error("Error while initializing DemuxerWorker, fallback to inline"),_&&self.URL.revokeObjectURL(_.objectURL),this.transmuxer=new G.default(this.observer,L,w,A,d),this.worker=null}}else this.transmuxer=new G.default(this.observer,L,w,A,d)}var f=a.prototype;return f.destroy=function(){var d=this.worker;if(d)d.removeEventListener("message",this.onwmsg),d.terminate(),this.worker=null;else{var i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}var o=this.observer;o&&o.removeAllListeners(),this.observer=null},f.push=function(d,i,o,O,w,C,L,A,_,T){var v=this;_.transmuxing.start=self.performance.now();var c=this.transmuxer,E=this.worker,h=C?C.start:w.start,x=w.decryptdata,U=this.frag,F=!(U&&w.cc===U.cc),S=!(U&&_.level===U.level),M=U?_.sn-U.sn:-1,I=this.part?_.part-this.part.index:1,b=!S&&(M===1||M===0&&I===1),K=self.performance.now();(S||M||w.stats.parsing.start===0)&&(w.stats.parsing.start=K),C&&(I||!b)&&(C.stats.parsing.start=K);var Q=new G.TransmuxState(F,b,A,S,h);if(!b||F){W.logger.log("[transmuxer-interface, "+w.type+"]: Starting new transmux session for sn: "+_.sn+" p: "+_.part+" level: "+_.level+" id: "+_.id+`
discontinuity: `+F+`
trackSwitch: `+S+`
contiguous: `+b+`
accurateTimeOffset: `+A+`
timeOffset: `+h);var ne=new G.TransmuxConfig(o,O,i,L,T);this.configureTransmuxer(ne)}if(this.frag=w,this.part=C,E)E.postMessage({cmd:"demux",data:d,decryptdata:x,chunkMeta:_,state:Q},d instanceof ArrayBuffer?[d]:[]);else if(c){var fe=c.push(d,x,_,Q);Object(G.isPromise)(fe)?fe.then(function(we){v.handleTransmuxComplete(we)}):this.handleTransmuxComplete(fe)}},f.flush=function(d){var i=this;d.transmuxing.start=self.performance.now();var o=this.transmuxer,O=this.worker;if(O)O.postMessage({cmd:"flush",chunkMeta:d});else if(o){var w=o.flush(d);Object(G.isPromise)(w)?w.then(function(C){i.handleFlushResult(C,d)}):this.handleFlushResult(w,d)}},f.handleFlushResult=function(d,i){var o=this;d.forEach(function(O){o.handleTransmuxComplete(O)}),this.onFlush(i)},f.onWorkerMessage=function(d){var i=d.data,o=this.hls;switch(i.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,o.trigger(i.event,i.data);break}}},f.configureTransmuxer=function(d){var i=this.worker,o=this.transmuxer;i?i.postMessage({cmd:"configure",config:d}):o&&o.configure(d)},f.handleTransmuxComplete=function(d){d.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(d)},a}()},"./src/demux/transmuxer-worker.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return n});var $=N("./src/demux/transmuxer.ts"),j=N("./src/events.ts"),P=N("./src/utils/logger.ts"),G=N("./node_modules/eventemitter3/index.js"),W=N.n(G);function n(l){var a=new G.EventEmitter,f=function(d,i){l.postMessage({event:d,data:i})};a.on(j.Events.FRAG_DECRYPTED,f),a.on(j.Events.ERROR,f),l.addEventListener("message",function(u){var d=u.data;switch(d.cmd){case"init":{var i=JSON.parse(d.config);l.transmuxer=new $.default(a,d.typeSupported,i,d.vendor,d.id),Object(P.enableLogs)(i.debug),f("init",null);break}case"configure":{l.transmuxer.configure(d.config);break}case"demux":{var o=l.transmuxer.push(d.data,d.decryptdata,d.chunkMeta,d.state);Object($.isPromise)(o)?o.then(function(C){D(l,C)}):D(l,o);break}case"flush":{var O=d.chunkMeta,w=l.transmuxer.flush(O);Object($.isPromise)(w)?w.then(function(C){g(l,C,O)}):g(l,w,O);break}default:break}})}function D(l,a){if(p(a.remuxResult))return;var f=[],u=a.remuxResult,d=u.audio,i=u.video;d&&y(f,d),i&&y(f,i),l.postMessage({event:"transmuxComplete",data:a},f)}function y(l,a){a.data1&&l.push(a.data1.buffer),a.data2&&l.push(a.data2.buffer)}function g(l,a,f){a.forEach(function(u){D(l,u)}),l.postMessage({event:"flush",data:f})}function p(l){return!l.audio&&!l.video&&!l.text&&!l.id3&&!l.initSegment}},"./src/demux/transmuxer.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return i}),N.d(V,"isPromise",function(){return w}),N.d(V,"TransmuxConfig",function(){return C}),N.d(V,"TransmuxState",function(){return L});var $=N("./src/events.ts"),j=N("./src/errors.ts"),P=N("./src/crypt/decrypter.ts"),G=N("./src/demux/aacdemuxer.ts"),W=N("./src/demux/mp4demuxer.ts"),n=N("./src/demux/tsdemuxer.ts"),D=N("./src/demux/mp3demuxer.ts"),y=N("./src/remux/mp4-remuxer.ts"),g=N("./src/remux/passthrough-remuxer.ts"),p=N("./src/demux/chunk-cache.ts"),l=N("./src/utils/mp4-tools.ts"),a=N("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(A){a.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var u=[{demux:n.default,remux:y.default},{demux:W.default,remux:g.default},{demux:G.default,remux:y.default},{demux:D.default,remux:y.default}],d=1024;u.forEach(function(A){var _=A.demux;d=Math.max(d,_.minProbeByteLength)});var i=function(){function A(T,v,c,E,h){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=T,this.typeSupported=v,this.config=c,this.vendor=E,this.id=h}var _=A.prototype;return _.configure=function(v){this.transmuxConfig=v,this.decrypter&&this.decrypter.reset()},_.push=function(v,c,E,h){var x=this,U=E.transmuxing;U.executeStart=f();var F=new Uint8Array(v),S=this.cache,M=this.config,I=this.currentTransmuxState,b=this.transmuxConfig;h&&(this.currentTransmuxState=h);var K=o(F,c);if(K&&K.method==="AES-128"){var Q=this.getDecrypter();if(M.enableSoftwareAES){var ne=Q.softwareDecrypt(F,K.key.buffer,K.iv.buffer);if(!ne)return U.executeEnd=f(),O(E);F=new Uint8Array(ne)}else return this.decryptionPromise=Q.webCryptoDecrypt(F,K.key.buffer,K.iv.buffer).then(function(Me){var Be=x.push(Me,null,E);return x.decryptionPromise=null,Be}),this.decryptionPromise}var fe=h||I,we=fe.contiguous,Se=fe.discontinuity,he=fe.trackSwitch,se=fe.accurateTimeOffset,me=fe.timeOffset,re=b.audioCodec,le=b.videoCodec,Z=b.defaultInitPts,ae=b.duration,oe=b.initSegmentData;if((Se||he)&&this.resetInitSegment(oe,re,le,ae),Se&&this.resetInitialTimestamp(Z),we||this.resetContiguity(),this.needsProbing(F,Se,he)){if(S.dataLength){var ge=S.flush();F=Object(l.appendUint8Array)(ge,F)}this.configureTransmuxer(F,b)}var Re=this.transmux(F,K,me,se,E),Te=this.currentTransmuxState;return Te.contiguous=!0,Te.discontinuity=!1,Te.trackSwitch=!1,U.executeEnd=f(),Re},_.flush=function(v){var c=this,E=v.transmuxing;E.executeStart=f();var h=this.decrypter,x=this.cache,U=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return c.flush(v)});var S=[],M=U.timeOffset;if(h){var I=h.flush();I&&S.push(this.push(I,null,v))}var b=x.dataLength;x.reset();var K=this.demuxer,Q=this.remuxer;if(!K||!Q)return b>=d&&this.observer.emit($.Events.ERROR,$.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=f(),[O(v)];var ne=K.flush(M);return w(ne)?ne.then(function(fe){return c.flushRemux(S,fe,v),S}):(this.flushRemux(S,ne,v),S)},_.flushRemux=function(v,c,E){var h=c.audioTrack,x=c.avcTrack,U=c.id3Track,F=c.textTrack,S=this.currentTransmuxState,M=S.accurateTimeOffset,I=S.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var b=this.remuxer.remux(h,x,U,F,I,M,!0,this.id);v.push({remuxResult:b,chunkMeta:E}),E.transmuxing.executeEnd=f()},_.resetInitialTimestamp=function(v){var c=this.demuxer,E=this.remuxer;if(!c||!E)return;c.resetTimeStamp(v),E.resetTimeStamp(v)},_.resetContiguity=function(){var v=this.demuxer,c=this.remuxer;if(!v||!c)return;v.resetContiguity(),c.resetNextTimestamp()},_.resetInitSegment=function(v,c,E,h){var x=this.demuxer,U=this.remuxer;if(!x||!U)return;x.resetInitSegment(c,E,h),U.resetInitSegment(v,c,E)},_.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},_.transmux=function(v,c,E,h,x){var U;return c&&c.method==="SAMPLE-AES"?U=this.transmuxSampleAes(v,c,E,h,x):U=this.transmuxUnencrypted(v,E,h,x),U},_.transmuxUnencrypted=function(v,c,E,h){var x=this.demuxer.demux(v,c,!1,!this.config.progressive),U=x.audioTrack,F=x.avcTrack,S=x.id3Track,M=x.textTrack,I=this.remuxer.remux(U,F,S,M,c,E,!1,this.id);return{remuxResult:I,chunkMeta:h}},_.transmuxSampleAes=function(v,c,E,h,x){var U=this;return this.demuxer.demuxSampleAes(v,c,E).then(function(F){var S=U.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,E,h,!1,U.id);return{remuxResult:S,chunkMeta:x}})},_.configureTransmuxer=function(v,c){for(var E=this.config,h=this.observer,x=this.typeSupported,U=this.vendor,F=c.audioCodec,S=c.defaultInitPts,M=c.duration,I=c.initSegmentData,b=c.videoCodec,K,Q=0,ne=u.length;Q<ne;Q++)if(u[Q].demux.probe(v)){K=u[Q];break}K||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),K={demux:W.default,remux:g.default});var fe=this.demuxer,we=this.remuxer,Se=K.remux,he=K.demux;(!we||!(we instanceof Se))&&(this.remuxer=new Se(h,E,x,U)),(!fe||!(fe instanceof he))&&(this.demuxer=new he(h,E,x),this.probe=he.probe),this.resetInitSegment(I,F,b,M),this.resetInitialTimestamp(S)},_.needsProbing=function(v,c,E){return!this.demuxer||!this.remuxer||c||E},_.getDecrypter=function(){var v=this.decrypter;return v||(v=this.decrypter=new P.default(this.observer,this.config)),v},A}();function o(A,_){var T=null;return A.byteLength>0&&_!=null&&_.key!=null&&_.iv!==null&&_.method!=null&&(T=_),T}var O=function(_){return{remuxResult:{},chunkMeta:_}};function w(A){return"then"in A&&A.then instanceof Function}var C=function(_,T,v,c,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=_,this.videoCodec=T,this.initSegmentData=v,this.duration=c,this.defaultInitPts=E},L=function(_,T,v,c,E){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=_,this.contiguous=T,this.accurateTimeOffset=v,this.trackSwitch=c,this.timeOffset=E}},"./src/demux/tsdemuxer.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"discardEPB",function(){return O});var $=N("./src/demux/adts.ts"),j=N("./src/demux/mpegaudio.ts"),P=N("./src/demux/exp-golomb.ts"),G=N("./src/demux/id3.ts"),W=N("./src/demux/sample-aes.ts"),n=N("./src/events.ts"),D=N("./src/utils/mp4-tools.ts"),y=N("./src/utils/logger.ts"),g=N("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},l=function(){function w(L,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=L,this.config=A,this.typeSupported=_}w.probe=function(A){var _=w.syncOffset(A);return _<0?!1:(_&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+_+", junk ahead ?"),!0)},w.syncOffset=function(A){for(var _=Math.min(1e3,A.length-3*188),T=0;T<_;){if(A[T]===71&&A[T+188]===71&&A[T+2*188]===71)return T;T++}return-1},w.createTrack=function(A,_){return{container:A==="video"||A==="audio"?"video/mp2t":void 0,type:A,id:p[A],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:A==="audio"?_:void 0}};var C=w.prototype;return C.resetInitSegment=function(A,_,T){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=w.createTrack("video",T),this._audioTrack=w.createTrack("audio",T),this._id3Track=w.createTrack("id3",T),this._txtTrack=w.createTrack("text",T),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=A,this.videoCodec=_,this._duration=T},C.resetTimeStamp=function(){},C.resetContiguity=function(){var A=this._audioTrack,_=this._avcTrack,T=this._id3Track;A&&(A.pesData=null),_&&(_.pesData=null),T&&(T.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},C.demux=function(A,_,T,v){T===void 0&&(T=!1),v===void 0&&(v=!1),T||(this.sampleAes=null);var c,E=this._avcTrack,h=this._audioTrack,x=this._id3Track,U=E.pid,F=E.pesData,S=h.pid,M=x.pid,I=h.pesData,b=x.pesData,K=!1,Q=this.pmtParsed,ne=this._pmtId,fe=A.length;if(this.remainderData&&(A=Object(D.appendUint8Array)(this.remainderData,A),fe=A.length,this.remainderData=null),fe<188&&!v)return this.remainderData=A,{audioTrack:h,avcTrack:E,id3Track:x,textTrack:this._txtTrack};var we=Math.max(0,w.syncOffset(A));fe-=(fe+we)%188,fe<A.byteLength&&!v&&(this.remainderData=new Uint8Array(A.buffer,fe,A.buffer.byteLength-fe));for(var Se=we;Se<fe;Se+=188)if(A[Se]===71){var he=!!(A[Se+1]&64),se=((A[Se+1]&31)<<8)+A[Se+2],me=(A[Se+3]&48)>>4,re=void 0;if(me>1){if(re=Se+5+A[Se+4],re===Se+188)continue}else re=Se+4;switch(se){case U:he&&(F&&(c=d(F))&&this.parseAVCPES(c,!1),F={data:[],size:0}),F&&(F.data.push(A.subarray(re,Se+188)),F.size+=Se+188-re);break;case S:he&&(I&&(c=d(I))&&(h.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),I={data:[],size:0}),I&&(I.data.push(A.subarray(re,Se+188)),I.size+=Se+188-re);break;case M:he&&(b&&(c=d(b))&&this.parseID3PES(c),b={data:[],size:0}),b&&(b.data.push(A.subarray(re,Se+188)),b.size+=Se+188-re);break;case 0:he&&(re+=A[re]+1),ne=this._pmtId=f(A,re);break;case ne:{he&&(re+=A[re]+1);var le=u(A,re,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,T);U=le.avc,U>0&&(E.pid=U),S=le.audio,S>0&&(h.pid=S,h.isAAC=le.isAAC),M=le.id3,M>0&&(x.pid=M),K&&!Q&&(y.logger.log("reparse from beginning"),K=!1,Se=we-188),Q=this.pmtParsed=!0;break}case 17:case 8191:break;default:K=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=F,h.pesData=I,x.pesData=b;var Z={audioTrack:h,avcTrack:E,id3Track:x,textTrack:this._txtTrack};return v&&this.extractRemainingSamples(Z),Z},C.flush=function(){var A=this.remainderData;this.remainderData=null;var _;return A?_=this.demux(A,-1,!1,!0):_={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(_),this.sampleAes?this.decrypt(_,this.sampleAes):_},C.extractRemainingSamples=function(A){var _=A.audioTrack,T=A.avcTrack,v=A.id3Track,c=T.pesData,E=_.pesData,h=v.pesData,x;c&&(x=d(c))?(this.parseAVCPES(x,!0),T.pesData=null):T.pesData=c,E&&(x=d(E))?(_.isAAC?this.parseAACPES(x):this.parseMPEGPES(x),_.pesData=null):(E!=null&&E.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),_.pesData=E),h&&(x=d(h))?(this.parseID3PES(x),v.pesData=null):v.pesData=h},C.demuxSampleAes=function(A,_,T){var v=this.demux(A,T,!0,!this.config.progressive),c=this.sampleAes=new W.default(this.observer,this.config,_);return this.decrypt(v,c)},C.decrypt=function(A,_){return new Promise(function(T){var v=A.audioTrack,c=A.avcTrack;v.samples&&v.isAAC?_.decryptAacSamples(v.samples,0,function(){c.samples?_.decryptAvcSamples(c.samples,0,0,function(){T(A)}):T(A)}):c.samples&&_.decryptAvcSamples(c.samples,0,0,function(){T(A)})})},C.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},C.parseAVCPES=function(A,_){var T=this,v=this._avcTrack,c=this.parseAVCNALu(A.data),E=!1,h=this.avcSample,x,U=!1;A.data=null,h&&c.length&&!v.audFound&&(i(h,v),h=this.avcSample=a(!1,A.pts,A.dts,"")),c.forEach(function(F){switch(F.type){case 1:{x=!0,h||(h=T.avcSample=a(!0,A.pts,A.dts,"")),E&&(h.debug+="NDR "),h.frame=!0;var S=F.data;if(U&&S.length>4){var M=new P.default(S).readSliceType();(M===2||M===4||M===7||M===9)&&(h.key=!0)}break}case 5:x=!0,h||(h=T.avcSample=a(!0,A.pts,A.dts,"")),E&&(h.debug+="IDR "),h.key=!0,h.frame=!0;break;case 6:{x=!0,E&&h&&(h.debug+="SEI ");var I=new P.default(O(F.data));I.readUByte();for(var b=0,K=0,Q=!1,ne=0;!Q&&I.bytesAvailable>1;){b=0;do ne=I.readUByte(),b+=ne;while(ne===255);K=0;do ne=I.readUByte(),K+=ne;while(ne===255);if(b===4&&I.bytesAvailable!==0){Q=!0;var fe=I.readUByte();if(fe===181){var we=I.readUShort();if(we===49){var Se=I.readUInt();if(Se===1195456820){var he=I.readUByte();if(he===3){for(var se=I.readUByte(),me=I.readUByte(),re=31&se,le=[se,me],Z=0;Z<re;Z++)le.push(I.readUByte()),le.push(I.readUByte()),le.push(I.readUByte());o(T._txtTrack.samples,{type:3,pts:A.pts,bytes:le})}}}}}else if(b===5&&I.bytesAvailable!==0){if(Q=!0,K>16){for(var ae=[],oe=0;oe<16;oe++)ae.push(I.readUByte().toString(16)),(oe===3||oe===5||oe===7||oe===9)&&ae.push("-");for(var ge=K-16,Re=new Uint8Array(ge),Te=0;Te<ge;Te++)Re[Te]=I.readUByte();o(T._txtTrack.samples,{pts:A.pts,payloadType:b,uuid:ae.join(""),userData:Object(G.utf8ArrayToStr)(Re),userDataBytes:Re})}}else if(K<I.bytesAvailable)for(var Me=0;Me<K;Me++)I.readUByte()}break}case 7:if(x=!0,U=!0,E&&h&&(h.debug+="SPS "),!v.sps){var Be=new P.default(F.data),pe=Be.readSPS();v.width=pe.width,v.height=pe.height,v.pixelRatio=pe.pixelRatio,v.sps=[F.data],v.duration=T._duration;for(var Ce=F.data.subarray(1,4),ke="avc1.",Le=0;Le<3;Le++){var Ge=Ce[Le].toString(16);Ge.length<2&&(Ge="0"+Ge),ke+=Ge}v.codec=ke}break;case 8:x=!0,E&&h&&(h.debug+="PPS "),v.pps||(v.pps=[F.data]);break;case 9:x=!1,v.audFound=!0,h&&i(h,v),h=T.avcSample=a(!1,A.pts,A.dts,E?"AUD ":"");break;case 12:x=!1;break;default:x=!1,h&&(h.debug+="unknown NAL "+F.type+" ");break}if(h&&x){var Ve=h.units;Ve.push(F)}}),_&&h&&(i(h,v),this.avcSample=null)},C.getLastNalUnit=function(){var A,_=this.avcSample,T;if(!_||_.units.length===0){var v=this._avcTrack.samples;_=v[v.length-1]}if((A=_)!==null&&A!==void 0&&A.units){var c=_.units;T=c[c.length-1]}return T},C.parseAVCNALu=function(A){var _=A.byteLength,T=this._avcTrack,v=T.naluState||0,c=v,E=[],h=0,x,U,F,S=-1,M=0;for(v===-1&&(S=0,M=A[0]&31,v=0,h=1);h<_;){if(x=A[h++],!v){v=x?0:1;continue}if(v===1){v=x?0:2;continue}if(!x)v=3;else if(x===1){if(S>=0){var I={data:A.subarray(S,h-v-1),type:M};E.push(I)}else{var b=this.getLastNalUnit();if(b&&(c&&h<=4-c&&(b.state&&(b.data=b.data.subarray(0,b.data.byteLength-c))),U=h-v-1,U>0)){var K=new Uint8Array(b.data.byteLength+U);K.set(b.data,0),K.set(A.subarray(0,U),b.data.byteLength),b.data=K,b.state=0}}h<_?(F=A[h]&31,S=h,M=F,v=0):v=-1}else v=0}if(S>=0&&v>=0){var Q={data:A.subarray(S,_),type:M,state:v};E.push(Q)}if(E.length===0){var ne=this.getLastNalUnit();if(ne){var fe=new Uint8Array(ne.data.byteLength+A.byteLength);fe.set(ne.data,0),fe.set(A,ne.data.byteLength),ne.data=fe}}return T.naluState=v,E},C.parseAACPES=function(A){var _=0,T=this._audioTrack,v=this.aacOverFlow,c=A.data;if(v){this.aacOverFlow=null;var E=v.sample.unit.byteLength,h=Math.min(v.missing,E),x=E-h;v.sample.unit.set(c.subarray(0,h),x),T.samples.push(v.sample),_=v.missing}var U,F;for(U=_,F=c.length;U<F-1&&!$.isHeader(c,U);U++);if(U!==_){var S,M;if(U<F-1?(S="AAC PES did not start with ADTS header,offset:"+U,M=!1):(S="no ADTS header found in AAC PES",M=!0),y.logger.warn("parsing error:"+S),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:M,reason:S}),M)return}$.initTrackConfig(T,this.observer,c,U,this.audioCodec);var I;if(A.pts!==void 0)I=A.pts;else if(v){var b=$.getFrameDuration(T.samplerate);I=v.sample.pts+b}else{y.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var K=0;U<F;)if($.isHeader(c,U)){if(U+5<F){var Q=$.appendFrame(T,c,U,I,K);if(Q)if(Q.missing)this.aacOverFlow=Q;else{U+=Q.length,K++;continue}}break}else U++},C.parseMPEGPES=function(A){var _=A.data,T=_.length,v=0,c=0,E=A.pts;if(E===void 0){y.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<T;)if(j.isHeader(_,c)){var h=j.appendFrame(this._audioTrack,_,c,E,v);if(h)c+=h.length,v++;else break}else c++},C.parseID3PES=function(A){if(A.pts===void 0){y.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(A)},w}();l.minProbeByteLength=188;function a(w,C,L,A){return{key:w,frame:!1,pts:C,dts:L,units:[],debug:A,length:0}}function f(w,C){return(w[C+10]&31)<<8|w[C+11]}function u(w,C,L,A){var _={audio:-1,avc:-1,id3:-1,isAAC:!0},T=(w[C+1]&15)<<8|w[C+2],v=C+3+T-4,c=(w[C+10]&15)<<8|w[C+11];for(C+=12+c;C<v;){var E=(w[C+1]&31)<<8|w[C+2];switch(w[C]){case 207:if(!A){y.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:_.audio===-1&&(_.audio=E);break;case 21:_.id3===-1&&(_.id3=E);break;case 219:if(!A){y.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:_.avc===-1&&(_.avc=E);break;case 3:case 4:L?_.audio===-1&&(_.audio=E,_.isAAC=!1):y.logger.log("MPEG audio found, not supported in this browser");break;case 36:y.logger.warn("Unsupported HEVC stream type found");break;default:break}C+=((w[C+3]&15)<<8|w[C+4])+5}return _}function d(w){var C=0,L,A,_,T,v,c=w.data;if(!w||w.size===0)return null;for(;c[0].length<19&&c.length>1;){var E=new Uint8Array(c[0].length+c[1].length);E.set(c[0]),E.set(c[1],c[0].length),c[0]=E,c.splice(1,1)}L=c[0];var h=(L[0]<<16)+(L[1]<<8)+L[2];if(h===1){if(A=(L[4]<<8)+L[5],A&&A>w.size-6)return null;var x=L[7];x&192&&(T=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,x&64?(v=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,T-v>60*9e4&&(y.logger.warn(Math.round((T-v)/9e4)+"s delta between PTS and DTS, align them"),T=v)):v=T),_=L[8];var U=_+9;if(w.size<=U)return null;w.size-=U;for(var F=new Uint8Array(w.size),S=0,M=c.length;S<M;S++){L=c[S];var I=L.byteLength;if(U)if(U>I){U-=I;continue}else L=L.subarray(U),I-=U,U=0;F.set(L,C),C+=I}return A&&(A-=_+3),{data:F,pts:T,dts:v,len:A}}return null}function i(w,C){if(w.units.length&&w.frame){if(w.pts===void 0){var L=C.samples,A=L.length;if(A){var _=L[A-1];w.pts=_.pts,w.dts=_.dts}else{C.dropped++;return}}C.samples.push(w)}w.debug.length&&y.logger.log(w.pts+"/"+w.dts+":"+w.debug)}function o(w,C){var L=w.length;if(L>0){if(C.pts>=w[L-1].pts)w.push(C);else for(var A=L-1;A>=0;A--)if(C.pts<w[A].pts){w.splice(A,0,C);break}}else w.push(C)}function O(w){for(var C=w.byteLength,L=[],A=1;A<C-2;)w[A]===0&&w[A+1]===0&&w[A+2]===3?(L.push(A+2),A+=2):A++;if(L.length===0)return w;var _=C-L.length,T=new Uint8Array(_),v=0;for(A=0;A<_;v++,A++)v===L[0]&&(v++,L.shift()),T[A]=w[v];return T}V.default=l},"./src/errors.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"ErrorTypes",function(){return $}),N.d(V,"ErrorDetails",function(){return j});var $;(function(P){P.NETWORK_ERROR="networkError",P.MEDIA_ERROR="mediaError",P.KEY_SYSTEM_ERROR="keySystemError",P.MUX_ERROR="muxError",P.OTHER_ERROR="otherError"})($||($={}));var j;(function(P){P.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",P.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",P.KEY_SYSTEM_NO_SESSION="keySystemNoSession",P.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",P.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",P.MANIFEST_LOAD_ERROR="manifestLoadError",P.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",P.MANIFEST_PARSING_ERROR="manifestParsingError",P.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",P.LEVEL_EMPTY_ERROR="levelEmptyError",P.LEVEL_LOAD_ERROR="levelLoadError",P.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",P.LEVEL_SWITCH_ERROR="levelSwitchError",P.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",P.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",P.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",P.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",P.FRAG_LOAD_ERROR="fragLoadError",P.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",P.FRAG_DECRYPT_ERROR="fragDecryptError",P.FRAG_PARSING_ERROR="fragParsingError",P.REMUX_ALLOC_ERROR="remuxAllocError",P.KEY_LOAD_ERROR="keyLoadError",P.KEY_LOAD_TIMEOUT="keyLoadTimeOut",P.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",P.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",P.BUFFER_APPEND_ERROR="bufferAppendError",P.BUFFER_APPENDING_ERROR="bufferAppendingError",P.BUFFER_STALLED_ERROR="bufferStalledError",P.BUFFER_FULL_ERROR="bufferFullError",P.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",P.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",P.INTERNAL_EXCEPTION="internalException",P.INTERNAL_ABORTED="aborted",P.UNKNOWN="unknown"})(j||(j={}))},"./src/events.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"Events",function(){return $});var $;(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"})($||($={}))},"./src/hls.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return w});var $=N("./node_modules/url-toolkit/src/url-toolkit.js"),j=N.n($),P=N("./src/loader/playlist-loader.ts"),G=N("./src/loader/key-loader.ts"),W=N("./src/controller/id3-track-controller.ts"),n=N("./src/controller/latency-controller.ts"),D=N("./src/controller/level-controller.ts"),y=N("./src/controller/fragment-tracker.ts"),g=N("./src/controller/stream-controller.ts"),p=N("./src/is-supported.ts"),l=N("./src/utils/logger.ts"),a=N("./src/config.ts"),f=N("./node_modules/eventemitter3/index.js"),u=N.n(f),d=N("./src/events.ts"),i=N("./src/errors.ts");function o(C,L){for(var A=0;A<L.length;A++){var _=L[A];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(C,_.key,_)}}function O(C,L,A){return L&&o(C.prototype,L),A&&o(C,A),C}var w=function(){C.isSupported=function(){return Object(p.isSupported)()};function C(A){A===void 0&&(A={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new f.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var _=this.config=Object(a.mergeConfig)(C.DefaultConfig,A);this.userConfig=A,Object(l.enableLogs)(_.debug),this._autoLevelCapping=-1,_.progressive&&Object(a.enableStreamingMode)(_);var T=_.abrController,v=_.bufferController,c=_.capLevelController,E=_.fpsController,h=this.abrController=new T(this),x=this.bufferController=new v(this),U=this.capLevelController=new c(this),F=new E(this),S=new P.default(this),M=new G.default(this),I=new W.default(this),b=this.levelController=new D.default(this),K=new y.FragmentTracker(this),Q=this.streamController=new g.default(this,K);U.setStreamController(Q),F.setStreamController(Q);var ne=[b,Q];this.networkControllers=ne;var fe=[S,M,h,x,U,F,I,K];this.audioTrackController=this.createController(_.audioTrackController,null,ne),this.createController(_.audioStreamController,K,ne),this.subtitleTrackController=this.createController(_.subtitleTrackController,null,ne),this.createController(_.subtitleStreamController,K,ne),this.createController(_.timelineController,null,fe),this.emeController=this.createController(_.emeController,null,fe),this.cmcdController=this.createController(_.cmcdController,null,fe),this.latencyController=this.createController(n.default,null,fe),this.coreComponents=fe}var L=C.prototype;return L.createController=function(_,T,v){if(_){var c=T?new _(this,T):new _(this);return v&&v.push(c),c}return null},L.on=function(_,T,v){v===void 0&&(v=this),this._emitter.on(_,T,v)},L.once=function(_,T,v){v===void 0&&(v=this),this._emitter.once(_,T,v)},L.removeAllListeners=function(_){this._emitter.removeAllListeners(_)},L.off=function(_,T,v,c){v===void 0&&(v=this),this._emitter.off(_,T,v,c)},L.listeners=function(_){return this._emitter.listeners(_)},L.emit=function(_,T,v){return this._emitter.emit(_,T,v)},L.trigger=function(_,T){if(this.config.debug)return this.emit(_,_,T);try{return this.emit(_,_,T)}catch(v){l.logger.error("An internal error happened while handling event "+_+'. Error message: "'+v.message+'". Here is a stacktrace:',v),this.trigger(d.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:_,error:v})}return!1},L.listenerCount=function(_){return this._emitter.listenerCount(_)},L.destroy=function(){l.logger.log("destroy"),this.trigger(d.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(_){return _.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(_){return _.destroy()}),this.coreComponents.length=0},L.attachMedia=function(_){l.logger.log("attachMedia"),this._media=_,this.trigger(d.Events.MEDIA_ATTACHING,{media:_})},L.detachMedia=function(){l.logger.log("detachMedia"),this.trigger(d.Events.MEDIA_DETACHING,void 0),this._media=null},L.loadSource=function(_){this.stopLoad();var T=this.media,v=this.url,c=this.url=$.buildAbsoluteURL(self.location.href,_,{alwaysNormalize:!0});l.logger.log("loadSource:"+c),T&&v&&v!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(T)),this.trigger(d.Events.MANIFEST_LOADING,{url:_})},L.startLoad=function(_){_===void 0&&(_=-1),l.logger.log("startLoad("+_+")"),this.networkControllers.forEach(function(T){T.startLoad(_)})},L.stopLoad=function(){l.logger.log("stopLoad"),this.networkControllers.forEach(function(_){_.stopLoad()})},L.swapAudioCodec=function(){l.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},L.recoverMediaError=function(){l.logger.log("recoverMediaError");var _=this._media;this.detachMedia(),_&&this.attachMedia(_)},L.removeLevel=function(_,T){T===void 0&&(T=0),this.levelController.removeLevel(_,T)},O(C,[{key:"levels",get:function(){var _=this.levelController.levels;return _||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(_){l.logger.log("set currentLevel:"+_),this.loadLevel=_,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(_){l.logger.log("set nextLevel:"+_),this.levelController.manualLevel=_,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(_){l.logger.log("set loadLevel:"+_),this.levelController.manualLevel=_}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(_){this.levelController.nextLoadLevel=_}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(_){l.logger.log("set firstLevel:"+_),this.levelController.firstLevel=_}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(_){l.logger.log("set startLevel:"+_),_!==-1&&(_=Math.max(_,this.minAutoLevel)),this.levelController.startLevel=_}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(_){var T=!!_;T!==this.config.capLevelToPlayerSize&&(T?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=T)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(_){this._autoLevelCapping!==_&&(l.logger.log("set autoLevelCapping:"+_),this._autoLevelCapping=_)}},{key:"bandwidthEstimate",get:function(){var _=this.abrController.bwEstimator;return _?_.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var _=this.levels,T=this.config.minAutoBitrate;if(!_)return 0;for(var v=_.length,c=0;c<v;c++)if(_[c].maxBitrate>T)return c;return 0}},{key:"maxAutoLevel",get:function(){var _=this.levels,T=this.autoLevelCapping,v;return T===-1&&_&&_.length?v=_.length-1:v=T,v}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(_){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,_)}},{key:"audioTracks",get:function(){var _=this.audioTrackController;return _?_.audioTracks:[]}},{key:"audioTrack",get:function(){var _=this.audioTrackController;return _?_.audioTrack:-1},set:function(_){var T=this.audioTrackController;T&&(T.audioTrack=_)}},{key:"subtitleTracks",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTrack:-1},set:function(_){var T=this.subtitleTrackController;T&&(T.subtitleTrack=_)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var _=this.subtitleTrackController;return _?_.subtitleDisplay:!1},set:function(_){var T=this.subtitleTrackController;T&&(T.subtitleDisplay=_)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(_){this.config.lowLatencyMode=_}},{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 d.Events}},{key:"ErrorTypes",get:function(){return i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return C.defaultConfig?C.defaultConfig:a.hlsDefaultConfig},set:function(_){C.defaultConfig=_}}]),C}();w.defaultConfig=void 0},"./src/is-supported.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"isSupported",function(){return P}),N.d(V,"changeTypeSupported",function(){return G});var $=N("./src/utils/mediasource-helper.ts");function j(){return self.SourceBuffer||self.WebKitSourceBuffer}function P(){var W=Object($.getMediaSource)();if(!W)return!1;var n=j(),D=W&&typeof W.isTypeSupported=="function"&&W.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),y=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!D&&!!y}function G(){var W,n=j();return typeof(n==null||((W=n.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return l}),N.d(V,"LoadError",function(){return f});var $=N("./src/polyfills/number.ts"),j=N("./src/errors.ts");function P(u,d){u.prototype=Object.create(d.prototype),u.prototype.constructor=u,y(u,d)}function G(u){var d=typeof Map=="function"?new Map:void 0;return G=function(o){if(o===null||!D(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof d!="undefined"){if(d.has(o))return d.get(o);d.set(o,O)}function O(){return W(o,arguments,g(this).constructor)}return O.prototype=Object.create(o.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),y(O,o)},G(u)}function W(u,d,i){return n()?W=Reflect.construct:W=function(O,w,C){var L=[null];L.push.apply(L,w);var A=Function.bind.apply(O,L),_=new A;return C&&y(_,C.prototype),_},W.apply(null,arguments)}function n(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(u){return!1}}function D(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function y(u,d){return y=Object.setPrototypeOf||function(o,O){return o.__proto__=O,o},y(u,d)}function g(u){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},g(u)}var p=Math.pow(2,17),l=function(){function u(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var d=u.prototype;return d.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},d.abort=function(){this.loader&&this.loader.abort()},d.load=function(o,O){var w=this,C=o.url;if(!C)return Promise.reject(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,networkDetails:null},"Fragment does not have a "+(C?"part list":"url")));this.abort();var L=this.config,A=L.fLoader,_=L.loader;return new Promise(function(T,v){w.loader&&w.loader.destroy();var c=w.loader=o.loader=A?new A(L):new _(L),E=a(o),h={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:p};o.stats=c.stats,c.load(E,h,{onSuccess:function(U,F,S,M){w.resetLoader(o,c),T({frag:o,part:null,payload:U.data,networkDetails:M})},onError:function(U,F,S){w.resetLoader(o,c),v(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,response:U,networkDetails:S}))},onAbort:function(U,F,S){w.resetLoader(o,c),v(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,networkDetails:S}))},onTimeout:function(U,F,S){w.resetLoader(o,c),v(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,networkDetails:S}))},onProgress:function(U,F,S,M){O&&O({frag:o,part:null,payload:S,networkDetails:M})}})})},d.loadPart=function(o,O,w){var C=this;this.abort();var L=this.config,A=L.fLoader,_=L.loader;return new Promise(function(T,v){C.loader&&C.loader.destroy();var c=C.loader=o.loader=A?new A(L):new _(L),E=a(o,O),h={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:p};O.stats=c.stats,c.load(E,h,{onSuccess:function(U,F,S,M){C.resetLoader(o,c),C.updateStatsFromPart(o,O);var I={frag:o,part:O,payload:U.data,networkDetails:M};w(I),T(I)},onError:function(U,F,S){C.resetLoader(o,c),v(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,part:O,response:U,networkDetails:S}))},onAbort:function(U,F,S){o.stats.aborted=O.stats.aborted,C.resetLoader(o,c),v(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,part:O,networkDetails:S}))},onTimeout:function(U,F,S){C.resetLoader(o,c),v(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,part:O,networkDetails:S}))}})})},d.updateStatsFromPart=function(o,O){var w=o.stats,C=O.stats,L=C.total;if(w.loaded+=C.loaded,L){var A=Math.round(o.duration/O.duration),_=Math.min(Math.round(w.loaded/L),A),T=A-_,v=T*Math.round(w.loaded/_);w.total=w.loaded+v}else w.total=Math.max(w.loaded,w.total);var c=w.loading,E=C.loading;c.start?c.first+=E.first-E.start:(c.start=E.start,c.first=E.first),c.end=E.end},d.resetLoader=function(o,O){o.loader=null,this.loader===O&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),O.destroy()},u}();function a(u,d){d===void 0&&(d=null);var i=d||u,o={frag:u,part:d,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},O=i.byteRangeStartOffset,w=i.byteRangeEndOffset;return Object($.isFiniteNumber)(O)&&Object($.isFiniteNumber)(w)&&(o.rangeStart=O,o.rangeEnd=w),o}var f=function(u){P(d,u);function d(i){for(var o,O=arguments.length,w=new Array(O>1?O-1:0),C=1;C<O;C++)w[C-1]=arguments[C];return o=u.call.apply(u,[this].concat(w))||this,o.data=void 0,o.data=i,o}return d}(G(Error))},"./src/loader/fragment.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"ElementaryStreamTypes",function(){return l}),N.d(V,"BaseSegment",function(){return a}),N.d(V,"Fragment",function(){return f}),N.d(V,"Part",function(){return u});var $=N("./src/polyfills/number.ts"),j=N("./node_modules/url-toolkit/src/url-toolkit.js"),P=N.n(j),G=N("./src/utils/logger.ts"),W=N("./src/loader/level-key.ts"),n=N("./src/loader/load-stats.ts");function D(d,i){d.prototype=Object.create(i.prototype),d.prototype.constructor=d,y(d,i)}function y(d,i){return y=Object.setPrototypeOf||function(O,w){return O.__proto__=w,O},y(d,i)}function g(d,i){for(var o=0;o<i.length;o++){var O=i[o];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(d,O.key,O)}}function p(d,i,o){return i&&g(d.prototype,i),o&&g(d,o),d}var l;(function(d){d.AUDIO="audio",d.VIDEO="video",d.AUDIOVIDEO="audiovideo"})(l||(l={}));var a=function(){function d(o){var O;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(O={},O[l.AUDIO]=null,O[l.VIDEO]=null,O[l.AUDIOVIDEO]=null,O),this.baseurl=o}var i=d.prototype;return i.setByteRange=function(O,w){var C=O.split("@",2),L=[];C.length===1?L[0]=w?w.byteRangeEndOffset:0:L[0]=parseInt(C[1]),L[1]=parseInt(C[0])+L[0],this._byteRange=L},p(d,[{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(O){this._url=O}}]),d}(),f=function(d){D(i,d);function i(O,w){var C;return C=d.call(this,w)||this,C._decryptdata=null,C.rawProgramDateTime=null,C.programDateTime=null,C.tagList=[],C.duration=0,C.sn=0,C.levelkey=void 0,C.type=void 0,C.loader=null,C.level=-1,C.cc=0,C.startPTS=void 0,C.endPTS=void 0,C.appendedPTS=void 0,C.startDTS=void 0,C.endDTS=void 0,C.start=0,C.deltaPTS=void 0,C.maxStartPTS=void 0,C.minEndPTS=void 0,C.stats=new n.LoadStats,C.urlId=0,C.data=void 0,C.bitrateTest=!1,C.title=null,C.initSegment=null,C.type=O,C}var o=i.prototype;return o.createInitializationVector=function(w){for(var C=new Uint8Array(16),L=12;L<16;L++)C[L]=w>>8*(15-L)&255;return C},o.setDecryptDataFromLevelKey=function(w,C){var L=w;return(w==null?void 0:w.method)==="AES-128"&&w.uri&&!w.iv&&(L=W.LevelKey.fromURI(w.uri),L.method=w.method,L.iv=this.createInitializationVector(C),L.keyFormat="identity"),L},o.setElementaryStreamInfo=function(w,C,L,A,_,T){T===void 0&&(T=!1);var v=this.elementaryStreams,c=v[w];if(!c){v[w]={startPTS:C,endPTS:L,startDTS:A,endDTS:_,partial:T};return}c.startPTS=Math.min(c.startPTS,C),c.endPTS=Math.max(c.endPTS,L),c.startDTS=Math.min(c.startDTS,A),c.endDTS=Math.max(c.endDTS,_)},o.clearElementaryStreamInfo=function(){var w=this.elementaryStreams;w[l.AUDIO]=null,w[l.VIDEO]=null,w[l.AUDIOVIDEO]=null},p(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var w=this.sn;typeof w!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&G.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),w=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,w)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object($.isFiniteNumber)(this.programDateTime))return null;var w=Object($.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+w*1e3}},{key:"encrypted",get:function(){var w;return!!((w=this.decryptdata)!==null&&w!==void 0&&w.keyFormat&&this.decryptdata.uri)}}]),i}(a),u=function(d){D(i,d);function i(o,O,w,C,L){var A;A=d.call(this,w)||this,A.fragOffset=0,A.duration=0,A.gap=!1,A.independent=!1,A.relurl=void 0,A.fragment=void 0,A.index=void 0,A.stats=new n.LoadStats,A.duration=o.decimalFloatingPoint("DURATION"),A.gap=o.bool("GAP"),A.independent=o.bool("INDEPENDENT"),A.relurl=o.enumeratedString("URI"),A.fragment=O,A.index=C;var _=o.enumeratedString("BYTERANGE");return _&&A.setByteRange(_,L),L&&(A.fragOffset=L.fragOffset+L.duration),A}return p(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var O=this.elementaryStreams;return!!(O.audio||O.video||O.audiovideo)}}]),i}(a)},"./src/loader/key-loader.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return G});var $=N("./src/events.ts"),j=N("./src/errors.ts"),P=N("./src/utils/logger.ts"),G=function(){function W(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var n=W.prototype;return n._registerListeners=function(){this.hls.on($.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off($.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var y in this.loaders){var g=this.loaders[y];g&&g.destroy()}this.loaders={}},n.onKeyLoading=function(y,g){var p=g.frag,l=p.type,a=this.loaders[l];if(!p.decryptdata){P.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=p.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var u=this.hls.config;if(a&&(P.logger.warn("abort previous key loader for type:"+l),a.abort()),!f){P.logger.warn("key uri is falsy");return}var d=u.loader,i=p.loader=this.loaders[l]=new d(u);this.decrypturl=f,this.decryptkey=null;var o={url:f,frag:p,responseType:"arraybuffer"},O={timeout:u.fragLoadingTimeOut,maxRetry:0,retryDelay:u.fragLoadingRetryDelay,maxRetryDelay:u.fragLoadingMaxRetryTimeout,highWaterMark:0},w={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(o,O,w)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger($.Events.KEY_LOADED,{frag:p}))},n.loadsuccess=function(y,g,p){var l=p.frag;if(!l.decryptdata){P.logger.error("after key load, decryptdata unset");return}this.decryptkey=l.decryptdata.key=new Uint8Array(y.data),l.loader=null,delete this.loaders[l.type],this.hls.trigger($.Events.KEY_LOADED,{frag:l})},n.loaderror=function(y,g){var p=g.frag,l=p.loader;l&&l.abort(),delete this.loaders[p.type],this.hls.trigger($.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:y})},n.loadtimeout=function(y,g){var p=g.frag,l=p.loader;l&&l.abort(),delete this.loaders[p.type],this.hls.trigger($.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},W}()},"./src/loader/level-details.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"LevelDetails",function(){return W});var $=N("./src/polyfills/number.ts");function j(n,D){for(var y=0;y<D.length;y++){var g=D[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(n,g.key,g)}}function P(n,D,y){return D&&j(n.prototype,D),y&&j(n,y),n}var G=10,W=function(){function n(y){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=y}var D=n.prototype;return D.reloaded=function(g){if(!g){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-g.lastPartSn,l=this.lastPartIndex-g.lastPartIndex;this.updated=this.endSN!==g.endSN||!!l||!!p,this.advanced=this.endSN>g.endSN||p>0||p===0&&l>0,this.updated||this.advanced?this.misses=Math.floor(g.misses*.6):this.misses=g.misses+1,this.availabilityDelay=g.availabilityDelay},P(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object($.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||G}},{key:"drift",get:function(){var g=this.driftEndTime-this.driftStartTime;if(g>0){var p=this.driftEnd-this.driftStart;return p*1e3/g}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var g;return(g=this.fragments)!==null&&g!==void 0&&g.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 g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),n}()},"./src/loader/level-key.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"LevelKey",function(){return W});var $=N("./node_modules/url-toolkit/src/url-toolkit.js"),j=N.n($);function P(n,D){for(var y=0;y<D.length;y++){var g=D[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(n,g.key,g)}}function G(n,D,y){return D&&P(n.prototype,D),y&&P(n,y),n}var W=function(){n.fromURL=function(y,g){return new n(y,g)},n.fromURI=function(y){return new n(y)};function n(D,y){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,y?this._uri=Object($.buildAbsoluteURL)(D,y,{alwaysNormalize:!0}):this._uri=D}return G(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"LoadStats",function(){return $});var $=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(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return i});var $=N("./src/polyfills/number.ts"),j=N("./node_modules/url-toolkit/src/url-toolkit.js"),P=N.n(j),G=N("./src/loader/fragment.ts"),W=N("./src/loader/level-details.ts"),n=N("./src/loader/level-key.ts"),D=N("./src/utils/attr-list.ts"),y=N("./src/utils/logger.ts"),g=N("./src/utils/codecs.ts"),p=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,l=/#EXT-X-MEDIA:(.*)/g,a=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),f=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),u=/\.(mp4|m4s|m4v|m4a)$/i;function d(L){var A,_;return u.test((A=(_=j.parseURL(L))===null||_===void 0?void 0:_.path)!=null?A:"")}var i=function(){function L(){}return L.findGroup=function(_,T){for(var v=0;v<_.length;v++){var c=_[v];if(c.id===T)return c}},L.convertAVC1ToAVCOTI=function(_){var T=_.split(".");if(T.length>2){var v=T.shift()+".";return v+=parseInt(T.shift()).toString(16),v+=("000"+parseInt(T.shift()).toString(16)).substr(-4),v}return _},L.resolve=function(_,T){return j.buildAbsoluteURL(T,_,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(_,T){var v=[],c={},E=!1;p.lastIndex=0;for(var h;(h=p.exec(_))!=null;)if(h[1]){var x=new D.AttrList(h[1]),U={attrs:x,bitrate:x.decimalInteger("AVERAGE-BANDWIDTH")||x.decimalInteger("BANDWIDTH"),name:x.NAME,url:L.resolve(h[2],T)},F=x.decimalResolution("RESOLUTION");F&&(U.width=F.width,U.height=F.height),o((x.CODECS||"").split(/[ ,]+/).filter(function(M){return M}),U),U.videoCodec&&U.videoCodec.indexOf("avc1")!==-1&&(U.videoCodec=L.convertAVC1ToAVCOTI(U.videoCodec)),v.push(U)}else if(h[3]){var S=new D.AttrList(h[3]);S["DATA-ID"]&&(E=!0,c[S["DATA-ID"]]=S)}return{levels:v,sessionData:E?c:null}},L.parseMasterPlaylistMedia=function(_,T,v,c){c===void 0&&(c=[]);var E,h=[],x=0;for(l.lastIndex=0;(E=l.exec(_))!==null;){var U=new D.AttrList(E[1]);if(U.TYPE===v){var F={attrs:U,bitrate:0,id:x++,groupId:U["GROUP-ID"],instreamId:U["INSTREAM-ID"],name:U.NAME||U.LANGUAGE||"",type:v,default:U.bool("DEFAULT"),autoselect:U.bool("AUTOSELECT"),forced:U.bool("FORCED"),lang:U.LANGUAGE,url:U.URI?L.resolve(U.URI,T):""};if(c.length){var S=L.findGroup(c,F.groupId)||c[0];O(F,S,"audioCodec"),O(F,S,"textCodec")}h.push(F)}}return h},L.parseLevelPlaylist=function(_,T,v,c,E){var h=new W.LevelDetails(T),x=h.fragments,U=null,F=0,S=0,M=0,I=0,b=null,K=new G.Fragment(c,T),Q,ne,fe,we=-1,Se=!1;for(a.lastIndex=0,h.m3u8=_;(Q=a.exec(_))!==null;){Se&&(Se=!1,K=new G.Fragment(c,T),K.start=M,K.sn=F,K.cc=I,K.level=v,U&&(K.initSegment=U,K.rawProgramDateTime=U.rawProgramDateTime));var he=Q[1];if(he){K.duration=parseFloat(he);var se=(" "+Q[2]).slice(1);K.title=se||null,K.tagList.push(se?["INF",he,se]:["INF",he])}else if(Q[3])Object($.isFiniteNumber)(K.duration)&&(K.start=M,fe&&(K.levelkey=fe),K.sn=F,K.level=v,K.cc=I,K.urlId=E,x.push(K),K.relurl=(" "+Q[3]).slice(1),C(K,b),b=K,M+=K.duration,F++,S=0,Se=!0);else if(Q[4]){var me=(" "+Q[4]).slice(1);b?K.setByteRange(me,b):K.setByteRange(me)}else if(Q[5])K.rawProgramDateTime=(" "+Q[5]).slice(1),K.tagList.push(["PROGRAM-DATE-TIME",K.rawProgramDateTime]),we===-1&&(we=x.length);else{if(Q=Q[0].match(f),!Q){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(ne=1;ne<Q.length&&!(typeof Q[ne]!="undefined");ne++);var re=(" "+Q[ne]).slice(1),le=(" "+Q[ne+1]).slice(1),Z=Q[ne+2]?(" "+Q[ne+2]).slice(1):"";switch(re){case"PLAYLIST-TYPE":h.type=le.toUpperCase();break;case"MEDIA-SEQUENCE":F=h.startSN=parseInt(le);break;case"SKIP":{var ae=new D.AttrList(le),oe=ae.decimalInteger("SKIPPED-SEGMENTS");if(Object($.isFiniteNumber)(oe)){h.skippedSegments=oe;for(var ge=oe;ge--;)x.unshift(null);F+=oe}var Re=ae.enumeratedString("RECENTLY-REMOVED-DATERANGES");Re&&(h.recentlyRemovedDateranges=Re.split(" "));break}case"TARGETDURATION":h.targetduration=parseFloat(le);break;case"VERSION":h.version=parseInt(le);break;case"EXTM3U":break;case"ENDLIST":h.live=!1;break;case"#":(le||Z)&&K.tagList.push(Z?[le,Z]:[le]);break;case"DIS":I++;case"GAP":K.tagList.push([re]);break;case"BITRATE":K.tagList.push([re,le]);break;case"DISCONTINUITY-SEQ":I=parseInt(le);break;case"KEY":{var Te,Me=new D.AttrList(le),Be=Me.enumeratedString("METHOD"),pe=Me.URI,Ce=Me.hexadecimalInteger("IV"),ke=Me.enumeratedString("KEYFORMATVERSIONS"),Le=Me.enumeratedString("KEYID"),Ge=(Te=Me.enumeratedString("KEYFORMAT"))!=null?Te:"identity",Ve=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ve.indexOf(Ge)>-1){y.logger.warn("Keyformat "+Ge+" is not supported from the manifest");continue}else if(Ge!=="identity")continue;Be&&(fe=n.LevelKey.fromURL(T,pe),pe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Be)>=0&&(fe.method=Be,fe.keyFormat=Ge,Le&&(fe.keyID=Le),ke&&(fe.keyFormatVersions=ke),fe.iv=Ce));break}case"START":{var tt=new D.AttrList(le),rt=tt.decimalFloatingPoint("TIME-OFFSET");Object($.isFiniteNumber)(rt)&&(h.startTimeOffset=rt);break}case"MAP":{var ut=new D.AttrList(le);K.relurl=ut.URI,ut.BYTERANGE&&K.setByteRange(ut.BYTERANGE),K.level=v,K.sn="initSegment",fe&&(K.levelkey=fe),K.initSegment=null,U=K,Se=!0;break}case"SERVER-CONTROL":{var lt=new D.AttrList(le);h.canBlockReload=lt.bool("CAN-BLOCK-RELOAD"),h.canSkipUntil=lt.optionalFloat("CAN-SKIP-UNTIL",0),h.canSkipDateRanges=h.canSkipUntil>0&&lt.bool("CAN-SKIP-DATERANGES"),h.partHoldBack=lt.optionalFloat("PART-HOLD-BACK",0),h.holdBack=lt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ne=new D.AttrList(le);h.partTarget=Ne.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Pe=h.partList;Pe||(Pe=h.partList=[]);var ze=S>0?Pe[Pe.length-1]:void 0,Xe=S++,je=new G.Part(new D.AttrList(le),K,T,Xe,ze);Pe.push(je),K.duration+=je.duration;break}case"PRELOAD-HINT":{var Fe=new D.AttrList(le);h.preloadHint=Fe;break}case"RENDITION-REPORT":{var _e=new D.AttrList(le);h.renditionReports=h.renditionReports||[],h.renditionReports.push(_e);break}default:y.logger.warn("line parsed but not handled: "+Q);break}}}b&&!b.relurl?(x.pop(),M-=b.duration,h.partList&&(h.fragmentHint=b)):h.partList&&(C(K,b),K.cc=I,h.fragmentHint=K);var ye=x.length,ve=x[0],ue=x[ye-1];if(M+=h.skippedSegments*h.targetduration,M>0&&ye&&ue){h.averagetargetduration=M/ye;var ce=ue.sn;h.endSN=ce!=="initSegment"?ce:0,ve&&(h.startCC=ve.cc,ve.initSegment||h.fragments.every(function(be){return be.relurl&&d(be.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),K=new G.Fragment(c,T),K.relurl=ue.relurl,K.level=v,K.sn="initSegment",ve.initSegment=K,h.needSidxRanges=!0))}else h.endSN=0,h.startCC=0;return h.fragmentHint&&(M+=h.fragmentHint.duration),h.totalduration=M,h.endCC=I,we>0&&w(x,we),h},L}();function o(L,A){["video","audio","text"].forEach(function(_){var T=L.filter(function(c){return Object(g.isCodecType)(c,_)});if(T.length){var v=T.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});A[_+"Codec"]=v.length>0?v[0]:T[0],L=L.filter(function(c){return T.indexOf(c)===-1})}}),A.unknownCodecs=L}function O(L,A,_){var T=A[_];T&&(L[_]=T)}function w(L,A){for(var _=L[A],T=A;T--;){var v=L[T];if(!v)return;v.programDateTime=_.programDateTime-v.duration*1e3,_=v}}function C(L,A){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):A!=null&&A.programDateTime&&(L.programDateTime=A.endProgramDateTime),Object($.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/polyfills/number.ts"),j=N("./src/events.ts"),P=N("./src/errors.ts"),G=N("./src/utils/logger.ts"),W=N("./src/utils/mp4-tools.ts"),n=N("./src/loader/m3u8-parser.ts"),D=N("./src/types/loader.ts"),y=N("./src/utils/attr-list.ts");function g(a){var f=a.type;switch(f){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function p(a,f){var u=a.url;return(u===void 0||u.indexOf("data:")===0)&&(u=f.url),u}var l=function(){function a(u){this.hls=void 0,this.loaders=Object.create(null),this.hls=u,this.registerListeners()}var f=a.prototype;return f.registerListeners=function(){var d=this.hls;d.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),d.on(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var d=this.hls;d.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),d.off(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),d.off(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(d){var i=this.hls.config,o=i.pLoader,O=i.loader,w=o||O,C=new w(i);return d.loader=C,this.loaders[d.type]=C,C},f.getInternalLoader=function(d){return this.loaders[d.type]},f.resetInternalLoader=function(d){this.loaders[d]&&delete this.loaders[d]},f.destroyInternalLoaders=function(){for(var d in this.loaders){var i=this.loaders[d];i&&i.destroy(),this.resetInternalLoader(d)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(d,i){var o=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:o,deliveryDirectives:null})},f.onLevelLoading=function(d,i){var o=i.id,O=i.level,w=i.url,C=i.deliveryDirectives;this.load({id:o,groupId:null,level:O,responseType:"text",type:D.PlaylistContextType.LEVEL,url:w,deliveryDirectives:C})},f.onAudioTrackLoading=function(d,i){var o=i.id,O=i.groupId,w=i.url,C=i.deliveryDirectives;this.load({id:o,groupId:O,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:w,deliveryDirectives:C})},f.onSubtitleTrackLoading=function(d,i){var o=i.id,O=i.groupId,w=i.url,C=i.deliveryDirectives;this.load({id:o,groupId:O,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:w,deliveryDirectives:C})},f.load=function(d){var i,o=this.hls.config,O=this.getInternalLoader(d);if(O){var w=O.context;if(w&&w.url===d.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+d.type),O.abort()}var C,L,A,_;switch(d.type){case D.PlaylistContextType.MANIFEST:C=o.manifestLoadingMaxRetry,L=o.manifestLoadingTimeOut,A=o.manifestLoadingRetryDelay,_=o.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:C=0,L=o.levelLoadingTimeOut;break;default:C=o.levelLoadingMaxRetry,L=o.levelLoadingTimeOut,A=o.levelLoadingRetryDelay,_=o.levelLoadingMaxRetryTimeout;break}if(O=this.createInternalLoader(d),(i=d.deliveryDirectives)!==null&&i!==void 0&&i.part){var T;if(d.type===D.PlaylistContextType.LEVEL&&d.level!==null?T=this.hls.levels[d.level].details:d.type===D.PlaylistContextType.AUDIO_TRACK&&d.id!==null?T=this.hls.audioTracks[d.id].details:d.type===D.PlaylistContextType.SUBTITLE_TRACK&&d.id!==null&&(T=this.hls.subtitleTracks[d.id].details),T){var v=T.partTarget,c=T.targetduration;v&&c&&(L=Math.min(Math.max(v*3,c*.8)*1e3,L))}}var E={timeout:L,maxRetry:C,retryDelay:A,maxRetryDelay:_,highWaterMark:0},h={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};O.load(d,E,h)},f.loadsuccess=function(d,i,o,O){if(O===void 0&&(O=null),o.isSidxRequest){this.handleSidxRequest(d,o),this.handlePlaylistLoaded(d,i,o,O);return}this.resetInternalLoader(o.type);var w=d.data;if(w.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(d,o,"no EXTM3U delimiter",O);return}i.parsing.start=performance.now(),w.indexOf("#EXTINF:")>0||w.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(d,i,o,O):this.handleMasterPlaylist(d,i,o,O)},f.loaderror=function(d,i,o){o===void 0&&(o=null),this.handleNetworkError(i,o,!1,d)},f.loadtimeout=function(d,i,o){o===void 0&&(o=null),this.handleNetworkError(i,o,!0)},f.handleMasterPlaylist=function(d,i,o,O){var w=this.hls,C=d.data,L=p(d,o),A=n.default.parseMasterPlaylist(C,L),_=A.levels,T=A.sessionData;if(!_.length){this.handleManifestParsingError(d,o,"no level found in manifest",O);return}var v=_.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),c=_.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),E=n.default.parseMasterPlaylistMedia(C,L,"AUDIO",v),h=n.default.parseMasterPlaylistMedia(C,L,"SUBTITLES",c),x=n.default.parseMasterPlaylistMedia(C,L,"CLOSED-CAPTIONS");if(E.length){var U=E.some(function(F){return!F.url});!U&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(G.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),E.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new y.AttrList({}),bitrate:0,url:""}))}w.trigger(j.Events.MANIFEST_LOADED,{levels:_,audioTracks:E,subtitles:h,captions:x,url:L,stats:i,networkDetails:O,sessionData:T})},f.handleTrackOrLevelPlaylist=function(d,i,o,O){var w=this.hls,C=o.id,L=o.level,A=o.type,_=p(d,o),T=Object($.isFiniteNumber)(C)?C:0,v=Object($.isFiniteNumber)(L)?L:T,c=g(o),E=n.default.parseLevelPlaylist(d.data,_,v,c,T);if(!E.fragments.length){w.trigger(j.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:_,reason:"no fragments found in level",level:typeof o.level=="number"?o.level:void 0});return}if(A===D.PlaylistContextType.MANIFEST){var h={attrs:new y.AttrList({}),bitrate:0,details:E,name:"",url:_};w.trigger(j.Events.MANIFEST_LOADED,{levels:[h],audioTracks:[],url:_,stats:i,networkDetails:O,sessionData:null})}if(i.parsing.end=performance.now(),E.needSidxRanges){var x,U=(x=E.fragments[0].initSegment)===null||x===void 0?void 0:x.url;this.load({url:U,isSidxRequest:!0,type:A,level:L,levelDetails:E,id:C,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}o.levelDetails=E,this.handlePlaylistLoaded(d,i,o,O)},f.handleSidxRequest=function(d,i){var o=Object(W.parseSegmentIndex)(new Uint8Array(d.data));if(!o)return;var O=o.references,w=i.levelDetails;O.forEach(function(C,L){var A=C.info,_=w.fragments[L];_.byteRange.length===0&&_.setByteRange(String(1+A.end-A.start)+"@"+String(A.start)),_.initSegment&&_.initSegment.setByteRange(String(o.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(d,i,o,O){this.hls.trigger(j.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===D.PlaylistContextType.MANIFEST,url:d.url,reason:o,response:d,context:i,networkDetails:O})},f.handleNetworkError=function(d,i,o,O){o===void 0&&(o=!1),G.logger.warn("[playlist-loader]: A network "+(o?"timeout":"error")+" occurred while loading "+d.type+" level: "+d.level+" id: "+d.id+' group-id: "'+d.groupId+'"');var w=P.ErrorDetails.UNKNOWN,C=!1,L=this.getInternalLoader(d);switch(d.type){case D.PlaylistContextType.MANIFEST:w=o?P.ErrorDetails.MANIFEST_LOAD_TIMEOUT:P.ErrorDetails.MANIFEST_LOAD_ERROR,C=!0;break;case D.PlaylistContextType.LEVEL:w=o?P.ErrorDetails.LEVEL_LOAD_TIMEOUT:P.ErrorDetails.LEVEL_LOAD_ERROR,C=!1;break;case D.PlaylistContextType.AUDIO_TRACK:w=o?P.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,C=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:w=o?P.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:P.ErrorDetails.SUBTITLE_LOAD_ERROR,C=!1;break}L&&this.resetInternalLoader(d.type);var A={type:P.ErrorTypes.NETWORK_ERROR,details:w,fatal:C,url:d.url,loader:L,context:d,networkDetails:i};O&&(A.response=O),this.hls.trigger(j.Events.ERROR,A)},f.handlePlaylistLoaded=function(d,i,o,O){var w=o.type,C=o.level,L=o.id,A=o.groupId,_=o.loader,T=o.levelDetails,v=o.deliveryDirectives;if(!(T!=null&&T.targetduration)){this.handleManifestParsingError(d,o,"invalid target duration",O);return}if(!_)return;T.live&&(_.getCacheAge&&(T.ageHeader=_.getCacheAge()||0),(!_.getCacheAge||isNaN(T.ageHeader))&&(T.ageHeader=0));switch(w){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(j.Events.LEVEL_LOADED,{details:T,level:C||0,id:L||0,stats:i,networkDetails:O,deliveryDirectives:v});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(j.Events.AUDIO_TRACK_LOADED,{details:T,id:L||0,groupId:A||"",stats:i,networkDetails:O,deliveryDirectives:v});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(j.Events.SUBTITLE_TRACK_LOADED,{details:T,id:L||0,groupId:A||"",stats:i,networkDetails:O,deliveryDirectives:v});break}},a}();V.default=l},"./src/polyfills/number.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"isFiniteNumber",function(){return $}),N.d(V,"MAX_SAFE_INTEGER",function(){return j});var $=Number.isFinite||function(P){return typeof P=="number"&&isFinite(P)},j=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ee,V,N){"use strict";N.r(V);var $=function(){function j(){}return j.getSilentFrame=function(G,W){switch(G){case"mp4a.40.2":if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(W===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(W===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(W===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(W===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},j}();V.default=$},"./src/remux/mp4-generator.ts":function(ee,V,N){"use strict";N.r(V);var $=Math.pow(2,32)-1,j=function(){function P(){}return P.init=function(){P.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var W;for(W in P.types)P.types.hasOwnProperty(W)&&(P.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.charCodeAt(3)]);var n=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),D=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);P.HDLR_TYPES={video:n,audio:D};var y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),g=new Uint8Array([0,0,0,0,0,0,0,0]);P.STTS=P.STSC=P.STCO=g,P.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),P.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),P.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),P.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);P.FTYP=P.box(P.types.ftyp,p,a,p,l),P.DINF=P.box(P.types.dinf,P.box(P.types.dref,y))},P.box=function(W){for(var n=8,D=arguments.length,y=new Array(D>1?D-1:0),g=1;g<D;g++)y[g-1]=arguments[g];for(var p=y.length,l=p;p--;)n+=y[p].byteLength;var a=new Uint8Array(n);for(a[0]=n>>24&255,a[1]=n>>16&255,a[2]=n>>8&255,a[3]=n&255,a.set(W,4),p=0,n=8;p<l;p++)a.set(y[p],n),n+=y[p].byteLength;return a},P.hdlr=function(W){return P.box(P.types.hdlr,P.HDLR_TYPES[W])},P.mdat=function(W){return P.box(P.types.mdat,W)},P.mdhd=function(W,n){n*=W;var D=Math.floor(n/($+1)),y=Math.floor(n%($+1));return P.box(P.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,D>>24,D>>16&255,D>>8&255,D&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))},P.mdia=function(W){return P.box(P.types.mdia,P.mdhd(W.timescale,W.duration),P.hdlr(W.type),P.minf(W))},P.mfhd=function(W){return P.box(P.types.mfhd,new Uint8Array([0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255]))},P.minf=function(W){return W.type==="audio"?P.box(P.types.minf,P.box(P.types.smhd,P.SMHD),P.DINF,P.stbl(W)):P.box(P.types.minf,P.box(P.types.vmhd,P.VMHD),P.DINF,P.stbl(W))},P.moof=function(W,n,D){return P.box(P.types.moof,P.mfhd(W),P.traf(D,n))},P.moov=function(W){for(var n=W.length,D=[];n--;)D[n]=P.trak(W[n]);return P.box.apply(null,[P.types.moov,P.mvhd(W[0].timescale,W[0].duration)].concat(D).concat(P.mvex(W)))},P.mvex=function(W){for(var n=W.length,D=[];n--;)D[n]=P.trex(W[n]);return P.box.apply(null,[P.types.mvex].concat(D))},P.mvhd=function(W,n){n*=W;var D=Math.floor(n/($+1)),y=Math.floor(n%($+1)),g=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,D>>24,D>>16&255,D>>8&255,D&255,y>>24,y>>16&255,y>>8&255,y&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return P.box(P.types.mvhd,g)},P.sdtp=function(W){var n=W.samples||[],D=new Uint8Array(4+n.length),y,g;for(y=0;y<n.length;y++)g=n[y].flags,D[y+4]=g.dependsOn<<4|g.isDependedOn<<2|g.hasRedundancy;return P.box(P.types.sdtp,D)},P.stbl=function(W){return P.box(P.types.stbl,P.stsd(W),P.box(P.types.stts,P.STTS),P.box(P.types.stsc,P.STSC),P.box(P.types.stsz,P.STSZ),P.box(P.types.stco,P.STCO))},P.avc1=function(W){var n=[],D=[],y,g,p;for(y=0;y<W.sps.length;y++)g=W.sps[y],p=g.byteLength,n.push(p>>>8&255),n.push(p&255),n=n.concat(Array.prototype.slice.call(g));for(y=0;y<W.pps.length;y++)g=W.pps[y],p=g.byteLength,D.push(p>>>8&255),D.push(p&255),D=D.concat(Array.prototype.slice.call(g));var l=P.box(P.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|W.sps.length].concat(n).concat([W.pps.length]).concat(D))),a=W.width,f=W.height,u=W.pixelRatio[0],d=W.pixelRatio[1];return P.box(P.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,a>>8&255,a&255,f>>8&255,f&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l,P.box(P.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),P.box(P.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,u&255,d>>24,d>>16&255,d>>8&255,d&255])))},P.esds=function(W){var n=W.config.length;return new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(W.config).concat([6,1,2]))},P.mp4a=function(W){var n=W.samplerate;return P.box(P.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),P.box(P.types.esds,P.esds(W)))},P.mp3=function(W){var n=W.samplerate;return P.box(P.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},P.stsd=function(W){return W.type==="audio"?!W.isAAC&&W.codec==="mp3"?P.box(P.types.stsd,P.STSD,P.mp3(W)):P.box(P.types.stsd,P.STSD,P.mp4a(W)):P.box(P.types.stsd,P.STSD,P.avc1(W))},P.tkhd=function(W){var n=W.id,D=W.duration*W.timescale,y=W.width,g=W.height,p=Math.floor(D/($+1)),l=Math.floor(D%($+1));return P.box(P.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,n&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,l>>24,l>>16&255,l>>8&255,l&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,y>>8&255,y&255,0,0,g>>8&255,g&255,0,0]))},P.traf=function(W,n){var D=P.sdtp(W),y=W.id,g=Math.floor(n/($+1)),p=Math.floor(n%($+1));return P.box(P.types.traf,P.box(P.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),P.box(P.types.tfdt,new Uint8Array([1,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,p>>24,p>>16&255,p>>8&255,p&255])),P.trun(W,D.length+16+20+8+16+8+8),D)},P.trak=function(W){return W.duration=W.duration||4294967295,P.box(P.types.trak,P.tkhd(W),P.mdia(W))},P.trex=function(W){var n=W.id;return P.box(P.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},P.trun=function(W,n){var D=W.samples||[],y=D.length,g=12+16*y,p=new Uint8Array(g),l,a,f,u,d,i;for(n+=8+g,p.set([0,0,15,1,y>>>24&255,y>>>16&255,y>>>8&255,y&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),l=0;l<y;l++)a=D[l],f=a.duration,u=a.size,d=a.flags,i=a.cts,p.set([f>>>24&255,f>>>16&255,f>>>8&255,f&255,u>>>24&255,u>>>16&255,u>>>8&255,u&255,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.paddingValue<<1|d.isNonSync,d.degradPrio&240<<8,d.degradPrio&15,i>>>24&255,i>>>16&255,i>>>8&255,i&255],12+16*l);return P.box(P.types.trun,p)},P.initSegment=function(W){P.types||P.init();var n=P.moov(W),D=new Uint8Array(P.FTYP.byteLength+n.byteLength);return D.set(P.FTYP),D.set(n,P.FTYP.byteLength),D},P}();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,V.default=j},"./src/remux/mp4-remuxer.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return i}),N.d(V,"normalizePts",function(){return o});var $=N("./src/polyfills/number.ts"),j=N("./src/remux/aac-helper.ts"),P=N("./src/remux/mp4-generator.ts"),G=N("./src/events.ts"),W=N("./src/errors.ts"),n=N("./src/utils/logger.ts"),D=N("./src/types/loader.ts"),y=N("./src/utils/timescale-conversion.ts");function g(){return g=Object.assign||function(L){for(var A=1;A<arguments.length;A++){var _=arguments[A];for(var T in _)Object.prototype.hasOwnProperty.call(_,T)&&(L[T]=_[T])}return L},g.apply(this,arguments)}var p=10*1e3,l=1024,a=1152,f=null,u=null,d=!1,i=function(){function L(_,T,v,c){if(c===void 0&&(c=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=_,this.config=T,this.typeSupported=v,this.ISGenerated=!1,f===null){var E=navigator.userAgent||"",h=E.match(/Chrome\/(\d+)/i);f=h?parseInt(h[1]):0}if(u===null){var x=navigator.userAgent.match(/Safari\/(\d+)/i);u=x?parseInt(x[1]):0}d=!!f&&f<75||!!u&&u<600}var A=L.prototype;return A.destroy=function(){},A.resetTimeStamp=function(T){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=T},A.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},A.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},A.getVideoStartPts=function(T){var v=!1,c=T.reduce(function(E,h){var x=h.pts-E;return x<-4294967296?(v=!0,o(E,h.pts)):x>0?E:h.pts},T[0].pts);return v&&n.logger.debug("PTS rollover detected"),c},A.remux=function(T,v,c,E,h,x,U,F){var S,M,I,b,K,Q,ne=h,fe=h,we=T.pid>-1,Se=v.pid>-1,he=v.samples.length,se=T.samples.length>0,me=he>1,re=(!we||se)&&(!Se||me)||this.ISGenerated||U;if(re){this.ISGenerated||(I=this.generateIS(T,v,h));var le=this.isVideoContiguous,Z=-1;if(me&&(Z=O(v.samples),!le&&this.config.forceKeyFrameOnDiscontinuity))if(Q=!0,Z>0){n.logger.warn("[mp4-remuxer]: Dropped "+Z+" out of "+he+" video samples due to a missing keyframe");var ae=this.getVideoStartPts(v.samples);v.samples=v.samples.slice(Z),v.dropped+=Z,fe+=(v.samples[0].pts-ae)/(v.timescale||9e4)}else Z===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+he+" video samples"),Q=!1);if(this.ISGenerated){if(se&&me){var oe=this.getVideoStartPts(v.samples),ge=o(T.samples[0].pts,oe)-oe,Re=ge/v.inputTimeScale;ne+=Math.max(0,Re),fe+=Math.max(0,-Re)}if(se){if(T.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),I=this.generateIS(T,v,h)),M=this.remuxAudio(T,ne,this.isAudioContiguous,x,Se||me||F===D.PlaylistLevelType.AUDIO?fe:void 0),me){var Te=M?M.endPTS-M.startPTS:0;v.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),I=this.generateIS(T,v,h)),S=this.remuxVideo(v,fe,le,Te)}}else me&&(S=this.remuxVideo(v,fe,le,0));S&&(S.firstKeyFrame=Z,S.independent=Z!==-1)}}return this.ISGenerated&&(c.samples.length&&(K=this.remuxID3(c,h)),E.samples.length&&(b=this.remuxText(E,h))),{audio:M,video:S,initSegment:I,independent:Q,text:b,id3:K}},A.generateIS=function(T,v,c){var E=T.samples,h=v.samples,x=this.typeSupported,U={},F=!Object($.isFiniteNumber)(this._initPTS),S="audio/mp4",M,I,b;if(F&&(M=I=Infinity),T.config&&E.length&&(T.timescale=T.samplerate,T.isAAC||(x.mpeg?(S="audio/mpeg",T.codec=""):x.mp3&&(T.codec="mp3")),U.audio={id:"audio",container:S,codec:T.codec,initSegment:!T.isAAC&&x.mpeg?new Uint8Array(0):P.default.initSegment([T]),metadata:{channelCount:T.channelCount}},F&&(b=T.inputTimeScale,M=I=E[0].pts-Math.round(b*c))),v.sps&&v.pps&&h.length&&(v.timescale=v.inputTimeScale,U.video={id:"main",container:"video/mp4",codec:v.codec,initSegment:P.default.initSegment([v]),metadata:{width:v.width,height:v.height}},F)){b=v.inputTimeScale;var K=this.getVideoStartPts(h),Q=Math.round(b*c);I=Math.min(I,o(h[0].dts,K)-Q),M=Math.min(M,K-Q)}if(Object.keys(U).length)return this.ISGenerated=!0,F&&(this._initPTS=M,this._initDTS=I),{tracks:U,initPTS:M,timescale:b}},A.remuxVideo=function(T,v,c,E){var h=T.inputTimeScale,x=T.samples,U=[],F=x.length,S=this._initPTS,M=this.nextAvcDts,I=8,b,K,Q,ne=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,we=0,Se=!1;if(!c||M===null){var he=v*h,se=x[0].pts-o(x[0].dts,x[0].pts);M=he-se}for(var me=0;me<F;me++){var re=x[me];if(re.pts=o(re.pts-S,M),re.dts=o(re.dts-S,M),re.dts>re.pts){var le=9e4*.2;we=Math.max(Math.min(we,re.pts-re.dts),-1*le)}re.dts<x[me>0?me-1:me].dts&&(Se=!0)}Se&&x.sort(function(yt,bt){var dt=yt.dts-bt.dts,wt=yt.pts-bt.pts;return dt||wt}),K=x[0].dts,Q=x[x.length-1].dts;var Z=Math.round((Q-K)/(F-1));if(we<0){if(we<Z*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(y.toMsFromMpegTsClock)(-Z,!0)+" ms");for(var ae=we,oe=0;oe<F;oe++)x[oe].dts=ae=Math.max(ae,x[oe].pts-Z),x[oe].pts=Math.max(ae,x[oe].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(y.toMsFromMpegTsClock)(we,!0)+" ms to overcome this issue");for(var ge=0;ge<F;ge++)x[ge].dts=x[ge].dts+we}K=x[0].dts}if(c){var Re=K-M,Te=Re>Z,Me=Re<-1;if(Te||Me){Te?n.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(Re,!0)+" ms ("+Re+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-Re,!0)+" ms ("+Re+"dts) overlapping between fragments detected"),K=M;var Be=x[0].pts-Re;x[0].dts=K,x[0].pts=Be,n.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(Be,!0)+"/"+Object(y.toMsFromMpegTsClock)(K,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(Re,!0)+" ms")}}d&&(K=Math.max(0,K));for(var pe=0,Ce=0,ke=0;ke<F;ke++){for(var Le=x[ke],Ge=Le.units,Ve=Ge.length,tt=0,rt=0;rt<Ve;rt++)tt+=Ge[rt].data.length;Ce+=tt,pe+=Ve,Le.length=tt,Le.dts=Math.max(Le.dts,K),Le.pts=Math.max(Le.pts,Le.dts,0),ne=Math.min(Le.pts,ne),fe=Math.max(Le.pts,fe)}Q=x[F-1].dts;var ut=Ce+4*pe+8,lt;try{lt=new Uint8Array(ut)}catch(yt){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ut,reason:"fail allocating video mdat "+ut});return}var Ne=new DataView(lt.buffer);Ne.setUint32(0,ut),lt.set(P.default.types.mdat,4);for(var Pe=0;Pe<F;Pe++){for(var ze=x[Pe],Xe=ze.units,je=0,Fe=0,_e=Xe.length;Fe<_e;Fe++){var ye=Xe[Fe],ve=ye.data,ue=ye.data.byteLength;Ne.setUint32(I,ue),I+=4,lt.set(ve,I),I+=ue,je+=4+ue}if(Pe<F-1)b=x[Pe+1].dts-ze.dts;else{var ce=this.config,be=ze.dts-x[Pe>0?Pe-1:Pe].dts;if(ce.stretchShortVideoTrack&&this.nextAudioPts!==null){var xe=Math.floor(ce.maxBufferHole*h),Oe=(E?ne+E*h:this.nextAudioPts)-ze.pts;Oe>xe?(b=Oe-be,b<0&&(b=be),n.logger.log("[mp4-remuxer]: It is approximately "+Oe/90+" ms to the next segment; using duration "+b/90+" ms for the last video frame.")):b=be}else b=be}var Ue=Math.round(ze.pts-ze.dts);U.push(new w(ze.key,b,je,Ue))}if(U.length&&f&&f<70){var Ke=U[0].flags;Ke.dependsOn=2,Ke.isNonSync=0}console.assert(b!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=M=Q+b,this.isVideoContiguous=!0;var et=P.default.moof(T.sequenceNumber++,K,g({},T,{samples:U})),it="video",nt={data1:et,data2:lt,startPTS:ne/h,endPTS:(fe+b)/h,startDTS:K/h,endDTS:M/h,type:it,hasAudio:!1,hasVideo:!0,nb:U.length,dropped:T.dropped};return T.samples=[],T.dropped=0,console.assert(lt.length,"MDAT length must not be zero"),nt},A.remuxAudio=function(T,v,c,E,h){var x=T.inputTimeScale,U=T.samplerate?T.samplerate:x,F=x/U,S=T.isAAC?l:a,M=S*F,I=this._initPTS,b=!T.isAAC&&this.typeSupported.mpeg,K=[],Q=T.samples,ne=b?0:8,fe=this.nextAudioPts||-1,we=v*x;if(this.isAudioContiguous=c=c||Q.length&&fe>0&&(E&&Math.abs(we-fe)<9e3||Math.abs(o(Q[0].pts-I,we)-fe)<20*M),Q.forEach(function(ve){ve.pts=o(ve.pts-I,we)}),!c||fe<0){if(Q=Q.filter(function(ve){return ve.pts>=0}),!Q.length)return;h===0?fe=0:E?fe=Math.max(0,we):fe=Q[0].pts}if(T.isAAC)for(var Se=h!==void 0,he=this.config.maxAudioFramesDrift,se=0,me=fe;se<Q.length;se++){var re=Q[se],le=re.pts,Z=le-me,ae=Math.abs(1e3*Z/x);if(Z<=-he*M&&Se)se===0&&(n.logger.warn("Audio frame @ "+(le/x).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Z/x)+" ms."),this.nextAudioPts=fe=me=le);else if(Z>=he*M&&ae<p&&Se){var oe=Math.round(Z/M);me=le-oe*M,me<0&&(oe--,me+=M),se===0&&(this.nextAudioPts=fe=me),n.logger.warn("[mp4-remuxer]: Injecting "+oe+" audio frame @ "+(me/x).toFixed(3)+"s due to "+Math.round(1e3*Z/x)+" ms gap.");for(var ge=0;ge<oe;ge++){var Re=Math.max(me,0),Te=j.default.getSilentFrame(T.manifestCodec||T.codec,T.channelCount);Te||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Te=re.unit.subarray()),Q.splice(se,0,{unit:Te,pts:Re}),me+=M,se++}}re.pts=me,me+=M}for(var Me=null,Be=null,pe,Ce=0,ke=Q.length;ke--;)Ce+=Q[ke].unit.byteLength;for(var Le=0,Ge=Q.length;Le<Ge;Le++){var Ve=Q[Le],tt=Ve.unit,rt=Ve.pts;if(Be!==null){var ut=K[Le-1];ut.duration=Math.round((rt-Be)/F)}else if(c&&T.isAAC&&(rt=fe),Me=rt,Ce>0){Ce+=ne;try{pe=new Uint8Array(Ce)}catch(ve){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ce,reason:"fail allocating audio mdat "+Ce});return}if(!b){var lt=new DataView(pe.buffer);lt.setUint32(0,Ce),pe.set(P.default.types.mdat,4)}}else return;pe.set(tt,ne);var Ne=tt.byteLength;ne+=Ne,K.push(new w(!0,S,Ne,0)),Be=rt}var Pe=K.length;if(!Pe)return;var ze=K[K.length-1];this.nextAudioPts=fe=Be+F*ze.duration;var Xe=b?new Uint8Array(0):P.default.moof(T.sequenceNumber++,Me/F,g({},T,{samples:K}));T.samples=[];var je=Me/x,Fe=fe/x,_e="audio",ye={data1:Xe,data2:pe,startPTS:je,endPTS:Fe,startDTS:je,endDTS:Fe,type:_e,hasAudio:!0,hasVideo:!1,nb:Pe};return this.isAudioContiguous=!0,console.assert(pe.length,"MDAT length must not be zero"),ye},A.remuxEmptyAudio=function(T,v,c,E){var h=T.inputTimeScale,x=T.samplerate?T.samplerate:h,U=h/x,F=this.nextAudioPts,S=(F!==null?F:E.startDTS*h)+this._initDTS,M=E.endDTS*h+this._initDTS,I=U*l,b=Math.ceil((M-S)/I),K=j.default.getSilentFrame(T.manifestCodec||T.codec,T.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!K){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Q=[],ne=0;ne<b;ne++){var fe=S+ne*I;Q.push({unit:K,pts:fe,dts:fe})}return T.samples=Q,this.remuxAudio(T,v,c,!1)},A.remuxID3=function(T,v){var c=T.samples.length;if(!c)return;for(var E=T.inputTimeScale,h=this._initPTS,x=this._initDTS,U=0;U<c;U++){var F=T.samples[U];F.pts=o(F.pts-h,v*E)/E,F.dts=o(F.dts-x,v*E)/E}var S=T.samples;return T.samples=[],{samples:S}},A.remuxText=function(T,v){var c=T.samples.length;if(!c)return;for(var E=T.inputTimeScale,h=this._initPTS,x=0;x<c;x++){var U=T.samples[x];U.pts=o(U.pts-h,v*E)/E}T.samples.sort(function(S,M){return S.pts-M.pts});var F=T.samples;return T.samples=[],{samples:F}},L}();function o(L,A){var _;if(A===null)return L;for(A<L?_=-8589934592:_=8589934592;Math.abs(L-A)>4294967296;)L+=_;return L}function O(L){for(var A=0;A<L.length;A++)if(L[A].key)return A;return-1}var w=function(A,_,T,v){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=_,this.size=T,this.cts=v,this.flags=new C(A)},C=function(A){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=A?2:1,this.isNonSync=A?0:1}},"./src/remux/passthrough-remuxer.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/polyfills/number.ts"),j=N("./src/utils/mp4-tools.ts"),P=N("./src/loader/fragment.ts"),G=N("./src/utils/logger.ts"),W=function(){function y(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var g=y.prototype;return g.destroy=function(){},g.resetTimeStamp=function(l){this.initPTS=l,this.lastEndDTS=null},g.resetNextTimestamp=function(){this.lastEndDTS=null},g.resetInitSegment=function(l,a,f){this.audioCodec=a,this.videoCodec=f,this.generateInitSegment(l),this.emitInitSegment=!0},g.generateInitSegment=function(l){var a=this.audioCodec,f=this.videoCodec;if(!l||!l.byteLength){this.initTracks=void 0,this.initData=void 0;return}var u=this.initData=Object(j.parseInitSegment)(l);a||(a=D(u.audio,P.ElementaryStreamTypes.AUDIO)),f||(f=D(u.video,P.ElementaryStreamTypes.VIDEO));var d={};u.audio&&u.video?d.audiovideo={container:"video/mp4",codec:a+","+f,initSegment:l,id:"main"}:u.audio?d.audio={container:"audio/mp4",codec:a,initSegment:l,id:"audio"}:u.video?d.video={container:"video/mp4",codec:f,initSegment:l,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=d},g.remux=function(l,a,f,u,d){var i=this.initPTS,o=this.lastEndDTS,O={audio:void 0,video:void 0,text:u,id3:f,initSegment:void 0};Object($.isFiniteNumber)(o)||(o=this.lastEndDTS=d||0);var w=a.samples;if(!w||!w.length)return O;var C={initPTS:void 0,timescale:1},L=this.initData;if((!L||!L.length)&&(this.generateInitSegment(w),L=this.initData),!L||!L.length)return G.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),O;this.emitInitSegment&&(C.tracks=this.initTracks,this.emitInitSegment=!1),Object($.isFiniteNumber)(i)||(this.initPTS=C.initPTS=i=n(L,w,o));var A=Object(j.getDuration)(w,L),_=o,T=A+_;Object(j.offsetStartDTS)(L,w,i),A>0?this.lastEndDTS=T:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var v=!!L.audio,c=!!L.video,E="";v&&(E+="audio"),c&&(E+="video");var h={data1:w,startPTS:_,startDTS:_,endPTS:T,endDTS:T,type:E,hasAudio:v,hasVideo:c,nb:1,dropped:0};return O.audio=h.type==="audio"?h:void 0,O.video=h.type!=="audio"?h:void 0,O.text=u,O.id3=f,O.initSegment=C,O},y}(),n=function(g,p,l){return Object(j.getStartDTS)(g,p)-l};function D(y,g){var p=y==null?void 0:y.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||g===P.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=W},"./src/task-loop.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return $});var $=function(){function j(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var P=j.prototype;return P.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},P.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},P.onHandlerDestroyed=function(){},P.hasInterval=function(){return!!this._tickInterval},P.hasNextTick=function(){return!!this._tickTimer},P.setInterval=function(W){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,W),!0)},P.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},P.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},P.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},P.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},P.doTick=function(){},j}()},"./src/types/cmcd.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"CMCDVersion",function(){return $}),N.d(V,"CMCDObjectType",function(){return j}),N.d(V,"CMCDStreamingFormat",function(){return P}),N.d(V,"CMCDStreamType",function(){return G});var $=1,j;(function(W){W.MANIFEST="m",W.AUDIO="a",W.VIDEO="v",W.MUXED="av",W.INIT="i",W.CAPTION="c",W.TIMED_TEXT="tt",W.KEY="k",W.OTHER="o"})(j||(j={}));var P;(function(W){W.DASH="d",W.HLS="h",W.SMOOTH="s",W.OTHER="o"})(P||(P={}));var G;(function(W){W.VOD="v",W.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"HlsSkip",function(){return P}),N.d(V,"getSkipValue",function(){return G}),N.d(V,"HlsUrlParameters",function(){return W}),N.d(V,"Level",function(){return n});function $(D,y){for(var g=0;g<y.length;g++){var p=y[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(D,p.key,p)}}function j(D,y,g){return y&&$(D.prototype,y),g&&$(D,g),D}var P;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(P||(P={}));function G(D,y){var g=D.canSkipUntil,p=D.canSkipDateRanges,l=D.endSN,a=y!==void 0?y-l:0;return g&&a<g?p?P.v2:P.Yes:P.No}var W=function(){function D(g,p,l){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=g,this.part=p,this.skip=l}var y=D.prototype;return y.addDirectives=function(p){var l=new self.URL(p);return this.msn!==void 0&&l.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&l.searchParams.set("_HLS_part",this.part.toString()),this.skip&&l.searchParams.set("_HLS_skip",this.skip),l.toString()},D}(),n=function(){function D(y){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[y.url],this.attrs=y.attrs,this.bitrate=y.bitrate,y.details&&(this.details=y.details),this.id=y.id||0,this.name=y.name,this.width=y.width||0,this.height=y.height||0,this.audioCodec=y.audioCodec,this.videoCodec=y.videoCodec,this.unknownCodecs=y.unknownCodecs,this.codecSet=[y.videoCodec,y.audioCodec].filter(function(g){return g}).join(",").replace(/\.[^.,]+/g,"")}return j(D,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(g){var p=g%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),D}()},"./src/types/loader.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"PlaylistContextType",function(){return $}),N.d(V,"PlaylistLevelType",function(){return j});var $;(function(P){P.MANIFEST="manifest",P.LEVEL="level",P.AUDIO_TRACK="audioTrack",P.SUBTITLE_TRACK="subtitleTrack"})($||($={}));var j;(function(P){P.MAIN="main",P.AUDIO="audio",P.SUBTITLE="subtitle"})(j||(j={}))},"./src/types/transmuxer.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"ChunkMetadata",function(){return $});var $=function(G,W,n,D,y,g){D===void 0&&(D=0),y===void 0&&(y=-1),g===void 0&&(g=!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=G,this.sn=W,this.id=n,this.size=D,this.part=y,this.partial=g};function j(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"AttrList",function(){return P});var $=/^(\d+)x(\d+)$/,j=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,P=function(){function G(n){typeof n=="string"&&(n=G.parseAttrList(n));for(var D in n)n.hasOwnProperty(D)&&(this[D]=n[D])}var W=G.prototype;return W.decimalInteger=function(D){var y=parseInt(this[D],10);return y>Number.MAX_SAFE_INTEGER?Infinity:y},W.hexadecimalInteger=function(D){if(this[D]){var y=(this[D]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var g=new Uint8Array(y.length/2),p=0;p<y.length/2;p++)g[p]=parseInt(y.slice(p*2,p*2+2),16);return g}else return null},W.hexadecimalIntegerAsNumber=function(D){var y=parseInt(this[D],16);return y>Number.MAX_SAFE_INTEGER?Infinity:y},W.decimalFloatingPoint=function(D){return parseFloat(this[D])},W.optionalFloat=function(D,y){var g=this[D];return g?parseFloat(g):y},W.enumeratedString=function(D){return this[D]},W.bool=function(D){return this[D]==="YES"},W.decimalResolution=function(D){var y=$.exec(this[D]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},G.parseAttrList=function(D){var y,g={},p='"';for(j.lastIndex=0;(y=j.exec(D))!==null;){var l=y[2];l.indexOf(p)===0&&l.lastIndexOf(p)===l.length-1&&(l=l.slice(1,-1)),g[y[1]]=l}return g},G}()},"./src/utils/binary-search.ts":function(ee,V,N){"use strict";N.r(V);var $={search:function(P,G){for(var W=0,n=P.length-1,D=null,y=null;W<=n;){D=(W+n)/2|0,y=P[D];var g=G(y);if(g>0)W=D+1;else if(g<0)n=D-1;else return y}return null}};V.default=$},"./src/utils/buffer-helper.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"BufferHelper",function(){return P});var $=N("./src/utils/logger.ts"),j={length:0,start:function(){return 0},end:function(){return 0}},P=function(){function G(){}return G.isBuffered=function(n,D){try{if(n){for(var y=G.getBuffered(n),g=0;g<y.length;g++)if(D>=y.start(g)&&D<=y.end(g))return!0}}catch(p){}return!1},G.bufferInfo=function(n,D,y){try{if(n){var g=G.getBuffered(n),p=[],l;for(l=0;l<g.length;l++)p.push({start:g.start(l),end:g.end(l)});return this.bufferedInfo(p,D,y)}}catch(a){}return{len:0,start:D,end:D,nextStart:void 0}},G.bufferedInfo=function(n,D,y){D=Math.max(0,D),n.sort(function(C,L){var A=C.start-L.start;return A||L.end-C.end});var g=[];if(y)for(var p=0;p<n.length;p++){var l=g.length;if(l){var a=g[l-1].end;n[p].start-a<y?n[p].end>a&&(g[l-1].end=n[p].end):g.push(n[p])}else g.push(n[p])}else g=n;for(var f=0,u,d=D,i=D,o=0;o<g.length;o++){var O=g[o].start,w=g[o].end;if(D+y>=O&&D<w)d=O,i=w,f=i-D;else if(D+y<O){u=O;break}}return{len:f,start:d||0,end:i||0,nextStart:u}},G.getBuffered=function(n){try{return n.buffered}catch(D){return $.logger.log("failed to get media.buffered",D),j}},G}()},"./src/utils/cea-608-parser.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"Row",function(){return i}),N.d(V,"CaptionScreen",function(){return o});var $=N("./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},P=function(T){var v=T;return j.hasOwnProperty(T)&&(v=j[T]),String.fromCharCode(v)},G=15,W=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},D={17:2,18:4,21:6,22:8,23:10,19:13,20:15},y={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},g={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],l;(function(_){_[_.ERROR=0]="ERROR",_[_.TEXT=1]="TEXT",_[_.WARNING=2]="WARNING",_[_.INFO=2]="INFO",_[_.DEBUG=3]="DEBUG",_[_.DATA=3]="DATA"})(l||(l={}));var a=function(){function _(){this.time=null,this.verboseLevel=l.ERROR}var T=_.prototype;return T.log=function(c,E){this.verboseLevel>=c&&$.logger.log(this.time+" ["+c+"] "+E)},_}(),f=function(T){for(var v=[],c=0;c<T.length;c++)v.push(T[c].toString(16));return v},u=function(){function _(v,c,E,h,x){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=v||"white",this.underline=c||!1,this.italics=E||!1,this.background=h||"black",this.flash=x||!1}var T=_.prototype;return T.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},T.setStyles=function(c){for(var E=["foreground","underline","italics","background","flash"],h=0;h<E.length;h++){var x=E[h];c.hasOwnProperty(x)&&(this[x]=c[x])}},T.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},T.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},T.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},T.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},_}(),d=function(){function _(v,c,E,h,x,U){this.uchar=void 0,this.penState=void 0,this.uchar=v||" ",this.penState=new u(c,E,h,x,U)}var T=_.prototype;return T.reset=function(){this.uchar=" ",this.penState.reset()},T.setChar=function(c,E){this.uchar=c,this.penState.copy(E)},T.setPenState=function(c){this.penState.copy(c)},T.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},T.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},T.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},_}(),i=function(){function _(v){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var c=0;c<W;c++)this.chars.push(new d);this.logger=v,this.pos=0,this.currPenState=new u}var T=_.prototype;return T.equals=function(c){for(var E=!0,h=0;h<W;h++)if(!this.chars[h].equals(c.chars[h])){E=!1;break}return E},T.copy=function(c){for(var E=0;E<W;E++)this.chars[E].copy(c.chars[E])},T.isEmpty=function(){for(var c=!0,E=0;E<W;E++)if(!this.chars[E].isEmpty()){c=!1;break}return c},T.setCursor=function(c){this.pos!==c&&(this.pos=c),this.pos<0?(this.logger.log(l.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>W&&(this.logger.log(l.DEBUG,"Too large cursor position "+this.pos),this.pos=W)},T.moveCursor=function(c){var E=this.pos+c;if(c>1)for(var h=this.pos+1;h<E+1;h++)this.chars[h].setPenState(this.currPenState);this.setCursor(E)},T.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},T.insertChar=function(c){c>=144&&this.backSpace();var E=P(c);if(this.pos>=W){this.logger.log(l.ERROR,"Cannot insert "+c.toString(16)+" ("+E+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(E,this.currPenState),this.moveCursor(1)},T.clearFromPos=function(c){var E;for(E=c;E<W;E++)this.chars[E].reset()},T.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},T.clearToEndOfRow=function(){this.clearFromPos(this.pos)},T.getTextString=function(){for(var c=[],E=!0,h=0;h<W;h++){var x=this.chars[h].uchar;x!==" "&&(E=!1),c.push(x)}return E?"":c.join("")},T.setPenStyles=function(c){this.currPenState.setStyles(c);var E=this.chars[this.pos];E.setPenState(this.currPenState)},_}(),o=function(){function _(v){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var c=0;c<G;c++)this.rows.push(new i(v));this.logger=v,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var T=_.prototype;return T.reset=function(){for(var c=0;c<G;c++)this.rows[c].clear();this.currRow=G-1},T.equals=function(c){for(var E=!0,h=0;h<G;h++)if(!this.rows[h].equals(c.rows[h])){E=!1;break}return E},T.copy=function(c){for(var E=0;E<G;E++)this.rows[E].copy(c.rows[E])},T.isEmpty=function(){for(var c=!0,E=0;E<G;E++)if(!this.rows[E].isEmpty()){c=!1;break}return c},T.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},T.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},T.insertChar=function(c){var E=this.rows[this.currRow];E.insertChar(c)},T.setPen=function(c){var E=this.rows[this.currRow];E.setPenStyles(c)},T.moveCursor=function(c){var E=this.rows[this.currRow];E.moveCursor(c)},T.setCursor=function(c){this.logger.log(l.INFO,"setCursor: "+c);var E=this.rows[this.currRow];E.setCursor(c)},T.setPAC=function(c){this.logger.log(l.INFO,"pacData = "+JSON.stringify(c));var E=c.row-1;if(this.nrRollUpRows&&E<this.nrRollUpRows-1&&(E=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==E){for(var h=0;h<G;h++)this.rows[h].clear();var x=this.currRow+1-this.nrRollUpRows,U=this.lastOutputScreen;if(U){var F=U.rows[x].cueStartTime,S=this.logger.time;if(F&&S!==null&&F<S)for(var M=0;M<this.nrRollUpRows;M++)this.rows[E-this.nrRollUpRows+M+1].copy(U.rows[x+M])}}this.currRow=E;var I=this.rows[this.currRow];if(c.indent!==null){var b=c.indent,K=Math.max(b-1,0);I.setCursor(c.indent),c.color=I.chars[K].penState.foreground}var Q={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen(Q)},T.setBkgData=function(c){this.logger.log(l.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},T.setRollUpRows=function(c){this.nrRollUpRows=c},T.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(l.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(l.TEXT,this.getDisplayText());var c=this.currRow+1-this.nrRollUpRows,E=this.rows.splice(c,1)[0];E.clear(),this.rows.splice(this.currRow,0,E),this.logger.log(l.INFO,"Rolling up")},T.getDisplayText=function(c){c=c||!1;for(var E=[],h="",x=-1,U=0;U<G;U++){var F=this.rows[U].getTextString();F&&(x=U+1,c?E.push("Row "+x+": '"+F+"'"):E.push(F.trim()))}return E.length>0&&(c?h="["+E.join(" | ")+"]":h=E.join(`
`)),h},T.getTextAndFormat=function(){return this.rows},_}(),O=function(){function _(v,c,E){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=v,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new o(E),this.nonDisplayedMemory=new o(E),this.lastOutputScreen=new o(E),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=E}var T=_.prototype;return T.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},T.getHandler=function(){return this.outputFilter},T.setHandler=function(c){this.outputFilter=c},T.setPAC=function(c){this.writeScreen.setPAC(c)},T.setBkgData=function(c){this.writeScreen.setBkgData(c)},T.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(l.INFO,"MODE="+c),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=c},T.insertChars=function(c){for(var E=0;E<c.length;E++)this.writeScreen.insertChar(c[E]);var h=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(l.INFO,h+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(l.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},T.ccRCL=function(){this.logger.log(l.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},T.ccBS=function(){if(this.logger.log(l.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},T.ccAOF=function(){},T.ccAON=function(){},T.ccDER=function(){this.logger.log(l.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},T.ccRU=function(c){this.logger.log(l.INFO,"RU("+c+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(c)},T.ccFON=function(){this.logger.log(l.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},T.ccRDC=function(){this.logger.log(l.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},T.ccTR=function(){this.logger.log(l.INFO,"TR"),this.setMode("MODE_TEXT")},T.ccRTD=function(){this.logger.log(l.INFO,"RTD"),this.setMode("MODE_TEXT")},T.ccEDM=function(){this.logger.log(l.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},T.ccCR=function(){this.logger.log(l.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},T.ccENM=function(){this.logger.log(l.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},T.ccEOC=function(){if(this.logger.log(l.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var c=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=c,this.writeScreen=this.nonDisplayedMemory,this.logger.log(l.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},T.ccTO=function(c){this.logger.log(l.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},T.ccMIDROW=function(c){var E={flash:!1};if(E.underline=c%2===1,E.italics=c>=46,E.italics)E.foreground="white";else{var h=Math.floor(c/2)-16,x=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=x[h]}this.logger.log(l.INFO,"MIDROW: "+JSON.stringify(E)),this.writeScreen.setPen(E)},T.outputDataUpdate=function(c){c===void 0&&(c=!1);var E=this.logger.time;if(E===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=E:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,E,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:E),this.lastOutputScreen.copy(this.displayedMemory))},T.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},_}(),w=function(){function _(v,c,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var h=new a;this.channels=[null,new O(v,c,h),new O(v+1,E,h)],this.cmdHistory=A(),this.logger=h}var T=_.prototype;return T.getHandler=function(c){return this.channels[c].getHandler()},T.setHandler=function(c,E){this.channels[c].setHandler(E)},T.addData=function(c,E){var h,x,U,F=!1;this.logger.time=c;for(var S=0;S<E.length;S+=2){if(x=E[S]&127,U=E[S+1]&127,x===0&&U===0)continue;if(this.logger.log(l.DATA,"["+f([E[S],E[S+1]])+"] -> ("+f([x,U])+")"),h=this.parseCmd(x,U),h||(h=this.parseMidrow(x,U)),h||(h=this.parsePAC(x,U)),h||(h=this.parseBackgroundAttributes(x,U)),!h&&(F=this.parseChars(x,U),F)){var M=this.currentChannel;if(M&&M>0){var I=this.channels[M];I.insertChars(F)}else this.logger.log(l.WARNING,"No channel found yet. TEXT-MODE?")}!h&&!F&&this.logger.log(l.WARNING,"Couldn't parse cleaned data "+f([x,U])+" orig: "+f([E[S],E[S+1]]))}},T.parseCmd=function(c,E){var h=this.cmdHistory,x=(c===20||c===28||c===21||c===29)&&E>=32&&E<=47,U=(c===23||c===31)&&E>=33&&E<=35;if(!(x||U))return!1;if(L(c,E,h))return C(null,null,h),this.logger.log(l.DEBUG,"Repeated command ("+f([c,E])+") is dropped"),!0;var F=c===20||c===21||c===23?1:2,S=this.channels[F];return c===20||c===21||c===28||c===29?E===32?S.ccRCL():E===33?S.ccBS():E===34?S.ccAOF():E===35?S.ccAON():E===36?S.ccDER():E===37?S.ccRU(2):E===38?S.ccRU(3):E===39?S.ccRU(4):E===40?S.ccFON():E===41?S.ccRDC():E===42?S.ccTR():E===43?S.ccRTD():E===44?S.ccEDM():E===45?S.ccCR():E===46?S.ccENM():E===47&&S.ccEOC():S.ccTO(E-32),C(c,E,h),this.currentChannel=F,!0},T.parseMidrow=function(c,E){var h=0;if((c===17||c===25)&&E>=32&&E<=47){if(c===17?h=1:h=2,h!==this.currentChannel)return this.logger.log(l.ERROR,"Mismatch channel in midrow parsing"),!1;var x=this.channels[h];return x?(x.ccMIDROW(E),this.logger.log(l.DEBUG,"MIDROW ("+f([c,E])+")"),!0):!1}return!1},T.parsePAC=function(c,E){var h,x=this.cmdHistory,U=(c>=17&&c<=23||c>=25&&c<=31)&&E>=64&&E<=127,F=(c===16||c===24)&&E>=64&&E<=95;if(!(U||F))return!1;if(L(c,E,x))return C(null,null,x),!0;var S=c<=23?1:2;E>=64&&E<=95?h=S===1?n[c]:y[c]:h=S===1?D[c]:g[c];var M=this.channels[S];return M?(M.setPAC(this.interpretPAC(h,E)),C(c,E,x),this.currentChannel=S,!0):!1},T.interpretPAC=function(c,E){var h,x={color:null,italics:!1,indent:null,underline:!1,row:c};return E>95?h=E-96:h=E-64,x.underline=(h&1)===1,h<=13?x.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(h/2)]:h<=15?(x.italics=!0,x.color="white"):x.indent=Math.floor((h-16)/2)*4,x},T.parseChars=function(c,E){var h,x=null,U=null;if(c>=25?(h=2,U=c-8):(h=1,U=c),U>=17&&U<=19){var F;U===17?F=E+80:U===18?F=E+112:F=E+144,this.logger.log(l.INFO,"Special char '"+P(F)+"' in channel "+h),x=[F]}else c>=32&&c<=127&&(x=E===0?[c]:[c,E]);if(x){var S=f(x);this.logger.log(l.DEBUG,"Char codes = "+S.join(",")),C(c,E,this.cmdHistory)}return x},T.parseBackgroundAttributes=function(c,E){var h=(c===16||c===24)&&E>=32&&E<=47,x=(c===23||c===31)&&E>=45&&E<=47;if(!(h||x))return!1;var U,F={};c===16||c===24?(U=Math.floor((E-32)/2),F.background=p[U],E%2===1&&(F.background=F.background+"_semi")):E===45?F.background="transparent":(F.foreground="black",E===47&&(F.underline=!0));var S=c<=23?1:2,M=this.channels[S];return M.setBkgData(F),C(c,E,this.cmdHistory),!0},T.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var E=this.channels[c];E&&E.reset()}this.cmdHistory=A()},T.cueSplitAtTime=function(c){for(var E=0;E<this.channels.length;E++){var h=this.channels[E];h&&h.cueSplitAtTime(c)}},_}();function C(_,T,v){v.a=_,v.b=T}function L(_,T,v){return v.a===_&&v.b===T}function A(){return{a:null,b:null}}V.default=w},"./src/utils/codecs.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"isCodecType",function(){return j}),N.d(V,"isCodecSupportedInMp4",function(){return P});var $={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(G,W){var n=$[W];return!!n&&n[G.slice(0,4)]===!0}function P(G,W){return MediaSource.isTypeSupported((W||"video")+'/mp4;codecs="'+G+'"')}},"./src/utils/cues.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/utils/vttparser.ts"),j=N("./src/utils/webvtt-parser.ts"),P=N("./src/utils/texttrack-utils.ts"),G=/\s/,W={newCue:function(D,y,g,p){for(var l=[],a,f,u,d,i,o=self.VTTCue||self.TextTrackCue,O=0;O<p.rows.length;O++)if(a=p.rows[O],u=!0,d=0,i="",!a.isEmpty()){for(var w=0;w<a.chars.length;w++)G.test(a.chars[w].uchar)&&u?d++:(i+=a.chars[w].uchar,u=!1);a.cueStartTime=y,y===g&&(g+=1e-4),d>=16?d--:d++;var C=Object($.fixLineBreaks)(i.trim()),L=Object(j.generateCueId)(y,g,C);(!D||!D.cues||!D.cues.getCueById(L))&&(f=new o(y,g,C),f.id=L,f.line=O+1,f.align="left",f.position=10+Math.min(80,Math.floor(d*8/32)*10),l.push(f))}return D&&l.length&&(l.sort(function(A,_){return A.line==="auto"||_.line==="auto"?0:A.line>8&&_.line>8?_.line-A.line:A.line-_.line}),l.forEach(function(A){return Object(P.addCueToTrack)(D,A)})),l}};V.default=W},"./src/utils/discontinuities.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"findFirstFragWithCC",function(){return G}),N.d(V,"shouldAlignOnDiscontinuities",function(){return W}),N.d(V,"findDiscontinuousReferenceFrag",function(){return n}),N.d(V,"adjustSlidingStart",function(){return y}),N.d(V,"alignStream",function(){return g}),N.d(V,"alignPDT",function(){return l}),N.d(V,"alignFragmentByPDTDelta",function(){return a}),N.d(V,"alignMediaPlaylistByPDT",function(){return f});var $=N("./src/polyfills/number.ts"),j=N("./src/utils/logger.ts"),P=N("./src/controller/level-helper.ts");function G(u,d){for(var i=null,o=0,O=u.length;o<O;o++){var w=u[o];if(w&&w.cc===d){i=w;break}}return i}function W(u,d,i){return!!(d.details&&(i.endCC>i.startCC||u&&u.cc<i.startCC))}function n(u,d){var i=u.fragments,o=d.fragments;if(!o.length||!i.length){j.logger.log("No fragments to align");return}var O=G(i,o[0].cc);if(!O||O&&!O.startPTS){j.logger.log("No frag in previous level to align on");return}return O}function D(u,d){if(u){var i=u.start+d;u.start=u.startPTS=i,u.endPTS=i+u.duration}}function y(u,d){for(var i=d.fragments,o=0,O=i.length;o<O;o++)D(i[o],u);d.fragmentHint&&D(d.fragmentHint,u),d.alignedSliding=!0}function g(u,d,i){if(!d)return;p(u,i,d),!i.alignedSliding&&d.details&&l(i,d.details),!i.alignedSliding&&d.details&&!i.skippedSegments&&Object(P.adjustSliding)(d.details,i)}function p(u,d,i){if(W(u,i,d)){var o=n(i.details,d);o&&Object($.isFiniteNumber)(o.start)&&(j.logger.log("Adjusting PTS using last level due to CC increase within current level "+d.url),y(o.start,d))}}function l(u,d){if(!d.fragments.length||!u.hasProgramDateTime||!d.hasProgramDateTime)return;var i=d.fragments[0].programDateTime,o=u.fragments[0].programDateTime,O=(o-i)/1e3+d.fragments[0].start;O&&Object($.isFiniteNumber)(O)&&(j.logger.log("Adjusting PTS using programDateTime delta "+(o-i)+"ms, sliding:"+O.toFixed(3)+" "+u.url+" "),y(O,u))}function a(u,d){var i=u.programDateTime;if(!i)return;var o=(i-d)/1e3;u.start=u.startPTS=o,u.endPTS=o+u.duration}function f(u,d){if(!d.fragments.length||!u.hasProgramDateTime||!d.hasProgramDateTime)return;var i=d.fragments[0].programDateTime,o=d.fragments[0].start,O=i-o*1e3;u.fragments.forEach(function(w){a(w,O)}),u.fragmentHint&&a(u.fragmentHint,O),u.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/utils/ewma.ts"),j=function(){function P(W,n,D){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=D,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new $.default(W),this.fast_=new $.default(n)}var G=P.prototype;return G.update=function(n,D){var y=this.slow_,g=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new $.default(n,y.getEstimate(),y.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new $.default(D,g.getEstimate(),g.getTotalWeight()))},G.sample=function(n,D){n=Math.max(n,this.minDelayMs_);var y=8*D,g=n/1e3,p=y/g;this.fast_.sample(g,p),this.slow_.sample(g,p)},G.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},P}();V.default=j},"./src/utils/ewma.ts":function(ee,V,N){"use strict";N.r(V);var $=function(){function j(G,W,n){W===void 0&&(W=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=G,this.alpha_=G?Math.exp(Math.log(.5)/G):0,this.estimate_=W,this.totalWeight_=n}var P=j.prototype;return P.sample=function(W,n){var D=Math.pow(this.alpha_,W);this.estimate_=n*(1-D)+D*this.estimate_,this.totalWeight_+=W},P.getTotalWeight=function(){return this.totalWeight_},P.getEstimate=function(){if(this.alpha_){var W=1-Math.pow(this.alpha_,this.totalWeight_);if(W)return this.estimate_/W}return this.estimate_},j}();V.default=$},"./src/utils/fetch-loader.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"fetchSupported",function(){return a});var $=N("./src/polyfills/number.ts"),j=N("./src/loader/load-stats.ts"),P=N("./src/demux/chunk-cache.ts");function G(o,O){o.prototype=Object.create(O.prototype),o.prototype.constructor=o,g(o,O)}function W(o){var O=typeof Map=="function"?new Map:void 0;return W=function(C){if(C===null||!y(C))return C;if(typeof C!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O!="undefined"){if(O.has(C))return O.get(C);O.set(C,L)}function L(){return n(C,arguments,p(this).constructor)}return L.prototype=Object.create(C.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),g(L,C)},W(o)}function n(o,O,w){return D()?n=Reflect.construct:n=function(L,A,_){var T=[null];T.push.apply(T,A);var v=Function.bind.apply(L,T),c=new v;return _&&g(c,_.prototype),c},n.apply(null,arguments)}function D(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(o){return!1}}function y(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function g(o,O){return g=Object.setPrototypeOf||function(C,L){return C.__proto__=L,C},g(o,O)}function p(o){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},p(o)}function l(){return l=Object.assign||function(o){for(var O=1;O<arguments.length;O++){var w=arguments[O];for(var C in w)Object.prototype.hasOwnProperty.call(w,C)&&(o[C]=w[C])}return o},l.apply(this,arguments)}function a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(o){}return!1}var f=function(){function o(w){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=w.fetchSetup||d,this.controller=new self.AbortController,this.stats=new j.LoadStats}var O=o.prototype;return O.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},O.abortInternal=function(){var C=this.response;(!C||!C.ok)&&(this.stats.aborted=!0,this.controller.abort())},O.abort=function(){var C;this.abortInternal(),(C=this.callbacks)!==null&&C!==void 0&&C.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},O.load=function(C,L,A){var _=this,T=this.stats;if(T.loading.start)throw new Error("Loader can only be used once.");T.loading.start=self.performance.now();var v=u(C,this.controller.signal),c=A.onProgress,E=C.responseType==="arraybuffer",h=E?"byteLength":"length";this.context=C,this.config=L,this.callbacks=A,this.request=this.fetchSetup(C,v),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){_.abortInternal(),A.onTimeout(T,C,_.response)},L.timeout),self.fetch(this.request).then(function(x){if(_.response=_.loader=x,!x.ok){var U=x.status,F=x.statusText;throw new i(F||"fetch, bad network response",U,x)}return T.loading.first=Math.max(self.performance.now(),T.loading.start),T.total=parseInt(x.headers.get("Content-Length")||"0"),c&&Object($.isFiniteNumber)(L.highWaterMark)?_.loadProgressively(x,T,C,L.highWaterMark,c):E?x.arrayBuffer():x.text()}).then(function(x){var U=_.response;self.clearTimeout(_.requestTimeout),T.loading.end=Math.max(self.performance.now(),T.loading.first),T.loaded=T.total=x[h];var F={url:U.url,data:x};c&&!Object($.isFiniteNumber)(L.highWaterMark)&&c(T,C,x,U),A.onSuccess(F,T,C,U)}).catch(function(x){if(self.clearTimeout(_.requestTimeout),T.aborted)return;var U=x.code||0;A.onError({code:U,text:x.message},C,x.details)})},O.getCacheAge=function(){var C=null;if(this.response){var L=this.response.headers.get("age");C=L?parseFloat(L):null}return C},O.loadProgressively=function(C,L,A,_,T){_===void 0&&(_=0);var v=new P.default,c=C.body.getReader(),E=function h(){return c.read().then(function(x){if(x.done)return v.dataLength&&T(L,A,v.flush(),C),Promise.resolve(new ArrayBuffer(0));var U=x.value,F=U.length;return L.loaded+=F,F<_||v.dataLength?(v.push(U),v.dataLength>=_&&T(L,A,v.flush(),C)):T(L,A,U,C),h()}).catch(function(){return Promise.reject()})};return E()},o}();function u(o,O){var w={method:"GET",mode:"cors",credentials:"same-origin",signal:O,headers:new self.Headers(l({},o.headers))};return o.rangeEnd&&w.headers.set("Range","bytes="+o.rangeStart+"-"+String(o.rangeEnd-1)),w}function d(o,O){return new self.Request(o.url,O)}var i=function(o){G(O,o);function O(w,C,L){var A;return A=o.call(this,w)||this,A.code=void 0,A.details=void 0,A.code=C,A.details=L,A}return O}(W(Error));V.default=f},"./src/utils/imsc1-ttml-parser.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"IMSC1_CODEC",function(){return y}),N.d(V,"parseIMSC1",function(){return a});var $=N("./src/utils/mp4-tools.ts"),j=N("./src/utils/vttparser.ts"),P=N("./src/utils/vttcue.ts"),G=N("./src/demux/id3.ts"),W=N("./src/utils/timescale-conversion.ts"),n=N("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(_){for(var T=1;T<arguments.length;T++){var v=arguments[T];for(var c in v)Object.prototype.hasOwnProperty.call(v,c)&&(_[c]=v[c])}return _},D.apply(this,arguments)}var y="stpp.ttml.im1t",g=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,l={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(_,T,v,c,E){var h=Object($.findBox)(new Uint8Array(_),["mdat"]);if(h.length===0){E(new Error("Could not parse IMSC1 mdat"));return}var x=h[0],U=Object(G.utf8ArrayToStr)(new Uint8Array(_,x.start,x.end-x.start)),F=Object(W.toTimescaleFromScale)(T,1,v);try{c(f(U,F))}catch(S){E(S)}}function f(_,T){var v=new DOMParser,c=v.parseFromString(_,"text/xml"),E=c.getElementsByTagName("tt")[0];if(!E)throw new Error("Invalid ttml");var h={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},x=Object.keys(h).reduce(function(I,b){return I[b]=E.getAttribute("ttp:"+b)||h[b],I},{}),U=E.getAttribute("xml:space")!=="preserve",F=d(u(E,"styling","style")),S=d(u(E,"layout","region")),M=u(E,"body","[begin]");return[].map.call(M,function(I){var b=i(I,U);if(!b||!I.hasAttribute("begin"))return null;var K=C(I.getAttribute("begin"),x),Q=C(I.getAttribute("dur"),x),ne=C(I.getAttribute("end"),x);if(K===null)throw w(I);if(ne===null){if(Q===null)throw w(I);ne=K+Q}var fe=new P.default(K-T,ne-T,b);fe.id=Object(n.generateCueId)(fe.startTime,fe.endTime,fe.text);var we=S[I.getAttribute("region")],Se=F[I.getAttribute("style")];fe.position=10,fe.size=80;var he=o(we,Se),se=he.textAlign;if(se){var me=l[se];me&&(fe.lineAlign=me),fe.align=se}return D(fe,he),fe}).filter(function(I){return I!==null})}function u(_,T,v){var c=_.getElementsByTagName(T)[0];return c?[].slice.call(c.querySelectorAll(v)):[]}function d(_){return _.reduce(function(T,v){var c=v.getAttribute("xml:id");return c&&(T[c]=v),T},{})}function i(_,T){return[].slice.call(_.childNodes).reduce(function(v,c,E){var h;return c.nodeName==="br"&&E?v+`
`:(h=c.childNodes)!==null&&h!==void 0&&h.length?i(c,T):T?v+c.textContent.trim().replace(/\s+/g," "):v+c.textContent},"")}function o(_,T){var v="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(E,h){var x=O(T,v,h)||O(_,v,h);return x&&(E[h]=x),E},{})}function O(_,T,v){return _.hasAttributeNS(T,v)?_.getAttributeNS(T,v):null}function w(_){return new Error("Could not parse ttml timestamp "+_)}function C(_,T){if(!_)return null;var v=Object(j.parseTimeStamp)(_);return v===null&&(g.test(_)?v=L(_,T):p.test(_)&&(v=A(_,T))),v}function L(_,T){var v=g.exec(_),c=(v[4]|0)+(v[5]|0)/T.subFrameRate;return(v[1]|0)*3600+(v[2]|0)*60+(v[3]|0)+c/T.frameRate}function A(_,T){var v=p.exec(_),c=Number(v[1]),E=v[2];switch(E){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/T.frameRate;case"t":return c/T.tickRate}return c}},"./src/utils/logger.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"enableLogs",function(){return n}),N.d(V,"logger",function(){return D});var $=function(){},j={trace:$,debug:$,log:$,warn:$,info:$,error:$},P=j;function G(y){var g=self.console[y];return g?g.bind(self.console,"["+y+"] >"):$}function W(y){for(var g=arguments.length,p=new Array(g>1?g-1:0),l=1;l<g;l++)p[l-1]=arguments[l];p.forEach(function(a){P[a]=y[a]?y[a].bind(y):G(a)})}function n(y){if(self.console&&y===!0||typeof y=="object"){W(y,"debug","log","info","warn","error");try{P.log()}catch(g){P=j}}else P=j}var D=P},"./src/utils/mediakeys-helper.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"KeySystems",function(){return $}),N.d(V,"requestMediaKeySystemAccess",function(){return j});var $;(function(P){P.WIDEVINE="com.widevine.alpha",P.PLAYREADY="com.microsoft.playready"})($||($={}));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(ee,V,N){"use strict";N.r(V),N.d(V,"getMediaSource",function(){return $});function $(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"bin2str",function(){return W}),N.d(V,"readUint16",function(){return n}),N.d(V,"readUint32",function(){return D}),N.d(V,"writeUint32",function(){return y}),N.d(V,"findBox",function(){return g}),N.d(V,"parseSegmentIndex",function(){return p}),N.d(V,"parseInitSegment",function(){return l}),N.d(V,"getStartDTS",function(){return a}),N.d(V,"getDuration",function(){return f}),N.d(V,"computeRawDurationFromSamples",function(){return u}),N.d(V,"offsetStartDTS",function(){return d}),N.d(V,"segmentValidRange",function(){return i}),N.d(V,"appendUint8Array",function(){return o});var $=N("./src/utils/typed-array.ts"),j=N("./src/loader/fragment.ts"),P=Math.pow(2,32)-1,G=[].push;function W(O){return String.fromCharCode.apply(null,O)}function n(O,w){"data"in O&&(w+=O.start,O=O.data);var C=O[w]<<8|O[w+1];return C<0?65536+C:C}function D(O,w){"data"in O&&(w+=O.start,O=O.data);var C=O[w]<<24|O[w+1]<<16|O[w+2]<<8|O[w+3];return C<0?4294967296+C:C}function y(O,w,C){"data"in O&&(w+=O.start,O=O.data),O[w]=C>>24,O[w+1]=C>>16&255,O[w+2]=C>>8&255,O[w+3]=C&255}function g(O,w){var C=[];if(!w.length)return C;var L,A,_;"data"in O?(L=O.data,A=O.start,_=O.end):(L=O,A=0,_=L.byteLength);for(var T=A;T<_;){var v=D(L,T),c=W(L.subarray(T+4,T+8)),E=v>1?T+v:_;if(c===w[0])if(w.length===1)C.push({data:L,start:T+8,end:E});else{var h=g({data:L,start:T+8,end:E},w.slice(1));h.length&&G.apply(C,h)}T=E}return C}function p(O){var w=g(O,["moov"]),C=w[0],L=C?C.end:null,A=g(O,["sidx"]);if(!A||!A[0])return null;var _=[],T=A[0],v=T.data[0],c=v===0?8:16,E=D(T,c);c+=4;var h=0,x=0;v===0?c+=8:c+=16,c+=2;var U=T.end+x,F=n(T,c);c+=2;for(var S=0;S<F;S++){var M=c,I=D(T,M);M+=4;var b=I&2147483647,K=(I&2147483648)>>>31;if(K===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Q=D(T,M);M+=4,_.push({referenceSize:b,subsegmentDuration:Q,info:{duration:Q/E,start:U,end:U+b-1}}),U+=b,M+=4,c=M}return{earliestPresentationTime:h,timescale:E,version:v,referencesCount:F,references:_,moovEndOffset:L}}function l(O){for(var w=[],C=g(O,["moov","trak"]),L=0;L<C.length;L++){var A=C[L],_=g(A,["tkhd"])[0];if(_){var T=_.data[_.start],v=T===0?12:20,c=D(_,v),E=g(A,["mdia","mdhd"])[0];if(E){T=E.data[E.start],v=T===0?12:20;var h=D(E,v),x=g(A,["mdia","hdlr"])[0];if(x){var U=W(x.data.subarray(x.start+8,x.start+12)),F={soun:j.ElementaryStreamTypes.AUDIO,vide:j.ElementaryStreamTypes.VIDEO}[U];if(F){var S=g(A,["mdia","minf","stbl","stsd"])[0],M=void 0;S&&(M=W(S.data.subarray(S.start+12,S.start+16))),w[c]={timescale:h,type:F},w[F]={timescale:h,id:c,codec:M}}}}}}var I=g(O,["moov","mvex","trex"]);return I.forEach(function(b){var K=D(b,4),Q=w[K];Q&&(Q.default={duration:D(b,12),flags:D(b,20)})}),w}function a(O,w){return g(w,["moof","traf"]).reduce(function(C,L){var A=g(L,["tfdt"])[0],_=A.data[A.start],T=g(L,["tfhd"]).reduce(function(v,c){var E=D(c,4),h=O[E];if(h){var x=D(A,4);_===1&&(x*=Math.pow(2,32),x+=D(A,8));var U=h.timescale||9e4,F=x/U;if(isFinite(F)&&(v===null||F<v))return F}return v},null);return T!==null&&isFinite(T)&&(C===null||T<C)?T:C},null)||0}function f(O,w){for(var C=0,L=0,A=0,_=g(O,["moof","traf"]),T=0;T<_.length;T++){var v=_[T],c=g(v,["tfhd"])[0],E=D(c,4),h=w[E];if(!h)continue;var x=h.default,U=D(c,0)|(x==null?void 0:x.flags),F=x==null?void 0:x.duration;U&8&&(U&2?F=D(c,12):F=D(c,8));for(var S=h.timescale||9e4,M=g(v,["trun"]),I=0;I<M.length;I++){if(F){var b=D(M[I],4);C=F*b}else C=u(M[I]);h.type===j.ElementaryStreamTypes.VIDEO?L+=C/S:h.type===j.ElementaryStreamTypes.AUDIO&&(A+=C/S)}}if(L===0&&A===0){var K=p(O);if(K!=null&&K.references)return K.references.reduce(function(Q,ne){return Q+ne.info.duration||0},0)}return L||A}function u(O){var w=D(O,0),C=8;w&1&&(C+=4),w&4&&(C+=4);for(var L=0,A=D(O,4),_=0;_<A;_++){if(w&256){var T=D(O,C);L+=T,C+=4}w&512&&(C+=4),w&1024&&(C+=4),w&2048&&(C+=4)}return L}function d(O,w,C){g(w,["moof","traf"]).forEach(function(L){g(L,["tfhd"]).forEach(function(A){var _=D(A,4),T=O[_];if(!T)return;var v=T.timescale||9e4;g(L,["tfdt"]).forEach(function(c){var E=c.data[c.start],h=D(c,4);if(E===0)y(c,4,h-C*v);else{h*=Math.pow(2,32),h+=D(c,8),h-=C*v,h=Math.max(h,0);var x=Math.floor(h/(P+1)),U=Math.floor(h%(P+1));y(c,4,x),y(c,8,U)}})})})}function i(O){var w={valid:null,remainder:null},C=g(O,["moof"]);if(C){if(C.length<2)return w.remainder=O,w}else return w;var L=C[C.length-1];return w.valid=Object($.sliceUint8)(O,0,L.start-8),w.remainder=Object($.sliceUint8)(O,L.start-8),w}function o(O,w){var C=new Uint8Array(O.length+w.length);return C.set(O),C.set(w,O.length),C}},"./src/utils/output-filter.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"default",function(){return $});var $=function(){function j(G,W){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=W}var P=j.prototype;return P.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},P.newCue=function(W,n,D){(this.startTime===null||this.startTime>W)&&(this.startTime=W),this.endTime=n,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},P.reset=function(){this.cueRanges=[]},j}()},"./src/utils/texttrack-utils.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"sendAddTrackEvent",function(){return j}),N.d(V,"addCueToTrack",function(){return P}),N.d(V,"clearCurrentCues",function(){return G}),N.d(V,"removeCuesInRange",function(){return W}),N.d(V,"getCuesInRange",function(){return D});var $=N("./src/utils/logger.ts");function j(y,g){var p;try{p=new Event("addtrack")}catch(l){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=y,g.dispatchEvent(p)}function P(y,g){var p=y.mode;if(p==="disabled"&&(y.mode="hidden"),y.cues&&!y.cues.getCueById(g.id))try{if(y.addCue(g),!y.cues.getCueById(g.id))throw new Error("addCue is failed for: "+g)}catch(a){$.logger.debug("[texttrack-utils]: "+a);var l=new self.TextTrackCue(g.startTime,g.endTime,g.text);l.id=g.id,y.addCue(l)}p==="disabled"&&(y.mode=p)}function G(y){var g=y.mode;if(g==="disabled"&&(y.mode="hidden"),y.cues)for(var p=y.cues.length;p--;)y.removeCue(y.cues[p]);g==="disabled"&&(y.mode=g)}function W(y,g,p){var l=y.mode;if(l==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var a=D(y.cues,g,p),f=0;f<a.length;f++)y.removeCue(a[f]);l==="disabled"&&(y.mode=l)}function n(y,g){if(g<y[0].startTime)return 0;var p=y.length-1;if(g>y[p].endTime)return-1;for(var l=0,a=p;l<=a;){var f=Math.floor((a+l)/2);if(g<y[f].startTime)a=f-1;else if(g>y[f].startTime&&l<p)l=f+1;else return f}return y[l].startTime-g<g-y[a].startTime?l:a}function D(y,g,p){var l=[],a=n(y,g);if(a>-1)for(var f=a,u=y.length;f<u;f++){var d=y[f];if(d.startTime>=g&&d.endTime<=p)l.push(d);else if(d.startTime>p)return l}return l}},"./src/utils/time-ranges.ts":function(ee,V,N){"use strict";N.r(V);var $={toString:function(P){for(var G="",W=P.length,n=0;n<W;n++)G+="["+P.start(n).toFixed(3)+","+P.end(n).toFixed(3)+"]";return G}};V.default=$},"./src/utils/timescale-conversion.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"toTimescaleFromBase",function(){return j}),N.d(V,"toTimescaleFromScale",function(){return P}),N.d(V,"toMsFromMpegTsClock",function(){return G}),N.d(V,"toMpegTsClockFromTimescale",function(){return W});var $=9e4;function j(n,D,y,g){y===void 0&&(y=1),g===void 0&&(g=!1);var p=n*D*y;return g?Math.round(p):p}function P(n,D,y,g){return y===void 0&&(y=1),g===void 0&&(g=!1),j(n,D,1/y,g)}function G(n,D){return D===void 0&&(D=!1),j(n,1e3,1/$,D)}function W(n,D){return D===void 0&&(D=1),j(n,$,1/D)}},"./src/utils/typed-array.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"sliceUint8",function(){return $});function $(j,P,G){return Uint8Array.prototype.slice?j.slice(P,G):new Uint8Array(Array.prototype.slice.call(j,P,G))}},"./src/utils/vttcue.ts":function(ee,V,N){"use strict";N.r(V),V.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var $=["","lr","rl"],j=["start","middle","end","left","right"];function P(y,g){if(typeof g!="string")return!1;if(!Array.isArray(y))return!1;var p=g.toLowerCase();return~y.indexOf(p)?p:!1}function G(y){return P($,y)}function W(y){return P(j,y)}function n(y){for(var g=arguments.length,p=new Array(g>1?g-1:0),l=1;l<g;l++)p[l-1]=arguments[l];for(var a=1;a<arguments.length;a++){var f=arguments[a];for(var u in f)y[u]=f[u]}return y}function D(y,g,p){var l=this,a={enumerable:!0};l.hasBeenReset=!1;var f="",u=!1,d=y,i=g,o=p,O=null,w="",C=!0,L="auto",A="start",_=50,T="middle",v=50,c="middle";Object.defineProperty(l,"id",n({},a,{get:function(){return f},set:function(h){f=""+h}})),Object.defineProperty(l,"pauseOnExit",n({},a,{get:function(){return u},set:function(h){u=!!h}})),Object.defineProperty(l,"startTime",n({},a,{get:function(){return d},set:function(h){if(typeof h!="number")throw new TypeError("Start time must be set to a number.");d=h,this.hasBeenReset=!0}})),Object.defineProperty(l,"endTime",n({},a,{get:function(){return i},set:function(h){if(typeof h!="number")throw new TypeError("End time must be set to a number.");i=h,this.hasBeenReset=!0}})),Object.defineProperty(l,"text",n({},a,{get:function(){return o},set:function(h){o=""+h,this.hasBeenReset=!0}})),Object.defineProperty(l,"region",n({},a,{get:function(){return O},set:function(h){O=h,this.hasBeenReset=!0}})),Object.defineProperty(l,"vertical",n({},a,{get:function(){return w},set:function(h){var x=G(h);if(x===!1)throw new SyntaxError("An invalid or illegal string was specified.");w=x,this.hasBeenReset=!0}})),Object.defineProperty(l,"snapToLines",n({},a,{get:function(){return C},set:function(h){C=!!h,this.hasBeenReset=!0}})),Object.defineProperty(l,"line",n({},a,{get:function(){return L},set:function(h){if(typeof h!="number"&&h!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");L=h,this.hasBeenReset=!0}})),Object.defineProperty(l,"lineAlign",n({},a,{get:function(){return A},set:function(h){var x=W(h);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");A=x,this.hasBeenReset=!0}})),Object.defineProperty(l,"position",n({},a,{get:function(){return _},set:function(h){if(h<0||h>100)throw new Error("Position must be between 0 and 100.");_=h,this.hasBeenReset=!0}})),Object.defineProperty(l,"positionAlign",n({},a,{get:function(){return T},set:function(h){var x=W(h);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");T=x,this.hasBeenReset=!0}})),Object.defineProperty(l,"size",n({},a,{get:function(){return v},set:function(h){if(h<0||h>100)throw new Error("Size must be between 0 and 100.");v=h,this.hasBeenReset=!0}})),Object.defineProperty(l,"align",n({},a,{get:function(){return c},set:function(h){var x=W(h);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");c=x,this.hasBeenReset=!0}})),l.displayState=void 0}return D.prototype.getCueAsHTML=function(){var y=self.WebVTT;return y.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"parseTimeStamp",function(){return P}),N.d(V,"fixLineBreaks",function(){return g}),N.d(V,"VTTParser",function(){return p});var $=N("./src/utils/vttcue.ts"),j=function(){function l(){}var a=l.prototype;return a.decode=function(u,d){if(!u)return"";if(typeof u!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(u))},l}();function P(l){function a(u,d,i,o){return(u|0)*3600+(d|0)*60+(i|0)+parseFloat(o||0)}var f=l.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?a(f[2],f[3],0,f[4]):a(f[1],f[2],f[3],f[4]):null}var G=function(){function l(){this.values=Object.create(null)}var a=l.prototype;return a.set=function(u,d){!this.get(u)&&d!==""&&(this.values[u]=d)},a.get=function(u,d,i){return i?this.has(u)?this.values[u]:d[i]:this.has(u)?this.values[u]:d},a.has=function(u){return u in this.values},a.alt=function(u,d,i){for(var o=0;o<i.length;++o)if(d===i[o]){this.set(u,d);break}},a.integer=function(u,d){/^-?\d+$/.test(d)&&this.set(u,parseInt(d,10))},a.percent=function(u,d){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(d)){var i=parseFloat(d);if(i>=0&&i<=100)return this.set(u,i),!0}return!1},l}();function W(l,a,f,u){var d=u?l.split(u):[l];for(var i in d){if(typeof d[i]!="string")continue;var o=d[i].split(f);if(o.length!==2)continue;var O=o[0],w=o[1];a(O,w)}}var n=new $.default(0,0,""),D=n.align==="middle"?"middle":"center";function y(l,a,f){var u=l;function d(){var O=P(l);if(O===null)throw new Error("Malformed timestamp: "+u);return l=l.replace(/^[^\sa-zA-Z-]+/,""),O}function i(O,w){var C=new G;W(O,function(_,T){var v;switch(_){case"region":for(var c=f.length-1;c>=0;c--)if(f[c].id===T){C.set(_,f[c].region);break}break;case"vertical":C.alt(_,T,["rl","lr"]);break;case"line":v=T.split(","),C.integer(_,v[0]),C.percent(_,v[0])&&C.set("snapToLines",!1),C.alt(_,v[0],["auto"]),v.length===2&&C.alt("lineAlign",v[1],["start",D,"end"]);break;case"position":v=T.split(","),C.percent(_,v[0]),v.length===2&&C.alt("positionAlign",v[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":C.percent(_,T);break;case"align":C.alt(_,T,["start",D,"end","left","right"]);break}},/:/,/\s/),w.region=C.get("region",null),w.vertical=C.get("vertical","");var L=C.get("line","auto");L==="auto"&&n.line===-1&&(L=-1),w.line=L,w.lineAlign=C.get("lineAlign","start"),w.snapToLines=C.get("snapToLines",!0),w.size=C.get("size",100),w.align=C.get("align",D);var A=C.get("position","auto");A==="auto"&&n.position===50&&(A=w.align==="start"||w.align==="left"?0:w.align==="end"||w.align==="right"?100:50),w.position=A}function o(){l=l.replace(/^\s+/,"")}if(o(),a.startTime=d(),o(),l.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+u);l=l.substr(3),o(),a.endTime=d(),o(),i(l,a)}function g(l){return l.replace(/<br(?: \/)?>/gi,`
`)}var p=function(){function l(){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 a=l.prototype;return a.parse=function(u){var d=this;u&&(d.buffer+=d.decoder.decode(u,{stream:!0}));function i(){var A=d.buffer,_=0;for(A=g(A);_<A.length&&A[_]!=="\r"&&A[_]!==`
`;)++_;var T=A.substr(0,_);return A[_]==="\r"&&++_,A[_]===`
`&&++_,d.buffer=A.substr(_),T}function o(A){W(A,function(_,T){},/:/)}try{var O="";if(d.state==="INITIAL"){if(!/\r\n|\n/.test(d.buffer))return this;O=i();var w=O.match(/^()?WEBVTT([ \t].*)?$/);if(!w||!w[0])throw new Error("Malformed WebVTT signature.");d.state="HEADER"}for(var C=!1;d.buffer;){if(!/\r\n|\n/.test(d.buffer))return this;C?C=!1:O=i();switch(d.state){case"HEADER":/:/.test(O)?o(O):O||(d.state="ID");continue;case"NOTE":O||(d.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(O)){d.state="NOTE";break}if(!O)continue;if(d.cue=new $.default(0,0,""),d.state="CUE",O.indexOf("-->")===-1){d.cue.id=O;continue}case"CUE":if(!d.cue){d.state="BADCUE";continue}try{y(O,d.cue,d.regionList)}catch(A){d.cue=null,d.state="BADCUE";continue}d.state="CUETEXT";continue;case"CUETEXT":{var L=O.indexOf("-->")!==-1;if(!O||L&&(C=!0)){d.oncue&&d.cue&&d.oncue(d.cue),d.cue=null,d.state="ID";continue}if(d.cue===null)continue;d.cue.text&&(d.cue.text+=`
`),d.cue.text+=O}continue;case"BADCUE":O||(d.state="ID")}}}catch(A){d.state==="CUETEXT"&&d.cue&&d.oncue&&d.oncue(d.cue),d.cue=null,d.state=d.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.flush=function(){var u=this;try{if((u.cue||u.state==="HEADER")&&(u.buffer+=`
`,u.parse()),u.state==="INITIAL"||u.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(d){u.onparsingerror&&u.onparsingerror(d)}return u.onflush&&u.onflush(),this},l}()},"./src/utils/webvtt-parser.ts":function(ee,V,N){"use strict";N.r(V),N.d(V,"generateCueId",function(){return p}),N.d(V,"parseWebVTT",function(){return a});var $=N("./src/polyfills/number.ts"),j=N("./src/utils/vttparser.ts"),P=N("./src/demux/id3.ts"),G=N("./src/utils/timescale-conversion.ts"),W=N("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,D=function(u,d,i){return i===void 0&&(i=0),u.substr(i,d.length)===d},y=function(u){var d=parseInt(u.substr(-3)),i=parseInt(u.substr(-6,2)),o=parseInt(u.substr(-9,2)),O=u.length>9?parseInt(u.substr(0,u.indexOf(":"))):0;if(!Object($.isFiniteNumber)(d)||!Object($.isFiniteNumber)(i)||!Object($.isFiniteNumber)(o)||!Object($.isFiniteNumber)(O))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+u);return d+=1e3*i,d+=60*1e3*o,d+=60*60*1e3*O,d},g=function(u){for(var d=5381,i=u.length;i;)d=d*33^u.charCodeAt(--i);return(d>>>0).toString()};function p(f,u,d){return g(f.toString())+g(u.toString())+g(d)}var l=function(u,d,i){var o=u[d],O=u[o.prevCC];if(!O||!O.new&&o.new){u.ccOffset=u.presentationOffset=o.start,o.new=!1;return}for(;(w=O)!==null&&w!==void 0&&w.new;){var w;u.ccOffset+=o.start-O.start,o.new=!1,o=O,O=u[o.prevCC]}u.presentationOffset=i};function a(f,u,d,i,o,O,w,C){var L=new j.VTTParser,A=Object(P.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(n,`
`).split(`
`),_=[],T=Object(G.toMpegTsClockFromTimescale)(u,d),v="00:00.000",c=0,E=0,h,x=!0,U=!1;L.oncue=function(F){var S=i[o],M=i.ccOffset,I=(c-T)/9e4;if(S!=null&&S.new&&(E!==void 0?M=i.ccOffset=S.start:l(i,o,I)),I&&(M=I-i.presentationOffset),U){var b=F.endTime-F.startTime,K=Object(W.normalizePts)((F.startTime+M-E)*9e4,O*9e4)/9e4;F.startTime=K,F.endTime=K+b}var Q=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(Q)),F.id||(F.id=p(F.startTime,F.endTime,Q)),F.endTime>0&&_.push(F)},L.onparsingerror=function(F){h=F},L.onflush=function(){if(h){C(h);return}w(_)},A.forEach(function(F){if(x)if(D(F,"X-TIMESTAMP-MAP=")){x=!1,U=!0,F.substr(16).split(",").forEach(function(S){D(S,"LOCAL:")?v=S.substr(6):D(S,"MPEGTS:")&&(c=parseInt(S.substr(7)))});try{E=y(v)/1e3}catch(S){U=!1,h=S}return}else F===""&&(x=!1);L.parse(F+`
`)}),L.flush()}},"./src/utils/xhr-loader.ts":function(ee,V,N){"use strict";N.r(V);var $=N("./src/utils/logger.ts"),j=N("./src/loader/load-stats.ts"),P=/^age:\s*[\d.]+\s*$/m,G=function(){function W(D){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=D?D.xhrSetup:null,this.stats=new j.LoadStats,this.retryDelay=0}var n=W.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var y=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),y&&(y.onreadystatechange=null,y.onprogress=null,y.readyState!==4&&(this.stats.aborted=!0,y.abort()))},n.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(y,g,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=y,this.config=g,this.callbacks=p,this.retryDelay=g.retryDelay,this.loadInternal()},n.loadInternal=function(){var y=this.config,g=this.context;if(!y)return;var p=this.loader=new self.XMLHttpRequest,l=this.stats;l.loading.first=0,l.loaded=0;var a=this.xhrSetup;try{if(a)try{a(p,g.url)}catch(d){p.open("GET",g.url,!0),a(p,g.url)}p.readyState||p.open("GET",g.url,!0);var f=this.context.headers;if(f)for(var u in f)p.setRequestHeader(u,f[u])}catch(d){this.callbacks.onError({code:p.status,text:d.message},g,p);return}g.rangeEnd&&p.setRequestHeader("Range","bytes="+g.rangeStart+"-"+(g.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=g.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),p.send()},n.readystatechange=function(){var y=this.context,g=this.loader,p=this.stats;if(!y||!g)return;var l=g.readyState,a=this.config;if(p.aborted)return;if(l>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),l===4){g.onreadystatechange=null,g.onprogress=null;var f=g.status;if(f>=200&&f<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var u,d;if(y.responseType==="arraybuffer"?(u=g.response,d=u.byteLength):(u=g.responseText,d=u.length),p.loaded=p.total=d,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(p,y,u,g),!this.callbacks)return;var o={url:g.responseURL,data:u};this.callbacks.onSuccess(o,p,y,g)}else p.retry>=a.maxRetry||f>=400&&f<499?($.logger.error(f+" while loading "+y.url),this.callbacks.onError({code:f,text:g.statusText},y,g)):($.logger.warn(f+" while loading "+y.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,a.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},n.loadtimeout=function(){$.logger.warn("timeout while loading "+this.context.url);var y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(y){var g=this.stats;g.loaded=y.loaded,y.lengthComputable&&(g.total=y.total)},n.getCacheAge=function(){var y=null;if(this.loader&&P.test(this.loader.getAllResponseHeaders())){var g=this.loader.getResponseHeader("age");y=g?parseFloat(g):null}return y},W}();V.default=G}}).default})},vHTk:function(at,Ee,H){at.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return tt});var ee=H("rePB"),V=H("VTBJ"),N=H("KQm4"),$=H("U8pU"),j=H("ODXe"),P=H("q1tI"),G=H("TSYQ"),W=H.n(G),n=H("Gytx"),D=H.n(n),y=H("Kwbf"),g=H("t23M"),p=H("qx4F"),l=H("6eGT"),a=H("IBYe"),f=H("Ff2n"),u=H("c+Xe"),d=H("fyJ8"),i=H("biw7");function o(Ne,Pe,ze,Xe,je){var Fe=ze[Ne]||{},_e=ze[Pe]||{},ye,ve;Fe.fixed==="left"?ye=Xe.left[Ne]:_e.fixed==="right"&&(ve=Xe.right[Pe]);var ue=!1,ce=!1,be=!1,xe=!1,Oe=ze[Pe+1],Ue=ze[Ne-1];if(je==="rtl"){if(ye!==void 0){var Ke=Ue&&Ue.fixed==="left";xe=!Ke}else if(ve!==void 0){var et=Oe&&Oe.fixed==="right";be=!et}}else if(ye!==void 0){var it=Oe&&Oe.fixed==="left";ue=!it}else if(ve!==void 0){var nt=Ue&&Ue.fixed==="right";ce=!nt}return{fixLeft:ye,fixRight:ve,lastFixLeft:ue,firstFixRight:ce,lastFixRight:be,firstFixLeft:xe,isSticky:Xe.isSticky}}var O=H("sR1s");function w(Ne){var Pe=Ne.cells,ze=Ne.stickyOffsets,Xe=Ne.flattenColumns,je=Ne.rowComponent,Fe=Ne.cellComponent,_e=Ne.onHeaderRow,ye=Ne.index,ve=P.useContext(i.a),ue=ve.prefixCls,ce=ve.direction,be;_e&&(be=_e(Pe.map(function(Oe){return Oe.column}),ye));var xe=Object(O.a)(Pe.map(function(Oe){return Oe.column}));return P.createElement(je,Object.assign({},be),Pe.map(function(Oe,Ue){var Ke=Oe.column,et=o(Oe.colStart,Oe.colEnd,Xe,ze,ce),it;return Ke&&Ke.onHeaderCell&&(it=Oe.column.onHeaderCell(Ke)),P.createElement(d.a,Object.assign({},Oe,{ellipsis:Ke.ellipsis,align:Ke.align,component:Fe,prefixCls:ue,key:xe[Ue]},et,{additionalProps:it,rowType:"header"}))}))}w.displayName="HeaderRow";var C=w;function L(Ne){var Pe=[];function ze(_e,ye){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Pe[ve]=Pe[ve]||[];var ue=ye,ce=_e.filter(Boolean).map(function(be){var xe={key:be.key,className:be.className||"",children:be.title,column:be,colStart:ue},Oe=1,Ue=be.children;return Ue&&Ue.length>0&&(Oe=ze(Ue,ue,ve+1).reduce(function(Ke,et){return Ke+et},0),xe.hasSubColumns=!0),"colSpan"in be&&(Oe=be.colSpan),"rowSpan"in be&&(xe.rowSpan=be.rowSpan),xe.colSpan=Oe,xe.colEnd=xe.colStart+Oe-1,Pe[ve].push(xe),ue+=Oe,Oe});return ce}ze(Ne,0);for(var Xe=Pe.length,je=function(ye){Pe[ye].forEach(function(ve){!("rowSpan"in ve)&&!ve.hasSubColumns&&(ve.rowSpan=Xe-ye)})},Fe=0;Fe<Xe;Fe+=1)je(Fe);return Pe}function A(Ne){var Pe=Ne.stickyOffsets,ze=Ne.columns,Xe=Ne.flattenColumns,je=Ne.onHeaderRow,Fe=P.useContext(i.a),_e=Fe.prefixCls,ye=Fe.getComponent,ve=P.useMemo(function(){return L(ze)},[ze]),ue=ye(["header","wrapper"],"thead"),ce=ye(["header","row"],"tr"),be=ye(["header","cell"],"th");return P.createElement(ue,{className:"".concat(_e,"-thead")},ve.map(function(xe,Oe){var Ue=P.createElement(C,{key:Oe,flattenColumns:Xe,cells:xe,stickyOffsets:Pe,rowComponent:ce,cellComponent:be,onHeaderRow:je,index:Oe});return Ue}))}var _=A,T=H("hW8S");function v(Ne){for(var Pe=Ne.colWidths,ze=Ne.columns,Xe=Ne.columCount,je=[],Fe=Xe||ze.length,_e=!1,ye=Fe-1;ye>=0;ye-=1){var ve=Pe[ye],ue=ze&&ze[ye],ce=ue&&ue[T.a];(ve||ce||_e)&&(je.unshift(P.createElement("col",Object.assign({key:ye,style:{width:ve,minWidth:ve}},ce))),_e=!0)}return P.createElement("colgroup",null,je)}var c=v;function E(Ne,Pe){return Object(P.useMemo)(function(){for(var ze=[],Xe=0;Xe<Pe;Xe+=1){var je=Ne[Xe];if(je!==void 0)ze[Xe]=je;else return null}return ze},[Ne.join("_"),Pe])}var h=P.forwardRef(function(Ne,Pe){var ze=Ne.noData,Xe=Ne.columns,je=Ne.flattenColumns,Fe=Ne.colWidths,_e=Ne.columCount,ye=Ne.stickyOffsets,ve=Ne.direction,ue=Ne.fixHeader,ce=Ne.offsetHeader,be=Ne.stickyClassName,xe=Ne.onScroll,Oe=Object(f.a)(Ne,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Ue=P.useContext(i.a),Ke=Ue.prefixCls,et=Ue.scrollbarSize,it=Ue.isSticky,nt=it&&!ue?0:et,yt=P.useRef(null),bt=P.useCallback(function(It){Object(u.b)(Pe,It),Object(u.b)(yt,It)},[]);P.useEffect(function(){var It;function gt(Ye){var _t=Ye.currentTarget,$e=Ye.deltaX;$e&&(xe({currentTarget:_t,scrollLeft:_t.scrollLeft+$e}),Ye.preventDefault())}return(It=yt.current)===null||It===void 0||It.addEventListener("wheel",gt),function(){var Ye;(Ye=yt.current)===null||Ye===void 0||Ye.removeEventListener("wheel",gt)}},[]);var dt=je[je.length-1],wt={fixed:dt?dt.fixed:null,onHeaderCell:function(){return{className:"".concat(Ke,"-cell-scrollbar")}}},Tt=Object(P.useMemo)(function(){return nt?[].concat(Object(N.a)(Xe),[wt]):Xe},[nt,Xe]),Ct=Object(P.useMemo)(function(){return nt?[].concat(Object(N.a)(je),[wt]):je},[nt,je]),Nt=Object(P.useMemo)(function(){var It=ye.right,gt=ye.left;return Object(V.a)(Object(V.a)({},ye),{},{left:ve==="rtl"?[].concat(Object(N.a)(gt.map(function(Ye){return Ye+nt})),[0]):gt,right:ve==="rtl"?It:[].concat(Object(N.a)(It.map(function(Ye){return Ye+nt})),[0]),isSticky:it})},[nt,ye,it]),At=E(Fe,_e);return P.createElement("div",{style:Object(V.a)({overflow:"hidden"},it?{top:ce}:{}),ref:bt,className:W()("".concat(Ke,"-header"),Object(ee.a)({},be,!!be))},P.createElement("table",{style:{tableLayout:"fixed",visibility:ze||At?null:"hidden"}},P.createElement(c,{colWidths:At?[].concat(Object(N.a)(At),[nt]):[],columCount:_e+1,columns:Ct}),P.createElement(_,Object.assign({},Oe,{stickyOffsets:Nt,columns:Tt,flattenColumns:Ct}))))});h.displayName="FixedHeader";var x=h,U=P.createContext(null),F=U;function S(Ne){var Pe=Ne.prefixCls,ze=Ne.children,Xe=Ne.component,je=Ne.cellComponent,Fe=Ne.fixHeader,_e=Ne.fixColumn,ye=Ne.horizonScroll,ve=Ne.className,ue=Ne.expanded,ce=Ne.componentWidth,be=Ne.colSpan,xe=P.useContext(i.a),Oe=xe.scrollbarSize;return P.useMemo(function(){var Ue=ze;return _e&&(Ue=P.createElement("div",{style:{width:ce-(Fe?Oe:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Pe,"-expanded-row-fixed")},Ue)),P.createElement(Xe,{className:ve,style:{display:ue?null:"none"}},P.createElement(d.a,{component:je,prefixCls:Pe,colSpan:be},Ue))},[ze,Xe,Fe,ye,ve,ue,ce,be,Oe])}var M=S;function I(Ne){var Pe=Ne.className,ze=Ne.style,Xe=Ne.record,je=Ne.index,Fe=Ne.rowKey,_e=Ne.getRowKey,ye=Ne.rowExpandable,ve=Ne.expandedKeys,ue=Ne.onRow,ce=Ne.indent,be=ce===void 0?0:ce,xe=Ne.rowComponent,Oe=Ne.cellComponent,Ue=Ne.childrenColumnName,Ke=P.useContext(i.a),et=Ke.prefixCls,it=Ke.fixedInfoList,nt=P.useContext(F),yt=nt.fixHeader,bt=nt.fixColumn,dt=nt.horizonScroll,wt=nt.componentWidth,Tt=nt.flattenColumns,Ct=nt.expandableType,Nt=nt.expandRowByClick,At=nt.onTriggerExpand,It=nt.rowClassName,gt=nt.expandedRowClassName,Ye=nt.indentSize,_t=nt.expandIcon,$e=nt.expandedRowRender,Je=nt.expandIconColumnIndex,vt=P.useState(!1),St=Object(j.a)(vt,2),Rt=St[0],mt=St[1],ct=ve&&ve.has(Ne.recordKey);P.useEffect(function(){ct&&mt(!0)},[ct]);var Vt=Ct==="row"&&(!ye||ye(Xe)),jt=Ct==="nest",qt=Ue&&Xe&&Xe[Ue],Wt=Vt||jt,rn;ue&&(rn=ue(Xe,je));var On=function(R){if(Nt&&Wt&&At(Xe,R),rn&&rn.onClick){for(var k,z=arguments.length,ie=new Array(z>1?z-1:0),J=1;J<z;J++)ie[J-1]=arguments[J];(k=rn).onClick.apply(k,[R].concat(ie))}},Ln;typeof It=="string"?Ln=It:typeof It=="function"&&(Ln=It(Xe,je,be));var Qe=Object(O.a)(Tt),ht=P.createElement(xe,Object.assign({},rn,{"data-row-key":Fe,className:W()(Pe,"".concat(et,"-row"),"".concat(et,"-row-level-").concat(be),Ln,rn&&rn.className),style:Object(V.a)(Object(V.a)({},ze),rn?rn.style:null),onClick:On}),Tt.map(function(Y,R){var k=Y.render,z=Y.dataIndex,ie=Y.className,J=Qe[R],De=it[R],qe;R===(Je||0)&&jt&&(qe=P.createElement(P.Fragment,null,P.createElement("span",{style:{paddingLeft:"".concat(Ye*be,"px")},className:"".concat(et,"-row-indent indent-level-").concat(be)}),_t({prefixCls:et,expanded:ct,expandable:qt,record:Xe,onExpand:At})));var ft;return Y.onCell&&(ft=Y.onCell(Xe,je)),P.createElement(d.a,Object.assign({className:ie,ellipsis:Y.ellipsis,align:Y.align,component:Oe,prefixCls:et,key:J,record:Xe,index:je,dataIndex:z,render:k,shouldCellUpdate:Y.shouldCellUpdate},De,{appendNode:qe,additionalProps:ft}))})),Qt;if(Vt&&(Rt||ct)){var pn=$e(Xe,je,be+1,ct),_n=gt&&gt(Xe,je,be);Qt=P.createElement(M,{expanded:ct,className:W()("".concat(et,"-expanded-row"),"".concat(et,"-expanded-row-level-").concat(be+1),_n),prefixCls:et,fixHeader:yt,fixColumn:bt,horizonScroll:dt,component:xe,componentWidth:wt,cellComponent:Oe,colSpan:Tt.length},pn)}var fn;return qt&&ct&&(fn=(Xe[Ue]||[]).map(function(Y,R){var k=_e(Y,R);return P.createElement(I,Object.assign({},Ne,{key:k,rowKey:k,record:Y,recordKey:k,index:R,indent:be+1}))})),P.createElement(P.Fragment,null,ht,Qt,fn)}I.displayName="BodyRow";var b=I,K=P.createContext(null),Q=K;function ne(Ne){var Pe=Ne.columnKey,ze=Ne.onColumnResize,Xe=P.useRef();return P.useEffect(function(){Xe.current&&ze(Pe,Xe.current.offsetWidth)},[]),P.createElement(g.a,{onResize:function(Fe){var _e=Fe.offsetWidth;ze(Pe,_e)}},P.createElement("td",{ref:Xe,style:{padding:0,border:0,height:0}},P.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function fe(Ne){var Pe=Ne.data,ze=Ne.getRowKey,Xe=Ne.measureColumnWidth,je=Ne.expandedKeys,Fe=Ne.onRow,_e=Ne.rowExpandable,ye=Ne.emptyNode,ve=Ne.childrenColumnName,ue=P.useContext(Q),ce=ue.onColumnResize,be=P.useContext(i.a),xe=be.prefixCls,Oe=be.getComponent,Ue=P.useContext(F),Ke=Ue.fixHeader,et=Ue.horizonScroll,it=Ue.flattenColumns,nt=Ue.componentWidth;return P.useMemo(function(){var yt=Oe(["body","wrapper"],"tbody"),bt=Oe(["body","row"],"tr"),dt=Oe(["body","cell"],"td"),wt;Pe.length?wt=Pe.map(function(Ct,Nt){var At=ze(Ct,Nt);return P.createElement(b,{key:At,rowKey:At,record:Ct,recordKey:At,index:Nt,rowComponent:bt,cellComponent:dt,expandedKeys:je,onRow:Fe,getRowKey:ze,rowExpandable:_e,childrenColumnName:ve})}):wt=P.createElement(M,{expanded:!0,className:"".concat(xe,"-placeholder"),prefixCls:xe,fixHeader:Ke,fixColumn:et,horizonScroll:et,component:bt,componentWidth:nt,cellComponent:dt,colSpan:it.length},ye);var Tt=Object(O.a)(it);return P.createElement(yt,{className:"".concat(xe,"-tbody")},Xe&&P.createElement("tr",{"aria-hidden":"true",className:"".concat(xe,"-measure-row"),style:{height:0}},Tt.map(function(Ct){return P.createElement(ne,{key:Ct,columnKey:Ct,onColumnResize:ce})})),wt)},[Pe,xe,Fe,Xe,je,ze,Oe,nt,ye,it])}var we=P.memo(fe);we.displayName="Body";var Se=we,he=H("wRmb"),se=H("xEkU"),me=H.n(se);function re(Ne){var Pe=Object(P.useRef)(Ne),ze=Object(P.useState)({}),Xe=Object(j.a)(ze,2),je=Xe[1],Fe=Object(P.useRef)(null),_e=Object(P.useRef)([]);function ye(ve){Fe.current===null&&(_e.current=[],Fe.current=me()(function(){_e.current.forEach(function(ue){Pe.current=ue(Pe.current)}),Fe.current=null,je({})})),_e.current.push(ve)}return Object(P.useEffect)(function(){return function(){me.a.cancel(Fe.current)}},[]),[Pe.current,ye]}function le(Ne){var Pe=Object(P.useRef)(Ne),ze=Object(P.useRef)(null);function Xe(){window.clearTimeout(ze.current)}function je(_e){Pe.current=_e,Xe(),ze.current=window.setTimeout(function(){Pe.current=null,ze.current=null},100)}function Fe(){return Pe.current}return Object(P.useEffect)(function(){return Xe},[]),[je,Fe]}function Z(Ne,Pe,ze){var Xe=Object(P.useMemo)(function(){for(var je=[],Fe=[],_e=0,ye=0,ve=0;ve<Pe;ve+=1)if(ze==="rtl"){Fe[ve]=ye,ye+=Ne[ve]||0;var ue=Pe-ve-1;je[ue]=_e,_e+=Ne[ue]||0}else{je[ve]=_e,_e+=Ne[ve]||0;var ce=Pe-ve-1;Fe[ce]=ye,ye+=Ne[ce]||0}return{left:je,right:Fe}},[Ne,Pe,ze]);return Xe}var ae=Z;function oe(Ne){var Pe=Ne.className,ze=Ne.children;return P.createElement("div",{className:Pe},ze)}var ge=oe,Re=H("n6Qo");function Te(Ne){var Pe,ze=Ne.prefixCls,Xe=Ne.record,je=Ne.onExpand,Fe=Ne.expanded,_e=Ne.expandable,ye="".concat(ze,"-row-expand-icon");if(!_e)return P.createElement("span",{className:W()(ye,"".concat(ze,"-row-spaced"))});var ve=function(ce){je(Xe,ce),ce.stopPropagation()};return P.createElement("span",{className:W()(ye,(Pe={},Object(ee.a)(Pe,"".concat(ze,"-row-expanded"),Fe),Object(ee.a)(Pe,"".concat(ze,"-row-collapsed"),!Fe),Pe)),onClick:ve})}function Me(Ne,Pe,ze){var Xe=[];function je(Fe){(Fe||[]).forEach(function(_e,ye){Xe.push(Pe(_e,ye)),je(_e[ze])})}return je(Ne),Xe}var Be=H("zT1h"),pe=H("y0+3"),Ce=function(Pe,ze){var Xe,je,Fe=Pe.scrollBodyRef,_e=Pe.onScroll,ye=Pe.offsetScroll,ve=P.useContext(i.a),ue=ve.prefixCls,ce=((Xe=Fe.current)===null||Xe===void 0?void 0:Xe.scrollWidth)||0,be=((je=Fe.current)===null||je===void 0?void 0:je.clientWidth)||0,xe=ce&&be*(be/ce),Oe=P.useRef(),Ue=re({scrollLeft:0,isHiddenScrollBar:!1}),Ke=Object(j.a)(Ue,2),et=Ke[0],it=Ke[1],nt=P.useRef({delta:0,x:0}),yt=P.useState(!1),bt=Object(j.a)(yt,2),dt=bt[0],wt=bt[1],Tt=function(){wt(!1)},Ct=function(Ye){Ye.persist(),nt.current.delta=Ye.pageX-et.scrollLeft,nt.current.x=0,wt(!0),Ye.preventDefault()},Nt=function(Ye){var _t,$e=Ye||((_t=window)===null||_t===void 0?void 0:_t.event),Je=$e.buttons;if(!dt||Je===0){dt&&wt(!1);return}var vt=nt.current.x+Ye.pageX-nt.current.x-nt.current.delta;vt<=0&&(vt=0),vt+xe>=be&&(vt=be-xe),_e({scrollLeft:vt/be*(ce+2)}),nt.current.x=Ye.pageX},At=function(){var Ye=Object(pe.b)(Fe.current).top,_t=Ye+Fe.current.offsetHeight,$e=document.documentElement.scrollTop+window.innerHeight;_t-Object(p.a)()<=$e||Ye>=$e-ye?it(function(Je){return Object(V.a)(Object(V.a)({},Je),{},{isHiddenScrollBar:!0})}):it(function(Je){return Object(V.a)(Object(V.a)({},Je),{},{isHiddenScrollBar:!1})})},It=function(Ye){it(function(_t){return Object(V.a)(Object(V.a)({},_t),{},{scrollLeft:Ye/ce*be||0})})};return P.useImperativeHandle(ze,function(){return{setScrollLeft:It}}),P.useEffect(function(){var gt=Object(Be.a)(document.body,"mouseup",Tt,!1),Ye=Object(Be.a)(document.body,"mousemove",Nt,!1);return At(),function(){gt.remove(),Ye.remove()}},[xe,dt]),P.useEffect(function(){var gt=Object(Be.a)(window,"scroll",At,!1),Ye=Object(Be.a)(window,"resize",At,!1);return function(){gt.remove(),Ye.remove()}},[]),P.useEffect(function(){et.isHiddenScrollBar||it(function(gt){var Ye,_t;return Object(V.a)(Object(V.a)({},gt),{},{scrollLeft:Fe.current.scrollLeft/((Ye=Fe.current)===null||Ye===void 0?void 0:Ye.scrollWidth)*((_t=Fe.current)===null||_t===void 0?void 0:_t.clientWidth)})})},[et.isHiddenScrollBar]),ce<=be||!xe||et.isHiddenScrollBar?null:P.createElement("div",{style:{height:Object(p.a)(),width:be,bottom:ye},className:"".concat(ue,"-sticky-scroll")},P.createElement("div",{onMouseDown:Ct,ref:Oe,className:W()("".concat(ue,"-sticky-scroll-bar"),Object(ee.a)({},"".concat(ue,"-sticky-scroll-bar-active"),dt)),style:{width:"".concat(xe,"px"),transform:"translate3d(".concat(et.scrollLeft,"px, 0, 0)")}}))},ke=P.forwardRef(Ce);function Le(Ne,Pe){return P.useMemo(function(){var ze=!!Ne;return{isSticky:ze,stickyClassName:ze?"".concat(Pe,"-sticky-header"):"",offsetHeader:Object($.a)(Ne)==="object"&&Ne.offsetHeader||0,offsetScroll:Object($.a)(Ne)==="object"&&Ne.offsetScroll||0}},[Ne,Pe])}var Ge=[],Ve={},tt="rc-table-internal-hook",rt=P.memo(function(Ne){var Pe=Ne.children;return Pe},function(Ne,Pe){return D()(Ne.props,Pe.props)?Ne.pingLeft!==Pe.pingLeft||Ne.pingRight!==Pe.pingRight:!1});function ut(Ne){var Pe,ze=Ne.prefixCls,Xe=Ne.className,je=Ne.rowClassName,Fe=Ne.style,_e=Ne.data,ye=Ne.rowKey,ve=Ne.scroll,ue=Ne.tableLayout,ce=Ne.direction,be=Ne.title,xe=Ne.footer,Oe=Ne.summary,Ue=Ne.id,Ke=Ne.showHeader,et=Ne.components,it=Ne.emptyText,nt=Ne.onRow,yt=Ne.onHeaderRow,bt=Ne.internalHooks,dt=Ne.transformColumns,wt=Ne.internalRefs,Tt=Ne.sticky,Ct=_e||Ge,Nt=!!Ct.length,At=P.useState(0),It=Object(j.a)(At,2),gt=It[0],Ye=It[1];P.useEffect(function(){Ye(Object(p.a)())});var _t=P.useMemo(function(){return Object(O.c)(et,{})},[et]),$e=P.useCallback(function(vn,cn){return Object(O.b)(_t,vn)||cn},[_t]),Je=P.useMemo(function(){return typeof ye=="function"?ye:function(vn){var cn=vn&&vn[ye];return cn}},[ye]),vt=Object(T.c)(Ne),St=vt.expandIcon,Rt=vt.expandedRowKeys,mt=vt.defaultExpandedRowKeys,ct=vt.defaultExpandAllRows,Vt=vt.expandedRowRender,jt=vt.onExpand,qt=vt.onExpandedRowsChange,Wt=vt.expandRowByClick,rn=vt.rowExpandable,On=vt.expandIconColumnIndex,Ln=vt.expandedRowClassName,Qe=vt.childrenColumnName,ht=vt.indentSize,Qt=St||Te,pn=Qe||"children",_n=P.useMemo(function(){return Vt?"row":Ne.expandable&&bt===tt&&Ne.expandable.__PARENT_RENDER_ICON__||Ct.some(function(vn){return vn&&Object($.a)(vn)==="object"&&vn[pn]})?"nest":!1},[!!Vt,Ct]),fn=P.useState(function(){return mt||(ct?Me(Ct,Je,pn):[])}),Y=Object(j.a)(fn,2),R=Y[0],k=Y[1],z=P.useMemo(function(){return new Set(Rt||R||[])},[Rt,R]),ie=P.useCallback(function(vn){var cn=Je(vn,Ct.indexOf(vn)),hn,fr=z.has(cn);fr?(z.delete(cn),hn=Object(N.a)(z)):hn=[].concat(Object(N.a)(z),[cn]),k(hn),jt&&jt(!fr,vn),qt&&qt(hn)},[Je,z,Ct,jt,qt]),J=P.useState(0),De=Object(j.a)(J,2),qe=De[0],ft=De[1],Lt=Object(he.b)(Object(V.a)(Object(V.a)(Object(V.a)({},Ne),vt),{},{expandable:!!Vt,expandedKeys:z,getRowKey:Je,onTriggerExpand:ie,expandIcon:Qt,expandIconColumnIndex:On,direction:ce}),bt===tt?dt:null),st=Object(j.a)(Lt,2),Pt=st[0],Ut=st[1],mn=P.useMemo(function(){return{columns:Pt,flattenColumns:Ut}},[Pt,Ut]),Fn=P.useRef(),kn=P.useRef(),Tn=P.useRef(),er=P.useState(!1),_r=Object(j.a)(er,2),Kt=_r[0],Bt=_r[1],zt=P.useState(!1),$t=Object(j.a)(zt,2),Zt=$t[0],an=$t[1],bn=re(new Map),Pn=Object(j.a)(bn,2),Un=Pn[0],Cn=Pn[1],Bn=Object(O.a)(Ut),tr=Bn.map(function(vn){return Un.get(vn)}),Er=P.useMemo(function(){return tr},[tr.join("_")]),nr=ae(Er,Ut.length,ce),dn=ve&&Object(O.d)(ve.y),Xt=ve&&Object(O.d)(ve.x),wn=Xt&&Ut.some(function(vn){var cn=vn.fixed;return cn}),Yt=P.useRef(),sn=Le(Tt,ze),on=sn.isSticky,rr=sn.offsetHeader,Mn=sn.offsetScroll,nn=sn.stickyClassName,xr,Qn,Dr;dn&&(Qn={overflowY:"scroll",maxHeight:ve.y}),Xt&&(xr={overflowX:"auto"},dn||(Qn={overflowY:"hidden"}),Dr={width:ve.x===!0?"auto":ve.x,minWidth:"100%"});var wr=P.useCallback(function(vn,cn){Cn(function(hn){var fr=new Map(hn);return fr.set(vn,cn),fr})},[]),Tr=le(null),Mr=Object(j.a)(Tr,2),gr=Mr[0],Nr=Mr[1];function Fr(vn,cn){if(!cn)return;typeof cn=="function"?cn(vn):cn.scrollLeft!==vn&&(cn.scrollLeft=vn)}var cr=function(cn){var hn=cn.currentTarget,fr=cn.scrollLeft,Ur=typeof fr=="number"?fr:hn.scrollLeft,Br=hn||Ve;if(!Nr()||Nr()===Br){var xi;gr(Br),Fr(Ur,kn.current),Fr(Ur,Tn.current),Fr(Ur,(xi=Yt.current)===null||xi===void 0?void 0:xi.setScrollLeft)}if(hn){var Vi=hn.scrollWidth,ga=hn.clientWidth;Bt(Ur>0),an(Ur<Vi-ga)}},Yr=function(){Tn.current&&cr({currentTarget:Tn.current})},kt=function(cn){var hn=cn.width;Yr(),ft(Fn.current?Fn.current.offsetWidth:hn)};P.useEffect(function(){return Yr},[]),P.useEffect(function(){Xt&&Yr()},[Xt]),P.useEffect(function(){bt===tt&&wt&&(wt.body.current=Tn.current)});var Gt=$e(["table"],"table"),Mt=P.useMemo(function(){return ue||(wn?ve.x==="max-content"?"auto":"fixed":dn||Ut.some(function(vn){var cn=vn.ellipsis;return cn})?"fixed":"auto")},[dn,wn,Ut,ue]),Jt,un={colWidths:Er,columCount:Ut.length,stickyOffsets:nr,onHeaderRow:yt,fixHeader:dn},En=P.useMemo(function(){return Nt?null:typeof it=="function"?it():it},[Nt,it]),ln=P.createElement(Se,{data:Ct,measureColumnWidth:dn||Xt||on,expandedKeys:z,rowExpandable:rn,getRowKey:Je,onRow:nt,emptyNode:En,childrenColumnName:pn}),Dn=P.createElement(c,{colWidths:Ut.map(function(vn){var cn=vn.width;return cn}),columns:Ut}),$n=Oe&&P.createElement(Re.b,null,Oe(Ct)),en=$e(["body"]);if(dn||on){var vr;typeof en=="function"?(vr=en(Ct,{scrollbarSize:gt,ref:Tn,onScroll:cr}),un.colWidths=Ut.map(function(vn,cn){var hn=vn.width,fr=cn===Pt.length-1?hn-gt:hn;return typeof fr=="number"&&!Number.isNaN(fr)?fr:(Object(y.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):vr=P.createElement("div",{style:Object(V.a)(Object(V.a)({},xr),Qn),onScroll:cr,ref:Tn,className:W()("".concat(ze,"-body"))},P.createElement(Gt,{style:Object(V.a)(Object(V.a)({},Dr),{},{tableLayout:Mt})},Dn,ln,$n),on&&P.createElement(ke,{ref:Yt,offsetScroll:Mn,scrollBodyRef:Tn,onScroll:cr})),Jt=P.createElement(P.Fragment,null,Ke!==!1&&P.createElement(x,Object.assign({noData:!Ct.length},un,mn,{direction:ce,offsetHeader:rr,stickyClassName:nn,ref:kn,onScroll:cr})),vr)}else Jt=P.createElement("div",{style:Object(V.a)(Object(V.a)({},xr),Qn),className:W()("".concat(ze,"-content")),onScroll:cr,ref:Tn},P.createElement(Gt,{style:Object(V.a)(Object(V.a)({},Dr),{},{tableLayout:Mt})},Dn,Ke!==!1&&P.createElement(_,Object.assign({},un,mn)),ln,$n));var gn=Object(T.b)(Ne),Kn=P.createElement("div",Object.assign({className:W()(ze,Xe,(Pe={},Object(ee.a)(Pe,"".concat(ze,"-rtl"),ce==="rtl"),Object(ee.a)(Pe,"".concat(ze,"-ping-left"),Kt),Object(ee.a)(Pe,"".concat(ze,"-ping-right"),Zt),Object(ee.a)(Pe,"".concat(ze,"-layout-fixed"),ue==="fixed"),Object(ee.a)(Pe,"".concat(ze,"-fixed-header"),dn),Object(ee.a)(Pe,"".concat(ze,"-fixed-column"),wn),Object(ee.a)(Pe,"".concat(ze,"-scroll-horizontal"),Xt),Object(ee.a)(Pe,"".concat(ze,"-has-fix-left"),Ut[0]&&Ut[0].fixed),Object(ee.a)(Pe,"".concat(ze,"-has-fix-right"),Ut[Ut.length-1]&&Ut[Ut.length-1].fixed==="right"),Pe)),style:Fe,id:Ue,ref:Fn},gn),P.createElement(rt,{pingLeft:Kt,pingRight:Zt,props:Object(V.a)(Object(V.a)({},Ne),{},{stickyOffsets:nr,mergedExpandedKeys:z})},be&&P.createElement(ge,{className:"".concat(ze,"-title")},be(Ct)),P.createElement("div",{className:"".concat(ze,"-container")},Jt),xe&&P.createElement(ge,{className:"".concat(ze,"-footer")},xe(Ct))));Xt&&(Kn=P.createElement(g.a,{onResize:kt},Kn));var Gn=P.useMemo(function(){return{prefixCls:ze,getComponent:$e,scrollbarSize:gt,direction:ce,fixedInfoList:Ut.map(function(vn,cn){return o(cn,cn,Ut,nr,ce)}),isSticky:on}},[ze,$e,gt,ce,Ut,nr,ce,on]),hr=P.useMemo(function(){return Object(V.a)(Object(V.a)({},mn),{},{tableLayout:Mt,rowClassName:je,expandedRowClassName:Ln,componentWidth:qe,fixHeader:dn,fixColumn:wn,horizonScroll:Xt,expandIcon:Qt,expandableType:_n,expandRowByClick:Wt,expandedRowRender:Vt,onTriggerExpand:ie,expandIconColumnIndex:On,indentSize:ht})},[mn,Mt,je,Ln,qe,dn,wn,Xt,Qt,_n,Wt,Vt,ie,On,ht]),ma=P.useMemo(function(){return{onColumnResize:wr}},[wr]);return P.createElement(i.a.Provider,{value:Gn},P.createElement(F.Provider,{value:hr},P.createElement(Q.Provider,{value:ma},Kn)))}ut.Column=a.a,ut.ColumnGroup=l.a,ut.Summary=Re.a,ut.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var lt=Ee.b=ut},wRmb:function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return D});var ee=H("rePB"),V=H("KQm4"),N=H("VTBJ"),$=H("Ff2n"),j=H("q1tI"),P=H.n(j),G=H("Kwbf"),W=H("Zm9Q"),n=H("hW8S");function D(a){return Object(W.a)(a).filter(function(f){return j.isValidElement(f)}).map(function(f){var u=f.key,d=f.props,i=d.children,o=Object($.a)(d,["children"]),O=Object(N.a)({key:u},o);return i&&(O.children=D(i)),O})}function y(a){return a.reduce(function(f,u){var d=u.fixed,i=d===!0?"left":d,o=u.children;return o&&o.length>0?[].concat(Object(V.a)(f),Object(V.a)(y(o).map(function(O){return Object(N.a)({fixed:i},O)}))):[].concat(Object(V.a)(f),[Object(N.a)(Object(N.a)({},u),{},{fixed:i})])},[])}function g(a){for(var f=!0,u=0;u<a.length;u+=1){var d=a[u];if(f&&d.fixed!=="left")f=!1;else if(!f&&d.fixed==="left"){Object(G.a)(!1,"Index ".concat(u-1," of `columns` missing `fixed='left'` prop."));break}}for(var i=!0,o=a.length-1;o>=0;o-=1){var O=a[o];if(i&&O.fixed!=="right")i=!1;else if(!i&&O.fixed==="right"){Object(G.a)(!1,"Index ".concat(o+1," of `columns` missing `fixed='right'` prop."));break}}}function p(a){return a.map(function(f){var u=f.fixed,d=Object($.a)(f,["fixed"]),i=u;return u==="left"?i="right":u==="right"&&(i="left"),Object(N.a)({fixed:i},d)})}function l(a,f){var u=a.prefixCls,d=a.columns,i=a.children,o=a.expandable,O=a.expandedKeys,w=a.getRowKey,C=a.onTriggerExpand,L=a.expandIcon,A=a.rowExpandable,_=a.expandIconColumnIndex,T=a.direction,v=a.expandRowByClick,c=j.useMemo(function(){return d||D(i)},[d,i]),E=j.useMemo(function(){if(o){var U,F=_||0,S=c[F],M=(U={},Object(ee.a)(U,n.a,{className:"".concat(u,"-expand-icon-col")}),Object(ee.a)(U,"title",""),Object(ee.a)(U,"fixed",S?S.fixed:null),Object(ee.a)(U,"className","".concat(u,"-row-expand-icon-cell")),Object(ee.a)(U,"render",function(K,Q,ne){var fe=w(Q,ne),we=O.has(fe),Se=A?A(Q):!0,he=L({prefixCls:u,expanded:we,expandable:Se,record:Q,onExpand:C});return v?j.createElement("span",{onClick:function(me){return me.stopPropagation()}},he):he}),U),I=c.slice();return F>=0&&I.splice(F,0,M),I}return c},[o,c,w,O,L,T]),h=j.useMemo(function(){var U=E;return f&&(U=f(U)),U.length||(U=[{render:function(){return null}}]),U},[f,E,T]),x=j.useMemo(function(){return T==="rtl"?p(y(h)):y(h)},[h,T]);return[h,x]}Ee.b=l},"y0+3":function(at,Ee,H){"use strict";H.d(Ee,"a",function(){return y}),H.d(Ee,"b",function(){return p});var ee=/margin|padding|width|height|max|min|offset/,V={left:!0,top:!0},N={cssFloat:1,styleFloat:1,float:1};function $(l){return l.nodeType===1?l.ownerDocument.defaultView.getComputedStyle(l,null):{}}function j(l,a,f){if(a=a.toLowerCase(),f==="auto"){if(a==="height")return l.offsetHeight;if(a==="width")return l.offsetWidth}return a in V||(V[a]=ee.test(a)),V[a]?parseFloat(f)||0:f}function P(l,a){var f=arguments.length,u=$(l);return a=N[a]?"cssFloat"in l.style?"cssFloat":"styleFloat":a,f===1?u:j(l,a,u[a]||l.style[a])}function G(l,a,f){var u=arguments.length;if(a=N[a]?"cssFloat"in l.style?"cssFloat":"styleFloat":a,u===3)return typeof f=="number"&&ee.test(a)&&(f="".concat(f,"px")),l.style[a]=f,f;for(var d in a)a.hasOwnProperty(d)&&G(l,d,a[d]);return $(l)}function W(l){return l===document.body?document.documentElement.clientWidth:l.offsetWidth}function n(l){return l===document.body?window.innerHeight||document.documentElement.clientHeight:l.offsetHeight}function D(){var l=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:l,height:a}}function y(){var l=document.documentElement.clientWidth,a=window.innerHeight||document.documentElement.clientHeight;return{width:l,height:a}}function g(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function p(l){var a=l.getBoundingClientRect(),f=document.documentElement;return{left:a.left+(window.pageXOffset||f.scrollLeft)-(f.clientLeft||document.body.clientLeft||0),top:a.top+(window.pageYOffset||f.scrollTop)-(f.clientTop||document.body.clientTop||0)}}},yFVG:function(at,Ee,H){at.exports={bg:"bg___239CK",main:"main___rgkgN",formWrap:"formWrap___18Cpt",knowledgeWrap:"knowledgeWrap___rGX80",knowledgeIcon:"knowledgeIcon___2ajWi",knowledgeContent:"knowledgeContent___Qaosn",knowledgeItem:"knowledgeItem___1db86",knowledgeItemName:"knowledgeItemName___34_4x",knowledgeItemIcon:"knowledgeItemIcon___1O9dB",button:"button___3a82z",buttonFixed:"buttonFixed___2PTyf",buttonWrap:"buttonWrap___2c5Pc",topicWrap:"topicWrap____aMgV"}}}]);