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__index.a1a6b7...

440 lines
1.4 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[211,5,7,8,14],{"+NIl":function(ct,ge,U){(function(te){te(U("VrN/"))})(function(te){"use strict";te.defineMode("stex",function(Y,N){"use strict";function z(c,a){c.cmdState.push(a)}function P(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function F(c){var a=c.cmdState.pop();a&&a.closeBracket()}function G(c){for(var a=c.cmdState,p=a.length-1;p>=0;p--){var l=a[p];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function K(c,a,p){return function(){this.name=c,this.bracketNo=0,this.style=a,this.styles=p,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=K("importmodule","tag",["string","builtin"]),n.documentclass=K("documentclass","tag",["","atom"]),n.usepackage=K("usepackage","tag",["atom"]),n.begin=K("begin","tag",["atom"]),n.end=K("end","tag",["atom"]),n.label=K("label","tag",["atom"]),n.ref=K("ref","tag",["atom"]),n.eqref=K("eqref","tag",["atom"]),n.cite=K("cite","tag",["atom"]),n.bibitem=K("bibitem","tag",["atom"]),n.Bibitem=K("Bibitem","tag",["atom"]),n.RBibitem=K("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(c,a){c.f=a}function E(c,a){var p;if(c.match(/^\\[a-zA-Z@]+/)){var l=c.current().slice(1);return p=n.hasOwnProperty(l)?n[l]:n.DEFAULT,p=new p,z(a,p),I(a,b),p.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return I(a,function(s,i){return f(s,i,"\\]")}),"keyword";if(c.match("\\("))return I(a,function(s,i){return f(s,i,"\\)")}),"keyword";if(c.match("$$"))return I(a,function(s,i){return f(s,i,"$$")}),"keyword";if(c.match("$"))return I(a,function(s,i){return f(s,i,"$")}),"keyword";var u=c.next();if(u=="%")return c.skipToEnd(),"comment";if(u=="}"||u=="]"){if(p=P(a),p)p.closeBracket(u),I(a,b);else return"error";return"bracket"}else return u=="{"||u=="["?(p=n.DEFAULT,p=new p,z(a,p),"bracket"):/\d/.test(u)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),p=G(a),p.name=="begin"&&(p.argument=c.current()),p.styleIdentifier())}function f(c,a,p){if(c.eatSpace())return null;if(p&&c.match(p))return I(a,E),"keyword";if(c.match(/^\\[a-zA-Z@]+/))return"tag";if(c.match(/^[a-zA-Z]+/))return"variable-2";if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/]/))return"tag";if(c.match(/^[\^_&]/))return"tag";if(c.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(c.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=c.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(c.skipToEnd(),"comment"):"error"}function b(c,a){var p=c.peek(),l;return p=="{"||p=="["?(l=P(a),l.openBracket(p),c.eat(p),I(a,E),"bracket"):/[ \t\r]/.test(p)?(c.eat(p),null):(I(a,E),F(a),E(c,a))}return{startState:function(){var c=N.inMathMode?function(a,p){return f(a,p)}:E;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,a){return a.f(c,a)},blankLine:function(c){c.f=E,c.cmdState.length=0},lineComment:"%"}}),te.defineMIME("text/x-stex","stex"),te.defineMIME("text/x-latex","stex")})},"+ua5":function(ct,ge,U){},"+vTd":function(ct,ge,U){ct.exports={flex_box_center:"flex_box_center___37CPQ",flex_space_between:"flex_space_between___1yzV5",flex_box_vertical_center:"flex_box_vertical_center___2QH_C",flex_box_center_end:"flex_box_center_end___22kLi",flex_box_column:"flex_box_column___1Y3On",line:"line___-rzSr",b1:"b1___1zz_c",b2:"b2___1dAOW",list:"list___1gpez",title:"title___21uOv",tr:"tr___3kTJL",itemDetail:"itemDetail___8QmqJ",answerWrapper:"answerWrapper___3guKO",decoration:"decoration___1rcYW",row:"row___3uQSh",typeRow:"typeRow___ADZSj",type:"type___2pfNZ",typeName:"typeName___8ZhPv",typeIcon:"typeIcon___1Xniv",unpublished:"unpublished___dTXTI",private:"private___XQiDx",public:"public___iIFou",reviewFlag:"reviewFlag___YP4vk",typeRightAction:"typeRightAction___1PQjp",actionLink:"actionLink___2E5q_",actionIcon:"actionIcon___GCvNK",topicTitle:"topicTitle___3fJds",topicTitleContent:"topicTitleContent___35cf9",judgmentContent:"judgmentContent___SU5rV",programContent:"programContent___3G6-D",otherContent:"otherContent___1JHnX",combinationContent:"combinationContent___6ZXO-",con:"con___1_qCl",otherContentItem:"otherContentItem___18WrV",otehrContentHtml:"otehrContentHtml___LW3nV",difficultyRow:"difficultyRow___3HvT0",updateTimeRow:"updateTimeRow___1dNd0",updateTimeWrap:"updateTimeWrap___2PKks",updateTimeContent:"updateTimeContent___1mNBy",programLanguage:"programLanguage___3CnaJ",updateTimeRowAction:"updateTimeRowAction___1DaMt",bottomAction:"bottomAction___Y-BNC",borderColorBlue:"borderColorBlue___2Xd-0",borderColorRed:"borderColorRed___2zA_q",borderColorFFF:"borderColorFFF___2R5-5",borderColorGray:"borderColorGray___nZnDe",selectIcon:"selectIcon___2byLd",colorGreen:"colorGreen___1iOKR",parseAnswerBorder:"parseAnswerBorder___1LTYn",answer:"answer___2L9lv",answerHtml:"answerHtml___3zrOk",parse:"parse___3d3dm",parseText:"parseText___1C_VL",parseAnswer:"parseAnswer___QMVPC",parseAnswerHtml:"parseAnswerHtml___2TCVz",actionBar:"actionBar___2ItMN",know:"know___y8QKK",menu:"menu___SYdg7",bottom:"bottom___2dFIa",textBtn:"textBtn___1y00f"}},"+z73":function(ct,ge,U){ct.exports={flex_box_center:"flex_box_center___3WSrc",flex_space_between:"flex_space_between___1fpCp",flex_box_vertical_center:"flex_box_vertical_center___3Wy8W",flex_box_center_end:"flex_box_center_end___3YIs2",flex_box_column:"flex_box_column___3CNwR",pWrap:"pWrap___2jVbQ",few:"few___3Eebn"}},"/cxE":function(ct,ge,U){"use strict";U.d(ge,"f",function(){return N}),U.d(ge,"g",function(){return z}),U.d(ge,"h",function(){return P}),U.d(ge,"e",function(){return G}),U.d(ge,"b",function(){return K}),U.d(ge,"c",function(){return n}),U.d(ge,"d",function(){return I}),U.d(ge,"a",function(){return E});class te{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(()=>{throw f.stack?new Error(f.message+`
`+f.stack):f},0)}}emit(f){this.listeners.forEach(b=>{b(f)})}onUnexpectedError(f){this.unexpectedErrorHandler(f),this.emit(f)}onUnexpectedExternalError(f){this.unexpectedErrorHandler(f)}}const Y=new te;function N(f){G(f)||Y.onUnexpectedError(f);return}function z(f){G(f)||Y.onUnexpectedExternalError(f);return}function P(f){if(f instanceof Error){let{name:b,message:c}=f;const a=f.stacktrace||f.stack;return{$isError:!0,name:b,message:c,stack:a}}return f}const F="Canceled";function G(f){return f instanceof Error&&f.name===F&&f.message===F}function K(){const f=new Error(F);return f.name=f.message,f}function n(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function I(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class E extends Error{constructor(f){super("NotSupported");f&&(this.message=f)}}},"19Vz":function(ct,ge,U){(function(te){te(U("VrN/"))})(function(te){te.defineOption("placeholder","",function(K,n,I){var E=I&&I!=te.Init;if(n&&!E)K.on("blur",P),K.on("change",F),K.on("swapDoc",F),te.on(K.getInputField(),"compositionupdate",K.state.placeholderCompose=function(){z(K)}),F(K);else if(!n&&E){K.off("blur",P),K.off("change",F),K.off("swapDoc",F),te.off(K.getInputField(),"compositionupdate",K.state.placeholderCompose),Y(K);var f=K.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}n&&!K.hasFocus()&&P(K)});function Y(K){K.state.placeholder&&(K.state.placeholder.parentNode.removeChild(K.state.placeholder),K.state.placeholder=null)}function N(K){Y(K);var n=K.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=K.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var I=K.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),n.appendChild(I),K.display.lineSpace.insertBefore(n,K.display.lineSpace.firstChild)}function z(K){setTimeout(function(){var n=!1,I=K.getInputField();I.nodeName=="TEXTAREA"?n=!I.value:K.lineCount()==1&&(n=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),n?N(K):Y(K)},20)}function P(K){G(K)&&N(K)}function F(K){var n=K.getWrapperElement(),I=G(K);n.className=n.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?N(K):Y(K)}function G(K){return K.lineCount()===1&&K.getLine(0)===""}})},"1eCo":function(ct,ge,U){(function(te){te(U("VrN/"))})(function(te){"use strict";var Y={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};te.defineMode("xml",function(z,P){var F=z.indentUnit,G={},K=P.htmlMode?Y:N;for(var n in K)G[n]=K[n];for(var n in P)G[n]=P[n];var I,E;function f(d,C){function x(W){return C.tokenize=W,W(d,C)}var w=d.next();if(w=="<")return d.eat("!")?d.eat("[")?d.match("CDATA[")?x(a("atom","]]>")):null:d.match("--")?x(a("comment","-->")):d.match("DOCTYPE",!0,!0)?(d.eatWhile(/[\w\._\-]/),x(p(1))):null:d.eat("?")?(d.eatWhile(/[\w\._\-]/),C.tokenize=a("meta","?>"),"meta"):(I=d.eat("/")?"closeTag":"openTag",C.tokenize=b,"tag bracket");if(w=="&"){var j;return d.eat("#")?d.eat("x")?j=d.eatWhile(/[a-fA-F\d]/)&&d.eat(";"):j=d.eatWhile(/[\d]/)&&d.eat(";"):j=d.eatWhile(/[\w\.\-:]/)&&d.eat(";"),j?"atom":"error"}else return d.eatWhile(/[^&<]/),null}f.isInText=!0;function b(d,C){var x=d.next();if(x==">"||x=="/"&&d.eat(">"))return C.tokenize=f,I=x==">"?"endTag":"selfcloseTag","tag bracket";if(x=="=")return I="equals",null;if(x=="<"){C.tokenize=f,C.state=i,C.tagName=C.tagStart=null;var w=C.tokenize(d,C);return w?w+" tag error":"tag error"}else return/[\'\"]/.test(x)?(C.tokenize=c(x),C.stringStartCol=d.column(),C.tokenize(d,C)):(d.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(d){var C=function(x,w){for(;!x.eol();)if(x.next()==d){w.tokenize=b;break}return"string"};return C.isInAttribute=!0,C}function a(d,C){return function(x,w){for(;!x.eol();){if(x.match(C)){w.tokenize=f;break}x.next()}return d}}function p(d){return function(C,x){for(var w;(w=C.next())!=null;){if(w=="<")return x.tokenize=p(d+1),x.tokenize(C,x);if(w==">")if(d==1){x.tokenize=f;break}else return x.tokenize=p(d-1),x.tokenize(C,x)}return"meta"}}function l(d,C,x){this.prev=d.context,this.tagName=C,this.indent=d.indented,this.startOfLine=x,(G.doNotIndent.hasOwnProperty(C)||d.context&&d.context.noIndent)&&(this.noIndent=!0)}function u(d){d.context&&(d.context=d.context.prev)}function s(d,C){for(var x;;){if(!d.context)return;if(x=d.context.tagName,!G.contextGrabbers.hasOwnProperty(x)||!G.contextGrabbers[x].hasOwnProperty(C))return;u(d)}}function i(d,C,x){return d=="openTag"?(x.tagStart=C.column(),D):d=="closeTag"?A:i}function D(d,C,x){return d=="word"?(x.tagName=C.current(),E="tag",O):G.allowMissingTagName&&d=="endTag"?(E="tag bracket",O(d,C,x)):(E="error",D)}function A(d,C,x){if(d=="word"){var w=C.current();return x.context&&x.context.tagName!=w&&G.implicitlyClosed.hasOwnProperty(x.context.tagName)&&u(x),x.context&&x.context.tagName==w||G.matchClosing===!1?(E="tag",S):(E="tag error",R)}else return G.allowMissingTagName&&d=="endTag"?(E="tag bracket",S(d,C,x)):(E="error",R)}function S(d,C,x){return d!="endTag"?(E="error",S):(u(x),i)}function R(d,C,x){return E="error",S(d,C,x)}function O(d,C,x){if(d=="word")return E="attribute",g;if(d=="endTag"||d=="selfcloseTag"){var w=x.tagName,j=x.tagStart;return x.tagName=x.tagStart=null,d=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(w)?s(x,w):(s(x,w),x.context=new l(x,w,j==x.indented)),i}return E="error",O}function g(d,C,x){return d=="equals"?_:(G.allowMissing||(E="error"),O(d,C,x))}function _(d,C,x){return d=="string"?h:d=="word"&&G.allowUnquoted?(E="string",O):(E="error",O(d,C,x))}function h(d,C,x){return d=="string"?h:O(d,C,x)}return{startState:function(d){var C={tokenize:f,state:i,indented:d||0,tagName:null,tagStart:null,context:null};return d!=null&&(C.baseIndent=d),C},token:function(d,C){if(!C.tagName&&d.sol()&&(C.indented=d.indentation()),d.eatSpace())return null;I=null;var x=C.tokenize(d,C);return(x||I)&&x!="comment"&&(E=null,C.state=C.state(I||x,d,C),E&&(x=E=="error"?x+" error":E)),x},indent:function(d,C,x){var w=d.context;if(d.tokenize.isInAttribute)return d.tagStart==d.indented?d.stringStartCol+1:d.indented+F;if(w&&w.noIndent)return te.Pass;if(d.tokenize!=b&&d.tokenize!=f)return x?x.match(/^(\s*)/)[0].length:0;if(d.tagName)return G.multilineTagIndentPastTag!==!1?d.tagStart+d.tagName.length+2:d.tagStart+F*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(C))return 0;var j=C&&/^<(\/)?([\w_:\.-]*)/.exec(C);if(j&&j[1])for(;w;)if(w.tagName==j[2]){w=w.prev;break}else if(G.implicitlyClosed.hasOwnProperty(w.tagName))w=w.prev;else break;else if(j)for(;w;){var W=G.contextGrabbers[w.tagName];if(W&&W.hasOwnProperty(j[2]))w=w.prev;else break}for(;w&&w.prev&&!w.startOfLine;)w=w.prev;return w?w.indent+F:d.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(d){d.state==_&&(d.state=O)},xmlCurrentTag:function(d){return d.tagName?{name:d.tagName,close:d.type=="closeTag"}:null},xmlCurrentContext:function(d){for(var C=[],x=d.context;x;x=x.prev)x.tagName&&C.push(x.tagName);return C.reverse()}}}),te.defineMIME("text/xml","xml"),te.defineMIME("application/xml","xml"),te.mimeModes.hasOwnProperty("text/html")||te.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1vnw":function(ct,ge,U){ct.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"24hK":function(ct,ge,U){"use strict";U.d(ge,"a",function(){return Y});class te{constructor(N){this.element=N,this.next=te.Undefined,this.prev=te.Undefined}}te.Undefined=new te(void 0);class Y{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let N=this._first;for(;N!==te.Undefined;){const z=N.next;N.prev=te.Undefined,N.next=te.Undefined,N=z}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(N){return this._insert(N,!1)}push(N){return this._insert(N,!0)}_insert(N,z){const P=new te(N);if(this._first===te.Undefined)this._first=P,this._last=P;else if(z){const G=this._last;this._last=P,P.prev=G,G.next=P}else{const G=this._first;this._first=P,P.next=G,G.prev=P}this._size+=1;let F=!1;return()=>{F||(F=!0,this._remove(P))}}shift(){if(this._first===te.Undefined)return;{const N=this._first.element;return this._remove(this._first),N}}pop(){if(this._last===te.Undefined)return;{const N=this._last.element;return this._remove(this._last),N}}_remove(N){if(N.prev!==te.Undefined&&N.next!==te.Undefined){const z=N.prev;z.next=N.next,N.next.prev=z}else N.prev===te.Undefined&&N.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):N.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):N.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let N=this._first;for(;N!==te.Undefined;)yield N.element,N=N.next}}},"3/fG":function(ct,ge,U){"use strict";U.d(ge,"a",function(){return Y});function te(N,z){let P;return z.length===0?P=N:P=N.replace(/\{(\d+)\}/g,function(F,G){const K=G[0];return typeof z[K]!="undefined"?z[K]:F}),P}function Y(N,z,...P){return te(z,P)}},"55Ip":function(ct,ge,U){"use strict";U.d(ge,"a",function(){return s});var te=U("Ty5D"),Y=U("dI71"),N=U("q1tI"),z=U.n(N),P=U("YS25"),F=U("17x9"),G=U.n(F),K=U("wx14"),n=U("zLVn"),I=U("9R94"),E=function(_){Object(Y.a)(h,_);function h(){for(var C,x=arguments.length,w=new Array(x),j=0;j<x;j++)w[j]=arguments[j];return C=_.call.apply(_,[this].concat(w))||this,C.history=Object(P.a)(C.props),C}var d=h.prototype;return d.render=function(){return z.a.createElement(te.c,{history:this.history,children:this.props.children})},h}(z.a.Component),f=function(_){Object(Y.a)(h,_);function h(){for(var C,x=arguments.length,w=new Array(x),j=0;j<x;j++)w[j]=arguments[j];return C=_.call.apply(_,[this].concat(w))||this,C.history=Object(P.b)(C.props),C}var d=h.prototype;return d.render=function(){return z.a.createElement(te.c,{history:this.history,children:this.props.children})},h}(z.a.Component),b=function(h,d){return typeof h=="function"?h(d):h},c=function(h,d){return typeof h=="string"?Object(P.c)(h,null,null,d):h},a=function(h){return h},p=z.a.forwardRef;typeof p=="undefined"&&(p=a);function l(_){return!!(_.metaKey||_.altKey||_.ctrlKey||_.shiftKey)}var u=p(function(_,h){var d=_.innerRef,C=_.navigate,x=_.onClick,w=Object(n.a)(_,["innerRef","navigate","onClick"]),j=w.target,W=Object(K.a)({},w,{onClick:function(M){try{x&&x(M)}catch(m){throw M.preventDefault(),m}!M.defaultPrevented&&M.button===0&&(!j||j==="_self")&&!l(M)&&(M.preventDefault(),C())}});return a!==p?W.ref=h||d:W.ref=d,z.a.createElement("a",W)}),s=p(function(_,h){var d=_.component,C=d===void 0?u:d,x=_.replace,w=_.to,j=_.innerRef,W=Object(n.a)(_,["component","replace","to","innerRef"]);return z.a.createElement(te.e.Consumer,null,function(T){T||Object(I.a)(!1);var M=T.history,m=c(b(w,T.location),T.location),v=m?M.createHref(m):"",H=Object(K.a)({},W,{href:v,navigate:function(){var q=b(w,T.location),re=x?M.replace:M.push;re(q)}});return a!==p?H.ref=h||j:H.innerRef=j,z.a.createElement(C,H)})});if(!1)var i,D;var A=function(h){return h},S=z.a.forwardRef;typeof S=="undefined"&&(S=A);function R(){for(var _=arguments.length,h=new Array(_),d=0;d<_;d++)h[d]=arguments[d];return h.filter(function(C){return C}).join(" ")}var O=S(function(_,h){var d=_["aria-current"],C=d===void 0?"page":d,x=_.activeClassName,w=x===void 0?"active":x,j=_.activeStyle,W=_.className,T=_.exact,M=_.isActive,m=_.location,v=_.sensitive,H=_.strict,X=_.style,q=_.to,re=_.innerRef,ye=Object(n.a)(_,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return z.a.createElement(te.e.Consumer,null,function(pe){pe||Object(I.a)(!1);var ue=m||pe.location,fe=c(b(q,ue),ue),be=fe.pathname,se=be&&be.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ae=se?Object(te.f)(ue.pathname,{path:se,exact:T,sensitive:v,strict:H}):null,Ce=!!(M?M(ae,ue):ae),ze=Ce?R(W,w):W,Ye=Ce?Object(K.a)({},X,{},j):X,He=Object(K.a)({"aria-current":Ce&&C||null,className:ze,style:Ye,to:fe},ye);return A!==S?He.ref=h||re:He.innerRef=re,z.a.createElement(s,He)})});if(!1)var g},"5VLF":function(ct,ge,U){"use strict";var te,Y;function N(z,P,F){var G=function(K,n){return z.js_beautify(K,n)};return G.js=z.js_beautify,G.css=P.css_beautify,G.html=F.html_beautify,G.js_beautify=z.js_beautify,G.css_beautify=P.css_beautify,G.html_beautify=F.html_beautify,G}!(te=[U("6UM0"),U("TXwP"),U("psGv")],Y=function(z,P,F){return N(z,P,F)}.apply(ge,te),Y!==void 0&&(ct.exports=Y))},"5Y4S":function(ct,ge,U){"use strict";U.d(ge,"a",function(){return N});var te=U("MNsG");const Y=te.b.performance&&typeof te.b.performance.now=="function";class N{constructor(z){this._highResolution=Y&&z,this._startTime=this._now(),this._stopTime=-1}static create(z=!0){return new N(z)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?te.b.performance.now():Date.now()}}},"6+eU":function(ct,ge,U){"use strict";U.d(ge,"a",function(){return S});var te=U("wx14"),Y=U("rePB"),N=U("VTBJ"),z=U("1OyB"),P=U("vuIU"),F=U("Ji7U"),G=U("LK+K"),K=U("q1tI"),n=U.n(K),I=U("TSYQ"),E=U.n(I),f=function(O){var g,_="".concat(O.rootPrefixCls,"-item"),h=E()(_,"".concat(_,"-").concat(O.page),(g={},Object(Y.a)(g,"".concat(_,"-active"),O.active),Object(Y.a)(g,O.className,!!O.className),Object(Y.a)(g,"".concat(_,"-disabled"),!O.page),g)),d=function(){O.onClick(O.page)},C=function(w){O.onKeyPress(w,O.onClick,O.page)};return n.a.createElement("li",{title:O.showTitle?O.page:null,className:h,onClick:d,onKeyPress:C,tabIndex:"0"},O.itemRender(O.page,"page",n.a.createElement("a",{rel:"nofollow"},O.page)))},b=f,c={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},a=function(R){Object(F.a)(g,R);var O=Object(G.a)(g);function g(){var _;Object(z.a)(this,g);for(var h=arguments.length,d=new Array(h),C=0;C<h;C++)d[C]=arguments[C];return _=O.call.apply(O,[this].concat(d)),_.state={goInputText:""},_.buildOptionText=function(x){return"".concat(x," ").concat(_.props.locale.items_per_page)},_.changeSize=function(x){_.props.changeSize(Number(x))},_.handleChange=function(x){_.setState({goInputText:x.target.value})},_.handleBlur=function(x){var w=_.props,j=w.goButton,W=w.quickGo,T=w.rootPrefixCls,M=_.state.goInputText;if(j||M==="")return;if(x.relatedTarget&&(x.relatedTarget.className.indexOf("".concat(T,"-prev"))>=0||x.relatedTarget.className.indexOf("".concat(T,"-next"))>=0))return;_.setState({goInputText:""}),W(_.getValidValue())},_.go=function(x){var w=_.state.goInputText;if(w==="")return;(x.keyCode===c.ENTER||x.type==="click")&&(_.setState({goInputText:""}),_.props.quickGo(_.getValidValue()))},_}return Object(P.a)(g,[{key:"getValidValue",value:function(){var h=this.state,d=h.goInputText,C=h.current;return!d||isNaN(d)?C:Number(d)}},{key:"getPageSizeOptions",value:function(){var h=this.props,d=h.pageSize,C=h.pageSizeOptions;return C.some(function(x){return x.toString()===d.toString()})?C:C.concat([d.toString()]).sort(function(x,w){var j=isNaN(Number(x))?0:Number(x),W=isNaN(Number(w))?0:Number(w);return j-W})}},{key:"render",value:function(){var h=this,d=this.props,C=d.pageSize,x=d.locale,w=d.rootPrefixCls,j=d.changeSize,W=d.quickGo,T=d.goButton,M=d.selectComponentClass,m=d.buildOptionText,v=d.selectPrefixCls,H=d.disabled,X=this.state.goInputText,q="".concat(w,"-options"),re=M,ye=null,pe=null,ue=null;if(!j&&!W)return null;var fe=this.getPageSizeOptions();if(j&&re){var be=fe.map(function(se,ae){return n.a.createElement(re.Option,{key:ae,value:se.toString()},(m||h.buildOptionText)(se))});ye=n.a.createElement(re,{disabled:H,prefixCls:v,showSearch:!1,className:"".concat(q,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(C||fe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ae){return ae.parentNode}},be)}return W&&(T&&(ue=typeof T=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:H,className:"".concat(q,"-quick-jumper-button")},x.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},T)),pe=n.a.createElement("div",{className:"".concat(q,"-quick-jumper")},x.jump_to,n.a.createElement("input",{disabled:H,type:"text",value:X,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),x.page,ue)),n.a.createElement("li",{className:"".concat(q)},ye,pe)}}]),g}(n.a.Component);a.defaultProps={pageSizeOptions:["10","20","50","100"]};var p=a,l=U("N2Kk");function u(){}function s(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}function i(R,O,g){return g}function D(R,O,g){var _=typeof R=="undefined"?O.pageSize:R;return Math.floor((g.total-1)/_)+1}var A=function(R){Object(F.a)(g,R);var O=Object(G.a)(g);function g(_){var h;Object(z.a)(this,g),h=O.call(this,_),h.getJumpPrevPage=function(){return Math.max(1,h.state.current-(h.props.showLessItems?3:5))},h.getJumpNextPage=function(){return Math.min(D(void 0,h.state,h.props),h.state.current+(h.props.showLessItems?3:5))},h.getItemIcon=function(j,W){var T=h.props.prefixCls,M=j||n.a.createElement("button",{type:"button","aria-label":W,className:"".concat(T,"-item-link")});return typeof j=="function"&&(M=n.a.createElement(j,Object(N.a)({},h.props))),M},h.savePaginationNode=function(j){h.paginationNode=j},h.isValid=function(j){return s(j)&&j!==h.state.current},h.shouldDisplayQuickJumper=function(){var j=h.props,W=j.showQuickJumper,T=j.pageSize,M=j.total;return M<=T?!1:W},h.handleKeyDown=function(j){(j.keyCode===c.ARROW_UP||j.keyCode===c.ARROW_DOWN)&&j.preventDefault()},h.handleKeyUp=function(j){var W=h.getValidValue(j),T=h.state.currentInputValue;W!==T&&h.setState({currentInputValue:W}),j.keyCode===c.ENTER?h.handleChange(W):j.keyCode===c.ARROW_UP?h.handleChange(W-1):j.keyCode===c.ARROW_DOWN&&h.handleChange(W+1)},h.changePageSize=function(j){var W=h.state.current,T=D(j,h.state,h.props);W=W>T?T:W,T===0&&(W=h.state.current),typeof j=="number"&&("pageSize"in h.props||h.setState({pageSize:j}),"current"in h.props||h.setState({current:W,currentInputValue:W})),h.props.onShowSizeChange(W,j),"onChange"in h.props&&h.props.onChange&&h.props.onChange(W,j)},h.handleChange=function(j){var W=h.props.disabled,T=j;if(h.isValid(T)&&!W){var M=D(void 0,h.state,h.props);T>M?T=M:T<1&&(T=1),"current"in h.props||h.setState({current:T,currentInputValue:T});var m=h.state.pageSize;return h.props.onChange(T,m),T}return h.state.current},h.prev=function(){h.hasPrev()&&h.handleChange(h.state.current-1)},h.next=function(){h.hasNext()&&h.handleChange(h.state.current+1)},h.jumpPrev=function(){h.handleChange(h.getJumpPrevPage())},h.jumpNext=function(){h.handleChange(h.getJumpNextPage())},h.hasPrev=function(){return h.state.current>1},h.hasNext=function(){return h.state.current<D(void 0,h.state,h.props)},h.runIfEnter=function(j,W){if(j.key==="Enter"||j.charCode===13){for(var T=arguments.length,M=new Array(T>2?T-2:0),m=2;m<T;m++)M[m-2]=arguments[m];W.apply(void 0,M)}},h.runIfEnterPrev=function(j){h.runIfEnter(j,h.prev)},h.runIfEnterNext=function(j){h.runIfEnter(j,h.next)},h.runIfEnterJumpPrev=function(j){h.runIfEnter(j,h.jumpPrev)},h.runIfEnterJumpNext=function(j){h.runIfEnter(j,h.jumpNext)},h.handleGoTO=function(j){(j.keyCode===c.ENTER||j.type==="click")&&h.handleChange(h.state.currentInputValue)};var d=_.onChange!==u,C="current"in _;C&&!d&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var x=_.defaultCurrent;"current"in _&&(x=_.current);var w=_.defaultPageSize;return"pageSize"in _&&(w=_.pageSize),x=Math.min(x,D(w,void 0,_)),h.state={current:x,currentInputValue:x,pageSize:w},h}return Object(P.a)(g,[{key:"componentDidUpdate",value:function(h,d){var C=this.props.prefixCls;if(d.current!==this.state.current&&this.paginationNode){var x=this.paginationNode.querySelector(".".concat(C,"-item-").concat(d.current));x&&document.activeElement===x&&x.blur()}}},{key:"getValidValue",value:function(h){var d=h.target.value,C=D(void 0,this.state,this.props),x=this.state.currentInputValue,w;return d===""?w=d:isNaN(Number(d))?w=x:d>=C?w=C:w=Number(d),w}},{key:"getShowSizeChanger",value:function(){var h=this.props,d=h.showSizeChanger,C=h.total,x=h.totalBoundaryShowSizeChanger;return typeof d!="undefined"?d:C>x}},{key:"renderPrev",value:function(h){var d=this.props,C=d.prevIcon,x=d.itemRender,w=x(h,"prev",this.getItemIcon(C,"prev page")),j=!this.hasPrev();return Object(K.isValidElement)(w)?Object(K.cloneElement)(w,{disabled:j}):w}},{key:"renderNext",value:function(h){var d=this.props,C=d.nextIcon,x=d.itemRender,w=x(h,"next",this.getItemIcon(C,"next page")),j=!this.hasNext();return Object(K.isValidElement)(w)?Object(K.cloneElement)(w,{disabled:j}):w}},{key:"render",value:function(){var h=this,d=this.props,C=d.prefixCls,x=d.className,w=d.style,j=d.disabled,W=d.hideOnSinglePage,T=d.total,M=d.locale,m=d.showQuickJumper,v=d.showLessItems,H=d.showTitle,X=d.showTotal,q=d.simple,re=d.itemRender,ye=d.showPrevNextJumpers,pe=d.jumpPrevIcon,ue=d.jumpNextIcon,fe=d.selectComponentClass,be=d.selectPrefixCls,se=d.pageSizeOptions,ae=this.state,Ce=ae.current,ze=ae.pageSize,Ye=ae.currentInputValue;if(W===!0&&T<=ze)return null;var He=D(void 0,this.state,this.props),Ve=[],Fe=null,Ke=null,nt=null,de=null,De=null,Ne=m&&m.goButton,Ue=v?1:2,rt=Ce-1>0?Ce-1:0,lt=Ce+1<He?Ce+1:He,ft=Object.keys(this.props).reduce(function(ce,he){return(he.substr(0,5)==="data-"||he.substr(0,5)==="aria-"||he==="role")&&(ce[he]=h.props[he]),ce},{});if(q)return Ne&&(typeof Ne=="boolean"?De=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},M.jump_to_confirm):De=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ne),De=n.a.createElement("li",{title:H?"".concat(M.jump_to).concat(Ce,"/").concat(He):null,className:"".concat(C,"-simple-pager")},De)),n.a.createElement("ul",Object(te.a)({className:E()(C,"".concat(C,"-simple"),Object(Y.a)({},"".concat(C,"-disabled"),j),x),style:w,ref:this.savePaginationNode},ft),n.a.createElement("li",{title:H?M.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:E()("".concat(C,"-prev"),Object(Y.a)({},"".concat(C,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(rt)),n.a.createElement("li",{title:H?"".concat(Ce,"/").concat(He):null,className:"".concat(C,"-simple-pager")},n.a.createElement("input",{type:"text",value:Ye,disabled:j,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),n.a.createElement("span",{className:"".concat(C,"-slash")},"/"),He),n.a.createElement("li",{title:H?M.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:E()("".concat(C,"-next"),Object(Y.a)({},"".concat(C,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(lt)),De);if(He<=3+Ue*2){var at={locale:M,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:H,itemRender:re};He||Ve.push(n.a.createElement(b,Object(te.a)({},at,{key:"noPager",page:He,className:"".concat(C,"-disabled")})));for(var _t=1;_t<=He;_t+=1){var gt=Ce===_t;Ve.push(n.a.createElement(b,Object(te.a)({},at,{key:_t,page:_t,active:gt})))}}else{var xt=v?M.prev_3:M.prev_5,Ze=v?M.next_3:M.next_5;ye&&(Fe=n.a.createElement("li",{title:H?xt:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:E()("".concat(C,"-jump-prev"),Object(Y.a)({},"".concat(C,"-jump-prev-custom-icon"),!!pe))},re(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(pe,"prev page"))),Ke=n.a.createElement("li",{title:H?Ze:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:E()("".concat(C,"-jump-next"),Object(Y.a)({},"".concat(C,"-jump-next-custom-icon"),!!ue))},re(this.getJumpNextPage(),"jump-next",this.getItemIcon(ue,"next page")))),de=n.a.createElement(b,{locale:M,last:!0,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:He,page:He,active:!1,showTitle:H,itemRender:re}),nt=n.a.createElement(b,{locale:M,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:H,itemRender:re});var kt=Math.max(1,Ce-Ue),Ot=Math.min(Ce+Ue,He);Ce-1<=Ue&&(Ot=1+Ue*2),He-Ce<=Ue&&(kt=He-Ue*2);for(var qe=kt;qe<=Ot;qe+=1){var st=Ce===qe;Ve.push(n.a.createElement(b,{locale:M,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:qe,page:qe,active:st,showTitle:H,itemRender:re}))}Ce-1>=Ue*2&&Ce!==1+2&&(Ve[0]=Object(K.cloneElement)(Ve[0],{className:"".concat(C,"-item-after-jump-prev")}),Ve.unshift(Fe)),He-Ce>=Ue*2&&Ce!==He-2&&(Ve[Ve.length-1]=Object(K.cloneElement)(Ve[Ve.length-1],{className:"".concat(C,"-item-before-jump-next")}),Ve.push(Ke)),kt!==1&&Ve.unshift(nt),Ot!==He&&Ve.push(de)}var xe=null;X&&(xe=n.a.createElement("li",{className:"".concat(C,"-total-text")},X(T,[T===0?0:(Ce-1)*ze+1,Ce*ze>T?T:Ce*ze])));var we=!this.hasPrev()||!He,me=!this.hasNext()||!He;return n.a.createElement("ul",Object(te.a)({className:E()(C,x,Object(Y.a)({},"".concat(C,"-disabled"),j)),style:w,unselectable:"unselectable",ref:this.savePaginationNode},ft),xe,n.a.createElement("li",{title:H?M.prev_page:null,onClick:this.prev,tabIndex:we?null:0,onKeyPress:this.runIfEnterPrev,className:E()("".concat(C,"-prev"),Object(Y.a)({},"".concat(C,"-disabled"),we)),"aria-disabled":we},this.renderPrev(rt)),Ve,n.a.createElement("li",{title:H?M.next_page:null,onClick:this.next,tabIndex:me?null:0,onKeyPress:this.runIfEnterNext,className:E()("".concat(C,"-next"),Object(Y.a)({},"".concat(C,"-disabled"),me)),"aria-disabled":me},this.renderNext(lt)),n.a.createElement(p,{disabled:j,locale:M,rootPrefixCls:C,selectComponentClass:fe,selectPrefixCls:be,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ce,pageSize:ze,pageSizeOptions:se,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ne}))}}],[{key:"getDerivedStateFromProps",value:function(h,d){var C={};if("current"in h&&(C.current=h.current,h.current!==d.current&&(C.currentInputValue=C.current)),"pageSize"in h&&h.pageSize!==d.pageSize){var x=d.current,w=D(h.pageSize,d,h);x=x>w?w:x,"current"in h||(C.current=x,C.currentInputValue=x),C.pageSize=h.pageSize}return C}}]),g}(n.a.Component);A.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:u,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:u,locale:l.a,style:{},itemRender:i,totalBoundaryShowSizeChanger:50};var S=A},"6UM0":function(ct,ge,U){var te,Y;(function(){var N;(function(){"use strict";var P=[function(n,I,E){var f=E(1).Beautifier,b=E(5).Options;function c(a,p){var l=new f(a,p);return l.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new b}},function(n,I,E){var f=E(2).Output,b=E(3).Token,c=E(4),a=E(5).Options,p=E(7).Tokenizer,l=E(7).line_starters,u=E(7).positionable_operators,s=E(7).TOKEN;function i(v,H){return H.indexOf(v)!==-1}function D(v){return v.replace(/^\s+/g,"")}function A(v){for(var H={},X=0;X<v.length;X++)H[v[X].replace(/-/g,"_")]=v[X];return H}function S(v,H){return v&&v.type===s.RESERVED&&v.text===H}function R(v,H){return v&&v.type===s.RESERVED&&i(v.text,H)}var O=["case","return","do","if","throw","else","await","break","continue","async"],g=["before-newline","after-newline","preserve-newline"],_=A(g),h=[_.before_newline,_.preserve_newline],d={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function C(v,H){if(H.multiline_frame||H.mode===d.ForInitializer||H.mode===d.Conditional)return;v.remove_indent(H.start_line_index)}function x(v){v=v.replace(c.allLineBreaks,`
`);for(var H=[],X=v.indexOf(`
`);X!==-1;)H.push(v.substring(0,X)),v=v.substring(X+1),X=v.indexOf(`
`);return v.length&&H.push(v),H}function w(v){return v===d.ArrayLiteral}function j(v){return i(v,[d.Expression,d.ForInitializer,d.Conditional])}function W(v,H){for(var X=0;X<v.length;X++){var q=v[X].trim();if(q.charAt(0)!==H)return!1}return!0}function T(v,H){for(var X=0,q=v.length,re;X<q;X++)if(re=v[X],re&&re.indexOf(H)!==0)return!1;return!0}function M(v,H){H=H||{},this._source_text=v||"",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(H)}M.prototype.create_flags=function(v,H){var X=0;v&&(X=v.indentation_level,!this._output.just_added_newline()&&v.line_indent_level>X&&(X=v.line_indent_level));var q={mode:H,parent:v,last_token:v?v.last_token:new b(s.START_BLOCK,""),last_word:v?v.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:X,alignment:0,line_indent_level:v?v.line_indent_level:X,start_line_index:this._output.get_line_number(),ternary_depth:0};return q},M.prototype._reset=function(v){var H=v.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var X=new p(v,this._options);return this._tokens=X.tokenize(),v},M.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v,H=this._reset(this._source_text),X=this._options.eol;this._options.eol==="auto"&&(X=`
`,H&&c.lineBreak.test(H||"")&&(X=H.match(c.lineBreak)[0]));for(var q=this._tokens.next();q;)this.handle_token(q),this._last_last_text=this._flags.last_token.text,this._flags.last_token=q,q=this._tokens.next();return v=this._output.get_code(X),v},M.prototype.handle_token=function(v,H){v.type===s.START_EXPR?this.handle_start_expr(v):v.type===s.END_EXPR?this.handle_end_expr(v):v.type===s.START_BLOCK?this.handle_start_block(v):v.type===s.END_BLOCK?this.handle_end_block(v):v.type===s.WORD?this.handle_word(v):v.type===s.RESERVED?this.handle_word(v):v.type===s.SEMICOLON?this.handle_semicolon(v):v.type===s.STRING?this.handle_string(v):v.type===s.EQUALS?this.handle_equals(v):v.type===s.OPERATOR?this.handle_operator(v):v.type===s.COMMA?this.handle_comma(v):v.type===s.BLOCK_COMMENT?this.handle_block_comment(v,H):v.type===s.COMMENT?this.handle_comment(v,H):v.type===s.DOT?this.handle_dot(v):v.type===s.EOF?this.handle_eof(v):v.type===s.UNKNOWN?this.handle_unknown(v,H):this.handle_unknown(v,H)},M.prototype.handle_whitespace_and_comments=function(v,H){var X=v.newlines,q=this._options.keep_array_indentation&&w(this._flags.mode);if(v.comments_before)for(var re=v.comments_before.next();re;)this.handle_whitespace_and_comments(re,H),this.handle_token(re,H),re=v.comments_before.next();if(q)for(var ye=0;ye<X;ye+=1)this.print_newline(ye>0,H);else if(this._options.max_preserve_newlines&&X>this._options.max_preserve_newlines&&(X=this._options.max_preserve_newlines),this._options.preserve_newlines&&X>1){this.print_newline(!1,H);for(var pe=1;pe<X;pe+=1)this.print_newline(!0,H)}};var m=["async","break","continue","return","throw","yield"];M.prototype.allow_wrap_or_preserved_newline=function(v,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var X=this._options.preserve_newlines&&v.newlines||H,q=i(this._flags.last_token.text,u)||i(v.text,u);if(q){var re=i(this._flags.last_token.text,u)&&i(this._options.operator_position,h)||i(v.text,u);X=X&&re}if(X)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(R(this._flags.last_token,m))return;this._output.set_wrap_point()}},M.prototype.print_newline=function(v,H){if(!H&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var X=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&S(X,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(v)&&(this._flags.multiline_frame=!0)},M.prototype.print_token_line_indentation=function(v){this._output.just_added_newline()&&(this._options.keep_array_indentation&&v.newlines&&(v.text==="["||w(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(v.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(v){if(this._output.raw){this._output.add_raw_token(v);return}if(this._options.comma_first&&v.previous&&v.previous.type===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(v),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(v),this._output.non_breaking_space=!0,this._output.add_token(v.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(v){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,v),this._flags=this.create_flags(this._previous_flags,v),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===d.Statement&&C(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===d.ObjectLiteral&&this._flags.mode===d.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},M.prototype.start_of_statement=function(v){var H=!1;return H=H||R(this._flags.last_token,["var","let","const"])&&v.type===s.WORD,H=H||S(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&R(this._flags.last_token,m)&&!v.newlines,H=H||S(this._flags.last_token,"else")&&!(S(v,"if")&&!v.comments_before),H=H||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),H=H||this._flags.last_token.type===s.WORD&&this._flags.mode===d.BlockStatement&&!this._flags.in_case&&!(v.text==="--"||v.text==="++")&&this._last_last_text!=="function"&&v.type!==s.WORD&&v.type!==s.RESERVED,H=H||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),H?(this.set_mode(d.Statement),this.indent(),this.handle_whitespace_and_comments(v,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v,R(v,["do","for","if","while"])),!0):!1},M.prototype.handle_start_expr=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v);var H=d.Expression;if(v.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(v),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=d.ArrayLiteral,w(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())),i(this._flags.last_token.type,[s.START_EXPR,s.END_EXPR,s.WORD,s.OPERATOR,s.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===s.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,H=d.ForInitializer):i(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=d.Conditional):i(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&v.whitespace_before===""?this._output.space_before_token=!1:(i(this._flags.last_token.text,l)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var X=this._tokens.peek(-3);if(this._options.space_after_named_function&&X){var q=this._tokens.peek(-4);R(X,["async","function"])||X.text==="*"&&R(q,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?(X.text==="{"||X.text===","||X.text==="*"&&(q.text==="{"||q.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(v);(this._flags.last_token.type===s.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(i(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&i(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===s.START_BLOCK?this.print_newline():(this._flags.last_token.type===s.END_EXPR||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===s.COMMA)&&this.allow_wrap_or_preserved_newline(v,v.newlines),this.print_token(v),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},M.prototype.handle_end_expr=function(v){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(v,v.text==="]"&&w(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===s.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(v),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===d.Conditional&&(this._previous_flags.mode=d.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},M.prototype.handle_start_block=function(v){this.handle_whitespace_and_comments(v);var H=this._tokens.peek(),X=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(d.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(d.BlockStatement):X&&(i(X.text,[":",","])&&i(H.type,[s.STRING,s.WORD,s.RESERVED])||i(H.text,["get","set","..."])&&i(X.type,[s.WORD,s.RESERVED]))?i(this._last_last_text,["class","interface"])&&!i(X.text,[":",","])?this.set_mode(d.BlockStatement):this.set_mode(d.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(d.BlockStatement):i(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(d.ObjectLiteral):this.set_mode(d.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var q=!H.comments_before&&H.text==="}",re=q&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var ye=0,pe=null;this._flags.inline_frame=!0;do if(ye+=1,pe=this._tokens.peek(ye-1),pe.newlines){this._flags.inline_frame=!1;break}while(pe.type!==s.EOF&&!(pe.type===s.END_BLOCK&&pe.opened===v))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(re||this._flags.last_token.type===s.EQUALS||R(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(w(this._previous_flags.mode)&&(this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.COMMA)&&((this._flags.last_token.type===s.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(v),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==s.OPERATOR&&this._flags.last_token.type!==s.START_EXPR&&(this._flags.last_token.type===s.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(v),this.indent(),!q&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},M.prototype.handle_end_block=function(v){for(this.handle_whitespace_and_comments(v);this._flags.mode===d.Statement;)this.restore_mode();var H=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(w(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(v)},M.prototype.handle_word=function(v){if(v.type===s.RESERVED){if(i(v.text,["set","get"])&&this._flags.mode!==d.ObjectLiteral)v.type=s.WORD;else if(v.text==="import"&&i(this._tokens.peek().text,["(","."]))v.type=s.WORD;else if(i(v.text,["as","from"])&&!this._flags.import_block)v.type=s.WORD;else if(this._flags.mode===d.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(v.type=s.WORD)}}if(this.start_of_statement(v)?R(this._flags.last_token,["var","let","const"])&&v.type===s.WORD&&(this._flags.declaration_statement=!0):v.newlines&&!j(this._flags.mode)&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==s.EQUALS&&(this._options.preserve_newlines||!R(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(v),this.print_newline()):this.handle_whitespace_and_comments(v),this._flags.do_block&&!this._flags.do_while)if(S(v,"while")){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&S(v,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===d.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(v,["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(v),this._flags.in_case=!0;return}if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v)),S(v,"function")){(i(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(i(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===s.OPERATOR))&&(!this._output.just_added_blankline()&&!v.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?R(this._flags.last_token,["get","set","new","export"])||R(this._flags.last_token,m)?this._output.space_before_token=!0:S(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(j(this._flags.mode)||w(this._flags.mode))||this.print_newline(),this.print_token(v),this._flags.last_word=v.text;return}var X="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?X="SPACE":R(v,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines?X="NEWLINE":(X="SPACE",this._output.space_before_token=!0):X="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===d.BlockStatement?X="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&j(this._flags.mode)?X="SPACE":this._flags.last_token.type===s.STRING?X="NEWLINE":this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.last_token.text==="*"&&(i(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&i(this._last_last_text,["{",","]))?X="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?X="SPACE":X="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,X="NEWLINE"),R(v,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?X="SPACE":X="NEWLINE"),R(v,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===d.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var q=this._output.current_line;q.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else X==="NEWLINE"?R(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(v,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==s.END_EXPR?(this._flags.last_token.type!==s.START_EXPR||!R(v,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(v,"if")&&S(v.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(v,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&w(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():X==="SPACE"&&(this._output.space_before_token=!0);v.previous&&(v.previous.type===s.WORD||v.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(v),this._flags.last_word=v.text,v.type===s.RESERVED&&(v.text==="do"?this._flags.do_block=!0:v.text==="if"?this._flags.if_block=!0:v.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(v,"from")&&(this._flags.import_block=!1))},M.prototype.handle_semicolon=function(v){this.start_of_statement(v)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(v);for(var H=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&S(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(v)},M.prototype.handle_string=function(v){v.text.startsWith("`")&&v.newlines===0&&v.whitespace_before===""&&(v.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(v)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(v),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v):v.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(v.previous.text==="]"||v.previous.text===")")&&v.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(v)},M.prototype.handle_equals=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0},M.prototype.handle_comma=function(v){this.handle_whitespace_and_comments(v,!0),this.print_token(v),this._output.space_before_token=!0,this._flags.declaration_statement?(j(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(v)):this._flags.mode===d.ObjectLiteral||this._flags.mode===d.Statement&&this._flags.parent.mode===d.ObjectLiteral?(this._flags.mode===d.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(v)},M.prototype.handle_operator=function(v){var H=v.text==="*"&&(R(this._flags.last_token,["function","yield"])||i(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),X=i(v.text,["-","+"])&&(i(this._flags.last_token.type,[s.START_BLOCK,s.START_EXPR,s.EQUALS,s.OPERATOR])||i(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(v)){var q=!H;this.handle_whitespace_and_comments(v,q)}if(v.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(v);return}if(v.text==="::"){this.print_token(v);return}if(this._flags.last_token.type===s.OPERATOR&&i(this._options.operator_position,h)&&this.allow_wrap_or_preserved_newline(v),v.text===":"&&this._flags.in_case){this.print_token(v),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==s.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var re=!0,ye=!0,pe=!1;if(v.text===":"?this._flags.ternary_depth===0?re=!1:(this._flags.ternary_depth-=1,pe=!0):v.text==="?"&&(this._flags.ternary_depth+=1),!X&&!H&&this._options.preserve_newlines&&i(v.text,u)){var ue=v.text===":",fe=ue&&pe,be=ue&&!pe;switch(this._options.operator_position){case _.before_newline:this._output.space_before_token=!be,this.print_token(v),(!ue||fe)&&this.allow_wrap_or_preserved_newline(v),this._output.space_before_token=!0;return;case _.after_newline:this._output.space_before_token=!0,!ue||fe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(v):this._output.space_before_token=!1,this.print_token(v),this._output.space_before_token=!0;return;case _.preserve_newline:be||this.allow_wrap_or_preserved_newline(v),re=!(this._output.just_added_newline()||be),this._output.space_before_token=re,this.print_token(v),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(v),re=!1;var se=this._tokens.peek();ye=se&&i(se.type,[s.WORD,s.RESERVED])}else if(v.text==="...")this.allow_wrap_or_preserved_newline(v),re=this._flags.last_token.type===s.START_BLOCK,ye=!1;else if(i(v.text,["--","++","!","~"])||X){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(v),re=!1,ye=!1,v.newlines&&(v.text==="--"||v.text==="++"||v.text==="~")){var ae=R(this._flags.last_token,O)&&v.newlines;ae&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ae,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(re=!0),this._flags.last_token.type===s.RESERVED?re=!0:this._flags.last_token.type===s.END_EXPR?re=!(this._flags.last_token.text==="]"&&(v.text==="--"||v.text==="++")):this._flags.last_token.type===s.OPERATOR&&(re=i(v.text,["--","-","++","+"])&&i(this._flags.last_token.text,["--","-","++","+"]),i(v.text,["+","-"])&&i(this._flags.last_token.text,["--","++"])&&(ye=!0)),(this._flags.mode===d.BlockStatement&&!this._flags.inline_frame||this._flags.mode===d.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||re,this.print_token(v),this._output.space_before_token=ye},M.prototype.handle_block_comment=function(v,H){if(this._output.raw){this._output.add_raw_token(v),v.directives&&v.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(v.directives){this.print_newline(!1,H),this.print_token(v),v.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(v.text)&&!v.newlines){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0;return}else this.print_block_commment(v,H)},M.prototype.print_block_commment=function(v,H){var X=x(v.text),q,re=!1,ye=!1,pe=v.whitespace_before,ue=pe.length;if(this.print_newline(!1,H),this.print_token_line_indentation(v),this._output.add_token(X[0]),this.print_newline(!1,H),X.length>1){for(X=X.slice(1),re=W(X,"*"),ye=T(X,pe),re&&(this._flags.alignment=1),q=0;q<X.length;q++)re?(this.print_token_line_indentation(v),this._output.add_token(D(X[q]))):ye&&X[q]?(this.print_token_line_indentation(v),this._output.add_token(X[q].substring(ue))):(this._output.current_line.set_indent(-1),this._output.add_token(X[q])),this.print_newline(!1,H);this._flags.alignment=0}},M.prototype.handle_comment=function(v,H){v.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(v),this.print_newline(!1,H)},M.prototype.handle_dot=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),R(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(v,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(v)},M.prototype.handle_unknown=function(v,H){this.print_token(v),v.text[v.text.length-1]===`
`&&this.print_newline(!1,H)},M.prototype.handle_eof=function(v){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v)},n.exports.Beautifier=M},function(n){function I(b){this.__parent=b,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=[]}I.prototype.clone_empty=function(){var b=new I(this.__parent);return b.set_indent(this.__indent_count,this.__alignment_count),b},I.prototype.item=function(b){return b<0?this.__items[this.__items.length+b]:this.__items[b]},I.prototype.has_match=function(b){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(b))return!0;return!1},I.prototype.set_indent=function(b,c){this.is_empty()&&(this.__indent_count=b||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.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)},I.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},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var b=this.__parent.current_line;return b.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),b.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),b.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,b.__items[0]===" "&&(b.__items.splice(0,1),b.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(b){this.__items.push(b);var c=b.lastIndexOf(`
`);c!==-1?this.__character_count=b.length-c:this.__character_count+=b.length},I.prototype.pop=function(){var b=null;return this.is_empty()||(b=this.__items.pop(),this.__character_count-=b.length),b},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var b="";return this.is_empty()?this.__parent.indent_empty_lines&&(b=this.__parent.get_indent_string(this.__indent_count)):(b=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),b+=this.__items.join("")),b};function E(b,c){this.__cache=[""],this.__indent_size=b.indent_size,this.__indent_string=b.indent_char,b.indent_with_tabs||(this.__indent_string=new Array(b.indent_size+1).join(b.indent_char)),c=c||"",b.indent_level>0&&(c=new Array(b.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}E.prototype.get_indent_size=function(b,c){var a=this.__base_string_length;return c=c||0,b<0&&(a=0),a+=b*this.__indent_size,a+=c,a},E.prototype.get_indent_string=function(b,c){var a=this.__base_string;return c=c||0,b<0&&(b=0,a=""),c+=b*this.__indent_size,this.__ensure_cache(c),a+=this.__cache[c],a},E.prototype.__ensure_cache=function(b){for(;b>=this.__cache.length;)this.__add_column()},E.prototype.__add_column=function(){var b=this.__cache.length,c=0,a="";this.__indent_size&&b>=this.__indent_size&&(c=Math.floor(b/this.__indent_size),b-=c*this.__indent_size,a=new Array(c+1).join(this.__indent_string)),b&&(a+=new Array(b+1).join(" ")),this.__cache.push(a)};function f(b,c){this.__indent_cache=new E(b,c),this.raw=!1,this._end_with_newline=b.end_with_newline,this.indent_size=b.indent_size,this.wrap_line_length=b.wrap_line_length,this.indent_empty_lines=b.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(b,c){return this.__indent_cache.get_indent_string(b,c)},f.prototype.get_indent_size=function(b,c){return this.__indent_cache.get_indent_size(b,c)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(b){return this.is_empty()||!b&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(b){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return b!==`
`&&(a=a.replace(/[\n]/g,b)),a},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(b,c){return b=b||0,c=c||0,this.next_line.set_indent(b,c),this.__lines.length>1?(this.current_line.set_indent(b,c),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(b){for(var c=0;c<b.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(b.whitespace_before),this.current_line.push(b.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(b){this.__add_space_before_token(),this.current_line.push(b),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.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(" "))},f.prototype.remove_indent=function(b){for(var c=this.__lines.length;b<c;)this.__lines[b]._remove_indent(),b++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(b){for(b=b===void 0?!1:b,this.current_line.trim();b&&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},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(b,c){for(var a=this.__lines.length-2;a>=0;){var p=this.__lines[a];if(p.is_empty())break;if(p.item(0).indexOf(b)!==0&&p.item(-1)!==c){this.__lines.splice(a+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},n.exports.Output=f},function(n){function I(E,f,b,c){this.type=E,this.text=f,this.comments_before=null,this.newlines=b||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=I},function(n,I){var E="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",b="\\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",c="\\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}|["+E+b+"])",p="(?:\\\\u[0-9a-fA-F]{4}|["+f+b+c+"])*";I.identifier=new RegExp(a+p,"g"),I.identifierStart=new RegExp(a),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+b+c+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;I.newline=/[\n\r\u2028\u2029]/,I.lineBreak=new RegExp(`\r
|`+I.newline.source),I.allLineBreaks=new RegExp(I.lineBreak.source,"g")},function(n,I,E){var f=E(6).Options,b=["before-newline","after-newline","preserve-newline"];function c(a){f.call(this,a,"js");var p=this.raw_options.brace_style||null;p==="expand-strict"?this.raw_options.brace_style="expand":p==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var u=0;u<l.length;u++)l[u]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[u];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",b),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}c.prototype=new f,n.exports.Options=c},function(n){function I(b,c){this.raw_options=E(b,c),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"])}I.prototype._get_array=function(b,c){var a=this.raw_options[b],p=c||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(p=a.concat()):typeof a=="string"&&(p=a.split(/[^a-zA-Z0-9_\/\-]+/)),p},I.prototype._get_boolean=function(b,c){var a=this.raw_options[b],p=a===void 0?!!c:!!a;return p},I.prototype._get_characters=function(b,c){var a=this.raw_options[b],p=c||"";return typeof a=="string"&&(p=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),p},I.prototype._get_number=function(b,c){var a=this.raw_options[b];c=parseInt(c,10),isNaN(c)&&(c=0);var p=parseInt(a,10);return isNaN(p)&&(p=c),p},I.prototype._get_selection=function(b,c,a){var p=this._get_selection_list(b,c,a);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+b+`' can only be one of the following values:
`+c+`
You passed in: '`+this.raw_options[b]+"'");return p[0]},I.prototype._get_selection_list=function(b,c,a){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[c[0]],!this._is_valid_selection(a,c))throw new Error("Invalid Default Value!");var p=this._get_array(b,a);if(!this._is_valid_selection(p,c))throw new Error("Invalid Option Value: The option '"+b+`' can contain only the following values:
`+c+`
You passed in: '`+this.raw_options[b]+"'");return p},I.prototype._is_valid_selection=function(b,c){return b.length&&c.length&&!b.some(function(a){return c.indexOf(a)===-1})};function E(b,c){var a={};b=f(b);var p;for(p in b)p!==c&&(a[p]=b[p]);if(c&&b[c])for(p in b[c])a[p]=b[c][p];return a}function f(b){var c={},a;for(a in b){var p=a.replace(/-/g,"_");c[p]=b[a]}return c}n.exports.Options=I,n.exports.normalizeOpts=f,n.exports.mergeOpts=E},function(n,I,E){var f=E(8).InputScanner,b=E(9).Tokenizer,c=E(9).TOKEN,a=E(13).Directives,p=E(4),l=E(12).Pattern,u=E(14).TemplatablePattern;function s(W,T){return T.indexOf(W)!==-1}var i={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:c.START,RAW:c.RAW,EOF:c.EOF},D=new a(/\/\*/,/\*\//),A=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,S=/[0-9]/,R=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),g=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";g=g.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),g="\\?\\.(?!\\d) "+g,g=g.replace(/ /g,"|");var _=new RegExp(g),h="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),d=h.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+d.join("|")+")$"),x,w=function(W,T){b.call(this,W,T),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var M=new l(this._input),m=new u(this._input).read_options(this._options);this.__patterns={template:m,identifier:m.starting_with(p.identifier).matching(p.identifierMatch),number:M.matching(A),punct:M.matching(_),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(p.lineBreak),shebang:M.starting_with(/#!/).until_after(p.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:m.until(/['\\\n\r\u2028\u2029]/),double_quote:m.until(/["\\\n\r\u2028\u2029]/),template_text:m.until(/[`\\$]/),template_expression:m.until(/[`}\\]/)}};w.prototype=new b,w.prototype._is_comment=function(W){return W.type===i.COMMENT||W.type===i.BLOCK_COMMENT||W.type===i.UNKNOWN},w.prototype._is_opening=function(W){return W.type===i.START_BLOCK||W.type===i.START_EXPR},w.prototype._is_closing=function(W,T){return(W.type===i.END_BLOCK||W.type===i.END_EXPR)&&T&&(W.text==="]"&&T.text==="["||W.text===")"&&T.text==="("||W.text==="}"&&T.text==="{")},w.prototype._reset=function(){x=!1},w.prototype._get_next_token=function(W,T){var M=null;this._readWhitespace();var m=this._input.peek();return m===null?this._create_token(i.EOF,""):(M=M||this._read_non_javascript(m),M=M||this._read_string(m),M=M||this._read_word(W),M=M||this._read_singles(m),M=M||this._read_comment(m),M=M||this._read_regexp(m,W),M=M||this._read_xml(m,W),M=M||this._read_punctuation(),M=M||this._create_token(i.UNKNOWN,this._input.next()),M)},w.prototype._read_word=function(W){var T;if(T=this.__patterns.identifier.read(),T!=="")return T=T.replace(p.allLineBreaks,`
`),!(W.type===i.DOT||W.type===i.RESERVED&&(W.text==="set"||W.text==="get"))&&C.test(T)?(T==="in"||T==="of")&&(W.type===i.WORD||W.type===i.STRING)?this._create_token(i.OPERATOR,T):this._create_token(i.RESERVED,T):this._create_token(i.WORD,T);if(T=this.__patterns.number.read(),T!=="")return this._create_token(i.WORD,T)},w.prototype._read_singles=function(W){var T=null;return W==="("||W==="["?T=this._create_token(i.START_EXPR,W):W===")"||W==="]"?T=this._create_token(i.END_EXPR,W):W==="{"?T=this._create_token(i.START_BLOCK,W):W==="}"?T=this._create_token(i.END_BLOCK,W):W===";"?T=this._create_token(i.SEMICOLON,W):W==="."&&R.test(this._input.peek(1))?T=this._create_token(i.DOT,W):W===","&&(T=this._create_token(i.COMMA,W)),T&&this._input.next(),T},w.prototype._read_punctuation=function(){var W=this.__patterns.punct.read();if(W!=="")return W==="="?this._create_token(i.EQUALS,W):W==="?."?this._create_token(i.DOT,W):this._create_token(i.OPERATOR,W)},w.prototype._read_non_javascript=function(W){var T="";if(W==="#"){if(this._is_first_token()&&(T=this.__patterns.shebang.read(),T))return this._create_token(i.UNKNOWN,T.trim()+`
`);if(T=this.__patterns.include.read(),T)return this._create_token(i.UNKNOWN,T.trim()+`
`);W=this._input.next();var M="#";if(this._input.hasNext()&&this._input.testChar(S)){do W=this._input.next(),M+=W;while(this._input.hasNext()&&W!=="#"&&W!=="=");return W==="#"||(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(i.WORD,M)}this._input.back()}else if(W==="<"&&this._is_first_token()){if(T=this.__patterns.html_comment_start.read(),T){for(;this._input.hasNext()&&!this._input.testChar(p.newline);)T+=this._input.next();return x=!0,this._create_token(i.COMMENT,T)}}else if(x&&W==="-"&&(T=this.__patterns.html_comment_end.read(),T))return x=!1,this._create_token(i.COMMENT,T);return null},w.prototype._read_comment=function(W){var T=null;if(W==="/"){var M="";if(this._input.peek(1)==="*"){M=this.__patterns.block_comment.read();var m=D.get_directives(M);m&&m.ignore==="start"&&(M+=D.readIgnored(this._input)),M=M.replace(p.allLineBreaks,`
`),T=this._create_token(i.BLOCK_COMMENT,M),T.directives=m}else this._input.peek(1)==="/"&&(M=this.__patterns.comment.read(),T=this._create_token(i.COMMENT,M))}return T},w.prototype._read_string=function(W){if(W==="`"||W==="'"||W==='"'){var T=this._input.next();return this.has_char_escapes=!1,W==="`"?T+=this._read_string_recursive("`",!0,"${"):T+=this._read_string_recursive(W),this.has_char_escapes&&this._options.unescape_strings&&(T=j(T)),this._input.peek()===W&&(T+=this._input.next()),T=T.replace(p.allLineBreaks,`
`),this._create_token(i.STRING,T)}return null},w.prototype._allow_regexp_or_xml=function(W){return W.type===i.RESERVED&&s(W.text,["return","case","throw","else","do","typeof","yield"])||W.type===i.END_EXPR&&W.text===")"&&W.opened.previous.type===i.RESERVED&&s(W.opened.previous.text,["if","while","for"])||s(W.type,[i.COMMENT,i.START_EXPR,i.START_BLOCK,i.START,i.END_BLOCK,i.OPERATOR,i.EQUALS,i.EOF,i.SEMICOLON,i.COMMA])},w.prototype._read_regexp=function(W,T){if(W==="/"&&this._allow_regexp_or_xml(T)){for(var M=this._input.next(),m=!1,v=!1;this._input.hasNext()&&(m||v||this._input.peek()!==W)&&!this._input.testChar(p.newline);)M+=this._input.peek(),m?m=!1:(m=this._input.peek()==="\\",this._input.peek()==="["?v=!0:this._input.peek()==="]"&&(v=!1)),this._input.next();return this._input.peek()===W&&(M+=this._input.next(),M+=this._input.read(p.identifier)),this._create_token(i.STRING,M)}return null},w.prototype._read_xml=function(W,T){if(this._options.e4x&&W==="<"&&this._allow_regexp_or_xml(T)){var M="",m=this.__patterns.xml.read_match();if(m){for(var v=m[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=v.indexOf("{")===0,X=0;m;){var q=!!m[1],re=m[2],ye=!!m[m.length-1]||re.slice(0,8)==="![CDATA[";if(!ye&&(re===v||H&&re.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(q?--X:++X),M+=m[0],X<=0)break;m=this.__patterns.xml.read_match()}return m||(M+=this._input.match(/[\s\S]*/g)[0]),M=M.replace(p.allLineBreaks,`
`),this._create_token(i.STRING,M)}}return null};function j(W){for(var T="",M=0,m=new f(W),v=null;m.hasNext();)if(v=m.match(/([\s]|[^\\]|\\\\)+/g),v&&(T+=v[0]),m.peek()==="\\"){if(m.next(),m.peek()==="x")v=m.match(/x([0-9A-Fa-f]{2})/g);else if(m.peek()==="u")v=m.match(/u([0-9A-Fa-f]{4})/g);else{T+="\\",m.hasNext()&&(T+=m.next());continue}if(!v)return W;if(M=parseInt(v[1],16),M>126&&M<=255&&v[0].indexOf("x")===0)return W;if(M>=0&&M<32){T+="\\"+v[0];continue}else M===34||M===39||M===92?T+="\\"+String.fromCharCode(M):T+=String.fromCharCode(M)}return T}w.prototype._read_string_recursive=function(W,T,M){var m,v;W==="'"?v=this.__patterns.single_quote:W==='"'?v=this.__patterns.double_quote:W==="`"?v=this.__patterns.template_text:W==="}"&&(v=this.__patterns.template_expression);for(var H=v.read(),X="";this._input.hasNext();){if(X=this._input.next(),X===W||!T&&p.newline.test(X)){this._input.back();break}else X==="\\"&&this._input.hasNext()?(m=this._input.peek(),m==="x"||m==="u"?this.has_char_escapes=!0:m==="\r"&&this._input.peek(1)===`
`&&this._input.next(),X+=this._input.next()):M&&(M==="${"&&X==="$"&&this._input.peek()==="{"&&(X+=this._input.next()),M===X&&(W==="`"?X+=this._read_string_recursive("}",T,"`"):X+=this._read_string_recursive("`",T,"${"),this._input.hasNext()&&(X+=this._input.next())));X+=v.read(),H+=X}return H},n.exports.Tokenizer=w,n.exports.TOKEN=i,n.exports.positionable_operators=O.slice(),n.exports.line_starters=h.slice()},function(n){var I=RegExp.prototype.hasOwnProperty("sticky");function E(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}E.prototype.restart=function(){this.__position=0},E.prototype.back=function(){this.__position>0&&(this.__position-=1)},E.prototype.hasNext=function(){return this.__position<this.__input_length},E.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},E.prototype.peek=function(f){var b=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(b=this.__input.charAt(f)),b},E.prototype.__match=function(f,b){f.lastIndex=b;var c=f.exec(this.__input);return c&&!(I&&f.sticky)&&(c.index!==b&&(c=null)),c},E.prototype.test=function(f,b){return b=b||0,b+=this.__position,b>=0&&b<this.__input_length?!!this.__match(f,b):!1},E.prototype.testChar=function(f,b){var c=this.peek(b);return f.lastIndex=0,c!==null&&f.test(c)},E.prototype.match=function(f){var b=this.__match(f,this.__position);return b?this.__position+=b[0].length:b=null,b},E.prototype.read=function(f,b,c){var a="",p;return f&&(p=this.match(f),p&&(a+=p[0])),b&&(p||!f)&&(a+=this.readUntil(b,c)),a},E.prototype.readUntil=function(f,b){var c="",a=this.__position;f.lastIndex=this.__position;var p=f.exec(this.__input);return p?(a=p.index,b&&(a+=p[0].length)):a=this.__input_length,c=this.__input.substring(this.__position,a),this.__position=a,c},E.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},E.prototype.get_regexp=function(f,b){var c=null,a="g";return b&&I&&(a="y"),typeof f=="string"&&f!==""?c=new RegExp(f,a):f&&(c=new RegExp(f.source,a)),c},E.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},E.prototype.peekUntilAfter=function(f){var b=this.__position,c=this.readUntilAfter(f);return this.__position=b,c},E.prototype.lookBack=function(f){var b=this.__position-1;return b>=f.length&&this.__input.substring(b-f.length,b).toLowerCase()===f},n.exports.InputScanner=E},function(n,I,E){var f=E(8).InputScanner,b=E(3).Token,c=E(10).TokenStream,a=E(11).WhitespacePattern,p={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(u,s){this._input=new f(u),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var u,s=new b(p.START,""),i=null,D=[],A=new c;s.type!==p.EOF;){for(u=this._get_next_token(s,i);this._is_comment(u);)A.add(u),u=this._get_next_token(s,i);A.isEmpty()||(u.comments_before=A,A=new c),u.parent=i,this._is_opening(u)?(D.push(i),i=u):i&&this._is_closing(u,i)&&(u.opened=i,i.closed=u,i=D.pop(),u.parent=i),u.previous=s,s.next=u,this.__tokens.add(u),s=u}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(u,s){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(p.RAW,i):this._create_token(p.EOF,"")},l.prototype._is_comment=function(u){return!1},l.prototype._is_opening=function(u){return!1},l.prototype._is_closing=function(u,s){return!1},l.prototype._create_token=function(u,s){var i=new b(u,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return i},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=l,n.exports.TOKEN=p},function(n){function I(E){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=E}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position<this.__tokens_length},I.prototype.next=function(){var E=null;return this.hasNext()&&(E=this.__tokens[this.__position],this.__position+=1),E},I.prototype.peek=function(E){var f=null;return E=E||0,E+=this.__position,E>=0&&E<this.__tokens_length&&(f=this.__tokens[E]),f},I.prototype.add=function(E){this.__parent_token&&(E.parent=this.__parent_token),this.__tokens.push(E),this.__tokens_length+=1},n.exports.TokenStream=I},function(n,I,E){var f=E(12).Pattern;function b(c,a){f.call(this,c,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}b.prototype=new f,b.prototype.__set_whitespace_patterns=function(c,a){c+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},b.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var c=this._input.read(this._match_pattern);if(c===" ")this.whitespace_before_token=" ";else if(c){var a=this.__split(this._newline_regexp,c);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return c},b.prototype.matching=function(c,a){var p=this._create();return p.__set_whitespace_patterns(c,a),p._update(),p},b.prototype._create=function(){return new b(this._input,this)},b.prototype.__split=function(c,a){c.lastIndex=0;for(var p=0,l=[],u=c.exec(a);u;)l.push(a.substring(p,u.index)),p=u.index+u[0].length,u=c.exec(a);return p<a.length?l.push(a.substring(p,a.length)):l.push(""),l},n.exports.WhitespacePattern=b},function(n){function I(E,f){this._input=E,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,f&&(this._starting_pattern=this._input.get_regexp(f._starting_pattern,!0),this._match_pattern=this._input.get_regexp(f._match_pattern,!0),this._until_pattern=this._input.get_regexp(f._until_pattern),this._until_after=f._until_after)}I.prototype.read=function(){var E=this._input.read(this._starting_pattern);return(!this._starting_pattern||E)&&(E+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),E},I.prototype.read_match=function(){return this._input.match(this._match_pattern)},I.prototype.until_after=function(E){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(E),f._update(),f},I.prototype.until=function(E){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(E),f._update(),f},I.prototype.starting_with=function(E){var f=this._create();return f._starting_pattern=this._input.get_regexp(E,!0),f._update(),f},I.prototype.matching=function(E){var f=this._create();return f._match_pattern=this._input.get_regexp(E,!0),f._update(),f},I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){},n.exports.Pattern=I},function(n){function I(E,f){E=typeof E=="string"?E:E.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(E+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(E+/\sbeautify\signore:end\s/.source+f,"g")}I.prototype.get_directives=function(E){if(!E.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var b=this.__directive_pattern.exec(E);b;)f[b[1]]=b[2],b=this.__directive_pattern.exec(E);return f},I.prototype.readIgnored=function(E){return E.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=I},function(n,I,E){var f=E(12).Pattern,b={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(a,p){f.call(this,a,p),this.__template_pattern=null,this._disabled=Object.assign({},b),this._excluded=Object.assign({},b),p&&(this.__template_pattern=this._input.get_regexp(p.__template_pattern),this._excluded=Object.assign(this._excluded,p._excluded),this._disabled=Object.assign(this._disabled,p._disabled));var l=new f(a);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}c.prototype=new f,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(a){var p=this._create();return p._disabled[a]=!0,p._update(),p},c.prototype.read_options=function(a){var p=this._create();for(var l in b)p._disabled[l]=a.templating.indexOf(l)===-1;return p._update(),p},c.prototype.exclude=function(a){var p=this._create();return p._excluded[a]=!0,p._update(),p},c.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 p=this._read_template();p;)this._match_pattern?p+=this._input.read(this._match_pattern):p+=this._input.readUntil(this.__template_pattern),a+=p,p=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},c.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("|")+")")},c.prototype._read_template=function(){var a="",p=this._input.peek();if(p==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(a=a||this.__patterns.erb.read())}else p==="{"&&(!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=c}],F={};function G(n){var I=F[n];if(I!==void 0)return I.exports;var E=F[n]={exports:{}};return P[n](E,E.exports,G),E.exports}var K=G(0);N=K})();var z=N;!(te=[],Y=function(){return{js_beautify:z}}.apply(ge,te),Y!==void 0&&(ct.exports=Y))})()},"746U":function(ct,ge,U){"use strict";U.d(ge,"f",function(){return te}),U.d(ge,"l",function(){return Y}),U.d(ge,"k",function(){return N}),U.d(ge,"j",function(){return z}),U.d(ge,"g",function(){return P}),U.d(ge,"m",function(){return F}),U.d(ge,"h",function(){return G}),U.d(ge,"n",function(){return K}),U.d(ge,"c",function(){return n}),U.d(ge,"a",function(){return I}),U.d(ge,"i",function(){return E}),U.d(ge,"o",function(){return f}),U.d(ge,"e",function(){return a}),U.d(ge,"d",function(){return p}),U.d(ge,"p",function(){return l}),U.d(ge,"b",function(){return u});function te(s){return Array.isArray(s)}function Y(s){return typeof s=="string"}function N(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function z(s){return typeof s=="number"&&!isNaN(s)}function P(s){return s===!0||s===!1}function F(s){return typeof s=="undefined"}function G(s){return!K(s)}function K(s){return F(s)||s===null}function n(s,i){if(!s)throw new Error(i?`Unexpected type, expected '${i}'`:"Unexpected type")}function I(s){if(K(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function E(s){return typeof s=="function"}function f(s,i){const D=Math.min(s.length,i.length);for(let A=0;A<D;A++)b(s[A],i[A])}function b(s,i){if(Y(i)){if(typeof s!==i)throw new Error(`argument does not match constraint: typeof ${i}`)}else if(E(i)){try{if(s instanceof i)return}catch(D){}if(!K(s)&&s.constructor===i)return;if(i.length===1&&i.call(void 0,s)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function c(s){let i=[],D=Object.getPrototypeOf(s);for(;Object.prototype!==D;)i=i.concat(Object.getOwnPropertyNames(D)),D=Object.getPrototypeOf(D);return i}function a(s){const i=[];for(const D of c(s))typeof s[D]=="function"&&i.push(D);return i}function p(s,i){const D=S=>function(){const R=Array.prototype.slice.call(arguments,0);return i(S,R)};let A={};for(const S of s)A[S]=D(S);return A}function l(s){return s===null?void 0:s}function u(s,i="Unreachable"){throw new Error(i)}},"7Cbv":function(ct,ge,U){"use strict";var te=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Y=new Uint8Array(16);function N(){if(!te)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return te(Y)}var z=/^(?:[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 P(b){return typeof b=="string"&&z.test(b)}for(var F=P,G=[],K=0;K<256;++K)G.push((K+256).toString(16).substr(1));function n(b){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(G[b[c+0]]+G[b[c+1]]+G[b[c+2]]+G[b[c+3]]+"-"+G[b[c+4]]+G[b[c+5]]+"-"+G[b[c+6]]+G[b[c+7]]+"-"+G[b[c+8]]+G[b[c+9]]+"-"+G[b[c+10]]+G[b[c+11]]+G[b[c+12]]+G[b[c+13]]+G[b[c+14]]+G[b[c+15]]).toLowerCase();if(!F(a))throw TypeError("Stringified UUID is invalid");return a}var I=n;function E(b,c,a){b=b||{};var p=b.random||(b.rng||N)();if(p[6]=p[6]&15|64,p[8]=p[8]&63|128,c){a=a||0;for(var l=0;l<16;++l)c[a+l]=p[l];return c}return I(p)}var f=ge.a=E},"7ahc":function(ct,ge,U){"use strict";U.d(ge,"a",function(){return D});var te=U("k1fw"),Y=U("0Owb"),N=U("+L6B"),z=U("2/Rp"),P=U("y8nQ"),F=U("Vl3Y"),G=U("tJVT"),K=U("OaEy"),n=U("2fM7"),I=U("q1tI"),E=U.n(I),f=U("VrN/"),b=U.n(f),c=U("p77/"),a=U.n(c),p=U("c5Ni"),l=U.n(p),u=n.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},i={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};ge.b=function(A){var S=A.callback,R=A.onCancel,O=Object(I.useState)("python"),g=Object(G.a)(O,2),_=g[0],h=g[1];function d(x){h(i[x][1])}function C(x){S(x)}return E.a.createElement(F.a,Object(Y.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),E.a.createElement(F.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},E.a.createElement(n.a,{onChange:d},Object.keys(i).map(function(x){return E.a.createElement(u,{key:x,value:x},i[x][0])}))),E.a.createElement(F.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},E.a.createElement(D,{mode:_})),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(z.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function D(A){var S=A.value,R=A.onChange,O=A.mode,g=A.options,_=g===void 0?{}:g,h=Object(I.useRef)(),d=Object(I.useState)(),C=Object(G.a)(d,2),x=C[0],w=C[1];return Object(I.useEffect)(function(){if(x){function j(W){var T=W.getValue();R&&R(T)}return x.on("change",j),function(){x.off("change",j)}}},[x,R]),Object(I.useEffect)(function(){x&&x.setOption("mode",O)},[x,O]),Object(I.useEffect)(function(){x&&((S!==x.getValue()||S==="")&&setTimeout(function(){x.setValue(S||" ")},300))},[x,S]),Object(I.useEffect)(function(){if(h.current&&!x){var j=b.a.fromTextArea(h.current,Object(te.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},_));w(j)}},[h.current,x]),E.a.createElement("div",{className:"my-codemirror-container"},E.a.createElement("textarea",{ref:h}))}},"815F":function(ct,ge,U){"use strict";U.d(ge,"e",function(){return G}),U.d(ge,"c",function(){return n}),U.d(ge,"d",function(){return I}),U.d(ge,"a",function(){return f}),U.d(ge,"f",function(){return b}),U.d(ge,"b",function(){return c});var te=U("KQm4"),Y=U("VTBJ"),N=U("Ff2n"),z=U("Zm9Q"),P=U("Kwbf"),F=U("OZM5");function G(a,p){return a!=null?a:p}function K(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=new Map;function l(u){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(u||[]).forEach(function(i){var D=i.key,A=i.children;Object(P.a)(D!=null,"Tree node must have a certain key: [".concat(s).concat(D,"]"));var S=String(D);Object(P.a)(!p.has(S)||D===null||D===void 0,"Same 'key' exist in the Tree: ".concat(S)),p.set(S,!0),l(A,"".concat(s).concat(S," > "))})}l(a)}function n(a){function p(l){var u=Object(z.a)(l);return u.map(function(s){if(!Object(F.i)(s))return Object(P.a)(!s,"Tree/TreeNode can only accept TreeNode as children."),null;var i=s.key,D=s.props,A=D.children,S=Object(N.a)(D,["children"]),R=Object(Y.a)({key:i},S),O=p(A);return O.length&&(R.children=O),R}).filter(function(s){return s})}return p(a)}function I(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],l=new Set(p===!0?[]:p),u=[];function s(i){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return i.map(function(A,S){var R=Object(F.h)(D?D.pos:"0",S),O=G(A.key,R),g=Object(Y.a)(Object(Y.a)({},A),{},{parent:D,pos:R,children:null,data:A,isStart:[].concat(Object(te.a)(D?D.isStart:[]),[S===0]),isEnd:[].concat(Object(te.a)(D?D.isEnd:[]),[S===i.length-1])});return u.push(g),p===!0||l.has(O)?g.children=s(A.children||[],g):g.children=[],g})}return s(a),u}function E(a,p,l){var u;l?typeof l=="string"?u=function(D){return D[l]}:typeof l=="function"&&(u=function(D){return l(D)}):u=function(D,A){return G(D.key,A)};function s(i,D,A){var S=i?i.children:a,R=i?Object(F.h)(A.pos,D):"0";if(i){var O=u(i,R),g={node:i,index:D,pos:R,key:O,parentPos:A.node?A.pos:null,level:A.level+1};p(g)}S&&S.forEach(function(_,h){s(_,h,{node:i,pos:R,level:A?A.level+1:-1})})}s(null)}function f(a){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=p.initWrapper,u=p.processEntity,s=p.onProcessFinished,i=arguments.length>2?arguments[2]:void 0,D={},A={},S={posEntities:D,keyEntities:A};return l&&(S=l(S)||S),E(a,function(R){var O=R.node,g=R.index,_=R.pos,h=R.key,d=R.parentPos,C=R.level,x={node:O,index:g,key:h,pos:_,level:C},w=G(h,_);D[_]=x,A[w]=x,x.parent=D[d],x.parent&&(x.parent.children=x.parent.children||[],x.parent.children.push(x)),u&&u(x,S)},i),s&&s(S),S}function b(a,p){var l=p.expandedKeys,u=p.selectedKeys,s=p.loadedKeys,i=p.loadingKeys,D=p.checkedKeys,A=p.halfCheckedKeys,S=p.dragOverNodeKey,R=p.dropPosition,O=p.keyEntities,g=O[a],_={eventKey:a,expanded:l.indexOf(a)!==-1,selected:u.indexOf(a)!==-1,loaded:s.indexOf(a)!==-1,loading:i.indexOf(a)!==-1,checked:D.indexOf(a)!==-1,halfChecked:A.indexOf(a)!==-1,pos:String(g?g.pos:""),dragOver:S===a&&R===0,dragOverGapTop:S===a&&R===-1,dragOverGapBottom:S===a&&R===1};return _}function c(a){var p=a.data,l=a.expanded,u=a.selected,s=a.checked,i=a.loaded,D=a.loading,A=a.halfChecked,S=a.dragOver,R=a.dragOverGapTop,O=a.dragOverGapBottom,g=a.pos,_=a.active,h=Object(Y.a)(Object(Y.a)({},p),{},{expanded:l,selected:u,checked:s,loaded:i,loading:D,halfChecked:A,dragOver:S,dragOverGapTop:R,dragOverGapBottom:O,pos:g,active:_});return"props"in h||Object.defineProperty(h,"props",{get:function(){return Object(P.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),a}}),h}},"8EBN":function(ct,ge,U){(function(te){te(U("VrN/"))})(function(te){"use strict";te.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 Y=0;Y<te.modeInfo.length;Y++){var N=te.modeInfo[Y];N.mimes&&(N.mime=N.mimes[0])}te.findModeByMIME=function(z){z=z.toLowerCase();for(var P=0;P<te.modeInfo.length;P++){var F=te.modeInfo[P];if(F.mime==z)return F;if(F.mimes){for(var G=0;G<F.mimes.length;G++)if(F.mimes[G]==z)return F}}if(/\+xml$/.test(z))return te.findModeByMIME("application/xml");if(/\+json$/.test(z))return te.findModeByMIME("application/json")},te.findModeByExtension=function(z){z=z.toLowerCase();for(var P=0;P<te.modeInfo.length;P++){var F=te.modeInfo[P];if(F.ext){for(var G=0;G<F.ext.length;G++)if(F.ext[G]==z)return F}}},te.findModeByFileName=function(z){for(var P=0;P<te.modeInfo.length;P++){var F=te.modeInfo[P];if(F.file&&F.file.test(z))return F}var G=z.lastIndexOf("."),K=G>-1&&z.substring(G+1,z.length);if(K)return te.findModeByExtension(K)},te.findModeByName=function(z){z=z.toLowerCase();for(var P=0;P<te.modeInfo.length;P++){var F=te.modeInfo[P];if(F.name.toLowerCase()==z)return F;if(F.alias){for(var G=0;G<F.alias.length;G++)if(F.alias[G].toLowerCase()==z)return F}}}})},"8HAY":function(ct,ge,U){"use strict";U.d(ge,"a",function(){return P}),U.d(ge,"b",function(){return F}),U.d(ge,"d",function(){return G}),U.d(ge,"e",function(){return K}),U.d(ge,"c",function(){return n});var te=U("MI8n"),Y=U("pmY6"),N=U("3/fG"),z=function(I,E,f,b){function c(a){return a instanceof f?a:new f(function(p){p(a)})}return new(f||(f=Promise))(function(a,p){function l(i){try{s(b.next(i))}catch(D){p(D)}}function u(i){try{s(b.throw(i))}catch(D){p(D)}}function s(i){i.done?a(i.value):c(i.value).then(l,u)}s((b=b.apply(I,E||[])).next())})};class P extends Y.a{constructor(I,E="",f="",b=!0,c){super();this._onDidChange=this._register(new te.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=I,this._label=E,this._cssClass=f,this._enabled=b,this._actionCallback=c}get id(){return this._id}get label(){return this._label}set label(I){this._setLabel(I)}_setLabel(I){this._label!==I&&(this._label=I,this._onDidChange.fire({label:I}))}get tooltip(){return this._tooltip||""}set tooltip(I){this._setTooltip(I)}_setTooltip(I){this._tooltip!==I&&(this._tooltip=I,this._onDidChange.fire({tooltip:I}))}get class(){return this._cssClass}set class(I){this._setClass(I)}_setClass(I){this._cssClass!==I&&(this._cssClass=I,this._onDidChange.fire({class:I}))}get enabled(){return this._enabled}set enabled(I){this._setEnabled(I)}_setEnabled(I){this._enabled!==I&&(this._enabled=I,this._onDidChange.fire({enabled:I}))}get checked(){return this._checked}set checked(I){this._setChecked(I)}_setChecked(I){this._checked!==I&&(this._checked=I,this._onDidChange.fire({checked:I}))}run(I,E){return z(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(I))})}}class F extends Y.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new te.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new te.b),this.onDidRun=this._onDidRun.event}run(I,E){return z(this,void 0,void 0,function*(){if(!I.enabled)return;this._onBeforeRun.fire({action:I});let f;try{yield this.runAction(I,E)}catch(b){f=b}this._onDidRun.fire({action:I,error:f})})}runAction(I,E){return z(this,void 0,void 0,function*(){yield I.run(E)})}}class G extends P{constructor(I){super(G.ID,I,I?"separator text":"separator");this.checked=!1,this.enabled=!1}}G.ID="vs.actions.separator";class K{constructor(I,E,f,b){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=I,this.label=E,this.class=b,this._actions=f}get actions(){return this._actions}dispose(){}run(){return z(this,void 0,void 0,function*(){})}}class n extends P{constructor(){super(n.ID,N.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(ct,ge,U){ct.exports={button:"button___1wy9m"}},"9Bee":function(ct,ge,U){"use strict";var te=U("DYRE"),Y=U("zeV3"),N=U("+L6B"),z=U("2/Rp"),P=U("k1fw"),F=U("9og8"),G=U("tJVT"),K=U("WmNS"),n=U.n(K),I=U("q1tI"),E=U.n(I),f=U("vg9a"),b=U("DlQD"),c=U.n(b),a=U("rUJ1");function p(Z,L){var k=Z.match(/^(\s+)(?:```)/);if(k===null)return L;var V=k[1];return L.split(`
`).map(function(ne){var Q=ne.match(/^\s+/);if(Q===null)return ne;var Pe=Object(G.a)(Q,1),pt=Pe[0];return pt.length>=V.length?ne.slice(V.length):ne}).join(`
`)}var l=[],u=["<ul>"],s=new c.a.Renderer,i=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function D(){l.length=0,u=["<ul>"]}var A={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(Z,L,k,V){if(L>=Z.length||Z[L].level<=k)return L;var ne=Z[L];V.push("<li><a href='#"+ne.anchor+"'>"+ne.text+"</a>"),L++;var Q=[];return L=S(Z,L,ne.level,Q),Q.length>0&&(V.push("<ul>"),Q.forEach(function(Pe){V.push(Pe)}),V.push("</ul>")),V.push("</li>"),L=S(Z,L,k,V),L}function R(){return S(l,0,0,u),u.push("</ul>"),u.join("")}var O={heading:function(L){var k=i.exec(L);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(L){var k=this.rules.block.fences.exec(L);if(k){var V=k[0],ne=p(V,k[3]||""),Q=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(Q)>=0){var Pe=h(),pt=ne;ne=Pe,d[Pe]={type:"block",expression:pt}}return{type:"code",raw:V,lang:Q,text:ne}}}},g=/(?:\${2})([^\n`]+?)(?:\${2})/gi,_=0,h=function(){return"__special_katext_id_".concat(_++,"__")},d={};function C(){return d}function x(){_=0,d={}}function w(Z){return Z=Z.replace(g,function(L,k){var V=h();return d[V]={type:"inline",expression:k},V}),Z}var j=s.listitem;s.listitem=function(Z){return j(w(Z))};var W=s.paragraph;s.paragraph=function(Z){return W(w(Z))};var T=s.tablecell;s.tablecell=function(Z,L){return T(w(Z),L)},s.code=function(Z,L,k){var V=(L||"").match(/\S*/)[0];return V?["latex","katex","math"].indexOf(V)>=0?"<p class='editormd-tex'>".concat(Z,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(L,'">').concat(k?Z:Object(a.escape)(Z,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(k?Z:Object(a.escape)(Z,!0))+"</code></pre>"},s.heading=function(Z,L,k){var V=this.options.headerPrefix+k.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:V,level:L,text:Z}),"<h"+L+' id="'+V+'">'+Z+"</h"+L+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:O,renderer:s});var M=c.a,m=U("SJMd"),v=U("ulZh"),H=U.n(v),X=U("m3rI"),q=U("Oy/b"),re=U("p5ED"),ye=U("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 pe=function(Z,L){return(pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,V){k.__proto__=V}||function(k,V){for(var ne in V)Object.prototype.hasOwnProperty.call(V,ne)&&(k[ne]=V[ne])})(Z,L)};function ue(Z,L){function k(){this.constructor=Z}pe(Z,L),Z.prototype=L===null?Object.create(L):(k.prototype=L.prototype,new k)}function fe(Z,L,k,V){return new(k||(k=Promise))(function(ne,Q){function Pe(rn){try{Lt(V.next(rn))}catch(vt){Q(vt)}}function pt(rn){try{Lt(V.throw(rn))}catch(vt){Q(vt)}}function Lt(rn){var vt;rn.done?ne(rn.value):(vt=rn.value,vt instanceof k?vt:new k(function(Gt){Gt(vt)})).then(Pe,pt)}Lt((V=V.apply(Z,L||[])).next())})}function be(Z,L){var k,V,ne,Q,Pe={label:0,sent:function(){if(1&ne[0])throw ne[1];return ne[1]},trys:[],ops:[]};return Q={next:pt(0),throw:pt(1),return:pt(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function pt(Lt){return function(rn){return function(vt){if(k)throw new TypeError("Generator is already executing.");for(;Pe;)try{if(k=1,V&&(ne=2&vt[0]?V.return:vt[0]?V.throw||((ne=V.return)&&ne.call(V),0):V.next)&&!(ne=ne.call(V,vt[1])).done)return ne;switch(V=0,ne&&(vt=[2&vt[0],ne.value]),vt[0]){case 0:case 1:ne=vt;break;case 4:return Pe.label++,{value:vt[1],done:!1};case 5:Pe.label++,V=vt[1],vt=[0];continue;case 7:vt=Pe.ops.pop(),Pe.trys.pop();continue;default:if(!(ne=Pe.trys,(ne=ne.length>0&&ne[ne.length-1])||vt[0]!==6&&vt[0]!==2)){Pe=0;continue}if(vt[0]===3&&(!ne||vt[1]>ne[0]&&vt[1]<ne[3])){Pe.label=vt[1];break}if(vt[0]===6&&Pe.label<ne[1]){Pe.label=ne[1],ne=vt;break}if(ne&&Pe.label<ne[2]){Pe.label=ne[2],Pe.ops.push(vt);break}ne[2]&&Pe.ops.pop(),Pe.trys.pop();continue}vt=L.call(Z,Pe)}catch(Gt){vt=[6,Gt],V=0}finally{k=ne=0}if(5&vt[0])throw vt[1];return{value:vt[0]?vt[1]:void 0,done:!0}}([Lt,rn])}}}function se(){for(var Z=0,L=0,k=arguments.length;L<k;L++)Z+=arguments[L].length;var V=Array(Z),ne=0;for(L=0;L<k;L++)for(var Q=arguments[L],Pe=0,pt=Q.length;Pe<pt;Pe++,ne++)V[ne]=Q[Pe];return V}var ae=function(){function Z(){}return Z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Z.setAttributes=function(L,k){for(var V=0,ne=k;V<ne.length;V++){var Q=ne[V],Pe=Q[0],pt=Q[1];L.setAttribute(Pe,pt)}},Z.createRect=function(L,k,V){var ne=document.createElementNS("http://www.w3.org/2000/svg","rect");return ne.setAttribute("width",L.toString()),ne.setAttribute("height",k.toString()),V&&Z.setAttributes(ne,V),ne},Z.createLine=function(L,k,V,ne,Q){var Pe=document.createElementNS("http://www.w3.org/2000/svg","line");return Pe.setAttribute("x1",L.toString()),Pe.setAttribute("y1",k.toString()),Pe.setAttribute("x2",V.toString()),Pe.setAttribute("y2",ne.toString()),Q&&Z.setAttributes(Pe,Q),Pe},Z.createPolygon=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",L),k&&Z.setAttributes(V,k),V},Z.createCircle=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","circle");return V.setAttribute("cx",(L/2).toString()),V.setAttribute("cy",(L/2).toString()),V.setAttribute("r",L.toString()),k&&Z.setAttributes(V,k),V},Z.createEllipse=function(L,k,V){var ne=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ne.setAttribute("cx",(L/2).toString()),ne.setAttribute("cy",(k/2).toString()),ne.setAttribute("rx",(L/2).toString()),ne.setAttribute("ry",(k/2).toString()),V&&Z.setAttributes(ne,V),ne},Z.createGroup=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return L&&Z.setAttributes(k,L),k},Z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Z.createMarker=function(L,k,V,ne,Q,Pe,pt){var Lt=document.createElementNS("http://www.w3.org/2000/svg","marker");return Z.setAttributes(Lt,[["id",L],["orient",k],["markerWidth",V.toString()],["markerHeight",ne.toString()],["refX",Q.toString()],["refY",Pe.toString()]]),Lt.appendChild(pt),Lt},Z.createText=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),L&&Z.setAttributes(k,L),k},Z.createTSpan=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=L,k&&Z.setAttributes(V,k),V},Z.createImage=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return L&&Z.setAttributes(k,L),k},Z.createPoint=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=L,V.y=k,V},Z.createPath=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",L),k&&Z.setAttributes(V,k),V},Z}(),Ce=function(){function Z(){}return Z.addKey=function(L){Z.key=L},Object.defineProperty(Z,"isLicensed",{get:function(){return!!Z.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Z.key)},enumerable:!1,configurable:!0}),Z}(),ze=function(){function Z(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Z.prototype.rasterize=function(L,k,V){var ne=this;return new Promise(function(Q){var Pe=V!==void 0?V:document.createElement("canvas");L===null&&(ne.markersOnly=!0,ne.naturalSize=!1);var pt=document.createElementNS("http://www.w3.org/2000/svg","svg");pt.setAttribute("xmlns","http://www.w3.org/2000/svg"),pt.setAttribute("width",k.width.baseVal.valueAsString),pt.setAttribute("height",k.height.baseVal.valueAsString),pt.setAttribute("viewBox","0 0 "+k.viewBox.baseVal.width.toString()+" "+k.viewBox.baseVal.height.toString()),pt.innerHTML=k.innerHTML,ne.naturalSize===!0?(pt.width.baseVal.value=L.naturalWidth,pt.height.baseVal.value=L.naturalHeight):ne.width!==void 0&&ne.height!==void 0&&(pt.width.baseVal.value=ne.width,pt.height.baseVal.value=ne.height),Pe.width=pt.width.baseVal.value,Pe.height=pt.height.baseVal.value;var Lt=pt.outerHTML,rn=Pe.getContext("2d");ne.markersOnly!==!0&&rn.drawImage(L,0,0,Pe.width,Pe.height);var vt=window.URL,Gt=new Image(Pe.width,Pe.height);Gt.setAttribute("crossOrigin","anonymous");var pr=new Blob([Lt],{type:"image/svg+xml"}),Ir=vt.createObjectURL(pr);Gt.onload=function(){rn.drawImage(Gt,0,0),vt.revokeObjectURL(Ir);var Zt=Pe.toDataURL(ne.imageType,ne.imageQuality);Q(Zt)},Gt.src=Ir})},Z}(),Ye=function(){},He=function(){function Z(L){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+L+"_"}return Object.defineProperty(Z.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Z.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(Z.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Z.prototype.addClass=function(L){return this.styleSheet===void 0&&this.addStyleSheet(),L.name=""+this.classNamePrefix+L.localName,this.classes.push(L),this.styleSheet.sheet.insertRule("."+L.name+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length),L},Z.prototype.addRule=function(L){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(L),this.styleSheet.sheet.insertRule(L.selector+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length)},Z.prototype.addStyleSheet=function(){var L;this.styleSheet=document.createElement("style"),((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).appendChild(this.styleSheet),this.addRule(new Ve("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ve("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ve("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Fe("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Fe("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Z.prototype.removeStyleSheet=function(){var L;this.styleSheet&&(((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Z}(),Ve=function(Z,L){this.selector=Z,this.style=L},Fe=function(Z,L){this.localName=Z,this.style=L},Ke=function(){function Z(L,k,V,ne,Q){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=L,this.displayMode=k,this.markerItems=V,this.uiStyleSettings=ne,this.styles=Q,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Z.prototype.show=function(L){var k=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=L,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var V=document.createElement("div");V.className=this.toolbarBlockStyleClass.name,V.style.whiteSpace="nowrap",this.uiContainer.appendChild(V),this.addActionButton(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(Q){var Pe=document.createElement("div");Pe.className=""+k.toolbarButtonStyleClass.name,Pe.setAttribute("data-type-name",Q.typeName),Pe.innerHTML=Q.icon,Pe.addEventListener("click",function(){k.markerToolbarButtonClicked(Pe,Q)}),k.buttons.push(Pe),k.markerButtons.push(Pe)}),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 ne=document.createElement("div");ne.className=this.toolbarBlockStyleClass.name,ne.style.whiteSpace="nowrap",ne.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ne),this.addActionButton(ne,'<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(ne,'<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()},Z.prototype.addButtonClickListener=function(L){this.buttonClickListeners.push(L)},Z.prototype.removeButtonClickListener=function(L){this.buttonClickListeners.indexOf(L)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(L),1)},Z.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Z.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var L=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<L||k===L&&this.markerButtons.length-1===L?this.markerButtonBlock.appendChild(this.markerButtons[k]):(k===L&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[k]))}},Z.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")},Z.prototype.resetButtonStyles=function(){var L=this;this.buttons.forEach(function(k){k.className=k.className.replace(L.uiStyleSettings.toolbarButtonStyleColorsClassName?L.uiStyleSettings.toolbarButtonStyleColorsClassName:L.toolbarButtonStyleColorsClass.name,"").trim(),k.className=k.className.replace(L.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?L.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:L.toolbarActiveButtonStyleColorsClass.name,"").trim(),k.className+=" "+(L.uiStyleSettings.toolbarButtonStyleColorsClassName?L.uiStyleSettings.toolbarButtonStyleColorsClassName:L.toolbarButtonStyleColorsClass.name)})},Z.prototype.addActionButton=function(L,k,V){var ne=this,Q=document.createElement("div");switch(Q.className=""+this.toolbarButtonStyleClass.name,Q.innerHTML=k,Q.setAttribute("data-action",V),Q.addEventListener("click",function(){ne.actionToolbarButtonClicked(Q,V)}),V){case"select":Q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Q.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Q.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Q.style.fill=this.uiStyleSettings.closeButtonColor}L.appendChild(Q),this.buttons.push(Q)},Z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Fe("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 Fe("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Fe("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Fe("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 Fe("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Fe("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
padding: `+L+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Fe("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Fe("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ve("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ve("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},Z.prototype.markerToolbarButtonClicked=function(L,k){this.setActiveButton(L),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},Z.prototype.actionToolbarButtonClicked=function(L,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Z.prototype.setActiveButton=function(L){this.resetButtonStyles(),L.className=L.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),L.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Z.prototype.setActiveMarkerButton=function(L){var k=this.markerButtons.find(function(V){return V.getAttribute("data-type-name")===L});k&&this.setActiveButton(k)},Z.prototype.setCurrentMarker=function(L){var k=this;this.currentMarker=L,this.buttons.filter(function(V){return/delete|notes/.test(V.getAttribute("data-action"))}).forEach(function(V){k.currentMarker===void 0?(V.style.fillOpacity="0.4",V.style.pointerEvents="none"):(V.style.fillOpacity="1",V.style.pointerEvents="all")})},Z}(),nt=function(){function Z(L,k,V,ne){this.panels=[],this.panelButtons=[],this.markerjsContainer=L,this.displayMode=k,this.uiStyleSettings=V,this.styles=ne,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Z.prototype.addStyles=function(){var L;this.toolboxStyleClass=this.styles.addClass(new Fe("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 Fe("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Fe("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Fe("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Fe("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 Fe("toolbox-panel-row_colors",`
background-color: `+((L=this.uiStyleSettings.toolboxBackgroundColor)!==null&&L!==void 0?L:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Fe("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 Fe("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Fe("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ve("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ve("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},Z.prototype.show=function(L){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=L,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Z.prototype.setPanelButtons=function(L){var k,V,ne=this;this.panels=L,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+" "+((V=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&V!==void 0?V:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Q){var Pe;Q.uiStyleSettings=ne.uiStyleSettings;var pt=document.createElement("div");pt.className=ne.toolboxButtonStyleClass.name+" "+((Pe=ne.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pe!==void 0?Pe:ne.toolboxButtonStyleColorsClass.name),pt.innerHTML=Q.icon,pt.title=Q.title,pt.addEventListener("click",function(){ne.panelButtonClick(Q)}),ne.panelButtons.push(pt),ne.buttonRow.appendChild(pt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Z.prototype.panelButtonClick=function(L){var k=this,V=-1;if(L!==this.activePanel){V=this.panels.indexOf(L),this.panelRow.innerHTML="";var ne=L.getUi();ne.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ne),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=L}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(Q,Pe){var pt,Lt;Q.className=k.toolboxButtonStyleClass.name+" "+(Pe===V?""+((pt=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&pt!==void 0?pt:k.toolboxActiveButtonStyleColorsClass.name):""+((Lt=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Lt!==void 0?Lt:k.toolboxButtonStyleColorsClass.name))})},Z}(),de=function(Z,L){this.title=Z,this.icon=L},De=function(Z){function L(k,V,ne,Q){var Pe=Z.call(this,k,Q||'<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 Pe.colors=[],Pe.addTransparent=!1,Pe.colorBoxes=[],Pe.colors=V,Pe.currentColor=ne,Pe.setCurrentColor=Pe.setCurrentColor.bind(Pe),Pe.getColorBox=Pe.getColorBox.bind(Pe),Pe}return ue(L,Z),L.prototype.getUi=function(){var k=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.whiteSpace="nowrap",this.colors.forEach(function(ne){var Q=k.getColorBox(ne);V.appendChild(Q),k.colorBoxes.push(Q)}),V},L.prototype.getColorBox=function(k){var V=this,ne=this.uiStyleSettings.toolbarHeight/4,Q=this.uiStyleSettings.toolbarHeight-ne,Pe=document.createElement("div");Pe.style.display="inline-block",Pe.style.boxSizing="content-box",Pe.style.width=Q-2+"px",Pe.style.height=Q-2+"px",Pe.style.padding="1px",Pe.style.marginRight="2px",Pe.style.marginBottom="2px",Pe.style.borderWidth="2px",Pe.style.borderStyle="solid",Pe.style.borderRadius=(Q+2)/2+"px",Pe.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Pe.addEventListener("click",function(){V.setCurrentColor(k,Pe)});var pt=document.createElement("div");return pt.style.display="inline-block",pt.style.width=Q-2+"px",pt.style.height=Q-2+"px",pt.style.backgroundColor=k,pt.style.borderRadius=Q/2+"px",k==="transparent"&&(pt.style.fill=this.uiStyleSettings.toolboxAccentColor,pt.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>`),Pe.appendChild(pt),Pe},L.prototype.setCurrentColor=function(k,V){var ne=this;this.currentColor=k,this.colorBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},L}(de),Ne=function(){function Z(L,k,V){this._state="new",this._isSelected=!1,this._container=L,this._overlayContainer=k,this.globalSettings=V,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Z.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Z.prototype.ownsTarget=function(L){return!1},Object.defineProperty(Z.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Z.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Z.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Z.prototype.pointerDown=function(L,k){},Z.prototype.dblClick=function(L,k){},Z.prototype.manipulate=function(L){},Z.prototype.pointerUp=function(L){this.stateChanged()},Z.prototype.dispose=function(){},Z.prototype.addMarkerVisualToContainer=function(L){this.container.childNodes.length>0?this.container.insertBefore(L,this.container.childNodes[0]):this.container.appendChild(L)},Z.prototype.getState=function(){return{typeName:Z.typeName,state:this.state,notes:this.notes}},Z.prototype.restoreState=function(L){this._state=L.state,this.notes=L.notes},Z.prototype.scale=function(L,k){},Z.prototype.colorChanged=function(L){this.onColorChanged&&this.onColorChanged(L),this.stateChanged()},Z.prototype.fillColorChanged=function(L){this.onFillColorChanged&&this.onFillColorChanged(L),this.stateChanged()},Z.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var L=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),L.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(L)&&this.onStateChanged(this)}},Z.typeName="MarkerBase",Z}(),Ue=function(){function Z(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Z.prototype.findGripByVisual=function(L){return this.topLeft.ownsTarget(L)?this.topLeft:this.topCenter.ownsTarget(L)?this.topCenter:this.topRight.ownsTarget(L)?this.topRight:this.centerLeft.ownsTarget(L)?this.centerLeft:this.centerRight.ownsTarget(L)?this.centerRight:this.bottomLeft.ownsTarget(L)?this.bottomLeft:this.bottomCenter.ownsTarget(L)?this.bottomCenter:this.bottomRight.ownsTarget(L)?this.bottomRight:void 0},Z}(),rt=function(){function Z(){this.GRIP_SIZE=10,this.visual=ae.createGroup(),this.visual.appendChild(ae.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ae.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Z.prototype.ownsTarget=function(L){return L===this.visual||L===this.visual.childNodes[0]||L===this.visual.childNodes[1]},Z}(),lt=function(){function Z(){}return Z.toITransformMatrix=function(L){return{a:L.a,b:L.b,c:L.c,d:L.d,e:L.e,f:L.f}},Z.toSVGMatrix=function(L,k){return L.a=k.a,L.b=k.b,L.c=k.c,L.d=k.d,L.e=k.e,L.f=k.f,L},Z}(),ft=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V,ne)||this;return Q.left=0,Q.top=0,Q.width=0,Q.height=0,Q.defaultSize={x:50,y:20},Q.offsetX=0,Q.offsetY=0,Q.rotationAngle=0,Q.CB_DISTANCE=10,Q._suppressMarkerCreateEvent=!1,Q.container.transform.baseVal.appendItem(ae.createTransform()),Q.setupControlBox(),Q}return ue(L,Z),Object.defineProperty(L.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var V=ae.createTransform();this._visual.transform.baseVal.appendItem(V)},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(k){return!!Z.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),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 ne=this.unrotatePoint(k);if(this.manipulationStartX=ne.x,this.manipulationStartY=ne.y,this.offsetX=ne.x-this.left,this.offsetY=ne.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(V),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(V)){this.activeGrip=this.rotatorGrip;var Q=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Q.x-this.width/2,this.top=Q.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Pe=this.container.transform.baseVal.getItem(0);Pe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Pe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},L.prototype.pointerUp=function(k){var V=this.state;Z.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",V==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},L.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},L.prototype.manipulate=function(k){var V=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(V.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(V.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(V):this.state==="rotate"&&this.rotate(k)},L.prototype.resize=function(k){var V=this.manipulationStartLeft,ne=this.manipulationStartWidth,Q=this.manipulationStartTop,Pe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:V=this.manipulationStartLeft+k.x-this.manipulationStartX,ne=this.manipulationStartWidth+this.manipulationStartLeft-V;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ne=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Q=this.manipulationStartTop+k.y-this.manipulationStartY,Pe=this.manipulationStartHeight+this.manipulationStartTop-Q;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Pe=this.manipulationStartHeight+k.y-this.manipulationStartY}ne>=0?(this.left=V,this.width=ne):(this.left=V+ne,this.width=-ne),Pe>=0?(this.top=Q,this.height=Pe):(this.top=Q+Pe,this.height=-Pe),this.setSize()},L.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},L.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var V=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*V,this.applyRotation()}},L.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)},L.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var V=this.container.getCTM(),ne=ae.createPoint(k.x,k.y);return{x:(ne=ne.matrixTransform(V)).x,y:ne.y}},L.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var V=this.container.getCTM();V=V.inverse();var ne=ae.createPoint(k.x,k.y);return{x:(ne=ne.matrixTransform(V)).x,y:ne.y}},L.prototype.select=function(){Z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},L.prototype.deselect=function(){Z.prototype.deselect.call(this),this.controlBox.style.display="none"},L.prototype.setupControlBox=function(){this.controlBox=ae.createGroup();var k=ae.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=ae.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=ae.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ue,this.addControlGrips(),this.controlBox.style.display="none"},L.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()},L.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()},L.prototype.createGrip=function(){var k=new rt;return k.visual.transform.baseVal.appendItem(ae.createTransform()),this.controlBox.appendChild(k.visual),k},L.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,V=-k/2,ne=V,Q=(this.width+this.CB_DISTANCE)/2-k/2,Pe=(this.height+this.CB_DISTANCE)/2-k/2,pt=this.height+this.CB_DISTANCE-k/2,Lt=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,V,ne),this.positionGrip(this.controlGrips.topCenter.visual,Q,ne),this.positionGrip(this.controlGrips.topRight.visual,Lt,ne),this.positionGrip(this.controlGrips.centerLeft.visual,V,Pe),this.positionGrip(this.controlGrips.centerRight.visual,Lt,Pe),this.positionGrip(this.controlGrips.bottomLeft.visual,V,pt),this.positionGrip(this.controlGrips.bottomCenter.visual,Q,pt),this.positionGrip(this.controlGrips.bottomRight.visual,Lt,pt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Q,ne-3*this.CB_DISTANCE)},L.prototype.positionGrip=function(k,V,ne){var Q=k.transform.baseVal.getItem(0);Q.setTranslate(V,ne),k.transform.baseVal.replaceItem(Q,0)},L.prototype.hideControlBox=function(){this.controlBox.style.display="none"},L.prototype.showControlBox=function(){this.controlBox.style.display=""},L.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:lt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:lt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Z.prototype.getState.call(this))},L.prototype.restoreState=function(k){Z.prototype.restoreState.call(this,k);var V=k;this.left=V.left,this.top=V.top,this.width=V.width,this.height=V.height,this.rotationAngle=V.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(lt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,V.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(lt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,V.containerTransformMatrix))},L.prototype.scale=function(k,V){Z.prototype.scale.call(this,k,V);var ne=this.rotatePoint({x:this.left,y:this.top}),Q=this.unrotatePoint({x:ne.x*k,y:ne.y*V});this.left=Q.x,this.top=Q.y,this.width=this.width*k,this.height=this.height*V,this.adjustControlBox()},L}(Ne),at=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V,ne)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return!(!Z.prototype.ownsTarget.call(this,k)&&k!==this.visual)},L.prototype.createVisual=function(){this.visual=ae.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},L.prototype.manipulate=function(k){Z.prototype.manipulate.call(this,k)},L.prototype.resize=function(k){Z.prototype.resize.call(this,k),this.setSize()},L.prototype.setSize=function(){Z.prototype.setSize.call(this),ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},L.prototype.pointerUp=function(k){Z.prototype.pointerUp.call(this,k),this.setSize()},L.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&ae.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},L.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&ae.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},L.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&ae.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},L.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&ae.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},L.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Z.prototype.getState.call(this))},L.prototype.restoreState=function(k){var V=k;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),Z.prototype.restoreState.call(this,k),this.setSize()},L.prototype.scale=function(k,V){Z.prototype.scale.call(this,k,V),this.setSize()},L.title="Rectangle marker",L}(ft),_t=function(Z){function L(k,V,ne,Q){var Pe=Z.call(this,k,Q||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Pe.widths=[],Pe.widthBoxes=[],Pe.widths=V,Pe.currentWidth=ne,Pe.setCurrentWidth=Pe.setCurrentWidth.bind(Pe),Pe}return ue(L,Z),L.prototype.getUi=function(){var k=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.widths.forEach(function(ne){var Q=document.createElement("div");Q.style.display="flex",Q.style.flexGrow="2",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=ne===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){k.setCurrentWidth(ne,Q)}),V.appendChild(Q);var Pe=document.createElement("div");Pe.innerText=ne.toString(),Pe.style.marginRight="5px",Q.appendChild(Pe);var pt=document.createElement("div");pt.style.minHeight="20px",pt.style.flexGrow="2",pt.style.display="flex",pt.style.alignItems="center";var Lt=document.createElement("hr");Lt.style.minWidth="20px",Lt.style.border="0px",Lt.style.borderTop=ne+"px solid "+k.uiStyleSettings.toolboxColor,Lt.style.flexGrow="2",pt.appendChild(Lt),Q.appendChild(pt),k.widthBoxes.push(Q)}),V},L.prototype.setCurrentWidth=function(k,V){var ne=this;this.currentWidth=k,this.widthBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},L}(de),gt=function(Z){function L(k,V,ne,Q){var Pe=Z.call(this,k,Q||'<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 Pe.styles=[],Pe.styleBoxes=[],Pe.styles=V,Pe.currentStyle=ne,Pe.setCurrentStyle=Pe.setCurrentStyle.bind(Pe),Pe}return ue(L,Z),L.prototype.getUi=function(){var k=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.styles.forEach(function(ne){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/k.styles.length-5+"%",Q.style.borderColor=ne===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){k.setCurrentStyle(ne,Q)}),V.appendChild(Q);var Pe=document.createElement("div");Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.overflow="hidden";var pt=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+k.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ne!==""?'stroke-dasharray="'+ne+'"':"")+` />
</svg>`;Pe.innerHTML=pt,Q.appendChild(Pe),k.styleBoxes.push(Q)}),V},L.prototype.setCurrentStyle=function(k,V){var ne=this;this.currentStyle=k,this.styleBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},L}(de),xt=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V,ne)||this;return Q.strokeColor=ne.defaultColor,Q.strokeWidth=ne.defaultStrokeWidth,Q.strokeDasharray=ne.defaultStrokeDasharray,Q.strokePanel=new De("Line color",ne.defaultColorSet,ne.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new _t("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new gt("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return ue(L,Z),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Z.prototype.getState.call(this);return k.typeName=L.typeName,k},L.typeName="FrameMarker",L.title="Frame marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',L}(at),Ze=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},kt=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V,ne)||this;return Q.x1=0,Q.y1=0,Q.x2=0,Q.y2=0,Q.defaultLength=50,Q.manipulationStartX=0,Q.manipulationStartY=0,Q.manipulationStartX1=0,Q.manipulationStartY1=0,Q.manipulationStartX2=0,Q.manipulationStartY2=0,Q.setupControlBox(),Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return!!Z.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),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(V)?this.activeGrip=this.grip1:this.grip2.ownsTarget(V)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},L.prototype.pointerUp=function(k){var V=this.state;Z.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",V==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},L.prototype.adjustVisual=function(){},L.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)},L.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()},L.prototype.select=function(){Z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},L.prototype.deselect=function(){Z.prototype.deselect.call(this),this.controlBox.style.display="none"},L.prototype.setupControlBox=function(){this.controlBox=ae.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},L.prototype.adjustControlBox=function(){this.positionGrips()},L.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},L.prototype.createGrip=function(){var k=new rt;return k.visual.transform.baseVal.appendItem(ae.createTransform()),this.controlBox.appendChild(k.visual),k},L.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)},L.prototype.positionGrip=function(k,V,ne){var Q=k.transform.baseVal.getItem(0);Q.setTranslate(V,ne),k.transform.baseVal.replaceItem(Q,0)},L.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Z.prototype.getState.call(this))},L.prototype.restoreState=function(k){Z.prototype.restoreState.call(this,k);var V=k;this.x1=V.x1,this.y1=V.y1,this.x2=V.x2,this.y2=V.y2},L.prototype.scale=function(k,V){Z.prototype.scale.call(this,k,V),this.x1=this.x1*k,this.y1=this.y1*V,this.x2=this.x2*k,this.y2=this.y2*V,this.adjustVisual(),this.adjustControlBox()},L}(Ne),Ot=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V,ne)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.strokeColor=ne.defaultColor,Q.strokeWidth=ne.defaultStrokeWidth,Q.strokeDasharray=ne.defaultStrokeDasharray,Q.strokePanel=new De("Line color",ne.defaultColorSet,ne.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new _t("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new gt("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return!(!Z.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},L.prototype.createVisual=function(){this.visual=ae.createGroup(),this.selectorLine=ae.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ae.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},L.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ae.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ae.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ae.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},L.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},L.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},L.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Z.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){Z.prototype.restoreState.call(this,k);var V=k;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.createVisual(),this.adjustVisual()},L.typeName="LineMarker",L.title="Line marker",L.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',L}(kt),qe=function(Z){function L(k,V,ne,Q){var Pe=Z.call(this,k,Q||'<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 Pe.fonts=[],Pe.fontBoxes=[],Pe.fonts=V,Pe.currentFont=ne,Pe.setCurrentFont=Pe.setCurrentFont.bind(Pe),Pe}return ue(L,Z),L.prototype.getUi=function(){var k=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.flexGrow="2",this.fonts.forEach(function(ne){var Q=document.createElement("div");Q.style.display="inline-block",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/k.fonts.length-5+"%",Q.style.borderColor=ne===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){k.setCurrentFont(ne,Q)}),V.appendChild(Q);var Pe=document.createElement("div");Pe.style.display="flex",Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.fontFamily=ne,Pe.style.overflow="hidden";var pt=document.createElement("div");pt.style.whiteSpace="nowrap",pt.style.overflow="hidden",pt.style.textOverflow="ellipsis",pt.innerHTML="The quick brown fox jumps over the lazy dog",Pe.appendChild(pt),Q.appendChild(Pe),k.fontBoxes.push(Q)}),V},L.prototype.setCurrentFont=function(k,V){var ne=this;this.currentFont=k,this.fontBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},L}(de),st=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V,ne)||this;return Q.color="transparent",Q.padding=5,Q.DEFAULT_TEXT="your text here",Q.text=Q.DEFAULT_TEXT,Q.isMoved=!1,Q.color=ne.defaultColor,Q.fontFamily=ne.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setColor=Q.setColor.bind(Q),Q.setFont=Q.setFont.bind(Q),Q.renderText=Q.renderText.bind(Q),Q.sizeText=Q.sizeText.bind(Q),Q.textEditDivClicked=Q.textEditDivClicked.bind(Q),Q.showTextEditor=Q.showTextEditor.bind(Q),Q.setSize=Q.setSize.bind(Q),Q.positionTextEditor=Q.positionTextEditor.bind(Q),Q.colorPanel=new De("Color",ne.defaultColorSet,ne.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.fontFamilyPanel=new qe("Font",ne.defaultFontFamilies,ne.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q}return ue(L,Z),L.prototype.ownsTarget=function(k){if(Z.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var V=!1;return this.textElement.childNodes.forEach(function(ne){ne===k&&(V=!0)}),V},L.prototype.createVisual=function(){this.visual=ae.createGroup(),this.bgRectangle=ae.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ae.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ae.createTransform()),this.textElement.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},L.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(V){k.textElement.appendChild(ae.createTSpan(V.trim()===""?" ":V.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},L.prototype.getTextScale=function(){var k=this.textElement.getBBox(),V=1;if(k.width>0&&k.height>0){var ne=(1*this.width-this.width*this.padding*2/100)/k.width,Q=(1*this.height-this.height*this.padding*2/100)/k.height;V=Math.min(ne,Q)}return V},L.prototype.getTextPosition=function(k){var V=this.textElement.getBBox(),ne=0,Q=0;return V.width>0&&V.height>0&&(ne=(this.width-V.width*k)/2,Q=this.height/2-V.height*k/2),{x:ne,y:Q}},L.prototype.sizeText=function(){var k=this.textElement.getBBox(),V=this.getTextScale(),ne=this.getTextPosition(V);ne.y-=k.y*V,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ne.x+"px, "+ne.y+"px) scale("+V+", "+V+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ne.x,ne.y),this.textElement.transform.baseVal.getItem(1).setScale(V,V))},L.prototype.manipulate=function(k){Z.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)},L.prototype.resize=function(k){Z.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},L.prototype.setSize=function(){Z.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},L.prototype.pointerUp=function(k){var V=this.state;V==="creating"&&(this._suppressMarkerCreateEvent=!0),Z.prototype.pointerUp.call(this,k),this.setSize(),(V==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},L.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(V){V.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var V=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&V>.9;)V-=.1,k.textEditor.style.fontSize=Math.max(V,.9)+"em"}),this.textEditor.addEventListener("keyup",function(V){V.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(V){if(V.clipboardData){var ne=V.clipboardData.getData("text"),Q=window.getSelection();if(!Q.rangeCount)return!1;Q.deleteFromDocument(),Q.getRangeAt(0).insertNode(document.createTextNode(ne)),V.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")},L.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),V=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ne=this.textElement.getBBox(),Q={x:ne.width*k,y:ne.height*k};V.x-=Q.x/2,V.y-=Q.y/2,this.textEditor.style.top=V.y+"px",this.textEditor.style.left=V.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-V.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},L.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()},L.prototype.select=function(){Z.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},L.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Z.prototype.deselect.call(this)},L.prototype.dblClick=function(k,V){Z.prototype.dblClick.call(this,k,V),this.showTextEditor()},L.prototype.setColor=function(k){this.textElement&&ae.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},L.prototype.setFont=function(k){this.textElement&&ae.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},L.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},L.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Z.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){var V=k;this.color=V.color,this.fontFamily=V.fontFamily,this.padding=V.padding,this.text=V.text,this.createVisual(),Z.prototype.restoreState.call(this,k),this.setSize()},L.prototype.scale=function(k,V){Z.prototype.scale.call(this,k,V),this.setSize(),this.sizeText(),this.positionTextEditor()},L.typeName="TextMarker",L.title="Text marker",L.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>',L}(ft),xe=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V,ne)||this;return Q.color="transparent",Q.lineWidth=3,Q.drawing=!1,Q.pixelRatio=1,Q.color=ne.defaultColor,Q.lineWidth=ne.defaultStrokeWidth,Q.pixelRatio=ne.freehandPixelRatio,Q.setColor=Q.setColor.bind(Q),Q.addCanvas=Q.addCanvas.bind(Q),Q.finishCreation=Q.finishCreation.bind(Q),Q.setLineWidth=Q.setLineWidth.bind(Q),Q.colorPanel=new De("Color",ne.defaultColorSet,ne.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.lineWidthPanel=new _t("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.lineWidthPanel.onWidthChanged=Q.setLineWidth,Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return!(!Z.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},L.prototype.createVisual=function(){this.visual=ae.createGroup(),this.drawingImage=ae.createImage(),this.visual.appendChild(this.drawingImage);var k=ae.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(k,V){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):Z.prototype.pointerDown.call(this,k,V)},L.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):Z.prototype.manipulate.call(this,k)},L.prototype.resize=function(k){Z.prototype.resize.call(this,k),ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},L.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Z.prototype.pointerUp.call(this,k)},L.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)},L.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Z.prototype.select.call(this)},L.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Z.prototype.deselect.call(this)},L.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),V=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ne=V[0],Q=V[1],Pe=V[2],pt=V[3],Lt=!1,rn=0;rn<this.canvasElement.height;rn++)for(var vt=0;vt<this.canvasElement.width;vt++)k.data[rn*this.canvasElement.width*4+4*vt+3]>0&&(Lt=!0,rn<Q&&(Q=rn),vt<ne&&(ne=vt),rn>pt&&(pt=rn),vt>Pe&&(Pe=vt));if(Lt){this.left=ne/this.pixelRatio,this.top=Q/this.pixelRatio,this.width=(Pe-ne)/this.pixelRatio,this.height=(pt-Q)/this.pixelRatio;var Gt=document.createElement("canvas");Gt.width=Pe-ne,Gt.height=pt-Q,Gt.getContext("2d").putImageData(this.canvasContext.getImageData(ne,Q,Pe-ne,pt-Q),0,0),this.drawingImgUrl=Gt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},L.prototype.setDrawingImage=function(){ae.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},L.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},L.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},Z.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){this.createVisual(),Z.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},L.prototype.scale=function(k,V){Z.prototype.scale.call(this,k,V),this.setDrawingImage()},L.typeName="FreehandMarker",L.title="Freehand marker",L.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>',L}(ft),we=function(Z){function L(k,V,ne){var Q=Z.call(this,k,ne||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Q.typeBoxes=[],Q.currentType=V,Q.setCurrentType=Q.setCurrentType.bind(Q),Q}return ue(L,Z),L.prototype.getUi=function(){var k=this,V=document.createElement("div");V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2";for(var ne=function(pt){var Lt="both";switch(pt){case 0:Lt="both";break;case 1:Lt="start";break;case 2:Lt="end";break;case 3:Lt="none"}var rn=document.createElement("div");if(rn.style.display="flex",rn.style.flexGrow="2",rn.style.alignItems="center",rn.style.justifyContent="space-between",rn.style.padding="5px",rn.style.borderWidth="2px",rn.style.borderStyle="solid",rn.style.borderColor=Lt===Q.currentType?Q.uiStyleSettings.toolboxAccentColor:"transparent",rn.addEventListener("click",function(){k.setCurrentType(Lt,rn)}),V.appendChild(rn),Lt==="both"||Lt==="start"){var vt=document.createElement("div");vt.style.display="flex",vt.style.alignItems="center",vt.style.minHeight="20px",vt.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="`+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,vt.style.marginLeft="5px",rn.appendChild(vt)}var Gt=document.createElement("div");Gt.style.display="flex",Gt.style.alignItems="center",Gt.style.minHeight="20px",Gt.style.flexGrow="2";var pr=document.createElement("hr");if(pr.style.minWidth="20px",pr.style.border="0px",pr.style.borderTop="3px solid "+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee"),pr.style.flexGrow="2",Gt.appendChild(pr),rn.appendChild(Gt),Lt==="both"||Lt==="end"){var Ir=document.createElement("div");Ir.style.display="flex",Ir.style.alignItems="center",Ir.style.minHeight="20px",Ir.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="`+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Ir.style.marginRight="5px",rn.appendChild(Ir)}Q.typeBoxes.push(rn)},Q=this,Pe=0;Pe<4;Pe++)ne(Pe);return V},L.prototype.setCurrentType=function(k,V){var ne=this;this.currentType=k,this.typeBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ne.uiStyleSettings!==void 0?ne.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},L}(de),me=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V,ne)||this;return Q.arrowType="end",Q.arrowBaseHeight=10,Q.arrowBaseWidth=10,Q.getArrowPoints=Q.getArrowPoints.bind(Q),Q.setArrowType=Q.setArrowType.bind(Q),Q.arrowTypePanel=new we("Arrow type","end"),Q.arrowTypePanel.onArrowTypeChanged=Q.setArrowType,Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return!(!Z.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},L.prototype.getArrowPoints=function(k,V){var ne=this.arrowBaseWidth+2*this.strokeWidth,Q=this.arrowBaseHeight+2*this.strokeWidth;return k-ne/2+","+(V+Q/2)+" "+k+","+(V-Q/2)+" "+(k+ne/2)+","+(V+Q/2)},L.prototype.createTips=function(){this.arrow1=ae.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ae.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.arrow2)},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.state==="creating"&&this.createTips()},L.prototype.adjustVisual=function(){if(Z.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ae.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ae.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.arrow1.transform.baseVal.getItem(0);V.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(V,0);var ne=this.arrow2.transform.baseVal.getItem(0);ne.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ne,0)}},L.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},Z.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){Z.prototype.restoreState.call(this,k);var V=k;this.arrowType=V.arrowType,this.createTips(),this.adjustVisual()},L.typeName="ArrowMarker",L.title="Arrow marker",L.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',L}(Ot),ce=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V,ne)||this;return Q.fillColor=ne.defaultFillColor,Q.strokeWidth=0,Q.fillPanel=new De("Color",ne.defaultColorSet,ne.defaultFillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q}return ue(L,Z),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Z.prototype.getState.call(this);return k.typeName=L.typeName,k},L.typeName="CoverMarker",L.title="Cover marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',L}(at),he=function(Z){function L(k,V,ne,Q){var Pe=Z.call(this,k,Q||'<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 Pe.opacities=[],Pe.opacityBoxes=[],Pe.opacities=V,Pe.currentOpacity=ne,Pe.setCurrentOpacity=Pe.setCurrentOpacity.bind(Pe),Pe}return ue(L,Z),L.prototype.getUi=function(){var k=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",V.style.justifyContent="space-between",this.opacities.forEach(function(ne){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="center",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=ne===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){k.setCurrentOpacity(ne,Q)}),V.appendChild(Q);var Pe=document.createElement("div");Pe.innerText=100*ne+"%",Q.appendChild(Pe),k.opacityBoxes.push(Q)}),V},L.prototype.setCurrentOpacity=function(k,V){var ne=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},L}(de),Te=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V,ne)||this;return Q.setOpacity=Q.setOpacity.bind(Q),Q.fillColor=ne.defaultHighlightColor,Q.strokeWidth=0,Q.opacity=ne.defaultHighlightOpacity,Q.fillPanel=new De("Color",ne.defaultColorSet,Q.fillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q.opacityPanel=new he("Opacity",ne.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return ue(L,Z),L.prototype.setOpacity=function(k){this.opacity=k,this.visual&&ae.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Z.prototype.getState.call(this);return k.typeName=L.typeName,k},L.typeName="HighlightMarker",L.title="Highlight marker",L.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>',L}(ce),Re='<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>',Me=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V,ne)||this;return Q.bgColor="transparent",Q.tipPosition={x:0,y:0},Q.tipBase1Position={x:0,y:0},Q.tipBase2Position={x:0,y:0},Q.tipMoving=!1,Q.color=ne.defaultStrokeColor,Q.bgColor=ne.defaultFillColor,Q.fontFamily=ne.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setBgColor=Q.setBgColor.bind(Q),Q.getTipPoints=Q.getTipPoints.bind(Q),Q.positionTip=Q.positionTip.bind(Q),Q.setTipPoints=Q.setTipPoints.bind(Q),Q.colorPanel=new De("Text color",ne.defaultColorSet,Q.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>'),Q.colorPanel.onColorChanged=Q.setColor,Q.bgColorPanel=new De("Fill color",ne.defaultColorSet,Q.bgColor,Re),Q.bgColorPanel.onColorChanged=Q.setBgColor,Q.fontFamilyPanel=new qe("Font",ne.defaultFontFamilies,ne.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q.tipGrip=new rt,Q.tipGrip.visual.transform.baseVal.appendItem(ae.createTransform()),Q.controlBox.appendChild(Q.tipGrip.visual),Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return Z.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},L.prototype.createTip=function(){ae.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ae.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},L.prototype.pointerDown=function(k,V){this.state==="new"&&Z.prototype.pointerDown.call(this,k,V),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(V)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Z.prototype.pointerDown.call(this,k,V)},L.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Z.prototype.pointerUp.call(this,k);else{var V=this.state==="creating";Z.prototype.pointerUp.call(this,k),this.setTipPoints(V),this.positionTip()}},L.prototype.manipulate=function(k){if(this.tipMoving){var V=this.unrotatePoint(k);this.tipPosition={x:V.x-this.manipulationStartLeft,y:V.y-this.manipulationStartTop},this.positionTip()}else Z.prototype.manipulate.call(this,k)},L.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(ae.setAttributes(this.bgRectangle,[["fill",k]]),ae.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},L.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},L.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var V=Math.min(this.height/2,15),ne=this.height/5;k&&(this.tipPosition={x:V+ne/2,y:this.height+20});var Q=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Q<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ne=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:V,y:0},this.tipBase2Position={x:V+ne,y:0}):(this.tipBase1Position={x:0,y:V},this.tipBase2Position={x:0,y:V+ne}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Q<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ne=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-V-ne,y:0},this.tipBase2Position={x:this.width-V,y:0}):(this.tipBase1Position={x:this.width,y:V},this.tipBase2Position={x:this.width,y:V+ne}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Q<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ne=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-V-ne,y:this.height},this.tipBase2Position={x:this.width-V,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-V-ne},this.tipBase2Position={x:this.width,y:this.height-V}):Q<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ne=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:V,y:this.height},this.tipBase2Position={x:V+ne,y:this.height}):(this.tipBase1Position={x:0,y:this.height-V},this.tipBase2Position={x:0,y:this.height-V-ne})},L.prototype.resize=function(k){Z.prototype.resize.call(this,k),this.positionTip()},L.prototype.positionTip=function(){ae.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(L.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),L.prototype.select=function(){this.positionTip(),Z.prototype.select.call(this)},L.prototype.getState=function(){var k=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Z.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){var V=k;this.bgColor=V.bgColor,this.tipPosition=V.tipPosition,Z.prototype.restoreState.call(this,k),this.createTip(),this.setTipPoints()},L.prototype.scale=function(k,V){Z.prototype.scale.call(this,k,V),this.tipPosition={x:this.tipPosition.x*k,y:this.tipPosition.y*V},this.positionTip()},L.typeName="CalloutMarker",L.title="Callout marker",L.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>',L}(st),et=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V,ne)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.strokeColor=ne.defaultColor,Q.strokeWidth=ne.defaultStrokeWidth,Q.strokeDasharray=ne.defaultStrokeDasharray,Q.fillColor=ne.defaultFillColor,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.setOpacity=Q.setOpacity.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q.strokePanel=new De("Line color",se(ne.defaultColorSet,["transparent"]),ne.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.fillPanel=new De("Fill color",se(ne.defaultColorSet,["transparent"]),Q.fillColor,Re),Q.fillPanel.onColorChanged=Q.setFillColor,Q.strokeWidthPanel=new _t("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new gt("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q.opacityPanel=new he("Opacity",ne.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return!(!Z.prototype.ownsTarget.call(this,k)&&k!==this.visual)},L.prototype.createVisual=function(){this.visual=ae.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},L.prototype.manipulate=function(k){Z.prototype.manipulate.call(this,k)},L.prototype.resize=function(k){Z.prototype.resize.call(this,k),this.setSize()},L.prototype.setSize=function(){Z.prototype.setSize.call(this),ae.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},L.prototype.pointerUp=function(k){Z.prototype.pointerUp.call(this,k),this.setSize()},L.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&ae.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},L.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&ae.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},L.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&ae.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},L.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&ae.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},L.prototype.setOpacity=function(k){this.opacity=k,this.visual&&ae.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Z.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){var V=k;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),Z.prototype.restoreState.call(this,k),this.setSize()},L.prototype.scale=function(k,V){Z.prototype.scale.call(this,k,V),this.setSize()},L.typeName="EllipseMarker",L.title="Ellipse marker",L.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>',L}(ft),ht=function(Z){function L(k,V,ne){return Z.call(this,k,V,ne)||this}return ue(L,Z),Object.defineProperty(L.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(k){return!(!Z.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},L.prototype.createTips=function(){this.tip1=ae.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ae.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.tip2)},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.state==="creating"&&this.createTips()},L.prototype.adjustVisual=function(){if(Z.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ae.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ae.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.tip1.transform.baseVal.getItem(0);V.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(V,0);var ne=this.tip2.transform.baseVal.getItem(0);ne.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ne,0)}},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Z.prototype.getState.call(this);return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){Z.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},L.typeName="MeasurementMarker",L.title="Measurement marker",L.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>',L}(Ot),Ut=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V,ne)||this;return Q.strokePanel.colors=ne.defaultColorSet,Q.fillColor="transparent",Q}return ue(L,Z),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Z.prototype.getState.call(this);return k.typeName=L.typeName,k},L.typeName="EllipseFrameMarker",L.title="Ellipse frame marker",L.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>',L}(et),nn=function(){function Z(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Z.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Z.prototype.addUndoStep=function(L){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(L)||(this.undoStack.push(L),JSON.stringify(this.lastRedoStep)!==JSON.stringify(L)&&this.redoStack.splice(0,this.redoStack.length))},Z.prototype.replaceLastUndoStep=function(L){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=L)},Z.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Z.prototype.undo=function(){if(this.undoStack.length>1){var L=this.undoStack.pop();return L!==void 0&&this.redoStack.push(L),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Z.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Z}(),en=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V,ne)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.curveX=0,Q.curveY=0,Q.manipulationStartCurveX=0,Q.manipulationStartCurveY=0,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.positionGrips=Q.positionGrips.bind(Q),Q.addControlGrips=Q.addControlGrips.bind(Q),Q.adjustVisual=Q.adjustVisual.bind(Q),Q.setupControlBox=Q.setupControlBox.bind(Q),Q.resize=Q.resize.bind(Q),Q.strokeColor=ne.defaultColor,Q.strokeWidth=ne.defaultStrokeWidth,Q.strokeDasharray=ne.defaultStrokeDasharray,Q.strokePanel=new De("Line color",ne.defaultColorSet,ne.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new _t("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new gt("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return!(!Z.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},L.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},L.prototype.createVisual=function(){this.visual=ae.createGroup(),this.selectorCurve=ae.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ae.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),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(V)&&(this.activeGrip=this.curveGrip,this._state="resize")},L.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ae.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ae.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ae.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},L.prototype.setupControlBox=function(){Z.prototype.setupControlBox.call(this),this.curveControlLine1=ae.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ae.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},L.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Z.prototype.addControlGrips.call(this)},L.prototype.positionGrips=function(){Z.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()))},L.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),Z.prototype.manipulate.call(this,k)},L.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),Z.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)},L.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},L.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},L.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},L.prototype.scale=function(k,V){this.curveX=this.curveX*k,this.curveY=this.curveY*V,Z.prototype.scale.call(this,k,V)},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Z.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){Z.prototype.restoreState.call(this,k);var V=k;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.curveX=V.curveX,this.curveY=V.curveY,this.createVisual(),this.adjustVisual()},L.typeName="CurveMarker",L.title="Curve marker",L.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>',L}(kt),mn=function(){function Z(L,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=L,this.cancelable=k}return Object.defineProperty(Z.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Z.prototype.preventDefault=function(){this._defaultPrevented=!0},Z}(),En=function(Z){function L(k,V,ne){var Q=Z.call(this,k,!1)||this;return Q.dataUrl=V,Q.state=ne,Q}return ue(L,Z),L}(mn),$t=function(Z){function L(k,V,ne){ne===void 0&&(ne=!1);var Q=Z.call(this,k,ne)||this;return Q.marker=V,Q}return ue(L,Z),L}(mn),rr=function(){function Z(){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 Z.prototype.addEventListener=function(L,k){this[L].push(k)},Z.prototype.removeEventListener=function(L,k){var V=this[L].indexOf(k);V>-1&&this[L].splice(V,1)},Z}(),Dn=function(){function Z(L){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ze,this._isOpen=!1,this.undoRedoManager=new nn,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 rr,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Z.instanceCounter++,this.styles=new He(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=L,this.targetRoot=document.body,this.width=L.clientWidth,this.height=L.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(Z.prototype,"ALL_MARKER_TYPES",{get:function(){return[xt,xe,me,st,Ut,et,Te,Me,ht,ce,Ot,en]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[xt,xe,me,st,et,Te,Me]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"BASIC_MARKER_TYPES",{get:function(){return[xt,xe,me,st,Te]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(L){var k=this;this._availableMarkerTypes.splice(0),L.forEach(function(V){if(typeof V=="string"){var ne=k.ALL_MARKER_TYPES.find(function(Q){return Q.typeName===V});ne!==void 0&&k._availableMarkerTypes.push(ne)}else k._availableMarkerTypes.push(V)})},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(L){this._zoomLevel=L,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(Z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Z.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ce.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Z.prototype.show=function(){var L=this;this.styles.styleSheetRoot===void 0&&Ye.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ye.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new mn(L))})},Z.prototype.render=function(){return fe(this,void 0,void 0,function(){var L;return be(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(L=new ze).naturalSize=this.renderAtNaturalSize,L.imageType=this.renderImageType,L.imageQuality=this.renderImageQuality,L.markersOnly=this.renderMarkersOnly,L.width=this.renderWidth,L.height=this.renderHeight,[4,L.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,L.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},Z.prototype.close=function(L){var k=this;if(L===void 0&&(L=!1),this.isOpen){var V=!1;L||this.eventListeners.beforeclose.forEach(function(ne){var Q=new mn(k,!0);ne(Q),Q.defaultPrevented&&(V=!0)}),V||(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(ne){return ne(new mn(k))}),this.detachEvents(),this._isOpen=!1)}},Z.prototype.addMarkersToToolbar=function(){for(var L,k=[],V=0;V<arguments.length;V++)k[V]=arguments[V];(L=this._availableMarkerTypes).push.apply(L,k)},Z.prototype.addRenderEventListener=function(L){this.addEventListener("render",function(k){L(k.dataUrl,k.state)})},Z.prototype.removeRenderEventListener=function(L){},Z.prototype.addCloseEventListener=function(L){this.addEventListener("close",function(){L()})},Z.prototype.removeCloseEventListener=function(L){},Z.prototype.setupResizeObserver=function(){var L=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){L.resize(L.target.clientWidth,L.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return L.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Z.prototype.onPopupTargetResize=function(){var L=1*this.target.clientWidth/this.target.clientHeight,k=this.editorCanvas.clientWidth/L>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*L:this.editorCanvas.clientWidth,V=k<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/L;this.resize(k,V)},Z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Z.prototype.resize=function(L,k){this._isResizing=!0;var V=L/this.imageWidth,ne=k/this.imageHeight;this.imageWidth=Math.round(L),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(V,ne),this._isResizing=!1},Z.prototype.scaleMarkers=function(L,k){var V,ne=this;this._currentMarker&&this._currentMarker instanceof st?this._currentMarker.scale(L,k):(V=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Q){Q!==ne._currentMarker&&Q.scale(L,k)}),V!==void 0&&this.setCurrentMarker(V)},Z.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"},Z.prototype.setTopLeft=function(){var L=this.editingTarget.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=L.left-k.left,this.top=L.top-k.top},Z.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)},Z.prototype.addDefs=function(){for(var L,k=[],V=0;V<arguments.length;V++)k[V]=arguments[V];this.defs=ae.createDefs(),this.addDefsToImage(),(L=this.defs).append.apply(L,k)},Z.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Z.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)},Z.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Z.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Z.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)},Z.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Z.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)},Z.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 L=document.createElement("a");L.href="https://markerjs.com/",L.target="_blank",L.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>',L.title="Powered by marker.js",L.style.display="grid",L.style.alignItems="center",L.style.justifyItems="center",L.style.padding="3px",L.style.width="20px",L.style.height="20px",this.logoUI.appendChild(L),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Z.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")},Z.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"},Z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Z.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 L=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=L+"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 Ke(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 nt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Z.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Z.prototype.removeMarker=function(L){this.markerImage.removeChild(L.container),this.markers.indexOf(L)>-1&&this.markers.splice(this.markers.indexOf(L),1),L.dispose()},Z.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())},Z.prototype.toolbarButtonClicked=function(L,k){if(L==="marker"&&k!==void 0)this.createNewMarker(k);else if(L==="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()}},Z.prototype.deleteSelectedMarker=function(){var L=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ne){var Q=new $t(L,L._currentMarker,!0);ne(Q),Q.defaultPrevented&&(k=!0)}),!k){var V=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(ne){return ne(new $t(L,V))})}}},Z.prototype.clear=function(){var L=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Pe){var pt=new $t(L,void 0,!0);Pe(pt),pt.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var V=function(Pe){var pt=ne.markers[Pe];ne.setCurrentMarker(ne.markers[Pe]),ne._currentMarker.dispose(),ne.markerImage.removeChild(ne._currentMarker.container),ne.markers.splice(ne.markers.indexOf(ne._currentMarker),1),ne.eventListeners.markerdelete.forEach(function(Lt){return Lt(new $t(L,pt))})},ne=this,Q=this.markers.length-1;Q>=0;Q--)V(Q);this.addUndoStep()}},Object.defineProperty(Z.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Z.prototype.showNotesEditor=function(){var L;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=(L=this._currentMarker.notes)!==null&&L!==void 0?L:"",this.overlayContainer.appendChild(this.notesArea))},Z.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)},Z.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Z.prototype.addUndoStep=function(){var L=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),V=this.undoRedoManager.getLastUndoStep();if(!V||V.width===k.width&&V.height===k.height){var ne=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),ne<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Q){return Q(new mn(L))})}else this.undoRedoManager.replaceLastUndoStep(k),this.eventListeners.statechange.forEach(function(Q){return Q(new mn(L))})}},Z.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Z.prototype.undoStep=function(){var L=this,k=this.undoRedoManager.undo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new mn(L))}))},Z.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Z.prototype.redoStep=function(){var L=this,k=this.undoRedoManager.redo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new mn(L))}))},Z.prototype.stepZoom=function(){var L=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=L<this.zoomSteps.length-1?this.zoomSteps[L+1]:this.zoomSteps[0]},Z.prototype.panTo=function(L){this.contentDiv.scrollBy({left:this.prevPanPoint.x-L.x,top:this.prevPanPoint.y-L.y}),this.prevPanPoint=L},Z.prototype.startRenderAndClose=function(){return fe(this,void 0,void 0,function(){var L,k,V=this;return be(this,function(ne){switch(ne.label){case 0:return[4,this.render()];case 1:return L=ne.sent(),k=this.getState(),this.eventListeners.render.forEach(function(Q){return Q(new En(V,L,k))}),this.close(!0),[2]}})})},Z.prototype.getState=function(L){L===!0&&this.setCurrentMarker();var k={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(V){return k.markers.push(V.getState())}),k},Z.prototype.restoreState=function(L){var k=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);L.markers.forEach(function(V){var ne=k._availableMarkerTypes.find(function(Pe){return Pe.typeName===V.typeName});if(ne!==void 0){var Q=k.addNewMarker(ne);Q.restoreState(V),k.markers.push(Q)}}),L.width&&L.height&&(L.width!==this.imageWidth||L.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/L.width,this.imageHeight/L.height),this.eventListeners.restorestate.forEach(function(V){return V(new mn(k))})},Z.prototype.addNewMarker=function(L){var k=ae.createGroup();return this.markerImage.appendChild(k),new L(k,this.overlayContainer,this.settings)},Z.prototype.createNewMarker=function(L){var k,V=this;(k=typeof L=="string"?this._availableMarkerTypes.find(function(ne){return ne.typeName===L}):L)&&(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(ne){return ne(new $t(V,V._currentMarker))}))},Z.prototype.markerCreated=function(L){var k=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(L),this.setCurrentMarker(L),L instanceof xe&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(xe):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(V){return V(new $t(k,k._currentMarker))})},Z.prototype.colorChanged=function(L){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=L,this.settings.defaultStrokeColor=L)},Z.prototype.fillColorChanged=function(L){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=L)},Z.prototype.markerStateChanged=function(L){var k=this;this.eventListeners.markerchange.forEach(function(V){return V(new $t(k,L))})},Z.prototype.setCurrentMarker=function(L){var k=this;this._currentMarker!==L&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(V){return V(new $t(k,k._currentMarker))})),this._currentMarker=L,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(V){return V(new $t(k,k._currentMarker))}))},Z.prototype.onPointerDown=function(L){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||L.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(V){return V.ownsTarget(L.target)});k!==void 0?(this.setCurrentMarker(k),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(L.clientX,L.clientY),L.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:L.clientX,y:L.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(L.clientX,L.clientY))},Z.prototype.onDblClick=function(L){if(this._isFocused||this.focus(),this.mode==="select"){var k=this.markers.find(function(V){return V.ownsTarget(L.target)});k!==void 0&&k!==this._currentMarker&&this.setCurrentMarker(k),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(L.clientX,L.clientY),L.target):this.setCurrentMarker()}},Z.prototype.onPointerMove=function(L){this.touchPoints!==1&&L.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||L.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(L.clientX,L.clientY)):this.zoomLevel>1&&this.panTo({x:L.clientX,y:L.clientY}))},Z.prototype.onPointerUp=function(L){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(L.clientX,L.clientY)),this.isDragging=!1,this.addUndoStep()},Z.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Z.prototype.onKeyUp=function(L){this._currentMarker===void 0||this.notesArea!==void 0||L.key!=="Delete"&&L.key!=="Backspace"||this.deleteSelectedMarker()},Z.prototype.clientToLocalCoordinates=function(L,k){var V=this.markerImage.getBoundingClientRect();return{x:(L-V.left)/this.zoomLevel,y:(k-V.top)/this.zoomLevel}},Z.prototype.onWindowResize=function(){this.positionUI()},Z.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var L=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=L+"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()},Z.prototype.addLicenseKey=function(L){Ce.addKey(L)},Z.prototype.addEventListener=function(L,k){this.eventListeners.addEventListener(L,k)},Z.prototype.removeEventListener=function(L,k){this.eventListeners.removeEventListener(L,k)},Z.prototype.renderState=function(L){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(L),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Z.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Z.prototype.focus=function(){var L=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 mn(L))}))},Z.prototype.blur=function(){var L=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new mn(L))}))},Z.instanceCounter=0,Z}();/* **********************************
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 Sr=function(Z,L){return(Sr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,V){k.__proto__=V}||function(k,V){for(var ne in V)Object.prototype.hasOwnProperty.call(V,ne)&&(k[ne]=V[ne])})(Z,L)};function br(Z,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");function k(){this.constructor=Z}Sr(Z,L),Z.prototype=L===null?Object.create(L):(k.prototype=L.prototype,new k)}function Pn(Z,L,k,V){return new(k||(k=Promise))(function(ne,Q){function Pe(rn){try{Lt(V.next(rn))}catch(vt){Q(vt)}}function pt(rn){try{Lt(V.throw(rn))}catch(vt){Q(vt)}}function Lt(rn){var vt;rn.done?ne(rn.value):(vt=rn.value,vt instanceof k?vt:new k(function(Gt){Gt(vt)})).then(Pe,pt)}Lt((V=V.apply(Z,L||[])).next())})}function Dr(Z,L){var k,V,ne,Q,Pe={label:0,sent:function(){if(1&ne[0])throw ne[1];return ne[1]},trys:[],ops:[]};return Q={next:pt(0),throw:pt(1),return:pt(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function pt(Lt){return function(rn){return function(vt){if(k)throw new TypeError("Generator is already executing.");for(;Pe;)try{if(k=1,V&&(ne=2&vt[0]?V.return:vt[0]?V.throw||((ne=V.return)&&ne.call(V),0):V.next)&&!(ne=ne.call(V,vt[1])).done)return ne;switch(V=0,ne&&(vt=[2&vt[0],ne.value]),vt[0]){case 0:case 1:ne=vt;break;case 4:return Pe.label++,{value:vt[1],done:!1};case 5:Pe.label++,V=vt[1],vt=[0];continue;case 7:vt=Pe.ops.pop(),Pe.trys.pop();continue;default:if(!(ne=Pe.trys,(ne=ne.length>0&&ne[ne.length-1])||vt[0]!==6&&vt[0]!==2)){Pe=0;continue}if(vt[0]===3&&(!ne||vt[1]>ne[0]&&vt[1]<ne[3])){Pe.label=vt[1];break}if(vt[0]===6&&Pe.label<ne[1]){Pe.label=ne[1],ne=vt;break}if(ne&&Pe.label<ne[2]){Pe.label=ne[2],Pe.ops.push(vt);break}ne[2]&&Pe.ops.pop(),Pe.trys.pop();continue}vt=L.call(Z,Pe)}catch(Gt){vt=[6,Gt],V=0}finally{k=ne=0}if(5&vt[0])throw vt[1];return{value:vt[0]?vt[1]:void 0,done:!0}}([Lt,rn])}}}var Or=function(){function Z(){}return Z.addKey=function(L){Z.key=L},Object.defineProperty(Z,"isLicensed",{get:function(){return!!Z.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Z.key)},enumerable:!1,configurable:!0}),Z}(),ln=function(){function Z(){}return Z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Z.setAttributes=function(L,k){for(var V=0,ne=k;V<ne.length;V++){var Q=ne[V],Pe=Q[0],pt=Q[1];L.setAttribute(Pe,pt)}},Z.createRect=function(L,k,V){var ne=document.createElementNS("http://www.w3.org/2000/svg","rect");return ne.setAttribute("width",L.toString()),ne.setAttribute("height",k.toString()),V&&Z.setAttributes(ne,V),ne},Z.createLine=function(L,k,V,ne,Q){var Pe=document.createElementNS("http://www.w3.org/2000/svg","line");return Pe.setAttribute("x1",L.toString()),Pe.setAttribute("y1",k.toString()),Pe.setAttribute("x2",V.toString()),Pe.setAttribute("y2",ne.toString()),Q&&Z.setAttributes(Pe,Q),Pe},Z.createPolygon=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",L),k&&Z.setAttributes(V,k),V},Z.createCircle=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","circle");return V.setAttribute("cx",(L/2).toString()),V.setAttribute("cy",(L/2).toString()),V.setAttribute("r",L.toString()),k&&Z.setAttributes(V,k),V},Z.createEllipse=function(L,k,V){var ne=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ne.setAttribute("cx",(L/2).toString()),ne.setAttribute("cy",(k/2).toString()),ne.setAttribute("rx",(L/2).toString()),ne.setAttribute("ry",(k/2).toString()),V&&Z.setAttributes(ne,V),ne},Z.createGroup=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return L&&Z.setAttributes(k,L),k},Z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Z.createMarker=function(L,k,V,ne,Q,Pe,pt){var Lt=document.createElementNS("http://www.w3.org/2000/svg","marker");return Z.setAttributes(Lt,[["id",L],["orient",k],["markerWidth",V.toString()],["markerHeight",ne.toString()],["refX",Q.toString()],["refY",Pe.toString()]]),Lt.appendChild(pt),Lt},Z.createText=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),L&&Z.setAttributes(k,L),k},Z.createTSpan=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=L,k&&Z.setAttributes(V,k),V},Z.createImage=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return L&&Z.setAttributes(k,L),k},Z.createPoint=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=L,V.y=k,V},Z.createPath=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",L),k&&Z.setAttributes(V,k),V},Z.createElement=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg",L);return k&&Z.setAttributes(V,k),V},Z.getHollowRectanglePath=function(L,k,V,ne,Q,Pe,pt,Lt){return"M"+L+","+k+"V"+(k+ne)+"H"+(L+V)+"V"+k+"H"+Q+"V"+Pe+"H"+(Q+pt)+"V"+(Pe+Lt)+"H"+Q+"V"+k+"Z"},Z}(),Yr=function(){function Z(L){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+L+"_"}return Object.defineProperty(Z.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Z.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(Z.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),Z.prototype.addClass=function(L){return this.styleSheet===void 0&&this.addStyleSheet(),L.name=""+this.classNamePrefix+L.localName,this.classes.push(L),this.styleSheet.sheet.insertRule("."+L.name+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length),L},Z.prototype.addRule=function(L){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(L),this.styleSheet.sheet.insertRule(L.selector+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length)},Z.prototype.addStyleSheet=function(){var L;this.styleSheet=document.createElement("style"),((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).appendChild(this.styleSheet),this.addRule(new tn("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new tn("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new tn("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new sn("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new sn("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Z.prototype.removeStyleSheet=function(){var L;this.styleSheet&&(((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Z}(),tn=function(Z,L){this.selector=Z,this.style=L},sn=function(Z,L){this.localName=Z,this.style=L},Qn=function(){function Z(){this.blocks=[],this.display=""}return Z.prototype.addButtonBlock=function(L){L.className=this.blockClassName,L.buttonClassName=this.buttonClassName,L.buttonColorsClassName=this.buttonColorsClassName,L.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(L)},Z.prototype.addElementBlock=function(L){L.className===void 0&&(L.className=this.blockClassName),this.blocks.push(L)},Z.prototype.getUI=function(){var L=document.createElement("div");return L.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,L.style.display=this.display,this.blocks.forEach(function(k){return L.appendChild(k.getUI())}),L},Z}(),sr=function(){function Z(){}return Z.prototype.getUI=function(){var L=document.createElement("div");if(L.className=this.className,this.minWidth!==void 0&&(L.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":L.style.justifyContent="flex-start";break;case"center":L.style.justifyContent="center";break;case"end":L.style.justifyContent="flex-end"}return L.style.whiteSpace="nowrap",L},Z}(),Nr=function(Z){function L(){var k=Z!==null&&Z.apply(this,arguments)||this;return k.buttons=[],k}return br(L,Z),L.prototype.addButton=function(k){k.className=this.buttonClassName,k.colorsClassName=this.buttonColorsClassName,k.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(k)},L.prototype.getUI=function(){var k=Z.prototype.getUI.call(this);return this.buttons.forEach(function(V){return k.appendChild(V.getUI())}),k},L}(sr),hn=function(){function Z(L,k){this._isActive=!1,this._isHidden=!1,this._icon=L,this.title=k,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(Z.prototype,"icon",{get:function(){return this._icon},set:function(L){this._icon=L,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isActive",{get:function(){return this._isActive},set:function(L){this._isActive=L,this.adjustClassName()},enumerable:!1,configurable:!0}),Z.prototype.getUI=function(){var L=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 L.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},Z.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,"")))},Z.prototype.hide=function(){this._isHidden=!0},Z}(),Qt=function(Z){function L(){var k=Z!==null&&Z.apply(this,arguments)||this;return k.elements=[],k}return br(L,Z),L.prototype.addElement=function(k){this.elements.push(k)},L.prototype.getUI=function(){var k=Z.prototype.getUI.call(this);return this.elements.forEach(function(V){return k.appendChild(V)}),k},L}(sr),$r=function(){function Z(L,k){this.horizontal=L,this.vertical=k}return Object.defineProperty(Z.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),Z.prototype.getVerticalLength=function(L){return L/this.ratio},Z.prototype.getHorizontalLength=function(L){return L*this.ratio},Z}(),fr=function(){function Z(){}return Z.getIcon=function(L,k){if(L>0&&k>0){var V=new $r(L,k),ne=V.ratio>=1?20:V.getHorizontalLength(20),Q=V.ratio<1?20:V.getVerticalLength(20),Pe=document.createElementNS("http://www.w3.org/2000/svg","svg");Pe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Pe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Pe);var pt=ln.createDefs();Pe.appendChild(pt);var Lt=ln.createElement("clipPath",[["id","text-bg-clip"]]);pt.appendChild(Lt);var rn=ln.createPath(ln.getHollowRectanglePath((24-ne)/2,(24-Q)/2,ne,Q,(24-ne)/2+2,(24-Q)/2+2,ne-4,Q-4));Pe.appendChild(rn);var vt=ln.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);vt.appendChild(ln.createTSpan(L+":"+k)),Pe.appendChild(vt);var Gt=vt.getBBox();ln.setAttributes(vt,[["x",((24-Gt.width)/2).toString()],["y",((24-Gt.height)/2-Gt.y).toString()]]);var pr=ln.createPath(ln.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Gt.width))/2,(24-Math.ceil(Gt.height))/2,Math.ceil(Gt.width),Math.ceil(Gt.height)));return Lt.appendChild(pr),ln.setAttributes(rn,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Pe),Pe.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>'},Z}(),Lr=function(Z){function L(k,V,ne){var Q=Z.call(this,k,V)||this;return Q.isDropdownOpen=!1,Q.onClick=Q.dropdownButtonClicked,Q.dropdownButtons=ne,Q}return br(L,Z),L.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(V){V.className=k.className,V.colorsClassName=k.colorsClassName,k.dropdownBlock.appendChild(V.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},L.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},L.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},L.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},L.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},L.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},L}(hn),kn=function(){function Z(L,k){this.GRIP_SIZE=10,this.color=L,this.fillColor=k,this.visual=ln.createGroup(),this.visual.appendChild(ln.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ln.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Z.prototype.ownsTarget=function(L){return L===this.visual||L===this.visual.childNodes[0]||L===this.visual.childNodes[1]},Z.prototype.setCenter=function(L,k){this.visual.childNodes.forEach(function(V){return ln.setAttributes(V,[["cx",L.toString()],["cy",k.toString()]])})},Z}(),Ur=function(){function Z(L,k,V,ne){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=L,this.canvasHeight=k,this.margin=V,this.container=ne,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(Z.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(L){this._aspectRatio=L,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(L){this._isGridVisible=L,this.gridContainer&&ln.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(L){this._zoomFactor=L,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Z.prototype.open=function(){var L=this;this.cropShadeElement=ln.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=ln.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var k=0;k<this.numberOfGridLines;k++)this.horizontalGridLines.push(ln.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(ln.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(V){return L.gridContainer.appendChild(V)}),this.verticalGridLines.forEach(function(V){return L.gridContainer.appendChild(V)}),this.cropRectElement=ln.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new kn(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new kn(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new kn(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new kn(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},Z.prototype.setCropRectangle=function(L){this.cropRect=L;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),ln.setAttributes(this.cropRectElement,[["x",k.x.toString()],["y",k.y.toString()],["width",k.width.toString()],["height",k.height.toString()]]);var V=k.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Q,Pe){var pt=k.y+V*(Pe+1);ln.setAttributes(Q,[["x1",""+k.x],["y1",""+pt],["x2",""+(k.x+k.width)],["y2",""+pt]])});var ne=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Q,Pe){var pt=k.x+ne*(Pe+1);ln.setAttributes(Q,[["x1",""+pt],["y1",""+k.y],["x2",""+pt],["y2",""+(k.y+k.height)]])}),ln.setAttributes(this.cropShadeElement,[["d",ln.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},Z.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)},Z.prototype.clientToLocalCoordinates=function(L,k){var V=this.container.getBoundingClientRect();return{x:L-V.left+this.margin,y:k-V.top+this.margin}},Z.prototype.onPointerDown=function(L){this.container.setPointerCapture(L.pointerId),this.previousPoint=this.clientToLocalCoordinates(L.clientX,L.clientY),this.cropRectElement===L.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(L.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(L.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(L.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(L.target)&&(this.activeGrip=this.bottomRightGrip)},Z.prototype.onPointerMove=function(L){if(this.isMoving)this.move(this.clientToLocalCoordinates(L.clientX,L.clientY));else if(this.activeGrip){var k=this.clientToLocalCoordinates(L.clientX,L.clientY);this.resize(k)}L.preventDefault()},Z.prototype.onPointerUp=function(L){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(L.pointerId)},Z.prototype.move=function(L){var k=L.x-this.previousPoint.x,V=L.y-this.previousPoint.y;this.zoomFactor!==1&&(k=-k/this.zoomFactor,V=-V/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+V),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=L},Z.prototype.resize=function(L){var k=Object.assign({},this.cropRect),V=L.x-this.previousPoint.x,ne=L.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:k.x+V<this.margin&&(V=this.margin-k.x),k.x+=V,k.width=this.cropRect.x+this.cropRect.width-k.x;break;case this.bottomRightGrip:case this.topRightGrip:k.width+V>this.canvasWidth*this.zoomFactor&&(V=this.canvasWidth*this.zoomFactor-k.width),k.width+=V}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(V),k.height=this.aspectRatio.getVerticalLength(k.width)):(k.y+=ne,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+=ne}k.width<10&&(k.x=this.cropRect.x,k.width=10),k.height<10&&(k.y=this.cropRect.y,k.height=10),this.previousPoint=L,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))},Z.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var L=this.cropRect.x+this.cropRect.width/2,k=this.cropRect.y+this.cropRect.height/2,V=this.aspectRatio.getHorizontalLength(this.cropRect.height),ne=this.aspectRatio.getVerticalLength(this.cropRect.width);V/this.canvasWidth<ne/this.canvasHeight?this.cropRect.width=V:this.cropRect.height=ne,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=L-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)}},Z.prototype.getRescaledRect=function(L,k,V,ne,Q,Pe){var pt=V/L,Lt=ne/k;return{x:(Q.x-Pe)*pt+Pe,y:(Q.y-Pe)*Lt+Pe,width:Q.width*pt,height:Q.height*Lt}},Z.prototype.scaleCanvas=function(L,k){var V=this.getRescaledRect(this.canvasWidth,this.canvasHeight,L,k,this.cropRect,this.margin);this.canvasWidth=L,this.canvasHeight=k,this.onCropChange&&this.onCropChange(V),this.setCropRectangle(V)},Z}(),vi=function(){function Z(L){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=L,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(Z.prototype,"angle",{get:function(){return this._angle},set:function(L){this._angle=L,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),Z.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},Z.prototype.onPointerDown=function(L){this.controlContainer.setPointerCapture(L.pointerId),this.isDragging=!0,this.previousPoint={x:L.clientX,y:L.clientY}},Z.prototype.onPointerMove=function(L){this.isDragging&&(this.onAngleChange&&this.onAngleChange((L.clientX-this.previousPoint.x)/5),this.previousPoint.x=L.clientX)},Z.prototype.onPointerUp=function(L){this.isDragging&&this.onAngleChange&&this.onAngleChange((L.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(L.pointerId)},Z.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var L=this.angleLabelText.getBBox();ln.setAttributes(this.angleLabelElement,[["x",((this.width-L.width)/2).toString()],["y",(this.height/2).toString()]])}},Z.prototype.positionScaleShape=function(){if(this.scaleShape){var L=this.scaleShape.transform.baseVal.getItem(0);L.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(L,0)}},Z.prototype.getVisual=function(){var L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.setAttribute("xmlns","http://www.w3.org/2000/svg"),L.setAttribute("width",this.width+"px"),L.setAttribute("height",this.height+"px"),L.setAttribute("viewBox","0 0 "+this.width+" "+this.height),L.style.flexShrink="0",document.body.appendChild(L);for(var k="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,V=1;V<=this.width/5+10;V++){var ne=V%5==0?this.height/3:this.height/6;k+="h4v"+-ne+"h1v"+ne}k+="v1H0Z",this.scaleShape=ln.createPath(k);var Q=ln.createTransform();this.scaleShape.transform.baseVal.appendItem(Q),L.appendChild(this.scaleShape),this.angleLabelElement=ln.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=ln.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Pe=ln.createTSpan("");return Pe.innerHTML="&deg;",this.angleLabelElement.appendChild(Pe),L.appendChild(this.angleLabelElement),document.body.removeChild(L),L},Z}(),Ai=function(){function Z(){this.naturalSize=!1,this.imageType="image/png"}return Z.prototype.rasterize=function(L,k,V,ne,Q,Pe,pt){var Lt=this;return new Promise(function(rn){var vt=document.createElement("canvas");vt.width=L.width.baseVal.value-2*ne,vt.height=L.height.baseVal.value-2*ne;var Gt=1,pr=1;Lt.naturalSize===!0?(Gt=k.naturalWidth/(L.width.baseVal.value-2*ne)/Pe,pr=k.naturalHeight/(L.height.baseVal.value-2*ne)/pt,vt.width=k.naturalWidth/Pe,vt.height=k.naturalHeight/pt):Lt.width!==void 0&&Lt.height!==void 0&&(Gt=Lt.width/V.width,pr=Lt.height/V.height,vt.width*=Gt,vt.height*=pr);var Ir=vt.getContext("2d");Ir.translate(vt.width/2,vt.height/2),Ir.rotate(Q*Math.PI/180),Ir.scale(Pe,pt),Ir.translate(-vt.width/2,-vt.height/2),Ir.drawImage(k,0,0,vt.width,vt.height);var Zt=document.createElement("canvas");Zt.width=V.width*Gt,Zt.height=V.height*pr,Zt.getContext("2d").putImageData(Ir.getImageData((V.x-ne)*Gt,(V.y-ne)*pr,V.width*Gt,V.height*pr),0,0),rn(Zt.toDataURL(Lt.imageType,Lt.imageQuality))})},Z}(),Et=function(){function Z(L){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=Z.instanceCounter++,this.styles=new Yr(this.instanceNo),this.target=L,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(Z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(L){this._zoomToCropEnabled=L,L?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(L){this._isGridVisible=L,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"gridLines",{get:function(){return this._gridLines},set:function(L){this._gridLines=L,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(L){this._rotationAngle=L,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"aspectRatio",{get:function(){var L;return(L=this._aspectRatio)!==null&&L!==void 0?L:this.aspectRatios[0]},set:function(L){this._aspectRatio=L},enumerable:!1,configurable:!0}),Z.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},Z.prototype.show=function(){this.showUI(),this.open()},Z.prototype.close=function(L){L===void 0&&(L=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),L||this.closeEventListeners.forEach(function(k){return k()}),this._isOpen=!1)},Z.prototype.addRenderEventListener=function(L){this.renderEventListeners.push(L)},Z.prototype.removeRenderEventListener=function(L){this.renderEventListeners.indexOf(L)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(L),1)},Z.prototype.addCloseEventListener=function(L){this.closeEventListeners.push(L)},Z.prototype.removeCloseEventListener=function(L){this.closeEventListeners.indexOf(L)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(L),1)},Z.prototype.setupResizeObserver=function(){var L=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){L.resize(L.target.clientWidth,L.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))},Z.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var L=1*this.target.clientWidth/this.target.clientHeight,k=this.contentDiv.clientWidth/L>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*L:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,V=k+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/L;this.resize(k,V)}},Z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Z.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",ln.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},Z.prototype.resize=function(L,k){this.imageWidth=Math.round(L),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()},Z.prototype.setEditingTarget=function(){var L=document.createElement("canvas");L.width=this.target.naturalWidth,L.height=this.target.naturalHeight,L.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var k=L.toDataURL();ln.setAttributes(this.editingTarget,[["href",k]]),this.setEditingTargetSize()},Z.prototype.setTopLeft=function(){var L=this.target.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=L.left-k.left-this.CANVAS_MARGIN,this.top=L.top-k.top-this.CANVAS_MARGIN},Z.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=ln.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=ln.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=ln.createGroup(),this.editingTargetRotationScaleContainer=ln.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var L=ln.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(L);var k=ln.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(k),this.editingTargetContainer=ln.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)},Z.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},Z.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=ln.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ur(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()},Z.prototype.zoomToCrop=function(){if(this.cropRect){var L=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=L+"px "+k+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-L+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-k+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},Z.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)},Z.prototype.cropRectChanged=function(L){this.cropRect=L,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},Z.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},Z.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"},Z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Z.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 L=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,k=this.target.offsetTop>L+this.CANVAS_MARGIN?this.target.offsetTop-(L+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},Z.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},Z.prototype.addTopToolbar=function(){var L=this;this.topToolbar=new Qn,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 Nr;k.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(k);var V=[];this.aspectRatios.forEach(function(pr){var Ir=new hn(fr.getIcon(pr.horizontal,pr.vertical),pr.horizontal===0&&pr.vertical===0?"FREE":pr.horizontal+":"+pr.vertical);Ir.onClick=function(){return L.ratioButtonClicked(pr)},V.push(Ir)}),this.aspectRatioButton=new Lr(fr.getIcon(0,0),"Aspect ratio",V),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 ne=new hn('<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");ne.isActive=this.isGridVisible,ne.onClick=function(){L.isGridVisible=!L.isGridVisible,ne.isActive=L.isGridVisible},k.addButton(ne);var Q=new hn('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(Q.isActive=this.zoomToCropEnabled,Q.onClick=function(){L.zoomToCropEnabled=!L.zoomToCropEnabled,Q.isActive=L.zoomToCropEnabled},k.addButton(Q),!Or.isLicensed){var Pe=new Qt;this.topToolbar.addElementBlock(Pe);var pt=document.createElement("div");pt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Lt=document.createElement("a");Lt.style.color="currentColor",Lt.href="https://markerjs.com/products/cropro",Lt.target="_blank",Lt.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>',pt.appendChild(Lt),Pe.addElement(pt)}var rn=new Nr;rn.minWidth=3*this.toolbarHeight+"px",rn.contentAlign="end",this.topToolbar.addButtonBlock(rn);var vt=new hn('<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");vt.onClick=this.startRenderAndClose,rn.addButton(vt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(vt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Gt=new hn('<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");Gt.onClick=this.close,rn.addButton(Gt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Gt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},Z.prototype.addBottomToolbar=function(){var L=this;this.bottomToolbar=new Qn,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 Nr;k.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(k);var V=new hn('<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");V.onClick=this.rotateLeftButtonClicked,k.addButton(V);var ne=new hn('<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");ne.onClick=this.rotateRightButtonClicked,k.addButton(ne);var Q=new Qt;Q.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Q),this.straightener=new vi("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(rn){L.rotateBy(rn),L.straightener.angle=L.rotationAngle},Q.addElement(this.straightener.getUI());var Pe=new Nr;Pe.minWidth=2*this.toolbarHeight+"px",Pe.contentAlign="end",this.bottomToolbar.addButtonBlock(Pe);var pt=new hn('<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");pt.onClick=this.flipHorizontallyButtonClicked,Pe.addButton(pt);var Lt=new hn('<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");Lt.onClick=this.flipVerticallyButtonClicked,Pe.addButton(Lt)},Z.prototype.ratioButtonClicked=function(L){this.aspectRatio=L,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},Z.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=fr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},Z.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new $r(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},Z.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Z.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},Z.prototype.restoreState=function(L){if(L){var k=this.cropLayer.getRescaledRect(L.width,L.height,this.imageWidth,this.imageHeight,L.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(k),this.cropRectChanged(k),this.flippedHorizontally=L.flippedHorizontally,this.flippedVertically=L.flippedVertically,this.applyFlip(),this.rotationAngle=L.rotationAngle,this.applyRotation()}},Z.prototype.clientToLocalCoordinates=function(L,k){var V=this.cropImage.getBoundingClientRect();return{x:L-V.left,y:k-V.top}},Z.prototype.onWindowResize=function(){this.positionUI()},Z.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var L=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=L+"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()},Z.prototype.rotateLeftButtonClicked=function(){var L=this.rotationAngle-90;this.rotationAngle%90!=0&&(L+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(L)},Z.prototype.rotateRightButtonClicked=function(){var L=this.rotationAngle+90;this.rotationAngle%90!=0&&(L-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(L)},Z.prototype.rotateTo=function(L){L=(L=L>180?L-360:L)<=-180?L+360:L,this.rotationAngle=L,this.applyRotation()},Z.prototype.rotateBy=function(L){this.rotateTo((this.rotationAngle+L)%360)},Z.prototype.applyRotation=function(){var L=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 V=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/V.width,this.imageHeight/V.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=L},Z.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},Z.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},Z.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},Z.prototype.startRenderAndClose=function(){return Pn(this,void 0,void 0,function(){var L,k;return Dr(this,function(V){switch(V.label){case 0:return[4,this.render()];case 1:return L=V.sent(),k=this.getState(),this.renderEventListeners.forEach(function(ne){return ne(L,k)}),this.close(!0),[2]}})})},Z.prototype.render=function(){return Pn(this,void 0,void 0,function(){var L;return Dr(this,function(k){switch(k.label){case 0:return(L=new Ai).naturalSize=this.renderAtNaturalSize,L.imageType=this.renderImageType,L.imageQuality=this.renderImageQuality,L.width=this.renderWidth,L.height=this.renderHeight,this.unzoomFromCrop(),ln.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,L.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,L.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()]}})})},Z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new sn("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 sn("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new sn("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var L=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new sn("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*L)+`px;
height: `+(this.toolbarHeight-2*L)+`px;
padding: `+L+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new sn("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new sn("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new tn("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new tn("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new sn("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 sn("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new sn("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 sn("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*L)+`px;
padding: `+L+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new sn("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},Z.instanceCounter=0,Z}(),fn=U("8hTe"),Gi=U.n(fn),zi=/<pre[^>]*>/g;function na(Z){var L=document.createElement("div");return L.innerHTML=Z,L.childNodes.length===0?"":L.childNodes[0].nodeValue}var Vi=ge.a=function(Z){var L=Z.value,k=L===void 0?"":L,V=Z.edit,ne=V===void 0?!1:V,Q=Z.className,Pe=Z.showTextOnly,pt=Z.showLines,Lt=Z.replaces,rn=Z.zoomImg,vt=Z.hasMask,Gt=Z.style,pr=Gt===void 0?{}:Gt,Ir=Z.stylesPrev,Zt=Ir===void 0?{}:Ir,mt=String(k),Pt=Object(I.useRef)(),Rt=Object(I.useRef)(),Ht=Object(I.useState)(""),un=Object(G.a)(Ht,2),xn=un[0],Cn=un[1],gn=Object(I.useState)("office"),Ln=Object(G.a)(gn,2),Kn=Ln[0],dn=Ln[1],Sn=function(){var jt=new Et(Rt.current);jt.displayMode="popup",jt.addRenderEventListener(function(){var yn=Object(F.a)(n.a.mark(function Ct(Mt){var Dt;return n.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return Pt.current.style.display="none",Vt.next=3,Object(ye.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Mt}});case 3:Dt=Vt.sent,Dt!=null&&Dt.id&&Lt(Rt.current.getAttribute("src").replace(X.a.API_SERVER,""),"/api/attachments/".concat(Dt==null?void 0:Dt.id,"?type=").concat(Dt.content_type));case 5:case"end":return Vt.stop()}},Ct)}));return function(Ct){return yn.apply(this,arguments)}}()),jt.show()},hr=function(){var jt=new Dn(Rt.current);jt.settings.displayMode="popup",jt.addEventListener("render",function(){var yn=Object(F.a)(n.a.mark(function Ct(Mt){var Dt;return n.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(Pt.current.style.display="none",!Rt.current){Vt.next=6;break}return Vt.next=4,Object(ye.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Mt.dataUrl}});case 4:Dt=Vt.sent,Dt!=null&&Dt.id&&Lt(Rt.current.getAttribute("src").replace(X.a.API_SERVER,""),"/api/attachments/".concat(Dt==null?void 0:Dt.id,"?type=").concat(Dt.content_type));case 6:case"end":return Vt.stop()}},Ct)}));return function(Ct){return yn.apply(this,arguments)}}()),jt.show(),window.markerArea=jt},Nn=Object(I.useMemo)(function(){Pt.current&&(Pt.current.style.zIndex=-1);try{var zt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,jt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;mt=mt.replace(zt,"("+X.a.API_SERVER+"/api/attachments/").replace(jt,'"'+X.a.API_SERVER+"/api/attachments/").replace(yn,'"'+X.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(ke){}var Ct=M(mt),Mt=C();if(mt.match(/\[TOC\]/)&&(Ct=Ct.replace("<p>[TOC]</p>",R()),D()),Ct=Ct.replace(/(__special_katext_id_\d+__)/g,function(ke,Vt){var Tn=Mt[Vt],mr=Tn.type,On=Tn.expression;return Object(q.renderToString)(na(On)||"",{displayMode:mr==="block",throwOnError:!1,output:"html"})}),Ct=Ct.replace(/▁/g,"\u2581\u2581\u2581"),x(),Pe){var Dt=document.createElement("div");return Dt.innerHTML=Ct,Dt.innerText}return setTimeout(function(){return lr()},500),Ct},[mt]),Kt=Object(I.useRef)();A.WebkitLineClamp=pt,pt&&(pr=Object(P.a)(Object(P.a)({},pr),A));function An(zt){var jt=zt.target;if(jt.tagName.toUpperCase()==="IMG"){if(rn){var yn=jt.getAttribute("src");Cn(yn),dn("image")}}else if(jt.tagName.toUpperCase()==="A"){var Ct=jt.getAttribute("href");if(Ct.indexOf("office")>-1)zt.preventDefault(),Cn(Ct),dn("office");else if(Ct.indexOf("application/pdf")>-1)zt.preventDefault(),Cn(Ct),dn("pdf");else if(Ct.indexOf("text/html")>-1)zt.preventDefault(),Cn(Ct),dn("html");else if(Ct.startsWith("#")){zt.preventDefault();var Mt=document.getElementById(Ct.replace("#",""));Mt&&Mt.scrollIntoView(!0)}}}var lr=function(){var jt,yn=(jt=Kt.current)===null||jt===void 0?void 0:jt.querySelectorAll("video");yn==null||yn.forEach(function(Ct){if(Ct.oncontextmenu=function(){return!1},Ct.src.indexOf(".m3u8")>-1&&!Ct.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var Mt=new H.a;Mt.loadSource(Ct.src),Mt.attachMedia(Ct)}}})};Object(I.useEffect)(function(){if(Kt.current&&Nn&&(Nn.match(zi)&&window.PR.prettyPrint()),Kt.current)return Kt.current.addEventListener("click",An),function(){Kt.current.removeEventListener("click",An),x(),D()}},[Nn,Kt.current,An]);var Un=function(jt){if(!ne)return;jt.target.nodeName==="IMG"?(Pt.current.style.zIndex=1,Pt.current.style.display="flex",Pt.current.style.width=jt.target.clientWidth+"px",Pt.current.style.height=jt.target.clientHeight+"px",Pt.current.style.top=jt.target.offsetTop+"px",Pt.current.style.left=jt.target.offsetLeft+"px",Rt.current.src=jt.target.getAttribute("src")):Pt.current.style.display="none"};return E.a.createElement("div",{style:{position:"relative"}},E.a.createElement("div",{ref:Kt,style:Object(P.a)({},pr),className:"".concat(Q||""," markdown-body ").concat(Gi.a.mdBody),onMouseOver:Un,dangerouslySetInnerHTML:{__html:Nn}}),E.a.createElement("div",{ref:Pt,className:Gi.a.button},E.a.createElement(Y.a,null,E.a.createElement(z.a,{onClick:function(){return Sn()}},"\u88C1\u526A"),E.a.createElement(z.a,{onClick:function(){return hr()}},"\u7F16\u8F91"))),E.a.createElement("img",{ref:Rt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),E.a.createElement(re.a,{close:!0,data:xn,type:xn!=null&&xn.length?Kn:"",style:Object(P.a)({},Zt),onClose:function(){return Cn("")}}))}},"9VGf":function(ct,ge,U){"use strict";U.d(ge,"a",function(){return N});var te=U("q1tI"),Y=U.n(te);function N(z,P){var F=Object(te.useRef)();Object(te.useEffect)(function(){F.current=z}),Object(te.useEffect)(function(){function G(){F.current()}if(P!==null){var K=setInterval(G,P);return function(){return clearInterval(K)}}},[P])}},"A60/":function(ct,ge,U){ct.exports={wrap:"wrap___37dvp",right20:"right20___2yZBe",right180:"right180___14fSn",basket:"basket___32ZdA",count:"count___2ydNT",iconWrap:"iconWrap___2cEp5",icon:"icon___3fYs3",name:"name___7IPYm"}},BU3w:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return F});var te=U("MNnm"),Y="rc-util-key";function N(G){if(G.attachTo)return G.attachTo;var K=document.querySelector("head");return K||document.body}function z(G){var K,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(te.a)())return null;var I=document.createElement("style");if((K=n.csp)===null||K===void 0?void 0:K.nonce){var E;I.nonce=(E=n.csp)===null||E===void 0?void 0:E.nonce}I.innerHTML=G;var f=N(n),b=f.firstChild;return n.prepend&&f.prepend?f.prepend(I):n.prepend&&b?f.insertBefore(I,b):f.appendChild(I),I}var P=new Map;function F(G,K){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=N(n);if(!P.has(I)){var E=z("",n),f=E.parentNode;P.set(I,f),f.removeChild(E)}var b=Array.from(P.get(I).children).find(function(u){return u.tagName==="STYLE"&&u[Y]===K});if(b){var c,a;if(((c=n.csp)===null||c===void 0?void 0:c.nonce)&&b.nonce!==((a=n.csp)===null||a===void 0?void 0:a.nonce)){var p;b.nonce=(p=n.csp)===null||p===void 0?void 0:p.nonce}return b.innerHTML!==G&&(b.innerHTML=G),b}var l=z(G,n);return l[Y]=K,l}},Bd2K:function(ct,ge,U){(function(te){te(U("VrN/"),U("osHv"))})(function(te){te.defineOption("autoCloseTags",!1,function(n,I,E){if(E!=te.Init&&E&&n.removeKeyMap("autoCloseTags"),!I)return;var f={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(f["'/'"]=function(b){return F(b)}),(typeof I!="object"||I.whenOpening!==!1)&&(f["'>'"]=function(b){return z(b)}),n.addKeyMap(f)});var Y=["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 z(n){if(n.getOption("disableInput"))return te.Pass;for(var I=n.listSelections(),E=[],f=n.getOption("autoCloseTags"),b=0;b<I.length;b++){if(!I[b].empty())return te.Pass;var c=I[b].head,a=n.getTokenAt(c),p=te.innerMode(n.getMode(),a.state),l=p.state,u=p.mode.xmlCurrentTag&&p.mode.xmlCurrentTag(l),s=u&&u.name;if(!s)return te.Pass;var i=p.mode.configuration=="html",D=typeof f=="object"&&f.dontCloseTags||i&&Y,A=typeof f=="object"&&f.indentTags||i&&N;a.end>c.ch&&(s=s.slice(0,s.length-a.end+c.ch));var S=s.toLowerCase();if(!s||a.type=="string"&&(a.end!=c.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||a.string.length==1)||a.type=="tag"&&u.close||a.string.indexOf("/")==c.ch-a.start-1||D&&G(D,S)>-1||K(n,p.mode.xmlCurrentContext&&p.mode.xmlCurrentContext(l)||[],s,c,!0))return te.Pass;var R=typeof f=="object"&&f.emptyTags;if(R&&G(R,s)>-1){E[b]={text:"/>",newPos:te.Pos(c.line,c.ch+2)};continue}var O=A&&G(A,S)>-1;E[b]={indent:O,text:">"+(O?`
`:"")+"</"+s+">",newPos:O?te.Pos(c.line+1,0):te.Pos(c.line,c.ch+1)}}for(var g=typeof f=="object"&&f.dontIndentOnAutoClose,b=I.length-1;b>=0;b--){var _=E[b];n.replaceRange(_.text,I[b].head,I[b].anchor,"+insert");var h=n.listSelections().slice(0);h[b]={head:_.newPos,anchor:_.newPos},n.setSelections(h),!g&&_.indent&&(n.indentLine(_.newPos.line,null,!0),n.indentLine(_.newPos.line+1,null,!0))}}function P(n,I){for(var E=n.listSelections(),f=[],b=I?"/":"</",c=n.getOption("autoCloseTags"),a=typeof c=="object"&&c.dontIndentOnSlash,p=0;p<E.length;p++){if(!E[p].empty())return te.Pass;var l=E[p].head,u=n.getTokenAt(l),s=te.innerMode(n.getMode(),u.state),i=s.state;if(I&&(u.type=="string"||u.string.charAt(0)!="<"||u.start!=l.ch-1))return te.Pass;var D,A=s.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(A&&s.mode.name=="javascript")D=b+"script";else if(A&&s.mode.name=="css")D=b+"style";else{var S=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(i);if(!S||S.length&&K(n,S,S[S.length-1],l))return te.Pass;D=b+S[S.length-1]}n.getLine(l.line).charAt(u.end)!=">"&&(D+=">"),f[p]=D}if(n.replaceSelections(f),E=n.listSelections(),!a)for(var p=0;p<E.length;p++)(p==E.length-1||E[p].head.line<E[p+1].head.line)&&n.indentLine(E[p].head.line)}function F(n){return n.getOption("disableInput")?te.Pass:P(n,!0)}te.commands.closeTag=function(n){return P(n)};function G(n,I){if(n.indexOf)return n.indexOf(I);for(var E=0,f=n.length;E<f;++E)if(n[E]==I)return E;return-1}function K(n,I,E,f,b){if(!te.scanForClosingTag)return!1;var c=Math.min(n.lastLine()+1,f.line+500),a=te.scanForClosingTag(n,f,null,c);if(!a||a.tag!=E)return!1;for(var p=b?1:0,l=I.length-1;l>=0&&I[l]==E;l--)++p;f=a.to;for(var l=1;l<p;l++){var u=te.scanForClosingTag(n,f,null,c);if(!u||u.tag!=E)return!1;f=u.to}return!0}})},BdwD:function(ct,ge,U){"use strict";var te=U("+L6B"),Y=U("2/Rp"),N=U("0Owb"),z=U("k1fw"),P=U("q1tI"),F=U.n(P),G=U("FOrL"),K=U.n(G),n=function(E){var f=E.buttonProps,b=f===void 0?{}:f,c=E.styles,a=c===void 0?{}:c,p=E.customText,l=E.ButtonText,u=E.ButtonClick,s=E.Buttonclass,i=E.ButtonTwo;return F.a.createElement("section",{className:"tc animated fadeIn",style:Object(z.a)(Object(z.a)({},{color:"#999",margin:"200px auto"}),a)},F.a.createElement("img",{src:K.a}),F.a.createElement("p",{className:"mt20 font14"},p||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),l&&F.a.createElement(Y.a,Object(N.a)({className:s,onClick:u},b),l),i&&i)};ge.a=n},BjJ7:function(ct,ge,U){"use strict";U.d(ge,"d",function(){return Y}),U.d(ge,"c",function(){return N}),U.d(ge,"e",function(){return z}),U.d(ge,"b",function(){return P}),U.d(ge,"a",function(){return G});var te=U("m3rI");function Y(K){var n=!0;if(K.length>0){for(var I=0;I<K.length;I++)if(K[I].compile_success==0||!K[I].compile_success){n=!1;break}}else n=!1;return n}function N(K){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",I=[],E=0;E<K.length;E++){var f=K[E],b=n?"".concat(n,"/").concat(f.name):"".concat(f.name);I.push({title:f.name,isLeaf:!(f.type==="tree"),key:b})}return I}function z(K,n,I){for(var E=0;E<K.length;E++){var f=K[E];if(f.key===n){f.children=I;break}f.children&&z(f.children,n,I)}return K}function P(K,n,I){var E;return function(){var f=this,b=arguments,c=function(){E=null,I||K.apply(f,b)},a=I&&!E;clearTimeout(E),E=setTimeout(c,n),a&&K.apply(f,b)}}var F=!0,G=te.a.API_SERVER},"C+DQ":function(ct,ge,U){},"C/vA":function(ct,ge,U){"use strict";U.d(ge,"a",function(){return te});function te(Y){const N=this;let z=!1,P;return function(){return z||(z=!0,P=Y.apply(N,arguments)),P}}},"Cg/j":function(ct,ge,U){"use strict";U.d(ge,"b",function(){return te}),U.d(ge,"a",function(){return Y}),U.d(ge,"c",function(){return z}),U.d(ge,"d",function(){return P});var te;(function(F){F.serviceIds=new Map,F.DI_TARGET="$di$target",F.DI_DEPENDENCIES="$di$dependencies";function G(K){return K[F.DI_DEPENDENCIES]||[]}F.getServiceDependencies=G})(te||(te={}));const Y=z("instantiationService");function N(F,G,K,n){G[te.DI_TARGET]===G?G[te.DI_DEPENDENCIES].push({id:F,index:K,optional:n}):(G[te.DI_DEPENDENCIES]=[{id:F,index:K,optional:n}],G[te.DI_TARGET]=G)}function z(F){if(te.serviceIds.has(F))return te.serviceIds.get(F);const G=function(K,n,I){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");N(G,K,I,!1)};return G.toString=()=>F,te.serviceIds.set(F,G),G}function P(F){return function(G,K,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");N(F,G,n,!0)}}},DlQD:function(ct,ge,U){(function(te,Y){ct.exports=Y()})(this,function(){"use strict";function te(xe,we){for(var me=0;me<we.length;me++){var ce=we[me];ce.enumerable=ce.enumerable||!1,ce.configurable=!0,"value"in ce&&(ce.writable=!0),Object.defineProperty(xe,ce.key,ce)}}function Y(xe,we,me){return we&&te(xe.prototype,we),me&&te(xe,me),xe}function N(xe,we){if(!xe)return;if(typeof xe=="string")return z(xe,we);var me=Object.prototype.toString.call(xe).slice(8,-1);if(me==="Object"&&xe.constructor&&(me=xe.constructor.name),me==="Map"||me==="Set")return Array.from(xe);if(me==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(me))return z(xe,we)}function z(xe,we){(we==null||we>xe.length)&&(we=xe.length);for(var me=0,ce=new Array(we);me<we;me++)ce[me]=xe[me];return ce}function P(xe,we){var me;if(typeof Symbol=="undefined"||xe[Symbol.iterator]==null){if(Array.isArray(xe)||(me=N(xe))||we&&xe&&typeof xe.length=="number"){me&&(xe=me);var ce=0;return function(){return ce>=xe.length?{done:!0}:{done:!1,value:xe[ce++]}}}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 me=xe[Symbol.iterator](),me.next.bind(me)}function F(xe,we){return we={exports:{}},xe(we,we.exports),we.exports}var G=F(function(xe){function we(){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 me(ce){xe.exports.defaults=ce}xe.exports={defaults:we(),getDefaults:we,changeDefaults:me}}),K=G.defaults,n=G.getDefaults,I=G.changeDefaults,E=/[&<>"']/,f=/[&<>"']/g,b=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},p=function(we){return a[we]};function l(xe,we){if(we){if(E.test(xe))return xe.replace(f,p)}else if(b.test(xe))return xe.replace(c,p);return xe}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(xe){return xe.replace(u,function(we,me){return me=me.toLowerCase(),me==="colon"?":":me.charAt(0)==="#"?me.charAt(1)==="x"?String.fromCharCode(parseInt(me.substring(2),16)):String.fromCharCode(+me.substring(1)):""})}var i=/(^|[^\[])\^/g;function D(xe,we){xe=xe.source||xe,we=we||"";var me={replace:function(he,Te){return Te=Te.source||Te,Te=Te.replace(i,"$1"),xe=xe.replace(he,Te),me},getRegex:function(){return new RegExp(xe,we)}};return me}var A=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(xe,we,me){if(xe){var ce;try{ce=decodeURIComponent(s(me)).replace(A,"").toLowerCase()}catch(he){return null}if(ce.indexOf("javascript:")===0||ce.indexOf("vbscript:")===0||ce.indexOf("data:")===0)return null}we&&!S.test(me)&&(me=d(we,me));try{me=encodeURI(me).replace(/%25/g,"%")}catch(he){return null}return me}var O={},g=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(xe,we){O[" "+xe]||(g.test(xe)?O[" "+xe]=xe+"/":O[" "+xe]=j(xe,"/",!0)),xe=O[" "+xe];var me=xe.indexOf(":")===-1;return we.substring(0,2)==="//"?me?we:xe.replace(_,"$1")+we:we.charAt(0)==="/"?me?we:xe.replace(h,"$1")+we:xe+we}var C={exec:function(){}};function x(xe){for(var we=1,me,ce;we<arguments.length;we++){me=arguments[we];for(ce in me)Object.prototype.hasOwnProperty.call(me,ce)&&(xe[ce]=me[ce])}return xe}function w(xe,we){var me=xe.replace(/\|/g,function(Te,Re,Me){for(var et=!1,ht=Re;--ht>=0&&Me[ht]==="\\";)et=!et;return et?"|":" |"}),ce=me.split(/ \|/),he=0;if(ce.length>we)ce.splice(we);else for(;ce.length<we;)ce.push("");for(;he<ce.length;he++)ce[he]=ce[he].trim().replace(/\\\|/g,"|");return ce}function j(xe,we,me){var ce=xe.length;if(ce===0)return"";for(var he=0;he<ce;){var Te=xe.charAt(ce-he-1);if(Te===we&&!me)he++;else if(Te!==we&&me)he++;else break}return xe.substr(0,ce-he)}function W(xe,we){if(xe.indexOf(we[1])===-1)return-1;for(var me=xe.length,ce=0,he=0;he<me;he++)if(xe[he]==="\\")he++;else if(xe[he]===we[0])ce++;else if(xe[he]===we[1]&&(ce--,ce<0))return he;return-1}function T(xe){xe&&xe.sanitize&&!xe.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:l,unescape:s,edit:D,cleanUrl:R,resolveUrl:d,noopTest:C,merge:x,splitCells:w,rtrim:j,findClosingBracket:W,checkSanitizeDeprecation:T},m=G.defaults,v=M.rtrim,H=M.splitCells,X=M.escape,q=M.findClosingBracket;function re(xe,we,me){var ce=we.href,he=we.title?X(we.title):null,Te=xe[1].replace(/\\([\[\]])/g,"$1");return xe[0].charAt(0)!=="!"?{type:"link",raw:me,href:ce,title:he,text:Te}:{type:"image",raw:me,href:ce,title:he,text:X(Te)}}function ye(xe,we){var me=xe.match(/^(\s+)(?:```)/);if(me===null)return we;var ce=me[1];return we.split(`
`).map(function(he){var Te=he.match(/^\s+/);if(Te===null)return he;var Re=Te[0];return Re.length>=ce.length?he.slice(ce.length):he}).join(`
`)}var pe=function(){function xe(me){this.options=me||m}var we=xe.prototype;return we.space=function(ce){var he=this.rules.block.newline.exec(ce);if(he)return he[0].length>1?{type:"space",raw:he[0]}:{raw:`
`}},we.code=function(ce,he){var Te=this.rules.block.code.exec(ce);if(Te){var Re=he[he.length-1];if(Re&&Re.type==="paragraph")return{raw:Te[0],text:Te[0].trimRight()};var Me=Te[0].replace(/^ {4}/gm,"");return{type:"code",raw:Te[0],codeBlockStyle:"indented",text:this.options.pedantic?Me:v(Me,`
`)}}},we.fences=function(ce){var he=this.rules.block.fences.exec(ce);if(he){var Te=he[0],Re=ye(Te,he[3]||"");return{type:"code",raw:Te,lang:he[2]?he[2].trim():he[2],text:Re}}},we.heading=function(ce){var he=this.rules.block.heading.exec(ce);if(he)return{type:"heading",raw:he[0],depth:he[1].length,text:he[2]}},we.nptable=function(ce){var he=this.rules.block.nptable.exec(ce);if(he){var Te={type:"table",header:H(he[1].replace(/^ *| *\| *$/g,"")),align:he[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:he[3]?he[3].replace(/\n$/,"").split(`
`):[],raw:he[0]};if(Te.header.length===Te.align.length){var Re=Te.align.length,Me;for(Me=0;Me<Re;Me++)/^ *-+: *$/.test(Te.align[Me])?Te.align[Me]="right":/^ *:-+: *$/.test(Te.align[Me])?Te.align[Me]="center":/^ *:-+ *$/.test(Te.align[Me])?Te.align[Me]="left":Te.align[Me]=null;for(Re=Te.cells.length,Me=0;Me<Re;Me++)Te.cells[Me]=H(Te.cells[Me],Te.header.length);return Te}}},we.hr=function(ce){var he=this.rules.block.hr.exec(ce);if(he)return{type:"hr",raw:he[0]}},we.blockquote=function(ce){var he=this.rules.block.blockquote.exec(ce);if(he){var Te=he[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:he[0],text:Te}}},we.list=function(ce){var he=this.rules.block.list.exec(ce);if(he){for(var Te=he[0],Re=he[2],Me=Re.length>1,et=Re[Re.length-1]===")",ht={type:"list",raw:Te,ordered:Me,start:Me?+Re.slice(0,-1):"",loose:!1,items:[]},Ut=he[0].match(this.rules.block.item),nn=!1,en,mn,En,$t,rr,Dn,Sr,br=Ut.length,Pn=0;Pn<br;Pn++)en=Ut[Pn],Te=en,mn=en.length,en=en.replace(/^ *([*+-]|\d+[.)]) */,""),~en.indexOf(`
`)&&(mn-=en.length,en=this.options.pedantic?en.replace(/^ {1,4}/gm,""):en.replace(new RegExp("^ {1,"+mn+"}","gm"),"")),Pn!==br-1&&(En=this.rules.block.bullet.exec(Ut[Pn+1])[0],(Me?En.length===1||!et&&En[En.length-1]===")":En.length>1||this.options.smartLists&&En!==Re)&&($t=Ut.slice(Pn+1).join(`
`),ht.raw=ht.raw.substring(0,ht.raw.length-$t.length),Pn=br-1)),rr=nn||/\n\n(?!\s*$)/.test(en),Pn!==br-1&&(nn=en.charAt(en.length-1)===`
`,rr||(rr=nn)),rr&&(ht.loose=!0),Dn=/^\[[ xX]\] /.test(en),Sr=void 0,Dn&&(Sr=en[1]!==" ",en=en.replace(/^\[[ xX]\] +/,"")),ht.items.push({type:"list_item",raw:Te,task:Dn,checked:Sr,loose:rr,text:en});return ht}},we.html=function(ce){var he=this.rules.block.html.exec(ce);if(he)return{type:this.options.sanitize?"paragraph":"html",raw:he[0],pre:!this.options.sanitizer&&(he[1]==="pre"||he[1]==="script"||he[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):X(he[0]):he[0]}},we.def=function(ce){var he=this.rules.block.def.exec(ce);if(he){he[3]&&(he[3]=he[3].substring(1,he[3].length-1));var Te=he[1].toLowerCase().replace(/\s+/g," ");return{tag:Te,raw:he[0],href:he[2],title:he[3]}}},we.table=function(ce){var he=this.rules.block.table.exec(ce);if(he){var Te={type:"table",header:H(he[1].replace(/^ *| *\| *$/g,"")),align:he[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:he[3]?he[3].replace(/\n$/,"").split(`
`):[]};if(Te.header.length===Te.align.length){Te.raw=he[0];var Re=Te.align.length,Me;for(Me=0;Me<Re;Me++)/^ *-+: *$/.test(Te.align[Me])?Te.align[Me]="right":/^ *:-+: *$/.test(Te.align[Me])?Te.align[Me]="center":/^ *:-+ *$/.test(Te.align[Me])?Te.align[Me]="left":Te.align[Me]=null;for(Re=Te.cells.length,Me=0;Me<Re;Me++)Te.cells[Me]=H(Te.cells[Me].replace(/^ *\| *| *\| *$/g,""),Te.header.length);return Te}}},we.lheading=function(ce){var he=this.rules.block.lheading.exec(ce);if(he)return{type:"heading",raw:he[0],depth:he[2].charAt(0)==="="?1:2,text:he[1]}},we.paragraph=function(ce){var he=this.rules.block.paragraph.exec(ce);if(he)return{type:"paragraph",raw:he[0],text:he[1].charAt(he[1].length-1)===`
`?he[1].slice(0,-1):he[1]}},we.text=function(ce,he){var Te=this.rules.block.text.exec(ce);if(Te){var Re=he[he.length-1];return Re&&Re.type==="text"?{raw:Te[0],text:Te[0]}:{type:"text",raw:Te[0],text:Te[0]}}},we.escape=function(ce){var he=this.rules.inline.escape.exec(ce);if(he)return{type:"escape",raw:he[0],text:X(he[1])}},we.tag=function(ce,he,Te){var Re=this.rules.inline.tag.exec(ce);if(Re)return!he&&/^<a /i.test(Re[0])?he=!0:he&&/^<\/a>/i.test(Re[0])&&(he=!1),!Te&&/^<(pre|code|kbd|script)(\s|>)/i.test(Re[0])?Te=!0:Te&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Re[0])&&(Te=!1),{type:this.options.sanitize?"text":"html",raw:Re[0],inLink:he,inRawBlock:Te,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Re[0]):X(Re[0]):Re[0]}},we.link=function(ce){var he=this.rules.inline.link.exec(ce);if(he){var Te=q(he[2],"()");if(Te>-1){var Re=he[0].indexOf("!")===0?5:4,Me=Re+he[1].length+Te;he[2]=he[2].substring(0,Te),he[0]=he[0].substring(0,Me).trim(),he[3]=""}var et=he[2],ht="";if(this.options.pedantic){var Ut=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(et);Ut?(et=Ut[1],ht=Ut[3]):ht=""}else ht=he[3]?he[3].slice(1,-1):"";et=et.trim().replace(/^<([\s\S]*)>$/,"$1");var nn=re(he,{href:et&&et.replace(this.rules.inline._escapes,"$1"),title:ht&&ht.replace(this.rules.inline._escapes,"$1")},he[0]);return nn}},we.reflink=function(ce,he){var Te;if((Te=this.rules.inline.reflink.exec(ce))||(Te=this.rules.inline.nolink.exec(ce))){var Re=(Te[2]||Te[1]).replace(/\s+/g," ");if(Re=he[Re.toLowerCase()],!Re||!Re.href){var Me=Te[0].charAt(0);return{type:"text",raw:Me,text:Me}}var et=re(Te,Re,Te[0]);return et}},we.strong=function(ce,he,Te){Te===void 0&&(Te="");var Re=this.rules.inline.strong.start.exec(ce);if(Re&&(!Re[1]||Re[1]&&(Te===""||this.rules.inline.punctuation.exec(Te)))){he=he.slice(-1*ce.length);var Me=Re[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Me.lastIndex=0;for(var et;(Re=Me.exec(he))!=null;)if(et=this.rules.inline.strong.middle.exec(he.slice(0,Re.index+3)),et)return{type:"strong",raw:ce.slice(0,et[0].length),text:ce.slice(2,et[0].length-2)}}},we.em=function(ce,he,Te){Te===void 0&&(Te="");var Re=this.rules.inline.em.start.exec(ce);if(Re&&(!Re[1]||Re[1]&&(Te===""||this.rules.inline.punctuation.exec(Te)))){he=he.slice(-1*ce.length);var Me=Re[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Me.lastIndex=0;for(var et;(Re=Me.exec(he))!=null;)if(et=this.rules.inline.em.middle.exec(he.slice(0,Re.index+2)),et)return{type:"em",raw:ce.slice(0,et[0].length),text:ce.slice(1,et[0].length-1)}}},we.codespan=function(ce){var he=this.rules.inline.code.exec(ce);if(he){var Te=he[2].replace(/\n/g," "),Re=/[^ ]/.test(Te),Me=Te.startsWith(" ")&&Te.endsWith(" ");return Re&&Me&&(Te=Te.substring(1,Te.length-1)),Te=X(Te,!0),{type:"codespan",raw:he[0],text:Te}}},we.br=function(ce){var he=this.rules.inline.br.exec(ce);if(he)return{type:"br",raw:he[0]}},we.del=function(ce){var he=this.rules.inline.del.exec(ce);if(he)return{type:"del",raw:he[0],text:he[1]}},we.autolink=function(ce,he){var Te=this.rules.inline.autolink.exec(ce);if(Te){var Re,Me;return Te[2]==="@"?(Re=X(this.options.mangle?he(Te[1]):Te[1]),Me="mailto:"+Re):(Re=X(Te[1]),Me=Re),{type:"link",raw:Te[0],text:Re,href:Me,tokens:[{type:"text",raw:Re,text:Re}]}}},we.url=function(ce,he){var Te;if(Te=this.rules.inline.url.exec(ce)){var Re,Me;if(Te[2]==="@")Re=X(this.options.mangle?he(Te[0]):Te[0]),Me="mailto:"+Re;else{var et;do et=Te[0],Te[0]=this.rules.inline._backpedal.exec(Te[0])[0];while(et!==Te[0]);Re=X(Te[0]),Te[1]==="www."?Me="http://"+Re:Me=Re}return{type:"link",raw:Te[0],text:Re,href:Me,tokens:[{type:"text",raw:Re,text:Re}]}}},we.inlineText=function(ce,he,Te){var Re=this.rules.inline.text.exec(ce);if(Re){var Me;return he?Me=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Re[0]):X(Re[0]):Re[0]:Me=X(this.options.smartypants?Te(Re[0]):Re[0]),{type:"text",raw:Re[0],text:Me}}},xe}(),ue=M.noopTest,fe=M.edit,be=M.merge,se={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ue,table:ue,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,se.def=fe(se.def).replace("label",se._label).replace("title",se._title).getRegex(),se.bullet=/(?:[*+-]|\d{1,9}[.)])/,se.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,se.item=fe(se.item,"gm").replace(/bull/g,se.bullet).getRegex(),se.list=fe(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex(),se._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",se._comment=/<!--(?!-?>)[\s\S]*?-->/,se.html=fe(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),se.paragraph=fe(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex(),se.blockquote=fe(se.blockquote).replace("paragraph",se.paragraph).getRegex(),se.normal=be({},se),se.gfm=be({},se.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),se.gfm.nptable=fe(se.gfm.nptable).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex(),se.gfm.table=fe(se.gfm.table).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex(),se.pedantic=be({},se.normal,{html:fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ue,paragraph:fe(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ae={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ue,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:ue,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ae._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ae.punctuation=fe(ae.punctuation).replace(/punctuation/g,ae._punctuation).getRegex(),ae._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ae._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ae.em.start=fe(ae.em.start).replace(/punctuation/g,ae._punctuation).getRegex(),ae.em.middle=fe(ae.em.middle).replace(/punctuation/g,ae._punctuation).replace(/overlapSkip/g,ae._overlapSkip).getRegex(),ae.em.endAst=fe(ae.em.endAst,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.em.endUnd=fe(ae.em.endUnd,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.start=fe(ae.strong.start).replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.middle=fe(ae.strong.middle).replace(/punctuation/g,ae._punctuation).replace(/blockSkip/g,ae._blockSkip).getRegex(),ae.strong.endAst=fe(ae.strong.endAst,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.endUnd=fe(ae.strong.endUnd,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.blockSkip=fe(ae._blockSkip,"g").getRegex(),ae.overlapSkip=fe(ae._overlapSkip,"g").getRegex(),ae._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ae._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ae._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ae.autolink=fe(ae.autolink).replace("scheme",ae._scheme).replace("email",ae._email).getRegex(),ae._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ae.tag=fe(ae.tag).replace("comment",se._comment).replace("attribute",ae._attribute).getRegex(),ae._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ae._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ae._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ae.link=fe(ae.link).replace("label",ae._label).replace("href",ae._href).replace("title",ae._title).getRegex(),ae.reflink=fe(ae.reflink).replace("label",ae._label).getRegex(),ae.reflinkSearch=fe(ae.reflinkSearch,"g").replace("reflink",ae.reflink).replace("nolink",ae.nolink).getRegex(),ae.normal=be({},ae),ae.pedantic=be({},ae.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:fe(/^!?\[(label)\]\((.*?)\)/).replace("label",ae._label).getRegex(),reflink:fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae._label).getRegex()}),ae.gfm=be({},ae.normal,{escape:fe(ae.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ae.gfm.url=fe(ae.gfm.url,"i").replace("email",ae.gfm._extended_email).getRegex(),ae.breaks=be({},ae.gfm,{br:fe(ae.br).replace("{2,}","*").getRegex(),text:fe(ae.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ce={block:se,inline:ae},ze=G.defaults,Ye=Ce.block,He=Ce.inline;function Ve(xe){return xe.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 Fe(xe){var we="",me,ce,he=xe.length;for(me=0;me<he;me++)ce=xe.charCodeAt(me),Math.random()>.5&&(ce="x"+ce.toString(16)),we+="&#"+ce+";";return we}var Ke=function(){function xe(me){this.tokens=[],this.tokens.links=Object.create(null),this.options=me||ze,this.options.tokenizer=this.options.tokenizer||new pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ce={block:Ye.normal,inline:He.normal};this.options.pedantic?(ce.block=Ye.pedantic,ce.inline=He.pedantic):this.options.gfm&&(ce.block=Ye.gfm,this.options.breaks?ce.inline=He.breaks:ce.inline=He.gfm),this.tokenizer.rules=ce}xe.lex=function(ce,he){var Te=new xe(he);return Te.lex(ce)};var we=xe.prototype;return we.lex=function(ce){return ce=ce.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ce,this.tokens,!0),this.inline(this.tokens),this.tokens},we.blockTokens=function(ce,he,Te){he===void 0&&(he=[]),Te===void 0&&(Te=!0),ce=ce.replace(/^ +$/gm,"");for(var Re,Me,et,ht;ce;){if(Re=this.tokenizer.space(ce)){ce=ce.substring(Re.raw.length),Re.type&&he.push(Re);continue}if(Re=this.tokenizer.code(ce,he)){ce=ce.substring(Re.raw.length),Re.type?he.push(Re):(ht=he[he.length-1],ht.raw+=`
`+Re.raw,ht.text+=`
`+Re.text);continue}if(Re=this.tokenizer.fences(ce)){ce=ce.substring(Re.raw.length),he.push(Re);continue}if(Re=this.tokenizer.heading(ce)){ce=ce.substring(Re.raw.length),he.push(Re);continue}if(Re=this.tokenizer.nptable(ce)){ce=ce.substring(Re.raw.length),he.push(Re);continue}if(Re=this.tokenizer.hr(ce)){ce=ce.substring(Re.raw.length),he.push(Re);continue}if(Re=this.tokenizer.blockquote(ce)){ce=ce.substring(Re.raw.length),Re.tokens=this.blockTokens(Re.text,[],Te),he.push(Re);continue}if(Re=this.tokenizer.list(ce)){for(ce=ce.substring(Re.raw.length),et=Re.items.length,Me=0;Me<et;Me++)Re.items[Me].tokens=this.blockTokens(Re.items[Me].text,[],!1);he.push(Re);continue}if(Re=this.tokenizer.html(ce)){ce=ce.substring(Re.raw.length),he.push(Re);continue}if(Te&&(Re=this.tokenizer.def(ce))){ce=ce.substring(Re.raw.length),this.tokens.links[Re.tag]||(this.tokens.links[Re.tag]={href:Re.href,title:Re.title});continue}if(Re=this.tokenizer.table(ce)){ce=ce.substring(Re.raw.length),he.push(Re);continue}if(Re=this.tokenizer.lheading(ce)){ce=ce.substring(Re.raw.length),he.push(Re);continue}if(Te&&(Re=this.tokenizer.paragraph(ce))){ce=ce.substring(Re.raw.length),he.push(Re);continue}if(Re=this.tokenizer.text(ce,he)){ce=ce.substring(Re.raw.length),Re.type?he.push(Re):(ht=he[he.length-1],ht.raw+=`
`+Re.raw,ht.text+=`
`+Re.text);continue}if(ce){var Ut="Infinite loop on byte: "+ce.charCodeAt(0);if(this.options.silent){console.error(Ut);break}else throw new Error(Ut)}}return he},we.inline=function(ce){var he,Te,Re,Me,et,ht,Ut=ce.length;for(he=0;he<Ut;he++){ht=ce[he];switch(ht.type){case"paragraph":case"text":case"heading":{ht.tokens=[],this.inlineTokens(ht.text,ht.tokens);break}case"table":{for(ht.tokens={header:[],cells:[]},Me=ht.header.length,Te=0;Te<Me;Te++)ht.tokens.header[Te]=[],this.inlineTokens(ht.header[Te],ht.tokens.header[Te]);for(Me=ht.cells.length,Te=0;Te<Me;Te++)for(et=ht.cells[Te],ht.tokens.cells[Te]=[],Re=0;Re<et.length;Re++)ht.tokens.cells[Te][Re]=[],this.inlineTokens(et[Re],ht.tokens.cells[Te][Re]);break}case"blockquote":{this.inline(ht.tokens);break}case"list":{for(Me=ht.items.length,Te=0;Te<Me;Te++)this.inline(ht.items[Te].tokens);break}}}return ce},we.inlineTokens=function(ce,he,Te,Re,Me){he===void 0&&(he=[]),Te===void 0&&(Te=!1),Re===void 0&&(Re=!1),Me===void 0&&(Me="");var et,ht=ce,Ut;if(this.tokens.links){var nn=Object.keys(this.tokens.links);if(nn.length>0)for(;(Ut=this.tokenizer.rules.inline.reflinkSearch.exec(ht))!=null;)nn.includes(Ut[0].slice(Ut[0].lastIndexOf("[")+1,-1))&&(ht=ht.slice(0,Ut.index)+"["+"a".repeat(Ut[0].length-2)+"]"+ht.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ut=this.tokenizer.rules.inline.blockSkip.exec(ht))!=null;)ht=ht.slice(0,Ut.index)+"["+"a".repeat(Ut[0].length-2)+"]"+ht.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ce;){if(et=this.tokenizer.escape(ce)){ce=ce.substring(et.raw.length),he.push(et);continue}if(et=this.tokenizer.tag(ce,Te,Re)){ce=ce.substring(et.raw.length),Te=et.inLink,Re=et.inRawBlock,he.push(et);continue}if(et=this.tokenizer.link(ce)){ce=ce.substring(et.raw.length),et.type==="link"&&(et.tokens=this.inlineTokens(et.text,[],!0,Re)),he.push(et);continue}if(et=this.tokenizer.reflink(ce,this.tokens.links)){ce=ce.substring(et.raw.length),et.type==="link"&&(et.tokens=this.inlineTokens(et.text,[],!0,Re)),he.push(et);continue}if(et=this.tokenizer.strong(ce,ht,Me)){ce=ce.substring(et.raw.length),et.tokens=this.inlineTokens(et.text,[],Te,Re),he.push(et);continue}if(et=this.tokenizer.em(ce,ht,Me)){ce=ce.substring(et.raw.length),et.tokens=this.inlineTokens(et.text,[],Te,Re),he.push(et);continue}if(et=this.tokenizer.codespan(ce)){ce=ce.substring(et.raw.length),he.push(et);continue}if(et=this.tokenizer.br(ce)){ce=ce.substring(et.raw.length),he.push(et);continue}if(et=this.tokenizer.del(ce)){ce=ce.substring(et.raw.length),et.tokens=this.inlineTokens(et.text,[],Te,Re),he.push(et);continue}if(et=this.tokenizer.autolink(ce,Fe)){ce=ce.substring(et.raw.length),he.push(et);continue}if(!Te&&(et=this.tokenizer.url(ce,Fe))){ce=ce.substring(et.raw.length),he.push(et);continue}if(et=this.tokenizer.inlineText(ce,Re,Ve)){ce=ce.substring(et.raw.length),Me=et.raw.slice(-1),he.push(et);continue}if(ce){var en="Infinite loop on byte: "+ce.charCodeAt(0);if(this.options.silent){console.error(en);break}else throw new Error(en)}}return he},Y(xe,null,[{key:"rules",get:function(){return{block:Ye,inline:He}}}]),xe}(),nt=G.defaults,de=M.cleanUrl,De=M.escape,Ne=function(){function xe(me){this.options=me||nt}var we=xe.prototype;return we.code=function(ce,he,Te){var Re=(he||"").match(/\S*/)[0];if(this.options.highlight){var Me=this.options.highlight(ce,Re);Me!=null&&Me!==ce&&(Te=!0,ce=Me)}return Re?'<pre><code class="'+this.options.langPrefix+De(Re,!0)+'">'+(Te?ce:De(ce,!0))+`</code></pre>
`:"<pre><code>"+(Te?ce:De(ce,!0))+`</code></pre>
`},we.blockquote=function(ce){return`<blockquote>
`+ce+`</blockquote>
`},we.html=function(ce){return ce},we.heading=function(ce,he,Te,Re){return this.options.headerIds?"<h"+he+' id="'+this.options.headerPrefix+Re.slug(Te)+'">'+ce+"</h"+he+`>
`:"<h"+he+">"+ce+"</h"+he+`>
`},we.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},we.list=function(ce,he,Te){var Re=he?"ol":"ul",Me=he&&Te!==1?' start="'+Te+'"':"";return"<"+Re+Me+`>
`+ce+"</"+Re+`>
`},we.listitem=function(ce){return"<li>"+ce+`</li>
`},we.checkbox=function(ce){return"<input "+(ce?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},we.paragraph=function(ce){return"<p>"+ce+`</p>
`},we.table=function(ce,he){return he&&(he="<tbody>"+he+"</tbody>"),`<table>
<thead>
`+ce+`</thead>
`+he+`</table>
`},we.tablerow=function(ce){return`<tr>
`+ce+`</tr>
`},we.tablecell=function(ce,he){var Te=he.header?"th":"td",Re=he.align?"<"+Te+' align="'+he.align+'">':"<"+Te+">";return Re+ce+"</"+Te+`>
`},we.strong=function(ce){return"<strong>"+ce+"</strong>"},we.em=function(ce){return"<em>"+ce+"</em>"},we.codespan=function(ce){return"<code>"+ce+"</code>"},we.br=function(){return this.options.xhtml?"<br/>":"<br>"},we.del=function(ce){return"<del>"+ce+"</del>"},we.link=function(ce,he,Te){if(ce=de(this.options.sanitize,this.options.baseUrl,ce),ce===null)return Te;var Re='<a href="'+De(ce)+'"';return he&&(Re+=' title="'+he+'"'),Re+=">"+Te+"</a>",Re},we.image=function(ce,he,Te){if(ce=de(this.options.sanitize,this.options.baseUrl,ce),ce===null)return Te;var Re='<img src="'+ce+'" alt="'+Te+'"';return he&&(Re+=' title="'+he+'"'),Re+=this.options.xhtml?"/>":">",Re},we.text=function(ce){return ce},xe}(),Ue=function(){function xe(){}var we=xe.prototype;return we.strong=function(ce){return ce},we.em=function(ce){return ce},we.codespan=function(ce){return ce},we.del=function(ce){return ce},we.html=function(ce){return ce},we.text=function(ce){return ce},we.link=function(ce,he,Te){return""+Te},we.image=function(ce,he,Te){return""+Te},we.br=function(){return""},xe}(),rt=function(){function xe(){this.seen={}}var we=xe.prototype;return we.slug=function(ce){var he=ce.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(he)){var Te=he;do this.seen[Te]++,he=Te+"-"+this.seen[Te];while(this.seen.hasOwnProperty(he))}return this.seen[he]=0,he},xe}(),lt=G.defaults,ft=M.unescape,at=function(){function xe(me){this.options=me||lt,this.options.renderer=this.options.renderer||new Ne,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ue,this.slugger=new rt}xe.parse=function(ce,he){var Te=new xe(he);return Te.parse(ce)};var we=xe.prototype;return we.parse=function(ce,he){he===void 0&&(he=!0);var Te="",Re,Me,et,ht,Ut,nn,en,mn,En,$t,rr,Dn,Sr,br,Pn,Dr,Or,ln,Yr=ce.length;for(Re=0;Re<Yr;Re++){$t=ce[Re];switch($t.type){case"space":continue;case"hr":{Te+=this.renderer.hr();continue}case"heading":{Te+=this.renderer.heading(this.parseInline($t.tokens),$t.depth,ft(this.parseInline($t.tokens,this.textRenderer)),this.slugger);continue}case"code":{Te+=this.renderer.code($t.text,$t.lang,$t.escaped);continue}case"table":{for(mn="",en="",ht=$t.header.length,Me=0;Me<ht;Me++)en+=this.renderer.tablecell(this.parseInline($t.tokens.header[Me]),{header:!0,align:$t.align[Me]});for(mn+=this.renderer.tablerow(en),En="",ht=$t.cells.length,Me=0;Me<ht;Me++){for(nn=$t.tokens.cells[Me],en="",Ut=nn.length,et=0;et<Ut;et++)en+=this.renderer.tablecell(this.parseInline(nn[et]),{header:!1,align:$t.align[et]});En+=this.renderer.tablerow(en)}Te+=this.renderer.table(mn,En);continue}case"blockquote":{En=this.parse($t.tokens),Te+=this.renderer.blockquote(En);continue}case"list":{for(rr=$t.ordered,Dn=$t.start,Sr=$t.loose,ht=$t.items.length,En="",Me=0;Me<ht;Me++)Pn=$t.items[Me],Dr=Pn.checked,Or=Pn.task,br="",Pn.task&&(ln=this.renderer.checkbox(Dr),Sr?Pn.tokens.length>0&&Pn.tokens[0].type==="text"?(Pn.tokens[0].text=ln+" "+Pn.tokens[0].text,Pn.tokens[0].tokens&&Pn.tokens[0].tokens.length>0&&Pn.tokens[0].tokens[0].type==="text"&&(Pn.tokens[0].tokens[0].text=ln+" "+Pn.tokens[0].tokens[0].text)):Pn.tokens.unshift({type:"text",text:ln}):br+=ln),br+=this.parse(Pn.tokens,Sr),En+=this.renderer.listitem(br,Or,Dr);Te+=this.renderer.list(En,rr,Dn);continue}case"html":{Te+=this.renderer.html($t.text);continue}case"paragraph":{Te+=this.renderer.paragraph(this.parseInline($t.tokens));continue}case"text":{for(En=$t.tokens?this.parseInline($t.tokens):$t.text;Re+1<Yr&&ce[Re+1].type==="text";)$t=ce[++Re],En+=`
`+($t.tokens?this.parseInline($t.tokens):$t.text);Te+=he?this.renderer.paragraph(En):En;continue}default:{var tn='Token with "'+$t.type+'" type was not found.';if(this.options.silent){console.error(tn);return}else throw new Error(tn)}}}return Te},we.parseInline=function(ce,he){he=he||this.renderer;var Te="",Re,Me,et=ce.length;for(Re=0;Re<et;Re++){Me=ce[Re];switch(Me.type){case"escape":{Te+=he.text(Me.text);break}case"html":{Te+=he.html(Me.text);break}case"link":{Te+=he.link(Me.href,Me.title,this.parseInline(Me.tokens,he));break}case"image":{Te+=he.image(Me.href,Me.title,Me.text);break}case"strong":{Te+=he.strong(this.parseInline(Me.tokens,he));break}case"em":{Te+=he.em(this.parseInline(Me.tokens,he));break}case"codespan":{Te+=he.codespan(Me.text);break}case"br":{Te+=he.br();break}case"del":{Te+=he.del(this.parseInline(Me.tokens,he));break}case"text":{Te+=he.text(Me.text);break}default:{var ht='Token with "'+Me.type+'" type was not found.';if(this.options.silent){console.error(ht);return}else throw new Error(ht)}}}return Te},xe}(),_t=M.merge,gt=M.checkSanitizeDeprecation,xt=M.escape,Ze=G.getDefaults,kt=G.changeDefaults,Ot=G.defaults;function qe(xe,we,me){if(typeof xe=="undefined"||xe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof xe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(xe)+", string expected");if(typeof we=="function"&&(me=we,we=null),we=_t({},qe.defaults,we||{}),gt(we),me){var ce=we.highlight,he;try{he=Ke.lex(xe,we)}catch(et){return me(et)}var Te=function(ht){var Ut;if(!ht)try{Ut=at.parse(he,we)}catch(nn){ht=nn}return we.highlight=ce,ht?me(ht):me(null,Ut)};if(!ce||ce.length<3)return Te();if(delete we.highlight,!he.length)return Te();var Re=0;qe.walkTokens(he,function(et){et.type==="code"&&(Re++,setTimeout(function(){ce(et.text,et.lang,function(ht,Ut){if(ht)return Te(ht);Ut!=null&&Ut!==et.text&&(et.text=Ut,et.escaped=!0),Re--,Re===0&&Te()})},0))}),Re===0&&Te();return}try{var Me=Ke.lex(xe,we);return we.walkTokens&&qe.walkTokens(Me,we.walkTokens),at.parse(Me,we)}catch(et){if(et.message+=`
Please report this to https://github.com/markedjs/marked.`,we.silent)return"<p>An error occurred:</p><pre>"+xt(et.message+"",!0)+"</pre>";throw et}}qe.options=qe.setOptions=function(xe){return _t(qe.defaults,xe),kt(qe.defaults),qe},qe.getDefaults=Ze,qe.defaults=Ot,qe.use=function(xe){var we=_t({},xe);if(xe.renderer&&function(){var ce=qe.defaults.renderer||new Ne,he=function(Me){var et=ce[Me];ce[Me]=function(){for(var ht=arguments.length,Ut=new Array(ht),nn=0;nn<ht;nn++)Ut[nn]=arguments[nn];var en=xe.renderer[Me].apply(ce,Ut);return en===!1&&(en=et.apply(ce,Ut)),en}};for(var Te in xe.renderer)he(Te);we.renderer=ce}(),xe.tokenizer&&function(){var ce=qe.defaults.tokenizer||new pe,he=function(Me){var et=ce[Me];ce[Me]=function(){for(var ht=arguments.length,Ut=new Array(ht),nn=0;nn<ht;nn++)Ut[nn]=arguments[nn];var en=xe.tokenizer[Me].apply(ce,Ut);return en===!1&&(en=et.apply(ce,Ut)),en}};for(var Te in xe.tokenizer)he(Te);we.tokenizer=ce}(),xe.walkTokens){var me=qe.defaults.walkTokens;we.walkTokens=function(ce){xe.walkTokens(ce),me&&me(ce)}}qe.setOptions(we)},qe.walkTokens=function(xe,we){for(var me=P(xe),ce;!(ce=me()).done;){var he=ce.value;we(he);switch(he.type){case"table":{for(var Te=P(he.tokens.header),Re;!(Re=Te()).done;){var Me=Re.value;qe.walkTokens(Me,we)}for(var et=P(he.tokens.cells),ht;!(ht=et()).done;)for(var Ut=ht.value,nn=P(Ut),en;!(en=nn()).done;){var mn=en.value;qe.walkTokens(mn,we)}break}case"list":{qe.walkTokens(he.items,we);break}default:he.tokens&&qe.walkTokens(he.tokens,we)}}},qe.Parser=at,qe.parser=at.parse,qe.Renderer=Ne,qe.TextRenderer=Ue,qe.Lexer=Ke,qe.lexer=Ke.lex,qe.Tokenizer=pe,qe.Slugger=rt,qe.parse=qe;var st=qe;return st})},EJTS:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return A});var te=U("qVdP"),Y=U("jsC+"),N=U("lUTK"),z=U("BvKs"),P=U("sRBo"),F=U("kaz8"),G=U("oBTY"),K=U("7Kak"),n=U("9yH6"),I=U("tJVT"),E=U("q1tI"),f=U.n(E),b=U("9Bee"),c=U("+vTd"),a=U.n(c),p=U("xKgJ"),l=U("Is5a"),u=U.n(l),s=["A\uFF0E","B\uFF0E","C\uFF0E","D\uFF0E","E\uFF0E","F\uFF0E","G\uFF0E","H\uFF0E","I\uFF0E","J\uFF0E","K\uFF0E","L\uFF0E","M\uFF0E","N\uFF0E","O\uFF0E","P\uFF0E","Q\uFF0E","R\uFF0E","S\uFF0E","T\uFF0E","U\uFF0E","V\uFF0E","W\uFF0E","X\uFF0E","Y\uFF0E","Z\uFF0E"],i=["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"],D=function(R){var O,g=R.data,_=R.selectIds,h=R.onSelectCheckBox,d=h===void 0?function(){}:h,C=R.showCheckbox,x=C===void 0?!0:C,w=Object(E.useState)(!1),j=Object(I.a)(w,2),W=j[0],T=j[1],M=function(){if(g.item_type==="JUDGMENT")return f.a.createElement("div",{className:a.a.judgmentContent},g.choices.map(function(ye,pe){return f.a.createElement(n.a,{key:pe,disabled:!0},ye.choice_text)}));if(g.item_type==="PROGRAM"){var q;return f.a.createElement("div",{className:a.a.programContent},f.a.createElement(b.a,{value:(q=g.program_attr)===null||q===void 0?void 0:q.description}))}if(g.item_type==="COMBINATION"){var re;return f.a.createElement("div",{className:a.a.combinationContent},g==null||((re=g.sub_item_banks)===null||re===void 0)?void 0:re.map(function(ye,pe){var ue,fe="(\u9898\u76EE".concat(pe+1,"-\u5355\u9009\u9898) ");return f.a.createElement(E.Fragment,null,f.a.createElement("div",{style:{marginTop:10,marginBottom:10}},f.a.createElement(b.a,{value:fe+ye.name})),ye.choices.map(function(be,se){return f.a.createElement("div",{key:se,className:a.a.otherContentItem},f.a.createElement("p",null,s[se]),f.a.createElement(b.a,{className:a.a.otehrContentHtml,value:be.choice_text}))}),f.a.createElement("div",{className:a.a.con},f.a.createElement("b",{className:"c-grey-333 font14"}," ","\u7B54\u6848\uFF1A",i==null?void 0:i[ye==null||((ue=ye.choices)===null||ue===void 0)?void 0:ue.findIndex(function(be){return be==null?void 0:be.is_answer})]," "),f.a.createElement("div",null,f.a.createElement("span",null,"\u89E3\u6790\uFF1A"),f.a.createElement(b.a,{className:a.a.parseAnswerHtml,value:ye.analysis||"\u6682\u65E0\u89E3\u6790"}))))}))}return f.a.createElement("div",{className:a.a.otherContent},g.choices.map(function(ye,pe){return f.a.createElement("div",{key:pe,className:a.a.otherContentItem},f.a.createElement("p",null,s[pe]),f.a.createElement(b.a,{className:a.a.otehrContentHtml,value:ye.choice_text}))}))},m=function(){var q;return f.a.createElement("div",null,(q=g.standard_answer)===null||q===void 0?void 0:q.map(function(re,ye){return f.a.createElement(b.a,{key:ye,className:a.a.answerHtml,value:"\u7B54\u6848\uFF08\u586B\u7A7A".concat(re.position,"\uFF09\uFF1A").concat(re.answer_text.join("\u3001"))})}))},v=function(){var q,re,ye,pe={SUBJECTIVE:(q=g.answer_texts)===null||q===void 0?void 0:q[0],JUDGMENT:(re=g.choices)===null||re===void 0||((ye=re.find(function(ze){return ze.is_answer}))===null||ye===void 0)?void 0:ye.choice_text},ue=g.choices.map(function(ze){return ze.is_answer}).findIndex(function(ze){return ze}),fe=ue>-1?i[ue]:"",be="";g.choices.map(function(ze,Ye){ze.is_answer&&(be+=i[Ye])});var se=pe[g.item_type],ae={SINGLE:f.a.createElement(b.a,{className:a.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(fe||"\u65E0")}),MULTIPLE:f.a.createElement(b.a,{className:a.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(be||"\u65E0")}),COMPLETION:m()},Ce=f.a.createElement(b.a,{className:a.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(se||"\u65E0")});return ae[g.item_type]||Ce},H=function(q){var re=Object(G.a)(_);q.target.checked?re.push(g.id):re=re.filter(function(ye){return ye!==g.id}),d(re)};return f.a.createElement("div",{className:a.a.itemWrap},f.a.createElement("div",{className:a.a.list},x&&f.a.createElement(F.a,{className:"mr10",onChange:H,checked:_.includes(g.id)}),f.a.createElement("div",{className:a.a.title},f.a.createElement(b.a,{key:1,showLines:1,showTextOnly:!0,className:a.a.topicTitleContent,value:g.name})),f.a.createElement("div",{className:a.a.line},f.a.createElement("b",{className:a.a.b1}),f.a.createElement("b",{className:a.a.b2})),f.a.createElement("div",{onClick:function(){return T(!W)},className:a.a.tr},W?"\u6536\u8D77":"\u5C55\u5F00",f.a.createElement("i",{style:{transform:W?"scale(0.5) rotate(-180deg)":"scale(0.5) rotate(0deg)"},className:"iconfont icon-zhankai4"}))),f.a.createElement("aside",{style:W?{display:"block"}:{display:"none"},className:a.a.itemDetail},f.a.createElement("div",{style:{marginBottom:44}},f.a.createElement(b.a,{key:2,className:a.a.topicTitleContent,value:g.name}),f.a.createElement("div",{className:"".concat(a.a.row," mt15")},M()),f.a.createElement("div",{className:a.a.row},f.a.createElement("div",{className:a.a.updateTimeRow},f.a.createElement("div",{className:a.a.updateTimeWrap},g.item_type==="PROGRAM"&&f.a.createElement("p",{className:a.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(O=g.program_attr)===null||O===void 0?void 0:O.language))))),g.item_type!=="PROGRAM"&&g.item_type!=="COMBINATION"&&f.a.createElement("div",{className:a.a.answerWrapper},f.a.createElement("img",{src:u.a,alt:"",className:a.a.decoration}),f.a.createElement("div",{className:a.a.answer},v()),f.a.createElement("div",{className:a.a.parse},f.a.createElement("div",{className:a.a.parseText},"\u89E3\u6790\uFF1A"),f.a.createElement("div",{className:a.a.parseAnswer},g.analysis?f.a.createElement(b.a,{className:a.a.parseAnswerHtml,value:g.analysis}):"\u6682\u65E0\u89E3\u6790")))))},A=function(R){var O,g,_,h,d,C,x,w,j,W,T,M,m,v,H,X,q=R.isProblemset,re=R.data,ye=R.user,pe=R.activeTabsKey,ue=R.onPublicReview,fe=ue===void 0?function(){}:ue,be=R.onStartExperience,se=be===void 0?function(){}:be,ae=R.onSetPrivate,Ce=ae===void 0?function(){}:ae,ze=R.onCorrection,Ye=ze===void 0?function(){}:ze,He=R.onCollect,Ve=He===void 0?function(){}:He,Fe=R.onSetPublic,Ke=Fe===void 0?function(){}:Fe,nt=R.onDelete,de=nt===void 0?function(){}:nt,De=R.onCancel,Ne=De===void 0?function(){}:De,Ue=R.onSelect,rt=Ue===void 0?function(){}:Ue,lt=R.onMoveTo,ft=lt===void 0?function(){}:lt,at=R.onSetShare,_t=at===void 0?function(){}:at,gt=R.onCancelShare,xt=gt===void 0?function(){}:gt,Ze=R.onPublish,kt=Ze===void 0?function(){}:Ze,Ot=R.onCancelPublish,qe=Ot===void 0?function(){}:Ot,st=re.item_type==="PROGRAM"?"/problems/".concat((O=re.program_attr)===null||O===void 0?void 0:O.identifier,"/edit"):"/problemset/edit/".concat(re.id),xe=pe==="0"&&!re.public&&!re.apply&&(re.item_type==="PROGRAM"&&((g=re.program_attr)===null||g===void 0?void 0:g.status)!==0||re.item_type!=="PROGRAM"),we=f.a.createElement(z.a,{forceSubMenuRender:!0,className:a.a.menu},pe==="0"&&!re.public&&f.a.createElement(z.a.Item,{key:"-1"},f.a.createElement("a",{className:a.a.actionLink,target:"_blank",href:st},"\u7F16\u8F91")),(pe==="0"||pe==="3")&&re.item_type==="PROGRAM"&&((_=re.program_attr)===null||_===void 0?void 0:_.status)!==0&&!re.public&&((h=re.author)===null||h===void 0?void 0:h.login)===((d=ye.userInfo)===null||d===void 0?void 0:d.login)&&f.a.createElement(z.a.Item,{key:"0"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){var Te;return qe(re==null||((Te=re.program_attr)===null||Te===void 0)?void 0:Te.identifier)}},"\u64A4\u9500\u53D1\u5E03")),pe==="0"&&f.a.createElement(z.a.Item,{key:"1"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return ft(re.id)}},"\u79FB\u52A8\u5230")),pe==="0"&&!(re!=null&&re.is_share)&&f.a.createElement(z.a.Item,{key:"3"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return _t(re.id)}},"\u5171\u4EAB")),(pe==="0"&&(re==null?void 0:re.is_share)||pe==="3"&&((C=re.author)===null||C===void 0?void 0:C.login)===((x=ye.userInfo)===null||x===void 0?void 0:x.login))&&f.a.createElement(z.a.Item,{key:"3"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return xt(re.id)}},"\u64A4\u9500\u5171\u4EAB")),xe&&f.a.createElement(z.a.Item,{key:"4"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ke(re.id)}},"\u516C\u5F00")),pe==="0"&&!re.public&&re.apply&&(re.item_type==="PROGRAM"&&re.program_attr.status!==0||re.item_type!=="PROGRAM")&&f.a.createElement(z.a.Item,{key:"5"},f.a.createElement("a",{className:a.a.reviewFlag,onClick:fe},"\u5BA1\u6838\u4E2D")),(pe==="0"||pe==="1")&&re.public&&((w=re.author)===null||w===void 0?void 0:w.login)===((j=ye.userInfo)===null||j===void 0?void 0:j.login)&&f.a.createElement(z.a.Item,{key:"6"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ce(re.id)}},"\u64A4\u9500\u516C\u5F00")),pe==="2"&&f.a.createElement(z.a.Item,{key:"7"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ve(re.id,re.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(pe==="0"||pe==="3")&&re.item_type==="PROGRAM"&&((W=re.program_attr)===null||W===void 0?void 0:W.status)===0&&!re.public&&((T=re.author)===null||T===void 0?void 0:T.login)===((M=ye.userInfo)===null||M===void 0?void 0:M.login)&&f.a.createElement(z.a.Item,{key:"8"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){var Te;return kt(re==null||((Te=re.program_attr)===null||Te===void 0)?void 0:Te.identifier)}},"\u53D1\u5E03")),(pe==="1"||pe==="3")&&!Object(p.o)()&&!Object(p.m)()&&((m=re.author)===null||m===void 0?void 0:m.login)!==((v=ye.userInfo)===null||v===void 0?void 0:v.login)&&f.a.createElement(z.a.Item,{key:"9"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ve(re.id,re.is_collected)}},re.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),pe!=="0"&&!Object(p.o)()&&!Object(p.m)()&&f.a.createElement(z.a.Item,{key:"10"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ye(re.id)}},"\u7EA0\u9519")),(pe==="0"&&!re.public||pe==="1"&&Object(p.o)()&&((H=re.author)===null||H===void 0?void 0:H.login)!==((X=ye.userInfo)===null||X===void 0?void 0:X.login))&&f.a.createElement(z.a.Item,{key:"11"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return de(re.id)}},"\u5220\u9664"))),me=f.a.createElement(z.a,{forceSubMenuRender:!0,className:a.a.menu},f.a.createElement(z.a.Item,{key:"10"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ye(re.id)}},"\u7EA0\u9519"))),ce=pe!=="0"&&!Object(p.o)()&&!Object(p.m)();return f.a.createElement(f.a.Fragment,null,q?f.a.createElement(f.a.Fragment,null,re.item_type!=="SUBJECTIVE"&&re.item_type!=="COMBINATION"&&f.a.createElement("span",{className:a.a.textBtn,style:{cursor:"pointer"},onClick:function(){return se(re)}},"\u4F53\u9A8C"),f.a.createElement(Y.a,{overlay:we},f.a.createElement("span",{style:{cursor:"default"},onClick:function(Te){return Te.preventDefault()}},f.a.createElement("span",{className:a.a.textBtn},"\u66F4\u591A")))):ce?f.a.createElement(Y.a,{className:"ml40",overlay:me},f.a.createElement("span",{style:{cursor:"default"},onClick:function(Te){return Te.preventDefault()}},f.a.createElement("span",null,"\u66F4\u591A"))):f.a.createElement("span",null))};ge.b=D},ELLl:function(ct,ge,U){(function(te){te(U("VrN/"))})(function(te){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},N=te.Pos;te.defineOption("autoCloseBrackets",!1,function(a,p,l){l&&l!=te.Init&&(a.removeKeyMap(P),a.state.closeBrackets=null),p&&(F(z(p,"pairs")),a.state.closeBrackets=p,a.addKeyMap(P))});function z(a,p){return p=="pairs"&&typeof a=="string"?a:typeof a=="object"&&a[p]!=null?a[p]:Y[p]}var P={Backspace:n,Enter:I};function F(a){for(var p=0;p<a.length;p++){var l=a.charAt(p),u="'"+l+"'";P[u]||(P[u]=G(l))}}F(Y.pairs+"`");function G(a){return function(p){return f(p,a)}}function K(a){var p=a.state.closeBrackets;if(!p||p.override)return p;var l=a.getModeAt(a.getCursor());return l.closeBrackets||p}function n(a){var p=K(a);if(!p||a.getOption("disableInput"))return te.Pass;for(var l=z(p,"pairs"),u=a.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return te.Pass;var i=b(a,u[s].head);if(!i||l.indexOf(i)%2!=0)return te.Pass}for(var s=u.length-1;s>=0;s--){var D=u[s].head;a.replaceRange("",N(D.line,D.ch-1),N(D.line,D.ch+1),"+delete")}}function I(a){var p=K(a),l=p&&z(p,"explode");if(!l||a.getOption("disableInput"))return te.Pass;for(var u=a.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return te.Pass;var i=b(a,u[s].head);if(!i||l.indexOf(i)%2!=0)return te.Pass}a.operation(function(){var D=a.lineSeparator()||`
`;a.replaceSelection(D+D,null),a.execCommand("goCharLeft"),u=a.listSelections();for(var A=0;A<u.length;A++){var S=u[A].head.line;a.indentLine(S,null,!0),a.indentLine(S+1,null,!0)}})}function E(a){var p=te.cmpPos(a.anchor,a.head)>0;return{anchor:new N(a.anchor.line,a.anchor.ch+(p?-1:1)),head:new N(a.head.line,a.head.ch+(p?1:-1))}}function f(a,p){var l=K(a);if(!l||a.getOption("disableInput"))return te.Pass;var u=z(l,"pairs"),s=u.indexOf(p);if(s==-1)return te.Pass;for(var i=z(l,"closeBefore"),D=z(l,"triples"),A=u.charAt(s+1)==p,S=a.listSelections(),R=s%2==0,O,g=0;g<S.length;g++){var _=S[g],h=_.head,d,C=a.getRange(h,N(h.line,h.ch+1));if(R&&!_.empty())d="surround";else if((A||!R)&&C==p)A&&c(a,h)?d="both":D.indexOf(p)>=0&&a.getRange(h,N(h.line,h.ch+3))==p+p+p?d="skipThree":d="skip";else if(A&&h.ch>1&&D.indexOf(p)>=0&&a.getRange(N(h.line,h.ch-2),h)==p+p){if(h.ch>2&&/\bstring/.test(a.getTokenTypeAt(N(h.line,h.ch-2))))return te.Pass;d="addFour"}else if(A){var x=h.ch==0?" ":a.getRange(N(h.line,h.ch-1),h);if(!te.isWordChar(C)&&x!=p&&!te.isWordChar(x))d="both";else return te.Pass}else if(R&&(C.length===0||/\s/.test(C)||i.indexOf(C)>-1))d="both";else return te.Pass;if(!O)O=d;else if(O!=d)return te.Pass}var w=s%2?u.charAt(s-1):p,j=s%2?p:u.charAt(s+1);a.operation(function(){if(O=="skip")a.execCommand("goCharRight");else if(O=="skipThree")for(var W=0;W<3;W++)a.execCommand("goCharRight");else if(O=="surround"){for(var T=a.getSelections(),W=0;W<T.length;W++)T[W]=w+T[W]+j;a.replaceSelections(T,"around"),T=a.listSelections().slice();for(var W=0;W<T.length;W++)T[W]=E(T[W]);a.setSelections(T)}else O=="both"?(a.replaceSelection(w+j,null),a.triggerElectric(w+j),a.execCommand("goCharLeft")):O=="addFour"&&(a.replaceSelection(w+w+w+w,"before"),a.execCommand("goCharRight"))})}function b(a,p){var l=a.getRange(N(p.line,p.ch-1),N(p.line,p.ch+1));return l.length==2?l:null}function c(a,p){var l=a.getTokenAt(N(p.line,p.ch+1));return/\bstring/.test(l.type)&&l.start==p.ch&&(p.ch==0||!/\bstring/.test(a.getTokenTypeAt(p)))}})},FOrL:function(ct,ge,U){ct.exports=U.p+"static/nodata.a6b3f948.png"},FWmy:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return te});function te(Y,N){if(!Y)throw new Error(N?`Assertion failed (${N})`:"Assertion Failed")}},HmJG:function(ct,ge,U){},IPdS:function(ct,ge,U){ct.exports={drawerWrap:"drawerWrap___nRvfD",title:"title___e_1lX",problemset:"problemset___1u9oP",content:"content___1WwQ5",delete:"delete___3Q7nc",deleteIcon:"deleteIcon___ObOyh",previewWrap:"previewWrap___25lTY",preview:"preview___3uiyE"}},Is5a:function(ct,ge){ct.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACMgAAAA6CAYAAABPwffJAAAAAXNSR0IArs4c6QAAH35JREFUeF7t3Q2MZWV9x/H/c849d17uzL6y7K4M76xLNIAKoiBQak0oRgsiYKyxUEq0LwZLYmqa0hqtpi8xodam1daKRFtbRITYBmlspRBBAXmRaHddsCyO7Bsssztzd2buveec5jl37jC7bN155l7OL7P3ewmZfTnn+Z37+f9nsjn3n+c4W8JrfHx8bGam9ZfNZutif3q1Wrl3YKDyB2NjY+NLWC74FHV+8AVzQlcC6nqr87vC4+RgAXW91fnBYJyAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACpr6/r86nBcoVUNdbnV+uNmnqevcy34WW84knto0513giz22NWef03P9qb27Vs846a9MrOiSjzg/14vjuBNT1Vud3p8fZoQLqeqvzQ704HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBMzU9/fV+fRAuQLqeqvzy9UmTV3vXucHD8g88shj/2zm3ttoNOa7wZmzJEnMnPvqOeec9euvZJuo81/J98baLxdQ11udT0+UK6Cutzq/XG3SEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBA4OgTU9/fV+UdHFZfPu1DXW52/fCp1dFyput69zg8ekLnvvu8+l+e28XDldM52XHTRW171SpZanf9KvjfWfrmAut7qfHqiXAF1vdX55WqThgACCCCAAAIIIIAAAggggAACCCCAAAIIIIDA0SGgvr+vzj86qrh83oW63ur85VOpo+NK1fXudX7wgMy3v31vnue5NZtNc84sz9sPWkqq1aLCb3vbxcFrhrSGOj/kWjm2ewF1vdX53QuyQoiAut7q/BArjkUAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIG2gPr+vjqfPihXQF1vdX652qSp693r/OBhlrvu+ve8PRiTmx+N6QzJtFsjt8sue0fwmiFtpc4PuVaO7V5AXW91fveCrBAioK63Oj/EimMRQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgLaC+v6/Opw/KFVDXW51frjZp6nr3Oj94mOX22+/0kzHWbDaK3WP8yw/JJElSDMxceeXlwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWW2/9Smcsptgx5qVdZNq/vuaa9wWvGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWb7whVvyZrN5UCf4xy055yxJqnb99dcGrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1k+85m/yZ05y4vdY/zjldpLFEMy5uyGD/9e8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjl05+++ZAdZNqPVvKvJEnsIx+5MXjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8olPfCrvPFKp/dXvHtNuDL/Yn3zspuA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy003fSxvNhsLOuGlJfwOMp/85MeD1wxpK3V+yLVybPcC6nqr87sXZIUQAXW91fkhVhyLAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACbQH1/X11Pn1QroC63ur8crVJU9e71/nBwyw33viR3O8a03nN7x4zt5PMzTd/OnjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8qEP3ZC3mi3Lbe65SvM94axaTeyzn/1M8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjluuuuf2kyxv/KrzD3Nc9zu+WWfwxeM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7z//dfkzUbjoP1j/COX/KOWqtWqffnLtwavGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWa644sp8fsuY+X7obCrj7I47bg9eM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7zjHb+Wt1rNYseY9is359z8DjLf/OZdwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWSy65NG82m0UnNJuN4muSJMVX/4ilb33r7uA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy4UXXpT73WP8kIxzZv43fgeZJKkWu8ncf/99wWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWN73pzXmr1SoGYzo7yfgdZPyQTKVSse9//3vBa4a0lTo/5Fo5tnsBdb3V+d0LskKIgLre6vwQK45FAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBtoD6/r46nz4oV0Bdb3V+udqkqevd6/zgYZazzz4nbzQaxXBMsXuM74liB5mk2EXm0UcfCV4zpK3U+SHXyrHdC6jrrc7vXpAVQgTU9Vbnh1hxLAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCLQF1Pf31fn0QbkC6nqr88vVJk1d717nBw+zbN58et7ZOabZbPjpGKtWE/OPXapWq7Zly/8ErxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1lOOeXUYkCmMyRjls8Px/gBmaeffip4zZC2UueHXCvHdi+grrc6v3tBVggRUNdbnR9ixbEIIIAAAggggAACCCCAAAIIIIAAAggggAACCCDQFlDf31fn0wflCqjrrc4vV5s0db17nR88zOIv4MCBujUafkimYa7zeKVKYsO1mv30p08HrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/MXNcyS57m75557Vq9atfbCq656951+95h6fWp+F5kkqVqtVrMkSexrX/v65RMTL9x/ySWXvOicy3vRMur8XrwH1li8gLre6vzFS3FkLwTU9Vbn98KQNRBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6DcB9f19dX6/1Vv9ftX1Vuer/fstX13vVzL//x2Q8aG+0HfffXd1zbp1v3rssSe8rzay4opzXrc5rtfr1mo1bWpqqthBZnh42DpDMo88vjWtT+2/Y/fuZ/9p754937r00ksbfp3QYRl1fr81ufr9quutzlf791u+ut7q/H6rN+8XAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIFeCKjv76vze2HIGosXUNdbnb94KY7shYC63mXlH3ZAphN+7733Dqw5ZsONGzae9Ie55aMe9o2vP714tJIfkvE7yZi5YueYzg4yDz+2pfB35iZ37njmz/ZPPP+5Cy64YKL4s0XuKKPO70UDscbiBdT1VucvXoojeyGgrrc6vxeGrIEAAggggAACCCCAAAIIIIAAAggggAACCCCAQL8JqO/vq/P7rd7q96uutzpf7d9v+ep6l5n/sgGZuXD34IMPrhpZsfrP12886beyLI98Ezhndv65ZxSDMX5Ixn/NcysGZKrVavH1gYeeLP7Mv6LIZbuf2/7Fycm9N5x33nmzZpYfaUhGnd9vza5+v+p6q/PV/v2Wr663Or/f6s37RQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgFwLq+/vq/F4YssbiBdT1VucvXoojeyGgrnfZ+QcNyCwIHxhdufbGdRtO+NPcD8f4o+amXi6+4Ozi8UqNRntAxr/845Wq1aT4+p37H2nXwU/T5GYuctmenc/+8eS+F24+0pCMOr8XDcQaixdQ11udv3gpjuyFgLre6vxeGLIGAggggAACCCCAAAIIIIAAAggggAACCCCAAAL9JqC+v6/O77d6q9+vut7qfLV/v+Wr663Inx+Q6YT70ZaHH330shNPfM2X8jwfzf2Ui5k1m6nd9i+32q23/MNBu8c45yzP8/kBmWuv+4Bd9Z7fsCSJi/Oc/8+5ye3bf3ztG9/whrv8qM3hdpJR5/dbs6vfr7re6ny1f7/lq+utzu+3evN+EUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBDohYD6/r46vxeGrLF4AXW91fmLl+LIXgio663KP3RAJnrggQfWbjjutL+t1Ubf7Ydj/MYxrVbLPv93N9vT27batm3bit1j/JxLs9kqvvqdY/zLP2Zp06ZNduqmzfbB37nRKpVKsZGMH5Kp1ye/vvPnT/3u+eef/4KZZYc+amkOQJbfiyZijcULqOutzl+8FEf2QkBdb3V+LwxZAwEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBfhNQ399X5/dbvdXvV11vdb7av9/y1fVW5RcDMgumc6IfPP7ku44/YdNXsyyL/XCMP+CuO2+zhx96wOIoth/+8Ilixxj/eCW/e8zc+ZYkSfH7M888y9IstTeee75ddvnVxXYx/rAoitKfPbvtvWe/7oxv+AGZhbvIqPP7rdnV71ddb3W+2r/f8tX1Vuf3W715vwgggAACCCCAAAIIIIAAAggggAACCCCAAAII9EJAfX9fnd8LQ9ZYvIC63ur8xUtxZC8E1PVW5i8ckInMLN761M/+YuWqtb/fGY7ZvXunfeHzf21xHFujMWNbtmwthmOKV95+XtLcnIxVk6q9evMmGxgYsjRN7foP3mDHHrth/ph9Ey/81ebTjv+omaULd5HpTAep8nvRRKyxeAF1vdX5i5fiyF4IqOutzu+FIWsggAACCCCAAAIIIIAAAggggAACCCCAAAIIINBvAur7++r8fqu3+v2q663OV/v3W7663sp8t2A6J37ooR+OverEE2+pxMkv5Zkffsnt3v+6x3705GOWZZkdODBlW7duKwZiGg0/JFOMx8w/Zsn/+aZNp1mtNup3jLHXnvF6u/itlxSPWHKRWStt/vdz27f/5rnnnjk+NyTjF/Avv4gk/9BHPfVb85f9fuk31+n5sun7Mo9+o9/6svF50wgggAACCCCAAAIIIIAAAggggAACCCCAAAJdCfD5Ap8vdNVAgSfTb/RbYMt0dXjf99vC6Zz77ntw8+mvOesbae5OzX0fZpnd/q9ftqmpSZua2metZtOeeeZZm56ents1xhWPW2rvIONscHDQTjrpBKskiY2MrLSRkVG78j3v989XMpc7i13+9JYfP/Guiy46b2tnF5m56hW71yjyGZDp6vsn+GT6jR/wwU3TxQn0G/3WRftwKgIIIIAAAggggAACCCCAAAIIIIAAAggggECfCvD5Ap8vlNn69Bv9Rr+VN5/S2UEmesYs2fPw4284/uTN/2FZXsssszxzdvttXzLnnL3w/K5iGGbHjp02NVW3RmN2buMXX67cqtWqjYyM2MaNG4rdY9asPbb483dfda25KLfIIrPI1Z956keXbHjzOT84ycxvQZN1BmRU+QzIlPntZr6H/DgV/VYue9+m0W/8g6Jvm583jgACCCCAAAIIIIAAAggggAACCCCAAAIIILBkAT5f4POFJTfPEk6k3+i3JbTNkk/p+36bA4jHxy3Z/txD55x2ypl3Z3lWy/PMbyBjd//bbRZFse3e9VzxmKVWq1XsIpOmaTEw419+gMYPxZx88olWqVSK36/fcFxxzNvfebXfQMaciyxyUX3rTx59+yknnP/w2FgxIJPOVU6Wz4DMkr93lnQi/cYP+CU1zhJPot/otyW2DqchgAACCCCAAAIIIIAAAggggAACCCCAAAII9LEAny/w+UKZ7U+/0W/0W3nzKZ0dZCo7dlgyPv74a4874dW35VF+kmX+8Umpfe+737FGs1HsINOYnSlq44dkdu7cbfV6vRiGGR4etg0bjrU4jou/HxgcsrXHrLdqUrU3v+WXzbnYLMrNZe6Znz/7k6vHxl73o40biwGZ1lyxZfkMyJT57Ta/g4ys3vRbufVWp839g4J+UxeCfAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEElpEAny8wsFBmu9Jv9Bv9Vt58ih+Qicws3rXLqnv2bD111THHfi6Kquf53WP8DjH/+/SWYjhmdna6+LqY19q16606MGjHrNtgJ596+twOM2ZZ1nhw4vndv71u3ean16+3xsIdZFT5zrnOY54W89Y4pksB+o1+67KFgk6n3+i3oIbhYAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEErPiMlM9P6YTSBOg3Ps8qrdn4+ZYeNCATxwdW7Hlx7ydXrlx1XZ47y7LcpqcP2LatT1ilUrXndz9n09P1X1ifoaGarVt/nDWbs7Zp81k2NDRsUeTMudz27Zv44rrVa25K0+H9hxuQUeQzIFPmt9vB/6BQ1Hvu3RYDYYp8+o1+K/PnK/1Wbr+RhgACCCCAAAIIIIAAAggggAACCCCAAAIIIHB0CCwcWFB8nsTnWUdHHy32XdBvDMgstld6cVzf99uhAOPj41esHxv7TJbmsR+Q8bvI7Nr5M5ua3GfORfbC8zts+sDUYe2Hhkds7TEb/dyR1UZW2PoNx8/tHuMsil26a3z8w2NjY3f8ogGZsvP5ALkX30aLX4N+4wf84rul+yPpN/qt+y5iBQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIF+E+DzBT5fKLPn6Tf6jX4rbz7loB1koqg+umfixROHhoY+lVQGf8UPx3T+f37XuDVbTYvjxOr1/Ta5f681ZmeKWvnHKY2uWGO12grLspbFccXWrR8rhmM6/zdbM/85PT39R+tWrd6eZbXJw+0go8hnQKbMb7eDd5BR1Hvu3RY7yCjy6Tf6rcyfr/Rbuf1GGgIIIIAAAggggAACCCCAAAIIIIAAAggggMDRIbBwYEHxeRKfZx0dfbTYd0G/MSCz2F7pxXF932+5f5aSWWXHDkucm6q14mTV3r3PXX7MqvUfz/J0KM/NMj8ok5pNTu61VnPGXBSbs8hc5E8tNoyxLE8tz1JLqoM2MrLGXGwWFQMy/ms8/fzEro+tWfOqOytpcyLPR+obN1rTzFpzRZTlO//sJ16lCdBv9FtpzdZ+hh4/38oEJwsBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgaNAgM8X+DyrzDam3+g3+q28+RS/g4z/ADkeH7fErZwcbh1IVuStxvqZ6ckPrBhddU2aZ1GemWV+CiY1a6Uta7WmLW2llvupGTNzLra4ElulMmSVuGLmh2PMmYvMYhdl+ycnbh0cGv17V6nuqgw39+f7Rg+MjRUDMu0FhPkMyJT57TY/sEC/lcvet2n8fOMfFH3b/LxxBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgSUL8PkCny8suXmWcCL9Rr8toW2WfErf99scQPSMWbJqwgbr2fRIVk9X5XG64cDU1EdXrFz11jTLoixr7xRTPHLJ/6LYnaHt7neJKb76//xv/K4xfjgmirJ9ExPfGRiMb06ike1RLZ6oRUNTE6ts5iQrBmT8qv4ly2dAZsnfO0s6kX7jB/ySGmeJJ9Fv9NsSW4fTEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBPpYgM8X+HyhzPan3+g3+q28+ZTODjKR38Vlzx6r5nm95lxtdDI9sDprzJyYNqavHhlZ/c4sSwczPyDj+7MzLDPXq85vQuOHZCIz/2v/5KUoimempl78Zjww8JUoGd4xGg+/mOf1Sedq9XXrrDG3e8z8gIwqnwGZMr/d5neQod/KZe/btM4/KFQ/X+bgZf3Oz7e+bX3eOAIIIIAAAggggAACCCCAAAIIIIAAAggggEAXAny+wMBCF+0TfCr9Rr8FN00XJ/R9v80BFI9Z2rHDkrRmg1FrutaaSkctydfMTmfr09bkxQNDtQuTJDkjy/Ko2EEmd/M7yfidY8zlxQ4yUeSyZrP55Ox0/f64MnrvwFC0y5pub2UknswqQ/W4bjMbN84/XmluD5pivEaSzwfIXXz3LOFU+o0f8EtomyWfQr/Rb0tuHk5EAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6FsBPl/g84Uym59+o9/ot/LmU4qHIx06JZSmU0OzrjJSaaUrGlm+Mk3z1ZY1jsvy1utdxZ1eTQbGnEUrnYtq7fOzem7ZvkZzdjxv5VsiV3nMourP49i9WI3cvlYl3j+Qt6bieGR64e4xneEUdX6ZDUcW/UYPlCug/vmizi9XmzQEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBI4OAfX9fXX+0VHF5fMu1PVW5y+fSh0dV6qutzJ/4YBM8ZCkcbOk9qJVm8364OxsZSSKWiNplI3mLh7Nm80VeWYjqbXWZ62sluX5kG+ByLnpqBLVY6vscpFNuSTZ7/J0Ms6iySyrTA0MtKaSpDZTX22NMSt2jyke0nTIgIws/+ho4+XzLhZMQdJvy6dsy/ZK6bdlWzouHAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABmQCfL8jo+zKYfuvLssvedD/3WzEg418LpnQi/6ilwUFL/JDMdB4Pu9nWUKsa1aJWo+Yq1SFrpYNZ5hLnsrh9bpRGUd60SjyTtxrTWaVarzSyej5QmR5y6QE/HDMzY825Ryv54Zjs0EcbqfNl3denwep6q/P7tOyyt62utzpfBk8wAggggAACCCCAAAIIIIAAAggggAACCCCAAALLWEB9f1+dv4xLtywvXV1vdf6yLNoyvmh1vVX5hw7I+N/7/+MdO6zih2RmZ6eqWTUeTNKhgZmZqcHKUDRQn02r1SiJs3SmGJCJ4sG0kTXT2kDcaE1ns4ODIzPNeHo2aqQzAwMjjbnhmJaZpX6eZuHuMZ2eWTClJMlfxr27LC9dXW91/rIs2jK+aHW91fnLuHRcOgIIIIAAAggggAACCCCAAAIIIIAAAggggAACMgH1/X11vgy+T4PV9Vbn92nZZW9bXW9V/vyAjJc/5CL8428qA3ssnh2wanWmnjQrUdJqumQ4GozrrcmKa7j2I5qqeV6rjLYOZDNpJcmbSStrNgZrzYFZa8yus3TMzA/HFI9VOtxwTKfq6nxZ9/VpsLre6vw+Lbvsbavrrc6XwROMAAIIIIAAAggggAACCCCAAAIIIIAAAggggMAyFlDf31fnL+PSLctLV9dbnb8si7aML1pdb0X+QQMyvnaHXIT/e//IpUqlYlGSWKUeT8Zx3UVx7IrdYzqvNM3TtJZntXQ0bTat1WpZtnHjwYMxv2g4prOOOn8Z9++yvHR1vdX5y7Joy/ii1fVW5y/j0nHpCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgjIBNT399X5Mvg+DVbXW53fp2WXvW11vcvOf9mAjJefuwj/y84jl6LOr8fHLYpjc1FU/N38K8ssT1PLx8Ze2ilm4a4xxWLO+R1kjvhS5x/xAjmgpwLqeqvze4rJYkcUUNdbnX9EIA5AAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBlwmo7++r82mJcgXU9Vbnl6tNmrreZeYfdkDGt8CCi/C/7QzKHPrrQ7uleITS3B8u/PWih2M6C6rz+TYoV0Bdb3V+udqkqeutzqcDEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAIFxAfX9fnR8uxhndCKjrrc7vxo5zwwXU9S4r//8dkFlIdsjFdP7q0HNftjvMYneMOVJ51PlHuj7+vrcC6nqr83uryWpHElDXW51/JB/+HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBF4uoL6/r86nJ8oVUNdbnV+uNmnqer+S+f8HabRiLm3R4IUAAAAASUVORK5CYII="},"Ix/O":function(ct,ge){ct.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAhNJREFUWEftlztLA0EQx/97Z2LAF1ooKhZaCClsVARFLAQbbQTBVFY2NjZiI4KFINjo51DBD2BhI4IQfKAIikJAg48oKD4Kk3usbDabXHSTu1yCucJp5pL5z+zvZm4XllBKVZTZSBriaLIV9HMdBIOoJE22XHEaA8U+zMc19B2HbfV5BByCAeAzDMPB4rJiCt0uBoZDHI5uIv4xUczbFJQbqOFdJNVz6Nm64xB7wVtQf0tBhUohJol7VHX1c4jddr0UNV3VIMoGh9hpKB+EakazIer7gc5FwN/o6qUcJyWegKsV4PUgmZINEVwGfHXyWoQAlALMy0zEmHdi2htwsWSBeFnNjIPVYOuIWuJZrG0XtwOQ5PNOPC+U75tIjyM27wGIu1kdFZXyRupxJGPMMxPPQp8vbo3l0fNxMAhmpgYovt8+15yF3u47EPEceg4RnfHAOG6mPQARmSoeQvUDRsLpYLJ0fBylgBAAAoZ5mTGdFVj1p07M65CzThhxQM2xi6QLOtPzTlyOO4Nw1Wz7pN8QugZU+ACZT54Tlhj7bdXJ4j81LN9qupYax/lY6pxIAIpklmaO/+1fUq4Q9VKed+JsxAPjOB32AMTJkAcgjgY8ABHu/YfI3DtU4+/vHWwDG+o9hwh39+HrYR8Uitut7yqPwESgeTBzIWYg75FNEK3NVcFCk6gvitqOELtMZyAKLVJC/TfVWC6c92hknAAAAABJRU5ErkJggg=="},JUtD:function(ct,ge,U){"use strict";U.r(ge);var te=U("14J3"),Y=U("BMrR"),N=U("DjyN"),z=U("NUBc"),P=U("qVdP"),F=U("jsC+"),G=U("T2oS"),K=U("W9HT"),n=U("+L6B"),I=U("2/Rp"),E=U("sPJy"),f=U("bE4q"),b=U("5Dmo"),c=U("3S7+"),a=U("lUTK"),p=U("BvKs"),l=U("sRBo"),u=U("kaz8"),s=U("miYZ"),i=U("tsqr"),D=U("7Kak"),A=U("9yH6"),S=U("2qtc"),R=U("kLXV"),O=U("oBTY"),g=U("k1fw"),_=U("9og8"),h=U("tJVT"),d=U("PpiC"),C=U("5NDa"),x=U("5rEg"),w=U("Znn+"),j=U("ZTPi"),W=U("WmNS"),T=U.n(W),M=U("q1tI"),m=U.n(M),v=U("9kvl"),H=U("55Ip"),X=U("iris"),q=U("jcZT"),re=U("BdwD"),ye=U("iNYN"),pe=U.n(ye),ue=function(mt){var Pt=mt.problemset,Rt=mt.globalSetting,Ht=mt.loading,un=mt.dispatch,xn=Object(d.a)(mt,["problemset","globalSetting","loading","dispatch"]);return m.a.createElement(R.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Pt.actionTabs.key==="Problemset-PublicReview",title:"\u63D0\u793A",okText:"\u77E5\u9053\u5566",cancelText:"",width:"442px",onOk:function(){un({type:"problemset/setActionTabs",payload:{}})},onCancel:function(){un({type:"problemset/setActionTabs",payload:{}})}},m.a.createElement("div",{className:pe.a.modalContent},"\u516C\u5F00\u7533\u8BF7\u5DF2\u63D0\u4EA4\uFF0C\u8BF7\u7B49\u5F85\u7BA1\u7406\u5458\u7684\u5BA1\u6838"),m.a.createElement("div",{className:pe.a.modalContent},"\u6211\u4EEC\u5C06\u57281-2\u4E2A\u5DE5\u4F5C\u65E5\u5185\u5B8C\u6210\u5BA1\u6838"))},fe=Object(v.a)(function(Zt){var mt=Zt.problemset,Pt=Zt.loading,Rt=Zt.globalSetting;return{problemset:mt,globalSetting:Rt,loading:Pt.effects}})(ue),be=U("xlxt"),se=U.n(be),ae=U("P/tu"),Ce=U("wd/R"),ze=U.n(Ce),Ye=function(mt){var Pt=mt.problemset,Rt=mt.dispatch,Ht=Object(M.useState)([]),un=Object(h.a)(Ht,2),xn=un[0],Cn=un[1],gn=function(){Rt({type:"problemset/setActionTabs",payload:{}})};Object(M.useEffect)(function(){if(Pt.actionTabs.key==="\u5BFC\u51FA\u8BD5\u9898"){var dn,Sn;Cn([(dn=Pt.actionTabs)===null||dn===void 0||((Sn=dn.params)===null||Sn===void 0)?void 0:Sn.group_id])}},[Pt.actionTabs.key]);var Ln=function(){if(xn.length===0){i.b.warn("\u8BF7\u9009\u62E9\u6587\u4EF6\u5939");return}console.log(xn[0],22),Kn({},"/api/item_banks/export.xlsx?group_id=".concat(xn[0]),function(Sn,hr){var Nn;if(((Nn=Sn.target.response)===null||Nn===void 0?void 0:Nn.type)==="application/json"){var Kt=new FileReader;Kt.readAsText(Sn.target.response,"utf-8"),Kt.addEventListener("loadend",function(){var jt=JSON.parse(Kt.result);i.b.warn((jt==null?void 0:jt.message)||"\u4E0B\u8F7D\u51FA\u9519, \u8BF7\u8054\u7CFB\u7BA1\u7406\u5458")});return}var An=new Blob([Sn.target.response],{type:"application/vnd.ms-excel;charset=utf-8"}),lr="item_bank_template_".concat(ze()().format("YYYY-MM-DD HH:mm:ss"),".xlsx");if(window.navigator&&window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(An,lr);else{var Un=URL.createObjectURL(An),zt=document.createElement("a");zt.href=Un,zt.setAttribute("download",lr),document.body.appendChild(zt),zt.click(),window.URL.revokeObjectURL(zt.href)}gn()})},Kn=function(Sn,hr,Nn,Kt){var An=hr,lr=new window.XMLHttpRequest;return lr.withCredentials=!0,lr.addEventListener("load",function(Un){Nn(Un,lr)},!1),lr.addEventListener("error",function(Un){Kt&&Kt(Un)},!1),lr.responseType="blob",lr.open("GET",An),lr.send(null),lr};return m.a.createElement(R.a,{centered:!0,title:"\u5BFC\u51FA\u8BD5\u9898",visible:Pt.actionTabs.key==="\u5BFC\u51FA\u8BD5\u9898",width:718,destroyOnClose:!0,wrapClassName:se.a.customModal,onCancel:gn,onOk:Ln},m.a.createElement("aside",{className:se.a.exportModal},m.a.createElement(ae.a,{value:xn,onChange:function(Sn){return Cn(Sn)}})))},He=Object(v.a)(function(Zt){var mt=Zt.problemset;return{problemset:mt}})(Ye),Ve=U("i8i3"),Fe=U.n(Ve),Ke=U("WCUW"),nt=U("Ty5D"),de=function(mt){var Pt,Rt,Ht=mt.problemset,un=mt.dispatch,xn=mt.onOk,Cn=Object(nt.i)(),gn=Object(M.useState)([]),Ln=Object(h.a)(gn,2),Kn=Ln[0],dn=Ln[1],Sn=Object(M.useState)(1),hr=Object(h.a)(Sn,2),Nn=hr[0],Kt=hr[1],An=Object(M.useState)([]),lr=Object(h.a)(An,2),Un=lr[0],zt=lr[1],jt=Object(M.useState)([]),yn=Object(h.a)(jt,2),Ct=yn[0],Mt=yn[1],Dt=Object(M.useState)(!0),ke=Object(h.a)(Dt,2),Vt=ke[0],Tn=ke[1],mr=Object(M.useState)(!1),On=Object(h.a)(mr,2),ii=On[0],ai=On[1],Kr=Object(M.useState)(!1),jn=Object(h.a)(Kr,2),Bt=jn[0],Er=jn[1];Object(M.useEffect)(function(){if(Ht.actionTabs.key==="\u5171\u4EAB\u8BD5\u9898"){var Jt,Yt;ur(),zt([(Jt=Ht.actionTabs)===null||Jt===void 0||((Yt=Jt.params)===null||Yt===void 0)?void 0:Yt.group_id])}},[Ht.actionTabs.key]);var ur=function(){var Jt=Object(_.a)(T.a.mark(function Yt(){var pn,Gn,Mn;return T.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:return Tn(!0),gr.next=3,Object(Ke.y)({type:0,page:1,per_page:10,order_by:"new"});case 3:pn=gr.sent,pn!=null&&pn.item_banks_group&&(Gn={id:-1,item_banks_count:(pn==null?void 0:pn.no_group_count)||0,name:{name:"\u672A\u52A0\u5165\u5206\u7EC4"}},Mn=[Gn].concat((pn==null?void 0:pn.item_banks_group)||[]),dn(Mn)),Tn(!1);case 6:case"end":return gr.stop()}},Yt)}));return function(){return Jt.apply(this,arguments)}}(),Yn=function(){un({type:"problemset/setActionTabs",payload:{}})},oi=function(){var Jt=Object(_.a)(T.a.mark(function Yt(){var pn;return T.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:if(!(Un.length===0)){Mn.next=3;break}return i.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u7684\u6587\u4EF6\u5939"),Mn.abrupt("return");case 3:if(!(Nn===1)){Mn.next=6;break}return Kt(2),Mn.abrupt("return");case 6:return ai(!0),Mn.next=9,Object(Ke.l)({item_banks_group_ids:Un,clazz:"ItemBank",group_ids:Ct});case 9:pn=Mn.sent,(pn==null?void 0:pn.status)===0&&(xn(),Yn()),ai(!1);case 12:case"end":return Mn.stop()}},Yt)}));return function(){return Jt.apply(this,arguments)}}(),Xt=function(Yt){zt(Yt),Er(Yt.length===Kn.length)};return m.a.createElement(R.a,{centered:!0,afterClose:function(){Mt([]),Kt(1),Er(!1),dn([])},title:"\u5171\u4EAB\u8BD5\u9898".concat(Nn,"/2"),visible:Ht.actionTabs.key==="\u5171\u4EAB\u8BD5\u9898",footer:null,width:718,destroyOnClose:!0,wrapClassName:Fe.a.customModal,onCancel:Yn},m.a.createElement("aside",{className:Fe.a.shareModal},m.a.createElement(K.a,{spinning:Vt},m.a.createElement("div",{className:Fe.a.content},Nn===1&&m.a.createElement("div",{className:Fe.a.group},m.a.createElement(ae.a,{value:Un,onChange:function(Yt){return zt(Yt)}})),Nn===2&&m.a.createElement("div",{className:Fe.a.teachGroup},m.a.createElement("p",null,"\u5171\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),m.a.createElement(u.a.Group,{value:Ct,onChange:function(Yt){return Mt(Yt)}},Ht==null||((Pt=Ht.teachGroupData)===null||Pt===void 0||((Rt=Pt.groups)===null||Rt===void 0))?void 0:Rt.map(function(Jt){return m.a.createElement(u.a,{key:Jt.group_id,value:Jt.group_id},Jt==null?void 0:Jt.name)})))),m.a.createElement("div",{className:Fe.a.footer},m.a.createElement(I.a,{onClick:Yn},"\u53D6\u6D88"),m.a.createElement(I.a,{loading:ii,onClick:oi,type:"primary"},Nn===1?"\u4E0B\u4E00\u6B65":"\u786E\u8BA4\u5171\u4EAB")))))},De=Object(v.a)(function(Zt){var mt=Zt.problemset;return{problemset:mt}})(de),Ne=function(mt){var Pt=mt.problemset,Rt=mt.globalSetting,Ht=mt.loading,un=mt.dispatch,xn=mt.onReloadData,Cn=xn===void 0?function(){}:xn,gn=Object(d.a)(mt,["problemset","globalSetting","loading","dispatch","onReloadData"]),Ln=Object(M.useRef)(!1),Kn=Object(M.useState)(!1),dn=Object(h.a)(Kn,2),Sn=dn[0],hr=dn[1];Object(M.useEffect)(function(){Pt.actionTabs.key==="Problemset-SetPrivate"?window.localStorage.getItem("problemset-set-private-hint-flag")==="1"?Nn():hr(!0):hr(!1)},[Pt.actionTabs.key]);var Nn=function(){var Kt=Object(_.a)(T.a.mark(function An(){var lr;return T.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return Ln.current&&window.localStorage.setItem("problemset-set-private-hint-flag","1"),zt.next=3,un({type:"problemset/setPrivate",payload:Pt.actionTabs.params});case 3:lr=zt.sent,un({type:"problemset/setActionTabs",payload:{}}),Ln.current=!1,lr.status===0&&Cn();case 7:case"end":return zt.stop()}},An)}));return function(){return Kt.apply(this,arguments)}}();return m.a.createElement(R.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Sn,title:"\u64A4\u9500\u516C\u5F00\u544A\u77E5",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Ht["problemset/setPrivate"],width:"442px",onOk:Nn,onCancel:function(){un({type:"problemset/setActionTabs",payload:{}}),Ln.current=!1}},m.a.createElement("div",{className:pe.a.modalContentLeft},"\u672C\u9898\u5DF2\u516C\u5F00\uFF0C\u64A4\u9500\u516C\u5F00\u53EF\u80FD\u5BFC\u81F4\u90E8\u5206\u7528\u6237\u5BF9\u672C\u9898\u7684\u4F7F\u7528\u53D7\u635F\u3002"),m.a.createElement("div",{className:pe.a.modalContentLeft},"\u786E\u8BA4\u64A4\u9500\u516C\u5F00\u56DE\u5230\u81EA\u6709\u72B6\u6001\u5417\uFF1F"),m.a.createElement("div",null,m.a.createElement(u.a,{className:"mt10",defaultChecked:!1,onChange:function(An){return Ln.current=An.target.checked}},"\u4E0D\u518D\u63D0\u793A")))},Ue=Object(v.a)(function(Zt){var mt=Zt.problemset,Pt=Zt.loading,Rt=Zt.globalSetting;return{problemset:mt,globalSetting:Rt,loading:Pt.effects}})(Ne),rt=function(mt){var Pt=mt.problemset,Rt=mt.globalSetting,Ht=mt.loading,un=mt.dispatch,xn=mt.onReloadData,Cn=xn===void 0?function(){}:xn,gn=Object(d.a)(mt,["problemset","globalSetting","loading","dispatch","onReloadData"]),Ln=function(){var Kn=Object(_.a)(T.a.mark(function dn(){var Sn;return T.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,un({type:"problemset/handleDelete",payload:Pt.actionTabs.params});case 2:Sn=Nn.sent,un({type:"problemset/setActionTabs",payload:{}}),Sn.status===0&&Cn();case 5:case"end":return Nn.stop()}},dn)}));return function(){return Kn.apply(this,arguments)}}();return m.a.createElement(R.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Pt.actionTabs.key==="Problemset-Delete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Ht["problemset/handleDelete"],width:"442px",onOk:Ln,onCancel:function(){un({type:"problemset/setActionTabs",payload:{}})}},m.a.createElement("div",{className:pe.a.modalContent},"\u786E\u8BA4\u5220\u9664\u540E\uFF0C\u65E0\u6CD5\u64A4\u9500"),m.a.createElement("div",{className:pe.a.modalContent},"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F"))},lt=Object(v.a)(function(Zt){var mt=Zt.problemset,Pt=Zt.loading,Rt=Zt.globalSetting;return{problemset:mt,globalSetting:Rt,loading:Pt.effects}})(rt),ft=U("LvDl"),at=U("9Bee"),_t=function(mt){var Pt,Rt=mt.problemset,Ht=mt.dispatch,un=Object(M.useState)({}),xn=Object(h.a)(un,2),Cn=xn[0],gn=xn[1],Ln=Object(M.useState)([]),Kn=Object(h.a)(Ln,2),dn=Kn[0],Sn=Kn[1],hr=Object(M.useState)(!1),Nn=Object(h.a)(hr,2),Kt=Nn[0],An=Nn[1],lr=["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"];Object(M.useEffect)(function(){var yn;if((Rt==null||((yn=Rt.actionTabs)===null||yn===void 0)?void 0:yn.key)==="SINGLE"){var Ct,Mt=Object(ft.cloneDeep)(Rt==null||((Ct=Rt.actionTabs)===null||Ct===void 0)?void 0:Ct.params);gn(Mt),Sn(Mt.choices)}},[Rt==null||((Pt=Rt.actionTabs)===null||Pt===void 0)?void 0:Pt.key]);var Un=function(){var yn=Object(_.a)(T.a.mark(function Ct(){var Mt,Dt;return T.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(dn.some(function(Tn){return Tn==null?void 0:Tn.checked})){Vt.next=3;break}return i.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),Vt.abrupt("return");case 3:Kt&&(Dt=Object(ft.cloneDeep)(Rt==null||((Mt=Rt.actionTabs)===null||Mt===void 0)?void 0:Mt.params),Sn(Dt.choices)),An(!Kt);case 5:case"end":return Vt.stop()}},Ct)}));return function(){return yn.apply(this,arguments)}}(),zt=function(Ct,Mt){console.log(Ct.target.checked);var Dt=dn.map(function(ke,Vt){return Object(g.a)(Object(g.a)({},ke),{},{checked:Vt===Mt?Ct.target.checked:!1})});Sn(Dt)},jt=function(){gn({}),Sn([]),An(!1),Ht({type:"problemset/setActionTabs",payload:{}})};return m.a.createElement(R.a,{centered:!0,destroyOnClose:!0,visible:Rt.actionTabs.key==="SINGLE",title:"\u8BD5\u9898\u4F53\u9A8C",okText:Kt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Un,onCancel:jt},m.a.createElement("div",null,m.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u5355\u9009\u9898"),m.a.createElement(at.a,{value:Cn==null?void 0:Cn.name}),dn==null?void 0:dn.map(function(yn,Ct){var Mt=yn.is_answer,Dt=yn.checked,ke=yn.choice_text,Vt="";return Kt&&Mt&&(Vt=pe.a.green),Kt&&!Mt&&Dt&&(Vt=pe.a.red),m.a.createElement("div",{key:Ct,style:{pointerEvents:Kt?"none":"auto"},className:"".concat(pe.a.row," ").concat(Vt)},m.a.createElement(A.a,{onChange:function(mr){return zt(mr,Ct)},checked:Dt}),m.a.createElement("span",null,lr[Ct],".\xA0"),m.a.createElement(at.a,{className:pe.a.html,value:ke}),Kt&&Mt&&m.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),Kt&&!Mt&&Dt&&m.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),Kt&&m.a.createElement(M.Fragment,null,m.a.createElement("div",{className:pe.a.line}),m.a.createElement("div",{className:"c-grey-333 mb5"},m.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),lr[dn.findIndex(function(yn){return yn.is_answer})]),m.a.createElement("div",{className:"c-grey-333 mb10"},m.a.createElement("b",null,"\u89E3\u6790:\xA0"),(Cn==null?void 0:Cn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},gt=Object(v.a)(function(Zt){var mt=Zt.problemset;return{problemset:mt}})(_t),xt=function(mt){var Pt,Rt=mt.problemset,Ht=mt.dispatch,un=Object(M.useState)({}),xn=Object(h.a)(un,2),Cn=xn[0],gn=xn[1],Ln=Object(M.useState)([]),Kn=Object(h.a)(Ln,2),dn=Kn[0],Sn=Kn[1],hr=Object(M.useState)(!1),Nn=Object(h.a)(hr,2),Kt=Nn[0],An=Nn[1],lr=["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"];Object(M.useEffect)(function(){var Ct;if((Rt==null||((Ct=Rt.actionTabs)===null||Ct===void 0)?void 0:Ct.key)==="MULTIPLE"){var Mt,Dt=Object(ft.cloneDeep)(Rt==null||((Mt=Rt.actionTabs)===null||Mt===void 0)?void 0:Mt.params);gn(Dt),Sn(Dt.choices)}},[Rt==null||((Pt=Rt.actionTabs)===null||Pt===void 0)?void 0:Pt.key]);var Un=function(){var Ct=Object(_.a)(T.a.mark(function Mt(){var Dt,ke;return T.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:if(dn.some(function(mr){return mr==null?void 0:mr.checked})){Tn.next=3;break}return i.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),Tn.abrupt("return");case 3:Kt&&(ke=Object(ft.cloneDeep)(Rt==null||((Dt=Rt.actionTabs)===null||Dt===void 0)?void 0:Dt.params),Sn(ke.choices)),An(!Kt);case 5:case"end":return Tn.stop()}},Mt)}));return function(){return Ct.apply(this,arguments)}}(),zt=function(Mt,Dt){console.log(Mt.target.checked);var ke=dn.map(function(Vt,Tn){return Object(g.a)(Object(g.a)({},Vt),{},{checked:Tn===Dt?Mt.target.checked:Vt.checked})});Sn(ke)},jt=function(){gn({}),Sn([]),An(!1),Ht({type:"problemset/setActionTabs",payload:{}})},yn=function(){var Mt="";return dn.forEach(function(Dt,ke){Dt.is_answer&&(Mt=Mt+lr[ke])}),Mt};return m.a.createElement(R.a,{centered:!0,destroyOnClose:!0,visible:Rt.actionTabs.key==="MULTIPLE",title:"\u8BD5\u9898\u4F53\u9A8C",okText:Kt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Un,onCancel:jt},m.a.createElement("div",null,m.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u591A\u9009\u9898"),m.a.createElement(at.a,{value:Cn==null?void 0:Cn.name}),dn==null?void 0:dn.map(function(Ct,Mt){var Dt=Ct.is_answer,ke=Ct.checked,Vt=Ct.choice_text,Tn="";return Kt&&Dt&&(Tn=pe.a.green),Kt&&!Dt&&ke&&(Tn=pe.a.red),m.a.createElement("div",{key:Mt,style:{pointerEvents:Kt?"none":"auto"},className:"".concat(pe.a.row," ").concat(Tn)},m.a.createElement(u.a,{style:{padding:3},onChange:function(On){return zt(On,Mt)},checked:ke}),m.a.createElement("span",null,lr[Mt],".\xA0"),m.a.createElement(at.a,{className:pe.a.html,value:Vt}),Kt&&Dt&&m.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),Kt&&!Dt&&ke&&m.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),Kt&&m.a.createElement(M.Fragment,null,m.a.createElement("div",{className:pe.a.line}),m.a.createElement("div",{className:"c-grey-333 mb5"},m.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),yn()),m.a.createElement("div",{className:"c-grey-333 mb10"},m.a.createElement("b",null,"\u89E3\u6790:\xA0"),(Cn==null?void 0:Cn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},Ze=Object(v.a)(function(Zt){var mt=Zt.problemset;return{problemset:mt}})(xt),kt=function(mt){var Pt,Rt,Ht=mt.problemset,un=mt.dispatch,xn=Object(M.useState)({}),Cn=Object(h.a)(xn,2),gn=Cn[0],Ln=Cn[1],Kn=Object(M.useState)([]),dn=Object(h.a)(Kn,2),Sn=dn[0],hr=dn[1],Nn=Object(M.useState)(!1),Kt=Object(h.a)(Nn,2),An=Kt[0],lr=Kt[1],Un=["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"];Object(M.useEffect)(function(){var Ct;if((Ht==null||((Ct=Ht.actionTabs)===null||Ct===void 0)?void 0:Ct.key)==="JUDGMENT"){var Mt,Dt=Object(ft.cloneDeep)(Ht==null||((Mt=Ht.actionTabs)===null||Mt===void 0)?void 0:Mt.params);Ln(Dt),hr(Dt.choices)}},[Ht==null||((Pt=Ht.actionTabs)===null||Pt===void 0)?void 0:Pt.key]);var zt=function(){var Ct=Object(_.a)(T.a.mark(function Mt(){var Dt,ke;return T.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:if(Sn.some(function(mr){return mr==null?void 0:mr.checked})){Tn.next=3;break}return i.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),Tn.abrupt("return");case 3:An&&(ke=Object(ft.cloneDeep)(Ht==null||((Dt=Ht.actionTabs)===null||Dt===void 0)?void 0:Dt.params),hr(ke.choices)),lr(!An);case 5:case"end":return Tn.stop()}},Mt)}));return function(){return Ct.apply(this,arguments)}}(),jt=function(Mt,Dt){console.log(Mt.target.checked);var ke=Sn.map(function(Vt,Tn){return Object(g.a)(Object(g.a)({},Vt),{},{checked:Tn===Dt?Mt.target.checked:!1})});hr(ke)},yn=function(){Ln({}),hr([]),lr(!1),un({type:"problemset/setActionTabs",payload:{}})};return m.a.createElement(R.a,{centered:!0,destroyOnClose:!0,visible:Ht.actionTabs.key==="JUDGMENT",title:"\u8BD5\u9898\u4F53\u9A8C",okText:An?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:zt,onCancel:yn},m.a.createElement("div",null,m.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u5224\u65AD\u9898"),m.a.createElement(at.a,{value:gn==null?void 0:gn.name}),Sn==null?void 0:Sn.map(function(Ct,Mt){var Dt=Ct.is_answer,ke=Ct.checked,Vt=Ct.choice_text,Tn="";return An&&Dt&&(Tn=pe.a.green),An&&!Dt&&ke&&(Tn=pe.a.red),m.a.createElement("div",{key:Mt,style:{pointerEvents:An?"none":"auto"},className:"".concat(pe.a.row," ").concat(Tn)},m.a.createElement(A.a,{onChange:function(On){return jt(On,Mt)},checked:ke}),m.a.createElement(at.a,{className:pe.a.html,value:Vt}),An&&Dt&&m.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),An&&!Dt&&ke&&m.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),An&&m.a.createElement(M.Fragment,null,m.a.createElement("div",{className:pe.a.line}),m.a.createElement("div",{className:"c-grey-333 mb5"},m.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),(Rt=Sn.find(function(Ct){return Ct.is_answer}))===null||Rt===void 0?void 0:Rt.choice_text),m.a.createElement("div",{className:"c-grey-333 mb10"},m.a.createElement("b",null,"\u89E3\u6790:\xA0"),(gn==null?void 0:gn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},Ot=Object(v.a)(function(Zt){var mt=Zt.problemset;return{problemset:mt}})(kt),qe=function(mt){var Pt,Rt,Ht=mt.problemset,un=mt.dispatch,xn=Object(M.useState)({}),Cn=Object(h.a)(xn,2),gn=Cn[0],Ln=Cn[1],Kn=Object(M.useState)([]),dn=Object(h.a)(Kn,2),Sn=dn[0],hr=dn[1],Nn=Object(M.useState)(!1),Kt=Object(h.a)(Nn,2),An=Kt[0],lr=Kt[1],Un=["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"];Object(M.useEffect)(function(){var Ct;if((Ht==null||((Ct=Ht.actionTabs)===null||Ct===void 0)?void 0:Ct.key)==="COMPLETION"){var Mt,Dt,ke=Object(ft.cloneDeep)(Ht==null||((Mt=Ht.actionTabs)===null||Mt===void 0)?void 0:Mt.params);Ln(ke),hr(ke==null||((Dt=ke.standard_answer)===null||Dt===void 0)?void 0:Dt.map(function(Vt){return{value:"",answer:(Vt==null?void 0:Vt.answer_text)||[]}}))}},[Ht==null||((Pt=Ht.actionTabs)===null||Pt===void 0)?void 0:Pt.key]);var zt=function(){var Ct=Object(_.a)(T.a.mark(function Mt(){var Dt,ke,Vt;return T.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:if(!Sn.some(function(On){return(On==null?void 0:On.value)===""})){mr.next=3;break}return i.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),mr.abrupt("return");case 3:An&&(Vt=Object(ft.cloneDeep)(Ht==null||((Dt=Ht.actionTabs)===null||Dt===void 0)?void 0:Dt.params),hr(Vt==null||((ke=Vt.standard_answer)===null||ke===void 0)?void 0:ke.map(function(On){return{value:"",answer:(On==null?void 0:On.answer_text)||[]}}))),lr(!An);case 5:case"end":return mr.stop()}},Mt)}));return function(){return Ct.apply(this,arguments)}}(),jt=function(Mt,Dt){var ke=Sn.map(function(Vt,Tn){return Object(g.a)(Object(g.a)({},Vt),{},{value:Tn===Dt?Mt.target.value:Vt.value})});hr(ke)},yn=function(){Ln({}),hr([]),lr(!1),un({type:"problemset/setActionTabs",payload:{}})};return m.a.createElement(R.a,{centered:!0,destroyOnClose:!0,visible:Ht.actionTabs.key==="COMPLETION",title:"\u8BD5\u9898\u4F53\u9A8C",okText:An?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:zt,onCancel:yn},m.a.createElement("div",null,m.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u586B\u7A7A\u9898"),m.a.createElement(at.a,{value:gn==null?void 0:gn.name}),Sn==null?void 0:Sn.map(function(Ct,Mt){var Dt=Ct.value,ke=Ct.answer,Vt="";return An&&ke!==null&&ke!==void 0&&ke.includes(Dt)&&(Vt=pe.a.green),An&&!(ke!=null&&ke.includes(Dt))&&(Vt=pe.a.red),m.a.createElement("div",{key:Mt,style:{pointerEvents:An?"none":"auto",marginTop:10},className:"".concat(pe.a.row," ").concat(Vt)},m.a.createElement("div",{style:{minWidth:80}},"\u586B\u7A7A",Mt+1,"\u7B54\u6848:"),m.a.createElement(x.a.TextArea,{className:pe.a.textArea,style:{width:610,marginRight:10},onChange:function(mr){return jt(mr,Mt)},value:Dt}),An&&(ke==null?void 0:ke.includes(Dt))&&m.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),An&&!(ke!=null&&ke.includes(Dt))&&m.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),An&&m.a.createElement(M.Fragment,null,m.a.createElement("div",{className:pe.a.line}),gn==null||((Rt=gn.standard_answer)===null||Rt===void 0)?void 0:Rt.map(function(Ct,Mt){var Dt;return m.a.createElement("div",{className:"c-grey-333 mb5"},m.a.createElement("b",null,"\u586B\u7A7A",Mt+1,"\u7B54\u6848:\xA0"),(Ct==null||((Dt=Ct.answer_text)===null||Dt===void 0)?void 0:Dt.join("\u3001"))||"")}),m.a.createElement("div",{className:"c-grey-333 mb10"},m.a.createElement("b",null,"\u89E3\u6790:\xA0"),(gn==null?void 0:gn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},st=Object(v.a)(function(Zt){var mt=Zt.problemset;return{problemset:mt}})(qe),xe=U("SAoR"),we=U("tK3L"),me=U.n(we),ce=U("bbsP"),he=U("/wGt"),Te=U("IPdS"),Re=U.n(Te),Me=[],et=function(mt){Me.forEach(function(Pt){if(mt.target===Pt.element||ht.isParent(mt.target,Pt.element))return;Pt.callbacks.forEach(function(Rt){return Rt()})})};window.document.body?window.document.body.addEventListener("click",et):window.addEventListener("DOMContentLoaded",function(){window.document.body.addEventListener("click",et)});var ht={isParent:function(mt,Pt){for(var Rt=mt;Rt&&Rt.tagName&&Rt.tagName.toLowerCase()!=="body";){if(Rt===Pt)return!0;Rt=Rt.parentNode}return!1},init:function(mt,Pt){var Rt=Me.filter(function(Ht){return Ht.element===mt});return Rt.length>0?Rt[0].callbacks.push(Pt):Me.push({element:mt,callbacks:[Pt]}),{clear:function(){Me=Me.filter(function(un){return un.element!==mt})}}}},Ut=ht,nn=[{stateName:"single_questions_count",type:"SINGLE",typeName:"\u5355\u9009\u9898"},{stateName:"multiple_questions_count",type:"MULTIPLE",typeName:"\u591A\u9009\u9898"},{stateName:"judgement_questions_count",type:"JUDGMENT",typeName:"\u5224\u65AD\u9898"},{stateName:"completion_questions_count",type:"COMPLETION",typeName:"\u586B\u7A7A\u9898"},{stateName:"subjective_questions_count",type:"SUBJECTIVE",typeName:"\u7B80\u7B54\u9898"},{stateName:"program_questions_count",type:"PROGRAM",typeName:"\u7F16\u7A0B\u9898"},{stateName:"practical_questions_count",type:"PRACTICAL",typeName:"\u5B9E\u8BAD\u9898"},{stateName:"combination_questions_count",type:"COMBINATION",typeName:"\u7EC4\u5408\u9898"}],en=function(mt){var Pt=mt.visible,Rt=mt.basketData,Ht=mt.basketTotal,un=mt.onClose,xn=un===void 0?function(){}:un,Cn=mt.onDelete,gn=Cn===void 0?function(){}:Cn,Ln=Object(M.useRef)(),Kn=Object(M.useRef)();return Object(M.useEffect)(function(){return Kn.current?(Ht>=0&&!Ln.current&&(Ln.current=Ut.init(Kn.current,function(){xn()})),function(){Ln.current&&Ln.current.clear()}):void 0},[Kn.current]),m.a.createElement(he.a,{className:Re.a.drawerWrap,placement:"right",closable:!1,mask:!1,visible:Pt,forceRender:!0,onClose:xn},Ht>0?m.a.createElement("div",{style:{height:"100%"},ref:Kn},m.a.createElement("div",{className:Re.a.title},"\u8BD5\u9898\u7BEE"),nn.map(function(dn){return Rt[dn.stateName]>0&&m.a.createElement("div",{className:Re.a.problemset,key:dn.type},m.a.createElement("div",{className:Re.a.content},dn.typeName,"(",Rt[dn.stateName],")"),m.a.createElement("div",{className:Re.a.delete,onClick:function(){return gn(dn.type)}},m.a.createElement("i",{className:"iconfont icon-shanchu1 ".concat(Re.a.deleteIcon)})))}),m.a.createElement("div",{className:Re.a.previewWrap},m.a.createElement("div",{className:Re.a.preview,onClick:function(){return v.d.push("/problemset/preview")}},"\u8BD5\u5377\u9884\u89C8"))):m.a.createElement("div",{ref:Kn},m.a.createElement(re.a,{customText:"\u8BF7\u9009\u62E9\u8BD5\u9898\u8FDB\u884C\u7EC4\u5377"})))},mn={SINGLE:"\u5355\u9009\u9898",MULTIPLE:"\u591A\u9009\u9898",JUDGMENT:"\u5224\u65AD\u9898",COMPLETION:"\u586B\u7A7A\u9898",SUBJECTIVE:"\u7B80\u7B54\u9898",PROGRAM:"\u7F16\u7A0B\u9898",PRACTICAL:"\u5B9E\u8BAD\u9898",COMBINATION:"\u7EC4\u5408\u9898"},En=function(mt){var Pt,Rt,Ht=mt.problemset,un=mt.globalSetting,xn=mt.loading,Cn=mt.dispatch,gn=mt.onReloadData,Ln=gn===void 0?function(){}:gn,Kn=mt.onReloadBasketData,dn=Kn===void 0?function(){}:Kn,Sn=Object(d.a)(mt,["problemset","globalSetting","loading","dispatch","onReloadData","onReloadBasketData"]),hr=function(){var Nn=Object(_.a)(T.a.mark(function Kt(){var An;return T.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:return Un.next=2,Cn({type:"problemset/basketDelete",payload:Ht.actionTabs.params});case 2:An=Un.sent,Cn({type:"problemset/setActionTabs",payload:{}}),An.status===0&&(Ln(),dn());case 5:case"end":return Un.stop()}},Kt)}));return function(){return Nn.apply(this,arguments)}}();return m.a.createElement(R.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Ht.actionTabs.key==="Problemset-BasketDelete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:xn["problemset/handleDelete"],width:"442px",onOk:hr,onCancel:function(){Cn({type:"problemset/setActionTabs",payload:{}})}},m.a.createElement("div",{className:pe.a.modalContent},"\u662F\u5426\u5220\u9664\u8BD5\u9898\u7BEE\u4E2D",mn[(Pt=Ht.actionTabs)===null||Pt===void 0||((Rt=Pt.params)===null||Rt===void 0)?void 0:Rt.type]))},$t=Object(v.a)(function(Zt){var mt=Zt.problemset,Pt=Zt.loading,Rt=Zt.globalSetting;return{problemset:mt,globalSetting:Rt,loading:Pt.effects}})(En),rr=U("A60/"),Dn=U.n(rr),Sr=function(mt){var Pt=mt.count,Rt=mt.visibleBasket,Ht=mt.onToggleVisible,un=Ht===void 0?function(){}:Ht;return m.a.createElement("div",{className:"".concat(Rt?Dn.a.right180:Dn.a.right20," ").concat(Dn.a.wrap)},m.a.createElement(c.a,{title:"\u8BD5\u9898\u7BEE",placement:"left"},m.a.createElement("div",{className:Dn.a.basket,onClick:un},Pt>0&&m.a.createElement("div",{className:Dn.a.count},Pt),m.a.createElement("span",{className:Dn.a.iconWrap},m.a.createElement("i",{className:"".concat(Dn.a.icon," iconfont icon-shitilan")})),m.a.createElement("p",{className:Dn.a.name},"\u8BD5\u9898\u7BEE"))))},br=U("EJTS"),Pn=U("LE3n"),Dr=U("1vsH"),Or=U("xKgJ"),ln=U("/zsF"),Yr=U("PArb"),tn=U("jCWc"),sn=U("kPKH"),Qn=U("y8nQ"),sr=U("Vl3Y"),Nr=U("nSDg"),hn=U.n(Nr),Qt=U("HBuW"),$r=U("NLgs"),fr=U("vkP9"),Lr=x.a.Search,kn={id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]},Ur={id:"diff",name:"\u96BE\u5EA6",children:[{name:"\u5168\u90E8",id:"",type:"diff"},{name:"\u521D\u7EA7",id:1,type:"diff"},{name:"\u4E2D\u7EA7",id:2,type:"diff"},{name:"\u4E2D\u9AD8\u7EA7",id:3,type:"diff"},{name:"\u9AD8\u7EA7",id:4,type:"diff"}]},vi=function(mt){var Pt,Rt,Ht,un,xn=mt.classroomList,Cn=mt.loading,gn=mt.dispatch,Ln=mt.cb,Kn=mt.shixunIds,dn=Kn===void 0?[]:Kn,Sn=Object(nt.i)(),hr=Object(nt.h)(),Nn=xn.actionTabs,Kt=sr.a.useForm(),An=Object(h.a)(Kt,1),lr=An[0],Un=xn.shixunLists,zt=Object(M.useState)([]),jt=Object(h.a)(zt,2),yn=jt[0],Ct=jt[1],Mt=Object(M.useState)([]),Dt=Object(h.a)(Mt,2),ke=Dt[0],Vt=Dt[1],Tn=Object(M.useState)({page:1,type:"all",diff:0,status:"published",order:"desc",limit:10,sort:"myshixuns_count",tag_level:null,sub_discipline_id:null,discipline_id:null}),mr=Object(h.a)(Tn,2),On=mr[0],ii=mr[1];Object(M.useEffect)(function(){xn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"&&gn({type:"classroomList/getShixunLists",payload:Object(g.a)({},On)})},[xn.actionTabs.key]),Object(M.useEffect)(function(){return document.body.setAttribute("data-custom","height"),function(){document.body.removeAttribute("data-custom")}},[]),Object(M.useEffect)(function(){ai()},[Sn]);var ai=function(){var Bt=Object(_.a)(T.a.mark(function Er(){var ur;return T.a.wrap(function(oi){for(;;)switch(oi.prev=oi.next){case 0:return oi.next=2,Object(Qt.pb)({});case 2:ur=oi.sent,Vt((ur==null?void 0:ur.disciplines)||[]);case 4:case"end":return oi.stop()}},Er)}));return function(){return Bt.apply(this,arguments)}}(),Kr=function(Er,ur,Yn){On.tag_level=Er,On.sub_discipline_id=ur,On.discipline_id=Yn,ii(Object(g.a)({},On)),gn({type:"classroomList/getShixunLists",payload:Object(g.a)({},On)})},jn=function(){gn({type:"classroomList/setActionTabs",payload:{}}),ii({page:1,type:"all",diff:0,status:"published",order:"desc",limit:10,sort:"myshixuns_count",tag_level:null,sub_discipline_id:null,discipline_id:null})};return xn.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:m.a.createElement(he.a,{placement:"bottom",height:"100%",closable:!0,onClose:jn,visible:xn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",key:"bottom",className:hn.a.drawer,footer:m.a.createElement("div",{className:"tc"},m.a.createElement(I.a,{size:"large",onClick:function(){jn(),Ct([])},style:{marginRight:8}},"\u53D6\u6D88"),m.a.createElement(I.a,{size:"large",onClick:Object(_.a)(T.a.mark(function Bt(){var Er,ur,Yn;return T.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:Er=function(Yt){var pn=yn[Yt];if(dn.includes(pn)){var Gn,Mn;return i.b.info("\u8BF7\u52FF\u91CD\u590D\u9009\u62E9\uFF1A".concat(Un==null||((Gn=Un.shixun_list)===null||Gn===void 0||((Mn=Gn.find(function(qn){return qn.id===pn}))===null||Mn===void 0))?void 0:Mn.title)),{v:void 0}}},ur=0;case 2:if(!(ur<(yn==null?void 0:yn.length))){Xt.next=9;break}if(Yn=Er(ur),!(typeof Yn=="object")){Xt.next=6;break}return Xt.abrupt("return",Yn.v);case 6:ur++,Xt.next=2;break;case 9:jn(),Ln(yn),Ct([]);case 12:case"end":return Xt.stop()}},Bt)})),type:"primary"},"\u786E\u5B9A"))},m.a.createElement("section",{className:"tc"},m.a.createElement(fr.a,{onChange:function(Er){ii(Object(g.a)(Object(g.a)(Object(g.a)({},On),Er),{},{page:1})),gn({type:"classroomList/getShixunLists",payload:Object(g.a)(Object(g.a)(Object(g.a)({},On),Er),{},{page:1})})}})),m.a.createElement("section",{className:"edu-container"},m.a.createElement("ul",{className:hn.a.menu},m.a.createElement("li",null,kn.name),kn==null||((Pt=kn.children)===null||Pt===void 0)?void 0:Pt.map(function(Bt,Er){return m.a.createElement("li",{className:On[kn.id]==Bt.id?hn.a.actived:"",key:Bt.id,onClick:function(){On[kn.id]=Bt.id,ii(Object(g.a)({},On)),gn({type:"classroomList/getShixunLists",payload:Object(g.a)({},On)})}},m.a.createElement("strong",null,Bt.name))})),m.a.createElement("ul",{className:hn.a.menuDirection},m.a.createElement("li",{className:hn.a.directionName},"\u65B9\u5411"),m.a.createElement("li",{className:On.discipline_id?"":hn.a.actived,onClick:function(){Kr(null,null,null)}},m.a.createElement("strong",null,"\u5168\u90E8")),ke==null?void 0:ke.map(function(Bt,Er){return m.a.createElement("li",{key:Er,className:On.discipline_id==Bt.id?hn.a.actived:""},m.a.createElement("strong",{onClick:function(){Kr(1,null,Bt.id)}},Bt.name),m.a.createElement("div",null,Bt.sub_disciplines.map(function(ur,Yn){return m.a.createElement("div",{key:Yn,className:"mt5"},m.a.createElement("div",{className:On.sub_discipline_id==ur.id?"".concat(hn.a.actived2," ").concat(hn.a.subTag):hn.a.subTag,onClick:function(){Kr(2,ur.id,Bt.id)}},ur.name),m.a.createElement("ul",{className:"mt5"},ur.tags&&ur.tags.map(function(oi,Xt){return m.a.createElement("li",{key:Xt,className:On.sub_discipline_id==oi.id&&On.tag_level===3?hn.a.actived2:"",onClick:function(){Kr(3,oi.id,Bt.id)}},oi.name)})))})))})),m.a.createElement("ul",{className:hn.a.menu},m.a.createElement("li",null,Ur.name),Ur==null||((Rt=Ur.children)===null||Rt===void 0)?void 0:Rt.map(function(Bt,Er){return m.a.createElement("li",{className:On[Ur.id]==Bt.id?hn.a.actived:"",key:Bt.name,onClick:function(){On[Ur.id]=Bt.id,ii(Object(g.a)({},On)),gn({type:"classroomList/getShixunLists",payload:Object(g.a)({},On)})}},m.a.createElement("strong",null,Bt.name))})),m.a.createElement(Y.a,null,m.a.createElement(sn.a,{flex:"1"},m.a.createElement("div",{className:hn.a.menuCourse,style:{margin:"0px 15px"}},m.a.createElement("ul",null,m.a.createElement("li",null,"\u5DF2\u9009",m.a.createElement("span",{className:"c-blue"},yn.length),"\u4E2A\u5B9E\u8BAD"),m.a.createElement("li",null,"\u5171",m.a.createElement("span",{className:"c-blue"},Un.shixuns_count),"\u4E2A\u8BFE\u7A0B"),m.a.createElement("li",{className:"current",onClick:function(){var Er=Object(g.a)(Object(g.a)({},On),{},{order:On.order==="asc"?"desc":"asc"});ii(Er),gn({type:"classroomList/getShixunLists",payload:Er})}},"\u5B66\u4E60\u4EBA\u6570",m.a.createElement("p",{className:"edu-sorter current ".concat(On.order)},On.order==="asc"?m.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}):m.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"})))))),m.a.createElement(sn.a,{className:"c-grey-999"},"\u4EC5\u5DF2\u53D1\u5E03\u7684\u5B9E\u8BAD\u8FDB\u5165\u672C\u5217\u8868\u5907\u9009")),Un==null||((Ht=Un.shixun_list)===null||Ht===void 0)?void 0:Ht.map(function(Bt,Er){return m.a.createElement("div",{className:hn.a.listItem,key:Er},m.a.createElement(u.a,{checked:yn.includes(Bt.id),value:Bt.id,disabled:Bt==null?void 0:Bt.need_authorize,onChange:function(Yn){var oi=yn.indexOf(Bt.id);yn.indexOf(Bt.id)>-1?Ct(yn.filter(function(Xt){return Xt!==Bt.id})):Ct(yn.concat(Bt.id))}}),m.a.createElement("div",{className:hn.a.info},m.a.createElement("div",{className:hn.a.title},m.a.createElement("div",{className:hn.a.titleLeft},m.a.createElement("a",{className:"c-black",href:"/shixuns/".concat(Bt==null?void 0:Bt.identifier,"/challenges"),target:"_blank"},m.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:Bt.title}})),(Bt==null?void 0:Bt.need_authorize)&&m.a.createElement("span",{onClick:function(){Object($r.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(Or.v)()&&(Bt==null?void 0:Bt.mark_status)===1&&m.a.createElement(c.a,{title:Bt==null?void 0:Bt.mark_content},m.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(Or.v)()&&(Bt==null?void 0:Bt.mark_status)===2&&m.a.createElement(c.a,{title:Bt==null?void 0:Bt.mark_content},m.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(Or.v)()&&(Bt==null?void 0:Bt.mark_status)===3&&m.a.createElement(c.a,{title:Bt==null?void 0:Bt.mark_content},m.a.createElement("span",{style:{marginRight:"auto",background:"#E53333"},className:"tag-style current ml10"},"\u65E0\u6CD5\u4F7F\u7528")))),m.a.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},m.a.createElement("span",{className:hn.a.description,dangerouslySetInnerHTML:{__html:Bt.description}})),m.a.createElement("div",{className:" mt15"},Bt.challenge_names.map(function(ur,Yn){return m.a.createElement("span",{key:Yn,className:"mr30 font12"},"\u7B2C",Yn+1,"\u5173 ",ur," ")})),m.a.createElement(Yr.a,{dashed:!0}),m.a.createElement("div",{className:"c-light-black mt20 font12"},m.a.createElement("span",null,Bt.author_name),m.a.createElement("span",{className:"ml15 mr15"},"|"),m.a.createElement("span",null,Bt.author_school_name),m.a.createElement("span",{className:"ml15 mr15"},"|"),m.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",Bt.level),m.a.createElement("span",{className:"ml15 mr15"},"|"),m.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),m.a.createElement("span",null,Bt.study_count))))}),(Un==null||((un=Un.shixun_list)===null||un===void 0)?void 0:un.length)===0&&m.a.createElement(re.a,null),m.a.createElement("p",null)),m.a.createElement("div",{className:"tc mt20"},m.a.createElement(z.a,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:10,showSizeChanger:!1,current:On.page||1,showQuickJumper:!0,total:Un==null?void 0:Un.shixuns_count,onChange:function(Er){var ur=Object(g.a)(Object(g.a)({},On),{},{page:Er});ii(ur),gn({type:"classroomList/getShixunLists",payload:ur})}})))},Ai=Object(v.a)(function(Zt){var mt=Zt.classroomList,Pt=Zt.loading;return{classroomList:mt,loading:Pt}})(vi),Et=U("mgmH"),fn=U("ErOA"),Gi=U("ORt/"),zi=U.n(Gi),na=U("Ot1p"),Vi=function(mt,Pt){var Rt,Ht=mt.data,un=sr.a.useForm(),xn=Object(h.a)(un,1),Cn=xn[0],gn=Object(M.useState)({}),Ln=Object(h.a)(gn,2),Kn=Ln[0],dn=Ln[1];return Object(M.useEffect)(function(){Ht&&(dn(Ht),Cn.setFieldsValue(Object(g.a)({},Ht)))},[Ht]),Object(M.useImperativeHandle)(Pt,function(){return{form:Cn}}),m.a.createElement("div",{className:zi.a.operating},m.a.createElement(sr.a,{form:Cn,scrollToFirstError:!0,onValuesChange:function(){dn(Object(g.a)({},Cn.getFieldsValue()))}},m.a.createElement(sr.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"},{max:30,message:"\u8BF7\u8F93\u5165\u6807\u9898\uFF0C\u6700\u5927\u9650\u523630\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},m.a.createElement(x.a,{placeholder:"\u8BF7\u8F93\u5165\u6807\u9898\uFF0C\u6700\u5927\u9650\u523630\u4E2A\u5B57\u7B26",suffix:"".concat(((Rt=Kn.name)===null||Rt===void 0?void 0:Rt.length)||0,"/30")})),m.a.createElement(sr.a.Item,{name:"languages",label:"\u7F16\u7A0B\u8BED\u8A00",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},m.a.createElement(u.a.Group,null,m.a.createElement(u.a,{value:"c"},"C"),m.a.createElement(u.a,{value:"c++"},"C++"),m.a.createElement(u.a,{value:"java"},"Java"),m.a.createElement(u.a,{value:"python"},"Python"))),m.a.createElement("div",{className:zi.a.tip},"\u9009\u62E9\u652F\u6301\u4EE5\u4E0B\u7F16\u7A0B\u8BD5\u9898\u8FDB\u884C\u7F16\u8BD1\u7684\u8BED\u8A00"),m.a.createElement("div",{style:{margin:"20px 0 12px 0px"}},"\u8BF4\u660E"),m.a.createElement(sr.a.Item,{name:"description"},m.a.createElement(na.a,{defaultValue:Kn.description||"",watch:!0}))))},Z=Object(M.forwardRef)(Vi),L=U("SVaM"),k=U("sesT"),V=U.n(k),ne=U("wNkr"),Q=U.n(ne),Pe=U("xTzM"),pt=U.n(Pe),Lt=j.a.TabPane,rn=x.a.Search,vt=x.a.TextArea,Gt;(function(Zt){Zt.Mine="0",Zt.Public="1",Zt.Collection="2",Zt.TeachGroupShare="3"})(Gt||(Gt={}));var pr=function(mt){var Pt,Rt,Ht,un,xn,Cn,gn,Ln,Kn,dn,Sn,hr,Nn=mt.classroomList,Kt=mt.problemset,An=mt.user,lr=mt.globalSetting,Un=mt.loading,zt=mt.dispatch,jt=mt.match,yn=mt.shixunHomeworks,Ct=Object(d.a)(mt,["classroomList","problemset","user","globalSetting","loading","dispatch","match","shixunHomeworks"]),Mt=Object(M.useState)({discipline_id:null,sub_discipline_id:null,tag_discipline_id:null,group_id:null,type:"0",item_type:null,difficulty:null,keyword:null,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",id:((Pt=Ct.location)===null||Pt===void 0||((Rt=Pt.query)===null||Rt===void 0)?void 0:Rt.id)||null,exam_id:(jt==null||((Ht=jt.params)===null||Ht===void 0)?void 0:Ht.id)||null,exercise_id:(jt==null||((un=jt.params)===null||un===void 0)?void 0:un.categoryId)||null}),Dt=Object(h.a)(Mt,2),ke=Dt[0],Vt=Dt[1],Tn=Object(M.useState)(0),mr=Object(h.a)(Tn,2),On=mr[0],ii=mr[1],ai=Object(M.useState)([]),Kr=Object(h.a)(ai,2),jn=Kr[0],Bt=Kr[1],Er=Object(M.useState)(Gt.Mine),ur=Object(h.a)(Er,2),Yn=ur[0],oi=ur[1],Xt=Object(M.useState)(0),Jt=Object(h.a)(Xt,2),Yt=Jt[0],pn=Jt[1],Gn=Object(M.useState)(-1),Mn=Object(h.a)(Gn,2),qn=Mn[0],gr=Mn[1],wi=Object(M.useState)([]),Zn=Object(h.a)(wi,2),Qi=Zn[0],vr=Zn[1],fi=Object(M.useState)(!1),si=Object(h.a)(fi,2),Ni=si[0],ka=si[1],Lo=Object(M.useState)([]),ua=Object(h.a)(Lo,2),Gr=ua[0],lo=ua[1],uo=Object(M.useState)(0),va=Object(h.a)(uo,2),ya=va[0],$a=va[1],co=Object(M.useState)(!1),Ma=Object(h.a)(co,2),Ca=Ma[0],ho=Ma[1],fo=Object(M.useState)(!1),Na=Object(h.a)(fo,2),po=Na[0],Qa=Na[1],_a=Object(M.useRef)(!1),ra=Object(M.useRef)(""),ba=Object(M.useRef)(),Ee=Object(M.useRef)(),Le=Object(M.useRef)(),We=Object(M.useState)(),Se=Object(h.a)(We,2),ie=Se[0],ve=Se[1],le=Object(M.useState)([]),Ae=Object(h.a)(le,2),_e=Ae[0],Be=Ae[1],je=Object(M.useRef)(!1),Ge=(jt==null?void 0:jt.url)==="/problemset",tt=jt==null||((xn=jt.url)===null||xn===void 0)?void 0:xn.includes("program_homework"),yt=tt&&jt!==null&&jt!==void 0&&(Cn=jt.params)!==null&&Cn!==void 0&&Cn.categoryId&&jt!==null&&jt!==void 0&&(gn=jt.url)!==null&&gn!==void 0&&gn.includes("edit")?jt==null||((Ln=jt.params)===null||Ln===void 0)?void 0:Ln.categoryId:"",Tt=yt?"\u7F16\u8F91\u7F16\u7A0B\u4F5C\u4E1A":"\u65B0\u5EFA\u7F16\u7A0B\u4F5C\u4E1A",Nt=Object(M.useState)({}),Rn=Object(h.a)(Nt,2),$n=Rn[0],Bn=Rn[1],zn=Object(M.useState)(!1),Xn=Object(h.a)(zn,2),Vn=Xn[0],Fn=Xn[1],Jn=An.userInfo||{},er=Jn.admin,jr=Jn.business,tr=Jn.is_shixun_marker,_n=Jn.is_teacher,vn=Jn.user_identity,Wn=er||jr||tr||_n||vn!=="\u5B66\u751F",cr=Object(M.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),an=Object(h.a)(cr,2),dr=an[0],Br=an[1],ir=yn.commonHomeWorkAddDefaultData,Ar=Object(M.useState)([]),xr=Object(h.a)(Ar,2),zr=xr[0],Qr=xr[1],Wr=Object(M.useRef)(null),yi=Object(M.useState)(!1),Ii=Object(h.a)(yi,2),Ci=Ii[0],Zr=Ii[1],Pr=Object(M.useState)([]),Tr=Object(h.a)(Pr,2),wn=Tr[0],wr=Tr[1],Ui=Object(M.useState)(""),Zi=Object(h.a)(Ui,2),ia=Zi[0],Cr=Zi[1],Xi=Object(M.useState)(!1),Ji=Object(h.a)(Xi,2),Rr=Ji[0],yr=Ji[1],Hr=Object(M.useRef)(null),Ua=[{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u5347\u5E8F",type:"updated_at",direction:"asc"},{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F",type:"updated_at",direction:"desc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u5347\u5E8F",type:"quotes",direction:"asc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u964D\u5E8F",type:"quotes",direction:"desc"}];Object(M.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]);var Za=function(){var it=Object(_.a)(T.a.mark(function Je(){var $e,ot,ut;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,Object(Ke.q)({id:yt});case 2:$e=St.sent,$e!=null&&$e.name&&(ut={description:$e.description,languages:$e.languages,name:$e.name},Hr.current.form.setFieldsValue(ut),Bn(Object(g.a)({},ut)),wr(Object(O.a)($e.data)),Be((ot=$e.data)===null||ot===void 0?void 0:ot.map(function(wt){return wt.id})));case 4:case"end":return St.stop()}},Je)}));return function(){return it.apply(this,arguments)}}();Object(M.useEffect)(function(){yt&&Za()},[yt]),Object(M.useEffect)(function(){var it,Je=((it=Ct.location.query)===null||it===void 0?void 0:it.group_id)||0;ke.group_id=Number(Je),zt({type:"problemset/getDisciplines",payload:Object(g.a)(Object(g.a)({source:"question"},ke),{},{group_type:Yn})}),Vt(ke),ti(ke).then(function($e){$e!=null&&$e.status||Qr($e==null?void 0:$e.item_banks_group),Zr(!1)}),Yi(),Ea()},[]),Object(M.useEffect)(function(){return zt({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),zt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){zt({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),zt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[]),Object(M.useEffect)(function(){return zt({type:"globalSetting/headerFixedToggle",payload:!0}),function(){zt({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(M.useEffect)(function(){return zt({type:"globalSetting/headerFooterToggle",payload:Ge}),function(){zt({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(M.useEffect)(function(){Object(Dr.X)(tt?Tt:"\u8BD5\u9898\u5E93")},[tt,Tt]);var ca=function(Je,$e){var ot=[];if(!Je){var ut,At;Kt==null||((ut=Kt.disciplinesData)===null||ut===void 0||((At=ut.disciplines)===null||At===void 0))||At.forEach(function(Vr){var ji;Vr==null||((ji=Vr.sub_disciplines)===null||ji===void 0)||ji.forEach(function(ta){var La;ta==null||((La=ta.tag_disciplines)===null||La===void 0)||La.forEach(function(Bi){Bi.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&ot.push(Bi)})})})}if(Je&&!$e){var St,wt,cn,nr=Kt==null||((St=Kt.disciplinesData)===null||St===void 0||((wt=St.disciplines)===null||wt===void 0))?void 0:wt.find(function(Vr){return Vr.id===Je});nr==null||((cn=nr.sub_disciplines)===null||cn===void 0)||cn.forEach(function(Vr){var ji;Vr==null||((ji=Vr.tag_disciplines)===null||ji===void 0)||ji.forEach(function(ta){ta.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&ot.push(ta)})})}if(Je&&$e){var Oi,Hn,bi,Ei,mi=Kt==null||((Oi=Kt.disciplinesData)===null||Oi===void 0||((Hn=Oi.disciplines)===null||Hn===void 0))?void 0:Hn.find(function(Vr){return Vr.id===Je}),Ri=mi==null||((bi=mi.sub_disciplines)===null||bi===void 0)?void 0:bi.find(function(Vr){return Vr.id===$e});Ri==null||((Ei=Ri.tag_disciplines)===null||Ei===void 0)||Ei.forEach(function(Vr){Vr.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&ot.push(Vr)})}return ot},Ea=function(){var it=Object(_.a)(T.a.mark(function Je(){return T.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:zt({type:"problemset/getTeachGroupData"});case 1:case"end":return ot.stop()}},Je)}));return function(){return it.apply(this,arguments)}}();Object(M.useEffect)(function(){var it=Kt.basketData||{},Je=it.completion_questions_count,$e=Je===void 0?0:Je,ot=it.judgement_questions_count,ut=ot===void 0?0:ot,At=it.multiple_questions_count,St=At===void 0?0:At,wt=it.practical_questions_count,cn=wt===void 0?0:wt,nr=it.program_questions_count,Oi=nr===void 0?0:nr,Hn=it.single_questions_count,bi=Hn===void 0?0:Hn,Ei=it.subjective_questions_count,mi=Ei===void 0?0:Ei,Ri=it.combination_questions_count,Vr=Ri===void 0?0:Ri,ji=$e+ut+St+cn+Oi+bi+mi+Vr;$a(ji)},[Kt.basketData]);var ti=function(){var it=Object(_.a)(T.a.mark(function Je($e){var ot,ut;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return ot=Object(g.a)({},$e),ot.item_type=tt?"PROGRAM":$e.item_type,Zr(!0),ot.keyword=encodeURIComponent($e.keyword||""),St.next=6,zt({type:"problemset/getItemBanks",payload:ot});case 6:if(ut=St.sent,!(ut&&ut.status!==403&&ut.status!==401&&ut.status!==500)){St.next=18;break}return ii(ut.items_count||0),Bt(ut.items||[]),vr(ut.tag_disciplines||[]),ve(ut.used_shixun_ids||[]),ja(ut.items||[]),tt||Be([]),lo((ut==null?void 0:ut.navigation)||[]),pn((ut==null?void 0:ut.added_num)||0),Zr(!1),St.abrupt("return",ut);case 18:case"end":return St.stop()}},Je)}));return function($e){return it.apply(this,arguments)}}(),Yi=function(){zt({type:"problemset/getBasketList",payload:{}})},ja=function(Je){var $e=Je.every(function(ot){var ut;return((ut=ot.program_attr)===null||ut===void 0?void 0:ut.status)===0});_a.current=$e},Io=function(Je,$e){if(ke.discipline_id=Je||"",ke.sub_discipline_id=$e||"",ke.tag_discipline_id="",ke.page=1,ke.per_page=20,delete ke.id,gr(Je===null?-1:null),Vt(ke),ti(ke),Je===null)return},Po=function(Je){ke.item_type=Je||"",ke.page=1,ke.per_page=20,Vt(ke),ti(ke)},mo=function(Je){ke.difficulty=Je||"",ke.page=1,ke.per_page=20,delete ke.id,Vt(ke),ti(ke)},Ja=function(Je){ke.tag_discipline_id=Je,ke.page=1,ke.per_page=20,delete ke.id,Je===-1&&(ke.discipline_id="",ke.sub_discipline_id="",ke.tag_discipline_id=""),gr(Je),Vt(ke),ti(ke)},qa=Object(M.useState)(!1),da=Object(h.a)(qa,2),xa=da[0],go=da[1],Ba=function(Je){zt({type:"problemset/getDisciplines",payload:{source:"question",group_id:0,group_type:Je}}),ke.discipline_id="",ke.sub_discipline_id="",ke.tag_discipline_id="",ke.item_type=null,ke.difficulty=null,ke.type=Je,Je==="0"?ke.group_id=0:ke.group_id=null,Je==="3"&&tt?ke.only_published=!0:ke.only_published=null,Je==="3"?go(!0):go(!1),ke.page=1,ke.per_page=20,delete ke.id,gr(-1),oi(Je),Vt(ke),ti(ke)},Ta=function(Je,$e){ke.page=Je,ke.per_page=$e,Vt(ke),ti(ke)},ha=function(Je){ke.discipline_id="",ke.sub_discipline_id="",ke.tag_discipline_id="",ke.item_type=null,ke.difficulty=null,ke.page=1,ke.keyword=Je,delete ke.id,Je?(Qa(!0),Object(L.a)({name:Je,copywriting:Je,position:tt?"Practice":"ItemBank"})):Qa(!1),gr(-1),Vt(ke),ti(ke)},kr=function(){ke.per_page=20,Vt(ke),ti(ke)},Pi=function(Je){var $e=Je.length===jn.length&&ke.page>1?ke.page-1:ke.page;ke.page=$e,ke.per_page=20,Yi(),Vt(ke),ti(ke)},fa=function(){zt({type:"problemset/setActionTabs",payload:{key:"Problemset-PublicReview"}})},aa=function(){var it=Object(_.a)(T.a.mark(function Je($e,ot){var ut;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:if(!ot){St.next=6;break}return St.next=3,Object(Ke.n)({id:$e});case 3:St.t0=St.sent,St.next=9;break;case 6:return St.next=8,Object(Ke.G)({id:$e});case 8:St.t0=St.sent;case 9:ut=St.t0,(ut==null?void 0:ut.status)===0&&kr();case 11:case"end":return St.stop()}},Je)}));return function($e,ot){return it.apply(this,arguments)}}(),Sa=function(){var it=Object(_.a)(T.a.mark(function Je($e){return T.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:Ka($e);case 1:case"end":return ut.stop()}},Je)}));return function($e){return it.apply(this,arguments)}}(),pa=function(){var it=Object(_.a)(T.a.mark(function Je($e){return T.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:Ha([$e]);case 1:case"end":return ut.stop()}},Je)}));return function($e){return it.apply(this,arguments)}}(),Fa=function(Je){Ee.current="",ba.current="",R.a.confirm({centered:!0,width:530,icon:null,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BD5\u9898\u7EA0\u9519",content:m.a.createElement("div",{className:"font14"},m.a.createElement("div",null,"\u9519\u8BEF\u7C7B\u578B\uFF1A"),m.a.createElement(A.a.Group,{className:"mt10",onChange:function(ot){return ba.current=ot.target.value}},m.a.createElement(A.a,{value:"\u9898\u5E72"},"\u9898\u5E72"),m.a.createElement(A.a,{value:"\u7B54\u6848"},"\u7B54\u6848"),m.a.createElement(A.a,{value:"\u89E3\u6790"},"\u89E3\u6790"),m.a.createElement(A.a,{value:"\u5C5E\u6027"},"\u5C5E\u6027"),m.a.createElement(A.a,{value:"\u5176\u5B83"},"\u5176\u5B83")),m.a.createElement("div",{className:"mt10"},"\u9519\u8BEF\u63CF\u8FF0\uFF1A"),m.a.createElement(vt,{className:"mt10",rows:4,defaultValue:Ee.current,onChange:function(ot){return Ee.current=ot.target.value}})),onOk:function(){return new Promise(function(){var ot=Object(_.a)(T.a.mark(function ut(At,St){var wt;return T.a.wrap(function(nr){for(;;)switch(nr.prev=nr.next){case 0:if(ba.current&&Ee.current){nr.next=3;break}return i.b.info("\u8BF7\u586B\u5199\u9519\u8BEF\u7C7B\u578B\u548C\u9519\u8BEF\u63CF\u8FF0\uFF01"),nr.abrupt("return",St());case 3:return nr.next=5,Object(Ke.o)({id:Je,clazz:ba.current,description:Ee.current});case 5:wt=nr.sent,wt.status===0&&i.b.info("\u6DFB\u52A0\u6210\u529F\uFF01"),At();case 8:case"end":return nr.stop()}},ut)}));return function(ut,At){return ot.apply(this,arguments)}}())}})},eo=function(Je){zt({type:"problemset/setActionTabs",payload:{key:"Problemset-SetPrivate",params:{id:Je}}})},Wa=function(Je){zt({type:"problemset/setActionTabs",payload:{key:"Problemset-Delete",params:{id:Je}}})},to=function(){var it=Object(_.a)(T.a.mark(function Je($e){var ot,ut,At,St;return T.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:if(ot=$e.item_type,!(ot==="PROGRAM")){cn.next=12;break}return ut=$e.program_attr.identifier,cn.next=5,zt({type:"problemset/startExperience",payload:{id:ut}});case 5:if(At=cn.sent,!(At.status===0)){cn.next=10;break}return St=At.identifier,Object(Dr.S)("/myproblems/".concat(St)),cn.abrupt("return");case 10:return i.b.warn(At.message),cn.abrupt("return");case 12:zt({type:"problemset/setActionTabs",payload:{key:ot,params:$e}});case 13:case"end":return cn.stop()}},Je)}));return function($e){return it.apply(this,arguments)}}(),qi=function(){var it=Object(_.a)(T.a.mark(function Je($e){var ot,ut,At;return T.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(!ke.exam_id){wt.next=6;break}return wt.next=3,Object(Ke.M)({item_id:$e,id:ke.exam_id});case 3:return ot=wt.sent,ot.status===0&&kr(),wt.abrupt("return");case 6:if(!(ke!=null&&ke.exercise_id)){wt.next=12;break}return wt.next=9,Object(fn.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:ke==null?void 0:ke.exercise_id,item_bank_ids:[$e]}});case 9:return ut=wt.sent,ut.status===0&&kr(),wt.abrupt("return");case 12:return wt.next=14,zt({type:"problemset/cancel",payload:{id:$e,item_bank:1}});case 14:At=wt.sent,At.status===0&&(kr(),Yi());case 16:case"end":return wt.stop()}},Je)}));return function($e){return it.apply(this,arguments)}}(),oa=function(){var it=Object(_.a)(T.a.mark(function Je($e){return T.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:zt({type:"problemset/getDisciplines",payload:{source:"question",group_id:Math.abs($e),group_type:Gt.Mine}}),ke.discipline_id="",ke.sub_discipline_id="",ke.tag_discipline_id="",ke.page=1,ke.per_page=20,ke.group_id=Math.abs($e),gr(-1),Vt(ke),ti(ke).then(function(At){return Qr(At==null?void 0:At.item_banks_group)});case 10:case"end":return ut.stop()}},Je)}));return function($e){return it.apply(this,arguments)}}(),no=function(){var it=Object(_.a)(T.a.mark(function Je($e){var ot,ut,At;return T.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(!ke.exam_id){wt.next=6;break}return wt.next=3,Object(Ke.t)({exam_id:ke.exam_id,item_bank_ids:[$e]});case 3:return ot=wt.sent,ot.status===0&&kr(),wt.abrupt("return");case 6:if(!(ke!=null&&ke.exercise_id)){wt.next=12;break}return wt.next=9,Object(fn.a)("/api/exercises/".concat(ke==null?void 0:ke.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:[$e]}});case 9:return ut=wt.sent,ut.status===0&&kr(),wt.abrupt("return");case 12:if(!(ya===200)){wt.next=15;break}return i.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),wt.abrupt("return");case 15:return wt.next=17,zt({type:"problemset/select",payload:{item_bank_ids:[$e]}});case 17:At=wt.sent,At.status===0&&(kr(),Yi());case 19:case"end":return wt.stop()}},Je)}));return function($e){return it.apply(this,arguments)}}(),ro=function(){var it=Object(_.a)(T.a.mark(function Je($e){return T.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:if($e){ut.next=3;break}if(_e!=null&&_e.length){ut.next=3;break}return ut.abrupt("return",i.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898"));case 3:Le.current=[0],R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u79FB\u52A8\u5230",maskClosable:!0,className:"custom-modal-divider",icon:null,content:m.a.createElement("div",{className:"font14 ".concat(me.a.overflow),style:{maxHeight:500,overflow:"auto"}},m.a.createElement("p",{className:"c-grey-333"},"\u8BF7\u9009\u62E9\u9700\u8981\u79FB\u52A8\u5230\u7684\u6587\u4EF6\u5939"),m.a.createElement(ae.a,{defaultValue:!0,value:Le.current,onChange:function(St){return Le.current=St}})),onOk:function(){var At=Object(_.a)(T.a.mark(function wt(){var cn,nr;return T.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:return Hn.next=2,Object(Ke.f)({ids:$e?[$e]:_e,groups_ids:(cn=Le.current)===null||cn===void 0?void 0:cn[0]});case 2:nr=Hn.sent,Le.current=[],(nr==null?void 0:nr.status)===0&&kr();case 5:case"end":return Hn.stop()}},wt)}));function St(){return At.apply(this,arguments)}return St}()});case 5:case"end":return ut.stop()}},Je)}));return function($e){return it.apply(this,arguments)}}(),ko=function(){var it=Object(_.a)(T.a.mark(function Je($e){var ot,ut;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,Object(Ke.D)({clazz:"ItemBank",id:$e});case 2:ot=St.sent,ut=(ot==null?void 0:ot.groups)||[],Le.current=[],R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A\u64A4\u9500",cancelText:"\u53D6\u6D88",title:"\u672C\u9898\u5DF2\u5171\u4EAB\u7684\u6559\u7814\u56E2\u961F",maskClosable:!0,icon:null,content:m.a.createElement("div",{className:"font14 ".concat(me.a.overflow)},m.a.createElement("p",{className:"c-grey-999"},"\u9009\u4E2D\u5E76\u786E\u5B9A\uFF0C\u5373\u64A4\u9500\u672C\u9898\u5BF9\u9009\u4E2D\u6559\u7814\u56E2\u961F\u7684\u5206\u4EAB"),m.a.createElement(u.a.Group,{className:me.a.checkbox,defaultValue:Le.current,onChange:function(cn){return Le.current=cn}},ut==null?void 0:ut.map(function(wt){return m.a.createElement(u.a,{key:wt.group_id,value:wt.group_id},wt.name)}))),onOk:function(){var wt=Object(_.a)(T.a.mark(function nr(){return T.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:return Hn.abrupt("return",new Promise(function(){var bi=Object(_.a)(T.a.mark(function Ei(mi,Ri){var Vr,ji,ta;return T.a.wrap(function(Bi){for(;;)switch(Bi.prev=Bi.next){case 0:if(Le.current.length){Bi.next=3;break}return i.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u64A4\u9500\u5171\u4EAB\u7684\u6559\u7814\u56E2\u961F"),Bi.abrupt("return",Ri());case 3:return ji=ut==null||((Vr=ut.map(function(_o){return _o.group_id}))===null||Vr===void 0)?void 0:Vr.filter(function(_o){return!Le.current.includes(_o)}),Bi.next=6,Object(Ke.l)({ids:[$e],clazz:"ItemBank",group_ids:ji});case 6:return ta=Bi.sent,Le.current=[],(ta==null?void 0:ta.status)===0&&(i.b.info("\u64A4\u9500\u5171\u4EAB\u6210\u529F"),kr()),Bi.abrupt("return",mi());case 10:case"end":return Bi.stop()}},Ei)}));return function(Ei,mi){return bi.apply(this,arguments)}}()));case 1:case"end":return Hn.stop()}},nr)}));function cn(){return wt.apply(this,arguments)}return cn}()});case 6:case"end":return St.stop()}},Je)}));return function($e){return it.apply(this,arguments)}}(),Mo=function(Je){zt({type:"problemset/setActionTabs",payload:{key:"Problemset-BasketDelete",params:{type:Je}}})},io=function(){zt({type:"problemset/setActionTabs",payload:{key:"\u65B0\u5EFA\u6587\u4EF6\u5939",params:ke}});return},No=function(){var Je={discipline_id:"&discipline_id=".concat(ke.discipline_id),sub_discipline_id:"&sub_discipline_id=".concat(ke.sub_discipline_id),tag_discipline_id:"&sub_discipline_id=".concat(ke.tag_discipline_id),difficulty:"&difficulty=".concat(ke.difficulty),item_type:"&item_type=".concat(ke.item_type),group_id:"&group_id=".concat(ke.group_id||0)},$e="/problemset/newitem?pages=".concat(ke.page);Object.keys(Je).forEach(function(ot){ke[ot]&&($e=$e+Je[ot])}),v.d===null||v.d===void 0||v.d.push($e)},ni=function(Je){var $e=_e;if(!($e!=null&&$e.length))return i.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(ya+$e.length>200&&Je&&Ge){i.b.info("\u8BD5\u9898\u7BEE\u4E2D\u6700\u591A\u53EF\u518D\u52A0\u5165".concat(200-ya,"\u9898\uFF0C\u5F53\u524D\u9009\u4E2D").concat($e.length,"\u9898\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9"));return}Je?Jr($e):pi($e)},Jr=function(){var it=Object(_.a)(T.a.mark(function Je($e){var ot;return T.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:ot=Object(O.a)($e),jn.forEach(function(St){if(ot.includes(St.id)){var wt;St.item_type==="PROGRAM"&&((wt=St.program_attr)===null||wt===void 0?void 0:wt.status)===0&&Object(ft.remove)(ot,function(cn){return cn===St.id})}}),R.a.confirm({width:530,title:"\u63D0\u793A",className:"custom-modal-divider ",icon:null,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:m.a.createElement("div",null,"\u5F53\u524D\u5DF2\u9009\u62E9",$e.length,"\u9053\u8BD5\u9898\uFF0C\u5DF2\u52A0\u5165\u8FC7\u7684\u8BD5\u9898\u6216\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\u5C06\u4E0D\u4F1A\u91CD\u590D\u52A0\u5165"," "),onOk:function(){var St=Object(_.a)(T.a.mark(function cn(){var nr;return T.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:if(!ke.exam_id){Hn.next=6;break}return Hn.next=3,Object(Ke.t)({exam_id:ke.exam_id,item_bank_ids:ot});case 3:nr=Hn.sent,Hn.next=15;break;case 6:if(!(ke!=null&&ke.exercise_id)){Hn.next=12;break}return Hn.next=9,Object(fn.a)("/api/exercises/".concat(ke==null?void 0:ke.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:ot}});case 9:nr=Hn.sent,Hn.next=15;break;case 12:return Hn.next=14,zt({type:"problemset/select",payload:{item_bank_ids:ot}});case 14:nr=Hn.sent;case 15:nr.status===0&&(kr(),Yi());case 16:case"end":return Hn.stop()}},cn)}));function wt(){return St.apply(this,arguments)}return wt}()});case 3:case"end":return At.stop()}},Je)}));return function($e){return it.apply(this,arguments)}}(),pi=function(){var it=Object(_.a)(T.a.mark(function Je($e){var ot;return T.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!ke.exam_id){At.next=6;break}return At.next=3,Object(fn.a)("/api/examination_banks/".concat(ke.exam_id,"/batch_revoke_item.json"),{method:"post",body:{item_ids:$e}});case 3:ot=At.sent,At.next=15;break;case 6:if(!(ke!=null&&ke.exercise_id)){At.next=12;break}return At.next=9,Object(fn.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:ke==null?void 0:ke.exercise_id,item_bank_ids:$e}});case 9:ot=At.sent,At.next=15;break;case 12:return At.next=14,zt({type:"problemset/unselectAll",payload:{item_ids:$e}});case 14:ot=At.sent;case 15:ot.status===0&&(kr(),Yi());case 16:case"end":return At.stop()}},Je)}));return function($e){return it.apply(this,arguments)}}(),qr=function(){var it=Object(_.a)(T.a.mark(function Je($e){var ot;return T.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!(Ge&&ya===200)){At.next=3;break}return i.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),At.abrupt("return");case 3:if(!ke.exam_id){At.next=10;break}return At.next=6,Object(Ke.t)({exam_id:ke.exam_id,shixun_ids:$e});case 6:ot=At.sent,ot.status===0&&kr(),At.next=14;break;case 10:return At.next=12,zt({type:"problemset/select",payload:{shixun_ids:$e}});case 12:ot=At.sent,ot.status===0&&(Yi(),kr());case 14:case"end":return At.stop()}},Je)}));return function($e){return it.apply(this,arguments)}}(),Aa=function(){zt({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}})},Ha=function(Je){var $e,ot,ut,At;if(!(($e=Kt.teachGroupData)!==null&&$e!==void 0&&(ot=$e.groups)!==null&&ot!==void 0&&ot.length))return i.b.info("\u60A8\u6682\u672A\u521B\u5EFA\u6216\u52A0\u5165\u4EFB\u4F55\u6559\u7814\u56E2\u961F\uFF0C\u8BF7\u524D\u5F80\u201C\u6211\u7684\u4E2A\u4EBA\u4E2D\u5FC3-\u6559\u7814\u56E2\u961F\u201D\u67E5\u770B");R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5171\u4EAB\u81F3\u6559\u7814\u56E2\u961F",maskClosable:!0,icon:null,content:m.a.createElement("div",{className:"font14 ".concat(me.a.overflow)},m.a.createElement(u.a.Group,{className:me.a.checkbox,defaultValue:Le.current,onChange:function(wt){return Le.current=wt}},(ut=Kt.teachGroupData)===null||ut===void 0||((At=ut.groups)===null||At===void 0)?void 0:At.map(function(St){return m.a.createElement(u.a,{key:St.group_id,value:St.group_id},St.name)}))),onOk:function(){return new Promise(function(){var wt=Object(_.a)(T.a.mark(function cn(nr,Oi){var Hn,bi;return T.a.wrap(function(mi){for(;;)switch(mi.prev=mi.next){case 0:if((Hn=Le.current)!==null&&Hn!==void 0&&Hn.length){mi.next=3;break}return i.b.info("\u8BF7\u5148\u9009\u62E9\u6559\u7814\u56E2\u961F"),mi.abrupt("return",Oi());case 3:return mi.next=5,Object(Ke.l)({ids:Je||_e,clazz:"ItemBank",group_ids:Le.current});case 5:bi=mi.sent,(bi==null?void 0:bi.status)===0&&(i.b.info("\u6240\u9009\u8BD5\u9898\u6210\u529F\u5206\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),Le.current=[],Be([]),kr(),nr());case 7:case"end":return mi.stop()}},cn)}));return function(cn,nr){return wt.apply(this,arguments)}}())}})},ki=function(){var Je=function(){var $e=Object(_.a)(T.a.mark(function ot(){var ut;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return ka(!0),St.next=3,Object(Ke.j)({ids:_e});case 3:ut=St.sent,ka(!1),(ut==null?void 0:ut.status)===0&&R.a.info({centered:!0,width:530,className:"custom-modal-divider ",okText:"\u786E\u5B9A",title:"\u5220\u9664\u7ED3\u679C",maskClosable:!1,keyboard:!1,icon:null,content:"\u672C\u6B21\u6210\u529F\u5220\u9664".concat(ut.success,"\u6761\u8BD5\u9898\uFF0C\u6709").concat(ut.fail,"\u6761\u8BD5\u9898\u56E0\u4E3A\u516C\u5F00\u65E0\u6CD5\u5220\u9664\uFF0C\u8BF7\u64A4\u9500\u540E\u518D\u8FDB\u884C\u5220\u9664\u3002"),onOk:function(){Pi(new Array(ut.success))}});case 6:case"end":return St.stop()}},ot)}));return function(){return $e.apply(this,arguments)}}();if(_e!=null&&_e.length){R.a.confirm({centered:!0,width:530,className:"custom-modal-divider ",okText:"\u786E\u5B9A",title:"\u63D0\u793A",cancelText:"\u53D6\u6D88",icon:null,content:"\u672C\u6B21\u9009\u4E2D\u4E86".concat(_e==null?void 0:_e.length,"\u6761\u8BD5\u9898\u8FDB\u884C\u5220\u9664\u64CD\u4F5C\uFF0C\u5220\u9664\u540E\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\uFF1F"),onOk:Je});return}i.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u5220\u9664\u7684\u8BD5\u9898")},ao=function(){var Je,$e;if(!(_e!=null&&_e.length))return i.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(jn!=null&&(Je=jn.filter(function(ot){return _e.includes(ot.id)}))!==null&&Je!==void 0&&Je.every(function(ot){return ot.public}))return i.b.info("\u6240\u9009\u8BD5\u9898\u5DF2\u516C\u5F00\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9");if(jn!=null&&($e=jn.filter(function(ot){return _e.includes(ot.id)}))!==null&&$e!==void 0&&$e.find(function(ot){var ut;return ot.item_type==="PROGRAM"&&((ut=ot.program_attr)===null||ut===void 0?void 0:ut.status)===0}))return i.b.info("\u5DF2\u9009\u9898\u4E2D\u5B58\u5728\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898");window.localStorage.getItem("problemset-set-public-hint-flag")==="1"||An.userInfo.professional_certification?Ka():R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u516C\u5F00\u89C4\u5219\u544A\u77E5",maskClosable:!0,icon:null,content:m.a.createElement("div",{className:"font16 c-grey-333"},"\u516C\u5F00\u5E76\u7ECF\u5E73\u53F0\u5BA1\u6838\u540E\uFF0C\u8BE5\u9898\u5C06\u5728\u516C\u5171\u8BD5\u9898\u5E93\u53EF\u89C1\uFF0CEducoder\u6240\u6709\u7528\u6237\u5747\u53EF\u4F7F\u7528\u8BE5\u9898\u3002",m.a.createElement("br",null),"\u516C\u5F00\u540E\u4E0D\u53EF\u4FEE\u6539\uFF0C\u4F46\u53EF\u4EE5\u64A4\u9500\uFF1B\u64A4\u9500\u516C\u5F00\u540E\u53EF\u4EE5\u4FEE\u6539\u3002",m.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u7533\u8BF7\u516C\u5F00\uFF1F",m.a.createElement("br",null),m.a.createElement(u.a,{className:"mt10",defaultChecked:!1,onChange:function(ut){return je.current=ut.target.checked}},"\u4E0D\u518D\u63D0\u793A")),onOk:function(){Ka()}})},Ka=function(){var it=Object(_.a)(T.a.mark(function Je($e){var ot,ut;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return ot=Yn===Gt.TeachGroupShare?1:2,St.next=3,Object(Ke.g)({ids:$e?[$e]:_e,source:ot});case 3:ut=St.sent,ut.status===0&&(je.current&&window.localStorage.setItem("problemset-set-public-hint-flag","1"),je.current=!1,Be([]),kr());case 5:case"end":return St.stop()}},Je)}));return function($e){return it.apply(this,arguments)}}(),vo=function(Je){R.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{className:me.a.modalContent},"\u53D1\u5E03\u540E\u5373\u53EF\u5E94\u7528\u5230\u81EA\u5DF1\u7BA1\u7406\u7684\u8BFE\u5802"),m.a.createElement("div",{className:me.a.modalContent}," \u662F\u5426\u786E\u8BA4\u53D1\u5E03?")),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var $e=Object(_.a)(T.a.mark(function ut(){var At;return T.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(Ke.L)({identifier:Je});case 2:At=wt.sent,(At==null?void 0:At.status)===0&&(i.b.success("\u53D1\u5E03\u6210\u529F"),kr());case 4:case"end":return wt.stop()}},ut)}));function ot(){return $e.apply(this,arguments)}return ot}()})},ma=function(Je){R.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:m.a.createElement("p",{className:me.a.modalContent},"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F"),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var $e=Object(_.a)(T.a.mark(function ut(){var At;return T.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(Ke.K)({identifier:Je});case 2:At=wt.sent,(At==null?void 0:At.status)===0&&(i.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F"),kr());case 4:case"end":return wt.stop()}},ut)}));function ot(){return $e.apply(this,arguments)}return ot}()})},Ga=function(){var it=Object(_.a)(T.a.mark(function Je($e){return T.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:zt({type:"problemset/getDisciplines",payload:{source:"question",group_id:$e,group_type:Gt.TeachGroupShare}}),ke.page=1,ke.group_id=$e||null,delete ke.id,Vt(Object(g.a)({},ke)),ti(ke);case 6:case"end":return ut.stop()}},Je)}));return function($e){return it.apply(this,arguments)}}(),Oa=function(Je){ke.sort_by=Je.type,ke.sort_direction=Je.direction,ke.page=1,ke.per_page=20,Br(Je.name),Vt(ke),ti(ke)},yo=function(){ke.page=1,Vt(ke),ti(ke)},za=function(Je){ke.discipline_id="",ke.sub_discipline_id="",ke.tag_discipline_id="",ke.item_type=null,ke.difficulty=null,ke.page=1,ke.per_page=20,ke.group_id=Je,gr(-1),Vt(ke),ti(ke).then(function($e){return Qr($e==null?void 0:$e.item_banks_group)})},_r=function(){if(!(_e!=null&&_e.length)){zt({type:"problemset/setActionTabs",payload:{key:"\u5BFC\u51FA\u8BD5\u9898",params:ke}});return}R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5BFC\u51FA\u63D0\u793A",maskClosable:!0,icon:null,content:m.a.createElement("div",{className:"font14 ".concat(me.a.overflow)},"\u5DF2\u9009\u4E2D",_e==null?void 0:_e.length,"\u9053\u9898\uFF0C\u5176\u4E2D\u7F16\u7A0B\u9898\u4E0E\u5B9E\u8BAD\u9898\u6682\u4E0D\u652F\u6301\u5BFC\u51FA\u3002"),onOk:function(){Object(Et.k)({ids:_e})}})},or=function(){var it=Object(_.a)(T.a.mark(function Je(){var $e,ot,ut,At;return T.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(Ke.i)({ids:_e});case 2:$e=wt.sent,ot=$e.data||{},ut=ot.unpublish_program_question_count,At=ot.total_item_banks,ut===0?R.a.error({title:"\u9519\u8BEF",content:m.a.createElement("span",null,"\u53D1\u5E03\u9519\u8BEF\uFF01\u8BF7\u9009\u62E9\u5C1A\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\u8FDB\u884C\u53D1\u5E03"),centered:!0,okText:"\u786E\u8BA4"}):R.a.confirm({title:"\u63D0\u793A",content:m.a.createElement("span",null,"\u5F53\u524D\u9009\u4E2D",At,"\u9898\uFF0C\u5176\u4E2D\u5305\u542B",ut,"\u9053\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\uFF0C \u8BF7\u786E\u8BA4\u662F\u5426\u53D1\u5E03\uFF1F"),centered:!0,onOk:function(){var cn=Object(_.a)(T.a.mark(function Oi(){var Hn;return T.a.wrap(function(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return Ei.next=2,Object(Ke.h)({ids:_e});case 2:Hn=Ei.sent,Hn.status===0&&(i.b.success("\u53D1\u5E03\u6210\u529F"),kr());case 4:case"end":return Ei.stop()}},Oi)}));function nr(){return cn.apply(this,arguments)}return nr}()});case 5:case"end":return wt.stop()}},Je)}));return function(){return it.apply(this,arguments)}}(),ci=m.a.createElement(p.a,null,Wn&&m.a.createElement(p.a.Item,{onClick:function(){return ni(!0)}},"\u6279\u91CF\u52A0\u5165"),Wn&&m.a.createElement(p.a.Item,{onClick:function(){return ni(!1)}},"\u6279\u91CF\u79FB\u51FA"),Yn===Gt.Mine&&Ge&&m.a.createElement(p.a.Item,{onClick:function(){return ro()}},"\u79FB\u52A8\u5230"),Yn===Gt.Mine&&Ge&&m.a.createElement(p.a.Item,{onClick:ao},"\u6279\u91CF\u516C\u5F00"),Yn===Gt.Mine&&Ge&&m.a.createElement(p.a.Item,{onClick:function(){return Ha()}},"\u6279\u91CF\u5171\u4EAB"),Yn===Gt.Mine&&Ge&&m.a.createElement(p.a.Item,{onClick:ki},"\u6279\u91CF\u5220\u9664")),_i=function(Je){if(tt)if((wn==null?void 0:wn.length)<=0){var $e=jn.filter(function(cn){return Je.includes(cn.id)});wr(Object(O.a)($e)),Be($e==null?void 0:$e.map(function(cn){return cn.id}))}else if(Je.length>wn.length){var ot,ut=jn.filter(function(cn){return Je.includes(cn.id)}),At=wn.map(function(cn){return cn.id}),St=ut.filter(function(cn){return!At.includes(cn.id)});wr([].concat(Object(O.a)(wn),Object(O.a)(St))),Be((ot=[].concat(Object(O.a)(wn),Object(O.a)(St)))===null||ot===void 0?void 0:ot.map(function(cn){return cn.id}))}else{var wt=wn.filter(function(cn){return Je.includes(cn.id)});wr(Object(O.a)(wt)),Be(wt==null?void 0:wt.map(function(cn){return cn.id}))}else Be(Je)},sa=function(Je){if(tt)if(Je){var $e,ot=wn==null?void 0:wn.map(function(wt){return wt.id}),ut=jn.filter(function(wt){return!ot.includes(wt.id)});wr([].concat(Object(O.a)(wn),Object(O.a)(ut))),Be(($e=[].concat(Object(O.a)(wn),Object(O.a)(ut)))===null||$e===void 0?void 0:$e.map(function(wt){return wt.id}))}else{var At=jn==null?void 0:jn.map(function(wt){return wt.id}),St=wn.filter(function(wt){return!At.includes(wt.id)});wr(Object(O.a)(St)),Be(St==null?void 0:St.map(function(wt){return wt.id}))}else Be(Je?jn==null?void 0:jn.map(function(wt){return wt.id}):[])},ea=function(){var Je="/problemset/preview";if(ke.exam_id&&(Je="/paperlibrary/edit/".concat(ke.exam_id)),ke!=null&&ke.exercise_id){var $e;Je="/classrooms/".concat(jt==null||(($e=jt.params)===null||$e===void 0)?void 0:$e.coursesId,"/exercise/").concat(ke==null?void 0:ke.exercise_id,"/edit")}v.d.push(Je)},Ra=[{type:"SINGLE",name:"\u5355\u9009\u9898"},{type:"MULTIPLE",name:"\u591A\u9009\u9898"},{type:"JUDGMENT",name:"\u5224\u65AD\u9898"},{type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},{type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{type:"COMPLETION",name:"\u586B\u7A7A\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],la={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},li=function(Je,$e){var ot,ut=$e.id<0?"--":Wn?$e[ke.exercise_id?"added":"choosed"]?m.a.createElement("span",{key:1,className:me.a.btnAdd,onClick:function(wt){wt.target.style.pointerEvents="none",qi($e.id)}},Ge?"\u79FB\u51FA\u8BD5\u9898\u7BEE":m.a.createElement("span",null,m.a.createElement("b",{className:"iconfont icon-yichu ".concat(me.a.cancelC)}),"\u79FB\u51FA")):$e.item_type==="PROGRAM"&&((ot=$e.program_attr)===null||ot===void 0?void 0:ot.status)===0?m.a.createElement(c.a,{placement:"top",title:"\u7F16\u7A0B\u9898\u672A\u53D1\u5E03\uFF0C\u4E0D\u80FD\u52A0\u5165\uFF01"},m.a.createElement("span",{className:me.a.btnAdd,style:{cursor:"not-allowed",background:"#E3E6EC",color:"#B1BACD"}}," ",Ge?"\u52A0\u5165\u8BD5\u9898\u7BEE":m.a.createElement("span",{style:{padding:"0 3px"}},m.a.createElement("b",{className:"iconfont icon-jiaru ".concat(me.a.addC)}),"\u52A0\u5165")," ")):m.a.createElement("span",{className:me.a.btnAdd,onClick:function(){return no($e.id)}},Ge?"\u52A0\u5165\u8BD5\u9898\u7BEE":m.a.createElement("span",{style:{padding:"0 3px"}},m.a.createElement("b",{className:"iconfont icon-jiaru ".concat(me.a.addC)}),"\u52A0\u5165")):m.a.createElement(m.a.Fragment,null),At=m.a.createElement("span",{className:me.a.actonBtn},$e.id>0&&m.a.createElement(br.a,{isProblemset:Ge,user:An,key:$e.id,data:$e,activeTabsKey:Yn,selectIds:_e,onCollect:aa,onSetPublic:Sa,onStartExperience:to,onCorrection:Fa,onPublicReview:fa,onSetPrivate:eo,onDelete:Wa,onCancel:qi,onSelect:no,onMoveTo:ro,onSetShare:pa,onCancelShare:ko,onPublish:vo,onCancelPublish:ma}),ut);return At};Object(M.useEffect)(function(){if(tt){var it=jt.params,Je=it.coursesId,$e=it.categoryId;zt({type:"shixunHomeworks/addCommonHomeWorkDefaultData",payload:{category:$e,coursesId:Je,type:5}})}},[tt]);var Da=function(){var it=Object(_.a)(T.a.mark(function Je(){var $e,ot,ut,At,St;return T.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return Hr.current.form.validateFields().catch(function(nr){document.body.scrollIntoView()}),cn.next=3,Hr.current.form.validateFields();case 3:if($e=Hr.current.form.getFieldsValue(),console.log($e,"value"),!((wn==null?void 0:wn.length)<=0)){cn.next=8;break}return i.b.info("\u8BF7\u9009\u62E9\u7F16\u7A0B\u9898"),cn.abrupt("return");case 8:return Fn(!0),ot=jt.params,ut=ot.coursesId,At=ot.categoryId,cn.next=12,Object(fn.a)(yt?"/api/homework_commons/".concat(At,"/update_hack.json"):"/api/courses/".concat(ut,"/homework_commons.json"),{method:yt?"put":"post",body:Object(g.a)(Object(g.a)({},$e),{},{coursesId:ut,category:At,type:5,hack_ids:wn==null?void 0:wn.map(function(nr){return nr.id})})});case 12:St=cn.sent,(St==null?void 0:St.status)===0&&v.d.push("/classrooms/".concat(jt.params.coursesId,"/program_homework/").concat(yt?At:St.homework_id,"/detail?tabs=1")),Fn(!1);case 15:case"end":return cn.stop()}},Je)}));return function(){return it.apply(this,arguments)}}();return m.a.createElement("div",{className:me.a.page},m.a.createElement("section",null,m.a.createElement("div",{className:me.a.wrap},ir.course_name&&tt&&m.a.createElement("section",{className:"animated fadeIn"},m.a.createElement("aside",{className:"mt10"},ir.category&&m.a.createElement(f.a,{separator:">"},m.a.createElement(f.a.Item,null,m.a.createElement(H.a,{to:"/classrooms/".concat(ir.course_id,"/program_homework")},ir.course_name)),m.a.createElement(f.a.Item,null,m.a.createElement(H.a,{to:"/classrooms/".concat(ir.course_id,"/program_homework")},ir.category.category_name)),m.a.createElement(f.a.Item,null,Tt)))),m.a.createElement("div",{className:me.a.title},tt?Tt:"\u8BD5\u9898\u5E93"),tt&&m.a.createElement(Z,{data:$n,ref:Hr}),m.a.createElement("div",{className:me.a.headerWrapper},m.a.createElement("div",{className:me.a.tabsWrap},m.a.createElement(j.a,{activeKey:Yn,onChange:Ba,tabBarExtraContent:m.a.createElement("div",{className:me.a.searchWrap},Yn===Gt.Mine&&Ge&&m.a.createElement(I.a,{className:me.a.addQuestionBtn,onClick:No},m.a.createElement("img",{src:V.a,className:me.a.pngIcon,alt:""}),"\u65B0\u589E\u8BD5\u9898"),m.a.createElement(rn,{allowClear:!0,suffix:m.a.createElement("i",{className:"iconfont icon-sousuo9 font14 ".concat(me.a.searchIcon),onClick:function(){return ha(ke.keyword)}}),className:me.a.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",size:"large",onChange:function(Je){ke.keyword=Je.target.value,Vt(Object(g.a)({},ke))},onSearch:ha}))},m.a.createElement(Lt,{tab:"\u516C\u5171",key:"1"}),((Kn=Kt.teachGroupData)===null||Kn===void 0||((dn=Kn.groups)===null||dn===void 0)?void 0:dn.length)&&m.a.createElement(Lt,{tab:"\u6211\u7684\u7FA4\u7EC4",key:"3"}),!Object(Or.o)()&&!Object(Or.m)()&&!tt&&m.a.createElement(Lt,{tab:"\u6536\u85CF\u5939",key:"2"}),m.a.createElement(Lt,{tab:"\u6211\u521B\u5EFA\u7684",key:"0"}))),m.a.createElement(X.a,{showSelectAll:!1,className:me.a.select,disciplinesData:(Sn=Kt.disciplinesData)===null||Sn===void 0?void 0:Sn.disciplines,knowledgeData:Qi,directionValue:ke.discipline_id,subDisciplineValue:ke.sub_discipline_id,typeValue:ke.item_type,isprogram_homework:tt,showKnowledge:!0,name:ia,setname:Cr,difficultyValue:ke.difficulty,showShixun:!Object(Or.m)()&&!ke.exercise_id&&Yn!==Gt.TeachGroupShare&&Yn!==Gt.Public,onShixunChange:Aa,onDirectionChange:Io,onTypeChange:Po,onDifficultyChange:mo,knowledgeValue:qn,onKnowledgeChange:Ja,teachGroupData:(hr=Kt.teachGroupData)===null||hr===void 0?void 0:hr.groups,onTeachGroupChange:Ga,teachGroupValue:ke.group_id,showTeachGroup:xa})),m.a.createElement("div",{className:me.a.treeWrapper,style:{display:Yn===Gt.Mine?"block":"none"}},m.a.createElement("div",{className:me.a.treeHeader},m.a.createElement(xe.a,{data:Gr,onClick:oa}),m.a.createElement(I.a,{type:"link",onClick:io,className:me.a.exportBtn},m.a.createElement("img",{src:pt.a,alt:"",className:me.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),m.a.createElement(K.a,{spinning:Ci},m.a.createElement("div",{ref:Wr,className:me.a.treeContent},m.a.createElement(Pn.a,{isProblemset:Ge,reloadData:kr,data:zr,onShare:Ha,onOpen:oa})))),m.a.createElement("div",{className:me.a.contentWrap},m.a.createElement("div",{className:me.a.batchWrap},m.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},!tt&&m.a.createElement("div",{className:"font14"},m.a.createElement(F.a,{overlay:m.a.createElement(p.a,{selectedKeys:[dr]},Ua==null?void 0:Ua.map(function(it,Je){return m.a.createElement(p.a.Item,{key:it.name,onClick:function(){return Oa(it)}},it.name)}))},m.a.createElement("span",{style:{color:"#464F66"}},m.a.createElement("i",{className:"iconfont icon-paixu font14 mr5 c-light-primary"}),dr))),tt&&m.a.createElement("div",null,m.a.createElement(u.a,{checked:(jn==null?void 0:jn.filter(function(it){return wn==null?void 0:wn.map(function(Je){return Je.id}).includes(it.id)}).length)===jn.length,onChange:function(Je){return sa(Je.target.checked)}},"\u672C\u9875\u5168\u9009",m.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",_e==null?void 0:_e.length,")"))),tt&&m.a.createElement(R.a,{visible:Rr,centered:!0,width:700,okText:"\u786E\u8BA4".concat(yt?"\u7F16\u8F91":"\u65B0\u5EFA"),onCancel:function(){return yr(!1)},cancelText:"\u8FD4\u56DE\u5217\u8868",onOk:Da,confirmLoading:Vn,title:"\u67E5\u770B\u5DF2\u9009"},m.a.createElement("div",{className:"font14 c-light-primary mb10"},"\u5DF2\u9009",wn==null?void 0:wn.length,"\u4E2A"),m.a.createElement("div",{style:{height:400,overflow:"auto"}},wn==null?void 0:wn.map(function(it,Je){var $e,ot,ut,At,St,wt;return m.a.createElement("div",{key:Je,className:me.a.sendModal},m.a.createElement("div",{className:me.a.li},m.a.createElement("p",null,it==null?void 0:it.name),m.a.createElement("div",{className:me.a.bottom},m.a.createElement("span",{className:"c-grey-333"},"\u7F16\u7A0B\u9898"),m.a.createElement("i",{className:me.a.line}),m.a.createElement("span",{className:"c-grey-333"},it.difficulty===1&&"\u7B80\u5355",it.difficulty===2&&"\u9002\u4E2D",it.difficulty===3&&"\u56F0\u96BE"),m.a.createElement("i",{className:me.a.line}),m.a.createElement("span",null,"\u521B\u5EFA\u8005\xA0",m.a.createElement(c.a,{title:it==null||(($e=it.author)===null||$e===void 0)?void 0:$e.name},m.a.createElement("span",{className:"c-grey-333"},(it==null||((ot=it.author)===null||ot===void 0||((ut=ot.name)===null||ut===void 0))?void 0:ut.length)>6?(it==null||((At=it.author)===null||At===void 0||((St=At.name)===null||St===void 0))?void 0:St.substr(0,3))+"...":it==null||((wt=it.author)===null||wt===void 0)?void 0:wt.name))),m.a.createElement("i",{className:me.a.line}),m.a.createElement("span",{className:me.a.des},"\u66F4\u65B0\xA0",m.a.createElement("span",{className:"c-grey-333"},it==null?void 0:it.updated_at)))),m.a.createElement("div",{className:me.a.del,onClick:function(){_i(wn.filter(function(nr){return nr.id!==it.id}).map(function(nr){return nr.id}))}},"\u5220\u9664"))})))),m.a.createElement("div",null,Yn===Gt.Mine&&Ge&&m.a.createElement(I.a,{onClick:_r,type:"link",className:me.a.exportBtn},m.a.createElement("img",{src:Q.a,className:me.a.pngIcon}),m.a.createElement("span",null,"\u5BFC\u51FA\u8BD5\u9898")))),po?m.a.createElement("div",null,m.a.createElement(I.a,{style:{paddingLeft:0},onClick:function(){ke.page=1,ke.keyword=null,delete ke.id,Vt(ke),Qa(!1),ti(ke)},type:"link"}," ",m.a.createElement("i",{className:"iconfont icon-fanhui2 font14"}),"\u8FD4\u56DE"),m.a.createElement("span",{className:"font14 mr20 c-grey-333"},"\u641C\u7D22\u201C",decodeURIComponent(ke.keyword),"\u201D")):null,m.a.createElement("div",{className:me.a.contentListWrap},On!==0?m.a.createElement(K.a,{size:"large",spinning:Un["problemset/getItemBanks"]},jn.map(function(it,Je){var $e,ot;return m.a.createElement("div",{className:me.a.li},m.a.createElement("div",{className:me.a.top},m.a.createElement(br.b,{key:it.id,data:it,selectIds:_e,onSelectCheckBox:_i})),m.a.createElement("div",{className:me.a.bottom},m.a.createElement("p",{className:"".concat(me.a.actionLeftItem," ").concat(me.a.questionTypeName)},($e=Ra.find(function(ut){return ut.type===it.item_type}))===null||$e===void 0?void 0:$e.name),m.a.createElement("p",{className:me.a.actionLeftItem},la[it.difficulty]),m.a.createElement("p",{className:me.a.actionLeftItem},"\u521B\u5EFA\u8005",m.a.createElement("span",{className:"c-grey-333"},it==null||((ot=it.author)===null||ot===void 0)?void 0:ot.name)),m.a.createElement("p",{className:me.a.actionLeftItem},"\u66F4\u65B0",m.a.createElement("span",{className:"c-grey-333"},it==null?void 0:it.updated_at)),m.a.createElement("p",{className:me.a.actionLeftItem},"\u4F7F\u7528\u6B21\u6570",m.a.createElement("span",{className:"c-grey-333"},it==null?void 0:it.quotes)),!tt&&m.a.createElement("div",{className:me.a.more},li({},it))))})):m.a.createElement(K.a,{size:"large",spinning:Un["problemset/getItemBanks"]},m.a.createElement(re.a,null))),On!==0&&!tt&&m.a.createElement(z.a,{showQuickJumper:!0,onChange:Ta,defaultCurrent:1,pageSize:ke==null?void 0:ke.per_page,current:ke.page||1,total:On,showTotal:function(Je){return m.a.createElement("span",{className:"mr10"},"\u5171",m.a.createElement("span",{className:"c-light-primary"},Je),"\u6761\u6570\u636E")}}),tt&&m.a.createElement("div",{style:{height:20}})),Ge&&m.a.createElement(en,{basketData:Kt.basketData,visible:Ca,basketTotal:ya,onClose:function(){return ho(!1)},onDelete:Mo}),!Object(Or.m)()&&Ge&&m.a.createElement(Sr,{visibleBasket:Ca,onToggleVisible:function(){return ho(!Ca)},count:ya})),m.a.createElement(fe,null),m.a.createElement(Ue,{onReloadData:kr}),m.a.createElement(lt,{onReloadData:function(){return Pi([null])}}),m.a.createElement($t,{onReloadData:kr,onReloadBasketData:Yi}),Nn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?m.a.createElement(Ai,{shixunIds:ie,cb:qr}):null,m.a.createElement(gt,null),m.a.createElement(Ze,null),m.a.createElement(Ot,null),m.a.createElement(st,null),m.a.createElement(He,null),m.a.createElement(De,{onOk:yo}),m.a.createElement(q.a,{onOk:za})),Ge?m.a.createElement(M.Fragment,null,!!(_e!=null&&_e.length)&&m.a.createElement("div",{className:me.a.batch},m.a.createElement("aside",null,m.a.createElement("div",{style:{flexShrink:0,marginRight:20}},m.a.createElement(u.a,{className:"font14",checked:jn!=null&&jn.length?_e.length===(jn==null?void 0:jn.length):!1,onChange:function(Je){return sa(Je.target.checked)}},"\u672C\u9875\u5168\u9009",m.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",_e==null?void 0:_e.length,")"))),m.a.createElement("div",{className:me.a.btns},Wn&&m.a.createElement("div",{className:me.a.btn,onClick:function(){return ni(!0)}},m.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),Wn&&m.a.createElement("div",{className:me.a.btn,onClick:function(){return ni(!1)}},m.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),Yn===Gt.Mine&&m.a.createElement("div",{className:me.a.btn,onClick:function(){return ro()}},m.a.createElement("i",{className:"iconfont icon-yidongmulu font16"}),"\u6279\u91CF\u79FB\u52A8"),Yn===Gt.Mine&&m.a.createElement("div",{className:me.a.btn,onClick:ao}," ",m.a.createElement("i",{className:"iconfont icon-pilianggongkai"}),"\u6279\u91CF\u516C\u5F00"),Yn===Gt.Mine&&m.a.createElement("div",{className:me.a.btn,onClick:function(){return Ha()}}," ",m.a.createElement("i",{className:"iconfont icon-pilianggongxiang"}),"\u6279\u91CF\u5171\u4EAB"),Yn===Gt.Mine&&m.a.createElement("div",{className:me.a.btn,onClick:ki}," ",m.a.createElement("i",{className:"iconfont icon-piliangshanchu3 c-red"}),"\u6279\u91CF\u5220\u9664"),Yn===Gt.Mine&&m.a.createElement("div",{className:me.a.btn,onClick:or}," ",m.a.createElement("i",{className:"iconfont icon-fabu5"}),"\u6279\u91CF\u53D1\u5E03"),m.a.createElement("div",{onClick:function(){return Be([])},style:{marginLeft:"auto"},className:me.a.btn}," ",m.a.createElement("i",{className:"iconfont icon-piliangcaozuoicon2"}),"\u53D6\u6D88\u64CD\u4F5C"))))):tt?"":m.a.createElement("div",{className:me.a.batch},m.a.createElement("aside",null,m.a.createElement("div",{style:{flexShrink:0,marginRight:20}},m.a.createElement(u.a,{className:"font14",checked:jn!=null&&jn.length?_e.length===(jn==null?void 0:jn.length):!1,onChange:function(Je){return sa(Je.target.checked)}},"\u672C\u9875\u5168\u9009",m.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",_e==null?void 0:_e.length,")"))),m.a.createElement("div",{className:me.a.btns},Wn&&!!(_e!=null&&_e.length)&&m.a.createElement("div",{className:me.a.btn,onClick:function(){return ni(!0)}},m.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),Wn&&!!(_e!=null&&_e.length)&&m.a.createElement("div",{className:me.a.btn,onClick:function(){return ni(!1)}},m.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),m.a.createElement("div",{className:"c-grey-333 font12 mr40",style:{marginLeft:"auto"}},"\u5DF2\u52A0\u5165:\xA0\xA0",Yt,"\u9898"),m.a.createElement("div",{onClick:ea,className:me.a.btn},"\u8FD4\u56DE\u8BD5\u5377")))),tt&&m.a.createElement("div",{className:me.a.batch},m.a.createElement("aside",null,m.a.createElement("div",{style:{flexShrink:0,marginRight:20}},m.a.createElement(z.a,{showQuickJumper:!0,onChange:Ta,defaultCurrent:1,pageSize:ke==null?void 0:ke.per_page,current:ke.page||1,hideOnSinglePage:!0,total:On,showTotal:function(Je){return m.a.createElement("span",{className:"mr10"},"\u5171",m.a.createElement("span",{className:"c-light-primary"},Je),"\u6761\u6570\u636E")}})),m.a.createElement("div",{className:me.a.btns},m.a.createElement(Y.a,{align:"middle",style:{marginLeft:"auto"}},m.a.createElement(Y.a,{onClick:function(){if((wn==null?void 0:wn.length)<=0){i.b.info("\u5F53\u524D\u6682\u65E0\u6570\u636E");return}yr(!0)},align:"middle",className:"current"},m.a.createElement("i",{className:"iconfont icon-yixuan mr10 c-light-primary font20"}),m.a.createElement("span",null,"\u5DF2\u9009",m.a.createElement("span",{className:"c-light-primary"},_e.length),"\u4E2A")),m.a.createElement(I.a,{className:"mr20 ml40",onClick:function(){if(yt){var Je;v.d.push("/classrooms/".concat(jt.params.coursesId,"/program_homework/").concat(jt==null||((Je=jt.params)===null||Je===void 0)?void 0:Je.categoryId,"/detail?tabs=1"));return}v.d.push("/classrooms/".concat(jt.params.coursesId,"/program_homework"))}},"\u53D6\u6D88"),m.a.createElement(I.a,{loading:Vn,onClick:Da,type:"primary"},"\u786E\u8BA4",yt?"\u7F16\u8F91":"\u65B0\u5EFA"))))))},Ir=ge.default=Object(v.a)(function(Zt){var mt=Zt.classroomList,Pt=Zt.problemset,Rt=Zt.user,Ht=Zt.loading,un=Zt.globalSetting,xn=Zt.shixunHomeworks;return{classroomList:mt,problemset:Pt,user:Rt,globalSetting:un,loading:Ht.effects,shixunHomeworks:xn}})(pr)},JYp7:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return te});var te;(function(Y){function N(i){return i&&typeof i=="object"&&typeof i[Symbol.iterator]=="function"}Y.is=N;const z=Object.freeze([]);function P(){return z}Y.empty=P;function*F(i){yield i}Y.single=F;function G(i){return i||z}Y.from=G;function K(i){return!i||i[Symbol.iterator]().next().done===!0}Y.isEmpty=K;function n(i){return i[Symbol.iterator]().next().value}Y.first=n;function I(i,D){for(const A of i)if(D(A))return!0;return!1}Y.some=I;function E(i,D){for(const A of i)if(D(A))return A;return}Y.find=E;function*f(i,D){for(const A of i)D(A)&&(yield A)}Y.filter=f;function*b(i,D){let A=0;for(const S of i)yield D(S,A++)}Y.map=b;function*c(...i){for(const D of i)for(const A of D)yield A}Y.concat=c;function*a(i){for(const D of i)for(const A of D)yield A}Y.concatNested=a;function p(i,D,A){let S=A;for(const R of i)S=D(S,R);return S}Y.reduce=p;function*l(i,D,A=i.length){for(D<0&&(D+=i.length),A<0?A+=i.length:A>i.length&&(A=i.length);D<A;D++)yield i[D]}Y.slice=l;function u(i,D=Number.POSITIVE_INFINITY){const A=[];if(D===0)return[A,i];const S=i[Symbol.iterator]();for(let R=0;R<D;R++){const O=S.next();if(O.done)return[A,Y.empty()];A.push(O.value)}return[A,{[Symbol.iterator](){return S}}]}Y.consume=u;function s(i,D,A=(S,R)=>S===R){const S=i[Symbol.iterator](),R=D[Symbol.iterator]();for(;;){const O=S.next(),g=R.next();if(O.done!==g.done)return!1;if(O.done)return!0;if(!A(O.value,g.value))return!1}}Y.equals=s})(te||(te={}))},LE3n:function(ct,ge,U){"use strict";var te=U("ozfa"),Y=U("MJZm"),N=U("k1fw"),z=U("+L6B"),P=U("2/Rp"),F=U("5NDa"),G=U("5rEg"),K=U("2qtc"),n=U("kLXV"),I=U("miYZ"),E=U("tsqr"),f=U("9og8"),b=U("tJVT"),c=U("WmNS"),a=U.n(c),p=U("q1tI"),l=U.n(p),u=U("1vnw"),s=U.n(u),i=U("ErOA"),D=U("Ix/O"),A=U.n(D),S=U("xTzM"),R=U.n(S),O=U("WCUW"),g=U("LvDl"),_=U.n(g),h=function(x){var w=x.isProblemset,j=x.name,W=x.id,T=x.itemBanksCount,M=x.onOpen,m=M===void 0?function(){}:M,v=x.onShare,H=v===void 0?function(){}:v,X=x.onMove,q=X===void 0?function(){}:X,re=x.onDeleteOk,ye=re===void 0?function(){}:re,pe=Object(p.useState)(!1),ue=Object(b.a)(pe,2),fe=ue[0],be=ue[1],se=Object(p.useState)(j),ae=Object(b.a)(se,2),Ce=ae[0],ze=ae[1],Ye=Object(p.useState)(j),He=Object(b.a)(Ye,2),Ve=He[0],Fe=He[1],Ke=function(){var de=Object(f.a)(a.a.mark(function De(Ne){var Ue,rt,lt;return a.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:if(Ue=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],Ve.trim()){at.next=4;break}return E.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),at.abrupt("return");case 4:if(!(Ve.charAt(0)===" ")){at.next=7;break}return E.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),at.abrupt("return");case 7:rt=0;case 8:if(!(rt<Ve.length)){at.next=15;break}if(!Ue.includes(Ve.charAt(rt))){at.next=12;break}return E.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),at.abrupt("return",!1);case 12:rt++,at.next=8;break;case 15:return at.next=17,Object(i.a)("/api/item_banks_groups/".concat(Math.abs(Ne),".json"),{method:"put",body:{name:Ve}});case 17:lt=at.sent,lt.status===0&&(be(!1),ze(Ve));case 19:case"end":return at.stop()}},De)}));return function(Ne){return de.apply(this,arguments)}}(),nt=function(De){n.a.confirm({title:"\u63D0\u793A",okText:"\u786E\u8BA4\u5220\u9664",className:"custom-modal-divider ",icon:null,content:l.a.createElement("div",null,l.a.createElement("p",null,"\u672C\u6B21\u5220\u9664\u64CD\u4F5C\u786E\u5B9A\u540E\u5185\u5BB9\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F"),l.a.createElement("p",null,"\u5220\u9664\u6587\u4EF6\u5939\uFF0C\u5C06\u540C\u6B65\u5220\u9664\u5176\u6240\u5305\u542B\u7684\u5168\u90E8\u5B50\u6587\u4EF6\u5939\u548C\u8BD5\u9898\uFF0C\u8BF7\u614E\u91CD\u64CD\u4F5C\uFF01")),cancelText:"\u53D6\u6D88",onOk:function(){var Ne=Object(f.a)(a.a.mark(function rt(){var lt;return a.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:return at.next=2,Object(i.a)("/api/item_banks_groups/".concat(Math.abs(De),".json"),{method:"delete",body:{}});case 2:lt=at.sent,lt.status===0&&ye(De);case 4:case"end":return at.stop()}},rt)}));function Ue(){return Ne.apply(this,arguments)}return Ue}()})};return l.a.createElement("div",{className:s.a.list},fe?l.a.createElement(G.a,{style:{maxWidth:780},value:Ve,onChange:function(De){return Fe(De.target.value)}}):l.a.createElement("div",{title:Ce,onClick:function(){return m(W)},className:s.a.name},Ce),w&&l.a.createElement("div",{className:s.a.btns},fe?l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{style:{height:16},onClick:function(){return Ke(W)},className:"ml0"},l.a.createElement("i",{className:"iconfont icon-chenggong1",style:{color:"#33BD8C"}})),l.a.createElement("div",{style:{height:16},onClick:function(){Fe(Ce),be(!1)},className:"ml10"},l.a.createElement("i",{className:"iconfont icon-qingchu"}))):l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{onClick:function(){return q(W,"up")},className:"ml0"},l.a.createElement("i",{className:"iconfont icon-shangyi3",style:{transform:"translateY(2px)"}})),l.a.createElement("div",{onClick:function(){return q(W,"down")},className:"ml10",style:{transform:"rotate(180deg) translateY(1px)"}},l.a.createElement("i",{className:"iconfont icon-shangyi3"}))),l.a.createElement(P.a,{className:"ml10",onClick:function(){if(!T){E.b.warn("\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u8BD5\u9898");return}H(Math.abs(W))},type:"link"},"\u5171\u4EAB\u5168\u90E8\u8BD5\u9898"),l.a.createElement(P.a,{className:"ml10",onClick:function(){return be(!0)},type:"link"},"\u91CD\u547D\u540D"),l.a.createElement(P.a,{onClick:function(){return nt(W)},type:"link",danger:!0},"\u5220\u9664")))},d=function(x){var w=x.isProblemset,j=x.data,W=x.onOpen,T=W===void 0?function(){}:W,M=x.onShare,m=M===void 0?function(){}:M,v=x.reloadData,H=Object(p.useState)(),X=Object(b.a)(H,2),q=X[0],re=X[1];Object(p.useEffect)(function(){re(j==null?void 0:j.map(function(Ce){return{title:l.a.createElement(h,{isProblemset:w,name:Ce.name,id:Ce.id,itemBanksCount:Ce.item_banks_count,onMove:pe,onOpen:T,onShare:m,onDeleteOk:fe}),key:Ce.id,icon:l.a.createElement("img",{src:A.a,className:s.a.folderIcon}),isLeaf:!1}}))},[j]);var ye=function Ce(ze,Ye,He){for(var Ve=Object(g.cloneDeep)(ze),Fe=0;Fe<Ve.length;Fe++){if(Ve[Fe].key===Ye){if(He==="up"){var Ke=[Ve[Fe],Ve[Fe-1]];Ve[Fe-1]=Ke[0],Ve[Fe]=Ke[1]}else{var nt=[Ve[Fe+1],Ve[Fe]];Ve[Fe]=nt[0],Ve[Fe+1]=nt[1]}break}Ve[Fe].children&&(Ve[Fe].children=Ce(Ve[Fe].children,Ye,He))}return Ve},pe=function(){var Ce=Object(f.a)(a.a.mark(function ze(Ye,He){var Ve;return a.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:if(!(He==="up")){Ke.next=6;break}return Ke.next=3,Object(O.I)({id:Math.abs(Ye)});case 3:Ke.t0=Ke.sent,Ke.next=9;break;case 6:return Ke.next=8,Object(O.H)({id:Math.abs(Ye)});case 8:Ke.t0=Ke.sent;case 9:Ve=Ke.t0,Ve.status===0&&re(function(nt){return ye(nt,Ye,He)});case 11:case"end":return Ke.stop()}},ze)}));return function(Ye,He){return Ce.apply(this,arguments)}}(),ue=function Ce(ze,Ye){return ze.filter(function(He){return He.key===Ye?!1:(He.children&&(He.children=Ce(He.children,Ye)),!0)})},fe=function(ze){re(function(Ye){return ue(Ye,ze)}),v()},be=function Ce(ze,Ye,He){return ze.map(function(Ve){return Ve.key===Ye?Object(N.a)(Object(N.a)({},Ve),He):Ve.children?Object(N.a)(Object(N.a)({},Ve),{},{children:Ce(Ve.children,Ye,He)}):Ve})},se=function(){var Ce=Object(f.a)(a.a.mark(function ze(Ye){var He,Ve,Fe,Ke,nt;return a.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return He=Ye.key,De.next=3,Object(O.B)({group_id:Math.abs(He)});case 3:Ve=De.sent,Fe=Ve||{},Ke=Fe.item_banks_group,nt=Fe.item_banks_group_count,nt>0?re(function(Ne){return be(Ne,He,{children:Ke.map(function(Ue){return{title:l.a.createElement(h,{isProblemset:w,name:Ue.name,id:Ue.id,itemBanksCount:Ue.item_banks_count,onMove:pe,onOpen:T,onShare:m,onDeleteOk:fe}),key:Ue.id,icon:l.a.createElement("img",{src:A.a,className:s.a.folderIcon}),isLeaf:!1}})})}):re(function(Ne){return be(Ne,He,{isLeaf:!0})});case 6:case"end":return De.stop()}},ze)}));return function(Ye){return Ce.apply(this,arguments)}}(),ae=function(ze,Ye){var He=Ye.node,Ve=Ye.expanded;re(function(Fe){return be(Fe,He.key,{icon:Ve?l.a.createElement("img",{src:R.a,className:s.a.folderIcon}):l.a.createElement("img",{src:A.a,className:s.a.folderIcon})})})};return(q==null?void 0:q.length)>0&&l.a.createElement(Y.a,{showLine:{showLeafIcon:!1},showIcon:!0,treeData:q,loadData:se,onExpand:ae,className:s.a.folderWrapper,selectable:!1})};ge.a=d},LdHM:function(ct,ge,U){"use strict";U.d(ge,"b",function(){return i}),U.d(ge,"a",function(){return A});var te=U("1OyB"),Y=U("vuIU"),N=U("Ji7U"),z=U("LK+K"),P=U("q1tI"),F=U("rePB"),G=U("Ff2n"),K=U("ODXe"),n=U("4IlW"),I=U("bX4T"),E=U("YrtM"),f=U("TSYQ"),b=U.n(f),c=U("+nKL"),a=U("8OUc"),p=function(H,X){var q=H.prefixCls,re=H.id,ye=H.flattenOptions,pe=H.childrenAsData,ue=H.values,fe=H.searchValue,be=H.multiple,se=H.defaultActiveFirstOption,ae=H.height,Ce=H.itemHeight,ze=H.notFoundContent,Ye=H.open,He=H.menuItemSelectedIcon,Ve=H.virtual,Fe=H.onSelect,Ke=H.onToggleOpen,nt=H.onActiveValue,de=H.onScroll,De=H.onMouseEnter,Ne="".concat(q,"-item"),Ue=Object(E.a)(function(){return ye},[Ye,ye],function(st,xe){return xe[0]&&st[1]!==xe[1]}),rt=P.useRef(null),lt=function(xe){xe.preventDefault()},ft=function(xe){rt.current&&rt.current.scrollTo({index:xe})},at=function(xe){for(var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,me=Ue.length,ce=0;ce<me;ce+=1){var he=(xe+ce*we+me)%me,Te=Ue[he],Re=Te.group,Me=Te.data;if(!Re&&!Me.disabled)return he}return-1},_t=P.useState(function(){return at(0)}),gt=Object(K.a)(_t,2),xt=gt[0],Ze=gt[1],kt=function(xe){Ze(xe);var we=Ue[xe];if(!we){nt(null,-1);return}nt(we.data.value,xe)};P.useEffect(function(){kt(se!==!1?at(0):-1)},[Ue.length,fe]),P.useEffect(function(){var st=setTimeout(function(){if(!be&&Ye&&ue.size===1){var xe=Array.from(ue)[0],we=Ue.findIndex(function(me){var ce=me.data;return ce.value===xe});kt(we),ft(we)}});return function(){return clearTimeout(st)}},[Ye]);var Ot=function(xe){xe!==void 0&&Fe(xe,{selected:!ue.has(xe)}),be||Ke(!1)};if(P.useImperativeHandle(X,function(){return{onKeyDown:function(xe){var we=xe.which;switch(we){case n.a.UP:case n.a.DOWN:{var me=0;if(we===n.a.UP?me=-1:we===n.a.DOWN&&(me=1),me!==0){var ce=at(xt+me,me);ft(ce),kt(ce)}break}case n.a.ENTER:{var he=Ue[xt];he&&!he.data.disabled?Ot(he.data.value):Ot(void 0),Ye&&xe.preventDefault();break}case n.a.ESC:Ke(!1)}},onKeyUp:function(){},scrollTo:function(xe){ft(xe)}}}),Ue.length===0)return P.createElement("div",{role:"listbox",id:"".concat(re,"_list"),className:"".concat(Ne,"-empty"),onMouseDown:lt},ze);function qe(st){var xe=Ue[st];if(!xe)return null;var we=xe.data||{},me=we.value,ce=we.label,he=we.children,Te=Object(I.a)(we,!0),Re=pe?he:ce;return xe?P.createElement("div",Object.assign({"aria-label":typeof Re=="string"?Re:null},Te,{key:st,role:"option",id:"".concat(re,"_list_").concat(st),"aria-selected":ue.has(me)}),me):null}return P.createElement(P.Fragment,null,P.createElement("div",{role:"listbox",id:"".concat(re,"_list"),style:{height:0,width:0,overflow:"hidden"}},qe(xt-1),qe(xt),qe(xt+1)),P.createElement(c.a,{itemKey:"key",ref:rt,data:Ue,height:ae,itemHeight:Ce,fullHeight:!1,onMouseDown:lt,onScroll:de,virtual:Ve,onMouseEnter:De},function(st,xe){var we,me=st.group,ce=st.groupOption,he=st.data,Te=he.label,Re=he.key;if(me)return P.createElement("div",{className:b()(Ne,"".concat(Ne,"-group"))},Te!==void 0?Te:Re);var Me=he.disabled,et=he.value,ht=he.title,Ut=he.children,nn=he.style,en=he.className,mn=Object(G.a)(he,["disabled","value","title","children","style","className"]),En=ue.has(et),$t="".concat(Ne,"-option"),rr=b()(Ne,$t,en,(we={},Object(F.a)(we,"".concat($t,"-grouped"),ce),Object(F.a)(we,"".concat($t,"-active"),xt===xe&&!Me),Object(F.a)(we,"".concat($t,"-disabled"),Me),Object(F.a)(we,"".concat($t,"-selected"),En),we)),Dn=pe?Ut:Te,Sr=!He||typeof He=="function"||En;return P.createElement("div",Object.assign({},mn,{"aria-selected":En,className:rr,title:ht,onMouseMove:function(){if(xt===xe||Me)return;kt(xe)},onClick:function(){Me||Ot(et)},style:nn}),P.createElement("div",{className:"".concat($t,"-content")},Dn||et),P.isValidElement(He)||En,Sr&&P.createElement(a.a,{className:"".concat(Ne,"-option-state"),customizeIcon:He,customizeIconProps:{isSelected:En}},En?"\u2713":null))}))},l=P.forwardRef(p);l.displayName="OptionList";var u=l,s=function(){return null};s.isSelectOption=!0;var i=s,D=function(){return null};D.isSelectOptGroup=!0;var A=D,S=U("VTBJ"),R=U("Zm9Q");function O(v){var H=v.key,X=v.props,q=X.children,re=X.value,ye=Object(G.a)(X,["children","value"]);return Object(S.a)({key:H,value:re!==void 0?re:H,children:q},ye)}function g(v){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(v).map(function(X,q){if(!P.isValidElement(X)||!X.type)return null;var re=X.type.isSelectOptGroup,ye=X.key,pe=X.props,ue=pe.children,fe=Object(G.a)(pe,["children"]);return H||!re?O(X):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(ye===null?q:ye,"__"),label:ye},fe),{},{options:g(ue)})}).filter(function(X){return X})}var _=U("2Qr1"),h=U("qNPg"),d=U("U8pU"),C=U("Kwbf"),x=U("WKfj");function w(v){var H=v.mode,X=v.options,q=v.children,re=v.backfill,ye=v.allowClear,pe=v.placeholder,ue=v.getInputElement,fe=v.showSearch,be=v.onSearch,se=v.defaultOpen,ae=v.autoFocus,Ce=v.labelInValue,ze=v.value,Ye=v.inputValue,He=v.optionLabelProp,Ve=H==="multiple"||H==="tags",Fe=fe!==void 0?fe:Ve||H==="combobox",Ke=X||g(q);if(Object(C.a)(H!=="tags"||Ke.every(function(Ne){return!Ne.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var nt=Ke.some(function(Ne){return Ne.options?Ne.options.some(function(Ue){return typeof("value"in Ue?Ue.value:Ue.key)=="number"}):typeof("value"in Ne?Ne.value:Ne.key)=="number"});Object(C.a)(!nt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(H!=="combobox"||!He,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(H==="combobox"||!re,"`backfill` only works with `combobox` mode."),Object(C.a)(H==="combobox"||!ue,"`getInputElement` only work with `combobox` mode."),Object(C.b)(H!=="combobox"||!ue||!ye||!pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),be&&!Fe&&H!=="combobox"&&H!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!se||ae,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ze!=null){var de=Object(x.d)(ze);Object(C.a)(!Ce||de.every(function(Ne){return Object(d.a)(Ne)==="object"&&("key"in Ne||"value"in Ne)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(C.a)(!Ve||Array.isArray(ze),"`value` should be array when `mode` is `multiple` or `tags`")}if(q){var De=null;Object(R.a)(q).some(function(Ne){if(!P.isValidElement(Ne)||!Ne.type)return!1;var Ue=Ne.type;if(Ue.isSelectOption)return!1;if(Ue.isSelectOptGroup){var rt=Object(R.a)(Ne.props.children).every(function(lt){return!P.isValidElement(lt)||!Ne.type||lt.type.isSelectOption?!0:(De=lt.type,!1)});return!rt}return De=Ue,!0}),De&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(De.displayName||De.name||De,"`.")),Object(C.a)(Ye===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=w,W=Object(h.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:g,flattenOptions:_.d,getLabeledValue:_.e,filterOptions:_.b,isValueDisabled:_.g,findValueOption:_.c,warningProps:j,fillOptionsWithMissingValue:_.a}),T=function(v){Object(N.a)(X,v);var H=Object(z.a)(X);function X(){var q;return Object(te.a)(this,X),q=H.apply(this,arguments),q.selectRef=P.createRef(),q.focus=function(){q.selectRef.current.focus()},q.blur=function(){q.selectRef.current.blur()},q}return Object(Y.a)(X,[{key:"render",value:function(){return P.createElement(W,Object.assign({ref:this.selectRef},this.props))}}]),X}(P.Component);T.Option=i,T.OptGroup=A;var M=T,m=ge.c=M},M8RZ:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return n});var te=U("fWQN"),Y=U("mtLc"),N=U("yKVA"),z=U("879j"),P=U("q1tI"),F=U.n(P),G=U("i8i4"),K=U.n(G),n=function(I){Object(N.a)(f,I);var E=Object(z.a)(f);function f(b){var c;Object(te.a)(this,f),c=E.call(this,b);var a=window.document;return c.node=a.createElement("div"),a.body.appendChild(c.node),c}return Object(Y.a)(f,[{key:"render",value:function(){var c=this.props.children;return Object(G.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(F.a.Component)},MI8n:function(ct,ge,U){"use strict";U.d(ge,"c",function(){return P}),U.d(ge,"b",function(){return n}),U.d(ge,"e",function(){return I}),U.d(ge,"a",function(){return E}),U.d(ge,"d",function(){return f}),U.d(ge,"f",function(){return b});var te=U("/cxE"),Y=U("pmY6"),N=U("24hK"),z=U("5Y4S"),P;(function(c){c.None=()=>Y.a.None;function a(w){return(j,W=null,T)=>{let M=!1,m;return m=w(v=>M?void 0:(m?m.dispose():M=!0,j.call(W,v)),null,T),M&&m.dispose(),m}}c.once=a;function p(w,j){return A((W,T=null,M)=>w(m=>W.call(T,j(m)),null,M))}c.map=p;function l(w,j){return A((W,T=null,M)=>w(m=>{j(m),W.call(T,m)},null,M))}c.forEach=l;function u(w,j){return A((W,T=null,M)=>w(m=>j(m)&&W.call(T,m),null,M))}c.filter=u;function s(w){return w}c.signal=s;function i(...w){return(j,W=null,T)=>Object(Y.e)(...w.map(M=>M(m=>j.call(W,m),null,T)))}c.any=i;function D(w,j,W){let T=W;return p(w,M=>(T=j(T,M),T))}c.reduce=D;function A(w){let j;const W=new n({onFirstListenerAdd(){j=w(W.fire,W)},onLastListenerRemove(){j.dispose()}});return W.event}function S(w,j,W=100,T=!1,M){let m,v,H,X=0;const q=new n({leakWarningThreshold:M,onFirstListenerAdd(){m=w(re=>{X++,v=j(v,re),T&&!H&&(q.fire(v),v=void 0),clearTimeout(H),H=setTimeout(()=>{const ye=v;v=void 0,H=void 0,(!T||X>1)&&q.fire(ye),X=0},W)})},onLastListenerRemove(){m.dispose()}});return q.event}c.debounce=S;function R(w,j=(W,T)=>W===T){let W=!0,T;return u(w,M=>{const m=W||!j(M,T);return W=!1,T=M,m})}c.latch=R;function O(w,j){return[c.filter(w,j),c.filter(w,W=>!j(W))]}c.split=O;function g(w,j=!1,W=[]){let T=W.slice(),M=w(H=>{T?T.push(H):v.fire(H)});const m=()=>{T&&T.forEach(H=>v.fire(H)),T=null},v=new n({onFirstListenerAdd(){M||(M=w(H=>v.fire(H)))},onFirstListenerDidAdd(){T&&(j?setTimeout(m):m())},onLastListenerRemove(){M&&M.dispose(),M=null}});return v.event}c.buffer=g;class _{constructor(w){this.event=w}map(w){return new _(p(this.event,w))}forEach(w){return new _(l(this.event,w))}filter(w){return new _(u(this.event,w))}reduce(w,j){return new _(D(this.event,w,j))}latch(){return new _(R(this.event))}debounce(w,j=100,W=!1,T){return new _(S(this.event,w,j,W,T))}on(w,j,W){return this.event(w,j,W)}once(w,j,W){return a(this.event)(w,j,W)}}function h(w){return new _(w)}c.chain=h;function d(w,j,W=T=>T){const T=(...H)=>v.fire(W(...H)),M=()=>w.on(j,T),m=()=>w.removeListener(j,T),v=new n({onFirstListenerAdd:M,onLastListenerRemove:m});return v.event}c.fromNodeEventEmitter=d;function C(w,j,W=T=>T){const T=(...H)=>v.fire(W(...H)),M=()=>w.addEventListener(j,T),m=()=>w.removeEventListener(j,T),v=new n({onFirstListenerAdd:M,onLastListenerRemove:m});return v.event}c.fromDOMEventEmitter=C;function x(w){return new Promise(j=>a(w)(j))}c.toPromise=x})(P||(P={}));class F{constructor(c){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${c}_${F._idPool++}`}start(c){this._stopWatch=new z.a(!0),this._listenerCount=c}stop(){if(this._stopWatch){const c=this._stopWatch.elapsed();this._elapsedOverall+=c,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${c.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}F._idPool=0;let G=-1;class K{constructor(c,a=Math.random().toString(18).slice(2,5)){this.customThreshold=c,this.name=a,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(c){let a=G;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||c<a)return;this._stacks||(this._stacks=new Map);const p=new Error().stack.split(`
`).slice(3).join(`
`),l=this._stacks.get(p)||0;if(this._stacks.set(p,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let u,s=0;for(const[i,D]of this._stacks)(!u||s<D)&&(u=i,s=D);console.warn(`[${this.name}] potential listener LEAK detected, having ${c} listeners already. MOST frequent listener (${s}):`),console.warn(u)}return()=>{const u=this._stacks.get(p)||0;this._stacks.set(p,u-1)}}}class n{constructor(c){var a;this._disposed=!1,this._options=c,this._leakageMon=G>0?new K(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((a=this._options)===null||a===void 0?void 0:a._profName)?new F(this._options._profName):void 0}get event(){return this._event||(this._event=(c,a,p)=>{var l;this._listeners||(this._listeners=new N.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(a?[c,a]:c);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,c,a);const i=(l=this._leakageMon)===null||l===void 0?void 0:l.check(this._listeners.size),D=Object(Y.i)(()=>{if(i&&i(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const A=this._listeners&&!this._listeners.isEmpty();A||this._options.onLastListenerRemove(this)}});return p instanceof Y.b?p.add(D):Array.isArray(p)&&p.push(D),D}),this._event}fire(c){var a,p;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new N.a);for(let l of this._listeners)this._deliveryQueue.push([l,c]);for((a=this._perfMon)===null||a===void 0||a.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[l,u]=this._deliveryQueue.shift();try{typeof l=="function"?l.call(void 0,u):l[0].call(l[1],u)}catch(s){Object(te.f)(s)}}(p=this._perfMon)===null||p===void 0||p.stop()}}dispose(){var c,a,p,l,u;this._disposed||(this._disposed=!0,(c=this._listeners)===null||c===void 0||c.clear(),(a=this._deliveryQueue)===null||a===void 0||a.clear(),(l=(p=this._options)===null||p===void 0?void 0:p.onLastListenerRemove)===null||l===void 0||l.call(p),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class I extends n{constructor(c){super(c);this._isPaused=0,this._eventQueue=new N.a,this._mergeFn=c==null?void 0:c.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const c=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(c))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(c){this._listeners&&(this._isPaused!==0?this._eventQueue.push(c):super.fire(c))}}class E extends I{constructor(c){var a;super(c);this._delay=(a=c.delay)!==null&&a!==void 0?a:100}fire(c){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(c)}}class f{constructor(){this.buffers=[]}wrapEvent(c){return(a,p,l)=>c(u=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>a.call(p,u)):a.call(p,u)},void 0,l)}bufferEvents(c){const a=[];this.buffers.push(a);const p=c();return this.buffers.pop(),a.forEach(l=>l()),p}}class b{constructor(){this.listening=!1,this.inputEvent=P.None,this.inputEventListener=Y.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(c){this.inputEvent=c,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=c(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(ct,ge,U){"use strict";(function(te,Y){U.d(ge,"b",function(){return p}),U.d(ge,"i",function(){return i}),U.d(ge,"f",function(){return D}),U.d(ge,"d",function(){return A}),U.d(ge,"g",function(){return S}),U.d(ge,"h",function(){return R}),U.d(ge,"c",function(){return O}),U.d(ge,"k",function(){return g}),U.d(ge,"j",function(){return _}),U.d(ge,"a",function(){return h}),U.d(ge,"e",function(){return x});var N;const z="en";let P=!1,F=!1,G=!1,K=!1,n=!1,I=!1,E=!1,f,b=z,c,a;const p=typeof self=="object"?self:typeof te=="object"?te:{};let l;typeof p.vscode!="undefined"&&typeof p.vscode.process!="undefined"?l=p.vscode.process:typeof Y!="undefined"&&(l=Y);const u=typeof((N=l==null?void 0:l.versions)===null||N===void 0?void 0:N.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!u)a=navigator.userAgent,P=a.indexOf("Windows")>=0,F=a.indexOf("Macintosh")>=0,E=(a.indexOf("Macintosh")>=0||a.indexOf("iPad")>=0||a.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=a.indexOf("Linux")>=0,I=!0,f=navigator.language,b=f;else if(typeof l=="object"){P=l.platform==="win32",F=l.platform==="darwin",G=l.platform==="linux",K=G&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,f=z,b=z;const w=l.env.VSCODE_NLS_CONFIG;if(w)try{const j=JSON.parse(w),W=j.availableLanguages["*"];f=j.locale,b=W||z,c=j._translationsConfigFile}catch(j){}n=!0}else console.error("Unable to resolve platform.");let s=0;F?s=1:P?s=3:G&&(s=2);const i=P,D=F,A=G,S=n,R=I,O=E,g=a,_=function(){if(p.setImmediate)return p.setImmediate.bind(p);if(typeof p.postMessage=="function"&&!p.importScripts){let W=[];p.addEventListener("message",M=>{if(M.data&&M.data.vscodeSetImmediateId)for(let m=0,v=W.length;m<v;m++){const H=W[m];if(H.id===M.data.vscodeSetImmediateId){W.splice(m,1),H.callback();return}}});let T=0;return M=>{const m=++T;W.push({id:m,callback:M}),p.postMessage({vscodeSetImmediateId:m},"*")}}if(typeof(l==null?void 0:l.nextTick)=="function")return l.nextTick.bind(l);const j=Promise.resolve();return W=>j.then(W)}(),h=F||E?2:P?1:3;let d=!0,C=!1;function x(){if(!C){C=!0;const w=new Uint8Array(2);w[0]=1,w[1]=2;const j=new Uint16Array(w.buffer);d=j[0]===(2<<8)+1}return d}}).call(this,U("IyRk"),U("Q2Ig"))},N0LK:function(ct,ge,U){"use strict";U.d(ge,"C",function(){return te}),U.d(ge,"v",function(){return N}),U.d(ge,"s",function(){return z}),U.d(ge,"t",function(){return P}),U.d(ge,"U",function(){return F}),U.d(ge,"J",function(){return G}),U.d(ge,"O",function(){return K}),U.d(ge,"p",function(){return n}),U.d(ge,"T",function(){return I}),U.d(ge,"q",function(){return E}),U.d(ge,"N",function(){return f}),U.d(ge,"M",function(){return b}),U.d(ge,"Q",function(){return c}),U.d(ge,"u",function(){return a}),U.d(ge,"x",function(){return p}),U.d(ge,"I",function(){return l}),U.d(ge,"f",function(){return u}),U.d(ge,"h",function(){return s}),U.d(ge,"g",function(){return i}),U.d(ge,"i",function(){return D}),U.d(ge,"G",function(){return A}),U.d(ge,"H",function(){return S}),U.d(ge,"r",function(){return R}),U.d(ge,"R",function(){return O}),U.d(ge,"d",function(){return g}),U.d(ge,"e",function(){return _}),U.d(ge,"E",function(){return h}),U.d(ge,"F",function(){return d}),U.d(ge,"j",function(){return C}),U.d(ge,"z",function(){return x}),U.d(ge,"K",function(){return j}),U.d(ge,"L",function(){return W}),U.d(ge,"m",function(){return M}),U.d(ge,"k",function(){return v}),U.d(ge,"A",function(){return X}),U.d(ge,"a",function(){return q}),U.d(ge,"n",function(){return re}),U.d(ge,"l",function(){return ye}),U.d(ge,"D",function(){return pe}),U.d(ge,"B",function(){return ue}),U.d(ge,"b",function(){return fe}),U.d(ge,"S",function(){return be}),U.d(ge,"o",function(){return se}),U.d(ge,"P",function(){return ae}),U.d(ge,"w",function(){return Ce}),U.d(ge,"c",function(){return ze}),U.d(ge,"y",function(){return Ve});function te(de){return!de||typeof de!="string"?!0:de.trim().length===0}const Y=/{(\d+)}/g;function N(de,...De){return De.length===0?de:de.replace(Y,function(Ne,Ue){const rt=parseInt(Ue,10);return isNaN(rt)||rt<0||rt>=De.length?Ne:De[rt]})}function z(de){return de.replace(/[<>&]/g,function(De){switch(De){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return De}})}function P(de){return de.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function F(de,De=" "){const Ne=G(de,De);return K(Ne,De)}function G(de,De){if(!de||!De)return de;const Ne=De.length;if(Ne===0||de.length===0)return de;let Ue=0;for(;de.indexOf(De,Ue)===Ue;)Ue=Ue+Ne;return de.substring(Ue)}function K(de,De){if(!de||!De)return de;const Ne=De.length,Ue=de.length;if(Ne===0||Ue===0)return de;let rt=Ue,lt=-1;for(;!(lt=de.lastIndexOf(De,rt-1),lt===-1||lt+Ne!==rt);){if(lt===0)return"";rt=lt}return de.substring(0,rt)}function n(de){return de.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function I(de){return de.replace(/\*/g,"")}function E(de,De,Ne={}){if(!de)throw new Error("Cannot create regex from empty string");De||(de=P(de)),Ne.wholeWord&&(/\B/.test(de.charAt(0))||(de="\\b"+de),/\B/.test(de.charAt(de.length-1))||(de=de+"\\b"));let Ue="";return Ne.global&&(Ue+="g"),Ne.matchCase||(Ue+="i"),Ne.multiline&&(Ue+="m"),Ne.unicode&&(Ue+="u"),new RegExp(de,Ue)}function f(de){if(de.source==="^"||de.source==="^$"||de.source==="$"||de.source==="^\\s*$")return!1;const De=de.exec("");return!!(De&&de.lastIndex===0)}function b(de){return(de.global?"g":"")+(de.ignoreCase?"i":"")+(de.multiline?"m":"")+(de.unicode?"u":"")}function c(de){return de.split(/\r\n|\r|\n/)}function a(de){for(let De=0,Ne=de.length;De<Ne;De++){const Ue=de.charCodeAt(De);if(Ue!==32&&Ue!==9)return De}return-1}function p(de,De=0,Ne=de.length){for(let Ue=De;Ue<Ne;Ue++){const rt=de.charCodeAt(Ue);if(rt!==32&&rt!==9)return de.substring(De,Ue)}return de.substring(De,Ne)}function l(de,De=de.length-1){for(let Ne=De;Ne>=0;Ne--){const Ue=de.charCodeAt(Ne);if(Ue!==32&&Ue!==9)return Ne}return-1}function u(de,De){return de<De?-1:de>De?1:0}function s(de,De,Ne=0,Ue=de.length,rt=0,lt=De.length){for(;Ne<Ue&&rt<lt;Ne++,rt++){let _t=de.charCodeAt(Ne),gt=De.charCodeAt(rt);if(_t<gt)return-1;if(_t>gt)return 1}const ft=Ue-Ne,at=lt-rt;return ft<at?-1:ft>at?1:0}function i(de,De){return D(de,De,0,de.length,0,De.length)}function D(de,De,Ne=0,Ue=de.length,rt=0,lt=De.length){for(;Ne<Ue&&rt<lt;Ne++,rt++){let _t=de.charCodeAt(Ne),gt=De.charCodeAt(rt);if(_t===gt)continue;if(_t>=128||gt>=128)return s(de.toLowerCase(),De.toLowerCase(),Ne,Ue,rt,lt);A(_t)&&(_t-=32),A(gt)&&(gt-=32);const xt=_t-gt;if(xt===0)continue;return xt}const ft=Ue-Ne,at=lt-rt;return ft<at?-1:ft>at?1:0}function A(de){return de>=97&&de<=122}function S(de){return de>=65&&de<=90}function R(de,De){return de.length===De.length&&D(de,De)===0}function O(de,De){const Ne=De.length;return De.length>de.length?!1:D(de,De,0,Ne)===0}function g(de,De){let Ne,Ue=Math.min(de.length,De.length);for(Ne=0;Ne<Ue;Ne++)if(de.charCodeAt(Ne)!==De.charCodeAt(Ne))return Ne;return Ue}function _(de,De){let Ne,Ue=Math.min(de.length,De.length);const rt=de.length-1,lt=De.length-1;for(Ne=0;Ne<Ue;Ne++)if(de.charCodeAt(rt-Ne)!==De.charCodeAt(lt-Ne))return Ne;return Ue}function h(de){return 55296<=de&&de<=56319}function d(de){return 56320<=de&&de<=57343}function C(de,De){return(de-55296<<10)+(De-56320)+65536}function x(de,De,Ne){const Ue=de.charCodeAt(Ne);if(h(Ue)&&Ne+1<De){const rt=de.charCodeAt(Ne+1);if(d(rt))return C(Ue,rt)}return Ue}function w(de,De){const Ne=de.charCodeAt(De-1);if(d(Ne)&&De>1){const Ue=de.charCodeAt(De-2);if(h(Ue))return C(Ue,Ne)}return Ne}function j(de,De){const Ne=Ye.getInstance(),Ue=De,rt=de.length,lt=x(de,rt,De);De+=lt>=65536?2:1;let ft=Ne.getGraphemeBreakType(lt);for(;De<rt;){const at=x(de,rt,De),_t=Ne.getGraphemeBreakType(at);if(ze(ft,_t))break;De+=at>=65536?2:1,ft=_t}return De-Ue}function W(de,De){const Ne=Ye.getInstance(),Ue=De,rt=w(de,De);De-=rt>=65536?2:1;let lt=Ne.getGraphemeBreakType(rt);for(;De>0;){const ft=w(de,De),at=Ne.getGraphemeBreakType(ft);if(ze(at,lt))break;De-=ft>=65536?2:1,lt=at}return Ue-De}const T=/(?:[\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(de){return T.test(de)}const m=/(?:[\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 v(de){return m.test(de)}const H=/^[\t\n\r\x20-\x7E]*$/;function X(de){return H.test(de)}const q=/[\u2028\u2029]/;function re(de){return q.test(de)}function ye(de){for(let De=0,Ne=de.length;De<Ne;De++)if(pe(de.charCodeAt(De)))return!0;return!1}function pe(de){return de=+de,de>=11904&&de<=55215||de>=63744&&de<=64255||de>=65281&&de<=65374}function ue(de){return de>=127462&&de<=127487||de===8986||de===8987||de===9200||de===9203||de>=9728&&de<=10175||de===11088||de===11093||de>=127744&&de<=128591||de>=128640&&de<=128764||de>=128992&&de<=129003||de>=129280&&de<=129535||de>=129648&&de<=129750}const fe=String.fromCharCode(65279);function be(de){return!!(de&&de.length>0&&de.charCodeAt(0)===65279)}function se(de,De=!1){return de?(De&&(de=de.replace(/\\./g,"")),de.toLowerCase()!==de):!1}function ae(de){const De=90-65+1;return de=de%(2*De),de<De?String.fromCharCode(97+de):String.fromCharCode(65+de-De)}function Ce(de){const De=Ye.getInstance();return De.getGraphemeBreakType(de)}function ze(de,De){return de===0?De!==5&&De!==7:de===2&&De===3?!1:de===4||de===2||de===3||(De===4||De===2||De===3)?!0:de===8&&(De===8||De===9||De===11||De===12)||((de===11||de===9)&&(De===9||De===10)||((de===12||de===10)&&De===10||(De===5||De===13||(De===7||(de===1||de===13&&De===14)))))?!1:!(de===6&&De===6)}class Ye{constructor(){this._data=He()}static getInstance(){return Ye._INSTANCE||(Ye._INSTANCE=new Ye),Ye._INSTANCE}getGraphemeBreakType(de){if(de<32)return de===10?3:de===13?2:4;if(de<127)return 0;const De=this._data,Ne=De.length/3;let Ue=1;for(;Ue<=Ne;)if(de<De[3*Ue])Ue=2*Ue;else if(de>De[3*Ue+1])Ue=2*Ue+1;else return De[3*Ue+2];return 0}}Ye._INSTANCE=null;function He(){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 Ve(de,De){if(de===0)return 0;const Ne=Fe(de,De);if(Ne!==void 0)return Ne;const Ue=w(De,de);return de-=Ke(Ue),de}function Fe(de,De){let Ne=w(De,de);for(de-=Ke(Ne);nt(Ne)||Ne===65039||Ne===8419;){if(de===0)return;Ne=w(De,de),de-=Ke(Ne)}if(!ue(Ne))return;if(de>=0){const Ue=w(De,de);Ue===8205&&(de-=Ke(Ue))}return de}function Ke(de){return de>=65536?2:1}function nt(de){return 127995<=de&&de<=127999}},NLgs:function(ct,ge,U){"use strict";U.d(ge,"e",function(){return l}),U.d(ge,"f",function(){return u}),U.d(ge,"d",function(){return i}),U.d(ge,"c",function(){return D}),U.d(ge,"a",function(){return A}),U.d(ge,"b",function(){return S});var te=U("miYZ"),Y=U("tsqr"),N=U("9og8"),z=U("2qtc"),P=U("kLXV"),F=U("WmNS"),G=U.n(F),K=U("q1tI"),n=U.n(K),I=U("9kvl"),E=U("xKgJ"),f=U("1vsH"),b=U("RCxd"),c=U("yTi+"),a=U.n(c),p=U("m3rI"),l=function(O){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(u(O)&&s(g))},u=function(O){return Object(E.p)()?!0:(O({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},s=function(){var O,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,_=Object(I.c)()._store.getState(),h=_.user;return(O=h.userInfo)!==null&&O!==void 0&&O.profile_completed?!0:(P.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:g?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){I.d.push("/account/profile/edit")}}),!1)},i=function(){var O,g=Object(I.c)()._store.getState(),_=g.user;return(O=_.userInfo)!==null&&O!==void 0&&O.professional_certification?!0:(P.a.confirm({title:"\u63D0\u793A",centered:!0,content:n.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(f.S)("/account/certification")}}),!1)},D=function(){var O;if(Object(E.a)())return!0;var g=Object(I.c)()._store.getState(),_=g.user,h=g.globalSetting;return P.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:n.a.createElement("div",{className:"tc",style:{marginLeft:-38}},n.a.createElement("p",null,"\u626B\u7801\u6DFB\u52A0\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),n.a.createElement("img",{src:p.a.IMG_SERVER+(h==null||((O=h.setting)===null||O===void 0)?void 0:O.authority_qrcode_url),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1},A=function(O,g){var _;if(O)return!0;var h=Object(I.c)()._store.getState(),d=h.user,C=h.globalSetting;return P.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:n.a.createElement("div",null,n.a.createElement("p",null,g||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),n.a.createElement("div",{style:{marginLeft:"110px"}},n.a.createElement("img",{src:p.a.IMG_SERVER+(C==null||((_=C.setting)===null||_===void 0)?void 0:_.authority_qrcode_url),width:200}),n.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(f.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1},S=function(O){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",_=Object(I.c)()._store.getState(),h=_.shixunsDetail.detail;return(h==null?void 0:h.public)===2||(h==null?void 0:h.public)===1||(h==null?void 0:h.shixun_status)===3?(P.a.info({centered:!0,icon:n.a.createElement(b.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:n.a.createElement("div",{className:"tc",style:{marginLeft:-38}},n.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},n.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(h==null?void 0:h.public)===2?"\u5DF2\u516C\u5F00":(h==null?void 0:h.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",g,"\u3002"),n.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),n.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:a.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(h==null?void 0:h.shixun_status)===2?(P.a.confirm({centered:!0,icon:n.a.createElement(b.a,null),title:"\u63D0\u793A",content:n.a.createElement("div",null,n.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",g,"\u3002"),n.a.createElement("br",null),n.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){P.a.confirm({width:440,centered:!0,icon:n.a.createElement(b.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var C=Object(N.a)(G.a.mark(function w(){var j;return G.a.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return T.next=2,O({type:"shixunsDetail/cancelRelease",payload:{id:h==null?void 0:h.identifier}});case 2:j=T.sent,j.status!==401&&(Y.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),O({type:"shixunsDetail/getShixunsDetail",payload:{id:h==null?void 0:h.identifier}}),O({type:"practiceSetting/getCommonData",payload:{id:h==null?void 0:h.identifier}}));case 4:case"end":return T.stop()}},w)}));function x(){return C.apply(this,arguments)}return x}()})}}),!0):!1}},NvD2:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return F});var te=U("Kwbf");function Y(G,K){var n=new Set;return G.forEach(function(I){K.has(I)||n.add(I)}),n}function N(G){var K=G||{},n=K.disabled,I=K.disableCheckbox,E=K.checkable;return!!(n||I)||E===!1}function z(G,K,n,I){for(var E=new Set(G),f=new Set,b=0;b<=n;b+=1){var c=K.get(b)||new Set;c.forEach(function(u){var s=u.key,i=u.node,D=u.children,A=D===void 0?[]:D;E.has(s)&&!I(i)&&A.filter(function(S){return!I(S.node)}).forEach(function(S){E.add(S.key)})})}for(var a=new Set,p=n;p>=0;p-=1){var l=K.get(p)||new Set;l.forEach(function(u){var s=u.parent,i=u.node;if(I(i)||!u.parent||a.has(u.parent.key))return;if(I(u.parent.node)){a.add(s.key);return}var D=!0,A=!1;(s.children||[]).filter(function(S){return!I(S.node)}).forEach(function(S){var R=S.key,O=E.has(R);D&&!O&&(D=!1),!A&&(O||f.has(R))&&(A=!0)}),D&&E.add(s.key),A&&f.add(s.key),a.add(s.key)})}return{checkedKeys:Array.from(E),halfCheckedKeys:Array.from(Y(f,E))}}function P(G,K,n,I,E){for(var f=new Set(G),b=new Set(K),c=0;c<=I;c+=1){var a=n.get(c)||new Set;a.forEach(function(s){var i=s.key,D=s.node,A=s.children,S=A===void 0?[]:A;!f.has(i)&&!b.has(i)&&!E(D)&&S.filter(function(R){return!E(R.node)}).forEach(function(R){f.delete(R.key)})})}b=new Set;for(var p=new Set,l=I;l>=0;l-=1){var u=n.get(l)||new Set;u.forEach(function(s){var i=s.parent,D=s.node;if(E(D)||!s.parent||p.has(s.parent.key))return;if(E(s.parent.node)){p.add(i.key);return}var A=!0,S=!1;(i.children||[]).filter(function(R){return!E(R.node)}).forEach(function(R){var O=R.key,g=f.has(O);A&&!g&&(A=!1),!S&&(g||b.has(O))&&(S=!0)}),A||f.delete(i.key),S&&b.add(i.key),p.add(i.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(Y(b,f))}}function F(G,K,n,I){var E=[],f;I?f=I:f=N;var b=new Set(G.filter(function(l){var u=!!n[l];return u||E.push(l),u})),c=new Map,a=0;Object.keys(n).forEach(function(l){var u=n[l],s=u.level,i=c.get(s);i||(i=new Set,c.set(s,i)),i.add(u),a=Math.max(a,s)}),Object(te.a)(!E.length,"Tree missing follow keys: ".concat(E.slice(0,100).map(function(l){return"'".concat(l,"'")}).join(", ")));var p;return K===!0?p=z(b,c,a,f):p=P(b,K.halfCheckedKeys,c,a,f),p}},"ORt/":function(ct,ge,U){ct.exports={operating:"operating___1LS8K",tip:"tip___3LKV6"}},OZM5:function(ct,ge,U){"use strict";U.d(ge,"b",function(){return I}),U.d(ge,"a",function(){return E}),U.d(ge,"k",function(){return f}),U.d(ge,"h",function(){return b}),U.d(ge,"i",function(){return c}),U.d(ge,"g",function(){return a}),U.d(ge,"c",function(){return p}),U.d(ge,"d",function(){return l}),U.d(ge,"j",function(){return i}),U.d(ge,"e",function(){return D}),U.d(ge,"f",function(){return A});var te=U("KQm4"),Y=U("U8pU"),N=U("Ff2n"),z=U("q1tI"),P=U.n(z),F=U("Kwbf"),G=U("WaYH"),K=.25,n=2;function I(S,R){var O=S.slice(),g=O.indexOf(R);return g>=0&&O.splice(g,1),O}function E(S,R){var O=S.slice();return O.indexOf(R)===-1&&O.push(R),O}function f(S){return S.split("-")}function b(S,R){return"".concat(S,"-").concat(R)}function c(S){return S&&S.type&&S.type.isTreeNode}function a(S,R){var O=[S],g=R[S];function _(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.forEach(function(d){var C=d.key,x=d.children;O.push(C),_(x)})}return _(g.children),O}function p(S,R){var O=S.clientY,g=R.selectHandle.getBoundingClientRect(),_=g.top,h=g.bottom,d=g.height,C=Math.max(d*K,n);return O<=_+C?-1:O>=h-C?1:0}function l(S,R){if(!S)return;var O=R.multiple;return O?S.slice():S.length?[S[0]]:S}var u=function(R){return R};function s(S,R){if(!S)return[];var O=R||{},g=O.processProps,_=g===void 0?u:g,h=Array.isArray(S)?S:[S];return h.map(function(d){var C=d.children,x=Object(N.a)(d,["children"]),w=s(C,R);return P.a.createElement(G.a,Object.assign({},_(x)),w)})}function i(S){if(!S)return null;var R;if(Array.isArray(S))R={checkedKeys:S,halfCheckedKeys:void 0};else if(Object(Y.a)(S)==="object")R={checkedKeys:S.checked||void 0,halfCheckedKeys:S.halfChecked||void 0};else return Object(F.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function D(S,R){var O=new Set;function g(_){if(O.has(_))return;var h=R[_];if(!h)return;O.add(_);var d=h.parent,C=h.node;if(C.disabled)return;d&&g(d.key)}return(S||[]).forEach(function(_){g(_)}),Object(te.a)(O)}function A(S){var R={};return Object.keys(S).forEach(function(O){(O.startsWith("data-")||O.startsWith("aria-"))&&(R[O]=S[O])}),R}},Ot1p:function(ct,ge,U){"use strict";var te=U("2qtc"),Y=U("kLXV"),N=U("rAM+"),z=U("miYZ"),P=U("tsqr"),F=U("9og8"),G=U("tJVT"),K=U("jrin"),n=U("WmNS"),I=U.n(n),E=U("q1tI"),f=U.n(E),b=U("VrN/"),c=U.n(b),a=U("bdgK"),p=U("p77/"),l=U("Bd2K"),u=U("ELLl"),s=U("19Vz"),i=U("lZu9"),D=U("+NIl"),A=U("kSUc"),S=U("9Bee"),R=function(Me){var et=Me.value,ht=et===void 0?"":et,Ut=Me.className,nn=Me.showTextOnly,en=Me.showLines,mn=Me.style,En=mn===void 0?{}:mn,$t=Object(E.useMemo)(function(){return""},[ht]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:$t}}))},O=U("0Owb"),g=U("dejd"),_=U("C+DQ"),h=U("1vsH"),d=U("m3rI"),C=[{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 x(Me){var et=Me.onActionCallback,ht=Me.title,Ut=Me.icon,nn=Me.actionName,en=Me.className,mn=en===void 0?"":en,En=Me.children;function $t(){et(nn)}return f.a.createElement("a",{title:ht,className:mn,onClick:$t},f.a.createElement("i",{className:"md-iconfont ".concat(Ut)}),En)}var w=function(Me){var et=Me.watch,ht=Me.showNullButton,Ut=Me.onActionCallback,nn=Me.fullScreen,en=Me.insertTemp,mn=Me.hidetoolBar,En=Me.uuid,$t=Me.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.F)("_educoder_session"),"&key=").concat(En,"&api=").concat(encodeURIComponent(d.a.PROXY_SERVER)));var rr=[].concat(C,[{title:"".concat(et?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(et?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!mn&&rr.map(function(Dn,Sr){return f.a.createElement("li",{key:Sr},Dn.actionName?f.a.createElement(x,Object(O.a)({},Dn,{onActionCallback:Ut})):f.a.createElement("span",{className:"v-line"}))}),ht?f.a.createElement("li",null,f.a.createElement(x,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ut},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,en&&f.a.createElement("li",null,f.a.createElement(x,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(en),onActionCallback:Ut},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(x,{icon:"".concat(nn?"icon-shrink":"icon-enlarge"),title:nn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ut})))},j=U("M8RZ"),W=U("+L6B"),T=U("2/Rp"),M=U("y8nQ"),m=U("Vl3Y"),v=U("5NDa"),H=U("5rEg"),X={labelCol:{span:4},wrapperCol:{span:20}},q=function(Me){var et=Me.callback,ht=Me.onCancel;function Ut(nn){et(nn)}return f.a.createElement(m.a,Object(O.a)({},X,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ut}),f.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement(H.a,null)),f.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement(H.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(T.a,{type:"ghost",onClick:ht},"\u53D6\u6D88")))},re=U("7ahc"),ye=U("HmJG"),pe=U("BjJ7"),ue=m.a.useForm,fe={width:280,marginRight:10},be={labelCol:{span:5},wrapperCol:{span:19}},se=function(Me){var et=Me.callback,ht=Me.onCancel,Ut=ue(),nn=Object(G.a)(Ut,1),en=nn[0];function mn(rr){et(rr)}function En(rr,Dn){if(rr.status===-1){P.b.error(rr.message);return}en.setFieldsValue({src:"/api/attachments/".concat(rr.id),type:Dn.type})}function $t(rr){var Dn=rr.target.files[0];Ce(Dn,En)}return f.a.createElement(m.a,Object(O.a)({form:en},be,{className:"upload-image-panel",onFinish:mn}),f.a.createElement(m.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(m.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},f.a.createElement(H.a,{style:fe})),f.a.createElement(ae,{onFileChange:$t}))),f.a.createElement(m.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},f.a.createElement(H.a,{style:{width:264}})),f.a.createElement(m.a.Item,{style:{textAlign:"right"}},f.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(T.a,{type:"ghost",onClick:ht},"\u53D6\u6D88")))};function ae(Me){var et=Me.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:et}))}function Ce(Me,et){if(!Me)throw new String("\u6CA1\u6709\u6587\u4EF6");var ht=new FormData;ht.append("editormd-image-file",Me),ht.append("file_param_name","editormd-image-file"),ht.append("byxhr","true");var Ut=new window.XMLHttpRequest;Ut.withCredentials=!0,Ut.addEventListener("load",function(nn){et(JSON.parse(nn.target.responseText),Me)},!1),Ut.addEventListener("error",function(nn){console.error(nn)},!1),Ut.open("POST","".concat(pe.a,"/api/attachments.json")),Ut.send(ht)}var ze=U("giR+"),Ye=U("fyUT"),He=U("7Kak"),Ve=U("9yH6"),Fe=Ve.a.Group,Ke={margin:"0 8px"},nt=function(Me){var et=Me.callback,ht=Me.onCancel;function Ut(nn){et(nn)}return f.a.createElement(m.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ut},f.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},f.a.createElement("span",{style:Ke},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:Ke},"\u884C\u6570"),f.a.createElement(m.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(Ye.a,null)),f.a.createElement("span",{style:Ke},"\u5217\u6570"),f.a.createElement(m.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(Ye.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},f.a.createElement("span",{style:Ke},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(m.a.Item,{name:"align"},f.a.createElement(Fe,null,f.a.createElement(Ve.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(Ve.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(Ve.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(Ve.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(T.a,{type:"ghost",onClick:ht},"\u53D6\u6D88")))},de=U("ErOA"),De=U("7Cbv"),Ne="link",Ue="upload-image",rt="code-block",lt="add-table",ft="------------",at={default:ft,left:":".concat(ft),center:":".concat(ft,":"),right:"".concat(ft,":")},_t=U("9VGf"),gt,xt;function Ze(){}var kt=0,Ot=1e4,qe="\u2581",st=`
**\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 xe(Me){return/^\d+$/.test(Me)?"".concat(Me,"px"):Me}var we=navigator.platform.toUpperCase().indexOf("MAC")>=0,me=we?"Cmd":"Ctrl",ce=["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"],he=(gt={},Object(K.a)(gt,me+"-B","bold"),Object(K.a)(gt,me+"-I","italic"),gt),Te=(xt={},Object(K.a)(xt,Ne,"\u6DFB\u52A0\u94FE\u63A5"),Object(K.a)(xt,rt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(K.a)(xt,Ue,"\u6DFB\u52A0\u6587\u4EF6"),Object(K.a)(xt,lt,"\u6DFB\u52A0\u8868\u683C"),xt),Re=ge.a=function(Me){var et=Me.defaultValue,ht=et===void 0?"":et,Ut=Me.onChange,nn=Me.width,en=nn===void 0?"100%":nn,mn=Me.height,En=mn===void 0?400:mn,$t=Me.miniToolbar,rr=$t===void 0?!1:$t,Dn=Me.isFocus,Sr=Dn===void 0?!1:Dn,br=Me.watch,Pn=Me.insertTemp,Dr=Me.mode,Or=Dr===void 0?"markdown":Dr,ln=Me.id,Yr=ln===void 0?"markdown-editor-id":ln,tn=Me.showResizeBar,sn=tn===void 0?!1:tn,Qn=Me.noStorage,sr=Qn===void 0?!1:Qn,Nr=Me.showNullButton,hn=Nr===void 0?!1:Nr,Qt=Me.hidetoolBar,$r=Qt===void 0?!1:Qt,fr=Me.fullScreen,Lr=fr===void 0?!1:fr,kn=Me.onBlur,Ur=Me.onCMBeforeChange,vi=Me.onFullScreen,Ai=Me.className,Et=Ai===void 0?"":Ai,fn=Me.disablePaste,Gi=fn===void 0?!1:fn,zi=Me.placeholder,na=zi===void 0?"":zi,Vi=Me.values,Z=Vi===void 0?"":Vi,L=Object(E.useState)(null),k=Object(G.a)(L,2),V=k[0],ne=k[1],Q=Object(E.useState)(ht),Pe=Object(G.a)(Q,2),pt=Pe[0],Lt=Pe[1],rn=Object(E.useState)(br),vt=Object(G.a)(rn,2),Gt=vt[0],pr=vt[1],Ir=Object(E.useState)(Lr),Zt=Object(G.a)(Ir,2),mt=Zt[0],Pt=Zt[1],Rt=Object(E.useState)(""),Ht=Object(G.a)(Rt,2),un=Ht[0],xn=Ht[1],Cn=Object(E.useState)(0),gn=Object(G.a)(Cn,2),Ln=gn[0],Kn=gn[1],dn=Object(E.useState)(En),Sn=Object(G.a)(dn,2),hr=Sn[0],Nn=Sn[1],Kt=Object(E.useState)(!1),An=Object(G.a)(Kt,2),lr=An[0],Un=An[1],zt=Object(E.useRef)(Object(De.a)()),jt=Object(E.useRef)(!1),yn=Object(E.useRef)(),Ct=Object(E.useRef)(),Mt=Object(E.useRef)(),Dt=Object(E.useRef)(),ke=Object(E.useRef)(),Vt=function(){var Xt=Object(F.a)(I.a.mark(function Jt(){var Yt,pn;return I.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:return Mn.next=2,Object(de.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:zt.current}});case 2:pn=Mn.sent,pn!=null&&(Yt=pn.attachments)!==null&&Yt!==void 0&&Yt.length&&(console.log("cm:",V,Ct),pn.attachments.map(function(qn){qn.content_type.indexOf("image")>-1?V.replaceSelection("![,](/api/attachments/".concat(qn.id,"?type=").concat(qn.content_type,")")):qn.content_type.indexOf("video")>-1?V.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):qn.content_type.indexOf("pdf")>-1?V.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(qn.id,"?type=").concat(qn.content_type,'&disposition=inline" target="_blank">').concat(qn.name,"</a>")):V.replaceSelection("[".concat(qn.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(qn.id,"?type=").concat(qn.content_type,")"))}));case 4:case"end":return Mn.stop()}},Jt)}));return function(){return Xt.apply(this,arguments)}}();Object(E.useEffect)(function(){Lt(Z),V==null||V.setValue(Z)},[Z]),Object(E.useEffect)(function(){vi==null||vi(mt)},[mt]),Object(E.useEffect)(function(){if(Ct.current){var Xt=c.a.fromTextArea(Ct.current,{mode:Or,lineNumbers:!rr,lineWrapping:!0,value:ht,autoCloseTags:!0,autoCloseBrackets:!0});Sr&&Xt.focus();function Jt(Yt,pn){if(Gi){pn.preventDefault();return}var Gn=pn.clipboardData;if(Gn){var Mn=Gn.types.toString(),qn=Gn.items;if(Mn==="Files"||Gn.types.indexOf("Files")>-1){if(pn.preventDefault(),Or=="stex")return;try{var gr,wi=qn[1];((gr=qn[0])===null||gr===void 0?void 0:gr.kind)==="file"&&(wi=qn[0]);var Zn=wi.getAsFile(),Qi=Zn.name.split(".").pop();Ce(Zn,function(vr){if(vr.id){var fi,si,Ni;(Zn==null||((fi=Zn.type)===null||fi===void 0)?void 0:fi.indexOf("image"))>-1?Xt.replaceSelection("![,](/api/attachments/".concat(vr.id,"?type=").concat(vr.content_type,")")):(Zn==null||((si=Zn.type)===null||si===void 0)?void 0:si.indexOf("video"))>-1?Xt.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,'"></video>')):(Zn==null||((Ni=Zn.type)===null||Ni===void 0)?void 0:Ni.indexOf("pdf"))>-1?Xt.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,"?type=").concat(Zn.type,'&disposition=inline" target="_blank">').concat(Zn.name,"</a>")):ce.includes(Qi)?Xt.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,'?type=office&disposition=inline" target="_blank">').concat(Zn.name,"</a>")):Xt.replaceSelection("[".concat(Zn.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,"?type=").concat(vr.content_type,")"))}else(vr==null?void 0:vr.status)===401&&(document.location.href="/user/login")})}catch(vr){P.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Xt.on("paste",Jt),Xt.on("dragleave",function(Yt,pn){Mt.current.classList.remove("mouse-hover-md")}),Xt.on("dragover",function(Yt,pn){Mt.current.classList.add("mouse-hover-md")}),Xt.on("drop",function(Yt,pn){Mt.current.classList.add("mouse-hover-md");var Gn;if(Gn=pn.dataTransfer.files,Gn.length>0){pn.preventDefault(),pn.stopPropagation();for(var Mn=function(wi){var Zn=Gn[wi],Qi=Zn.name.split(".").pop();Ce(Zn,function(vr){if(vr.id){var fi,si,Ni;(Zn==null||((fi=Zn.type)===null||fi===void 0)?void 0:fi.indexOf("image"))>-1?Xt.replaceSelection("![,](/api/attachments/".concat(vr.id,"?type=").concat(vr.content_type,")")):(Zn==null||((si=Zn.type)===null||si===void 0)?void 0:si.indexOf("video"))>-1?Xt.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,'"></video>')):(Zn==null||((Ni=Zn.type)===null||Ni===void 0)?void 0:Ni.indexOf("pdf"))>-1?Xt.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,"?type=").concat(Zn.type,'&disposition=inline" target="_blank">').concat(Zn.name,"</a>")):ce.includes(Qi)?Xt.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,'?type=office&disposition=inline" target="_blank">').concat(Zn.name,"</a>")):Xt.replaceSelection("[".concat(Zn.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,"?type=").concat(vr.content_type,")"))}else(vr==null?void 0:vr.status)===401&&(document.location.href="/user/login")})},qn=0;qn<Gn.length;qn++)Mn(qn)}}),ne(Xt),function(){Xt.off("paste",Jt)}}},[]);var Tn=Object(E.useCallback)(function(){if(Mt.current)try{}catch(Xt){console.log(Xt,"---- to set md editor body height")}},[hr,Mt,mt]);Object(E.useEffect)(function(){function Xt(){var Yt=new a.default(function(pn){var Gn=Object(N.a)(pn),Mn;try{for(Gn.s();!(Mn=Gn.n()).done;){var qn=Mn.value;(qn.target.offsetHeight>0||qn.target.offsetWidth>0)&&(Tn(),V.setSize("100%","100%"),V.refresh())}}catch(gr){Gn.e(gr)}finally{Gn.f()}});return Yt.observe(Ct.current.parentElement),Yt}if(V){var Jt=Xt();return function(){Jt.unobserve(Ct.current.parentElement)}}},[V,Tn]),Object(E.useEffect)(function(){if(V){for(var Xt=[],Jt=function(){var qn=pn[Yt];Gn=Object(G.a)(qn,2);var gr=Gn[0],wi=Gn[1],Zn=Object(K.a)({},gr,function(){mr(wi)});Xt.push(Zn),V.addKeyMap(Zn)},Yt=0,pn=Object.entries(he);Yt<pn.length;Yt++){var Gn;Jt()}return yn.current=setInterval(function(){jt.current&&Vt()},4e3),function(){clearInterval(yn.current);var Mn=Object(N.a)(Xt),qn;try{for(Mn.s();!(qn=Mn.n()).done;){var gr=qn.value;V.removeKeyMap(gr)}}catch(wi){Mn.e(wi)}finally{Mn.f()}}}},[V]),Object(E.useEffect)(function(){Lr!==mt&&Pt(Lr)},[Lr]),Object(_t.a)(function(){if(!sr&&Ln>0){var Xt=new Date().getTime(),Jt=window.sessionStorage.getItem(Yr);Xt>=Ln+Ot&&(!Jt||Jt!==pt)&&(window.sessionStorage.setItem(Yr,pt),Un(!0))}},Ot),Object(E.useEffect)(function(){pr(br)},[V,br]),Object(E.useEffect)(function(){V&&(Sr&&V.focus())},[V,Sr]),Object(E.useEffect)(function(){if(Gt&&V){var Xt=V.getScrollerElement();function Jt(Yt){var pn=Yt.target;if(ke.current){var Gn=pn.scrollTop/pn.scrollHeight;ke.current.scrollTop=ke.current.scrollHeight*Gn}}return Xt.addEventListener("scroll",Jt),function(){Xt.removeEventListener("scroll",Jt)}}},[V,Gt]),Object(E.useEffect)(function(){if(V&&Ur){function Xt(Jt,Yt){Ur(Jt,Yt)}return V.on("beforeChange",Xt),function(){V.off("beforeChange",Xt)}}},[V,Ur]),Object(E.useEffect)(function(){if(V&&kn){function Xt(){kn(V.getValue())}return V.on("blur",Xt),function(){V.off("blur",Xt)}}},[V,kn]),Object(E.useEffect)(function(){if(V){function Xt(Jt){var Yt=Jt.getValue();Lt(Yt),Kn(new Date().getTime()),Jt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ut&&Ut(Yt)}return V.on("change",Xt),function(){V.off("change",Xt)}}},[V,Ut]),Object(E.useEffect)(function(){V&&(ht==null?(V.setValue(""),Lt("")):ht!==V.getValue()&&(V.setValue(ht),Lt(ht),V.setCursor(V.lineCount(),0)))},[V,ht]);var mr=Object(E.useCallback)(function(Xt){var Jt=V.getCursor(),Yt=V.getSelection(),pn=Yt.split(`
`);switch(Xt){case"bold":return V.replaceSelection("**"+Yt+"**"),Yt===""&&V.setCursor(Jt.line,Jt.ch+2),V.focus();case"italic":return V.replaceSelection("*"+Yt+"*"),Yt===""&&V.setCursor(Jt.line,Jt.ch+1),V.focus();case"code":return V.replaceSelection("`"+Yt+"`"),Yt===""&&V.setCursor(Jt.line,Jt.ch+1),V.focus();case"inline-latex":return V.replaceSelection("`$$"+Yt+"$$`"),Yt===""&&V.setCursor(Jt.line,Jt.ch+3),V.focus();case"latex":return V.replaceSelection("```latex\n"+Yt+"\n```"),V.setCursor(Jt.line+1,Yt.length+1),V.focus();case"line-break":return V.replaceSelection(`<br/>
`),V.focus();case"list-ul":return Yt===""?V.replaceSelection("- "+Yt):V.replaceSelection(pn.map(function(Gn){return Gn===""?"":"- ".concat(Gn)}).join(`
`)),V.focus();case"list-ol":return Yt===""?V.replaceSelection("1. "+Yt):V.replaceSelection(pn.map(function(Gn,Mn){return Gn===""?"":"".concat(Mn+1,". ").concat(Gn)}).join(`
`)),V.focus();case"add-null-ch":return Yt===""&&V.setCursor(Jt.line,Jt.ch+1),V.replaceSelection(qe),V.focus();case"inster-template-1":return Yt===""&&V.setCursor(Jt.line,Jt.ch),V.replaceSelection(st),V.focus();case"eraser":return V.setValue(""),V.focus();case"trigger-watch":return pr(!Gt),V.focus();case"trigger-full-screen":return Pt(!mt),V.focus();case Ne:xn(Ne);return;case rt:xn(rt);return;case Ue:xn(Ue);return;case lt:xn(lt);return;default:throw new Error}},[V,Gt,mt]),On=Object(E.useCallback)(function(Xt){xn("");switch(un){case Ne:var Jt=Xt.title,Yt=Xt.link;return V.replaceSelection("[".concat(Jt,"](").concat(Yt,")")),V.focus();case rt:var pn=Xt.language,Gn=Xt.content;return V.replaceSelection(["```"+pn,Gn,"```"].join(`
`)),V.focus();case Ue:var Mn=Xt.src,qn=Xt.alt;return qn?V.replaceSelection("![ ".concat(qn," ]( ").concat(Mn,' "').concat(qn,'" )')):V.replaceSelection("![,](".concat(Mn,")")),V.focus();case lt:for(var gr=Xt.row,wi=Xt.col,Zn=Xt.align,Qi=`
`,vr=0;vr<gr;vr++){for(var fi=[],si=[],Ni=0;Ni<wi;Ni++)vr===1&&si.push(at[Zn]),fi.push(" ");vr===1&&(Qi+="| ".concat(si.join(" | "),` |
`)),Qi+="| ".concat(fi.join(wi===1?"":" | "),` |
`)}return V.replaceSelection(Qi+`
`),V.focus();default:throw new Error}},[V,un]),ii=Object(E.useMemo)(function(){switch(un){case Ne:return f.a.createElement(q,{callback:On,onCancel:ai});case rt:return f.a.createElement(re.b,{callback:On,onCancel:ai});case Ue:return f.a.createElement(se,{callback:On,onCancel:ai});case lt:return f.a.createElement(nt,{callback:On,onCancel:ai});default:return null}},[un]);function ai(){xn("")}Object(E.useEffect)(function(){if(Dt.current){var Xt=Dt.current,Jt=!1,Yt=0;function pn(qn){Jt=!0,Yt=qn.pageY}function Gn(){Jt=!1}function Mn(qn){if(Jt){var gr=qn.pageY-Yt;gr<0&&(gr=0),gr>300&&(gr=300);var wi=En+gr+"px";Nn(wi)}}return Xt.addEventListener("mousedown",pn),document.addEventListener("mousemove",Mn),document.addEventListener("mouseup",Gn),function(){Xt.removeEventListener("mousedown",pn),document.removeEventListener("mousemove",Mn),document.removeEventListener("mouseup",Gn)}}},[V,Dt]),Object(E.useEffect)(function(){Nn(En)},[En]);var Kr=xe(en),jn=xe(hr),Bt={width:Kr,height:jn},Er=Object(E.useMemo)(function(){if(Ln){var Xt=new Date(Ln),Jt=Xt.getHours(),Yt=Xt.getMinutes(),pn=Xt.getSeconds();return Jt=Jt<10?"0"+Jt:Jt,Yt=Yt<10?"0"+Yt:Yt,pn=pn<10?"0"+pn:pn,"".concat(Jt,":").concat(Yt,":").concat(pn)}return 0},[Ln]);function ur(){window.sessionStorage.removeItem(Yr),Un(!1),Kn(0)}function Yn(){Un(!1),Kn(0),V.setValue(window.sessionStorage.getItem(Yr))}function oi(Xt,Jt){var Yt=V.getValue();Yt=Yt.replace(Xt,Jt),Lt(Yt),V==null||V.setValue(Yt)}return f.a.createElement(E.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:Mt},f.a.createElement("div",{className:"markdown-editor-container ".concat(Et," ").concat(Gt?"on-preview":""," ").concat(rr?"mini":""," ").concat(mt?"full-screen":""),style:Bt},f.a.createElement(w,{insertTemp:Pn,watch:Gt,fullScreen:mt,showNullButton:hn,onActionCallback:mr,hidetoolBar:$r,uuid:zt.current,setOpenPhones:function(){jt.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:Ct,placeholder:na})),Gt?f.a.createElement("div",{ref:ke,className:"preview-container"},Or==="stex"&&f.a.createElement(R,{value:pt}),Or!=="stex"&&f.a.createElement(S.a,{edit:!0,value:pt,replaces:oi})):null))),sn?f.a.createElement("a",{ref:Dt,className:"editor-resize"}):null,f.a.createElement(j.a,null,Te[un]?f.a.createElement(Y.a,{centered:!0,title:Te[un],visible:!0,onCancel:ai,footer:null,className:"markdown-popup-form"},ii):null))}},"P/tu":function(ct,ge,U){"use strict";var te=U("ozfa"),Y=U("MJZm"),N=U("0Owb"),z=U("9og8"),P=U("tJVT"),F=U("PpiC"),G=U("WmNS"),K=U.n(G),n=U("q1tI"),I=U.n(n),E=U("WCUW"),f=U("spXi"),b=U.n(f),c=function(p){var l=p.value,u=p.onChange,s=p.defaultValue,i=p.disabled,D=Object(F.a)(p,["value","onChange","defaultValue","disabled"]),A=Object(n.useState)([]),S=Object(P.a)(A,2),R=S[0],O=S[1],g=Object(n.useState)("1"),_=Object(P.a)(g,2),h=_[0],d=_[1];Object(n.useEffect)(function(){C()},[]);var C=function(){var j=Object(z.a)(K.a.mark(function W(){var T,M;return K.a.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,Object(E.A)({});case 2:T=v.sent,T!=null&&T.data&&(M=[{title:I.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:b.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:I.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:x(T.data||[])}],O(M),d("2"));case 4:case"end":return v.stop()}},W)}));return function(){return j.apply(this,arguments)}}(),x=function(W){function T(M){var m=M.children,v=Array.isArray(m)&&m.length>0,H=M==null?void 0:M.group_id;return{title:I.a.createElement("div",{title:M==null?void 0:M.name,className:b.a.name},M==null?void 0:M.name),value:H,key:H,icon:I.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:v?m==null?void 0:m.map(function(X){return T(X)}):[]}}return W==null?void 0:W.map(function(M){return T(M)})},w=s?{defaultExpandedKeys:[0]}:{selectedKeys:l,defaultExpandedKeys:l};return I.a.createElement("div",{className:b.a.customTree},I.a.createElement(Y.a,Object(N.a)({key:h},w,{showIcon:!0,treeData:R,onSelect:u,disabled:i},D)))};ge.a=c},Q0Vu:function(ct,ge,U){ct.exports={flex_box_center:"flex_box_center___3fHaw",flex_space_between:"flex_space_between___1tu3K",flex_box_vertical_center:"flex_box_vertical_center___3kmTT",flex_box_center_end:"flex_box_center_end___19OcD",flex_box_column:"flex_box_column___1aMoy",main:"main___JkLSb",wrap:"wrap___1k_Ib",content:"content___1by-P",programName:"programName___1mMSD",name:"name___2mlTd",directionContentWrap:"directionContentWrap___3qsxQ",directionItem:"directionItem___2aAvu",active:"active___ACZqb",subActive:"subActive___2RkoB",subItem:"subItem___3tJgX",subMenu:"subMenu___Y_7S_",action:"action___xqgFs"}},SAoR:function(ct,ge,U){"use strict";var te=U("Q9mQ"),Y=U("diRs"),N=U("q1tI"),z=U.n(N),P=U("+z73"),F=U.n(P),G=function(n){var I=n.data,E=I===void 0?[]:I,f=n.onClick,b=function(){return E.map(function(p,l){return z.a.createElement("div",{key:l,className:F.a.few},z.a.createElement("b",{title:p.name,style:{color:l===0?"#333333":"#999999"},onClick:function(){return f(p.id)}},p.name),l<E.length-1&&z.a.createElement("span",null,"/"))})},c=function(){var p=!0,l=E.slice(2,-2),u=z.a.createElement("div",{className:F.a.pWrap},l.map(function(s){return z.a.createElement("span",{title:s.name,onClick:function(){return f(s.id)},key:s.id},s.name)}));return E.map(function(s,i){var D=null;return i>1&&i<E.length-2?p&&(D=z.a.createElement(Y.a,{key:i,placement:"bottom",content:u},z.a.createElement("span",{style:{color:"#999",cursor:"pointer"}},".../")),p=!1):D=z.a.createElement("div",{key:i,className:F.a.few},z.a.createElement("b",{title:s.name,style:{color:i===0?"#333333":"#999999"},onClick:function(){return f(s.id)}},s.name),i<E.length-1&&z.a.createElement("span",null,"/")),D})};return z.a.createElement("aside",{style:{overflowX:"auto"}},(E==null?void 0:E.length)>5?c():b())};ge.a=G},SJMd:function(ct,ge){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var U,te,Y,N=!1,z,P;window.PR_SHOULD_USE_CONTINUATION=!0;var F,G;(function(){var K=window,n=["break,continue,do,else,for,if,return,while"],I=[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"],E=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[E,"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"],b=[E,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[E,"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",p=[E,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",u=[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"],s=[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"],i=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],D=[f,c,b,p,l,u,s,i],A=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",R="kwd",O="com",g="typ",_="lit",h="pun",d="pln",C="tag",x="dec",w="src",j="atn",W="atv",T="nocode",M="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function m(Fe){for(var Ke=0,nt=!1,de=!1,De=0,Ne=Fe.length;De<Ne;++De){var Ue=Fe[De];if(Ue.ignoreCase)de=!0;else if(/[a-z]/i.test(Ue.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){nt=!0,de=!1;break}}var rt={b:8,t:9,n:10,v:11,f:12,r:13};function lt(xt){var Ze=xt.charCodeAt(0);if(Ze!==92)return Ze;var kt=xt.charAt(1);return Ze=rt[kt],Ze||("0"<=kt&&kt<="7"?parseInt(xt.substring(1),8):kt==="u"||kt==="x"?parseInt(xt.substring(2),16):xt.charCodeAt(1))}function ft(xt){if(xt<32)return(xt<16?"\\x0":"\\x")+xt.toString(16);var Ze=String.fromCharCode(xt);return Ze==="\\"||Ze==="-"||Ze==="]"||Ze==="^"?"\\"+Ze:Ze}function at(xt){var Ze=xt.substring(1,xt.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")),kt=[],Ot=Ze[0]==="^",qe=["["];Ot&&qe.push("^");for(var st=Ot?1:0,xe=Ze.length;st<xe;++st){var we=Ze[st];if(/\\[bdsw]/i.test(we))qe.push(we);else{var me=lt(we),ce;st+2<xe&&Ze[st+1]==="-"?(ce=lt(Ze[st+2]),st+=2):ce=me,kt.push([me,ce]),ce<65||me>122||(ce<65||me>90||kt.push([Math.max(65,me)|32,Math.min(ce,90)|32]),ce<97||me>122||kt.push([Math.max(97,me)&~32,Math.min(ce,122)&~32]))}}kt.sort(function(Me,et){return Me[0]-et[0]||et[1]-Me[1]});for(var he=[],Te=[],st=0;st<kt.length;++st){var Re=kt[st];Re[0]<=Te[1]+1?Te[1]=Math.max(Te[1],Re[1]):he.push(Te=Re)}for(var st=0;st<he.length;++st){var Re=he[st];qe.push(ft(Re[0])),Re[1]>Re[0]&&(Re[1]+1>Re[0]&&qe.push("-"),qe.push(ft(Re[1])))}return qe.push("]"),qe.join("")}function _t(xt){for(var Ze=xt.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")),kt=Ze.length,Ot=[],qe=0,st=0;qe<kt;++qe){var xe=Ze[qe];if(xe==="(")++st;else if(xe.charAt(0)==="\\"){var we=+xe.substring(1);we&&(we<=st?Ot[we]=-1:Ze[qe]=ft(we))}}for(var qe=1;qe<Ot.length;++qe)Ot[qe]===-1&&(Ot[qe]=++Ke);for(var qe=0,st=0;qe<kt;++qe){var xe=Ze[qe];if(xe==="(")++st,Ot[st]||(Ze[qe]="(?:");else if(xe.charAt(0)==="\\"){var we=+xe.substring(1);we&&we<=st&&(Ze[qe]="\\"+Ot[we])}}for(var qe=0;qe<kt;++qe)Ze[qe]==="^"&&Ze[qe+1]!=="^"&&(Ze[qe]="");if(xt.ignoreCase&&nt)for(var qe=0;qe<kt;++qe){var xe=Ze[qe],me=xe.charAt(0);xe.length>=2&&me==="["?Ze[qe]=at(xe):me!=="\\"&&(Ze[qe]=xe.replace(/[a-zA-Z]/g,function(Te){var Re=Te.charCodeAt(0);return"["+String.fromCharCode(Re&~32,Re|32)+"]"}))}return Ze.join("")}for(var gt=[],De=0,Ne=Fe.length;De<Ne;++De){var Ue=Fe[De];if(Ue.global||Ue.multiline)throw new Error(""+Ue);gt.push("(?:"+_t(Ue)+")")}return new RegExp(gt.join("|"),de?"gi":"g")}function v(Fe,Ke){var nt=/(?:^|\s)nocode(?:\s|$)/,de=[],De=0,Ne=[],Ue=0;function rt(lt){var ft=lt.nodeType;if(ft==1){if(nt.test(lt.className))return;for(var at=lt.firstChild;at;at=at.nextSibling)rt(at);var _t=lt.nodeName.toLowerCase();(_t==="br"||_t==="li")&&(de[Ue]=`
`,Ne[Ue<<1]=De++,Ne[Ue++<<1|1]=lt)}else if(ft==3||ft==4){var gt=lt.nodeValue;gt.length&&(Ke?gt=gt.replace(/\r\n?/g,`
`):gt=gt.replace(/[ \t\r\n]+/g," "),de[Ue]=gt,Ne[Ue<<1]=De,De+=gt.length,Ne[Ue++<<1|1]=lt)}}return rt(Fe),{sourceCode:de.join("").replace(/\n$/,""),spans:Ne}}function H(Fe,Ke,nt,de,De){if(!nt)return;var Ne={sourceNode:Fe,pre:1,langExtension:null,numberLines:null,sourceCode:nt,spans:null,basePos:Ke,decorations:null};de(Ne),De.push.apply(De,Ne.decorations)}var X=/\S/;function q(Fe){for(var Ke=void 0,nt=Fe.firstChild;nt;nt=nt.nextSibling){var de=nt.nodeType;Ke=de===1?Ke?Fe:nt:de===3&&X.test(nt.nodeValue)?Fe:Ke}return Ke===Fe?void 0:Ke}function re(Fe,Ke){var nt={},de;(function(){for(var Ue=Fe.concat(Ke),rt=[],lt={},ft=0,at=Ue.length;ft<at;++ft){var _t=Ue[ft],gt=_t[3];if(gt)for(var xt=gt.length;--xt>=0;)nt[gt.charAt(xt)]=_t;var Ze=_t[1],kt=""+Ze;lt.hasOwnProperty(kt)||(rt.push(Ze),lt[kt]=null)}rt.push(/[\0-\uffff]/),de=m(rt)})();var De=Ke.length,Ne=function(Ue){for(var rt=Ue.sourceCode,lt=Ue.basePos,ft=Ue.sourceNode,at=[lt,d],_t=0,gt=rt.match(de)||[],xt={},Ze=0,kt=gt.length;Ze<kt;++Ze){var Ot=gt[Ze],qe=xt[Ot],st=void 0,xe;if(typeof qe=="string")xe=!1;else{var we=nt[Ot.charAt(0)];if(we)st=Ot.match(we[1]),qe=we[0];else{for(var me=0;me<De;++me)if(we=Ke[me],st=Ot.match(we[1]),st){qe=we[0];break}st||(qe=d)}xe=qe.length>=5&&qe.substring(0,5)==="lang-",xe&&!(st&&typeof st[1]=="string")&&(xe=!1,qe=w),xe||(xt[Ot]=qe)}var ce=_t;if(_t+=Ot.length,!xe)at.push(lt+ce,qe);else{var he=st[1],Te=Ot.indexOf(he),Re=Te+he.length;st[2]&&(Re=Ot.length-st[2].length,Te=Re-he.length);var Me=qe.substring(5);H(ft,lt+ce,Ot.substring(0,Te),Ne,at),H(ft,lt+ce+Te,he,ae(Me,he),at),H(ft,lt+ce+Re,Ot.substring(Re),Ne,at)}}Ue.decorations=at};return Ne}function ye(Fe){var Ke=[],nt=[];Fe.tripleQuotedStrings?Ke.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Fe.multiLineStrings?Ke.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ke.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Fe.verbatimStrings&&nt.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var de=Fe.hashComments;de&&(Fe.cStyleComments?(de>1?Ke.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ke.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),nt.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ke.push([O,/^#[^\r\n]*/,null,"#"])),Fe.cStyleComments&&(nt.push([O,/^\/\/[^\r\n]*/,null]),nt.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var De=Fe.regexLiterals;if(De){var Ne=De>1?"":`
\r`,Ue=Ne?".":"[\\S\\s]",rt="/(?=[^/*"+Ne+"])(?:[^/\\x5B\\x5C"+Ne+"]|\\x5C"+Ue+"|\\x5B(?:[^\\x5C\\x5D"+Ne+"]|\\x5C"+Ue+")*(?:\\x5D|$))+/";nt.push(["lang-regex",RegExp("^"+M+"("+rt+")")])}var lt=Fe.types;lt&&nt.push([g,lt]);var ft=(""+Fe.keywords).replace(/^ | $/g,"");ft.length&&nt.push([R,new RegExp("^(?:"+ft.replace(/[\s,]+/g,"|")+")\\b"),null]),Ke.push([d,/^\s+/,null,` \r
\xA0`]);var at="^.[^\\s\\w.$@'\"`/\\\\]*";return Fe.regexLiterals&&(at+="(?!s*/)"),nt.push([_,/^@[a-z_$][a-z_$@0-9]*/i,null],[g,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[d,/^[a-z_$][a-z_$@0-9]*/i,null],[_,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[d,/^\\[\s\S]?/,null],[h,new RegExp(at),null]),re(Ke,nt)}var pe=ye({keywords:D,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ue(Fe,Ke,nt){for(var de=/(?:^|\s)nocode(?:\s|$)/,De=/\r\n?|\n/,Ne=Fe.ownerDocument,Ue=Ne.createElement("li");Fe.firstChild;)Ue.appendChild(Fe.firstChild);var rt=[Ue];function lt(Ze){var kt=Ze.nodeType;if(kt==1&&!de.test(Ze.className))if(Ze.nodeName==="br")ft(Ze),Ze.parentNode&&Ze.parentNode.removeChild(Ze);else for(var Ot=Ze.firstChild;Ot;Ot=Ot.nextSibling)lt(Ot);else if((kt==3||kt==4)&&nt){var qe=Ze.nodeValue,st=qe.match(De);if(st){var xe=qe.substring(0,st.index);Ze.nodeValue=xe;var we=qe.substring(st.index+st[0].length);if(we){var me=Ze.parentNode;me.insertBefore(Ne.createTextNode(we),Ze.nextSibling)}ft(Ze),xe||Ze.parentNode.removeChild(Ze)}}}function ft(Ze){for(;!Ze.nextSibling;)if(Ze=Ze.parentNode,!Ze)return;function kt(st,xe){var we=xe?st.cloneNode(!1):st,me=st.parentNode;if(me){var ce=kt(me,1),he=st.nextSibling;ce.appendChild(we);for(var Te=he;Te;Te=he)he=Te.nextSibling,ce.appendChild(Te)}return we}for(var Ot=kt(Ze.nextSibling,0),qe;(qe=Ot.parentNode)&&qe.nodeType===1;)Ot=qe;rt.push(Ot)}for(var at=0;at<rt.length;++at)lt(rt[at]);Ke===(Ke|0)&&rt[0].setAttribute("value",Ke);var _t=Ne.createElement("ol");_t.className="linenums";for(var gt=Math.max(0,Ke-1|0)||0,at=0,xt=rt.length;at<xt;++at)Ue=rt[at],Ue.className="L"+(at+gt)%10,Ue.firstChild||Ue.appendChild(Ne.createTextNode("\xA0")),_t.appendChild(Ue);Fe.appendChild(_t)}function fe(Fe){var Ke=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ke=Ke&&+Ke[1]<=8;var nt=/\n/g,de=Fe.sourceCode,De=de.length,Ne=0,Ue=Fe.spans,rt=Ue.length,lt=0,ft=Fe.decorations,at=ft.length,_t=0;ft[at]=De;var gt,xt;for(xt=gt=0;xt<at;)ft[xt]!==ft[xt+2]?(ft[gt++]=ft[xt++],ft[gt++]=ft[xt++]):xt+=2;for(at=gt,xt=gt=0;xt<at;){for(var Ze=ft[xt],kt=ft[xt+1],Ot=xt+2;Ot+2<=at&&ft[Ot+1]===kt;)Ot+=2;ft[gt++]=Ze,ft[gt++]=kt,xt=Ot}at=ft.length=gt;var qe=Fe.sourceNode,st="";qe&&(st=qe.style.display,qe.style.display="none");try{for(var xe=null;lt<rt;){var we=Ue[lt],me=Ue[lt+2]||De,ce=ft[_t+2]||De,Ot=Math.min(me,ce),he=Ue[lt+1],Te;if(he.nodeType!==1&&(Te=de.substring(Ne,Ot))){Ke&&(Te=Te.replace(nt,"\r")),he.nodeValue=Te;var Re=he.ownerDocument,Me=Re.createElement("span");Me.className=ft[_t+1];var et=he.parentNode;et.replaceChild(Me,he),Me.appendChild(he),Ne<me&&(Ue[lt+1]=he=Re.createTextNode(de.substring(Ot,me)),et.insertBefore(he,Me.nextSibling))}Ne=Ot,Ne>=me&&(lt+=2),Ne>=ce&&(_t+=2)}}finally{qe&&(qe.style.display=st)}}var be={};function se(Fe,Ke){for(var nt=Ke.length;--nt>=0;){var de=Ke[nt];be.hasOwnProperty(de)?K.console&&console.warn("cannot override language handler %s",de):be[de]=Fe}}function ae(Fe,Ke){return Fe&&be.hasOwnProperty(Fe)||(Fe=/^\s*</.test(Ke)?"default-markup":"default-code"),be[Fe]}se(pe,["default-code"]),se(re([],[[d,/^[^<?]+/],[x,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),se(re([[d,/^[\s]+/,null,` \r
`],[W,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[h,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),se(re([],[[W,/^[\s\S]+/]]),["uq.val"]),se(ye({keywords:f,hashComments:!0,cStyleComments:!0,types:A}),["c","cc","cpp","cxx","cyc","m"]),se(ye({keywords:"null,true,false"}),["json"]),se(ye({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:A}),["cs"]),se(ye({keywords:b,cStyleComments:!0}),["java"]),se(ye({keywords:i,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),se(ye({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),se(ye({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),se(ye({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),se(ye({keywords:p,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),se(ye({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),se(re([],[[S,/^[\s\S]+/]]),["regex"]);function Ce(Fe){var Ke=Fe.langExtension;try{var nt=v(Fe.sourceNode,Fe.pre),de=nt.sourceCode;Fe.sourceCode=de,Fe.spans=nt.spans,Fe.basePos=0,ae(Ke,de)(Fe),fe(Fe)}catch(De){K.console&&console.log(De&&De.stack||De)}}function ze(Fe,Ke,nt){var de=nt||!1,De=Ke||null,Ne=document.createElement("div");Ne.innerHTML="<pre>"+Fe+"</pre>",Ne=Ne.firstChild,de&&ue(Ne,de,!0);var Ue={langExtension:De,numberLines:de,sourceNode:Ne,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ce(Ue),Ne.innerHTML}function Ye(Fe,Ke){var nt=Ke||document.body,de=nt.ownerDocument||document;function De(we){return nt.getElementsByTagName(we)}for(var Ne=[De("pre"),De("code"),De("xmp")],Ue=[],rt=0;rt<Ne.length;++rt)for(var lt=0,ft=Ne[rt].length;lt<ft;++lt)Ue.push(Ne[rt][lt]);Ne=null;var at=Date;at.now||(at={now:function(){return+new Date}});var _t=0,gt=/\blang(?:uage)?-([\w.]+)(?!\S)/,xt=/\bprettyprint\b/,Ze=/\bprettyprinted\b/,kt=/pre|xmp/i,Ot=/^code$/i,qe=/^(?:pre|code|xmp)$/i,st={};function xe(){for(var we=K.PR_SHOULD_USE_CONTINUATION?at.now()+250:Infinity;_t<Ue.length&&at.now()<we;_t++){for(var me=Ue[_t],ce=st,he=me;he=he.previousSibling;){var Te=he.nodeType,Re=(Te===7||Te===8)&&he.nodeValue;if(Re?!/^\??prettify\b/.test(Re):Te!==3||/\S/.test(he.nodeValue))break;if(Re){ce={},Re.replace(/\b(\w+)=([\w:.%+-]+)/g,function(br,Pn,Dr){ce[Pn]=Dr});break}}var Me=me.className;if((ce!==st||xt.test(Me))&&!Ze.test(Me)){for(var et=!1,ht=me.parentNode;ht;ht=ht.parentNode){var Ut=ht.tagName;if(qe.test(Ut)&&ht.className&&xt.test(ht.className)){et=!0;break}}if(!et){me.className+=" prettyprinted";var nn=ce.lang;if(!nn){nn=Me.match(gt);var en;!nn&&(en=q(me))&&Ot.test(en.tagName)&&(nn=en.className.match(gt)),nn&&(nn=nn[1])}var mn;if(kt.test(me.tagName))mn=1;else{var En=me.currentStyle,$t=de.defaultView,rr=En?En.whiteSpace:$t&&$t.getComputedStyle?$t.getComputedStyle(me,null).getPropertyValue("white-space"):0;mn=rr&&rr.substring(0,3)==="pre"}var Dn=ce.linenums;(Dn=Dn==="true"||+Dn)||(Dn=Me.match(/\blinenums\b(?::(\d+))?/),Dn=Dn?Dn[1]&&Dn[1].length?+Dn[1]:!0:!1),Dn&&ue(me,Dn,mn);var Sr={langExtension:nn,sourceNode:me,numberLines:Dn,pre:mn,sourceCode:null,basePos:null,spans:null,decorations:null};Ce(Sr)}}}_t<Ue.length?K.setTimeout(xe,250):typeof Fe=="function"&&Fe()}xe()}var He=K.PR={createSimpleLexer:re,registerLangHandler:se,sourceDecorator:ye,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:W,PR_COMMENT:O,PR_DECLARATION:x,PR_KEYWORD:R,PR_LITERAL:_,PR_NOCODE:T,PR_PLAIN:d,PR_PUNCTUATION:h,PR_SOURCE:w,PR_STRING:S,PR_TAG:C,PR_TYPE:g,prettyPrintOne:N?K.prettyPrintOne=ze:F=ze,prettyPrint:G=N?K.prettyPrint=Ye:G=Ye},Ve=K.define;typeof Ve=="function"&&Ve.amd&&Ve("google-code-prettify",[],function(){return He})})()},T8No:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return G}),U.d(ge,"e",function(){return K}),U.d(ge,"c",function(){return h}),U.d(ge,"b",function(){return d}),U.d(ge,"d",function(){return C}),U.d(ge,"f",function(){return j});var te=U("MNsG"),Y=U("N0LK"),N=U("Cg/j");let z=te.k||"";const P=new Map;P.set("false",!1),P.set("true",!0),P.set("isMac",te.f),P.set("isLinux",te.d),P.set("isWindows",te.i),P.set("isWeb",te.h),P.set("isMacNative",te.f&&!te.h),P.set("isEdge",z.indexOf("Edg/")>=0),P.set("isFirefox",z.indexOf("Firefox")>=0),P.set("isChrome",z.indexOf("Chrome")>=0),P.set("isSafari",z.indexOf("Safari")>=0);const F=Object.prototype.hasOwnProperty;class G{static has(T){return f.create(T)}static equals(T,M){return b.create(T,M)}static regex(T,M){return S.create(T,M)}static not(T){return l.create(T)}static and(...T){return g.create(T,null)}static or(...T){return _.create(T,null,!0)}static deserialize(T,M=!1){return T?this._deserializeOrExpression(T,M):void 0}static _deserializeOrExpression(T,M){let m=T.split("||");return _.create(m.map(v=>this._deserializeAndExpression(v,M)),null,!0)}static _deserializeAndExpression(T,M){let m=T.split("&&");return g.create(m.map(v=>this._deserializeOne(v,M)),null)}static _deserializeOne(T,M){if(T=T.trim(),T.indexOf("!=")>=0){let m=T.split("!=");return p.create(m[0].trim(),this._deserializeValue(m[1],M))}if(T.indexOf("==")>=0){let m=T.split("==");return b.create(m[0].trim(),this._deserializeValue(m[1],M))}if(T.indexOf("=~")>=0){let m=T.split("=~");return S.create(m[0].trim(),this._deserializeRegexValue(m[1],M))}if(T.indexOf(" in ")>=0){let m=T.split(" in ");return c.create(m[0].trim(),m[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(T)){const m=T.split(">=");return i.create(m[0].trim(),m[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(T)){const m=T.split(">");return s.create(m[0].trim(),m[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(T)){const m=T.split("<=");return A.create(m[0].trim(),m[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(T)){const m=T.split("<");return D.create(m[0].trim(),m[1].trim())}return/^\!\s*/.test(T)?l.create(T.substr(1).trim()):f.create(T)}static _deserializeValue(T,M){if(T=T.trim(),T==="true")return!0;if(T==="false")return!1;let m=/^'([^']*)'$/.exec(T);return m?m[1].trim():T}static _deserializeRegexValue(T,M){if(Object(Y.C)(T)){if(M)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let m=T.indexOf("/"),v=T.lastIndexOf("/");if(m===v||m<0){if(M)throw new Error(`bad regexp-value '${T}', missing /-enclosure`);return console.warn(`bad regexp-value '${T}', missing /-enclosure`),null}let H=T.slice(m+1,v),X=T[v+1]==="i"?"i":"";try{return new RegExp(H,X)}catch(q){if(M)throw new Error(`bad regexp-value '${T}', parse error: ${q}`);return console.warn(`bad regexp-value '${T}', parse error: ${q}`),null}}}function K(T,M){const m=T?T.substituteConstants():void 0,v=M?M.substituteConstants():void 0;return!m&&!v?!0:!m||!v?!1:m.equals(v)}function n(T,M){return T.cmp(M)}class I{constructor(){this.type=0}cmp(T){return this.type-T.type}equals(T){return T.type===this.type}substituteConstants(){return this}evaluate(T){return!1}serialize(){return"false"}keys(){return[]}negate(){return E.INSTANCE}}I.INSTANCE=new I;class E{constructor(){this.type=1}cmp(T){return this.type-T.type}equals(T){return T.type===this.type}substituteConstants(){return this}evaluate(T){return!0}serialize(){return"true"}keys(){return[]}negate(){return I.INSTANCE}}E.INSTANCE=new E;class f{constructor(T,M){this.key=T,this.negated=M,this.type=2}static create(T,M=null){const m=P.get(T);return typeof m=="boolean"?m?E.INSTANCE:I.INSTANCE:new f(T,M)}cmp(T){return T.type!==this.type?this.type-T.type:x(this.key,T.key)}equals(T){return T.type===this.type?this.key===T.key:!1}substituteConstants(){const T=P.get(this.key);return typeof T=="boolean"?T?E.INSTANCE:I.INSTANCE:this}evaluate(T){return!!T.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this)),this.negated}}class b{constructor(T,M,m){this.key=T,this.value=M,this.negated=m,this.type=4}static create(T,M,m=null){if(typeof M=="boolean")return M?f.create(T,m):l.create(T,m);const v=P.get(T);if(typeof v=="boolean"){const H=v?"true":"false";return M===H?E.INSTANCE:I.INSTANCE}return new b(T,M,m)}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){const T=P.get(this.key);if(typeof T=="boolean"){const M=T?"true":"false";return this.value===M?E.INSTANCE:I.INSTANCE}return this}evaluate(T){return T.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 c{constructor(T,M){this.key=T,this.valueKey=M,this.type=10,this.negated=null}static create(T,M){return new c(T,M)}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.valueKey,T.key,T.valueKey)}equals(T){return T.type===this.type?this.key===T.key&&this.valueKey===T.valueKey:!1}substituteConstants(){return this}evaluate(T){const M=T.getValue(this.valueKey),m=T.getValue(this.key);return Array.isArray(M)?M.indexOf(m)>=0:typeof m=="string"&&typeof M=="object"&&M!==null?F.call(M,m):!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(T){this._actual=T,this.type=11}static create(T){return new a(T)}cmp(T){return T.type!==this.type?this.type-T.type:this._actual.cmp(T._actual)}equals(T){return T.type===this.type?this._actual.equals(T._actual):!1}substituteConstants(){return this}evaluate(T){return!this._actual.evaluate(T)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class p{constructor(T,M,m){this.key=T,this.value=M,this.negated=m,this.type=5}static create(T,M,m=null){if(typeof M=="boolean")return M?l.create(T,m):f.create(T,m);const v=P.get(T);if(typeof v=="boolean"){const H=v?"true":"false";return M===H?I.INSTANCE:E.INSTANCE}return new p(T,M,m)}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){const T=P.get(this.key);if(typeof T=="boolean"){const M=T?"true":"false";return this.value===M?I.INSTANCE:E.INSTANCE}return this}evaluate(T){return T.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this.key,this.value,this)),this.negated}}class l{constructor(T,M){this.key=T,this.negated=M,this.type=3}static create(T,M=null){const m=P.get(T);return typeof m=="boolean"?m?I.INSTANCE:E.INSTANCE:new l(T,M)}cmp(T){return T.type!==this.type?this.type-T.type:x(this.key,T.key)}equals(T){return T.type===this.type?this.key===T.key:!1}substituteConstants(){const T=P.get(this.key);return typeof T=="boolean"?T?I.INSTANCE:E.INSTANCE:this}evaluate(T){return!T.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function u(T,M){if(typeof T=="string"){const m=parseFloat(T);isNaN(m)||(T=m)}return typeof T=="string"||typeof T=="number"?M(T):I.INSTANCE}class s{constructor(T,M,m){this.key=T,this.value=M,this.negated=m,this.type=12}static create(T,M,m=null){return u(M,v=>new s(T,v,m))}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){return this}evaluate(T){return typeof this.value=="string"?!1:parseFloat(T.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this.key,this.value,this)),this.negated}}class i{constructor(T,M,m){this.key=T,this.value=M,this.negated=m,this.type=13}static create(T,M,m=null){return u(M,v=>new i(T,v,m))}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){return this}evaluate(T){return typeof this.value=="string"?!1:parseFloat(T.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this.key,this.value,this)),this.negated}}class D{constructor(T,M,m){this.key=T,this.value=M,this.negated=m,this.type=14}static create(T,M,m=null){return u(M,v=>new D(T,v,m))}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){return this}evaluate(T){return typeof this.value=="string"?!1:parseFloat(T.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 A{constructor(T,M,m){this.key=T,this.value=M,this.negated=m,this.type=15}static create(T,M,m=null){return u(M,v=>new A(T,v,m))}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){return this}evaluate(T){return typeof this.value=="string"?!1:parseFloat(T.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class S{constructor(T,M){this.key=T,this.regexp=M,this.type=7,this.negated=null}static create(T,M){return new S(T,M)}cmp(T){if(T.type!==this.type)return this.type-T.type;if(this.key<T.key)return-1;if(this.key>T.key)return 1;const M=this.regexp?this.regexp.source:"",m=T.regexp?T.regexp.source:"";return M<m?-1:M>m?1:0}equals(T){if(T.type===this.type){const M=this.regexp?this.regexp.source:"",m=T.regexp?T.regexp.source:"";return this.key===T.key&&M===m}return!1}substituteConstants(){return this}evaluate(T){let M=T.getValue(this.key);return this.regexp?this.regexp.test(M):!1}serialize(){const T=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${T}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this)),this.negated}}class R{constructor(T){this._actual=T,this.type=8}static create(T){return new R(T)}cmp(T){return T.type!==this.type?this.type-T.type:this._actual.cmp(T._actual)}equals(T){return T.type===this.type?this._actual.equals(T._actual):!1}substituteConstants(){return this}evaluate(T){return!this._actual.evaluate(T)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(T){let M=null;for(let m=0,v=T.length;m<v;m++){const H=T[m].substituteConstants();if(T[m]!==H&&M===null){M=[];for(let X=0;X<m;X++)M[X]=T[X]}M!==null&&(M[m]=H)}return M===null?T:M}class g{constructor(T,M){this.expr=T,this.negated=M,this.type=6}static create(T,M){return g._normalizeArr(T,M)}cmp(T){if(T.type!==this.type)return this.type-T.type;if(this.expr.length<T.expr.length)return-1;if(this.expr.length>T.expr.length)return 1;for(let M=0,m=this.expr.length;M<m;M++){const v=n(this.expr[M],T.expr[M]);if(v!==0)return v}return 0}equals(T){if(T.type===this.type){if(this.expr.length!==T.expr.length)return!1;for(let M=0,m=this.expr.length;M<m;M++)if(!this.expr[M].equals(T.expr[M]))return!1;return!0}return!1}substituteConstants(){const T=O(this.expr);return T===this.expr?this:g.create(T,this.negated)}evaluate(T){for(let M=0,m=this.expr.length;M<m;M++)if(!this.expr[M].evaluate(T))return!1;return!0}static _normalizeArr(T,M){const m=[];let v=!1;for(const H of T){if(!H)continue;if(H.type===1){v=!0;continue}if(H.type===0)return I.INSTANCE;if(H.type===6){m.push(...H.expr);continue}m.push(H)}if(m.length===0&&v)return E.INSTANCE;if(m.length===0)return;if(m.length===1)return m[0];m.sort(n);for(let H=1;H<m.length;H++)m[H-1].equals(m[H])&&(m.splice(H,1),H--);if(m.length===1)return m[0];for(;m.length>1;){const H=m[m.length-1];if(H.type!==9)break;m.pop();const X=m.pop(),q=m.length===0,re=_.create(H.expr.map(ye=>g.create([ye,X],null)),null,q);re&&(m.push(re),m.sort(n))}return m.length===1?m[0]:new g(m,M)}serialize(){return this.expr.map(T=>T.serialize()).join(" && ")}keys(){const T=[];for(let M of this.expr)T.push(...M.keys());return T}negate(){if(!this.negated){const T=[];for(let M of this.expr)T.push(M.negate());this.negated=_.create(T,this,!0)}return this.negated}}class _{constructor(T,M){this.expr=T,this.negated=M,this.type=9}static create(T,M,m){return _._normalizeArr(T,M,m)}cmp(T){if(T.type!==this.type)return this.type-T.type;if(this.expr.length<T.expr.length)return-1;if(this.expr.length>T.expr.length)return 1;for(let M=0,m=this.expr.length;M<m;M++){const v=n(this.expr[M],T.expr[M]);if(v!==0)return v}return 0}equals(T){if(T.type===this.type){if(this.expr.length!==T.expr.length)return!1;for(let M=0,m=this.expr.length;M<m;M++)if(!this.expr[M].equals(T.expr[M]))return!1;return!0}return!1}substituteConstants(){const T=O(this.expr);return T===this.expr?this:_.create(T,this.negated,!1)}evaluate(T){for(let M=0,m=this.expr.length;M<m;M++)if(this.expr[M].evaluate(T))return!0;return!1}static _normalizeArr(T,M,m){let v=[],H=!1;if(T){for(let X=0,q=T.length;X<q;X++){const re=T[X];if(!re)continue;if(re.type===0){H=!0;continue}if(re.type===1)return E.INSTANCE;if(re.type===9){v=v.concat(re.expr);continue}v.push(re)}if(v.length===0&&H)return I.INSTANCE;v.sort(n)}if(v.length===0)return;if(v.length===1)return v[0];for(let X=1;X<v.length;X++)v[X-1].equals(v[X])&&(v.splice(X,1),X--);if(v.length===1)return v[0];if(m){for(let X=0;X<v.length;X++)for(let q=X+1;q<v.length;q++)j(v[X],v[q])&&(v.splice(q,1),q--);if(v.length===1)return v[0]}return new _(v,M)}serialize(){return this.expr.map(T=>T.serialize()).join(" || ")}keys(){const T=[];for(let M of this.expr)T.push(...M.keys());return T}negate(){if(!this.negated){let T=[];for(let M of this.expr)T.push(M.negate());for(;T.length>1;){const M=T.shift(),m=T.shift(),v=[];for(const X of W(M))for(const q of W(m))v.push(g.create([X,q],null));const H=T.length===0;T.unshift(_.create(v,null,H))}this.negated=T[0]}return this.negated}}class h extends f{constructor(T,M,m){super(T,null);this._defaultValue=M,typeof m=="object"?h._info.push(Object.assign(Object.assign({},m),{key:T})):m!==!0&&h._info.push({key:T,description:m,type:M!=null?typeof M:void 0})}static all(){return h._info.values()}bindTo(T){return T.createKey(this.key,this._defaultValue)}getValue(T){return T.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(T){return b.create(this.key,T)}}h._info=[];const d=Object(N.c)("contextKeyService"),C="setContext";function x(T,M){return T<M?-1:T>M?1:0}function w(T,M,m,v){return T<m?-1:T>m?1:M<v?-1:M>v?1:0}function j(T,M){if(M.type===6&&T.type!==9&&T.type!==6){for(const H of M.expr)if(T.equals(H))return!0}const m=T.negate(),v=W(m).concat(W(M));v.sort(n);for(let H=0;H<v.length;H++){const X=v[H],q=X.negate();for(let re=H+1;re<v.length;re++){const ye=v[re];if(q.equals(ye))return!0}}return!1}function W(T){return T.type===9?T.expr:[T]}},TXwP:function(ct,ge,U){var te,Y;(function(){var N;(function(){"use strict";var P=[,,function(n){function I(b){this.__parent=b,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=[]}I.prototype.clone_empty=function(){var b=new I(this.__parent);return b.set_indent(this.__indent_count,this.__alignment_count),b},I.prototype.item=function(b){return b<0?this.__items[this.__items.length+b]:this.__items[b]},I.prototype.has_match=function(b){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(b))return!0;return!1},I.prototype.set_indent=function(b,c){this.is_empty()&&(this.__indent_count=b||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.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)},I.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},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var b=this.__parent.current_line;return b.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),b.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),b.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,b.__items[0]===" "&&(b.__items.splice(0,1),b.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(b){this.__items.push(b);var c=b.lastIndexOf(`
`);c!==-1?this.__character_count=b.length-c:this.__character_count+=b.length},I.prototype.pop=function(){var b=null;return this.is_empty()||(b=this.__items.pop(),this.__character_count-=b.length),b},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var b="";return this.is_empty()?this.__parent.indent_empty_lines&&(b=this.__parent.get_indent_string(this.__indent_count)):(b=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),b+=this.__items.join("")),b};function E(b,c){this.__cache=[""],this.__indent_size=b.indent_size,this.__indent_string=b.indent_char,b.indent_with_tabs||(this.__indent_string=new Array(b.indent_size+1).join(b.indent_char)),c=c||"",b.indent_level>0&&(c=new Array(b.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}E.prototype.get_indent_size=function(b,c){var a=this.__base_string_length;return c=c||0,b<0&&(a=0),a+=b*this.__indent_size,a+=c,a},E.prototype.get_indent_string=function(b,c){var a=this.__base_string;return c=c||0,b<0&&(b=0,a=""),c+=b*this.__indent_size,this.__ensure_cache(c),a+=this.__cache[c],a},E.prototype.__ensure_cache=function(b){for(;b>=this.__cache.length;)this.__add_column()},E.prototype.__add_column=function(){var b=this.__cache.length,c=0,a="";this.__indent_size&&b>=this.__indent_size&&(c=Math.floor(b/this.__indent_size),b-=c*this.__indent_size,a=new Array(c+1).join(this.__indent_string)),b&&(a+=new Array(b+1).join(" ")),this.__cache.push(a)};function f(b,c){this.__indent_cache=new E(b,c),this.raw=!1,this._end_with_newline=b.end_with_newline,this.indent_size=b.indent_size,this.wrap_line_length=b.wrap_line_length,this.indent_empty_lines=b.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(b,c){return this.__indent_cache.get_indent_string(b,c)},f.prototype.get_indent_size=function(b,c){return this.__indent_cache.get_indent_size(b,c)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(b){return this.is_empty()||!b&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(b){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return b!==`
`&&(a=a.replace(/[\n]/g,b)),a},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(b,c){return b=b||0,c=c||0,this.next_line.set_indent(b,c),this.__lines.length>1?(this.current_line.set_indent(b,c),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(b){for(var c=0;c<b.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(b.whitespace_before),this.current_line.push(b.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(b){this.__add_space_before_token(),this.current_line.push(b),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.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(" "))},f.prototype.remove_indent=function(b){for(var c=this.__lines.length;b<c;)this.__lines[b]._remove_indent(),b++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(b){for(b=b===void 0?!1:b,this.current_line.trim();b&&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},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(b,c){for(var a=this.__lines.length-2;a>=0;){var p=this.__lines[a];if(p.is_empty())break;if(p.item(0).indexOf(b)!==0&&p.item(-1)!==c){this.__lines.splice(a+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},n.exports.Output=f},,,,function(n){function I(b,c){this.raw_options=E(b,c),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"])}I.prototype._get_array=function(b,c){var a=this.raw_options[b],p=c||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(p=a.concat()):typeof a=="string"&&(p=a.split(/[^a-zA-Z0-9_\/\-]+/)),p},I.prototype._get_boolean=function(b,c){var a=this.raw_options[b],p=a===void 0?!!c:!!a;return p},I.prototype._get_characters=function(b,c){var a=this.raw_options[b],p=c||"";return typeof a=="string"&&(p=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),p},I.prototype._get_number=function(b,c){var a=this.raw_options[b];c=parseInt(c,10),isNaN(c)&&(c=0);var p=parseInt(a,10);return isNaN(p)&&(p=c),p},I.prototype._get_selection=function(b,c,a){var p=this._get_selection_list(b,c,a);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+b+`' can only be one of the following values:
`+c+`
You passed in: '`+this.raw_options[b]+"'");return p[0]},I.prototype._get_selection_list=function(b,c,a){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[c[0]],!this._is_valid_selection(a,c))throw new Error("Invalid Default Value!");var p=this._get_array(b,a);if(!this._is_valid_selection(p,c))throw new Error("Invalid Option Value: The option '"+b+`' can contain only the following values:
`+c+`
You passed in: '`+this.raw_options[b]+"'");return p},I.prototype._is_valid_selection=function(b,c){return b.length&&c.length&&!b.some(function(a){return c.indexOf(a)===-1})};function E(b,c){var a={};b=f(b);var p;for(p in b)p!==c&&(a[p]=b[p]);if(c&&b[c])for(p in b[c])a[p]=b[c][p];return a}function f(b){var c={},a;for(a in b){var p=a.replace(/-/g,"_");c[p]=b[a]}return c}n.exports.Options=I,n.exports.normalizeOpts=f,n.exports.mergeOpts=E},,function(n){var I=RegExp.prototype.hasOwnProperty("sticky");function E(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}E.prototype.restart=function(){this.__position=0},E.prototype.back=function(){this.__position>0&&(this.__position-=1)},E.prototype.hasNext=function(){return this.__position<this.__input_length},E.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},E.prototype.peek=function(f){var b=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(b=this.__input.charAt(f)),b},E.prototype.__match=function(f,b){f.lastIndex=b;var c=f.exec(this.__input);return c&&!(I&&f.sticky)&&(c.index!==b&&(c=null)),c},E.prototype.test=function(f,b){return b=b||0,b+=this.__position,b>=0&&b<this.__input_length?!!this.__match(f,b):!1},E.prototype.testChar=function(f,b){var c=this.peek(b);return f.lastIndex=0,c!==null&&f.test(c)},E.prototype.match=function(f){var b=this.__match(f,this.__position);return b?this.__position+=b[0].length:b=null,b},E.prototype.read=function(f,b,c){var a="",p;return f&&(p=this.match(f),p&&(a+=p[0])),b&&(p||!f)&&(a+=this.readUntil(b,c)),a},E.prototype.readUntil=function(f,b){var c="",a=this.__position;f.lastIndex=this.__position;var p=f.exec(this.__input);return p?(a=p.index,b&&(a+=p[0].length)):a=this.__input_length,c=this.__input.substring(this.__position,a),this.__position=a,c},E.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},E.prototype.get_regexp=function(f,b){var c=null,a="g";return b&&I&&(a="y"),typeof f=="string"&&f!==""?c=new RegExp(f,a):f&&(c=new RegExp(f.source,a)),c},E.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},E.prototype.peekUntilAfter=function(f){var b=this.__position,c=this.readUntilAfter(f);return this.__position=b,c},E.prototype.lookBack=function(f){var b=this.__position-1;return b>=f.length&&this.__input.substring(b-f.length,b).toLowerCase()===f},n.exports.InputScanner=E},,,,,function(n){function I(E,f){E=typeof E=="string"?E:E.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(E+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(E+/\sbeautify\signore:end\s/.source+f,"g")}I.prototype.get_directives=function(E){if(!E.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var b=this.__directive_pattern.exec(E);b;)f[b[1]]=b[2],b=this.__directive_pattern.exec(E);return f},I.prototype.readIgnored=function(E){return E.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=I},,function(n,I,E){var f=E(16).Beautifier,b=E(17).Options;function c(a,p){var l=new f(a,p);return l.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new b}},function(n,I,E){var f=E(17).Options,b=E(2).Output,c=E(8).InputScanner,a=E(13).Directives,p=new a(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,s=/\s/,i=/(?:\s|\n)+/g,D=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,A=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(R,O){this._source_text=R||"",this._options=new f(O),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}S.prototype.eatString=function(R){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(R.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return O},S.prototype.eatWhitespace=function(R){for(var O=s.test(this._input.peek()),g=0;s.test(this._input.peek());)this._ch=this._input.next(),R&&this._ch===`
`&&((g===0||g<this._options.max_preserve_newlines)&&(g++,this._output.add_new_line(!0)));return O},S.prototype.foundNestedPseudoClass=function(){for(var R=0,O=1,g=this._input.peek(O);g;){if(g==="{")return!0;if(g==="(")R+=1;else if(g===")"){if(R===0)return!1;R-=1}else if(g===";"||g==="}")return!1;O++,g=this._input.peek(O)}return!1},S.prototype.print_string=function(R){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(R)},S.prototype.preserveSingleSpace=function(R){R&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R=this._source_text,O=this._options.eol;O==="auto"&&(O=`
`,R&&l.test(R||"")&&(O=R.match(l)[0])),R=R.replace(u,`
`);var g=R.match(/^[\t ]*/)[0];this._output=new b(this._options,g),this._input=new c(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var _=0,h=!1,d=!1,C=!1,x=!1,w=!1,j=!1,W=this._ch,T=!1,M,m,v;M=this._input.read(i),m=M!=="",v=W,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),W=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var H=this._input.read(D),X=p.get_directives(H);X&&X.ignore==="start"&&(H+=p.readIgnored(this._input)),this.print_string(H),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(A)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(m),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var q=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);q.match(/[ :]$/)&&(q=this.eatString(": ").replace(/\s$/,""),this.print_string(q),this._output.space_before_token=!0),q=q.replace(/\s$/,""),q==="extend"?x=!0:q==="import"&&(w=!0),q in this.NESTED_AT_RULE?(this._nestedLevel+=1,q in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!h&&_===0&&q.indexOf(":")!==-1&&(d=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(m),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")d&&(d=!1,this.outdent()),C?(C=!1,h=this._indentLevel>=this._nestedLevel):h=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&h&&(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)):(v==="("?this._output.space_before_token=!1:v!==","&&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(),v==="{"&&this._output.trim(!0),w=!1,x=!1,d&&(this.outdent(),d=!1),this.print_string(this._ch),h=!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 re=0;re<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;re++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[re])){T=!0;break}(h||C)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!x&&_===0?(this.print_string(":"),d||(d=!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 ye=v==='"'||v==="'";this.preserveSingleSpace(ye||m),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")T=!1,_===0?(d&&(this.outdent(),d=!1),x=!1,w=!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(),_++,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(")")),_&&(_--,this.outdent()));else{var pe=!1;this._input.lookBack("with")&&(pe=!0),this.preserveSingleSpace(m||pe),this.print_string(this._ch),d&&v==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),j=!0):(this.eatWhitespace(),_++,this.indent())}else if(this._ch===")")_&&(_--,this.outdent()),j&&this._input.peek()===";"&&this._options.selector_separator_newline&&(j=!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&&(!d||j)&&_===0&&!w&&!x?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!d&&_===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&s.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(m),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),s.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var ue=v==='"'||v==="'";this.preserveSingleSpace(ue||m),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&T&&this._output.add_new_line()}var fe=this._output.get_code(O);return fe},n.exports.Beautifier=S},function(n,I,E){var f=E(6).Options;function b(c){f.call(this,c,"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 p=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<p.length;l++)p[l]!=="expand"?this.brace_style="collapse":this.brace_style=p[l]}b.prototype=new f,n.exports.Options=b}],F={};function G(n){var I=F[n];if(I!==void 0)return I.exports;var E=F[n]={exports:{}};return P[n](E,E.exports,G),E.exports}var K=G(15);N=K})();var z=N;!(te=[],Y=function(){return{css_beautify:z}}.apply(ge,te),Y!==void 0&&(ct.exports=Y))})()},Vhoy:function(ct,ge,U){"use strict";U.d(ge,"d",function(){return z}),U.d(ge,"e",function(){return P}),U.d(ge,"c",function(){return F}),U.d(ge,"b",function(){return G}),U.d(ge,"a",function(){return K});var te=U("MI8n");class Y{constructor(){this._icons=new Map,this._onDidRegister=new te.b}add(n){const I=this._icons.get(n.id);I?n.description?I.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 Y,z=N;function P(n,I){return new G(n,I)}function F(n){return n?n.replace(/\$\((.*?)\)/g,(I,E)=>` ${E} `).trim():""}class G{constructor(n,I,E){this.id=n,this.definition=I,this.description=E,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 K;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const I=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function E(c){if(c instanceof G)return["codicon","codicon-"+c.id];const a=I.exec(c.id);if(!a)return E(G.error);let[,p,l]=a;const u=["codicon","codicon-"+p];return l&&u.push("codicon-modifier-"+l.substr(1)),u}n.asClassNameArray=E;function f(c){return E(c).join(" ")}n.asClassName=f;function b(c){return"."+E(c).join(".")}n.asCSSSelector=b})(K||(K={})),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(ct,ge,U){(function(te,Y){ct.exports=Y()})(this,function(){"use strict";var te=navigator.userAgent,Y=navigator.platform,N=/gecko\/\d/i.test(te),z=/MSIE \d/.test(te),P=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(te),F=/Edge\/(\d+)/.exec(te),G=z||P||F,K=G&&(z?document.documentMode||6:+(F||P)[1]),n=!F&&/WebKit\//.test(te),I=n&&/Qt\/\d+\.\d+/.test(te),E=!F&&/Chrome\//.test(te),f=/Opera\//.test(te),b=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(te),a=/PhantomJS/.test(te),p=!F&&/AppleWebKit/.test(te)&&/Mobile\/\w+/.test(te),l=/Android/.test(te),u=p||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(te),s=p||/Mac/.test(Y),i=/\bCrOS\b/.test(te),D=/win/i.test(Y),A=f&&te.match(/Version\/(\d*\.\d*)/);A&&(A=Number(A[1])),A&&A>=15&&(f=!1,n=!0);var S=s&&(I||f&&(A==null||A<12.11)),R=N||G&&K>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var g=function(e,t){var o=e.className,r=O(t).exec(o);if(r){var y=o.slice(r.index+r[0].length);e.className=o.slice(0,r.index)+(y?r[1]+y:"")}};function _(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function h(e,t){return _(e).appendChild(t)}function d(e,t,o,r){var y=document.createElement(e);if(o&&(y.className=o),r&&(y.style.cssText=r),typeof t=="string")y.appendChild(document.createTextNode(t));else if(t)for(var B=0;B<t.length;++B)y.appendChild(t[B]);return y}function C(e,t,o,r){var y=d(e,t,o,r);return y.setAttribute("role","presentation"),y}var x;document.createRange?x=function(e,t,o,r){var y=document.createRange();return y.setEnd(r||e,o),y.setStart(e,t),y}:x=function(e,t,o){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(y){return r}return r.collapse(!0),r.moveEnd("character",o),r.moveStart("character",t),r};function w(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 j(){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 W(e,t){var o=e.className;O(t).test(o)||(e.className+=(o?" ":"")+t)}function T(e,t){for(var o=e.split(" "),r=0;r<o.length;r++)o[r]&&!O(o[r]).test(t)&&(t+=" "+o[r]);return t}var M=function(e){e.select()};p?M=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:G&&(M=function(e){try{e.select()}catch(t){}});function m(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function v(e,t,o){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(o!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function H(e,t,o,r,y){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var B=r||0,$=y||0;;){var J=e.indexOf(" ",B);if(J<0||J>=t)return $+(t-B);$+=J-B,$+=o-$%o,B=J+1}}var X=function(){this.id=null,this.f=null,this.time=0,this.handler=m(this.onTimeout,this)};X.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},X.prototype.set=function(e,t){this.f=t;var o=+new Date+e;(!this.id||o<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=o)};function q(e,t){for(var o=0;o<e.length;++o)if(e[o]==t)return o;return-1}var re=50,ye={toString:function(){return"CodeMirror.Pass"}},pe={scroll:!1},ue={origin:"*mouse"},fe={origin:"+move"};function be(e,t,o){for(var r=0,y=0;;){var B=e.indexOf(" ",r);B==-1&&(B=e.length);var $=B-r;if(B==e.length||y+$>=t)return r+Math.min($,t-y);if(y+=B-r,y+=o-y%o,r=B+1,y>=t)return r}}var se=[""];function ae(e){for(;se.length<=e;)se.push(Ce(se)+" ");return se[e]}function Ce(e){return e[e.length-1]}function ze(e,t){for(var o=[],r=0;r<e.length;r++)o[r]=t(e[r],r);return o}function Ye(e,t,o){for(var r=0,y=o(t);r<e.length&&o(e[r])<=y;)r++;e.splice(r,0,t)}function He(){}function Ve(e,t){var o;return Object.create?o=Object.create(e):(He.prototype=e,o=new He),t&&v(t,o),o}var Fe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ke(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Fe.test(e))}function nt(e,t){return t?t.source.indexOf("\\w")>-1&&Ke(e)?!0:t.test(e):Ke(e)}function de(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var De=/[\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 Ne(e){return e.charCodeAt(0)>=768&&De.test(e)}function Ue(e,t,o){for(;(o<0?t>0:t<e.length)&&Ne(e.charAt(t));)t+=o;return t}function rt(e,t,o){for(var r=t>o?-1:1;;){if(t==o)return t;var y=(t+o)/2,B=r<0?Math.ceil(y):Math.floor(y);if(B==t)return e(B)?t:o;e(B)?o=B:t=B+r}}function lt(e,t,o,r){if(!e)return r(t,o,"ltr",0);for(var y=!1,B=0;B<e.length;++B){var $=e[B];($.from<o&&$.to>t||t==o&&$.to==t)&&(r(Math.max($.from,t),Math.min($.to,o),$.level==1?"rtl":"ltr",B),y=!0)}y||r(t,o,"ltr")}var ft=null;function at(e,t,o){var r;ft=null;for(var y=0;y<e.length;++y){var B=e[y];if(B.from<t&&B.to>t)return y;B.to==t&&(B.from!=B.to&&o=="before"?r=y:ft=y),B.from==t&&(B.from!=B.to&&o!="before"?r=y:ft=y)}return r!=null?r:ft}var _t=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function o(oe){return oe<=247?e.charAt(oe):1424<=oe&&oe<=1524?"R":1536<=oe&&oe<=1785?t.charAt(oe-1536):1774<=oe&&oe<=2220?"r":8192<=oe&&oe<=8203?"w":oe==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,y=/[stwN]/,B=/[LRr]/,$=/[Lb1n]/,J=/[1n]/;function ee(oe,Oe,Ie){this.level=oe,this.from=Oe,this.to=Ie}return function(oe,Oe){var Ie=Oe=="ltr"?"L":"R";if(oe.length==0||Oe=="ltr"&&!r.test(oe))return!1;for(var Qe=oe.length,Xe=[],dt=0;dt<Qe;++dt)Xe.push(o(oe.charCodeAt(dt)));for(var bt=0,It=Ie;bt<Qe;++bt){var Ft=Xe[bt];Ft=="m"?Xe[bt]=It:It=Ft}for(var qt=0,Wt=Ie;qt<Qe;++qt){var on=Xe[qt];on=="1"&&Wt=="r"?Xe[qt]="n":B.test(on)&&(Wt=on,on=="r"&&(Xe[qt]="R"))}for(var In=1,bn=Xe[0];In<Qe-1;++In){var ar=Xe[In];ar=="+"&&bn=="1"&&Xe[In+1]=="1"?Xe[In]="1":ar==","&&bn==Xe[In+1]&&(bn=="1"||bn=="n")&&(Xe[In]=bn),bn=ar}for(var Fr=0;Fr<Qe;++Fr){var xi=Xe[Fr];if(xi==",")Xe[Fr]="N";else if(xi=="%"){var ei=void 0;for(ei=Fr+1;ei<Qe&&Xe[ei]=="%";++ei);for(var $i=Fr&&Xe[Fr-1]=="!"||ei<Qe&&Xe[ei]=="1"?"1":"N",Wi=Fr;Wi<ei;++Wi)Xe[Wi]=$i;Fr=ei-1}}for(var di=0,Hi=Ie;di<Qe;++di){var Si=Xe[di];Hi=="L"&&Si=="1"?Xe[di]="L":B.test(Si)&&(Hi=Si)}for(var gi=0;gi<Qe;++gi)if(y.test(Xe[gi])){var hi=void 0;for(hi=gi+1;hi<Qe&&y.test(Xe[hi]);++hi);for(var ri=(gi?Xe[gi-1]:Ie)=="L",Ki=(hi<Qe?Xe[hi]:Ie)=="L",Ro=ri==Ki?ri?"L":"R":Ie,Ya=gi;Ya<hi;++Ya)Xe[Ya]=Ro;gi=hi-1}for(var Li=[],wa,Ti=0;Ti<Qe;)if($.test(Xe[Ti])){var _s=Ti;for(++Ti;Ti<Qe&&$.test(Xe[Ti]);++Ti);Li.push(new ee(0,_s,Ti))}else{var Pa=Ti,oo=Li.length,so=Oe=="rtl"?1:0;for(++Ti;Ti<Qe&&Xe[Ti]!="L";++Ti);for(var Mi=Pa;Mi<Ti;)if(J.test(Xe[Mi])){Pa<Mi&&(Li.splice(oo,0,new ee(1,Pa,Mi)),oo+=so);var Do=Mi;for(++Mi;Mi<Ti&&J.test(Xe[Mi]);++Mi);Li.splice(oo,0,new ee(2,Do,Mi)),oo+=so,Pa=Mi}else++Mi;Pa<Ti&&Li.splice(oo,0,new ee(1,Pa,Ti))}return Oe=="ltr"&&(Li[0].level==1&&(wa=oe.match(/^\s+/))&&(Li[0].from=wa[0].length,Li.unshift(new ee(0,0,wa[0].length))),Ce(Li).level==1&&(wa=oe.match(/\s+$/))&&(Ce(Li).to-=wa[0].length,Li.push(new ee(0,Qe-wa[0].length,Qe)))),Oe=="rtl"?Li.reverse():Li}}();function gt(e,t){var o=e.order;return o==null&&(o=e.order=_t(e.text,t)),o}var xt=[],Ze=function(e,t,o){if(e.addEventListener)e.addEventListener(t,o,!1);else if(e.attachEvent)e.attachEvent("on"+t,o);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||xt).concat(o)}};function kt(e,t){return e._handlers&&e._handlers[t]||xt}function Ot(e,t,o){if(e.removeEventListener)e.removeEventListener(t,o,!1);else if(e.detachEvent)e.detachEvent("on"+t,o);else{var r=e._handlers,y=r&&r[t];if(y){var B=q(y,o);B>-1&&(r[t]=y.slice(0,B).concat(y.slice(B+1)))}}}function qe(e,t){var o=kt(e,t);if(!o.length)return;for(var r=Array.prototype.slice.call(arguments,2),y=0;y<o.length;++y)o[y].apply(null,r)}function st(e,t,o){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),qe(e,o||t.type,e,t),Te(t)||t.codemirrorIgnore}function xe(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var o=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)q(o,t[r])==-1&&o.push(t[r])}function we(e,t){return kt(e,t).length>0}function me(e){e.prototype.on=function(t,o){Ze(this,t,o)},e.prototype.off=function(t,o){Ot(this,t,o)}}function ce(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function he(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Te(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Re(e){ce(e),he(e)}function Me(e){return e.target||e.srcElement}function et(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var ht=function(){if(G&&K<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),Ut;function nn(e){if(Ut==null){var t=d("span","\u200B");h(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ut=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&K<8))}var o=Ut?d("span","\u200B"):d("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return o.setAttribute("cm-text",""),o}var en;function mn(e){if(en!=null)return en;var t=h(e,document.createTextNode("A\u062EA")),o=x(t,0,1).getBoundingClientRect(),r=x(t,1,2).getBoundingClientRect();return _(e),!o||o.left==o.right?!1:en=r.right-o.right<3}var En=`
b`.split(/\n/).length!=3?function(e){for(var t=0,o=[],r=e.length;t<=r;){var y=e.indexOf(`
`,t);y==-1&&(y=e.length);var B=e.slice(t,e.charAt(y-1)=="\r"?y-1:y),$=B.indexOf("\r");$!=-1?(o.push(B.slice(0,$)),t+=$+1):(o.push(B),t=y+1)}return o}:function(e){return e.split(/\r\n?|\n/)},$t=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(o){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},rr=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Dn=null;function Sr(e){if(Dn!=null)return Dn;var t=h(e,d("span","x")),o=t.getBoundingClientRect(),r=x(t,0,1).getBoundingClientRect();return Dn=Math.abs(o.left-r.left)>1}var br={},Pn={};function Dr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),br[e]=t}function Or(e,t){Pn[e]=t}function ln(e){if(typeof e=="string"&&Pn.hasOwnProperty(e))e=Pn[e];else if(e&&typeof e.name=="string"&&Pn.hasOwnProperty(e.name)){var t=Pn[e.name];typeof t=="string"&&(t={name:t}),e=Ve(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ln("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ln("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Yr(e,t){t=ln(t);var o=br[t.name];if(!o)return Yr(e,"text/plain");var r=o(e,t);if(tn.hasOwnProperty(t.name)){var y=tn[t.name];for(var B in y){if(!y.hasOwnProperty(B))continue;r.hasOwnProperty(B)&&(r["_"+B]=r[B]),r[B]=y[B]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var $ in t.modeProps)r[$]=t.modeProps[$];return r}var tn={};function sn(e,t){var o=tn.hasOwnProperty(e)?tn[e]:tn[e]={};v(t,o)}function Qn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var o={};for(var r in t){var y=t[r];y instanceof Array&&(y=y.concat([])),o[r]=y}return o}function sr(e,t){for(var o;e.innerMode&&!(o=e.innerMode(t),!o||o.mode==e);)t=o.state,e=o.mode;return o||{mode:e,state:t}}function Nr(e,t,o){return e.startState?e.startState(t,o):!0}var hn=function(e,t,o){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=o};hn.prototype.eol=function(){return this.pos>=this.string.length},hn.prototype.sol=function(){return this.pos==this.lineStart},hn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},hn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},hn.prototype.eat=function(e){var t=this.string.charAt(this.pos),o;if(typeof e=="string"?o=t==e:o=t&&(e.test?e.test(t):e(t)),o)return++this.pos,t},hn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},hn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},hn.prototype.skipToEnd=function(){this.pos=this.string.length},hn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},hn.prototype.backUp=function(e){this.pos-=e},hn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},hn.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},hn.prototype.match=function(e,t,o){if(typeof e=="string"){var r=function($){return o?$.toLowerCase():$},y=this.string.substr(this.pos,e.length);if(r(y)==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)}},hn.prototype.current=function(){return this.string.slice(this.start,this.pos)},hn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},hn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},hn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Qt(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 o=e;!o.lines;)for(var r=0;;++r){var y=o.children[r],B=y.chunkSize();if(t<B){o=y;break}t-=B}return o.lines[t]}function $r(e,t,o){var r=[],y=t.line;return e.iter(t.line,o.line+1,function(B){var $=B.text;y==o.line&&($=$.slice(0,o.ch)),y==t.line&&($=$.slice(t.ch)),r.push($),++y}),r}function fr(e,t,o){var r=[];return e.iter(t,o,function(y){r.push(y.text)}),r}function Lr(e,t){var o=t-e.height;if(o)for(var r=e;r;r=r.parent)r.height+=o}function kn(e){if(e.parent==null)return null;for(var t=e.parent,o=q(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var y=0;!(r.children[y]==t);++y)o+=r.children[y].chunkSize();return o+t.first}function Ur(e,t){var o=e.first;e:do{for(var r=0;r<e.children.length;++r){var y=e.children[r],B=y.height;if(t<B){e=y;continue e}t-=B,o+=y.chunkSize()}return o}while(!e.lines);for(var $=0;$<e.lines.length;++$){var J=e.lines[$],ee=J.height;if(t<ee)break;t-=ee}return o+$}function vi(e,t){return t>=e.first&&t<e.first+e.size}function Ai(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Et(e,t,o){if(o===void 0&&(o=null),!(this instanceof Et))return new Et(e,t,o);this.line=e,this.ch=t,this.sticky=o}function fn(e,t){return e.line-t.line||e.ch-t.ch}function Gi(e,t){return e.sticky==t.sticky&&fn(e,t)==0}function zi(e){return Et(e.line,e.ch)}function na(e,t){return fn(e,t)<0?t:e}function Vi(e,t){return fn(e,t)<0?e:t}function Z(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function L(e,t){if(t.line<e.first)return Et(e.first,0);var o=e.first+e.size-1;return t.line>o?Et(o,Qt(e,o).text.length):k(t,Qt(e,t.line).text.length)}function k(e,t){var o=e.ch;return o==null||o>t?Et(e.line,t):o<0?Et(e.line,0):e}function V(e,t){for(var o=[],r=0;r<t.length;r++)o[r]=L(e,t[r]);return o}var ne=function(e,t){this.state=e,this.lookAhead=t},Q=function(e,t,o,r){this.state=t,this.doc=e,this.line=o,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Q.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Q.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}},Q.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Q.fromSaved=function(e,t,o){return t instanceof ne?new Q(e,Qn(e.mode,t.state),o,t.lookAhead):new Q(e,Qn(e.mode,t),o)},Q.prototype.save=function(e){var t=e!==!1?Qn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ne(t,this.maxLookAhead):t};function Pe(e,t,o,r){var y=[e.state.modeGen],B={};mt(e,t.text,e.doc.mode,o,function(oe,Oe){return y.push(oe,Oe)},B,r);for(var $=o.state,J=function(oe){o.baseTokens=y;var Oe=e.state.overlays[oe],Ie=1,Qe=0;o.state=!0,mt(e,t.text,Oe.mode,o,function(Xe,dt){for(var bt=Ie;Qe<Xe;){var It=y[Ie];It>Xe&&y.splice(Ie,1,Xe,y[Ie+1],It),Ie+=2,Qe=Math.min(Xe,It)}if(!dt)return;if(Oe.opaque)y.splice(bt,Ie-bt,Xe,"overlay "+dt),Ie=bt+2;else for(;bt<Ie;bt+=2){var Ft=y[bt+1];y[bt+1]=(Ft?Ft+" ":"")+"overlay "+dt}},B),o.state=$,o.baseTokens=null,o.baseTokenPos=1},ee=0;ee<e.state.overlays.length;++ee)J(ee);return{styles:y,classes:B.bgClass||B.textClass?B:null}}function pt(e,t,o){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Lt(e,kn(t)),y=t.text.length>e.options.maxHighlightLength&&Qn(e.doc.mode,r.state),B=Pe(e,t,r);y&&(r.state=y),t.stateAfter=r.save(!y),t.styles=B.styles,B.classes?t.styleClasses=B.classes:t.styleClasses&&(t.styleClasses=null),o===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Lt(e,t,o){var r=e.doc,y=e.display;if(!r.mode.startState)return new Q(r,!0,t);var B=Pt(e,t,o),$=B>r.first&&Qt(r,B-1).stateAfter,J=$?Q.fromSaved(r,$,B):new Q(r,Nr(r.mode),B);return r.iter(B,t,function(ee){rn(e,ee.text,J);var oe=J.line;ee.stateAfter=oe==t-1||oe%5==0||oe>=y.viewFrom&&oe<y.viewTo?J.save():null,J.nextLine()}),o&&(r.modeFrontier=J.line),J}function rn(e,t,o,r){var y=e.doc.mode,B=new hn(t,e.options.tabSize,o);for(B.start=B.pos=r||0,t==""&&vt(y,o.state);!B.eol();)Gt(y,B,o.state),B.start=B.pos}function vt(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var o=sr(e,t);if(o.mode.blankLine)return o.mode.blankLine(o.state)}function Gt(e,t,o,r){for(var y=0;y<10;y++){r&&(r[0]=sr(e,o).mode);var B=e.token(t,o);if(t.pos>t.start)return B}throw new Error("Mode "+e.name+" failed to advance stream.")}var pr=function(e,t,o){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=o};function Ir(e,t,o,r){var y=e.doc,B=y.mode,$;t=L(y,t);var J=Qt(y,t.line),ee=Lt(e,t.line,o),oe=new hn(J.text,e.options.tabSize,ee),Oe;for(r&&(Oe=[]);(r||oe.pos<t.ch)&&!oe.eol();)oe.start=oe.pos,$=Gt(B,oe,ee.state),r&&Oe.push(new pr(oe,$,Qn(y.mode,ee.state)));return r?Oe:new pr(oe,$,ee.state)}function Zt(e,t){if(e)for(;;){var o=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!o)break;e=e.slice(0,o.index)+e.slice(o.index+o[0].length);var r=o[1]?"bgClass":"textClass";t[r]==null?t[r]=o[2]:new RegExp("(?:^|\\s)"+o[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+o[2])}return e}function mt(e,t,o,r,y,B,$){var J=o.flattenSpans;J==null&&(J=e.options.flattenSpans);var ee=0,oe=null,Oe=new hn(t,e.options.tabSize,r),Ie,Qe=e.options.addModeClass&&[null];for(t==""&&Zt(vt(o,r.state),B);!Oe.eol();){if(Oe.pos>e.options.maxHighlightLength?(J=!1,$&&rn(e,t,r,Oe.pos),Oe.pos=t.length,Ie=null):Ie=Zt(Gt(o,Oe,r.state,Qe),B),Qe){var Xe=Qe[0].name;Xe&&(Ie="m-"+(Ie?Xe+" "+Ie:Xe))}if(!J||oe!=Ie){for(;ee<Oe.start;)ee=Math.min(Oe.start,ee+5e3),y(ee,oe);oe=Ie}Oe.start=Oe.pos}for(;ee<Oe.pos;){var dt=Math.min(Oe.pos,ee+5e3);y(dt,oe),ee=dt}}function Pt(e,t,o){for(var r,y,B=e.doc,$=o?-1:t-(e.doc.mode.innerMode?1e3:100),J=t;J>$;--J){if(J<=B.first)return B.first;var ee=Qt(B,J-1),oe=ee.stateAfter;if(oe&&(!o||J+(oe instanceof ne?oe.lookAhead:0)<=B.modeFrontier))return J;var Oe=H(ee.text,null,e.options.tabSize);(y==null||r>Oe)&&(y=J-1,r=Oe)}return y}function Rt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var o=e.first,r=t-1;r>o;r--){var y=Qt(e,r).stateAfter;if(y&&(!(y instanceof ne)||r+y.lookAhead<t)){o=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,o)}var Ht=!1,un=!1;function xn(){Ht=!0}function Cn(){un=!0}function gn(e,t,o){this.marker=e,this.from=t,this.to=o}function Ln(e,t){if(e)for(var o=0;o<e.length;++o){var r=e[o];if(r.marker==t)return r}}function Kn(e,t){for(var o,r=0;r<e.length;++r)e[r]!=t&&(o||(o=[])).push(e[r]);return o}function dn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Sn(e,t,o){var r;if(e)for(var y=0;y<e.length;++y){var B=e[y],$=B.marker,J=B.from==null||($.inclusiveLeft?B.from<=t:B.from<t);if(J||B.from==t&&$.type=="bookmark"&&(!o||!B.marker.insertLeft)){var ee=B.to==null||($.inclusiveRight?B.to>=t:B.to>t);(r||(r=[])).push(new gn($,B.from,ee?null:B.to))}}return r}function hr(e,t,o){var r;if(e)for(var y=0;y<e.length;++y){var B=e[y],$=B.marker,J=B.to==null||($.inclusiveRight?B.to>=t:B.to>t);if(J||B.from==t&&$.type=="bookmark"&&(!o||B.marker.insertLeft)){var ee=B.from==null||($.inclusiveLeft?B.from<=t:B.from<t);(r||(r=[])).push(new gn($,ee?null:B.from-t,B.to==null?null:B.to-t))}}return r}function Nn(e,t){if(t.full)return null;var o=vi(e,t.from.line)&&Qt(e,t.from.line).markedSpans,r=vi(e,t.to.line)&&Qt(e,t.to.line).markedSpans;if(!o&&!r)return null;var y=t.from.ch,B=t.to.ch,$=fn(t.from,t.to)==0,J=Sn(o,y,$),ee=hr(r,B,$),oe=t.text.length==1,Oe=Ce(t.text).length+(oe?y:0);if(J)for(var Ie=0;Ie<J.length;++Ie){var Qe=J[Ie];if(Qe.to==null){var Xe=Ln(ee,Qe.marker);Xe?oe&&(Qe.to=Xe.to==null?null:Xe.to+Oe):Qe.to=y}}if(ee)for(var dt=0;dt<ee.length;++dt){var bt=ee[dt];if(bt.to!=null&&(bt.to+=Oe),bt.from==null){var It=Ln(J,bt.marker);It||(bt.from=Oe,oe&&(J||(J=[])).push(bt))}else bt.from+=Oe,oe&&(J||(J=[])).push(bt)}J&&(J=Kt(J)),ee&&ee!=J&&(ee=Kt(ee));var Ft=[J];if(!oe){var qt=t.text.length-2,Wt;if(qt>0&&J)for(var on=0;on<J.length;++on)J[on].to==null&&(Wt||(Wt=[])).push(new gn(J[on].marker,null,null));for(var In=0;In<qt;++In)Ft.push(Wt);Ft.push(ee)}return Ft}function Kt(e){for(var t=0;t<e.length;++t){var o=e[t];o.from!=null&&o.from==o.to&&o.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function An(e,t,o){var r=null;if(e.iter(t.line,o.line+1,function(Xe){if(Xe.markedSpans)for(var dt=0;dt<Xe.markedSpans.length;++dt){var bt=Xe.markedSpans[dt].marker;bt.readOnly&&(!r||q(r,bt)==-1)&&(r||(r=[])).push(bt)}}),!r)return null;for(var y=[{from:t,to:o}],B=0;B<r.length;++B)for(var $=r[B],J=$.find(0),ee=0;ee<y.length;++ee){var oe=y[ee];if(fn(oe.to,J.from)<0||fn(oe.from,J.to)>0)continue;var Oe=[ee,1],Ie=fn(oe.from,J.from),Qe=fn(oe.to,J.to);(Ie<0||!$.inclusiveLeft&&!Ie)&&Oe.push({from:oe.from,to:J.from}),(Qe>0||!$.inclusiveRight&&!Qe)&&Oe.push({from:J.to,to:oe.to}),y.splice.apply(y,Oe),ee+=Oe.length-3}return y}function lr(e){var t=e.markedSpans;if(!t)return;for(var o=0;o<t.length;++o)t[o].marker.detachLine(e);e.markedSpans=null}function Un(e,t){if(!t)return;for(var o=0;o<t.length;++o)t[o].marker.attachLine(e);e.markedSpans=t}function zt(e){return e.inclusiveLeft?-1:0}function jt(e){return e.inclusiveRight?1:0}function yn(e,t){var o=e.lines.length-t.lines.length;if(o!=0)return o;var r=e.find(),y=t.find(),B=fn(r.from,y.from)||zt(e)-zt(t);if(B)return-B;var $=fn(r.to,y.to)||jt(e)-jt(t);return $||t.id-e.id}function Ct(e,t){var o=un&&e.markedSpans,r;if(o)for(var y=void 0,B=0;B<o.length;++B)y=o[B],y.marker.collapsed&&(t?y.from:y.to)==null&&(!r||yn(r,y.marker)<0)&&(r=y.marker);return r}function Mt(e){return Ct(e,!0)}function Dt(e){return Ct(e,!1)}function ke(e,t){var o=un&&e.markedSpans,r;if(o)for(var y=0;y<o.length;++y){var B=o[y];B.marker.collapsed&&(B.from==null||B.from<t)&&(B.to==null||B.to>t)&&(!r||yn(r,B.marker)<0)&&(r=B.marker)}return r}function Vt(e,t,o,r,y){var B=Qt(e,t),$=un&&B.markedSpans;if($)for(var J=0;J<$.length;++J){var ee=$[J];if(!ee.marker.collapsed)continue;var oe=ee.marker.find(0),Oe=fn(oe.from,o)||zt(ee.marker)-zt(y),Ie=fn(oe.to,r)||jt(ee.marker)-jt(y);if(Oe>=0&&Ie<=0||Oe<=0&&Ie>=0)continue;if(Oe<=0&&(ee.marker.inclusiveRight&&y.inclusiveLeft?fn(oe.to,o)>=0:fn(oe.to,o)>0)||Oe>=0&&(ee.marker.inclusiveRight&&y.inclusiveLeft?fn(oe.from,r)<=0:fn(oe.from,r)<0))return!0}}function Tn(e){for(var t;t=Mt(e);)e=t.find(-1,!0).line;return e}function mr(e){for(var t;t=Dt(e);)e=t.find(1,!0).line;return e}function On(e){for(var t,o;t=Dt(e);)e=t.find(1,!0).line,(o||(o=[])).push(e);return o}function ii(e,t){var o=Qt(e,t),r=Tn(o);return o==r?t:kn(r)}function ai(e,t){if(t>e.lastLine())return t;var o=Qt(e,t),r;if(!Kr(e,o))return t;for(;r=Dt(o);)o=r.find(1,!0).line;return kn(o)+1}function Kr(e,t){var o=un&&t.markedSpans;if(o)for(var r=void 0,y=0;y<o.length;++y){if(r=o[y],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&jn(e,t,r))return!0}}function jn(e,t,o){if(o.to==null){var r=o.marker.find(1,!0);return jn(e,r.line,Ln(r.line.markedSpans,o.marker))}if(o.marker.inclusiveRight&&o.to==t.text.length)return!0;for(var y=void 0,B=0;B<t.markedSpans.length;++B)if(y=t.markedSpans[B],y.marker.collapsed&&!y.marker.widgetNode&&y.from==o.to&&(y.to==null||y.to!=o.from)&&(y.marker.inclusiveLeft||o.marker.inclusiveRight)&&jn(e,t,y))return!0}function Bt(e){e=Tn(e);for(var t=0,o=e.parent,r=0;r<o.lines.length;++r){var y=o.lines[r];if(y==e)break;t+=y.height}for(var B=o.parent;B;o=B,B=o.parent)for(var $=0;$<B.children.length;++$){var J=B.children[$];if(J==o)break;t+=J.height}return t}function Er(e){if(e.height==0)return 0;for(var t=e.text.length,o,r=e;o=Mt(r);){var y=o.find(0,!0);r=y.from.line,t+=y.from.ch-y.to.ch}for(r=e;o=Dt(r);){var B=o.find(0,!0);t-=r.text.length-B.from.ch,r=B.to.line,t+=r.text.length-B.to.ch}return t}function ur(e){var t=e.display,o=e.doc;t.maxLine=Qt(o,o.first),t.maxLineLength=Er(t.maxLine),t.maxLineChanged=!0,o.iter(function(r){var y=Er(r);y>t.maxLineLength&&(t.maxLineLength=y,t.maxLine=r)})}var Yn=function(e,t,o){this.text=e,Un(this,t),this.height=o?o(this):1};Yn.prototype.lineNo=function(){return kn(this)},me(Yn);function oi(e,t,o,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),lr(e),Un(e,o);var y=r?r(e):1;y!=e.height&&Lr(e,y)}function Xt(e){e.parent=null,lr(e)}var Jt={},Yt={};function pn(e,t){if(!e||/^\s*$/.test(e))return null;var o=t.addModeClass?Yt:Jt;return o[e]||(o[e]=e.replace(/\S+/g,"cm-$&"))}function Gn(e,t){var o=C("span",null,null,n?"padding-right: .1px":null),r={pre:C("pre",[o],"CodeMirror-line"),content:o,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var y=0;y<=(t.rest?t.rest.length:0);y++){var B=y?t.rest[y-1]:t.line,$=void 0;r.pos=0,r.addToken=qn,mn(e.display.measure)&&($=gt(B,e.doc.direction))&&(r.addToken=wi(r.addToken,$)),r.map=[];var J=t!=e.display.externalMeasured&&kn(B);Qi(B,r,pt(e,B,J)),B.styleClasses&&(B.styleClasses.bgClass&&(r.bgClass=T(B.styleClasses.bgClass,r.bgClass||"")),B.styleClasses.textClass&&(r.textClass=T(B.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(nn(e.display.measure))),y==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 ee=r.content.lastChild;(/\bcm-tab\b/.test(ee.className)||ee.querySelector&&ee.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return qe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=T(r.pre.className,r.textClass||"")),r}function Mn(e){var t=d("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function qn(e,t,o,r,y,B,$){if(!t)return;var J=e.splitSpaces?gr(t,e.trailingSpace):t,ee=e.cm.state.specialChars,oe=!1,Oe;if(!ee.test(t))e.col+=t.length,Oe=document.createTextNode(J),e.map.push(e.pos,e.pos+t.length,Oe),G&&K<9&&(oe=!0),e.pos+=t.length;else{Oe=document.createDocumentFragment();for(var Ie=0;;){ee.lastIndex=Ie;var Qe=ee.exec(t),Xe=Qe?Qe.index-Ie:t.length-Ie;if(Xe){var dt=document.createTextNode(J.slice(Ie,Ie+Xe));G&&K<9?Oe.appendChild(d("span",[dt])):Oe.appendChild(dt),e.map.push(e.pos,e.pos+Xe,dt),e.col+=Xe,e.pos+=Xe}if(!Qe)break;Ie+=Xe+1;var bt=void 0;if(Qe[0]==" "){var It=e.cm.options.tabSize,Ft=It-e.col%It;bt=Oe.appendChild(d("span",ae(Ft),"cm-tab")),bt.setAttribute("role","presentation"),bt.setAttribute("cm-text"," "),e.col+=Ft}else Qe[0]=="\r"||Qe[0]==`
`?(bt=Oe.appendChild(d("span",Qe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),bt.setAttribute("cm-text",Qe[0]),e.col+=1):(bt=e.cm.options.specialCharPlaceholder(Qe[0]),bt.setAttribute("cm-text",Qe[0]),G&&K<9?Oe.appendChild(d("span",[bt])):Oe.appendChild(bt),e.col+=1);e.map.push(e.pos,e.pos+1,bt),e.pos++}}if(e.trailingSpace=J.charCodeAt(t.length-1)==32,o||r||y||oe||B||$){var qt=o||"";r&&(qt+=r),y&&(qt+=y);var Wt=d("span",[Oe],qt,B);if($)for(var on in $)$.hasOwnProperty(on)&&on!="style"&&on!="class"&&Wt.setAttribute(on,$[on]);return e.content.appendChild(Wt)}e.content.appendChild(Oe)}function gr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var o=t,r="",y=0;y<e.length;y++){var B=e.charAt(y);B==" "&&o&&(y==e.length-1||e.charCodeAt(y+1)==32)&&(B="\xA0"),r+=B,o=B==" "}return r}function wi(e,t){return function(o,r,y,B,$,J,ee){y=y?y+" cm-force-border":"cm-force-border";for(var oe=o.pos,Oe=oe+r.length;;){for(var Ie=void 0,Qe=0;Qe<t.length&&!(Ie=t[Qe],Ie.to>oe&&Ie.from<=oe);Qe++);if(Ie.to>=Oe)return e(o,r,y,B,$,J,ee);e(o,r.slice(0,Ie.to-oe),y,B,null,J,ee),B=null,r=r.slice(Ie.to-oe),oe=Ie.to}}}function Zn(e,t,o,r){var y=!r&&o.widgetNode;y&&e.map.push(e.pos,e.pos+t,y),!r&&e.cm.display.input.needsContentAttribute&&(y||(y=e.content.appendChild(document.createElement("span"))),y.setAttribute("cm-marker",o.id)),y&&(e.cm.display.input.setUneditable(y),e.content.appendChild(y)),e.pos+=t,e.trailingSpace=!1}function Qi(e,t,o){var r=e.markedSpans,y=e.text,B=0;if(!r){for(var $=1;$<o.length;$+=2)t.addToken(t,y.slice(B,B=o[$]),pn(o[$+1],t.cm.options));return}for(var J=y.length,ee=0,oe=1,Oe="",Ie,Qe,Xe=0,dt,bt,It,Ft,qt;;){if(Xe==ee){dt=bt=It=Qe="",qt=null,Ft=null,Xe=Infinity;for(var Wt=[],on=void 0,In=0;In<r.length;++In){var bn=r[In],ar=bn.marker;if(ar.type=="bookmark"&&bn.from==ee&&ar.widgetNode)Wt.push(ar);else if(bn.from<=ee&&(bn.to==null||bn.to>ee||ar.collapsed&&bn.to==ee&&bn.from==ee)){if(bn.to!=null&&bn.to!=ee&&Xe>bn.to&&(Xe=bn.to,bt=""),ar.className&&(dt+=" "+ar.className),ar.css&&(Qe=(Qe?Qe+";":"")+ar.css),ar.startStyle&&bn.from==ee&&(It+=" "+ar.startStyle),ar.endStyle&&bn.to==Xe&&(on||(on=[])).push(ar.endStyle,bn.to),ar.title&&((qt||(qt={})).title=ar.title),ar.attributes)for(var Fr in ar.attributes)(qt||(qt={}))[Fr]=ar.attributes[Fr];ar.collapsed&&(!Ft||yn(Ft.marker,ar)<0)&&(Ft=bn)}else bn.from>ee&&Xe>bn.from&&(Xe=bn.from)}if(on)for(var xi=0;xi<on.length;xi+=2)on[xi+1]==Xe&&(bt+=" "+on[xi]);if(!Ft||Ft.from==ee)for(var ei=0;ei<Wt.length;++ei)Zn(t,0,Wt[ei]);if(Ft&&(Ft.from||0)==ee){if(Zn(t,(Ft.to==null?J+1:Ft.to)-ee,Ft.marker,Ft.from==null),Ft.to==null)return;Ft.to==ee&&(Ft=!1)}}if(ee>=J)break;for(var $i=Math.min(J,Xe);;){if(Oe){var Wi=ee+Oe.length;if(!Ft){var di=Wi>$i?Oe.slice(0,$i-ee):Oe;t.addToken(t,di,Ie?Ie+dt:dt,It,ee+di.length==Xe?bt:"",Qe,qt)}if(Wi>=$i){Oe=Oe.slice($i-ee),ee=$i;break}ee=Wi,It=""}Oe=y.slice(B,B=o[oe++]),Ie=pn(o[oe++],t.cm.options)}}}function vr(e,t,o){this.line=t,this.rest=On(t),this.size=this.rest?kn(Ce(this.rest))-o+1:1,this.node=this.text=null,this.hidden=Kr(e,t)}function fi(e,t,o){for(var r=[],y,B=t;B<o;B=y){var $=new vr(e.doc,Qt(e.doc,B),B);y=B+$.size,r.push($)}return r}var si=null;function Ni(e){si?si.ops.push(e):e.ownsGroup=si={ops:[e],delayedCallbacks:[]}}function ka(e){var t=e.delayedCallbacks,o=0;do{for(;o<t.length;o++)t[o].call(null);for(var r=0;r<e.ops.length;r++){var y=e.ops[r];if(y.cursorActivityHandlers)for(;y.cursorActivityCalled<y.cursorActivityHandlers.length;)y.cursorActivityHandlers[y.cursorActivityCalled++].call(null,y.cm)}}while(o<t.length)}function Lo(e,t){var o=e.ownsGroup;if(!o)return;try{ka(o)}finally{si=null,t(o)}}var ua=null;function Gr(e,t){var o=kt(e,t);if(!o.length)return;var r=Array.prototype.slice.call(arguments,2),y;si?y=si.delayedCallbacks:ua?y=ua:(y=ua=[],setTimeout(lo,0));for(var B=function(J){y.push(function(){return o[J].apply(null,r)})},$=0;$<o.length;++$)B($)}function lo(){var e=ua;ua=null;for(var t=0;t<e.length;++t)e[t]()}function uo(e,t,o,r){for(var y=0;y<t.changes.length;y++){var B=t.changes[y];B=="text"?co(e,t):B=="gutter"?Ca(e,t,o,r):B=="class"?Ma(e,t):B=="widget"&&ho(e,t,r)}t.changes=null}function va(e){return e.node==e.text&&(e.node=d("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),G&&K<8&&(e.node.style.zIndex=2)),e.node}function ya(e,t){var o=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(o&&(o+=" CodeMirror-linebackground"),t.background)o?t.background.className=o:(t.background.parentNode.removeChild(t.background),t.background=null);else if(o){var r=va(t);t.background=r.insertBefore(d("div",null,o),r.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var o=e.display.externalMeasured;return o&&o.line==t.line?(e.display.externalMeasured=null,t.measure=o.measure,o.built):Gn(e,t)}function co(e,t){var o=t.text.className,r=$a(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Ma(e,t)):o&&(t.text.className=o)}function Ma(e,t){ya(e,t),t.line.wrapClass?va(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var o=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=o||""}function Ca(e,t,o,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 y=va(t);t.gutterBackground=d("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),y.insertBefore(t.gutterBackground,t.text)}var B=t.line.gutterMarkers;if(e.options.lineNumbers||B){var $=va(t),J=t.gutter=d("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(J),$.insertBefore(J,t.text),t.line.gutterClass&&(J.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!B||!B["CodeMirror-linenumbers"])&&(t.lineNumber=J.appendChild(d("div",Ai(e.options,o),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),B)for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var oe=e.display.gutterSpecs[ee].className,Oe=B.hasOwnProperty(oe)&&B[oe];Oe&&J.appendChild(d("div",[Oe],"CodeMirror-gutter-elt","left: "+r.gutterLeft[oe]+"px; width: "+r.gutterWidth[oe]+"px"))}}}function ho(e,t,o){t.alignable&&(t.alignable=null);for(var r=O("CodeMirror-linewidget"),y=t.node.firstChild,B=void 0;y;y=B)B=y.nextSibling,r.test(y.className)&&t.node.removeChild(y);Na(e,t,o)}function fo(e,t,o,r){var y=$a(e,t);return t.text=t.node=y.pre,y.bgClass&&(t.bgClass=y.bgClass),y.textClass&&(t.textClass=y.textClass),Ma(e,t),Ca(e,t,o,r),Na(e,t,r),t.node}function Na(e,t,o){if(po(e,t.line,t,o,!0),t.rest)for(var r=0;r<t.rest.length;r++)po(e,t.rest[r],t,o,!1)}function po(e,t,o,r,y){if(!t.widgets)return;for(var B=va(o),$=0,J=t.widgets;$<J.length;++$){var ee=J[$],oe=d("div",[ee.node],"CodeMirror-linewidget"+(ee.className?" "+ee.className:""));ee.handleMouseEvents||oe.setAttribute("cm-ignore-events","true"),Qa(ee,oe,o,r),e.display.input.setUneditable(oe),y&&ee.above?B.insertBefore(oe,o.gutter||o.text):B.appendChild(oe),Gr(ee,"redraw")}}function Qa(e,t,o,r){if(e.noHScroll){(o.alignable||(o.alignable=[])).push(t);var y=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(y-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=y+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function _a(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!w(document.body,e.node)){var o="position: relative;";e.coverGutter&&(o+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(o+="width: "+t.display.wrapper.clientWidth+"px;"),h(t.display.measure,d("div",[e.node],null,o))}return e.height=e.node.parentNode.offsetHeight}function ra(e,t){for(var o=Me(t);o!=e.wrapper;o=o.parentNode)if(!o||o.nodeType==1&&o.getAttribute("cm-ignore-events")=="true"||o.parentNode==e.sizer&&o!=e.mover)return!0}function ba(e){return e.lineSpace.offsetTop}function Ee(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Le(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=h(e.measure,d("pre","x","CodeMirror-line-like")),o=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(o.paddingLeft),right:parseInt(o.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function We(e){return re-e.display.nativeBarWidth}function Se(e){return e.display.scroller.clientWidth-We(e)-e.display.barWidth}function ie(e){return e.display.scroller.clientHeight-We(e)-e.display.barHeight}function ve(e,t,o){var r=e.options.lineWrapping,y=r&&Se(e);if(!t.measure.heights||r&&t.measure.width!=y){var B=t.measure.heights=[];if(r){t.measure.width=y;for(var $=t.text.firstChild.getClientRects(),J=0;J<$.length-1;J++){var ee=$[J],oe=$[J+1];Math.abs(ee.bottom-oe.bottom)>2&&B.push((ee.bottom+oe.top)/2-o.top)}}B.push(o.bottom-o.top)}}function le(e,t,o){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 y=0;y<e.rest.length;y++)if(kn(e.rest[y])>o)return{map:e.measure.maps[y],cache:e.measure.caches[y],before:!0}}function Ae(e,t){t=Tn(t);var o=kn(t),r=e.display.externalMeasured=new vr(e.doc,t,o);r.lineN=o;var y=r.built=Gn(e,r);return r.text=y.pre,h(e.display.lineMeasure,y.pre),r}function _e(e,t,o,r){return Ge(e,je(e,t),o,r)}function Be(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Pr(e,t)];var o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size)return o}function je(e,t){var o=kn(t),r=Be(e,o);r&&!r.text?r=null:r&&r.changes&&(uo(e,r,o,Wr(e)),e.curOp.forceUpdate=!0),r||(r=Ae(e,t));var y=le(r,t,o);return{line:t,view:r,rect:null,map:y.map,cache:y.cache,before:y.before,hasHeights:!1}}function Ge(e,t,o,r,y){t.before&&(o=-1);var B=o+(r||""),$;return t.cache.hasOwnProperty(B)?$=t.cache[B]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ve(e,t.view,t.rect),t.hasHeights=!0),$=Nt(e,t,o,r),$.bogus||(t.cache[B]=$)),{left:$.left,right:$.right,top:y?$.rtop:$.top,bottom:y?$.rbottom:$.bottom}}var tt={left:0,right:0,top:0,bottom:0};function yt(e,t,o){for(var r,y,B,$,J,ee,oe=0;oe<e.length;oe+=3)if(J=e[oe],ee=e[oe+1],t<J?(y=0,B=1,$="left"):t<ee?(y=t-J,B=y+1):(oe==e.length-3||t==ee&&e[oe+3]>t)&&(B=ee-J,y=B-1,t>=ee&&($="right")),y!=null){if(r=e[oe+2],J==ee&&o==(r.insertLeft?"left":"right")&&($=o),o=="left"&&y==0)for(;oe&&e[oe-2]==e[oe-3]&&e[oe-1].insertLeft;)r=e[(oe-=3)+2],$="left";if(o=="right"&&y==ee-J)for(;oe<e.length-3&&e[oe+3]==e[oe+4]&&!e[oe+5].insertLeft;)r=e[(oe+=3)+2],$="right";break}return{node:r,start:y,end:B,collapse:$,coverStart:J,coverEnd:ee}}function Tt(e,t){var o=tt;if(t=="left")for(var r=0;r<e.length&&!((o=e[r]).left!=o.right);r++);else for(var y=e.length-1;y>=0&&!((o=e[y]).left!=o.right);y--);return o}function Nt(e,t,o,r){var y=yt(t.map,o,r),B=y.node,$=y.start,J=y.end,ee=y.collapse,oe;if(B.nodeType==3){for(var Oe=0;Oe<4;Oe++){for(;$&&Ne(t.line.text.charAt(y.coverStart+$));)--$;for(;y.coverStart+J<y.coverEnd&&Ne(t.line.text.charAt(y.coverStart+J));)++J;if(G&&K<9&&$==0&&J==y.coverEnd-y.coverStart?oe=B.parentNode.getBoundingClientRect():oe=Tt(x(B,$,J).getClientRects(),r),oe.left||oe.right||$==0)break;J=$,$=$-1,ee="right"}G&&K<11&&(oe=Rn(e.display.measure,oe))}else{$>0&&(ee=r="right");var Ie;e.options.lineWrapping&&(Ie=B.getClientRects()).length>1?oe=Ie[r=="right"?Ie.length-1:0]:oe=B.getBoundingClientRect()}if(G&&K<9&&!$&&(!oe||!oe.left&&!oe.right)){var Qe=B.parentNode.getClientRects()[0];Qe?oe={left:Qe.left,right:Qe.left+Qr(e.display),top:Qe.top,bottom:Qe.bottom}:oe=tt}for(var Xe=oe.top-t.rect.top,dt=oe.bottom-t.rect.top,bt=(Xe+dt)/2,It=t.view.measure.heights,Ft=0;Ft<It.length-1&&!(bt<It[Ft]);Ft++);var qt=Ft?It[Ft-1]:0,Wt=It[Ft],on={left:(ee=="right"?oe.right:oe.left)-t.rect.left,right:(ee=="left"?oe.left:oe.right)-t.rect.left,top:qt,bottom:Wt};return!oe.left&&!oe.right&&(on.bogus=!0),e.options.singleCursorHeightPerLine||(on.rtop=Xe,on.rbottom=dt),on}function Rn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Sr(e))return t;var o=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*o,right:t.right*o,top:t.top*r,bottom:t.bottom*r}}function $n(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 Bn(e){e.display.externalMeasure=null,_(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)$n(e.display.view[t])}function zn(e){Bn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Xn(){return E&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Vn(){return E&&l?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Fn(e){var t=0;if(e.widgets)for(var o=0;o<e.widgets.length;++o)e.widgets[o].above&&(t+=_a(e.widgets[o]));return t}function Jn(e,t,o,r,y){if(!y){var B=Fn(t);o.top+=B,o.bottom+=B}if(r=="line")return o;r||(r="local");var $=Bt(t);if(r=="local"?$+=ba(e.display):$-=e.display.viewOffset,r=="page"||r=="window"){var J=e.display.lineSpace.getBoundingClientRect();$+=J.top+(r=="window"?0:Vn());var ee=J.left+(r=="window"?0:Xn());o.left+=ee,o.right+=ee}return o.top+=$,o.bottom+=$,o}function er(e,t,o){if(o=="div")return t;var r=t.left,y=t.top;if(o=="page")r-=Xn(),y-=Vn();else if(o=="local"||!o){var B=e.display.sizer.getBoundingClientRect();r+=B.left,y+=B.top}var $=e.display.lineSpace.getBoundingClientRect();return{left:r-$.left,top:y-$.top}}function jr(e,t,o,r,y){return r||(r=Qt(e.doc,t.line)),Jn(e,r,_e(e,r,t.ch,y),o)}function tr(e,t,o,r,y,B){r=r||Qt(e.doc,t.line),y||(y=je(e,r));function $(dt,bt){var It=Ge(e,y,dt,bt?"right":"left",B);return bt?It.left=It.right:It.right=It.left,Jn(e,r,It,o)}var J=gt(r,e.doc.direction),ee=t.ch,oe=t.sticky;if(ee>=r.text.length?(ee=r.text.length,oe="before"):ee<=0&&(ee=0,oe="after"),!J)return $(oe=="before"?ee-1:ee,oe=="before");function Oe(dt,bt,It){var Ft=J[bt],qt=Ft.level==1;return $(It?dt-1:dt,qt!=It)}var Ie=at(J,ee,oe),Qe=ft,Xe=Oe(ee,Ie,oe=="before");return Qe!=null&&(Xe.other=Oe(ee,Qe,oe!="before")),Xe}function _n(e,t){var o=0;t=L(e.doc,t),e.options.lineWrapping||(o=Qr(e.display)*t.ch);var r=Qt(e.doc,t.line),y=Bt(r)+ba(e.display);return{left:o,right:o,top:y,bottom:y+r.height}}function vn(e,t,o,r,y){var B=Et(e,t,o);return B.xRel=y,r&&(B.outside=r),B}function Wn(e,t,o){var r=e.doc;if(o+=e.display.viewOffset,o<0)return vn(r.first,0,null,-1,-1);var y=Ur(r,o),B=r.first+r.size-1;if(y>B)return vn(r.first+r.size-1,Qt(r,B).text.length,null,1,1);t<0&&(t=0);for(var $=Qt(r,y);;){var J=Br(e,$,y,t,o),ee=ke($,J.ch+(J.xRel>0||J.outside>0?1:0));if(!ee)return J;var oe=ee.find(1);if(oe.line==y)return oe;$=Qt(r,y=oe.line)}}function cr(e,t,o,r){r-=Fn(t);var y=t.text.length,B=rt(function($){return Ge(e,o,$-1).bottom<=r},y,0);return y=rt(function($){return Ge(e,o,$).top>r},B,y),{begin:B,end:y}}function an(e,t,o,r){o||(o=je(e,t));var y=Jn(e,t,Ge(e,o,r),"line").top;return cr(e,t,o,y)}function dr(e,t,o,r){return e.bottom<=o?!1:e.top>o?!0:(r?e.left:e.right)>t}function Br(e,t,o,r,y){y-=Bt(t);var B=je(e,t),$=Fn(t),J=0,ee=t.text.length,oe=!0,Oe=gt(t,e.doc.direction);if(Oe){var Ie=(e.options.lineWrapping?Ar:ir)(e,t,o,B,Oe,r,y);oe=Ie.level!=1,J=oe?Ie.from:Ie.to-1,ee=oe?Ie.to:Ie.from-1}var Qe=null,Xe=null,dt=rt(function(In){var bn=Ge(e,B,In);return bn.top+=$,bn.bottom+=$,dr(bn,r,y,!1)?(bn.top<=y&&bn.left<=r&&(Qe=In,Xe=bn),!0):!1},J,ee),bt,It,Ft=!1;if(Xe){var qt=r-Xe.left<Xe.right-r,Wt=qt==oe;dt=Qe+(Wt?0:1),It=Wt?"after":"before",bt=qt?Xe.left:Xe.right}else{!oe&&(dt==ee||dt==J)&&dt++,It=dt==0?"after":dt==t.text.length?"before":Ge(e,B,dt-(oe?1:0)).bottom+$<=y==oe?"after":"before";var on=tr(e,Et(o,dt,It),"line",t,B);bt=on.left,Ft=y<on.top?-1:y>=on.bottom?1:0}return dt=Ue(t.text,dt,1),vn(o,dt,It,Ft,r-bt)}function ir(e,t,o,r,y,B,$){var J=rt(function(Ie){var Qe=y[Ie],Xe=Qe.level!=1;return dr(tr(e,Et(o,Xe?Qe.to:Qe.from,Xe?"before":"after"),"line",t,r),B,$,!0)},0,y.length-1),ee=y[J];if(J>0){var oe=ee.level!=1,Oe=tr(e,Et(o,oe?ee.from:ee.to,oe?"after":"before"),"line",t,r);dr(Oe,B,$,!0)&&Oe.top>$&&(ee=y[J-1])}return ee}function Ar(e,t,o,r,y,B,$){var J=cr(e,t,r,$),ee=J.begin,oe=J.end;/\s/.test(t.text.charAt(oe-1))&&oe--;for(var Oe=null,Ie=null,Qe=0;Qe<y.length;Qe++){var Xe=y[Qe];if(Xe.from>=oe||Xe.to<=ee)continue;var dt=Xe.level!=1,bt=Ge(e,r,dt?Math.min(oe,Xe.to)-1:Math.max(ee,Xe.from)).right,It=bt<B?B-bt+1e9:bt-B;(!Oe||Ie>It)&&(Oe=Xe,Ie=It)}return Oe||(Oe=y[y.length-1]),Oe.from<ee&&(Oe={from:ee,to:Oe.to,level:Oe.level}),Oe.to>oe&&(Oe={from:Oe.from,to:oe,level:Oe.level}),Oe}var xr;function zr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(xr==null){xr=d("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)xr.appendChild(document.createTextNode("x")),xr.appendChild(d("br"));xr.appendChild(document.createTextNode("x"))}h(e.measure,xr);var o=xr.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),_(e.measure),o||1}function Qr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=d("span","xxxxxxxxxx"),o=d("pre",[t],"CodeMirror-line-like");h(e.measure,o);var r=t.getBoundingClientRect(),y=(r.right-r.left)/10;return y>2&&(e.cachedCharWidth=y),y||10}function Wr(e){for(var t=e.display,o={},r={},y=t.gutters.clientLeft,B=t.gutters.firstChild,$=0;B;B=B.nextSibling,++$){var J=e.display.gutterSpecs[$].className;o[J]=B.offsetLeft+B.clientLeft+y,r[J]=B.clientWidth}return{fixedPos:yi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:o,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function yi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ii(e){var t=zr(e.display),o=e.options.lineWrapping,r=o&&Math.max(5,e.display.scroller.clientWidth/Qr(e.display)-3);return function(y){if(Kr(e.doc,y))return 0;var B=0;if(y.widgets)for(var $=0;$<y.widgets.length;$++)y.widgets[$].height&&(B+=y.widgets[$].height);return o?B+(Math.ceil(y.text.length/r)||1)*t:B+t}}function Ci(e){var t=e.doc,o=Ii(e);t.iter(function(r){var y=o(r);y!=r.height&&Lr(r,y)})}function Zr(e,t,o,r){var y=e.display;if(!o&&Me(t).getAttribute("cm-not-content")=="true")return null;var B,$,J=y.lineSpace.getBoundingClientRect();try{B=t.clientX-J.left,$=t.clientY-J.top}catch(Ie){return null}var ee=Wn(e,B,$),oe;if(r&&ee.xRel>0&&(oe=Qt(e.doc,ee.line).text).length==ee.ch){var Oe=H(oe,oe.length,e.options.tabSize)-oe.length;ee=Et(ee.line,Math.max(0,Math.round((B-Le(e.display).left)/Qr(e.display))-Oe))}return ee}function Pr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var o=e.display.view,r=0;r<o.length;r++)if(t-=o[r].size,t<0)return r}function Tr(e,t,o,r){t==null&&(t=e.doc.first),o==null&&(o=e.doc.first+e.doc.size),r||(r=0);var y=e.display;if(r&&o<y.viewTo&&(y.updateLineNumbers==null||y.updateLineNumbers>t)&&(y.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=y.viewTo)un&&ii(e.doc,t)<y.viewTo&&wr(e);else if(o<=y.viewFrom)un&&ai(e.doc,o+r)>y.viewFrom?wr(e):(y.viewFrom+=r,y.viewTo+=r);else if(t<=y.viewFrom&&o>=y.viewTo)wr(e);else if(t<=y.viewFrom){var B=Ui(e,o,o+r,1);B?(y.view=y.view.slice(B.index),y.viewFrom=B.lineN,y.viewTo+=r):wr(e)}else if(o>=y.viewTo){var $=Ui(e,t,t,-1);$?(y.view=y.view.slice(0,$.index),y.viewTo=$.lineN):wr(e)}else{var J=Ui(e,t,t,-1),ee=Ui(e,o,o+r,1);J&&ee?(y.view=y.view.slice(0,J.index).concat(fi(e,J.lineN,ee.lineN)).concat(y.view.slice(ee.index)),y.viewTo+=r):wr(e)}var oe=y.externalMeasured;oe&&(o<oe.lineN?oe.lineN+=r:t<oe.lineN+oe.size&&(y.externalMeasured=null))}function wn(e,t,o){e.curOp.viewChanged=!0;var r=e.display,y=e.display.externalMeasured;if(y&&t>=y.lineN&&t<y.lineN+y.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var B=r.view[Pr(e,t)];if(B.node==null)return;var $=B.changes||(B.changes=[]);q($,o)==-1&&$.push(o)}function wr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ui(e,t,o,r){var y=Pr(e,t),B,$=e.display.view;if(!un||o==e.doc.first+e.doc.size)return{index:y,lineN:o};for(var J=e.display.viewFrom,ee=0;ee<y;ee++)J+=$[ee].size;if(J!=t){if(r>0){if(y==$.length-1)return null;B=J+$[y].size-t,y++}else B=J-t;t+=B,o+=B}for(;ii(e.doc,o)!=o;){if(y==(r<0?0:$.length-1))return null;o+=r*$[y-(r<0?1:0)].size,y+=r}return{index:y,lineN:o}}function Zi(e,t,o){var r=e.display,y=r.view;y.length==0||t>=r.viewTo||o<=r.viewFrom?(r.view=fi(e,t,o),r.viewFrom=t):(r.viewFrom>t?r.view=fi(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Pr(e,t))),r.viewFrom=t,r.viewTo<o?r.view=r.view.concat(fi(e,r.viewTo,o)):r.viewTo>o&&(r.view=r.view.slice(0,Pr(e,o)))),r.viewTo=o}function ia(e){for(var t=e.display.view,o=0,r=0;r<t.length;r++){var y=t[r];!y.hidden&&(!y.node||y.changes)&&++o}return o}function Cr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Xi(e,t){t===void 0&&(t=!0);for(var o=e.doc,r={},y=r.cursors=document.createDocumentFragment(),B=r.selection=document.createDocumentFragment(),$=0;$<o.sel.ranges.length;$++){if(!t&&$==o.sel.primIndex)continue;var J=o.sel.ranges[$];if(J.from().line>=e.display.viewTo||J.to().line<e.display.viewFrom)continue;var ee=J.empty();(ee||e.options.showCursorWhenSelecting)&&Ji(e,J.head,y),ee||yr(e,J,B)}return r}function Ji(e,t,o){var r=tr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),y=o.appendChild(d("div","\xA0","CodeMirror-cursor"));if(y.style.left=r.left+"px",y.style.top=r.top+"px",y.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var B=o.appendChild(d("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 Rr(e,t){return e.top-t.top||e.left-t.left}function yr(e,t,o){var r=e.display,y=e.doc,B=document.createDocumentFragment(),$=Le(e.display),J=$.left,ee=Math.max(r.sizerWidth,Se(e)-r.sizer.offsetLeft)-$.right,oe=y.direction=="ltr";function Oe(Wt,on,In,bn){on<0&&(on=0),on=Math.round(on),bn=Math.round(bn),B.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+Wt+`px;
top: `+on+"px; width: "+(In==null?ee-Wt:In)+`px;
height: `+(bn-on)+"px"))}function Ie(Wt,on,In){var bn=Qt(y,Wt),ar=bn.text.length,Fr,xi;function ei(di,Hi){return jr(e,Et(Wt,di),"div",bn,Hi)}function $i(di,Hi,Si){var gi=an(e,bn,null,di),hi=Hi=="ltr"==(Si=="after")?"left":"right",ri=Si=="after"?gi.begin:gi.end-(/\s/.test(bn.text.charAt(gi.end-1))?2:1);return ei(ri,hi)[hi]}var Wi=gt(bn,y.direction);return lt(Wi,on||0,In==null?ar:In,function(di,Hi,Si,gi){var hi=Si=="ltr",ri=ei(di,hi?"left":"right"),Ki=ei(Hi-1,hi?"right":"left"),Ro=on==null&&di==0,Ya=In==null&&Hi==ar,Li=gi==0,wa=!Wi||gi==Wi.length-1;if(Ki.top-ri.top<=3){var Ti=(oe?Ro:Ya)&&Li,_s=(oe?Ya:Ro)&&wa,Pa=Ti?J:(hi?ri:Ki).left,oo=_s?ee:(hi?Ki:ri).right;Oe(Pa,ri.top,oo-Pa,ri.bottom)}else{var so,Mi,Do,bs;hi?(so=oe&&Ro&&Li?J:ri.left,Mi=oe?ee:$i(di,Si,"before"),Do=oe?J:$i(Hi,Si,"after"),bs=oe&&Ya&&wa?ee:Ki.right):(so=oe?$i(di,Si,"before"):J,Mi=!oe&&Ro&&Li?ee:ri.right,Do=!oe&&Ya&&wa?J:Ki.left,bs=oe?$i(Hi,Si,"after"):ee),Oe(so,ri.top,Mi-so,ri.bottom),ri.bottom<Ki.top&&Oe(J,ri.bottom,null,Ki.top),Oe(Do,Ki.top,bs-Do,Ki.bottom)}(!Fr||Rr(ri,Fr)<0)&&(Fr=ri),Rr(Ki,Fr)<0&&(Fr=Ki),(!xi||Rr(ri,xi)<0)&&(xi=ri),Rr(Ki,xi)<0&&(xi=Ki)}),{start:Fr,end:xi}}var Qe=t.from(),Xe=t.to();if(Qe.line==Xe.line)Ie(Qe.line,Qe.ch,Xe.ch);else{var dt=Qt(y,Qe.line),bt=Qt(y,Xe.line),It=Tn(dt)==Tn(bt),Ft=Ie(Qe.line,Qe.ch,It?dt.text.length+1:null).end,qt=Ie(Xe.line,It?0:null,Xe.ch).start;It&&(Ft.top<qt.top-2?(Oe(Ft.right,Ft.top,null,Ft.bottom),Oe(J,qt.top,qt.left,qt.bottom)):Oe(Ft.right,Ft.top,qt.left-Ft.right,Ft.bottom)),Ft.bottom<qt.top&&Oe(J,Ft.bottom,null,qt.top)}o.appendChild(B)}function Hr(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var o=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ea(e),t.cursorDiv.style.visibility=(o=!o)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ua(e){e.state.focused||(e.display.input.focus(),ca(e))}function Za(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ea(e))},100)}function ca(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(qe(e,"focus",e,t),e.state.focused=!0,W(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()),Hr(e)}function Ea(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(qe(e,"blur",e,t),e.state.focused=!1,g(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function ti(e){for(var t=e.display,o=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var y=t.view[r],B=e.options.lineWrapping,$=void 0,J=0;if(y.hidden)continue;if(G&&K<8){var ee=y.node.offsetTop+y.node.offsetHeight;$=ee-o,o=ee}else{var oe=y.node.getBoundingClientRect();$=oe.bottom-oe.top,!B&&y.text.firstChild&&(J=y.text.firstChild.getBoundingClientRect().right-oe.left-1)}var Oe=y.line.height-$;if((Oe>.005||Oe<-.005)&&(Lr(y.line,$),Yi(y.line),y.rest))for(var Ie=0;Ie<y.rest.length;Ie++)Yi(y.rest[Ie]);if(J>e.display.sizerWidth){var Qe=Math.ceil(J/Qr(e.display));Qe>e.display.maxLineLength&&(e.display.maxLineLength=Qe,e.display.maxLine=y.line,e.display.maxLineChanged=!0)}}}function Yi(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var o=e.widgets[t],r=o.node.parentNode;r&&(o.height=r.offsetHeight)}}function ja(e,t,o){var r=o&&o.top!=null?Math.max(0,o.top):e.scroller.scrollTop;r=Math.floor(r-ba(e));var y=o&&o.bottom!=null?o.bottom:r+e.wrapper.clientHeight,B=Ur(t,r),$=Ur(t,y);if(o&&o.ensure){var J=o.ensure.from.line,ee=o.ensure.to.line;J<B?(B=J,$=Ur(t,Bt(Qt(t,J))+e.wrapper.clientHeight)):Math.min(ee,t.lastLine())>=$&&(B=Ur(t,Bt(Qt(t,ee))-e.wrapper.clientHeight),$=ee)}return{from:B,to:Math.max($,B+1)}}function Io(e,t){if(st(e,"scrollCursorIntoView"))return;var o=e.display,r=o.sizer.getBoundingClientRect(),y=null;if(t.top+r.top<0?y=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(y=!1),y!=null&&!a){var B=d("div","\u200B",null,`position: absolute;
top: `+(t.top-o.viewOffset-ba(e.display))+`px;
height: `+(t.bottom-t.top+We(e)+o.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(B),B.scrollIntoView(y),e.display.lineSpace.removeChild(B)}}function Po(e,t,o,r){r==null&&(r=0);var y;!e.options.lineWrapping&&t==o&&(t=t.ch?Et(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,o=t.sticky=="before"?Et(t.line,t.ch+1,"before"):t);for(var B=0;B<5;B++){var $=!1,J=tr(e,t),ee=!o||o==t?J:tr(e,o);y={left:Math.min(J.left,ee.left),top:Math.min(J.top,ee.top)-r,right:Math.max(J.left,ee.left),bottom:Math.max(J.bottom,ee.bottom)+r};var oe=Ja(e,y),Oe=e.doc.scrollTop,Ie=e.doc.scrollLeft;if(oe.scrollTop!=null&&(ha(e,oe.scrollTop),Math.abs(e.doc.scrollTop-Oe)>1&&($=!0)),oe.scrollLeft!=null&&(Pi(e,oe.scrollLeft),Math.abs(e.doc.scrollLeft-Ie)>1&&($=!0)),!$)break}return y}function mo(e,t){var o=Ja(e,t);o.scrollTop!=null&&ha(e,o.scrollTop),o.scrollLeft!=null&&Pi(e,o.scrollLeft)}function Ja(e,t){var o=e.display,r=zr(e.display);t.top<0&&(t.top=0);var y=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:o.scroller.scrollTop,B=ie(e),$={};t.bottom-t.top>B&&(t.bottom=t.top+B);var J=e.doc.height+Ee(o),ee=t.top<r,oe=t.bottom>J-r;if(t.top<y)$.scrollTop=ee?0:t.top;else if(t.bottom>y+B){var Oe=Math.min(t.top,(oe?J:t.bottom)-B);Oe!=y&&($.scrollTop=Oe)}var Ie=e.options.fixedGutter?0:o.gutters.offsetWidth,Qe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:o.scroller.scrollLeft-Ie,Xe=Se(e)-o.gutters.offsetWidth,dt=t.right-t.left>Xe;return dt&&(t.right=t.left+Xe),t.left<10?$.scrollLeft=0:t.left<Qe?$.scrollLeft=Math.max(0,t.left+Ie-(dt?0:10)):t.right>Xe+Qe-3&&($.scrollLeft=t.right+(dt?0:10)-Xe),$}function qa(e,t){if(t==null)return;Ba(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function da(e){Ba(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function xa(e,t,o){(t!=null||o!=null)&&Ba(e),t!=null&&(e.curOp.scrollLeft=t),o!=null&&(e.curOp.scrollTop=o)}function go(e,t){Ba(e),e.curOp.scrollToPos=t}function Ba(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var o=_n(e,t.from),r=_n(e,t.to);Ta(e,o,r,t.margin)}}function Ta(e,t,o,r){var y=Ja(e,{left:Math.min(t.left,o.left),top:Math.min(t.top,o.top)-r,right:Math.max(t.right,o.right),bottom:Math.max(t.bottom,o.bottom)+r});xa(e,y.scrollLeft,y.scrollTop)}function ha(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;N||Oa(e,{top:t}),kr(e,t,!0),N&&Oa(e),Aa(e,100)}function kr(e,t,o){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!o)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Pi(e,t,o,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(o?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,or(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function fa(e){var t=e.display,o=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ee(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?o:0,docHeight:r,scrollHeight:r+We(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:o}}var aa=function(e,t,o){this.cm=o;var r=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),y=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=y.tabIndex=-1,e(r),e(y),Ze(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ze(y,"scroll",function(){y.clientWidth&&t(y.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&K<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};aa.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,o=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(o){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var y=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+y)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=o?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var B=e.viewWidth-e.barLeft-(o?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:o?r:0,bottom:t?r:0}},aa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},aa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},aa.prototype.zeroWidthHack=function(){var e=s&&!c?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new X,this.disableVert=new X},aa.prototype.enableZeroWidthBar=function(e,t,o){e.style.pointerEvents="auto";function r(){var y=e.getBoundingClientRect(),B=o=="vert"?document.elementFromPoint(y.right-1,(y.top+y.bottom)/2):document.elementFromPoint((y.right+y.left)/2,y.bottom-1);B!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},aa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sa=function(){};Sa.prototype.update=function(){return{bottom:0,right:0}},Sa.prototype.setScrollLeft=function(){},Sa.prototype.setScrollTop=function(){},Sa.prototype.clear=function(){};function pa(e,t){t||(t=fa(e));var o=e.display.barWidth,r=e.display.barHeight;Fa(e,t);for(var y=0;y<4&&o!=e.display.barWidth||r!=e.display.barHeight;y++)o!=e.display.barWidth&&e.options.lineWrapping&&ti(e),Fa(e,fa(e)),o=e.display.barWidth,r=e.display.barHeight}function Fa(e,t){var o=e.display,r=o.scrollbars.update(t);o.sizer.style.paddingRight=(o.barWidth=r.right)+"px",o.sizer.style.paddingBottom=(o.barHeight=r.bottom)+"px",o.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(o.scrollbarFiller.style.display="block",o.scrollbarFiller.style.height=r.bottom+"px",o.scrollbarFiller.style.width=r.right+"px"):o.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(o.gutterFiller.style.display="block",o.gutterFiller.style.height=r.bottom+"px",o.gutterFiller.style.width=t.gutterWidth+"px"):o.gutterFiller.style.display=""}var eo={native:aa,null:Sa};function Wa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&g(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new eo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ze(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,o){o=="horizontal"?Pi(e,t):ha(e,t)},e),e.display.scrollbars.addClass&&W(e.display.wrapper,e.display.scrollbars.addClass)}var to=0;function qi(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:++to},Ni(e.curOp)}function oa(e){var t=e.curOp;t&&Lo(t,function(o){for(var r=0;r<o.ops.length;r++)o.ops[r].cm.curOp=null;no(o)})}function no(e){for(var t=e.ops,o=0;o<t.length;o++)ro(t[o]);for(var r=0;r<t.length;r++)ko(t[r]);for(var y=0;y<t.length;y++)Mo(t[y]);for(var B=0;B<t.length;B++)io(t[B]);for(var $=0;$<t.length;$++)No(t[$])}function ro(e){var t=e.cm,o=t.display;ao(t),e.updateMaxLine&&ur(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<o.viewFrom||e.scrollToPos.to.line>=o.viewTo)||o.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ki(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ko(e){e.updatedDisplay=e.mustUpdate&&ma(e.cm,e.update)}function Mo(e){var t=e.cm,o=t.display;e.updatedDisplay&&ti(t),e.barMeasure=fa(t),o.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=_e(t,o.maxLine,o.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(o.scroller.clientWidth,o.sizer.offsetLeft+e.adjustWidthTo+We(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,o.sizer.offsetLeft+e.adjustWidthTo-Se(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=o.input.prepareSelection())}function io(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Pi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var o=e.focus&&e.focus==j();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,o),(e.updatedDisplay||e.startHeight!=t.doc.height)&&pa(t,e.barMeasure),e.updatedDisplay&&_r(t,e.barMeasure),e.selectionChanged&&Hr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),o&&Ua(e.cm)}function No(e){var t=e.cm,o=t.display,r=t.doc;if(e.updatedDisplay&&Ga(t,e.update),o.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(o.wheelStartX=o.wheelStartY=null),e.scrollTop!=null&&kr(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Pi(t,e.scrollLeft,!0,!0),e.scrollToPos){var y=Po(t,L(r,e.scrollToPos.from),L(r,e.scrollToPos.to),e.scrollToPos.margin);Io(t,y)}var B=e.maybeHiddenMarkers,$=e.maybeUnhiddenMarkers;if(B)for(var J=0;J<B.length;++J)B[J].lines.length||qe(B[J],"hide");if($)for(var ee=0;ee<$.length;++ee)$[ee].lines.length&&qe($[ee],"unhide");o.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&qe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ni(e,t){if(e.curOp)return t();qi(e);try{return t()}finally{oa(e)}}function Jr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);qi(e);try{return t.apply(e,arguments)}finally{oa(e)}}}function pi(e){return function(){if(this.curOp)return e.apply(this,arguments);qi(this);try{return e.apply(this,arguments)}finally{oa(this)}}}function qr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);qi(t);try{return e.apply(this,arguments)}finally{oa(t)}}}function Aa(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,m(Ha,e))}function Ha(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var o=+new Date+e.options.workTime,r=Lt(e,t.highlightFrontier),y=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(B){if(r.line>=e.display.viewFrom){var $=B.styles,J=B.text.length>e.options.maxHighlightLength?Qn(t.mode,r.state):null,ee=Pe(e,B,r,!0);J&&(r.state=J),B.styles=ee.styles;var oe=B.styleClasses,Oe=ee.classes;Oe?B.styleClasses=Oe:oe&&(B.styleClasses=null);for(var Ie=!$||$.length!=B.styles.length||oe!=Oe&&(!oe||!Oe||oe.bgClass!=Oe.bgClass||oe.textClass!=Oe.textClass),Qe=0;!Ie&&Qe<$.length;++Qe)Ie=$[Qe]!=B.styles[Qe];Ie&&y.push(r.line),B.stateAfter=r.save(),r.nextLine()}else B.text.length<=e.options.maxHighlightLength&&rn(e,B.text,r),B.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>o)return Aa(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),y.length&&ni(e,function(){for(var B=0;B<y.length;B++)wn(e,y[B],"text")})}var ki=function(e,t,o){var r=e.display;this.viewport=t,this.visible=ja(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Se(e),this.force=o,this.dims=Wr(e),this.events=[]};ki.prototype.signal=function(e,t){we(e,t)&&this.events.push(arguments)},ki.prototype.finish=function(){for(var e=0;e<this.events.length;e++)qe.apply(null,this.events[e])};function ao(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=We(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=We(e)+"px",t.scrollbarsClipped=!0)}function Ka(e){if(e.hasFocus())return null;var t=j();if(!t||!w(e.display.lineDiv,t))return null;var o={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&w(e.display.lineDiv,r.anchorNode)&&(o.anchorNode=r.anchorNode,o.anchorOffset=r.anchorOffset,o.focusNode=r.focusNode,o.focusOffset=r.focusOffset)}return o}function vo(e){if(!e||!e.activeElt||e.activeElt==j())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&w(document.body,e.anchorNode)&&w(document.body,e.focusNode)){var t=window.getSelection(),o=document.createRange();o.setEnd(e.anchorNode,e.anchorOffset),o.collapse(!1),t.removeAllRanges(),t.addRange(o),t.extend(e.focusNode,e.focusOffset)}}function ma(e,t){var o=e.display,r=e.doc;if(t.editorIsHidden)return wr(e),!1;if(!t.force&&t.visible.from>=o.viewFrom&&t.visible.to<=o.viewTo&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo)&&o.renderedView==o.view&&ia(e)==0)return!1;ci(e)&&(wr(e),t.dims=Wr(e));var y=r.first+r.size,B=Math.max(t.visible.from-e.options.viewportMargin,r.first),$=Math.min(y,t.visible.to+e.options.viewportMargin);o.viewFrom<B&&B-o.viewFrom<20&&(B=Math.max(r.first,o.viewFrom)),o.viewTo>$&&o.viewTo-$<20&&($=Math.min(y,o.viewTo)),un&&(B=ii(e.doc,B),$=ai(e.doc,$));var J=B!=o.viewFrom||$!=o.viewTo||o.lastWrapHeight!=t.wrapperHeight||o.lastWrapWidth!=t.wrapperWidth;Zi(e,B,$),o.viewOffset=Bt(Qt(e.doc,o.viewFrom)),e.display.mover.style.top=o.viewOffset+"px";var ee=ia(e);if(!J&&ee==0&&!t.force&&o.renderedView==o.view&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo))return!1;var oe=Ka(e);return ee>4&&(o.lineDiv.style.display="none"),yo(e,o.updateLineNumbers,t.dims),ee>4&&(o.lineDiv.style.display=""),o.renderedView=o.view,vo(oe),_(o.cursorDiv),_(o.selectionDiv),o.gutters.style.height=o.sizer.style.minHeight=0,J&&(o.lastWrapHeight=t.wrapperHeight,o.lastWrapWidth=t.wrapperWidth,Aa(e,400)),o.updateLineNumbers=null,!0}function Ga(e,t){for(var o=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Se(e)){if(o&&o.top!=null&&(o={top:Math.min(e.doc.height+Ee(e.display)-ie(e),o.top)}),t.visible=ja(e.display,e.doc,o),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ja(e.display,e.doc,o));if(!ma(e,t))break;ti(e);var y=fa(e);Cr(e),pa(e,y),_r(e,y),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 Oa(e,t){var o=new ki(e,t);if(ma(e,o)){ti(e),Ga(e,o);var r=fa(e);Cr(e),pa(e,r),_r(e,r),o.finish()}}function yo(e,t,o){var r=e.display,y=e.options.lineNumbers,B=r.lineDiv,$=B.firstChild;function J(dt){var bt=dt.nextSibling;return n&&s&&e.display.currentWheelTarget==dt?dt.style.display="none":dt.parentNode.removeChild(dt),bt}for(var ee=r.view,oe=r.viewFrom,Oe=0;Oe<ee.length;Oe++){var Ie=ee[Oe];if(!Ie.hidden)if(!Ie.node||Ie.node.parentNode!=B){var Qe=fo(e,Ie,oe,o);B.insertBefore(Qe,$)}else{for(;$!=Ie.node;)$=J($);var Xe=y&&t!=null&&t<=oe&&Ie.lineNumber;Ie.changes&&(q(Ie.changes,"gutter")>-1&&(Xe=!1),uo(e,Ie,oe,o)),Xe&&(_(Ie.lineNumber),Ie.lineNumber.appendChild(document.createTextNode(Ai(e.options,oe)))),$=Ie.node.nextSibling}oe+=Ie.size}for(;$;)$=J($)}function za(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function _r(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+We(e)+"px"}function or(e){var t=e.display,o=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=yi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,y=t.gutters.offsetWidth,B=r+"px",$=0;$<o.length;$++)if(!o[$].hidden){e.options.fixedGutter&&(o[$].gutter&&(o[$].gutter.style.left=B),o[$].gutterBackground&&(o[$].gutterBackground.style.left=B));var J=o[$].alignable;if(J)for(var ee=0;ee<J.length;ee++)J[ee].style.left=B}e.options.fixedGutter&&(t.gutters.style.left=r+y+"px")}function ci(e){if(!e.options.lineNumbers)return!1;var t=e.doc,o=Ai(e.options,t.first+t.size-1),r=e.display;if(o.length!=r.lineNumChars){var y=r.measure.appendChild(d("div",[d("div",o)],"CodeMirror-linenumber CodeMirror-gutter-elt")),B=y.firstChild.offsetWidth,$=y.offsetWidth-B;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(B,r.lineGutter.offsetWidth-$)+1,r.lineNumWidth=r.lineNumInnerWidth+$,r.lineNumChars=r.lineNumInnerWidth?o.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",za(e.display),!0}return!1}function _i(e,t){for(var o=[],r=!1,y=0;y<e.length;y++){var B=e[y],$=null;if(typeof B!="string"&&($=B.style,B=B.className),B=="CodeMirror-linenumbers")if(t)r=!0;else continue;o.push({className:B,style:$})}return t&&!r&&o.push({className:"CodeMirror-linenumbers",style:null}),o}function sa(e){var t=e.gutters,o=e.gutterSpecs;_(t),e.lineGutter=null;for(var r=0;r<o.length;++r){var y=o[r],B=y.className,$=y.style,J=t.appendChild(d("div",null,"CodeMirror-gutter "+B));$&&(J.style.cssText=$),B=="CodeMirror-linenumbers"&&(e.lineGutter=J,J.style.width=(e.lineNumWidth||1)+"px")}t.style.display=o.length?"":"none",za(e)}function ea(e){sa(e.display),Tr(e),or(e)}function Ra(e,t,o,r){var y=this;this.input=o,y.scrollbarFiller=d("div",null,"CodeMirror-scrollbar-filler"),y.scrollbarFiller.setAttribute("cm-not-content","true"),y.gutterFiller=d("div",null,"CodeMirror-gutter-filler"),y.gutterFiller.setAttribute("cm-not-content","true"),y.lineDiv=C("div",null,"CodeMirror-code"),y.selectionDiv=d("div",null,null,"position: relative; z-index: 1"),y.cursorDiv=d("div",null,"CodeMirror-cursors"),y.measure=d("div",null,"CodeMirror-measure"),y.lineMeasure=d("div",null,"CodeMirror-measure"),y.lineSpace=C("div",[y.measure,y.lineMeasure,y.selectionDiv,y.cursorDiv,y.lineDiv],null,"position: relative; outline: none");var B=C("div",[y.lineSpace],"CodeMirror-lines");y.mover=d("div",[B],null,"position: relative"),y.sizer=d("div",[y.mover],"CodeMirror-sizer"),y.sizerWidth=null,y.heightForcer=d("div",null,null,"position: absolute; height: "+re+"px; width: 1px;"),y.gutters=d("div",null,"CodeMirror-gutters"),y.lineGutter=null,y.scroller=d("div",[y.sizer,y.heightForcer,y.gutters],"CodeMirror-scroll"),y.scroller.setAttribute("tabIndex","-1"),y.wrapper=d("div",[y.scrollbarFiller,y.gutterFiller,y.scroller],"CodeMirror"),G&&K<8&&(y.gutters.style.zIndex=-1,y.scroller.style.paddingRight=0),!n&&!(N&&u)&&(y.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(y.wrapper):e(y.wrapper)),y.viewFrom=y.viewTo=t.first,y.reportedViewFrom=y.reportedViewTo=t.first,y.view=[],y.renderedView=null,y.externalMeasured=null,y.viewOffset=0,y.lastWrapHeight=y.lastWrapWidth=0,y.updateLineNumbers=null,y.nativeBarWidth=y.barHeight=y.barWidth=0,y.scrollbarsClipped=!1,y.lineNumWidth=y.lineNumInnerWidth=y.lineNumChars=null,y.alignWidgets=!1,y.cachedCharWidth=y.cachedTextHeight=y.cachedPaddingH=null,y.maxLine=null,y.maxLineLength=0,y.maxLineChanged=!1,y.wheelDX=y.wheelDY=y.wheelStartX=y.wheelStartY=null,y.shift=!1,y.selForContextMenu=null,y.activeTouch=null,y.gutterSpecs=_i(r.gutters,r.lineNumbers),sa(y),o.init(y)}var la=0,li=null;G?li=-.53:N?li=15:E?li=-.7:b&&(li=-1/3);function Da(e){var t=e.wheelDeltaX,o=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),o==null&&e.detail&&e.axis==e.VERTICAL_AXIS?o=e.detail:o==null&&(o=e.wheelDelta),{x:t,y:o}}function it(e){var t=Da(e);return t.x*=li,t.y*=li,t}function Je(e,t){var o=Da(t),r=o.x,y=o.y,B=e.display,$=B.scroller,J=$.scrollWidth>$.clientWidth,ee=$.scrollHeight>$.clientHeight;if(!(r&&J||y&&ee))return;if(y&&s&&n){e:for(var oe=t.target,Oe=B.view;oe!=$;oe=oe.parentNode)for(var Ie=0;Ie<Oe.length;Ie++)if(Oe[Ie].node==oe){e.display.currentWheelTarget=oe;break e}}if(r&&!N&&!f&&li!=null){y&&ee&&ha(e,Math.max(0,$.scrollTop+y*li)),Pi(e,Math.max(0,$.scrollLeft+r*li)),(!y||y&&ee)&&ce(t),B.wheelStartX=null;return}if(y&&li!=null){var Qe=y*li,Xe=e.doc.scrollTop,dt=Xe+B.wrapper.clientHeight;Qe<0?Xe=Math.max(0,Xe+Qe-50):dt=Math.min(e.doc.height,dt+Qe+50),Oa(e,{top:Xe,bottom:dt})}la<20&&(B.wheelStartX==null?(B.wheelStartX=$.scrollLeft,B.wheelStartY=$.scrollTop,B.wheelDX=r,B.wheelDY=y,setTimeout(function(){if(B.wheelStartX==null)return;var bt=$.scrollLeft-B.wheelStartX,It=$.scrollTop-B.wheelStartY,Ft=It&&B.wheelDY&&It/B.wheelDY||bt&&B.wheelDX&&bt/B.wheelDX;if(B.wheelStartX=B.wheelStartY=null,!Ft)return;li=(li*la+Ft)/(la+1),++la},200)):(B.wheelDX+=r,B.wheelDY+=y))}var $e=function(e,t){this.ranges=e,this.primIndex=t};$e.prototype.primary=function(){return this.ranges[this.primIndex]},$e.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 o=this.ranges[t],r=e.ranges[t];if(!Gi(o.anchor,r.anchor)||!Gi(o.head,r.head))return!1}return!0},$e.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new ot(zi(this.ranges[t].anchor),zi(this.ranges[t].head));return new $e(e,this.primIndex)},$e.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},$e.prototype.contains=function(e,t){t||(t=e);for(var o=0;o<this.ranges.length;o++){var r=this.ranges[o];if(fn(t,r.from())>=0&&fn(e,r.to())<=0)return o}return-1};var ot=function(e,t){this.anchor=e,this.head=t};ot.prototype.from=function(){return Vi(this.anchor,this.head)},ot.prototype.to=function(){return na(this.anchor,this.head)},ot.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ut(e,t,o){var r=e&&e.options.selectionsMayTouch,y=t[o];t.sort(function(Qe,Xe){return fn(Qe.from(),Xe.from())}),o=q(t,y);for(var B=1;B<t.length;B++){var $=t[B],J=t[B-1],ee=fn(J.to(),$.from());if(r&&!$.empty()?ee>0:ee>=0){var oe=Vi(J.from(),$.from()),Oe=na(J.to(),$.to()),Ie=J.empty()?$.from()==$.head:J.from()==J.head;B<=o&&--o,t.splice(--B,2,new ot(Ie?Oe:oe,Ie?oe:Oe))}}return new $e(t,o)}function At(e,t){return new $e([new ot(e,t||e)],0)}function St(e){return e.text?Et(e.from.line+e.text.length-1,Ce(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function wt(e,t){if(fn(e,t.from)<0)return e;if(fn(e,t.to)<=0)return St(t);var o=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=St(t).ch-t.to.ch),Et(o,r)}function cn(e,t){for(var o=[],r=0;r<e.sel.ranges.length;r++){var y=e.sel.ranges[r];o.push(new ot(wt(y.anchor,t),wt(y.head,t)))}return ut(e.cm,o,e.sel.primIndex)}function nr(e,t,o){return e.line==t.line?Et(o.line,e.ch-t.ch+o.ch):Et(o.line+(e.line-t.line),e.ch)}function Oi(e,t,o){for(var r=[],y=Et(e.first,0),B=y,$=0;$<t.length;$++){var J=t[$],ee=nr(J.from,y,B),oe=nr(St(J),y,B);if(y=J.to,B=oe,o=="around"){var Oe=e.sel.ranges[$],Ie=fn(Oe.head,Oe.anchor)<0;r[$]=new ot(Ie?oe:ee,Ie?ee:oe)}else r[$]=new ot(ee,ee)}return new $e(r,e.sel.primIndex)}function Hn(e){e.doc.mode=Yr(e.options,e.doc.modeOption),bi(e)}function bi(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,Aa(e,100),e.state.modeGen++,e.curOp&&Tr(e)}function Ei(e,t){return t.from.ch==0&&t.to.ch==0&&Ce(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function mi(e,t,o,r){function y(qt){return o?o[qt]:null}function B(qt,Wt,on){oi(qt,Wt,on,r),Gr(qt,"change",qt,t)}function $(qt,Wt){for(var on=[],In=qt;In<Wt;++In)on.push(new Yn(oe[In],y(In),r));return on}var J=t.from,ee=t.to,oe=t.text,Oe=Qt(e,J.line),Ie=Qt(e,ee.line),Qe=Ce(oe),Xe=y(oe.length-1),dt=ee.line-J.line;if(t.full)e.insert(0,$(0,oe.length)),e.remove(oe.length,e.size-oe.length);else if(Ei(e,t)){var bt=$(0,oe.length-1);B(Ie,Ie.text,Xe),dt&&e.remove(J.line,dt),bt.length&&e.insert(J.line,bt)}else if(Oe==Ie)if(oe.length==1)B(Oe,Oe.text.slice(0,J.ch)+Qe+Oe.text.slice(ee.ch),Xe);else{var It=$(1,oe.length-1);It.push(new Yn(Qe+Oe.text.slice(ee.ch),Xe,r)),B(Oe,Oe.text.slice(0,J.ch)+oe[0],y(0)),e.insert(J.line+1,It)}else if(oe.length==1)B(Oe,Oe.text.slice(0,J.ch)+oe[0]+Ie.text.slice(ee.ch),y(0)),e.remove(J.line+1,dt);else{B(Oe,Oe.text.slice(0,J.ch)+oe[0],y(0)),B(Ie,Qe+Ie.text.slice(ee.ch),Xe);var Ft=$(1,oe.length-1);dt>1&&e.remove(J.line+1,dt-1),e.insert(J.line+1,Ft)}Gr(e,"change",e,t)}function Ri(e,t,o){function r(y,B,$){if(y.linked)for(var J=0;J<y.linked.length;++J){var ee=y.linked[J];if(ee.doc==B)continue;var oe=$&&ee.sharedHist;if(o&&!oe)continue;t(ee.doc,oe),r(ee.doc,y,oe)}}r(e,null,!0)}function Vr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ci(e),Hn(e),ji(e),e.options.lineWrapping||ur(e),e.options.mode=t.modeOption,Tr(e)}function ji(e){(e.doc.direction=="rtl"?W:g)(e.display.lineDiv,"CodeMirror-rtl")}function ta(e){ni(e,function(){ji(e),Tr(e)})}function La(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 Bi(e,t){var o={from:zi(t.from),to:St(t),text:$r(e,t.from,t.to)};return xs(e,o,t.from.line,t.to.line+1),Ri(e,function(r){return xs(r,o,t.from.line,t.to.line+1)},!0),o}function _o(e){for(;e.length;){var t=Ce(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return _o(e.done),Ce(e.done);if(e.done.length&&!Ce(e.done).ranges)return Ce(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ce(e.done)}function Es(e,t,o,r){var y=e.history;y.undone.length=0;var B=+new Date,$,J;if((y.lastOp==r||y.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&y.lastModTime>B-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&($=pl(y,y.lastOp==r)))J=Ce($.changes),fn(t.from,t.to)==0&&fn(t.from,J.to)==0?J.to=St(t):$.changes.push(Bi(e,t));else{var ee=Ce(y.done);for((!ee||!ee.ranges)&&Qo(e.sel,y.done),$={changes:[Bi(e,t)],generation:y.generation},y.done.push($);y.done.length>y.undoDepth;)y.done.shift(),y.done[0].ranges||y.done.shift()}y.done.push(o),y.generation=++y.maxGeneration,y.lastModTime=y.lastSelTime=B,y.lastOp=y.lastSelOp=r,y.lastOrigin=y.lastSelOrigin=t.origin,J||qe(e,"historyAdded")}function ml(e,t,o,r){var y=t.charAt(0);return y=="*"||y=="+"&&o.ranges.length==r.ranges.length&&o.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,o,r){var y=e.history,B=r&&r.origin;o==y.lastSelOp||B&&y.lastSelOrigin==B&&(y.lastModTime==y.lastSelTime&&y.lastOrigin==B||ml(e,B,Ce(y.done),t))?y.done[y.done.length-1]=t:Qo(t,y.done),y.lastSelTime=+new Date,y.lastSelOrigin=B,y.lastSelOp=o,r&&r.clearRedo!==!1&&_o(y.undone)}function Qo(e,t){var o=Ce(t);o&&o.ranges&&o.equals(e)||t.push(e)}function xs(e,t,o,r){var y=t["spans_"+e.id],B=0;e.iter(Math.max(e.first,o),Math.min(e.first+e.size,r),function($){$.markedSpans&&((y||(y=t["spans_"+e.id]={}))[B]=$.markedSpans),++B})}function vl(e){if(!e)return null;for(var t,o=0;o<e.length;++o)e[o].marker.explicitlyCleared?t||(t=e.slice(0,o)):t&&t.push(e[o]);return t?t.length?t:null:e}function yl(e,t){var o=t["spans_"+e.id];if(!o)return null;for(var r=[],y=0;y<t.text.length;++y)r.push(vl(o[y]));return r}function Ts(e,t){var o=yl(e,t),r=Nn(e,t);if(!o)return r;if(!r)return o;for(var y=0;y<o.length;++y){var B=o[y],$=r[y];if(B&&$){e:for(var J=0;J<$.length;++J){for(var ee=$[J],oe=0;oe<B.length;++oe)if(B[oe].marker==ee.marker)continue e;B.push(ee)}}else $&&(o[y]=$)}return o}function bo(e,t,o){for(var r=[],y=0;y<e.length;++y){var B=e[y];if(B.ranges){r.push(o?$e.prototype.deepCopy.call(B):B);continue}var $=B.changes,J=[];r.push({changes:J});for(var ee=0;ee<$.length;++ee){var oe=$[ee],Oe=void 0;if(J.push({from:oe.from,to:oe.to,text:oe.text}),t)for(var Ie in oe)(Oe=Ie.match(/^spans_(\d+)$/))&&(q(t,Number(Oe[1]))>-1&&(Ce(J)[Ie]=oe[Ie],delete oe[Ie]))}}return r}function ls(e,t,o,r){if(r){var y=e.anchor;if(o){var B=fn(t,y)<0;B!=fn(o,y)<0?(y=t,t=o):B!=fn(t,o)<0&&(t=o)}return new ot(y,t)}else return new ot(o||t,t)}function Zo(e,t,o,r,y){y==null&&(y=e.cm&&(e.cm.display.shift||e.extend)),Di(e,new $e([ls(e.sel.primary(),t,o,y)],0),r)}function ws(e,t,o){for(var r=[],y=e.cm&&(e.cm.display.shift||e.extend),B=0;B<e.sel.ranges.length;B++)r[B]=ls(e.sel.ranges[B],t[B],null,y);var $=ut(e.cm,r,e.sel.primIndex);Di(e,$,o)}function us(e,t,o,r){var y=e.sel.ranges.slice(0);y[t]=o,Di(e,ut(e.cm,y,e.sel.primIndex),r)}function Cs(e,t,o,r){Di(e,At(t,o),r)}function _l(e,t,o){var r={ranges:t.ranges,update:function(y){this.ranges=[];for(var B=0;B<y.length;B++)this.ranges[B]=new ot(L(e,y[B].anchor),L(e,y[B].head))},origin:o&&o.origin};return qe(e,"beforeSelectionChange",e,r),e.cm&&qe(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?ut(e.cm,r.ranges,r.ranges.length-1):t}function Ss(e,t,o){var r=e.history.done,y=Ce(r);y&&y.ranges?(r[r.length-1]=t,Jo(e,t,o)):Di(e,t,o)}function Di(e,t,o){Jo(e,t,o),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,o)}function Jo(e,t,o){(we(e,"beforeSelectionChange")||e.cm&&we(e.cm,"beforeSelectionChange"))&&(t=_l(e,t,o));var r=o&&o.bias||(fn(t.primary().head,e.sel.primary().head)<0?-1:1);As(e,Rs(e,t,r,!0)),!(o&&o.scroll===!1)&&e.cm&&da(e.cm)}function As(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,xe(e.cm)),Gr(e,"cursorActivity",e)}function Os(e){As(e,Rs(e,e.sel,null,!1))}function Rs(e,t,o,r){for(var y,B=0;B<t.ranges.length;B++){var $=t.ranges[B],J=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[B],ee=qo(e,$.anchor,J&&J.anchor,o,r),oe=qo(e,$.head,J&&J.head,o,r);(y||ee!=$.anchor||oe!=$.head)&&(y||(y=t.ranges.slice(0,B)),y[B]=new ot(ee,oe))}return y?ut(e.cm,y,t.primIndex):t}function Eo(e,t,o,r,y){var B=Qt(e,t.line);if(B.markedSpans)for(var $=0;$<B.markedSpans.length;++$){var J=B.markedSpans[$],ee=J.marker,oe="selectLeft"in ee?!ee.selectLeft:ee.inclusiveLeft,Oe="selectRight"in ee?!ee.selectRight:ee.inclusiveRight;if((J.from==null||(oe?J.from<=t.ch:J.from<t.ch))&&(J.to==null||(Oe?J.to>=t.ch:J.to>t.ch))){if(y&&(qe(ee,"beforeCursorEnter"),ee.explicitlyCleared))if(B.markedSpans){--$;continue}else break;if(!ee.atomic)continue;if(o){var Ie=ee.find(r<0?1:-1),Qe=void 0;if((r<0?Oe:oe)&&(Ie=Ds(e,Ie,-r,Ie&&Ie.line==t.line?B:null)),Ie&&Ie.line==t.line&&(Qe=fn(Ie,o))&&(r<0?Qe<0:Qe>0))return Eo(e,Ie,t,r,y)}var Xe=ee.find(r<0?-1:1);return(r<0?oe:Oe)&&(Xe=Ds(e,Xe,r,Xe.line==t.line?B:null)),Xe?Eo(e,Xe,t,r,y):null}}return t}function qo(e,t,o,r,y){var B=r||1,$=Eo(e,t,o,B,y)||!y&&Eo(e,t,o,B,!0)||Eo(e,t,o,-B,y)||!y&&Eo(e,t,o,-B,!0);return $||(e.cantEdit=!0,Et(e.first,0))}function Ds(e,t,o,r){return o<0&&t.ch==0?t.line>e.first?L(e,Et(t.line-1)):null:o>0&&t.ch==(r||Qt(e,t.line)).text.length?t.line<e.first+e.size-1?Et(t.line+1,0):null:new Et(t.line,t.ch+o)}function Ls(e){e.setSelection(Et(e.firstLine(),0),Et(e.lastLine()),pe)}function Is(e,t,o){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return o&&(r.update=function(y,B,$,J){y&&(r.from=L(e,y)),B&&(r.to=L(e,B)),$&&(r.text=$),J!==void 0&&(r.origin=J)}),qe(e,"beforeChange",e,r),e.cm&&qe(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 xo(e,t,o){if(e.cm){if(!e.cm.curOp)return Jr(e.cm,xo)(e,t,o);if(e.cm.state.suppressEdits)return}if((we(e,"beforeChange")||e.cm&&we(e.cm,"beforeChange"))&&(t=Is(e,t,!0),!t))return;var r=Ht&&!o&&An(e,t.from,t.to);if(r)for(var y=r.length-1;y>=0;--y)Ps(e,{from:r[y].from,to:r[y].to,text:y?[""]:t.text,origin:t.origin});else Ps(e,t)}function Ps(e,t){if(t.text.length==1&&t.text[0]==""&&fn(t.from,t.to)==0)return;var o=cn(e,t);Es(e,t,o,e.cm?e.cm.curOp.id:NaN),Uo(e,t,o,Nn(e,t));var r=[];Ri(e,function(y,B){!B&&q(r,y.history)==-1&&(Us(y.history,t),r.push(y.history)),Uo(y,t,null,Nn(y,t))})}function es(e,t,o){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!o)return;for(var y=e.history,B,$=e.sel,J=t=="undo"?y.done:y.undone,ee=t=="undo"?y.undone:y.done,oe=0;oe<J.length&&!(B=J[oe],o?B.ranges&&!B.equals(e.sel):!B.ranges);oe++);if(oe==J.length)return;for(y.lastOrigin=y.lastSelOrigin=null;;)if(B=J.pop(),B.ranges){if(Qo(B,ee),o&&!B.equals(e.sel)){Di(e,B,{clearRedo:!1});return}$=B}else if(r){J.push(B);return}else break;var Oe=[];Qo($,ee),ee.push({changes:Oe,generation:y.generation}),y.generation=B.generation||++y.maxGeneration;for(var Ie=we(e,"beforeChange")||e.cm&&we(e.cm,"beforeChange"),Qe=function(bt){var It=B.changes[bt];if(It.origin=t,Ie&&!Is(e,It,!1))return J.length=0,{};Oe.push(Bi(e,It));var Ft=bt?cn(e,It):Ce(J);Uo(e,It,Ft,Ts(e,It)),!bt&&e.cm&&e.cm.scrollIntoView({from:It.from,to:St(It)});var qt=[];Ri(e,function(Wt,on){!on&&q(qt,Wt.history)==-1&&(Us(Wt.history,It),qt.push(Wt.history)),Uo(Wt,It,null,Ts(Wt,It))})},Xe=B.changes.length-1;Xe>=0;--Xe){var dt=Qe(Xe);if(dt)return dt.v}}function ks(e,t){if(t==0)return;if(e.first+=t,e.sel=new $e(ze(e.sel.ranges,function(y){return new ot(Et(y.anchor.line+t,y.anchor.ch),Et(y.head.line+t,y.head.ch))}),e.sel.primIndex),e.cm){Tr(e.cm,e.first,e.first-t,t);for(var o=e.cm.display,r=o.viewFrom;r<o.viewTo;r++)wn(e.cm,r,"gutter")}}function Uo(e,t,o,r){if(e.cm&&!e.cm.curOp)return Jr(e.cm,Uo)(e,t,o,r);if(t.to.line<e.first){ks(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 y=t.text.length-1-(e.first-t.from.line);ks(e,y),t={from:Et(e.first,0),to:Et(t.to.line+y,t.to.ch),text:[Ce(t.text)],origin:t.origin}}var B=e.lastLine();t.to.line>B&&(t={from:t.from,to:Et(B,Qt(e,B).text.length),text:[t.text[0]],origin:t.origin}),t.removed=$r(e,t.from,t.to),o||(o=cn(e,t)),e.cm?bl(e.cm,t,r):mi(e,t,r),Jo(e,o,pe),e.cantEdit&&qo(e,Et(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,o){var r=e.doc,y=e.display,B=t.from,$=t.to,J=!1,ee=B.line;e.options.lineWrapping||(ee=kn(Tn(Qt(r,B.line))),r.iter(ee,$.line+1,function(Xe){if(Xe==y.maxLine)return J=!0,!0})),r.sel.contains(t.from,t.to)>-1&&xe(e),mi(r,t,o,Ii(e)),e.options.lineWrapping||(r.iter(ee,B.line+t.text.length,function(Xe){var dt=Er(Xe);dt>y.maxLineLength&&(y.maxLine=Xe,y.maxLineLength=dt,y.maxLineChanged=!0,J=!1)}),J&&(e.curOp.updateMaxLine=!0)),Rt(r,B.line),Aa(e,400);var oe=t.text.length-($.line-B.line)-1;t.full?Tr(e):B.line==$.line&&t.text.length==1&&!Ei(e.doc,t)?wn(e,B.line,"text"):Tr(e,B.line,$.line+1,oe);var Oe=we(e,"changes"),Ie=we(e,"change");if(Ie||Oe){var Qe={from:B,to:$,text:t.text,removed:t.removed,origin:t.origin};Ie&&Gr(e,"change",e,Qe),Oe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Qe)}e.display.selForContextMenu=null}function To(e,t,o,r,y){var B;r||(r=o),fn(r,o)<0&&(B=[r,o],o=B[0],r=B[1]),typeof t=="string"&&(t=e.splitLines(t)),xo(e,{from:o,to:r,text:t,origin:y})}function Ms(e,t,o,r){o<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Ns(e,t,o,r){for(var y=0;y<e.length;++y){var B=e[y],$=!0;if(B.ranges){B.copied||(B=e[y]=B.deepCopy(),B.copied=!0);for(var J=0;J<B.ranges.length;J++)Ms(B.ranges[J].anchor,t,o,r),Ms(B.ranges[J].head,t,o,r);continue}for(var ee=0;ee<B.changes.length;++ee){var oe=B.changes[ee];if(o<oe.from.line)oe.from=Et(oe.from.line+r,oe.from.ch),oe.to=Et(oe.to.line+r,oe.to.ch);else if(t<=oe.to.line){$=!1;break}}$||(e.splice(0,y+1),y=0)}}function Us(e,t){var o=t.from.line,r=t.to.line,y=t.text.length-(r-o)-1;Ns(e.done,o,r,y),Ns(e.undone,o,r,y)}function jo(e,t,o,r){var y=t,B=t;return typeof t=="number"?B=Qt(e,Z(e,t)):y=kn(t),y==null?null:(r(B,y)&&e.cm&&wn(e.cm,y,o),B)}function Bo(e){this.lines=e,this.parent=null;for(var t=0,o=0;o<e.length;++o)e[o].parent=this,t+=e[o].height;this.height=t}Bo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var o=e,r=e+t;o<r;++o){var y=this.lines[o];this.height-=y.height,Xt(y),Gr(y,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,o){this.height+=o,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,o){for(var r=e+t;e<r;++e)if(o(this.lines[e]))return!0}};function Fo(e){this.children=e;for(var t=0,o=0,r=0;r<e.length;++r){var y=e[r];t+=y.chunkSize(),o+=y.height,y.parent=this}this.size=t,this.height=o,this.parent=null}Fo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var o=0;o<this.children.length;++o){var r=this.children[o],y=r.chunkSize();if(e<y){var B=Math.min(t,y-e),$=r.height;if(r.removeInner(e,B),this.height-=$-r.height,y==B&&(this.children.splice(o--,1),r.parent=null),(t-=B)==0)break;e=0}else e-=y}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Bo))){var J=[];this.collapse(J),this.children=[new Bo(J)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,o){this.size+=t.length,this.height+=o;for(var r=0;r<this.children.length;++r){var y=this.children[r],B=y.chunkSize();if(e<=B){if(y.insertInner(e,t,o),y.lines&&y.lines.length>50){for(var $=y.lines.length%25+25,J=$;J<y.lines.length;){var ee=new Bo(y.lines.slice(J,J+=25));y.height-=ee.height,this.children.splice(++r,0,ee),ee.parent=this}y.lines=y.lines.slice(0,$),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),o=new Fo(t);if(e.parent){e.size-=o.size,e.height-=o.height;var y=q(e.parent.children,e);e.parent.children.splice(y+1,0,o)}else{var r=new Fo(e.children);r.parent=e,e.children=[r,o],e=r}o.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,o){for(var r=0;r<this.children.length;++r){var y=this.children[r],B=y.chunkSize();if(e<B){var $=Math.min(t,B-e);if(y.iterN(e,$,o))return!0;if((t-=$)==0)break;e=0}else e-=B}}};var Wo=function(e,t,o){if(o)for(var r in o)o.hasOwnProperty(r)&&(this[r]=o[r]);this.doc=e,this.node=t};Wo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,o=this.line,r=kn(o);if(r==null||!t)return;for(var y=0;y<t.length;++y)t[y]==this&&t.splice(y--,1);t.length||(o.widgets=null);var B=_a(this);Lr(o,Math.max(0,o.height-B)),e&&(ni(e,function(){js(e,o,-B),wn(e,r,"widget")}),Gr(e,"lineWidgetCleared",e,this,r))},Wo.prototype.changed=function(){var e=this,t=this.height,o=this.doc.cm,r=this.line;this.height=null;var y=_a(this)-t;if(!y)return;Kr(this.doc,r)||Lr(r,r.height+y),o&&ni(o,function(){o.curOp.forceUpdate=!0,js(o,r,y),Gr(o,"lineWidgetChanged",o,e,kn(r))})},me(Wo);function js(e,t,o){Bt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&qa(e,o)}function El(e,t,o,r){var y=new Wo(e,o,r),B=e.cm;return B&&y.noHScroll&&(B.display.alignWidgets=!0),jo(e,t,"widget",function($){var J=$.widgets||($.widgets=[]);if(y.insertAt==null?J.push(y):J.splice(Math.min(J.length-1,Math.max(0,y.insertAt)),0,y),y.line=$,B&&!Kr(e,$)){var ee=Bt($)<e.scrollTop;Lr($,$.height+_a(y)),ee&&qa(B,y.height),B.curOp.forceUpdate=!0}return!0}),B&&Gr(B,"lineWidgetAdded",B,y,typeof t=="number"?t:kn(t)),y}var Bs=0,Va=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Bs};Va.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&qi(e),we(this,"clear")){var o=this.find();o&&Gr(this,"clear",o.from,o.to)}for(var r=null,y=null,B=0;B<this.lines.length;++B){var $=this.lines[B],J=Ln($.markedSpans,this);e&&!this.collapsed?wn(e,kn($),"text"):e&&(J.to!=null&&(y=kn($)),J.from!=null&&(r=kn($))),$.markedSpans=Kn($.markedSpans,J),J.from==null&&this.collapsed&&!Kr(this.doc,$)&&e&&Lr($,zr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ee=0;ee<this.lines.length;++ee){var oe=Tn(this.lines[ee]),Oe=Er(oe);Oe>e.display.maxLineLength&&(e.display.maxLine=oe,e.display.maxLineLength=Oe,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Tr(e,r,y+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Gr(e,"markerCleared",e,this,r,y),t&&oa(e),this.parent&&this.parent.clear()},Va.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var o,r,y=0;y<this.lines.length;++y){var B=this.lines[y],$=Ln(B.markedSpans,this);if($.from!=null&&(o=Et(t?B:kn(B),$.from),e==-1))return o;if($.to!=null&&(r=Et(t?B:kn(B),$.to),e==1))return r}return o&&{from:o,to:r}},Va.prototype.changed=function(){var e=this,t=this.find(-1,!0),o=this,r=this.doc.cm;if(!t||!r)return;ni(r,function(){var y=t.line,B=kn(t.line),$=Be(r,B);if($&&($n($),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Kr(o.doc,y)&&o.height!=null){var J=o.height;o.height=null;var ee=_a(o)-J;ee&&Lr(y,y.height+ee)}Gr(r,"markerChanged",r,e)})},Va.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||q(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Va.prototype.detachLine=function(e){if(this.lines.splice(q(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},me(Va);function wo(e,t,o,r,y){if(r&&r.shared)return xl(e,t,o,r,y);if(e.cm&&!e.cm.curOp)return Jr(e.cm,wo)(e,t,o,r,y);var B=new Va(e,y),$=fn(t,o);if(r&&v(r,B,!1),$>0||$==0&&B.clearWhenEmpty!==!1)return B;if(B.replacedWith&&(B.collapsed=!0,B.widgetNode=C("span",[B.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||B.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(B.widgetNode.insertLeft=!0)),B.collapsed){if(Vt(e,t.line,t,o,B)||t.line!=o.line&&Vt(e,o.line,t,o,B))throw new Error("Inserting collapsed marker partially overlapping an existing one");Cn()}B.addToHistory&&Es(e,{from:t,to:o,origin:"markText"},e.sel,NaN);var J=t.line,ee=e.cm,oe;if(e.iter(J,o.line+1,function(Ie){ee&&B.collapsed&&!ee.options.lineWrapping&&Tn(Ie)==ee.display.maxLine&&(oe=!0),B.collapsed&&J!=t.line&&Lr(Ie,0),dn(Ie,new gn(B,J==t.line?t.ch:null,J==o.line?o.ch:null)),++J}),B.collapsed&&e.iter(t.line,o.line+1,function(Ie){Kr(e,Ie)&&Lr(Ie,0)}),B.clearOnEnter&&Ze(B,"beforeCursorEnter",function(){return B.clear()}),B.readOnly&&(xn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),B.collapsed&&(B.id=++Bs,B.atomic=!0),ee){if(oe&&(ee.curOp.updateMaxLine=!0),B.collapsed)Tr(ee,t.line,o.line+1);else if(B.className||B.startStyle||B.endStyle||B.css||B.attributes||B.title)for(var Oe=t.line;Oe<=o.line;Oe++)wn(ee,Oe,"text");B.atomic&&Os(ee.doc),Gr(ee,"markerAdded",ee,B)}return B}var Ho=function(e,t){this.markers=e,this.primary=t;for(var o=0;o<e.length;++o)e[o].parent=this};Ho.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Gr(this,"clear")},Ho.prototype.find=function(e,t){return this.primary.find(e,t)},me(Ho);function xl(e,t,o,r,y){r=v(r),r.shared=!1;var B=[wo(e,t,o,r,y)],$=B[0],J=r.widgetNode;return Ri(e,function(ee){J&&(r.widgetNode=J.cloneNode(!0)),B.push(wo(ee,L(ee,t),L(ee,o),r,y));for(var oe=0;oe<ee.linked.length;++oe)if(ee.linked[oe].isParent)return;$=Ce(B)}),new Ho(B,$)}function Fs(e){return e.findMarks(Et(e.first,0),e.clipPos(Et(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var o=0;o<t.length;o++){var r=t[o],y=r.find(),B=e.clipPos(y.from),$=e.clipPos(y.to);if(fn(B,$)){var J=wo(e,B,$,r.primary,r.primary.type);r.markers.push(J),J.parent=r}}}function wl(e){for(var t=function(r){var y=e[r],B=[y.primary.doc];Ri(y.primary.doc,function(ee){return B.push(ee)});for(var $=0;$<y.markers.length;$++){var J=y.markers[$];q(B,J.doc)==-1&&(J.parent=null,y.markers.splice($--,1))}},o=0;o<e.length;o++)t(o)}var Cl=0,Fi=function(e,t,o,r,y){if(!(this instanceof Fi))return new Fi(e,t,o,r,y);o==null&&(o=0),Fo.call(this,[new Bo([new Yn("",null)])]),this.first=o,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=o;var B=Et(o,0);this.sel=At(B),this.history=new La(null),this.id=++Cl,this.modeOption=t,this.lineSep=r,this.direction=y=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),mi(this,{from:B,to:B,text:e}),Di(this,At(B),pe)};Fi.prototype=Ve(Fo.prototype,{constructor:Fi,iter:function(e,t,o){o?this.iterN(e-this.first,t-e,o):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var o=0,r=0;r<t.length;++r)o+=t[r].height;this.insertInner(e-this.first,t,o)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=fr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:qr(function(e){var t=Et(this.first,0),o=this.first+this.size-1;xo(this,{from:t,to:Et(o,Qt(this,o).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&xa(this.cm,0,0),Di(this,At(t),pe)}),replaceRange:function(e,t,o,r){t=L(this,t),o=o?L(this,o):t,To(this,e,t,o,r)},getRange:function(e,t,o){var r=$r(this,L(this,e),L(this,t));return o===!1?r:r.join(o||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(vi(this,e))return Qt(this,e)},getLineNumber:function(e){return kn(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Qt(this,e)),Tn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return L(this,e)},getCursor:function(e){var t=this.sel.primary(),o;return e==null||e=="head"?o=t.head:e=="anchor"?o=t.anchor:e=="end"||e=="to"||e===!1?o=t.to():o=t.from(),o},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:qr(function(e,t,o){Cs(this,L(this,typeof e=="number"?Et(e,t||0):e),null,o)}),setSelection:qr(function(e,t,o){Cs(this,L(this,e),L(this,t||e),o)}),extendSelection:qr(function(e,t,o){Zo(this,L(this,e),t&&L(this,t),o)}),extendSelections:qr(function(e,t){ws(this,V(this,e),t)}),extendSelectionsBy:qr(function(e,t){var o=ze(this.sel.ranges,e);ws(this,V(this,o),t)}),setSelections:qr(function(e,t,o){if(!e.length)return;for(var r=[],y=0;y<e.length;y++)r[y]=new ot(L(this,e[y].anchor),L(this,e[y].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Di(this,ut(this.cm,r,t),o)}),addSelection:qr(function(e,t,o){var r=this.sel.ranges.slice(0);r.push(new ot(L(this,e),L(this,t||e))),Di(this,ut(this.cm,r,r.length-1),o)}),getSelection:function(e){for(var t=this.sel.ranges,o,r=0;r<t.length;r++){var y=$r(this,t[r].from(),t[r].to());o=o?o.concat(y):y}return e===!1?o:o.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],o=this.sel.ranges,r=0;r<o.length;r++){var y=$r(this,o[r].from(),o[r].to());e!==!1&&(y=y.join(e||this.lineSeparator())),t[r]=y}return t},replaceSelection:function(e,t,o){for(var r=[],y=0;y<this.sel.ranges.length;y++)r[y]=e;this.replaceSelections(r,t,o||"+input")},replaceSelections:qr(function(e,t,o){for(var r=[],y=this.sel,B=0;B<y.ranges.length;B++){var $=y.ranges[B];r[B]={from:$.from(),to:$.to(),text:this.splitLines(e[B]),origin:o}}for(var J=t&&t!="end"&&Oi(this,r,t),ee=r.length-1;ee>=0;ee--)xo(this,r[ee]);J?Ss(this,J):this.cm&&da(this.cm)}),undo:qr(function(){es(this,"undo")}),redo:qr(function(){es(this,"redo")}),undoSelection:qr(function(){es(this,"undo",!0)}),redoSelection:qr(function(){es(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,o=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var y=0;y<e.undone.length;y++)e.undone[y].ranges||++o;return{undo:t,redo:o}},clearHistory:function(){var e=this;this.history=new La(this.history.maxGeneration),Ri(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:bo(this.history.done),undone:bo(this.history.undone)}},setHistory:function(e){var t=this.history=new La(this.history.maxGeneration);t.done=bo(e.done.slice(0),null,!0),t.undone=bo(e.undone.slice(0),null,!0)},setGutterMarker:qr(function(e,t,o){return jo(this,e,"gutter",function(r){var y=r.gutterMarkers||(r.gutterMarkers={});return y[t]=o,!o&&de(y)&&(r.gutterMarkers=null),!0})}),clearGutter:qr(function(e){var t=this;this.iter(function(o){o.gutterMarkers&&o.gutterMarkers[e]&&jo(t,o,"gutter",function(){return o.gutterMarkers[e]=null,de(o.gutterMarkers)&&(o.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!vi(this,e))return null;if(t=e,e=Qt(this,e),!e)return null}else if(t=kn(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:qr(function(e,t,o){return jo(this,e,t=="gutter"?"gutter":"class",function(r){var y=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[y])r[y]=o;else{if(O(o).test(r[y]))return!1;r[y]+=" "+o}return!0})}),removeLineClass:qr(function(e,t,o){return jo(this,e,t=="gutter"?"gutter":"class",function(r){var y=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",B=r[y];if(B)if(o==null)r[y]=null;else{var $=B.match(O(o));if(!$)return!1;var J=$.index+$[0].length;r[y]=B.slice(0,$.index)+(!$.index||J==B.length?"":" ")+B.slice(J)||null}else return!1;return!0})}),addLineWidget:qr(function(e,t,o){return El(this,e,t,o)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,o){return wo(this,L(this,e),L(this,t),o,o&&o.type||"range")},setBookmark:function(e,t){var o={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=L(this,e),wo(this,e,e,o,"bookmark")},findMarksAt:function(e){e=L(this,e);var t=[],o=Qt(this,e.line).markedSpans;if(o)for(var r=0;r<o.length;++r){var y=o[r];(y.from==null||y.from<=e.ch)&&(y.to==null||y.to>=e.ch)&&t.push(y.marker.parent||y.marker)}return t},findMarks:function(e,t,o){e=L(this,e),t=L(this,t);var r=[],y=e.line;return this.iter(e.line,t.line+1,function(B){var $=B.markedSpans;if($)for(var J=0;J<$.length;J++){var ee=$[J];!(ee.to!=null&&y==e.line&&e.ch>=ee.to||ee.from==null&&y!=e.line||ee.from!=null&&y==t.line&&ee.from>=t.ch)&&(!o||o(ee.marker))&&r.push(ee.marker.parent||ee.marker)}++y}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var o=t.markedSpans;if(o)for(var r=0;r<o.length;++r)o[r].from!=null&&e.push(o[r].marker)}),e},posFromIndex:function(e){var t,o=this.first,r=this.lineSeparator().length;return this.iter(function(y){var B=y.text.length+r;if(B>e)return t=e,!0;e-=B,++o}),L(this,Et(o,t))},indexFromPos:function(e){e=L(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var o=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+o}),t},copy:function(e){var t=new Fi(fr(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,o=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<o&&(o=e.to);var r=new Fi(fr(this,t,o),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,Fs(this)),r},unlinkDoc:function(e){if(e instanceof Xr&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var o=this.linked[t];if(o.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(Fs(this));break}if(e.history==this.history){var r=[e.id];Ri(e,function(y){return r.push(y.id)},!0),e.history=new La(null),e.history.done=bo(this.history.done,r),e.history.undone=bo(this.history.undone,r)}},iterLinkedDocs:function(e){Ri(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):En(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:qr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&ta(this.cm)})}),Fi.prototype.eachLine=Fi.prototype.iter;var Ws=0;function Sl(e){var t=this;if(Hs(t),st(t,e)||ra(t.display,e))return;ce(e),G&&(Ws=+new Date);var o=Zr(t,e,!0),r=e.dataTransfer.files;if(!o||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var y=r.length,B=Array(y),$=0,J=function(){++$==y&&Jr(t,function(){o=L(t.doc,o);var Xe={from:o,to:o,text:t.doc.splitLines(B.filter(function(dt){return dt!=null}).join(t.doc.lineSeparator())),origin:"paste"};xo(t.doc,Xe),Ss(t.doc,At(L(t.doc,o),L(t.doc,St(Xe))))})()},ee=function(Xe,dt){if(t.options.allowDropFileTypes&&q(t.options.allowDropFileTypes,Xe.type)==-1){J();return}var bt=new FileReader;bt.onerror=function(){return J()},bt.onload=function(){var It=bt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(It)){J();return}B[dt]=It,J()},bt.readAsText(Xe)},oe=0;oe<r.length;oe++)ee(r[oe],oe);else{if(t.state.draggingText&&t.doc.sel.contains(o)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Oe=e.dataTransfer.getData("Text");if(Oe){var Ie;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ie=t.listSelections()),Jo(t.doc,At(o,o)),Ie)for(var Qe=0;Qe<Ie.length;++Qe)To(t.doc,"",Ie[Qe].anchor,Ie[Qe].head,"drag");t.replaceSelection(Oe,"around","paste"),t.display.input.focus()}}catch(Xe){}}}function Al(e,t){if(G&&(!e.state.draggingText||+new Date-Ws<100)){Re(t);return}if(st(e,t)||ra(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!b){var o=d("img",null,null,"position: fixed; left: 0; top: 0;");o.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(o.width=o.height=1,e.display.wrapper.appendChild(o),o._top=o.offsetTop),t.dataTransfer.setDragImage(o,0,0),f&&o.parentNode.removeChild(o)}}function Ol(e,t){var o=Zr(e,t);if(!o)return;var r=document.createDocumentFragment();Ji(e,o,r),e.display.dragCursor||(e.display.dragCursor=d("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),h(e.display.dragCursor,r)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ks(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),o=[],r=0;r<t.length;r++){var y=t[r].CodeMirror;y&&o.push(y)}o.length&&o[0].operation(function(){for(var B=0;B<o.length;B++)e(o[B])})}var Gs=!1;function Rl(){if(Gs)return;Dl(),Gs=!0}function Dl(){var e;Ze(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ks(Ll)},100))}),Ze(window,"blur",function(){return Ks(Ea)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Xa={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"},Ko=0;Ko<10;Ko++)Xa[Ko+48]=Xa[Ko+96]=String(Ko);for(var ts=65;ts<=90;ts++)Xa[ts]=String.fromCharCode(ts);for(var Go=1;Go<=12;Go++)Xa[Go+111]=Xa[Go+63235]="F"+Go;var Ia={};Ia.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"},Ia.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"},Ia.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"},Ia.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"]},Ia.default=s?Ia.macDefault:Ia.pcDefault;function Il(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var o,r,y,B,$=0;$<t.length-1;$++){var J=t[$];if(/^(cmd|meta|m)$/i.test(J))B=!0;else if(/^a(lt)?$/i.test(J))o=!0;else if(/^(c|ctrl|control)$/i.test(J))r=!0;else if(/^s(hift)?$/i.test(J))y=!0;else throw new Error("Unrecognized modifier name: "+J)}return o&&(e="Alt-"+e),r&&(e="Ctrl-"+e),B&&(e="Cmd-"+e),y&&(e="Shift-"+e),e}function Pl(e){var t={};for(var o in e)if(e.hasOwnProperty(o)){var r=e[o];if(/^(name|fallthrough|(de|at)tach)$/.test(o))continue;if(r=="..."){delete e[o];continue}for(var y=ze(o.split(" "),Il),B=0;B<y.length;B++){var $=void 0,J=void 0;B==y.length-1?(J=y.join(" "),$=r):(J=y.slice(0,B+1).join(" "),$="...");var ee=t[J];if(!ee)t[J]=$;else if(ee!=$)throw new Error("Inconsistent bindings for "+J)}delete e[o]}for(var oe in t)e[oe]=t[oe];return e}function Co(e,t,o,r){t=ns(t);var y=t.call?t.call(e,r):t[e];if(y===!1)return"nothing";if(y==="...")return"multi";if(y!=null&&o(y))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Co(e,t.fallthrough,o,r);for(var B=0;B<t.fallthrough.length;B++){var $=Co(e,t.fallthrough[B],o,r);if($)return $}}}function zs(e){var t=typeof e=="string"?e:Xa[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Vs(e,t,o){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(S?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(S?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!o&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Xs(e,t){if(f&&e.keyCode==34&&e.char)return!1;var o=Xa[e.keyCode];return o==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(o=e.code),Vs(o,e,t))}function ns(e){return typeof e=="string"?Ia[e]:e}function So(e,t){for(var o=e.doc.sel.ranges,r=[],y=0;y<o.length;y++){for(var B=t(o[y]);r.length&&fn(B.from,Ce(r).to)<=0;){var $=r.pop();if(fn($.from,B.from)<0){B.from=$.from;break}}r.push(B)}ni(e,function(){for(var J=r.length-1;J>=0;J--)To(e.doc,"",r[J].from,r[J].to,"+delete");da(e)})}function cs(e,t,o){var r=Ue(e.text,t+o,o);return r<0||r>e.text.length?null:r}function ds(e,t,o){var r=cs(e,t.ch,o);return r==null?null:new Et(t.line,r,o<0?"after":"before")}function hs(e,t,o,r,y){if(e){t.doc.direction=="rtl"&&(y=-y);var B=gt(o,t.doc.direction);if(B){var $=y<0?Ce(B):B[0],J=y<0==($.level==1),ee=J?"after":"before",oe;if($.level>0||t.doc.direction=="rtl"){var Oe=je(t,o);oe=y<0?o.text.length-1:0;var Ie=Ge(t,Oe,oe).top;oe=rt(function(Qe){return Ge(t,Oe,Qe).top==Ie},y<0==($.level==1)?$.from:$.to-1,oe),ee=="before"&&(oe=cs(o,oe,1))}else oe=y<0?$.to:$.from;return new Et(r,oe,ee)}}return new Et(r,y<0?o.text.length:0,y<0?"before":"after")}function kl(e,t,o,r){var y=gt(t,e.doc.direction);if(!y)return ds(t,o,r);o.ch>=t.text.length?(o.ch=t.text.length,o.sticky="before"):o.ch<=0&&(o.ch=0,o.sticky="after");var B=at(y,o.ch,o.sticky),$=y[B];if(e.doc.direction=="ltr"&&$.level%2==0&&(r>0?$.to>o.ch:$.from<o.ch))return ds(t,o,r);var J=function(Ft,qt){return cs(t,Ft instanceof Et?Ft.ch:Ft,qt)},ee,oe=function(Ft){return e.options.lineWrapping?(ee=ee||je(e,t),an(e,t,ee,Ft)):{begin:0,end:t.text.length}},Oe=oe(o.sticky=="before"?J(o,-1):o.ch);if(e.doc.direction=="rtl"||$.level==1){var Ie=$.level==1==r<0,Qe=J(o,Ie?1:-1);if(Qe!=null&&(Ie?Qe<=$.to&&Qe<=Oe.end:Qe>=$.from&&Qe>=Oe.begin)){var Xe=Ie?"before":"after";return new Et(o.line,Qe,Xe)}}var dt=function(Ft,qt,Wt){for(var on=function(Fr,xi){return xi?new Et(o.line,J(Fr,1),"before"):new Et(o.line,Fr,"after")};Ft>=0&&Ft<y.length;Ft+=qt){var In=y[Ft],bn=qt>0==(In.level!=1),ar=bn?Wt.begin:J(Wt.end,-1);if(In.from<=ar&&ar<In.to)return on(ar,bn);if(ar=bn?In.from:J(In.to,-1),Wt.begin<=ar&&ar<Wt.end)return on(ar,bn)}},bt=dt(B+r,r,Oe);if(bt)return bt;var It=r>0?Oe.end:J(Oe.begin,-1);return It!=null&&!(r>0&&It==t.text.length)&&(bt=dt(r>0?0:y.length-1,r,oe(It)),bt)?bt:null}var zo={selectAll:Ls,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),pe)},killLine:function(e){return So(e,function(t){if(t.empty()){var o=Qt(e.doc,t.head.line).text.length;return t.head.ch==o&&t.head.line<e.lastLine()?{from:t.head,to:Et(t.head.line+1,0)}:{from:t.head,to:Et(t.head.line,o)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return So(e,function(t){return{from:Et(t.from().line,0),to:L(e.doc,Et(t.to().line+1,0))}})},delLineLeft:function(e){return So(e,function(t){return{from:Et(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return So(e,function(t){var o=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:o},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return So(e,function(t){var o=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:o},"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(Et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return $s(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 o=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:o},"div")},fe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:o},"div")},fe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:o},"div");return r.ch<e.getLine(r.line).search(/\S/)?$s(e,t.head):r},fe)},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=[],o=e.listSelections(),r=e.options.tabSize,y=0;y<o.length;y++){var B=o[y].from(),$=H(e.getLine(B.line),B.ch,r);t.push(ae(r-$%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ni(e,function(){for(var t=e.listSelections(),o=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var y=t[r].head,B=Qt(e.doc,y.line).text;if(B){if(y.ch==B.length&&(y=new Et(y.line,y.ch-1)),y.ch>0)y=new Et(y.line,y.ch+1),e.replaceRange(B.charAt(y.ch-1)+B.charAt(y.ch-2),Et(y.line,y.ch-2),y,"+transpose");else if(y.line>e.doc.first){var $=Qt(e.doc,y.line-1).text;$&&(y=new Et(y.line,1),e.replaceRange(B.charAt(0)+e.doc.lineSeparator()+$.charAt($.length-1),Et(y.line-1,$.length-1),y,"+transpose"))}}o.push(new ot(y,y))}e.setSelections(o)})},newlineAndIndent:function(e){return ni(e,function(){for(var t=e.listSelections(),o=t.length-1;o>=0;o--)e.replaceRange(e.doc.lineSeparator(),t[o].anchor,t[o].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);da(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ys(e,t){var o=Qt(e.doc,t),r=Tn(o);return r!=o&&(t=kn(r)),hs(!0,e,r,t,1)}function Ml(e,t){var o=Qt(e.doc,t),r=mr(o);return r!=o&&(t=kn(r)),hs(!0,e,o,t,-1)}function $s(e,t){var o=Ys(e,t.line),r=Qt(e.doc,o.line),y=gt(r,e.doc.direction);if(!y||y[0].level==0){var B=Math.max(o.ch,r.text.search(/\S/)),$=t.line==o.line&&t.ch<=B&&t.ch;return Et(o.line,$?0:B,o.sticky)}return o}function rs(e,t,o){if(typeof t=="string"&&(t=zo[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,y=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),o&&(e.display.shift=!1),y=t(e)!=ye}finally{e.display.shift=r,e.state.suppressEdits=!1}return y}function Nl(e,t,o){for(var r=0;r<e.state.keyMaps.length;r++){var y=Co(t,e.state.keyMaps[r],o,e);if(y)return y}return e.options.extraKeys&&Co(t,e.options.extraKeys,o,e)||Co(t,e.options.keyMap,o,e)}var Ul=new X;function Vo(e,t,o,r){var y=e.state.keySeq;if(y){if(zs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==y&&(e.state.keySeq=null,e.display.input.reset())}),Qs(e,y+" "+t,o,r))return!0}return Qs(e,t,o,r)}function Qs(e,t,o,r){var y=Nl(e,t,r);return y=="multi"&&(e.state.keySeq=t),y=="handled"&&Gr(e,"keyHandled",e,t,o),(y=="handled"||y=="multi")&&(ce(o),Hr(e)),!!y}function Zs(e,t){var o=Xs(t,!0);return o?t.shiftKey&&!e.state.keySeq?Vo(e,"Shift-"+o,t,function(r){return rs(e,r,!0)})||Vo(e,o,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return rs(e,r)}):Vo(e,o,t,function(r){return rs(e,r)}):!1}function jl(e,t,o){return Vo(e,"'"+o+"'",t,function(r){return rs(e,r,!0)})}var fs=null;function Js(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=j(),st(t,e))return;G&&K<11&&e.keyCode==27&&(e.returnValue=!1);var o=e.keyCode;t.display.shift=o==16||e.shiftKey;var r=Zs(t,e);f&&(fs=r?o:null,!r&&o==88&&!rr&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),N&&!s&&!r&&o==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),o==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;W(t,"CodeMirror-crosshair");function o(r){(r.keyCode==18||!r.altKey)&&(g(t,"CodeMirror-crosshair"),Ot(document,"keyup",o),Ot(document,"mouseover",o))}Ze(document,"keyup",o),Ze(document,"mouseover",o)}function qs(e){e.keyCode==16&&(this.doc.sel.shift=!1),st(this,e)}function el(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(ra(t.display,e)||st(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var o=e.keyCode,r=e.charCode;if(f&&o==fs){fs=null,ce(e);return}if(f&&(!e.which||e.which<10)&&Zs(t,e))return;var y=String.fromCharCode(r==null?o:r);if(y=="\b")return;if(jl(t,e,y))return;t.display.input.onKeyPress(e)}var Fl=400,ps=function(e,t,o){this.time=e,this.pos=t,this.button=o};ps.prototype.compare=function(e,t,o){return this.time+Fl>e&&fn(t,this.pos)==0&&o==this.button};var Xo,Yo;function Wl(e,t){var o=+new Date;return Yo&&Yo.compare(o,e,t)?(Xo=Yo=null,"triple"):Xo&&Xo.compare(o,e,t)?(Yo=new ps(o,e,t),Xo=null,"double"):(Xo=new ps(o,e,t),Yo=null,"single")}function tl(e){var t=this,o=t.display;if(st(t,e)||o.activeTouch&&o.input.supportsTouch())return;if(o.input.ensurePolled(),o.shift=e.shiftKey,ra(o,e)){n||(o.scroller.draggable=!1,setTimeout(function(){return o.scroller.draggable=!0},100));return}if(ms(t,e))return;var r=Zr(t,e),y=et(e),B=r?Wl(r,y):"single";if(window.focus(),y==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,y,r,B,e))return;y==1?r?Gl(t,r,B,e):Me(e)==o.scroller&&ce(e):y==2?(r&&Zo(t.doc,r),setTimeout(function(){return o.input.focus()},20)):y==3&&(R?t.display.input.onContextMenu(e):Za(t))}function Hl(e,t,o,r,y){var B="Click";return r=="double"?B="Double"+B:r=="triple"&&(B="Triple"+B),B=(t==1?"Left":t==2?"Middle":"Right")+B,Vo(e,Vs(B,y),y,function($){if(typeof $=="string"&&($=zo[$]),!$)return!1;var J=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),J=$(e,o)!=ye}finally{e.state.suppressEdits=!1}return J})}function Kl(e,t,o){var r=e.getOption("configureMouse"),y=r?r(e,t,o):{};if(y.unit==null){var B=i?o.shiftKey&&o.metaKey:o.altKey;y.unit=B?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(y.extend==null||e.doc.extend)&&(y.extend=e.doc.extend||o.shiftKey),y.addNew==null&&(y.addNew=s?o.metaKey:o.ctrlKey),y.moveOnDrag==null&&(y.moveOnDrag=!(s?o.altKey:o.ctrlKey)),y}function Gl(e,t,o,r){G?setTimeout(m(Ua,e),0):e.curOp.focus=j();var y=Kl(e,o,r),B=e.doc.sel,$;e.options.dragDrop&&ht&&!e.isReadOnly()&&o=="single"&&($=B.contains(t))>-1&&(fn(($=B.ranges[$]).from(),t)<0||t.xRel>0)&&(fn($.to(),t)>0||t.xRel<0)?zl(e,r,t,y):Vl(e,r,t,y)}function zl(e,t,o,r){var y=e.display,B=!1,$=Jr(e,function(oe){n&&(y.scroller.draggable=!1),e.state.draggingText=!1,Ot(y.wrapper.ownerDocument,"mouseup",$),Ot(y.wrapper.ownerDocument,"mousemove",J),Ot(y.scroller,"dragstart",ee),Ot(y.scroller,"drop",$),B||(ce(oe),r.addNew||Zo(e.doc,o,null,null,r.extend),n&&!b||G&&K==9?setTimeout(function(){y.wrapper.ownerDocument.body.focus({preventScroll:!0}),y.input.focus()},20):y.input.focus())}),J=function(oe){B=B||Math.abs(t.clientX-oe.clientX)+Math.abs(t.clientY-oe.clientY)>=10},ee=function(){return B=!0};n&&(y.scroller.draggable=!0),e.state.draggingText=$,$.copy=!r.moveOnDrag,y.scroller.dragDrop&&y.scroller.dragDrop(),Ze(y.wrapper.ownerDocument,"mouseup",$),Ze(y.wrapper.ownerDocument,"mousemove",J),Ze(y.scroller,"dragstart",ee),Ze(y.scroller,"drop",$),Za(e),setTimeout(function(){return y.input.focus()},20)}function nl(e,t,o){if(o=="char")return new ot(t,t);if(o=="word")return e.findWordAt(t);if(o=="line")return new ot(Et(t.line,0),L(e.doc,Et(t.line+1,0)));var r=o(e,t);return new ot(r.from,r.to)}function Vl(e,t,o,r){var y=e.display,B=e.doc;ce(t);var $,J,ee=B.sel,oe=ee.ranges;if(r.addNew&&!r.extend?(J=B.sel.contains(o),J>-1?$=oe[J]:$=new ot(o,o)):($=B.sel.primary(),J=B.sel.primIndex),r.unit=="rectangle")r.addNew||($=new ot(o,o)),o=Zr(e,t,!0,!0),J=-1;else{var Oe=nl(e,o,r.unit);r.extend?$=ls($,Oe.anchor,Oe.head,r.extend):$=Oe}r.addNew?J==-1?(J=oe.length,Di(B,ut(e,oe.concat([$]),J),{scroll:!1,origin:"*mouse"})):oe.length>1&&oe[J].empty()&&r.unit=="char"&&!r.extend?(Di(B,ut(e,oe.slice(0,J).concat(oe.slice(J+1)),0),{scroll:!1,origin:"*mouse"}),ee=B.sel):us(B,J,$,ue):(J=0,Di(B,new $e([$],0),ue),ee=B.sel);var Ie=o;function Qe(Wt){if(fn(Ie,Wt)==0)return;if(Ie=Wt,r.unit=="rectangle"){for(var on=[],In=e.options.tabSize,bn=H(Qt(B,o.line).text,o.ch,In),ar=H(Qt(B,Wt.line).text,Wt.ch,In),Fr=Math.min(bn,ar),xi=Math.max(bn,ar),ei=Math.min(o.line,Wt.line),$i=Math.min(e.lastLine(),Math.max(o.line,Wt.line));ei<=$i;ei++){var Wi=Qt(B,ei).text,di=be(Wi,Fr,In);Fr==xi?on.push(new ot(Et(ei,di),Et(ei,di))):Wi.length>di&&on.push(new ot(Et(ei,di),Et(ei,be(Wi,xi,In))))}on.length||on.push(new ot(o,o)),Di(B,ut(e,ee.ranges.slice(0,J).concat(on),J),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Wt)}else{var Hi=$,Si=nl(e,Wt,r.unit),gi=Hi.anchor,hi;fn(Si.anchor,gi)>0?(hi=Si.head,gi=Vi(Hi.from(),Si.anchor)):(hi=Si.anchor,gi=na(Hi.to(),Si.head));var ri=ee.ranges.slice(0);ri[J]=Xl(e,new ot(L(B,gi),hi)),Di(B,ut(e,ri,J),ue)}}var Xe=y.wrapper.getBoundingClientRect(),dt=0;function bt(Wt){var on=++dt,In=Zr(e,Wt,!0,r.unit=="rectangle");if(!In)return;if(fn(In,Ie)!=0){e.curOp.focus=j(),Qe(In);var bn=ja(y,B);(In.line>=bn.to||In.line<bn.from)&&setTimeout(Jr(e,function(){dt==on&&bt(Wt)}),150)}else{var ar=Wt.clientY<Xe.top?-20:Wt.clientY>Xe.bottom?20:0;ar&&setTimeout(Jr(e,function(){if(dt!=on)return;y.scroller.scrollTop+=ar,bt(Wt)}),50)}}function It(Wt){e.state.selectingText=!1,dt=Infinity,Wt&&(ce(Wt),y.input.focus()),Ot(y.wrapper.ownerDocument,"mousemove",Ft),Ot(y.wrapper.ownerDocument,"mouseup",qt),B.history.lastSelOrigin=null}var Ft=Jr(e,function(Wt){Wt.buttons===0||!et(Wt)?It(Wt):bt(Wt)}),qt=Jr(e,It);e.state.selectingText=qt,Ze(y.wrapper.ownerDocument,"mousemove",Ft),Ze(y.wrapper.ownerDocument,"mouseup",qt)}function Xl(e,t){var o=t.anchor,r=t.head,y=Qt(e.doc,o.line);if(fn(o,r)==0&&o.sticky==r.sticky)return t;var B=gt(y);if(!B)return t;var $=at(B,o.ch,o.sticky),J=B[$];if(J.from!=o.ch&&J.to!=o.ch)return t;var ee=$+(J.from==o.ch==(J.level!=1)?0:1);if(ee==0||ee==B.length)return t;var oe;if(r.line!=o.line)oe=(r.line-o.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Oe=at(B,r.ch,r.sticky),Ie=Oe-$||(r.ch-o.ch)*(J.level==1?-1:1);Oe==ee-1||Oe==ee?oe=Ie<0:oe=Ie>0}var Qe=B[ee+(oe?-1:0)],Xe=oe==(Qe.level==1),dt=Xe?Qe.from:Qe.to,bt=Xe?"after":"before";return o.ch==dt&&o.sticky==bt?t:new ot(new Et(o.line,dt,bt),r)}function rl(e,t,o,r){var y,B;if(t.touches)y=t.touches[0].clientX,B=t.touches[0].clientY;else try{y=t.clientX,B=t.clientY}catch(Qe){return!1}if(y>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ce(t);var $=e.display,J=$.lineDiv.getBoundingClientRect();if(B>J.bottom||!we(e,o))return Te(t);B-=J.top-$.viewOffset;for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var oe=$.gutters.childNodes[ee];if(oe&&oe.getBoundingClientRect().right>=y){var Oe=Ur(e.doc,B),Ie=e.display.gutterSpecs[ee];return qe(e,o,e,Oe,Ie.className,t),Te(t)}}}function ms(e,t){return rl(e,t,"gutterClick",!0)}function il(e,t){if(ra(e.display,t)||Yl(e,t))return;if(st(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Yl(e,t){return we(e,"gutterContextMenu")?rl(e,t,"gutterContextMenu",!1):!1}function al(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),zn(e)}var Ao={toString:function(){return"CodeMirror.Init"}},ol={},is={};function $l(e){var t=e.optionHandlers;function o(r,y,B,$){e.defaults[r]=y,B&&(t[r]=$?function(J,ee,oe){oe!=Ao&&B(J,ee,oe)}:B)}e.defineOption=o,e.Init=Ao,o("value","",function(r,y){return r.setValue(y)},!0),o("mode",null,function(r,y){r.doc.modeOption=y,Hn(r)},!0),o("indentUnit",2,Hn,!0),o("indentWithTabs",!1),o("smartIndent",!0),o("tabSize",4,function(r){bi(r),zn(r),Tr(r)},!0),o("lineSeparator",null,function(r,y){if(r.doc.lineSep=y,!y)return;var B=[],$=r.doc.first;r.doc.iter(function(ee){for(var oe=0;;){var Oe=ee.text.indexOf(y,oe);if(Oe==-1)break;oe=Oe+y.length,B.push(Et($,Oe))}$++});for(var J=B.length-1;J>=0;J--)To(r.doc,y,B[J],Et(B[J].line,B[J].ch+y.length))}),o("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,y,B){r.state.specialChars=new RegExp(y.source+(y.test(" ")?"":"| "),"g"),B!=Ao&&r.refresh()}),o("specialCharPlaceholder",Mn,function(r){return r.refresh()},!0),o("electricChars",!0),o("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),o("spellcheck",!1,function(r,y){return r.getInputField().spellcheck=y},!0),o("autocorrect",!1,function(r,y){return r.getInputField().autocorrect=y},!0),o("autocapitalize",!1,function(r,y){return r.getInputField().autocapitalize=y},!0),o("rtlMoveVisually",!D),o("wholeLineUpdateBefore",!0),o("theme","default",function(r){al(r),ea(r)},!0),o("keyMap","default",function(r,y,B){var $=ns(y),J=B!=Ao&&ns(B);J&&J.detach&&J.detach(r,$),$.attach&&$.attach(r,J||null)}),o("extraKeys",null),o("configureMouse",null),o("lineWrapping",!1,Zl,!0),o("gutters",[],function(r,y){r.display.gutterSpecs=_i(y,r.options.lineNumbers),ea(r)},!0),o("fixedGutter",!0,function(r,y){r.display.gutters.style.left=y?yi(r.display)+"px":"0",r.refresh()},!0),o("coverGutterNextToScrollbar",!1,function(r){return pa(r)},!0),o("scrollbarStyle","native",function(r){Wa(r),pa(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),o("lineNumbers",!1,function(r,y){r.display.gutterSpecs=_i(r.options.gutters,y),ea(r)},!0),o("firstLineNumber",1,ea,!0),o("lineNumberFormatter",function(r){return r},ea,!0),o("showCursorWhenSelecting",!1,Cr,!0),o("resetSelectionOnContextMenu",!0),o("lineWiseCopyCut",!0),o("pasteLinesPerSelection",!0),o("selectionsMayTouch",!1),o("readOnly",!1,function(r,y){y=="nocursor"&&(Ea(r),r.display.input.blur()),r.display.input.readOnlyChanged(y)}),o("screenReaderLabel",null,function(r,y){y=y===""?null:y,r.display.input.screenReaderLabelChanged(y)}),o("disableInput",!1,function(r,y){y||r.display.input.reset()},!0),o("dragDrop",!0,Ql),o("allowDropFileTypes",null),o("cursorBlinkRate",530),o("cursorScrollMargin",0),o("cursorHeight",1,Cr,!0),o("singleCursorHeightPerLine",!0,Cr,!0),o("workTime",100),o("workDelay",100),o("flattenSpans",!0,bi,!0),o("addModeClass",!1,bi,!0),o("pollInterval",100),o("undoDepth",200,function(r,y){return r.doc.history.undoDepth=y}),o("historyEventDelay",1250),o("viewportMargin",10,function(r){return r.refresh()},!0),o("maxHighlightLength",1e4,bi,!0),o("moveInputWithCursor",!0,function(r,y){y||r.display.input.resetPosition()}),o("tabindex",null,function(r,y){return r.display.input.getField().tabIndex=y||""}),o("autofocus",null),o("direction","ltr",function(r,y){return r.doc.setDirection(y)},!0),o("phrases",null)}function Ql(e,t,o){var r=o&&o!=Ao;if(!t!=!r){var y=e.display.dragFunctions,B=t?Ze:Ot;B(e.display.scroller,"dragstart",y.start),B(e.display.scroller,"dragenter",y.enter),B(e.display.scroller,"dragover",y.over),B(e.display.scroller,"dragleave",y.leave),B(e.display.scroller,"drop",y.drop)}}function Zl(e){e.options.lineWrapping?(W(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(g(e.display.wrapper,"CodeMirror-wrap"),ur(e)),Ci(e),Tr(e),zn(e),setTimeout(function(){return pa(e)},100)}function Xr(e,t){var o=this;if(!(this instanceof Xr))return new Xr(e,t);this.options=t=t?v(t):{},v(ol,t,!1);var r=t.value;typeof r=="string"?r=new Fi(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var y=new Xr.inputStyles[t.inputStyle](this),B=this.display=new Ra(e,r,y,t);B.wrapper.CodeMirror=this,al(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wa(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 X,keySeq:null,specialChars:null},t.autofocus&&!u&&B.input.focus(),G&&K<11&&setTimeout(function(){return o.display.input.reset(!0)},20),Jl(this),Rl(),qi(this),this.curOp.forceUpdate=!0,Vr(this,r),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){o.hasFocus()&&!o.state.focused&&ca(o)},20):Ea(this);for(var $ in is)is.hasOwnProperty($)&&is[$](this,t[$],Ao);ci(this),t.finishInit&&t.finishInit(this);for(var J=0;J<gs.length;++J)gs[J](this);oa(this),n&&t.lineWrapping&&getComputedStyle(B.lineDiv).textRendering=="optimizelegibility"&&(B.lineDiv.style.textRendering="auto")}Xr.defaults=ol,Xr.optionHandlers=is;function Jl(e){var t=e.display;Ze(t.scroller,"mousedown",Jr(e,tl)),G&&K<11?Ze(t.scroller,"dblclick",Jr(e,function(ee){if(st(e,ee))return;var oe=Zr(e,ee);if(!oe||ms(e,ee)||ra(e.display,ee))return;ce(ee);var Oe=e.findWordAt(oe);Zo(e.doc,Oe.anchor,Oe.head)})):Ze(t.scroller,"dblclick",function(ee){return st(e,ee)||ce(ee)}),Ze(t.scroller,"contextmenu",function(ee){return il(e,ee)}),Ze(t.input.getField(),"contextmenu",function(ee){t.scroller.contains(ee.target)||il(e,ee)});var o,r={end:0};function y(){t.activeTouch&&(o=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function B(ee){if(ee.touches.length!=1)return!1;var oe=ee.touches[0];return oe.radiusX<=1&&oe.radiusY<=1}function $(ee,oe){if(oe.left==null)return!0;var Oe=oe.left-ee.left,Ie=oe.top-ee.top;return Oe*Oe+Ie*Ie>20*20}Ze(t.scroller,"touchstart",function(ee){if(!st(e,ee)&&!B(ee)&&!ms(e,ee)){t.input.ensurePolled(),clearTimeout(o);var oe=+new Date;t.activeTouch={start:oe,moved:!1,prev:oe-r.end<=300?r:null},ee.touches.length==1&&(t.activeTouch.left=ee.touches[0].pageX,t.activeTouch.top=ee.touches[0].pageY)}}),Ze(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ze(t.scroller,"touchend",function(ee){var oe=t.activeTouch;if(oe&&!ra(t,ee)&&oe.left!=null&&!oe.moved&&new Date-oe.start<300){var Oe=e.coordsChar(t.activeTouch,"page"),Ie;!oe.prev||$(oe,oe.prev)?Ie=new ot(Oe,Oe):!oe.prev.prev||$(oe,oe.prev.prev)?Ie=e.findWordAt(Oe):Ie=new ot(Et(Oe.line,0),L(e.doc,Et(Oe.line+1,0))),e.setSelection(Ie.anchor,Ie.head),e.focus(),ce(ee)}y()}),Ze(t.scroller,"touchcancel",y),Ze(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ha(e,t.scroller.scrollTop),Pi(e,t.scroller.scrollLeft,!0),qe(e,"scroll",e))}),Ze(t.scroller,"mousewheel",function(ee){return Je(e,ee)}),Ze(t.scroller,"DOMMouseScroll",function(ee){return Je(e,ee)}),Ze(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ee){st(e,ee)||Re(ee)},over:function(ee){st(e,ee)||(Ol(e,ee),Re(ee))},start:function(ee){return Al(e,ee)},drop:Jr(e,Sl),leave:function(ee){st(e,ee)||Hs(e)}};var J=t.input.getField();Ze(J,"keyup",function(ee){return qs.call(e,ee)}),Ze(J,"keydown",Jr(e,Js)),Ze(J,"keypress",Jr(e,el)),Ze(J,"focus",function(ee){return ca(e,ee)}),Ze(J,"blur",function(ee){return Ea(e,ee)})}var gs=[];Xr.defineInitHook=function(e){return gs.push(e)};function $o(e,t,o,r){var y=e.doc,B;o==null&&(o="add"),o=="smart"&&(y.mode.indent?B=Lt(e,t).state:o="prev");var $=e.options.tabSize,J=Qt(y,t),ee=H(J.text,null,$);J.stateAfter&&(J.stateAfter=null);var oe=J.text.match(/^\s*/)[0],Oe;if(!r&&!/\S/.test(J.text))Oe=0,o="not";else if(o=="smart"&&(Oe=y.mode.indent(B,J.text.slice(oe.length),J.text),Oe==ye||Oe>150)){if(!r)return;o="prev"}o=="prev"?t>y.first?Oe=H(Qt(y,t-1).text,null,$):Oe=0:o=="add"?Oe=ee+e.options.indentUnit:o=="subtract"?Oe=ee-e.options.indentUnit:typeof o=="number"&&(Oe=ee+o),Oe=Math.max(0,Oe);var Ie="",Qe=0;if(e.options.indentWithTabs)for(var Xe=Math.floor(Oe/$);Xe;--Xe)Qe+=$,Ie+=" ";if(Qe<Oe&&(Ie+=ae(Oe-Qe)),Ie!=oe)return To(y,Ie,Et(t,0),Et(t,oe.length),"+input"),J.stateAfter=null,!0;for(var dt=0;dt<y.sel.ranges.length;dt++){var bt=y.sel.ranges[dt];if(bt.head.line==t&&bt.head.ch<oe.length){var It=Et(t,oe.length);us(y,dt,new ot(It,It));break}}}var ga=null;function as(e){ga=e}function vs(e,t,o,r,y){var B=e.doc;e.display.shift=!1,r||(r=B.sel);var $=+new Date-200,J=y=="paste"||e.state.pasteIncoming>$,ee=En(t),oe=null;if(J&&r.ranges.length>1)if(ga&&ga.text.join(`
`)==t){if(r.ranges.length%ga.text.length==0){oe=[];for(var Oe=0;Oe<ga.text.length;Oe++)oe.push(B.splitLines(ga.text[Oe]))}}else ee.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(oe=ze(ee,function(Ft){return[Ft]}));for(var Ie=e.curOp.updateInput,Qe=r.ranges.length-1;Qe>=0;Qe--){var Xe=r.ranges[Qe],dt=Xe.from(),bt=Xe.to();Xe.empty()&&(o&&o>0?dt=Et(dt.line,dt.ch-o):e.state.overwrite&&!J?bt=Et(bt.line,Math.min(Qt(B,bt.line).text.length,bt.ch+Ce(ee).length)):J&&ga&&ga.lineWise&&ga.text.join(`
`)==ee.join(`
`)&&(dt=bt=Et(dt.line,0)));var It={from:dt,to:bt,text:oe?oe[Qe%oe.length]:ee,origin:y||(J?"paste":e.state.cutIncoming>$?"cut":"+input")};xo(e.doc,It),Gr(e,"inputRead",e,It)}t&&!J&&ll(e,t),da(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ie),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,t){var o=e.clipboardData&&e.clipboardData.getData("Text");if(o)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&ni(t,function(){return vs(t,o,0,null,"paste")}),!0}function ll(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var o=e.doc.sel,r=o.ranges.length-1;r>=0;r--){var y=o.ranges[r];if(y.head.ch>100||r&&o.ranges[r-1].head.line==y.head.line)continue;var B=e.getModeAt(y.head),$=!1;if(B.electricChars){for(var J=0;J<B.electricChars.length;J++)if(t.indexOf(B.electricChars.charAt(J))>-1){$=$o(e,y.head.line,"smart");break}}else B.electricInput&&(B.electricInput.test(Qt(e.doc,y.head.line).text.slice(0,y.head.ch))&&($=$o(e,y.head.line,"smart")));$&&Gr(e,"electricInput",e,y.head.line)}}function ul(e){for(var t=[],o=[],r=0;r<e.doc.sel.ranges.length;r++){var y=e.doc.sel.ranges[r].head.line,B={anchor:Et(y,0),head:Et(y+1,0)};o.push(B),t.push(e.getRange(B.anchor,B.head))}return{text:t,ranges:o}}function cl(e,t,o,r){e.setAttribute("autocorrect",o?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function dl(){var e=d("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=d("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),p&&(e.style.border="1px solid black"),cl(e),t}function ql(e){var t=e.optionHandlers,o=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,y){var B=this.options,$=B[r];if(B[r]==y&&r!="mode")return;B[r]=y,t.hasOwnProperty(r)&&Jr(this,t[r])(this,y,$),qe(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,y){this.state.keyMaps[y?"push":"unshift"](ns(r))},removeKeyMap:function(r){for(var y=this.state.keyMaps,B=0;B<y.length;++B)if(y[B]==r||y[B].name==r)return y.splice(B,1),!0},addOverlay:pi(function(r,y){var B=r.token?r:e.getMode(this.options,r);if(B.startState)throw new Error("Overlays may not be stateful.");Ye(this.state.overlays,{mode:B,modeSpec:r,opaque:y&&y.opaque,priority:y&&y.priority||0},function($){return $.priority}),this.state.modeGen++,Tr(this)}),removeOverlay:pi(function(r){for(var y=this.state.overlays,B=0;B<y.length;++B){var $=y[B].modeSpec;if($==r||typeof r=="string"&&$.name==r){y.splice(B,1),this.state.modeGen++,Tr(this);return}}}),indentLine:pi(function(r,y,B){typeof y!="string"&&typeof y!="number"&&(y==null?y=this.options.smartIndent?"smart":"prev":y=y?"add":"subtract"),vi(this.doc,r)&&$o(this,r,y,B)}),indentSelection:pi(function(r){for(var y=this.doc.sel.ranges,B=-1,$=0;$<y.length;$++){var J=y[$];if(J.empty())J.head.line>B&&($o(this,J.head.line,r,!0),B=J.head.line,$==this.doc.sel.primIndex&&da(this));else{var ee=J.from(),oe=J.to(),Oe=Math.max(B,ee.line);B=Math.min(this.lastLine(),oe.line-(oe.ch?0:1))+1;for(var Ie=Oe;Ie<B;++Ie)$o(this,Ie,r);var Qe=this.doc.sel.ranges;ee.ch==0&&y.length==Qe.length&&Qe[$].from().ch>0&&us(this.doc,$,new ot(ee,Qe[$].to()),pe)}}}),getTokenAt:function(r,y){return Ir(this,r,y)},getLineTokens:function(r,y){return Ir(this,Et(r),y,!0)},getTokenTypeAt:function(r){r=L(this.doc,r);var y=pt(this,Qt(this.doc,r.line)),B=0,$=(y.length-1)/2,J=r.ch,ee;if(J==0)ee=y[2];else for(;;){var oe=B+$>>1;if((oe?y[oe*2-1]:0)>=J)$=oe;else if(y[oe*2+1]<J)B=oe+1;else{ee=y[oe*2+2];break}}var Oe=ee?ee.indexOf("overlay "):-1;return Oe<0?ee:Oe==0?null:ee.slice(0,Oe-1)},getModeAt:function(r){var y=this.doc.mode;return y.innerMode?e.innerMode(y,this.getTokenAt(r).state).mode:y},getHelper:function(r,y){return this.getHelpers(r,y)[0]},getHelpers:function(r,y){var B=[];if(!o.hasOwnProperty(y))return B;var $=o[y],J=this.getModeAt(r);if(typeof J[y]=="string")$[J[y]]&&B.push($[J[y]]);else if(J[y])for(var ee=0;ee<J[y].length;ee++){var oe=$[J[y][ee]];oe&&B.push(oe)}else J.helperType&&$[J.helperType]?B.push($[J.helperType]):$[J.name]&&B.push($[J.name]);for(var Oe=0;Oe<$._global.length;Oe++){var Ie=$._global[Oe];Ie.pred(J,this)&&q(B,Ie.val)==-1&&B.push(Ie.val)}return B},getStateAfter:function(r,y){var B=this.doc;return r=Z(B,r==null?B.first+B.size-1:r),Lt(this,r+1,y).state},cursorCoords:function(r,y){var B,$=this.doc.sel.primary();return r==null?B=$.head:typeof r=="object"?B=L(this.doc,r):B=r?$.from():$.to(),tr(this,B,y||"page")},charCoords:function(r,y){return jr(this,L(this.doc,r),y||"page")},coordsChar:function(r,y){return r=er(this,r,y||"page"),Wn(this,r.left,r.top)},lineAtHeight:function(r,y){return r=er(this,{top:r,left:0},y||"page").top,Ur(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,y,B){var $=!1,J;if(typeof r=="number"){var ee=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>ee&&(r=ee,$=!0),J=Qt(this.doc,r)}else J=r;return Jn(this,J,{top:0,left:0},y||"page",B||$).top+($?this.doc.height-Bt(J):0)},defaultTextHeight:function(){return zr(this.display)},defaultCharWidth:function(){return Qr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,y,B,$,J){var ee=this.display;r=tr(this,L(this.doc,r));var oe=r.bottom,Oe=r.left;if(y.style.position="absolute",y.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(y),ee.sizer.appendChild(y),$=="over")oe=r.top;else if($=="above"||$=="near"){var Ie=Math.max(ee.wrapper.clientHeight,this.doc.height),Qe=Math.max(ee.sizer.clientWidth,ee.lineSpace.clientWidth);($=="above"||r.bottom+y.offsetHeight>Ie)&&r.top>y.offsetHeight?oe=r.top-y.offsetHeight:r.bottom+y.offsetHeight<=Ie&&(oe=r.bottom),Oe+y.offsetWidth>Qe&&(Oe=Qe-y.offsetWidth)}y.style.top=oe+"px",y.style.left=y.style.right="",J=="right"?(Oe=ee.sizer.clientWidth-y.offsetWidth,y.style.right="0px"):(J=="left"?Oe=0:J=="middle"&&(Oe=(ee.sizer.clientWidth-y.offsetWidth)/2),y.style.left=Oe+"px"),B&&mo(this,{left:Oe,top:oe,right:Oe+y.offsetWidth,bottom:oe+y.offsetHeight})},triggerOnKeyDown:pi(Js),triggerOnKeyPress:pi(el),triggerOnKeyUp:qs,triggerOnMouseDown:pi(tl),execCommand:function(r){if(zo.hasOwnProperty(r))return zo[r].call(null,this)},triggerElectric:pi(function(r){ll(this,r)}),findPosH:function(r,y,B,$){var J=1;y<0&&(J=-1,y=-y);for(var ee=L(this.doc,r),oe=0;oe<y&&!(ee=ys(this.doc,ee,J,B,$),ee.hitSide);++oe);return ee},moveH:pi(function(r,y){var B=this;this.extendSelectionsBy(function($){return B.display.shift||B.doc.extend||$.empty()?ys(B.doc,$.head,r,y,B.options.rtlMoveVisually):r<0?$.from():$.to()},fe)}),deleteH:pi(function(r,y){var B=this.doc.sel,$=this.doc;B.somethingSelected()?$.replaceSelection("",null,"+delete"):So(this,function(J){var ee=ys($,J.head,r,y,!1);return r<0?{from:ee,to:J.head}:{from:J.head,to:ee}})}),findPosV:function(r,y,B,$){var J=1,ee=$;y<0&&(J=-1,y=-y);for(var oe=L(this.doc,r),Oe=0;Oe<y;++Oe){var Ie=tr(this,oe,"div");if(ee==null?ee=Ie.left:Ie.left=ee,oe=hl(this,Ie,J,B),oe.hitSide)break}return oe},moveV:pi(function(r,y){var B=this,$=this.doc,J=[],ee=!this.display.shift&&!$.extend&&$.sel.somethingSelected();if($.extendSelectionsBy(function(Oe){if(ee)return r<0?Oe.from():Oe.to();var Ie=tr(B,Oe.head,"div");Oe.goalColumn!=null&&(Ie.left=Oe.goalColumn),J.push(Ie.left);var Qe=hl(B,Ie,r,y);return y=="page"&&Oe==$.sel.primary()&&qa(B,jr(B,Qe,"div").top-Ie.top),Qe},fe),J.length)for(var oe=0;oe<$.sel.ranges.length;oe++)$.sel.ranges[oe].goalColumn=J[oe]}),findWordAt:function(r){var y=this.doc,B=Qt(y,r.line).text,$=r.ch,J=r.ch;if(B){var ee=this.getHelper(r,"wordChars");(r.sticky=="before"||J==B.length)&&$?--$:++J;for(var oe=B.charAt($),Oe=nt(oe,ee)?function(Ie){return nt(Ie,ee)}:/\s/.test(oe)?function(Ie){return/\s/.test(Ie)}:function(Ie){return!/\s/.test(Ie)&&!nt(Ie)};$>0&&Oe(B.charAt($-1));)--$;for(;J<B.length&&Oe(B.charAt(J));)++J}return new ot(Et(r.line,$),Et(r.line,J))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?W(this.display.cursorDiv,"CodeMirror-overwrite"):g(this.display.cursorDiv,"CodeMirror-overwrite"),qe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==j()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:pi(function(r,y){xa(this,r,y)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-We(this)-this.display.barHeight,width:r.scrollWidth-We(this)-this.display.barWidth,clientHeight:ie(this),clientWidth:Se(this)}},scrollIntoView:pi(function(r,y){r==null?(r={from:this.doc.sel.primary().head,to:null},y==null&&(y=this.options.cursorScrollMargin)):typeof r=="number"?r={from:Et(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=y||0,r.from.line!=null?go(this,r):Ta(this,r.from,r.to,r.margin)}),setSize:pi(function(r,y){var B=this,$=function(ee){return typeof ee=="number"||/^\d+$/.test(String(ee))?ee+"px":ee};r!=null&&(this.display.wrapper.style.width=$(r)),y!=null&&(this.display.wrapper.style.height=$(y)),this.options.lineWrapping&&Bn(this);var J=this.display.viewFrom;this.doc.iter(J,this.display.viewTo,function(ee){if(ee.widgets){for(var oe=0;oe<ee.widgets.length;oe++)if(ee.widgets[oe].noHScroll){wn(B,J,"widget");break}}++J}),this.curOp.forceUpdate=!0,qe(this,"refresh",this)}),operation:function(r){return ni(this,r)},startOperation:function(){return qi(this)},endOperation:function(){return oa(this)},refresh:pi(function(){var r=this.display.cachedTextHeight;Tr(this),this.curOp.forceUpdate=!0,zn(this),xa(this,this.doc.scrollLeft,this.doc.scrollTop),za(this.display),(r==null||Math.abs(r-zr(this.display))>.5||this.options.lineWrapping)&&Ci(this),qe(this,"refresh",this)}),swapDoc:pi(function(r){var y=this.doc;return y.cm=null,this.state.selectingText&&this.state.selectingText(),Vr(this,r),zn(this),this.display.input.reset(),xa(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Gr(this,"swapDoc",this,y),y}),phrase:function(r){var y=this.options.phrases;return y&&Object.prototype.hasOwnProperty.call(y,r)?y[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}},me(e),e.registerHelper=function(r,y,B){o.hasOwnProperty(r)||(o[r]=e[r]={_global:[]}),o[r][y]=B},e.registerGlobalHelper=function(r,y,B,$){e.registerHelper(r,y,$),o[r]._global.push({pred:B,val:$})}}function ys(e,t,o,r,y){var B=t,$=o,J=Qt(e,t.line),ee=y&&e.direction=="rtl"?-o:o;function oe(){var qt=t.line+ee;return qt<e.first||qt>=e.first+e.size?!1:(t=new Et(qt,t.ch,t.sticky),J=Qt(e,qt))}function Oe(qt){var Wt;if(r=="codepoint"){var on=J.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(on)?Wt=null:Wt=new Et(t.line,Math.max(0,Math.min(J.text.length,t.ch+o*(on>=55296&&on<56320?2:1))),-o)}else y?Wt=kl(e.cm,J,t,o):Wt=ds(J,t,o);if(Wt==null)if(!qt&&oe())t=hs(y,e.cm,J,t.line,ee);else return!1;else t=Wt;return!0}if(r=="char"||r=="codepoint")Oe();else if(r=="column")Oe(!0);else if(r=="word"||r=="group")for(var Ie=null,Qe=r=="group",Xe=e.cm&&e.cm.getHelper(t,"wordChars"),dt=!0;!(o<0&&!Oe(!dt));dt=!1){var bt=J.text.charAt(t.ch)||`
`,It=nt(bt,Xe)?"w":Qe&&bt==`
`?"n":!Qe||/\s/.test(bt)?null:"p";if(Qe&&!dt&&!It&&(It="s"),Ie&&Ie!=It){o<0&&(o=1,Oe(),t.sticky="after");break}if(It&&(Ie=It),o>0&&!Oe(!dt))break}var Ft=qo(e,t,B,$,!0);return Gi(B,Ft)&&(Ft.hitSide=!0),Ft}function hl(e,t,o,r){var y=e.doc,B=t.left,$;if(r=="page"){var J=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ee=Math.max(J-.5*zr(e.display),3);$=(o>0?t.bottom:t.top)+o*ee}else r=="line"&&($=o>0?t.bottom+3:t.top-3);for(var oe;!(oe=Wn(e,B,$),!oe.outside);){if(o<0?$<=0:$>=y.height){oe.hitSide=!0;break}$+=o*5}return oe}var Mr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new X,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Mr.prototype.init=function(e){var t=this,o=this,r=o.cm,y=o.div=e.lineDiv;cl(y,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function B(J){for(var ee=J.target;ee;ee=ee.parentNode){if(ee==y)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ee.className))break}return!1}Ze(y,"paste",function(J){if(!B(J)||st(r,J)||sl(J,r))return;K<=11&&setTimeout(Jr(r,function(){return t.updateFromDOM()}),20)}),Ze(y,"compositionstart",function(J){t.composing={data:J.data,done:!1}}),Ze(y,"compositionupdate",function(J){t.composing||(t.composing={data:J.data,done:!1})}),Ze(y,"compositionend",function(J){t.composing&&(J.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ze(y,"touchstart",function(){return o.forceCompositionEnd()}),Ze(y,"input",function(){t.composing||t.readFromDOMSoon()});function $(J){if(!B(J)||st(r,J))return;if(r.somethingSelected())as({lineWise:!1,text:r.getSelections()}),J.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var ee=ul(r);as({lineWise:!0,text:ee.text}),J.type=="cut"&&r.operation(function(){r.setSelections(ee.ranges,0,pe),r.replaceSelection("",null,"cut")})}else return;if(J.clipboardData){J.clipboardData.clearData();var oe=ga.text.join(`
`);if(J.clipboardData.setData("Text",oe),J.clipboardData.getData("Text")==oe){J.preventDefault();return}}var Oe=dl(),Ie=Oe.firstChild;r.display.lineSpace.insertBefore(Oe,r.display.lineSpace.firstChild),Ie.value=ga.text.join(`
`);var Qe=document.activeElement;M(Ie),setTimeout(function(){r.display.lineSpace.removeChild(Oe),Qe.focus(),Qe==y&&o.showPrimarySelection()},50)}Ze(y,"copy",$),Ze(y,"cut",$)},Mr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Mr.prototype.prepareSelection=function(){var e=Xi(this.cm,!1);return e.focus=document.activeElement==this.div,e},Mr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Mr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Mr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,o=t.doc.sel.primary(),r=o.from(),y=o.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||y.line<t.display.viewFrom){e.removeAllRanges();return}var B=os(t,e.anchorNode,e.anchorOffset),$=os(t,e.focusNode,e.focusOffset);if(B&&!B.bad&&$&&!$.bad&&fn(Vi(B,$),r)==0&&fn(na(B,$),y)==0)return;var J=t.display.view,ee=r.line>=t.display.viewFrom&&fl(t,r)||{node:J[0].measure.map[2],offset:0},oe=y.line<t.display.viewTo&&fl(t,y);if(!oe){var Oe=J[J.length-1].measure,Ie=Oe.maps?Oe.maps[Oe.maps.length-1]:Oe.map;oe={node:Ie[Ie.length-1],offset:Ie[Ie.length-2]-Ie[Ie.length-3]}}if(!ee||!oe){e.removeAllRanges();return}var Qe=e.rangeCount&&e.getRangeAt(0),Xe;try{Xe=x(ee.node,ee.offset,oe.offset,oe.node)}catch(dt){}Xe&&(!N&&t.state.focused?(e.collapse(ee.node,ee.offset),Xe.collapsed||(e.removeAllRanges(),e.addRange(Xe))):(e.removeAllRanges(),e.addRange(Xe)),Qe&&e.anchorNode==null?e.addRange(Qe):N&&this.startGracePeriod()),this.rememberSelection()},Mr.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)},Mr.prototype.showMultipleSelections=function(e){h(this.cm.display.cursorDiv,e.cursors),h(this.cm.display.selectionDiv,e.selection)},Mr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Mr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return w(this.div,t)},Mr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Mr.prototype.blur=function(){this.div.blur()},Mr.prototype.getField=function(){return this.div},Mr.prototype.supportsTouch=function(){return!0},Mr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():ni(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)},Mr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Mr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(l&&E&&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 o=os(t,e.anchorNode,e.anchorOffset),r=os(t,e.focusNode,e.focusOffset);o&&r&&ni(t,function(){Di(t.doc,At(o,r),pe),(o.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},Mr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,o=e.doc.sel.primary(),r=o.from(),y=o.to();if(r.ch==0&&r.line>e.firstLine()&&(r=Et(r.line-1,Qt(e.doc,r.line-1).length)),y.ch==Qt(e.doc,y.line).text.length&&y.line<e.lastLine()&&(y=Et(y.line+1,0)),r.line<t.viewFrom||y.line>t.viewTo-1)return!1;var B,$,J;r.line==t.viewFrom||(B=Pr(e,r.line))==0?($=kn(t.view[0].line),J=t.view[0].node):($=kn(t.view[B].line),J=t.view[B-1].node.nextSibling);var ee=Pr(e,y.line),oe,Oe;if(ee==t.view.length-1?(oe=t.viewTo-1,Oe=t.lineDiv.lastChild):(oe=kn(t.view[ee+1].line)-1,Oe=t.view[ee+1].node.previousSibling),!J)return!1;for(var Ie=e.doc.splitLines(tu(e,J,Oe,$,oe)),Qe=$r(e.doc,Et($,0),Et(oe,Qt(e.doc,oe).text.length));Ie.length>1&&Qe.length>1;)if(Ce(Ie)==Ce(Qe))Ie.pop(),Qe.pop(),oe--;else if(Ie[0]==Qe[0])Ie.shift(),Qe.shift(),$++;else break;for(var Xe=0,dt=0,bt=Ie[0],It=Qe[0],Ft=Math.min(bt.length,It.length);Xe<Ft&&bt.charCodeAt(Xe)==It.charCodeAt(Xe);)++Xe;for(var qt=Ce(Ie),Wt=Ce(Qe),on=Math.min(qt.length-(Ie.length==1?Xe:0),Wt.length-(Qe.length==1?Xe:0));dt<on&&qt.charCodeAt(qt.length-dt-1)==Wt.charCodeAt(Wt.length-dt-1);)++dt;if(Ie.length==1&&Qe.length==1&&$==r.line)for(;Xe&&Xe>r.ch&&qt.charCodeAt(qt.length-dt-1)==Wt.charCodeAt(Wt.length-dt-1);)Xe--,dt++;Ie[Ie.length-1]=qt.slice(0,qt.length-dt).replace(/^\u200b+/,""),Ie[0]=Ie[0].slice(Xe).replace(/\u200b+$/,"");var In=Et($,Xe),bn=Et(oe,Qe.length?Ce(Qe).length-dt:0);if(Ie.length>1||Ie[0]||fn(In,bn))return To(e.doc,Ie,In,bn,"+input"),!0},Mr.prototype.ensurePolled=function(){this.forceCompositionEnd()},Mr.prototype.reset=function(){this.forceCompositionEnd()},Mr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Mr.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)},Mr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ni(this.cm,function(){return Tr(e.cm)})},Mr.prototype.setUneditable=function(e){e.contentEditable="false"},Mr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Jr(this.cm,vs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Mr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Mr.prototype.onContextMenu=function(){},Mr.prototype.resetPosition=function(){},Mr.prototype.needsContentAttribute=!0;function fl(e,t){var o=Be(e,t.line);if(!o||o.hidden)return null;var r=Qt(e.doc,t.line),y=le(o,r,t.line),B=gt(r,e.doc.direction),$="left";if(B){var J=at(B,t.ch);$=J%2?"right":"left"}var ee=yt(y.map,t.ch,$);return ee.offset=ee.collapse=="right"?ee.end:ee.start,ee}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Oo(e,t){return t&&(e.bad=!0),e}function tu(e,t,o,r,y){var B="",$=!1,J=e.doc.lineSeparator(),ee=!1;function oe(Xe){return function(dt){return dt.id==Xe}}function Oe(){$&&(B+=J,ee&&(B+=J),$=ee=!1)}function Ie(Xe){Xe&&(Oe(),B+=Xe)}function Qe(Xe){if(Xe.nodeType==1){var dt=Xe.getAttribute("cm-text");if(dt){Ie(dt);return}var bt=Xe.getAttribute("cm-marker"),It;if(bt){var Ft=e.findMarks(Et(r,0),Et(y+1,0),oe(+bt));Ft.length&&(It=Ft[0].find(0))&&Ie($r(e.doc,It.from,It.to).join(J));return}if(Xe.getAttribute("contenteditable")=="false")return;var qt=/^(pre|div|p|li|table|br)$/i.test(Xe.nodeName);if(!/^br$/i.test(Xe.nodeName)&&Xe.textContent.length==0)return;qt&&Oe();for(var Wt=0;Wt<Xe.childNodes.length;Wt++)Qe(Xe.childNodes[Wt]);/^(pre|p)$/i.test(Xe.nodeName)&&(ee=!0),qt&&($=!0)}else Xe.nodeType==3&&Ie(Xe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Qe(t),t==o);)t=t.nextSibling,ee=!1;return B}function os(e,t,o){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[o],!r)return Oo(e.clipPos(Et(e.display.viewTo-1)),!0);t=null,o=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 y=0;y<e.display.view.length;y++){var B=e.display.view[y];if(B.node==r)return nu(B,t,o)}}function nu(e,t,o){var r=e.text.firstChild,y=!1;if(!t||!w(r,t))return Oo(Et(kn(e.line),0),!0);if(t==r&&(y=!0,t=r.childNodes[o],o=0,!t)){var B=e.rest?Ce(e.rest):e.line;return Oo(Et(kn(B),B.text.length),y)}var $=t.nodeType==3?t:null,J=t;for(!$&&t.childNodes.length==1&&t.firstChild.nodeType==3&&($=t.firstChild,o&&(o=$.nodeValue.length));J.parentNode!=r;)J=J.parentNode;var ee=e.measure,oe=ee.maps;function Oe(It,Ft,qt){for(var Wt=-1;Wt<(oe?oe.length:0);Wt++)for(var on=Wt<0?ee.map:oe[Wt],In=0;In<on.length;In+=3){var bn=on[In+2];if(bn==It||bn==Ft){var ar=kn(Wt<0?e.line:e.rest[Wt]),Fr=on[In]+qt;return(qt<0||bn!=It)&&(Fr=on[In+(qt?1:0)]),Et(ar,Fr)}}}var Ie=Oe($,J,o);if(Ie)return Oo(Ie,y);for(var Qe=J.nextSibling,Xe=$?$.nodeValue.length-o:0;Qe;Qe=Qe.nextSibling){if(Ie=Oe(Qe,Qe.firstChild,0),Ie)return Oo(Et(Ie.line,Ie.ch-Xe),y);Xe+=Qe.textContent.length}for(var dt=J.previousSibling,bt=o;dt;dt=dt.previousSibling){if(Ie=Oe(dt,dt.firstChild,-1),Ie)return Oo(Et(Ie.line,Ie.ch+bt),y);bt+=dt.textContent.length}}var ui=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new X,this.hasSelection=!1,this.composing=null};ui.prototype.init=function(e){var t=this,o=this,r=this.cm;this.createField(e);var y=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),p&&(y.style.width="0px"),Ze(y,"input",function(){G&&K>=9&&t.hasSelection&&(t.hasSelection=null),o.poll()}),Ze(y,"paste",function($){if(st(r,$)||sl($,r))return;r.state.pasteIncoming=+new Date,o.fastPoll()});function B($){if(st(r,$))return;if(r.somethingSelected())as({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var J=ul(r);as({lineWise:!0,text:J.text}),$.type=="cut"?r.setSelections(J.ranges,null,pe):(o.prevInput="",y.value=J.text.join(`
`),M(y))}else return;$.type=="cut"&&(r.state.cutIncoming=+new Date)}Ze(y,"cut",B),Ze(y,"copy",B),Ze(e.scroller,"paste",function($){if(ra(e,$)||st(r,$))return;if(!y.dispatchEvent){r.state.pasteIncoming=+new Date,o.focus();return}var J=new Event("paste");J.clipboardData=$.clipboardData,y.dispatchEvent(J)}),Ze(e.lineSpace,"selectstart",function($){ra(e,$)||ce($)}),Ze(y,"compositionstart",function(){var $=r.getCursor("from");o.composing&&o.composing.range.clear(),o.composing={start:$,range:r.markText($,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ze(y,"compositionend",function(){o.composing&&(o.poll(),o.composing.range.clear(),o.composing=null)})},ui.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},ui.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ui.prototype.prepareSelection=function(){var e=this.cm,t=e.display,o=e.doc,r=Xi(e);if(e.options.moveInputWithCursor){var y=tr(e,o.sel.primary().head,"div"),B=t.wrapper.getBoundingClientRect(),$=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,y.top+$.top-B.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,y.left+$.left-B.left))}return r},ui.prototype.showSelection=function(e){var t=this.cm,o=t.display;h(o.cursorDiv,e.cursors),h(o.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ui.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var o=t.getSelection();this.textarea.value=o,t.state.focused&&M(this.textarea),G&&K>=9&&(this.hasSelection=o)}else e||(this.prevInput=this.textarea.value="",G&&K>=9&&(this.hasSelection=null))},ui.prototype.getField=function(){return this.textarea},ui.prototype.supportsTouch=function(){return!1},ui.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},ui.prototype.blur=function(){this.textarea.blur()},ui.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ui.prototype.receivedFocus=function(){this.slowPoll()},ui.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()})},ui.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function o(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,o)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,o)},ui.prototype.poll=function(){var e=this,t=this.cm,o=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||$t(o)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var y=o.value;if(y==r&&!t.somethingSelected())return!1;if(G&&K>=9&&this.hasSelection===y||s&&/[\uf700-\uf7ff]/.test(y))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var B=y.charCodeAt(0);if(B==8203&&!r&&(r="\u200B"),B==8666)return this.reset(),this.cm.execCommand("undo")}for(var $=0,J=Math.min(r.length,y.length);$<J&&r.charCodeAt($)==y.charCodeAt($);)++$;return ni(t,function(){vs(t,y.slice($),r.length-$,null,e.composing?"*compose":null),y.length>1e3||y.indexOf(`
`)>-1?o.value=e.prevInput="":e.prevInput=y,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ui.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ui.prototype.onKeyPress=function(){G&&K>=9&&(this.hasSelection=null),this.fastPoll()},ui.prototype.onContextMenu=function(e){var t=this,o=t.cm,r=o.display,y=t.textarea;t.contextMenuPending&&t.contextMenuPending();var B=Zr(o,e),$=r.scroller.scrollTop;if(!B||f)return;var J=o.options.resetSelectionOnContextMenu;J&&o.doc.sel.contains(B)==-1&&Jr(o,Di)(o.doc,At(B),pe);var ee=y.style.cssText,oe=t.wrapper.style.cssText,Oe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",y.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Oe.top-5)+"px; left: "+(e.clientX-Oe.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(),o.somethingSelected()||(y.value=t.prevInput=" "),t.contextMenuPending=Xe,r.selForContextMenu=o.doc.sel,clearTimeout(r.detectingSelectAll);function Qe(){if(y.selectionStart!=null){var bt=o.somethingSelected(),It="\u200B"+(bt?y.value:"");y.value="\u21DA",y.value=It,t.prevInput=bt?"":"\u200B",y.selectionStart=1,y.selectionEnd=It.length,r.selForContextMenu=o.doc.sel}}function Xe(){if(t.contextMenuPending!=Xe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=oe,y.style.cssText=ee,G&&K<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=$),y.selectionStart!=null){(!G||G&&K<9)&&Qe();var bt=0,It=function(){r.selForContextMenu==o.doc.sel&&y.selectionStart==0&&y.selectionEnd>0&&t.prevInput=="\u200B"?Jr(o,Ls)(o):bt++<10?r.detectingSelectAll=setTimeout(It,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(It,200)}}if(G&&K>=9&&Qe(),R){Re(e);var dt=function(){Ot(window,"mouseup",dt),setTimeout(Xe,20)};Ze(window,"mouseup",dt)}else setTimeout(Xe,50)},ui.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ui.prototype.setUneditable=function(){},ui.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?v(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 o=j();t.autofocus=o==e||e.getAttribute("autofocus")!=null&&o==document.body}function r(){e.value=J.getValue()}var y;if(e.form&&(Ze(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var B=e.form;y=B.submit;try{var $=B.submit=function(){r(),B.submit=y,B.submit(),B.submit=$}}catch(ee){}}t.finishInit=function(ee){ee.save=r,ee.getTextArea=function(){return e},ee.toTextArea=function(){ee.toTextArea=isNaN,r(),e.parentNode.removeChild(ee.getWrapperElement()),e.style.display="",e.form&&(Ot(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=y))}},e.style.display="none";var J=Xr(function(ee){return e.parentNode.insertBefore(ee,e.nextSibling)},t);return J}function iu(e){e.off=Ot,e.on=Ze,e.wheelEventPixels=it,e.Doc=Fi,e.splitLines=En,e.countColumn=H,e.findColumn=be,e.isWordChar=Ke,e.Pass=ye,e.signal=qe,e.Line=Yn,e.changeEnd=St,e.scrollbarModel=eo,e.Pos=Et,e.cmpPos=fn,e.modes=br,e.mimeModes=Pn,e.resolveMode=ln,e.getMode=Yr,e.modeExtensions=tn,e.extendMode=sn,e.copyState=Qn,e.startState=Nr,e.innerMode=sr,e.commands=zo,e.keyMap=Ia,e.keyName=Xs,e.isModifierKey=zs,e.lookupKey=Co,e.normalizeKeyMap=Pl,e.StringStream=hn,e.SharedTextMarker=Ho,e.TextMarker=Va,e.LineWidget=Wo,e.e_preventDefault=ce,e.e_stopPropagation=he,e.e_stop=Re,e.addClass=W,e.contains=w,e.rmClass=g,e.keyNames=Xa}$l(Xr),ql(Xr);var au="iter insert remove copy getEditor constructor".split(" ");for(var ss in Fi.prototype)Fi.prototype.hasOwnProperty(ss)&&q(au,ss)<0&&(Xr.prototype[ss]=function(e){return function(){return e.apply(this.doc,arguments)}}(Fi.prototype[ss]));return me(Fi),Xr.inputStyles={textarea:ui,contenteditable:Mr},Xr.defineMode=function(e){!Xr.defaults.mode&&e!="null"&&(Xr.defaults.mode=e),Dr.apply(this,arguments)},Xr.defineMIME=Or,Xr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Xr.defineMIME("text/plain","null"),Xr.defineExtension=function(e,t){Xr.prototype[e]=t},Xr.defineDocExtension=function(e,t){Fi.prototype[e]=t},Xr.fromTextArea=ru,iu(Xr),Xr.version="5.58.2",Xr})},WaYH:function(ct,ge,U){"use strict";var te=U("rePB"),Y=U("Ff2n"),N=U("VTBJ"),z=U("1OyB"),P=U("vuIU"),F=U("JX7q"),G=U("Ji7U"),K=U("LK+K"),n=U("q1tI"),I=U("TSYQ"),E=U.n(I),f=U("sboe"),b=U("OZM5"),c=function(R){var O=R.prefixCls,g=R.level,_=R.isStart,h=R.isEnd;if(!g)return null;for(var d="".concat(O,"-indent-unit"),C=[],x=0;x<g;x+=1){var w;C.push(n.createElement("span",{key:x,className:E()(d,(w={},Object(te.a)(w,"".concat(d,"-start"),_[x+1]),Object(te.a)(w,"".concat(d,"-end"),h[x+1]),Object(te.a)(w,"".concat(d,"-end-first-level"),!x&&h[0]),w))}))}return n.createElement("span",{"aria-hidden":"true",className:"".concat(O,"-indent")},C)},a=c,p=U("815F"),l="open",u="close",s="---",i=function(S){Object(G.a)(O,S);var R=Object(K.a)(O);function O(){var g;return Object(z.a)(this,O),g=R.apply(this,arguments),g.state={dragNodeHighlight:!1},g.onSelectorClick=function(_){var h=g.props.context.onNodeClick;h(_,Object(p.b)(g.props)),g.isSelectable()?g.onSelect(_):g.onCheck(_)},g.onSelectorDoubleClick=function(_){var h=g.props.context.onNodeDoubleClick;h(_,Object(p.b)(g.props))},g.onSelect=function(_){if(g.isDisabled())return;var h=g.props.context.onNodeSelect;_.preventDefault(),h(_,Object(p.b)(g.props))},g.onCheck=function(_){if(g.isDisabled())return;var h=g.props,d=h.disableCheckbox,C=h.checked,x=g.props.context.onNodeCheck;if(!g.isCheckable()||d)return;_.preventDefault();var w=!C;x(_,Object(p.b)(g.props),w)},g.onMouseEnter=function(_){var h=g.props.context.onNodeMouseEnter;h(_,Object(p.b)(g.props))},g.onMouseLeave=function(_){var h=g.props.context.onNodeMouseLeave;h(_,Object(p.b)(g.props))},g.onContextMenu=function(_){var h=g.props.context.onNodeContextMenu;h(_,Object(p.b)(g.props))},g.onDragStart=function(_){var h=g.props.context.onNodeDragStart;_.stopPropagation(),g.setState({dragNodeHighlight:!0}),h(_,Object(F.a)(g));try{_.dataTransfer.setData("text/plain","")}catch(d){}},g.onDragEnter=function(_){var h=g.props.context.onNodeDragEnter;_.preventDefault(),_.stopPropagation(),h(_,Object(F.a)(g))},g.onDragOver=function(_){var h=g.props.context.onNodeDragOver;_.preventDefault(),_.stopPropagation(),h(_,Object(F.a)(g))},g.onDragLeave=function(_){var h=g.props.context.onNodeDragLeave;_.stopPropagation(),h(_,Object(F.a)(g))},g.onDragEnd=function(_){var h=g.props.context.onNodeDragEnd;_.stopPropagation(),g.setState({dragNodeHighlight:!1}),h(_,Object(F.a)(g))},g.onDrop=function(_){var h=g.props.context.onNodeDrop;_.preventDefault(),_.stopPropagation(),g.setState({dragNodeHighlight:!1}),h(_,Object(F.a)(g))},g.onExpand=function(_){var h=g.props.context.onNodeExpand;h(_,Object(p.b)(g.props))},g.setSelectHandle=function(_){g.selectHandle=_},g.getNodeState=function(){var _=g.props.expanded;return g.isLeaf()?null:_?l:u},g.hasChildren=function(){var _=g.props.eventKey,h=g.props.context.keyEntities,d=h[_]||{},C=d.children;return!!(C||[]).length},g.isLeaf=function(){var _=g.props,h=_.isLeaf,d=_.loaded,C=g.props.context.loadData,x=g.hasChildren();return h===!1?!1:h||!C&&!x||C&&d&&!x},g.isDisabled=function(){var _=g.props.disabled,h=g.props.context.disabled;return!!(h||_)},g.isCheckable=function(){var _=g.props.checkable,h=g.props.context.checkable;return!h||_===!1?!1:h},g.syncLoadData=function(_){var h=_.expanded,d=_.loading,C=_.loaded,x=g.props.context,w=x.loadData,j=x.onNodeLoad;if(d)return;w&&h&&!g.isLeaf()&&(!g.hasChildren()&&!C&&j(Object(p.b)(g.props)))},g.renderSwitcher=function(){var _=g.props,h=_.expanded,d=_.switcherIcon,C=g.props.context,x=C.prefixCls,w=C.switcherIcon,j=d||w;if(g.isLeaf())return n.createElement("span",{className:E()("".concat(x,"-switcher"),"".concat(x,"-switcher-noop"))},typeof j=="function"?j(Object(N.a)(Object(N.a)({},g.props),{},{isLeaf:!0})):j);var W=E()("".concat(x,"-switcher"),"".concat(x,"-switcher_").concat(h?l:u));return n.createElement("span",{onClick:g.onExpand,className:W},typeof j=="function"?j(Object(N.a)(Object(N.a)({},g.props),{},{isLeaf:!1})):j)},g.renderCheckbox=function(){var _=g.props,h=_.checked,d=_.halfChecked,C=_.disableCheckbox,x=g.props.context.prefixCls,w=g.isDisabled(),j=g.isCheckable();if(!j)return null;var W=typeof j!="boolean"?j:null;return n.createElement("span",{className:E()("".concat(x,"-checkbox"),h&&"".concat(x,"-checkbox-checked"),!h&&d&&"".concat(x,"-checkbox-indeterminate"),(w||C)&&"".concat(x,"-checkbox-disabled")),onClick:g.onCheck},W)},g.renderIcon=function(){var _=g.props.loading,h=g.props.context.prefixCls;return n.createElement("span",{className:E()("".concat(h,"-iconEle"),"".concat(h,"-icon__").concat(g.getNodeState()||"docu"),_&&"".concat(h,"-icon_loading"))})},g.renderSelector=function(){var _=g.state.dragNodeHighlight,h=g.props,d=h.title,C=h.selected,x=h.icon,w=h.loading,j=h.data,W=g.props.context,T=W.prefixCls,M=W.showIcon,m=W.icon,v=W.draggable,H=W.loadData,X=W.titleRender,q=g.isDisabled(),re="".concat(T,"-node-content-wrapper"),ye;if(M){var pe=x||m;ye=pe?n.createElement("span",{className:E()("".concat(T,"-iconEle"),"".concat(T,"-icon__customize"))},typeof pe=="function"?pe(g.props):pe):g.renderIcon()}else H&&w&&(ye=g.renderIcon());var ue;typeof d=="function"?ue=d(j):X?ue=X(j):ue=d;var fe=n.createElement("span",{className:"".concat(T,"-title")},ue);return n.createElement("span",{ref:g.setSelectHandle,title:typeof d=="string"?d:"",className:E()("".concat(re),"".concat(re,"-").concat(g.getNodeState()||"normal"),!q&&(C||_)&&"".concat(T,"-node-selected"),!q&&v&&"draggable"),draggable:!q&&v||void 0,"aria-grabbed":!q&&v||void 0,onMouseEnter:g.onMouseEnter,onMouseLeave:g.onMouseLeave,onContextMenu:g.onContextMenu,onClick:g.onSelectorClick,onDoubleClick:g.onSelectorDoubleClick,onDragStart:v?g.onDragStart:void 0},ye,fe)},g}return Object(P.a)(O,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var _=this.props.selectable,h=this.props.context.selectable;return typeof _=="boolean"?_:h}},{key:"render",value:function(){var _,h=this.props,d=h.eventKey,C=h.className,x=h.style,w=h.dragOver,j=h.dragOverGapTop,W=h.dragOverGapBottom,T=h.isLeaf,M=h.isStart,m=h.isEnd,v=h.expanded,H=h.selected,X=h.checked,q=h.halfChecked,re=h.loading,ye=h.domRef,pe=h.active,ue=h.onMouseMove,fe=Object(Y.a)(h,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),be=this.props.context,se=be.prefixCls,ae=be.filterTreeNode,Ce=be.draggable,ze=be.keyEntities,Ye=this.isDisabled(),He=Object(b.f)(fe),Ve=ze[d]||{},Fe=Ve.level,Ke=m[m.length-1];return n.createElement("div",Object.assign({ref:ye,className:E()(C,"".concat(se,"-treenode"),(_={},Object(te.a)(_,"".concat(se,"-treenode-disabled"),Ye),Object(te.a)(_,"".concat(se,"-treenode-switcher-").concat(v?"open":"close"),!T),Object(te.a)(_,"".concat(se,"-treenode-checkbox-checked"),X),Object(te.a)(_,"".concat(se,"-treenode-checkbox-indeterminate"),q),Object(te.a)(_,"".concat(se,"-treenode-selected"),H),Object(te.a)(_,"".concat(se,"-treenode-loading"),re),Object(te.a)(_,"".concat(se,"-treenode-active"),pe),Object(te.a)(_,"".concat(se,"-treenode-leaf-last"),Ke),Object(te.a)(_,"drag-over",!Ye&&w),Object(te.a)(_,"drag-over-gap-top",!Ye&&j),Object(te.a)(_,"drag-over-gap-bottom",!Ye&&W),Object(te.a)(_,"filter-node",ae&&ae(Object(p.b)(this.props))),_)),style:x,onDragEnter:Ce?this.onDragEnter:void 0,onDragOver:Ce?this.onDragOver:void 0,onDragLeave:Ce?this.onDragLeave:void 0,onDrop:Ce?this.onDrop:void 0,onDragEnd:Ce?this.onDragEnd:void 0,onMouseMove:ue},He),n.createElement(a,{prefixCls:se,level:Fe,isStart:M,isEnd:m}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),O}(n.Component),D=function(R){return n.createElement(f.a.Consumer,null,function(O){return n.createElement(i,Object.assign({},R,{context:O}))})};D.displayName="TreeNode",D.defaultProps={title:s},D.isTreeNode=1;var A=ge.a=D},Y1PL:function(ct,ge,U){"use strict";U.r(ge),U.d(ge,"ResizableTextArea",function(){return q});var te=U("wx14"),Y=U("1OyB"),N=U("vuIU"),z=U("Ji7U"),P=U("LK+K"),F=U("q1tI"),G=U("VTBJ"),K=U("rePB"),n=U("Zm9Q"),I=U("Kwbf"),E=U("c+Xe"),f=U("m+aA"),b=U("bdgK"),c=new Map;function a(pe){pe.forEach(function(ue){var fe,be=ue.target;(fe=c.get(be))===null||fe===void 0||fe.forEach(function(se){return se(be)})})}var p=new b.default(a),l=null,u=null;function s(pe,ue){c.has(pe)||(c.set(pe,new Set),p.observe(pe)),c.get(pe).add(ue)}function i(pe,ue){c.has(pe)&&(c.get(pe).delete(ue),c.get(pe).size||(p.unobserve(pe),c.delete(pe)))}var D=function(pe){Object(z.a)(fe,pe);var ue=Object(P.a)(fe);function fe(){return Object(Y.a)(this,fe),ue.apply(this,arguments)}return Object(N.a)(fe,[{key:"render",value:function(){return this.props.children}}]),fe}(F.Component),A=F.createContext(null);function S(pe){var ue=pe.children,fe=pe.onBatchResize,be=F.useRef(0),se=F.useRef([]),ae=F.useContext(A),Ce=F.useCallback(function(ze,Ye,He){be.current+=1;var Ve=be.current;se.current.push({size:ze,element:Ye,data:He}),Promise.resolve().then(function(){Ve===be.current&&(fe==null||fe(se.current),se.current=[])}),ae==null||ae(ze,Ye,He)},[fe,ae]);return F.createElement(A.Provider,{value:Ce},ue)}function R(pe){var ue=pe.children,fe=pe.disabled,be=F.useRef(null),se=F.useRef(null),ae=F.useContext(A),Ce=F.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ze=F.isValidElement(ue)&&Object(E.c)(ue),Ye=ze?ue.ref:null,He=F.useMemo(function(){return Object(E.a)(Ye,be)},[Ye,be]),Ve=F.useRef(pe);Ve.current=pe;var Fe=F.useCallback(function(Ke){var nt=Ve.current,de=nt.onResize,De=nt.data,Ne=Ke.getBoundingClientRect(),Ue=Ne.width,rt=Ne.height,lt=Ke.offsetWidth,ft=Ke.offsetHeight,at=Math.floor(Ue),_t=Math.floor(rt);if(Ce.current.width!==at||Ce.current.height!==_t||Ce.current.offsetWidth!==lt||Ce.current.offsetHeight!==ft){var gt={width:at,height:_t,offsetWidth:lt,offsetHeight:ft};Ce.current=gt;var xt=lt===Math.round(Ue)?Ue:lt,Ze=ft===Math.round(rt)?rt:ft,kt=Object(G.a)(Object(G.a)({},gt),{},{offsetWidth:xt,offsetHeight:Ze});ae==null||ae(kt,Ke,De),de&&Promise.resolve().then(function(){de(kt,Ke)})}},[]);return F.useEffect(function(){var Ke=Object(f.a)(be.current)||Object(f.a)(se.current);return Ke&&!fe&&s(Ke,Fe),function(){return i(Ke,Fe)}},[be.current,fe]),F.createElement(D,{ref:se},ze?F.cloneElement(ue,{ref:He}):ue)}var O="rc-observer-key";function g(pe){var ue=pe.children,fe=Object(n.a)(ue);return fe.map(function(be,se){var ae=(be==null?void 0:be.key)||"".concat(O,"-").concat(se);return F.createElement(R,Object(te.a)({},pe,{key:ae}),be)})}g.Collection=S;var _=g,h=U("bT9E"),d=U("TSYQ"),C=U.n(d),x=`
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
`,w=["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"],j={},W;function T(pe){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,fe=pe.getAttribute("id")||pe.getAttribute("data-reactid")||pe.getAttribute("name");if(ue&&j[fe])return j[fe];var be=window.getComputedStyle(pe),se=be.getPropertyValue("box-sizing")||be.getPropertyValue("-moz-box-sizing")||be.getPropertyValue("-webkit-box-sizing"),ae=parseFloat(be.getPropertyValue("padding-bottom"))+parseFloat(be.getPropertyValue("padding-top")),Ce=parseFloat(be.getPropertyValue("border-bottom-width"))+parseFloat(be.getPropertyValue("border-top-width")),ze=w.map(function(He){return"".concat(He,":").concat(be.getPropertyValue(He))}).join(";"),Ye={sizingStyle:ze,paddingSize:ae,borderSize:Ce,boxSizing:se};return ue&&fe&&(j[fe]=Ye),Ye}function M(pe){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,be=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;W||(W=document.createElement("textarea"),W.setAttribute("tab-index","-1"),W.setAttribute("aria-hidden","true"),document.body.appendChild(W)),pe.getAttribute("wrap")?W.setAttribute("wrap",pe.getAttribute("wrap")):W.removeAttribute("wrap");var se=T(pe,ue),ae=se.paddingSize,Ce=se.borderSize,ze=se.boxSizing,Ye=se.sizingStyle;W.setAttribute("style","".concat(Ye,";").concat(x)),W.value=pe.value||pe.placeholder||"";var He=Number.MIN_SAFE_INTEGER,Ve=Number.MAX_SAFE_INTEGER,Fe=W.scrollHeight,Ke;if(ze==="border-box"?Fe+=Ce:ze==="content-box"&&(Fe-=ae),fe!==null||be!==null){W.value=" ";var nt=W.scrollHeight-ae;fe!==null&&(He=nt*fe,ze==="border-box"&&(He=He+ae+Ce),Fe=Math.max(He,Fe)),be!==null&&(Ve=nt*be,ze==="border-box"&&(Ve=Ve+ae+Ce),Ke=Fe>Ve?"":"hidden",Fe=Math.min(Ve,Fe))}return{height:Fe,minHeight:He,maxHeight:Ve,overflowY:Ke,resize:"none"}}var m=U("Gytx"),v=U.n(m),H;(function(pe){pe[pe.NONE=0]="NONE",pe[pe.RESIZING=1]="RESIZING",pe[pe.RESIZED=2]="RESIZED"})(H||(H={}));var X=function(pe){Object(z.a)(fe,pe);var ue=Object(P.a)(fe);function fe(be){var se;return Object(Y.a)(this,fe),se=ue.call(this,be),se.nextFrameActionId=void 0,se.resizeFrameId=void 0,se.textArea=void 0,se.saveTextArea=function(ae){se.textArea=ae},se.handleResize=function(ae){var Ce=se.state.resizeStatus,ze=se.props,Ye=ze.autoSize,He=ze.onResize;if(Ce!==H.NONE)return;typeof He=="function"&&He(ae),Ye&&se.resizeOnNextFrame()},se.resizeOnNextFrame=function(){cancelAnimationFrame(se.nextFrameActionId),se.nextFrameActionId=requestAnimationFrame(se.resizeTextarea)},se.resizeTextarea=function(){var ae=se.props.autoSize;if(!ae||!se.textArea)return;var Ce=ae.minRows,ze=ae.maxRows,Ye=M(se.textArea,!1,Ce,ze);se.setState({textareaStyles:Ye,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(se.resizeFrameId),se.resizeFrameId=requestAnimationFrame(function(){se.setState({resizeStatus:H.RESIZED},function(){se.resizeFrameId=requestAnimationFrame(function(){se.setState({resizeStatus:H.NONE}),se.fixFirefoxAutoScroll()})})})})},se.renderTextArea=function(){var ae=se.props,Ce=ae.prefixCls,ze=Ce===void 0?"rc-textarea":Ce,Ye=ae.autoSize,He=ae.onResize,Ve=ae.className,Fe=ae.disabled,Ke=se.state,nt=Ke.textareaStyles,de=Ke.resizeStatus,De=Object(h.a)(se.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ne=C()(ze,Ve,Object(K.a)({},"".concat(ze,"-disabled"),Fe));"value"in De&&(De.value=De.value||"");var Ue=Object(G.a)(Object(G.a)(Object(G.a)({},se.props.style),nt),de===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return F.createElement(_,{onResize:se.handleResize,disabled:!(Ye||He)},F.createElement("textarea",Object(te.a)({},De,{className:Ne,style:Ue,ref:se.saveTextArea})))},se.state={textareaStyles:{},resizeStatus:H.NONE},se}return Object(N.a)(fe,[{key:"componentDidUpdate",value:function(se){(se.value!==this.props.value||!v()(se.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var se=this.textArea.selectionStart,ae=this.textArea.selectionEnd;this.textArea.setSelectionRange(se,ae)}}catch(Ce){}}},{key:"render",value:function(){return this.renderTextArea()}}]),fe}(F.Component),q=X,re=function(pe){Object(z.a)(fe,pe);var ue=Object(P.a)(fe);function fe(be){var se;Object(Y.a)(this,fe),se=ue.call(this,be),se.resizableTextArea=void 0,se.focus=function(){se.resizableTextArea.textArea.focus()},se.saveTextArea=function(Ce){se.resizableTextArea=Ce},se.handleChange=function(Ce){var ze=se.props.onChange;se.setValue(Ce.target.value,function(){se.resizableTextArea.resizeTextarea()}),ze&&ze(Ce)},se.handleKeyDown=function(Ce){var ze=se.props,Ye=ze.onPressEnter,He=ze.onKeyDown;Ce.keyCode===13&&Ye&&Ye(Ce),He&&He(Ce)};var ae=typeof be.value=="undefined"||be.value===null?be.defaultValue:be.value;return se.state={value:ae},se}return Object(N.a)(fe,[{key:"setValue",value:function(se,ae){"value"in this.props||this.setState({value:se},ae)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return F.createElement(q,Object(te.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(se){return"value"in se?{value:se.value}:null}}]),fe}(F.Component),ye=ge.default=re},ZW9T:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return m});var te=U("k1fw"),Y=U("oBTY"),N=U("miYZ"),z=U("tsqr"),P=U("rAM+"),F=U("tJVT"),G=U("PpiC"),K=U("q1tI"),n=U.n(K),I=U("bdgK"),E=U("9og8"),f=U("WmNS"),b=U.n(f),c={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"]},p={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},l={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},u=U("5VLF"),s=U.n(u),i={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"]}},D=function(H,X){return X.map(function(q){return{label:q,kind:H.languages.CompletionItemKind.Keyword,insertText:q}})},A=function(H){return Object.keys(i.tables).map(function(X){return{label:X,kind:H.languages.CompletionItemKind.Variable,insertText:X}})},S=function(H,X){var q=i.tables[H];return q?q.map(function(re){return{label:re,kind:X.languages.CompletionItemKind.Field,insertText:re}}):[]};function R(v,H,X,q,re){var ye=H.getWordUntilPosition(X),pe={startLineNumber:X.lineNumber,endLineNumber:X.lineNumber,startColumn:ye.startColumn,endColumn:ye.endColumn},ue=q.map(function(fe){return{label:fe,kind:v.languages.CompletionItemKind.Keyword,insertText:fe,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}});return re.map(function(fe){ue.push(Object(te.a)(Object(te.a)({},fe),{},{range:pe}))}),ue}var O=function(v){i.languages.map(function(re){return v.languages.registerDocumentFormattingEditProvider(re,{provideDocumentFormattingEdits:function(pe,ue,fe){return Object(E.a)(b.a.mark(function be(){var se;return b.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return se=s()(pe.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}),Ce.abrupt("return",[{range:pe.getFullModelRange(),text:se}]);case 2:case"end":return Ce.stop()}},be)}))()}}),re});var H=p.quickKey.map(function(re){return{label:re.label,kind:v.languages.CompletionItemKind.Method,insertText:re.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),X=l.quickKey.map(function(re){return{label:re.label,kind:v.languages.CompletionItemKind.Method,insertText:re.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),q=a.quickKey.map(function(re){return{label:re.label,kind:v.languages.CompletionItemKind.Method,insertText:re.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet}});v.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ye,pe){var ue=ye.getWordUntilPosition(pe),fe={startLineNumber:pe.lineNumber,endLineNumber:pe.lineNumber,startColumn:ue.startColumn,endColumn:ue.endColumn},be=ye.getLineContent(pe.lineNumber).substring(ue.startColumn-2,ue.endColumn);return{suggestions:[].concat(Object(Y.a)(p.keywords.map(function(se){return{label:se,kind:v.languages.CompletionItemKind.Function,documentation:se,insertText:se,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:fe}})),Object(Y.a)(p.quickKey.map(function(se){return{label:se.label,kind:v.languages.CompletionItemKind.Function,documentation:se.content,insertText:be.startsWith("#")?se.content.replace(/#/,""):se.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:fe}})))}}}),v.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(ye,pe){var ue=ye.getWordUntilPosition(pe),fe={startLineNumber:pe.lineNumber,endLineNumber:pe.lineNumber,startColumn:ue.startColumn,endColumn:ue.endColumn};return{suggestions:Object(Y.a)(c.keywords.map(function(be){return{label:be,kind:v.languages.CompletionItemKind.Function,documentation:be,insertText:be,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:fe}}))}}}),v.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ye,pe){var ue=ye.getWordUntilPosition(pe),fe={startLineNumber:pe.lineNumber,endLineNumber:pe.lineNumber,startColumn:ue.startColumn,endColumn:ue.endColumn},be=ye.getLineContent(pe.lineNumber).substring(ue.startColumn-2,ue.endColumn);return{suggestions:[].concat(Object(Y.a)(a.keywords.map(function(se){return{label:se,kind:v.languages.CompletionItemKind.Function,documentation:se,insertText:se,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:fe}})),Object(Y.a)(a.quickKey.map(function(se){return{label:se.label,kind:v.languages.CompletionItemKind.Function,documentation:se.content,insertText:be.startsWith("#")?se.content.replace(/#/,""):se.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:fe}})))}}}),v.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ye,pe){var ue=ye.getWordUntilPosition(pe),fe={startLineNumber:pe.lineNumber,endLineNumber:pe.lineNumber,startColumn:ue.startColumn,endColumn:ue.endColumn},be=ye.getLineContent(pe.lineNumber).substring(ue.startColumn-2,ue.endColumn);return{suggestions:[].concat(Object(Y.a)(l.keywords.map(function(se){return{label:se,kind:v.languages.CompletionItemKind.Function,documentation:se,insertText:se,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:fe}})),Object(Y.a)(l.quickKey.map(function(se){return{label:se.label,kind:v.languages.CompletionItemKind.Function,documentation:se.content,insertText:be.startsWith("#")?se.content.replace(/#/,""):se.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:fe}})))}}})},g="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",_=U("fjLI"),h=U("LvDl"),d=U("+ua5");function C(v){return/^\d+$/.test(v)?"".concat(v,"px"):v}function x(){}var w=!1,j={"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 W(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=v;if(Array.isArray(v)){for(var X=0;X<v.length;X++){var q=j[v[X]];if(q)return q}return H[0]}return j[H]||H}var T=null,M=ge.b=function(v){var H=v.width,X=H===void 0?"100%":H,q=v.height,re=q===void 0?"100%":q,ye=v.value,pe=v.language,ue=pe===void 0?"javascript":pe,fe=v.style,be=fe===void 0?{}:fe,se=v.options,ae=se===void 0?{}:se,Ce=v.overrideServices,ze=Ce===void 0?{}:Ce,Ye=v.theme,He=Ye===void 0?"vs-dark":Ye,Ve=v.onEditBlur,Fe=v.onSave,Ke=v.autoHeight,nt=Ke===void 0?!1:Ke,de=v.forbidCopy,De=de===void 0?!1:de,Ne=v.onChange,Ue=Ne===void 0?x:Ne,rt=v.editorDidMount,lt=rt===void 0?x:rt,ft=v.onFocus,at=ft===void 0?x:ft,_t=v.filename,gt=_t===void 0?"educoder.txt":_t,xt=v.errorLine,Ze=v.errorContent,kt=Ze===void 0?"":Ze,Ot=Object(G.a)(v,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),qe=Object(K.useRef)(),st=Object(K.useRef)({}),xe=Object(K.useRef)(),we=Object(K.useRef)(),me=Object(K.useRef)(!1),ce=Object(K.useRef)(),he=Object(K.useState)(!1),Te=Object(F.a)(he,2),Re=Te[0],Me=Te[1];function et(){var tn;return qe.current&&(tn=new I.default(function(sn){var Qn=Object(P.a)(sn),sr;try{for(Qn.s();!(sr=Qn.n()).done;){var Nr=sr.value;(Nr.target.offsetHeight>0||Nr.target.offsetWidth>0)&&st.current.instance.layout()}}catch(hn){Qn.e(hn)}finally{Qn.f()}}),tn.observe(qe.current)),tn}function ht(){z.b.warn(decodeURIComponent(g))}var Ut=function(){var sn=st.current.instance;if(ye!=null&&sn&&Re){var Qn=sn.getModel();Qn&&ye!==Qn.getValue()&&(w=!0,Qn.setValue(ye),sn.layout(),w=!1)}};Object(K.useEffect)(function(){we.current&&clearTimeout(we.current),we.current=setTimeout(function(){Ut()},500)},[ye,Re,st.current]),Object(K.useEffect)(function(){if(xt&&st.current&&st.current.instance){var tn=st.current.instance;tn.changeViewZones(function(Qn){var sr=document.createElement("div");sr.style.padding="10px 20px",sr.style.width="calc(100% - 20px)",sr.className="my-error-line-wrp",sr.innerHTML=kt,Qn.addZone({afterLineNumber:xt||11,heightInLines:3,domNode:sr})});var sn={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}};tn.addOverlayWidget(sn),tn.revealPositionInCenter({lineNumber:20,column:1})}},[xt,st.current,Re]);function nn(){var tn=st.current.instance;if(tn){var sn=tn.getSelection(),Qn=st.current.pastePos||{},sr=new T.Range(Qn.startLineNumber||sn.endLineNumber,Qn.startColumn||sn.endColumn,Qn.endLineNumber||sn.endLineNumber,Qn.endColumn||sn.endColumn);setTimeout(function(){tn.executeEdits("",[{range:sr,text:""}])},300)}}function en(tn){(window.navigator.platform.match("Mac")?tn.metaKey:tn.ctrlKey)&&tn.keyCode==83&&(tn.preventDefault(),Fe())}var mn=function(){if(nt&&st.current.instance){var sn=st.current.instance.getContentHeight();ln(sn<re?re:sn)}else ln(re)};function En(tn){var sn=document.createEvent("MouseEvents");sn.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),tn.dispatchEvent(sn)}function $t(tn,sn){var Qn=window.URL||window.webkitURL||window,sr=new Blob([sn]),Nr=document.createElementNS("http://www.w3.org/1999/xhtml","a");Nr.href=Qn.createObjectURL(sr),Nr.download=tn,En(Nr)}Object(K.useEffect)(function(){mn()},[mn]),Object(K.useEffect)(function(){qe.current&&!Re&&Promise.all([U.e(16),U.e(28)]).then(U.t.bind(null,"M/lh",7)).then(function(tn){try{T=tn,st.current.instance=T.editor.create(qe.current,{value:ye,language:W(ue),theme:He,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},ze);var sn=st.current.instance,Qn=_.d._menuItems,sr=Object(Y.a)(Qn).find(function(fr){return fr[0]._debugName=="EditorContext"}),Nr=sr[1],hn=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Qt=function(Lr,kn){var Ur=Lr._first;do{var vi,Ai,Et=kn.includes((vi=Ur.element)===null||vi===void 0||((Ai=vi.command)===null||Ai===void 0)?void 0:Ai.id);Et&&Lr._remove(Ur)}while(Ur=Ur.next)};if(lt(sn,T),setTimeout(function(){mn(),st.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){$t(gt||"educoder.txt",sn.getValue())}}),sn.getDomNode().addEventListener("input",function(){xe.current.autoFormat&&sn.getAction("editor.action.formatDocument").run()})},500),st.current.subscription=sn.onDidChangeModelContent(function(fr){me.current?clearTimeout(ce.current):(mn(),Ue(sn.getValue(),fr)),ce.current=setTimeout(function(){me.current=!1},500)}),window.Monaco||O(T,W(ue)),De&&(Qt(Nr,hn),qe.current.classList.add("noCopyPaste"),sn.onKeyDown(function(fr){var Lr=fr.keyCode,kn=fr.ctrlKey,Ur=fr.metaKey;(Lr===33||Lr===52)&&(Ur||kn)&&(ht(),fr.preventDefault())})),window.Monaco=T,Ve&&sn.onDidBlurEditorWidget(function(){Ve(sn.getValue())}),at&&sn.onDidFocusEditorText(function(){at(sn.getValue())}),De){sn.addCommand(T.KeyMod.CtrlCmd|T.KeyCode.KEY_V,function(){return ht(),null}),sn.onDidPaste(function(fr){st.current.pastePos=fr});try{window.addEventListener("paste",nn)}catch(fr){}}var $r=et();return Me(!0),function(){var fr=st.current.instance;fr.dispose();var Lr=fr.getModel();Lr&&Lr.dispose(),st.current.subscription&&st.current.subscription.dispose(),De&&window.removeEventListener("paste",nn),$r.unobserve(qe.current)}}catch(fr){}})},[]),Object(K.useEffect)(function(){var tn=st.current.instance;if(tn&&Re)return document.addEventListener("keydown",en,!1),function(){document.removeEventListener("keydown",en)}},[Fe,Re]),Object(K.useEffect)(function(){var tn=st.current.instance;if(tn&&Re){var sn=W(ue);T.editor.setModelLanguage(tn.getModel(),sn),console.log("language:",ue,tn.getModel(),sn)}},[ue,Re]),Object(K.useEffect)(function(){var tn=st.current.instance;tn&&Re&&T.editor.setTheme(He)},[He,Re]),Object(K.useEffect)(function(){var tn=st.current.instance;xe.current=ae,tn&&Re&&(tn.updateOptions(Object(te.a)({},ae)),setTimeout(function(){tn.getModel().updateOptions(Object(te.a)({},ae))},200))},[JSON.stringify(ae),Re]),Object(K.useEffect)(function(){var tn=st.current.instance;tn&&Re&&tn.layout()},[X,re,Re]);var rr=Object(K.useState)(C(X)),Dn=Object(F.a)(rr,2),Sr=Dn[0],br=Dn[1],Pn=Object(K.useState)(C(re)),Dr=Object(F.a)(Pn,2),Or=Dr[0],ln=Dr[1],Yr=Object(te.a)(Object(te.a)({},be),{},{width:Sr,height:Or});return n.a.createElement("div",{className:"my-monaco-editor",ref:qe,style:Yr})};function m(v){var H=v.width,X=H===void 0?"100%":H,q=v.height,re=q===void 0?"100%":q,ye=v.original,pe=v.modified,ue=v.language,fe=v.options,be=fe===void 0?{}:fe,se=Object(K.useRef)(),ae=Object(K.useState)(null),Ce=Object(F.a)(ae,2),ze=Ce[0],Ye=Ce[1];function He(nt){var de;return se.current&&(de=new I.default(function(De){var Ne=Object(P.a)(De),Ue;try{for(Ne.s();!(Ue=Ne.n()).done;){var rt=Ue.value;(rt.target.offsetHeight>0||rt.target.offsetWidth>0)&&nt.layout()}}catch(lt){Ne.e(lt)}finally{Ne.f()}}),de.observe(se.current)),de}Object(K.useEffect)(function(){se.current&&Promise.all([U.e(16),U.e(28)]).then(U.t.bind(null,"M/lh",7)).then(function(nt){T=nt;var de=T.editor.createDiffEditor(se.current,Object(te.a)(Object(te.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},be),{},{wordWrap:!0}));Ye(de);var De=He(de);return function(){de.dispose();var Ne=de.getModel();Ne&&Ne.dispose(),De.unobserve(se.current)}})},[]),Object(K.useEffect)(function(){ze&&ze.setModel({original:T.editor.createModel(ye,ue),modified:T.editor.createModel(pe,ue)})},[ye,pe,ue,ze]);var Ve=C(X),Fe=C(re),Ke={width:Ve,height:Fe};return n.a.createElement("div",{className:"my-diff-editor",ref:se,style:Ke})}},ZpRC:function(ct,ge,U){"use strict";function te(E){return typeof E=="object"&&E!=null&&E.nodeType===1}function Y(E,f){return(!f||E!=="hidden")&&E!=="visible"&&E!=="clip"}function N(E,f){if(E.clientHeight<E.scrollHeight||E.clientWidth<E.scrollWidth){var b=getComputedStyle(E,null);return Y(b.overflowY,f)||Y(b.overflowX,f)||function(c){var a=function(p){if(!p.ownerDocument||!p.ownerDocument.defaultView)return null;try{return p.ownerDocument.defaultView.frameElement}catch(l){return null}}(c);return!!a&&(a.clientHeight<c.scrollHeight||a.clientWidth<c.scrollWidth)}(E)}return!1}function z(E,f,b,c,a,p,l,u){return p<E&&l>f||p>E&&l<f?0:p<=E&&u<=b||l>=f&&u>=b?p-E-c:l>f&&u<b||p<E&&u>b?l-f+a:0}var P=function(E,f){var b=window,c=f.scrollMode,a=f.block,p=f.inline,l=f.boundary,u=f.skipOverflowHiddenElements,s=typeof l=="function"?l:function(nt){return nt!==l};if(!te(E))throw new TypeError("Invalid target");for(var i=document.scrollingElement||document.documentElement,D=[],A=E;te(A)&&s(A);){if((A=A.parentElement)===i){D.push(A);break}A!=null&&A===document.body&&N(A)&&!N(document.documentElement)||A!=null&&N(A,u)&&D.push(A)}for(var S=b.visualViewport?b.visualViewport.width:innerWidth,R=b.visualViewport?b.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,g=window.scrollY||pageYOffset,_=E.getBoundingClientRect(),h=_.height,d=_.width,C=_.top,x=_.right,w=_.bottom,j=_.left,W=a==="start"||a==="nearest"?C:a==="end"?w:C+h/2,T=p==="center"?j+d/2:p==="end"?x:j,M=[],m=0;m<D.length;m++){var v=D[m],H=v.getBoundingClientRect(),X=H.height,q=H.width,re=H.top,ye=H.right,pe=H.bottom,ue=H.left;if(c==="if-needed"&&C>=0&&j>=0&&w<=R&&x<=S&&C>=re&&w<=pe&&j>=ue&&x<=ye)return M;var fe=getComputedStyle(v),be=parseInt(fe.borderLeftWidth,10),se=parseInt(fe.borderTopWidth,10),ae=parseInt(fe.borderRightWidth,10),Ce=parseInt(fe.borderBottomWidth,10),ze=0,Ye=0,He="offsetWidth"in v?v.offsetWidth-v.clientWidth-be-ae:0,Ve="offsetHeight"in v?v.offsetHeight-v.clientHeight-se-Ce:0;if(i===v)ze=a==="start"?W:a==="end"?W-R:a==="nearest"?z(g,g+R,R,se,Ce,g+W,g+W+h,h):W-R/2,Ye=p==="start"?T:p==="center"?T-S/2:p==="end"?T-S:z(O,O+S,S,be,ae,O+T,O+T+d,d),ze=Math.max(0,ze+g),Ye=Math.max(0,Ye+O);else{ze=a==="start"?W-re-se:a==="end"?W-pe+Ce+Ve:a==="nearest"?z(re,pe,X,se,Ce+Ve,W,W+h,h):W-(re+X/2)+Ve/2,Ye=p==="start"?T-ue-be:p==="center"?T-(ue+q/2)+He/2:p==="end"?T-ye+ae+He:z(ue,ye,q,be,ae+He,T,T+d,d);var Fe=v.scrollLeft,Ke=v.scrollTop;W+=Ke-(ze=Math.max(0,Math.min(Ke+ze,v.scrollHeight-X+Ve))),T+=Fe-(Ye=Math.max(0,Math.min(Fe+Ye,v.scrollWidth-q+He)))}M.push({el:v,top:ze,left:Ye})}return M};function F(E){return E===Object(E)&&Object.keys(E).length!==0}function G(E,f){f===void 0&&(f="auto");var b="scrollBehavior"in document.body.style;E.forEach(function(c){var a=c.el,p=c.top,l=c.left;a.scroll&&b?a.scroll({top:p,left:l,behavior:f}):(a.scrollTop=p,a.scrollLeft=l)})}function K(E){return E===!1?{block:"end",inline:"nearest"}:F(E)?E:{block:"start",inline:"nearest"}}function n(E,f){var b=!E.ownerDocument.documentElement.contains(E);if(F(f)&&typeof f.behavior=="function")return f.behavior(b?[]:P(E,f));if(b)return;var c=K(f);return G(P(E,c),c.behavior)}var I=ge.a=n},"a+yL":function(ct,ge,U){ct.exports={search:"search___t0h96",btn:"btn___t2oDx"}},bT9E:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return Y});var te=U("VTBJ");function Y(N,z){var P=Object(te.a)({},N);return Array.isArray(z)&&z.forEach(function(F){delete P[F]}),P}},c5Ni:function(ct,ge,U){},d5o6:function(ct,ge,U){ct.exports={flex_box_center:"flex_box_center___2-Tej",flex_space_between:"flex_space_between___1Q3vH",flex_box_vertical_center:"flex_box_vertical_center___2x9ha",flex_box_center_end:"flex_box_center_end___1fvRI",flex_box_column:"flex_box_column___2RmOE",addModal:"addModal___2Pv06",row:"row___2XmSi",label:"label___1L8pt"}},dejd:function(ct,ge,U){},dmUQ:function(ct,ge,U){"use strict";var te=U("Ff2n"),Y=U("rePB"),N=U("1OyB"),z=U("vuIU"),P=U("Ji7U"),F=U("md7G"),G=U("foSv"),K=U("q1tI"),n=U.n(K),I=U("TSYQ"),E=U.n(I),f=U("4IlW");function b(h,d){var C=Object.keys(h);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(h);d&&(x=x.filter(function(w){return Object.getOwnPropertyDescriptor(h,w).enumerable})),C.push.apply(C,x)}return C}function c(h){for(var d=1;d<arguments.length;d++){var C=arguments[d]!=null?arguments[d]:{};d%2?b(Object(C),!0).forEach(function(x){Object(Y.a)(h,x,C[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(C)):b(Object(C)).forEach(function(x){Object.defineProperty(h,x,Object.getOwnPropertyDescriptor(C,x))})}return h}function a(h){var d=p();return function(){var x=Object(G.a)(h),w;if(d){var j=Object(G.a)(this).constructor;w=Reflect.construct(x,arguments,j)}else w=x.apply(this,arguments);return Object(F.a)(this,w)}}function p(){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(h){return!1}}function l(){}function u(h){h.preventDefault()}var s=function(d){return d.replace(/[^\w.-]+/g,"")},i=200,D=600,A=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(d){return d!=null},R=function(d,C){return C===d||typeof C=="number"&&typeof d=="number"&&isNaN(C)&&isNaN(d)},O=function(h){Object(P.a)(C,h);var d=a(C);function C(x){var w;Object(N.a)(this,C),w=d.call(this,x),w.onKeyDown=function(T){var M=w.props,m=M.onKeyDown,v=M.onPressEnter;if(T.keyCode===f.a.UP){var H=w.getRatio(T);w.up(T,H,null),w.stop()}else if(T.keyCode===f.a.DOWN){var X=w.getRatio(T);w.down(T,X,null),w.stop()}else T.keyCode===f.a.ENTER&&v&&v(T);if(w.recordCursorPosition(),w.lastKeyCode=T.keyCode,m){for(var q=arguments.length,re=new Array(q>1?q-1:0),ye=1;ye<q;ye++)re[ye-1]=arguments[ye];m.apply(void 0,[T].concat(re))}},w.onKeyUp=function(T){var M=w.props.onKeyUp;if(w.stop(),w.recordCursorPosition(),M){for(var m=arguments.length,v=new Array(m>1?m-1:0),H=1;H<m;H++)v[H-1]=arguments[H];M.apply(void 0,[T].concat(v))}},w.onChange=function(T){var M=w.props.onChange;w.state.focused&&(w.inputting=!0),w.rawInput=w.props.parser(w.getValueFromEvent(T)),w.setState({inputValue:w.rawInput}),M(w.toNumber(w.rawInput))},w.onMouseUp=function(){var T=w.props.onMouseUp;w.recordCursorPosition(),T&&T.apply(void 0,arguments)},w.onFocus=function(){var T;w.setState({focused:!0}),(T=w.props).onFocus.apply(T,arguments)},w.onBlur=function(){var T=w.props.onBlur;w.inputting=!1,w.setState({focused:!1});var M=w.getCurrentValidValue(w.state.inputValue),m=w.setValue(M,l);if(T){var v=w.input.value,H=w.getInputDisplayValue({focus:!1,value:m});w.input.value=H&&Number(H),T.apply(void 0,arguments),w.input.value=v}},w.getRatio=function(T){var M=1;return T.metaKey||T.ctrlKey?M=.1:T.shiftKey&&(M=10),M},w.getFullNum=function(T){return isNaN(T)?T:/e/i.test(String(T))?Number(T).toFixed(18).replace(/\.?0+$/,""):T},w.getPrecision=function(T){if(S(w.props.precision))return w.props.precision;var M=String(T);if(M.indexOf("e-")>=0)return parseInt(M.slice(M.indexOf("e-")+2),10);var m=0;return M.indexOf(".")>=0&&(m=M.length-M.indexOf(".")-1),m},w.getInputDisplayValue=function(T){var M=T||w.state,m=M.focused,v=M.inputValue,H=M.value,X;m?X=v:X=w.toPrecisionAsStep(H),X==null&&(X="");var q=w.formatWrapper(X);return S(w.props.decimalSeparator)&&(q=q.toString().replace(".",w.props.decimalSeparator)),q},w.recordCursorPosition=function(){try{w.cursorStart=w.input.selectionStart,w.cursorEnd=w.input.selectionEnd,w.currentValue=w.input.value,w.cursorBefore=w.input.value.substring(0,w.cursorStart),w.cursorAfter=w.input.value.substring(w.cursorEnd)}catch(T){}},w.restoreByAfter=function(T){if(T===void 0)return!1;var M=w.input.value,m=M.lastIndexOf(T);if(m===-1)return!1;var v=w.cursorBefore.length;return w.lastKeyCode===f.a.DELETE&&w.cursorBefore.charAt(v-1)===T[0]?(w.fixCaret(v,v),!0):m+T.length===M.length?(w.fixCaret(m,m),!0):!1},w.partRestoreByAfter=function(T){return T===void 0?!1:Array.prototype.some.call(T,function(M,m){var v=T.substring(m);return w.restoreByAfter(v)})},w.isNotCompleteNumber=function(T){return isNaN(T)||T===""||T===null||T&&T.toString().indexOf(".")===T.toString().length-1},w.stop=function(){w.autoStepTimer&&clearTimeout(w.autoStepTimer)},w.down=function(T,M,m){w.pressingUpOrDown=!0,w.step("down",T,M,m)},w.up=function(T,M,m){w.pressingUpOrDown=!0,w.step("up",T,M,m)},w.saveInput=function(T){w.input=T};var j=x.value;j===void 0&&(j=x.defaultValue),w.state={focused:x.autoFocus};var W=w.getValidValue(w.toNumber(j));return w.state=c(c({},w.state),{},{inputValue:w.toPrecisionAsStep(W),value:W}),w}return Object(z.a)(C,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(w){var j=this.props,W=j.value,T=j.onChange,M=j.max,m=j.min,v=this.state.focused;if(w){if(!R(w.value,W)||!R(w.max,M)||!R(w.min,m)){var H=v?W:this.getValidValue(W),X;this.pressingUpOrDown?X=H:this.inputting?X=this.rawInput:X=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:X})}var q="value"in this.props?W:this.state.value;"max"in this.props&&w.max!==M&&typeof q=="number"&&q>M&&T&&T(M),"min"in this.props&&w.min!==m&&typeof q=="number"&&q<m&&T&&T(m)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var re=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===f.a.BACKSPACE?re=this.cursorStart-1:this.lastKeyCode===f.a.DELETE&&(re=this.cursorStart):re=this.input.value.length,this.fixCaret(re,re)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case f.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case f.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ye){}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(w){var j=w;return j===""?j="":this.isNotCompleteNumber(parseFloat(j))?j=this.state.value:j=this.getValidValue(j),this.toNumber(j)}},{key:"getValueFromEvent",value:function(w){var j=w.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(j=j.replace(this.props.decimalSeparator,".")),j}},{key:"getValidValue",value:function(w){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,T=parseFloat(w);return isNaN(T)?w:(T<j&&(T=j),T>W&&(T=W),T)}},{key:"setValue",value:function(w,j){var W=this.props.precision,T=this.isNotCompleteNumber(parseFloat(w))?null:parseFloat(w),M=this.state.value,m=M===void 0?null:M,v=this.state.inputValue,H=v===void 0?null:v,X=typeof T=="number"?T.toFixed(W):"".concat(T),q=T!==m||X!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},j)):this.setState({value:T,inputValue:this.toPrecisionAsStep(w)},j),q&&this.props.onChange(T),T}},{key:"getMaxPrecision",value:function(w){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.props,T=W.precision,M=W.step;if(S(T))return T;var m=this.getPrecision(j),v=this.getPrecision(M),H=this.getPrecision(w);return w?Math.max(H,m+v):m+v}},{key:"getPrecisionFactor",value:function(w){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.getMaxPrecision(w,j);return Math.pow(10,W)}},{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(w){return this.props.formatter?this.props.formatter(w):w}},{key:"toPrecisionAsStep",value:function(w){if(this.isNotCompleteNumber(w)||w==="")return w;var j=Math.abs(this.getMaxPrecision(w));return isNaN(j)?w.toString():Number(w).toFixed(j)}},{key:"toNumber",value:function(w){var j=this.props.precision,W=this.state.focused,T=w&&w.length>16&&W;return this.isNotCompleteNumber(w)||T?w:S(j)?Math.round(w*Math.pow(10,j))/Math.pow(10,j):Number(w)}},{key:"upStep",value:function(w,j){var W=this.props.step,T=this.getPrecisionFactor(w,j),M=Math.abs(this.getMaxPrecision(w,j)),m=((T*w+T*W*j)/T).toFixed(M);return this.toNumber(m)}},{key:"downStep",value:function(w,j){var W=this.props.step,T=this.getPrecisionFactor(w,j),M=Math.abs(this.getMaxPrecision(w,j)),m=((T*w-T*W*j)/T).toFixed(M);return this.toNumber(m)}},{key:"step",value:function(w,j){var W=this,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,M=arguments.length>3?arguments[3]:void 0;this.stop(),j&&(j.persist(),j.preventDefault());var m=this.props;if(m.disabled)return;var v=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(v))return;var H=this["".concat(w,"Step")](v,T),X=H>m.max||H<m.min;if(H>m.max?H=m.max:H<m.min&&(H=m.min),this.setValue(H,null),this.setState({focused:!0},function(){W.pressingUpOrDown=!1}),X)return;this.autoStepTimer=setTimeout(function(){W[w](j,T,!0)},M?i:D)}},{key:"fixCaret",value:function(w,j){if(w===void 0||j===void 0||!this.input||!this.input.value)return;try{var W=this.input.selectionStart,T=this.input.selectionEnd;(w!==W||j!==T)&&this.input.setSelectionRange(w,j)}catch(M){}}},{key:"render",value:function(){var w,j=this.props,W=j.prefixCls,T=j.disabled,M=j.readOnly,m=j.useTouch,v=j.autoComplete,H=j.upHandler,X=j.downHandler,q=j.className,re=j.max,ye=j.min,pe=j.style,ue=j.title,fe=j.onMouseEnter,be=j.onMouseLeave,se=j.onMouseOver,ae=j.onMouseOut,Ce=j.required,ze=j.onClick,Ye=j.tabIndex,He=j.type,Ve=j.placeholder,Fe=j.id,Ke=j.inputMode,nt=j.pattern,de=j.step,De=j.maxLength,Ne=j.autoFocus,Ue=j.name,rt=j.onPaste,lt=j.onInput,ft=Object(te.a)(j,["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"]),at=this.state,_t=at.value,gt=at.focused,xt=E()(W,(w={},Object(Y.a)(w,q,!!q),Object(Y.a)(w,"".concat(W,"-disabled"),T),Object(Y.a)(w,"".concat(W,"-focused"),gt),w)),Ze={};Object.keys(ft).forEach(function(Re){(Re.substr(0,5)==="data-"||Re.substr(0,5)==="aria-"||Re==="role")&&(Ze[Re]=ft[Re])});var kt=!M&&!T,Ot=this.getInputDisplayValue(null),qe=(_t||_t===0)&&(isNaN(_t)||Number(_t)>=re),st=(_t||_t===0)&&(isNaN(_t)||Number(_t)<=ye),xe=qe||T||M,we=st||T||M,me=E()("".concat(W,"-handler"),"".concat(W,"-handler-up"),Object(Y.a)({},"".concat(W,"-handler-up-disabled"),xe)),ce=E()("".concat(W,"-handler"),"".concat(W,"-handler-down"),Object(Y.a)({},"".concat(W,"-handler-down-disabled"),we)),he=m?{onTouchStart:xe?l:this.up,onTouchEnd:this.stop}:{onMouseDown:xe?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Te=m?{onTouchStart:we?l:this.down,onTouchEnd:this.stop}:{onMouseDown:we?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:xt,style:pe,title:ue,onMouseEnter:fe,onMouseLeave:be,onMouseOver:se,onMouseOut:ae,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(W,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},he,{role:"button","aria-label":"Increase Value","aria-disabled":xe,className:me}),H||n.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-up-inner"),onClick:u})),n.a.createElement("span",Object.assign({unselectable:"on"},Te,{role:"button","aria-label":"Decrease Value","aria-disabled":we,className:ce}),X||n.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-down-inner"),onClick:u}))),n.a.createElement("div",{className:"".concat(W,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ye,"aria-valuemax":re,"aria-valuenow":_t,required:Ce,type:He,placeholder:Ve,onPaste:rt,onClick:ze,onMouseUp:this.onMouseUp,className:"".concat(W,"-input"),tabIndex:Ye,autoComplete:v,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:kt?this.onKeyDown:l,onKeyUp:kt?this.onKeyUp:l,autoFocus:Ne,maxLength:De,readOnly:M,disabled:T,max:re,min:ye,step:de,name:Ue,title:ue,id:Fe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ot),pattern:nt,inputMode:Ke,onInput:lt},Ze))))}}]),C}(n.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:A,min:-A,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:s,required:!1,autoComplete:"off"};var g=O,_=ge.a=g},fAei:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return i.a});var te=U("rePB"),Y=U("VTBJ"),N=U("KQm4"),z=U("1OyB"),P=U("vuIU"),F=U("Ji7U"),G=U("LK+K"),K=U("q1tI"),n=U("4IlW"),I=U("Kwbf"),E=U("TSYQ"),f=U.n(E),b=U("sboe"),c=U("OZM5"),a=U("815F"),p=U("ODXe"),l=U("Ff2n"),u=U("+nKL"),s=U("8XRh"),i=U("WaYH"),D=function(ye,pe){var ue=ye.className,fe=ye.style,be=ye.motion,se=ye.motionNodes,ae=ye.motionType,Ce=ye.onMotionStart,ze=ye.onMotionEnd,Ye=ye.active,He=ye.treeNodeRequiredProps,Ve=Object(l.a)(ye,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),Fe=K.useState(!0),Ke=Object(p.a)(Fe,2),nt=Ke[0],de=Ke[1],De=K.useContext(b.a),Ne=De.prefixCls,Ue=K.useRef(!1),rt=function(){Ue.current||ze(),Ue.current=!0};return Object(K.useEffect)(function(){se&&ae==="hide"&&nt&&de(!1)},[se]),Object(K.useEffect)(function(){return se&&Ce(),function(){se&&rt()}},[]),se?K.createElement(s.default,Object.assign({ref:pe,visible:nt},be,{motionAppear:ae==="show",onAppearEnd:rt,onLeaveEnd:rt}),function(lt,ft){var at=lt.className,_t=lt.style;return K.createElement("div",{ref:ft,className:f()("".concat(Ne,"-treenode-motion"),at),style:_t},se.map(function(gt){var xt=gt.data,Ze=xt.key,kt=Object(l.a)(xt,["key"]),Ot=gt.isStart,qe=gt.isEnd;delete kt.children;var st=Object(a.f)(Ze,He);return K.createElement(i.a,Object.assign({},kt,st,{active:Ye,data:gt.data,key:Ze,isStart:Ot,isEnd:qe}))}))}):K.createElement(i.a,Object.assign({domRef:pe,className:ue,style:fe},Ve,{active:Ye}))};D.displayName="MotionTreeNode";var A=K.forwardRef(D),S=A;function R(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],pe=re.length,ue=ye.length;if(Math.abs(pe-ue)!==1)return{add:!1,key:null};function fe(be,se){var ae=new Map;be.forEach(function(ze){ae.set(ze,!0)});var Ce=se.filter(function(ze){return!ae.has(ze)});return Ce.length===1?Ce[0]:null}return pe<ue?{add:!0,key:fe(re,ye)}:{add:!1,key:fe(ye,re)}}function O(re,ye,pe){var ue=re.findIndex(function(ae){var Ce=ae.data;return Ce.key===pe}),fe=re[ue+1],be=ye.findIndex(function(ae){var Ce=ae.data;return Ce.key===pe});if(fe){var se=ye.findIndex(function(ae){var Ce=ae.data;return Ce.key===fe.data.key});return ye.slice(be+1,se)}return ye.slice(be+1)}var g={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},_=function(){},h="RC_TREE_MOTION_".concat(Math.random()),d={key:h},C={key:h,level:0,index:0,pos:"0",node:d},x={parent:null,children:[],pos:C.pos,data:d,isStart:[],isEnd:[]};function w(re,ye,pe,ue){return ye===!1||!pe?re:re.slice(0,Math.ceil(pe/ue)+1)}function j(re){var ye=re.data.key,pe=re.pos;return Object(a.e)(ye,pe)}function W(re){for(var ye=String(re.data.key),pe=re;pe.parent;)pe=pe.parent,ye="".concat(pe.data.key," > ").concat(ye);return ye}var T=function(ye,pe){var ue=ye.prefixCls,fe=ye.data,be=ye.selectable,se=ye.checkable,ae=ye.expandedKeys,Ce=ye.selectedKeys,ze=ye.checkedKeys,Ye=ye.loadedKeys,He=ye.loadingKeys,Ve=ye.halfCheckedKeys,Fe=ye.keyEntities,Ke=ye.disabled,nt=ye.dragging,de=ye.dragOverNodeKey,De=ye.dropPosition,Ne=ye.motion,Ue=ye.height,rt=ye.itemHeight,lt=ye.virtual,ft=ye.focusable,at=ye.activeItem,_t=ye.focused,gt=ye.tabIndex,xt=ye.onKeyDown,Ze=ye.onFocus,kt=ye.onBlur,Ot=ye.onActiveChange,qe=ye.onListChangeStart,st=ye.onListChangeEnd,xe=Object(l.a)(ye,["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"]),we=K.useRef(null);K.useImperativeHandle(pe,function(){return{scrollTo:function(sn){we.current.scrollTo(sn)}}});var me=K.useState(ae),ce=Object(p.a)(me,2),he=ce[0],Te=ce[1],Re=K.useState(fe),Me=Object(p.a)(Re,2),et=Me[0],ht=Me[1],Ut=K.useState(fe),nn=Object(p.a)(Ut,2),en=nn[0],mn=nn[1],En=K.useState([]),$t=Object(p.a)(En,2),rr=$t[0],Dn=$t[1],Sr=K.useState(null),br=Object(p.a)(Sr,2),Pn=br[0],Dr=br[1];function Or(){ht(fe),mn(fe),Dn([]),Dr(null),st()}K.useEffect(function(){Te(ae);var tn=R(he,ae);if(tn.key!==null)if(tn.add){var sn=et.findIndex(function($r){var fr=$r.data.key;return fr===tn.key}),Qn=w(O(et,fe,tn.key),lt,Ue,rt),sr=et.slice();sr.splice(sn+1,0,x),mn(sr),Dn(Qn),Dr("show")}else{var Nr=fe.findIndex(function($r){var fr=$r.data.key;return fr===tn.key}),hn=w(O(fe,et,tn.key),lt,Ue,rt),Qt=fe.slice();Qt.splice(Nr+1,0,x),mn(Qt),Dn(hn),Dr("hide")}else et!==fe&&(ht(fe),mn(fe))},[ae,fe]),K.useEffect(function(){nt||Or()},[nt]);var ln=Ne?en:fe,Yr={expandedKeys:ae,selectedKeys:Ce,loadedKeys:Ye,loadingKeys:He,checkedKeys:ze,halfCheckedKeys:Ve,dragOverNodeKey:de,dropPosition:De,keyEntities:Fe};return K.createElement(K.Fragment,null,_t&&at&&K.createElement("span",{style:g,"aria-live":"assertive"},W(at)),K.createElement("div",{role:"tree"},K.createElement("input",{style:g,disabled:ft===!1||Ke,tabIndex:ft!==!1?gt:null,onKeyDown:xt,onFocus:Ze,onBlur:kt,value:"",onChange:_})),K.createElement(u.a,Object.assign({},xe,{data:ln,itemKey:j,height:Ue,fullHeight:!1,virtual:lt,itemHeight:rt,prefixCls:"".concat(ue,"-list"),ref:we}),function(tn){var sn=tn.pos,Qn=tn.data,sr=Qn.key,Nr=Object(l.a)(Qn,["key"]),hn=tn.isStart,Qt=tn.isEnd,$r=Object(a.e)(sr,sn);delete Nr.children;var fr=Object(a.f)($r,Yr);return K.createElement(S,Object.assign({},Nr,fr,{active:at&&sr===at.data.key,pos:sn,data:tn.data,isStart:hn,isEnd:Qt,motion:Ne,motionNodes:sr===h?rr:null,motionType:Pn,onMotionStart:qe,onMotionEnd:Or,treeNodeRequiredProps:Yr,onMouseMove:function(){Ot(null)}}))}))},M=K.forwardRef(T);M.displayName="NodeList";var m=M,v=U("NvD2"),H=function(re){Object(F.a)(pe,re);var ye=Object(G.a)(pe);function pe(){var ue;return Object(z.a)(this,pe),ue=ye.apply(this,arguments),ue.destroyed=!1,ue.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},ue.listRef=K.createRef(),ue.onNodeDragStart=function(fe,be){var se=ue.state,ae=se.expandedKeys,Ce=se.keyEntities,ze=ue.props.onDragStart,Ye=be.props.eventKey;ue.dragNode=be;var He=Object(c.b)(ae,Ye);ue.setState({dragging:!0,dragNodesKeys:Object(c.g)(Ye,Ce)}),ue.setExpandedKeys(He),ze&&ze({event:fe,node:Object(a.b)(be.props)})},ue.onNodeDragEnter=function(fe,be){var se=ue.state,ae=se.expandedKeys,Ce=se.keyEntities,ze=se.dragNodesKeys,Ye=ue.props.onDragEnter,He=be.props,Ve=He.pos,Fe=He.eventKey;if(!ue.dragNode||ze.indexOf(Fe)!==-1)return;var Ke=Object(c.c)(fe,be);if(ue.dragNode.props.eventKey===Fe&&Ke===0){ue.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ue.setState({dragOverNodeKey:Fe,dropPosition:Ke}),ue.delayedDragEnterLogic||(ue.delayedDragEnterLogic={}),Object.keys(ue.delayedDragEnterLogic).forEach(function(nt){clearTimeout(ue.delayedDragEnterLogic[nt])}),ue.delayedDragEnterLogic[Ve]=window.setTimeout(function(){if(!ue.state.dragging)return;var nt=Object(N.a)(ae),de=Ce[Fe];de&&(de.children||[]).length&&(nt=Object(c.a)(ae,Fe)),"expandedKeys"in ue.props||ue.setExpandedKeys(nt),Ye&&Ye({event:fe,node:Object(a.b)(be.props),expandedKeys:nt})},400)},0)},ue.onNodeDragOver=function(fe,be){var se=ue.state.dragNodesKeys,ae=ue.props.onDragOver,Ce=be.props.eventKey;if(se.indexOf(Ce)!==-1)return;if(ue.dragNode&&Ce===ue.state.dragOverNodeKey){var ze=Object(c.c)(fe,be);if(ze===ue.state.dropPosition)return;ue.setState({dropPosition:ze})}ae&&ae({event:fe,node:Object(a.b)(be.props)})},ue.onNodeDragLeave=function(fe,be){var se=ue.props.onDragLeave;ue.setState({dragOverNodeKey:""}),se&&se({event:fe,node:Object(a.b)(be.props)})},ue.onNodeDragEnd=function(fe,be){var se=ue.props.onDragEnd;ue.setState({dragOverNodeKey:""}),ue.cleanDragState(),se&&se({event:fe,node:Object(a.b)(be.props)}),ue.dragNode=null},ue.onNodeDrop=function(fe,be){var se=ue.state,ae=se.dragNodesKeys,Ce=ae===void 0?[]:ae,ze=se.dropPosition,Ye=ue.props.onDrop,He=be.props,Ve=He.eventKey,Fe=He.pos;if(ue.setState({dragOverNodeKey:""}),ue.cleanDragState(),Ce.indexOf(Ve)!==-1){Object(I.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Ke=Object(c.k)(Fe),nt={event:fe,node:Object(a.b)(be.props),dragNode:ue.dragNode?Object(a.b)(ue.dragNode.props):null,dragNodesKeys:Ce.slice(),dropPosition:ze+Number(Ke[Ke.length-1]),dropToGap:!1};ze!==0&&(nt.dropToGap=!0),Ye&&Ye(nt),ue.dragNode=null},ue.cleanDragState=function(){var fe=ue.state.dragging;fe&&ue.setState({dragging:!1})},ue.onNodeClick=function(fe,be){var se=ue.props.onClick;se&&se(fe,be)},ue.onNodeDoubleClick=function(fe,be){var se=ue.props.onDoubleClick;se&&se(fe,be)},ue.onNodeSelect=function(fe,be){var se=ue.state.selectedKeys,ae=ue.state.keyEntities,Ce=ue.props,ze=Ce.onSelect,Ye=Ce.multiple,He=be.selected,Ve=be.key,Fe=!He;Fe?Ye?se=Object(c.a)(se,Ve):se=[Ve]:se=Object(c.b)(se,Ve);var Ke=se.map(function(nt){var de=ae[nt];return de?de.node:null}).filter(function(nt){return nt});ue.setUncontrolledState({selectedKeys:se}),ze&&ze(se,{event:"select",selected:Fe,node:be,selectedNodes:Ke,nativeEvent:fe.nativeEvent})},ue.onNodeCheck=function(fe,be,se){var ae=ue.state,Ce=ae.keyEntities,ze=ae.checkedKeys,Ye=ae.halfCheckedKeys,He=ue.props,Ve=He.checkStrictly,Fe=He.onCheck,Ke=be.key,nt,de={event:"check",node:be,checked:se,nativeEvent:fe.nativeEvent};if(Ve){var De=se?Object(c.a)(ze,Ke):Object(c.b)(ze,Ke),Ne=Object(c.b)(Ye,Ke);nt={checked:De,halfChecked:Ne},de.checkedNodes=De.map(function(_t){return Ce[_t]}).filter(function(_t){return _t}).map(function(_t){return _t.node}),ue.setUncontrolledState({checkedKeys:De})}else{var Ue=Object(v.a)([].concat(Object(N.a)(ze),[Ke]),!0,Ce),rt=Ue.checkedKeys,lt=Ue.halfCheckedKeys;if(!se){var ft=new Set(rt);ft.delete(Ke);var at=Object(v.a)(Array.from(ft),{checked:!1,halfCheckedKeys:lt},Ce);rt=at.checkedKeys,lt=at.halfCheckedKeys}nt=rt,de.checkedNodes=[],de.checkedNodesPositions=[],de.halfCheckedKeys=lt,rt.forEach(function(_t){var gt=Ce[_t];if(!gt)return;var xt=gt.node,Ze=gt.pos;de.checkedNodes.push(xt),de.checkedNodesPositions.push({node:xt,pos:Ze})}),ue.setUncontrolledState({checkedKeys:rt},!1,{halfCheckedKeys:lt})}Fe&&Fe(nt,de)},ue.onNodeLoad=function(fe){return new Promise(function(be){ue.setState(function(se){var ae=se.loadedKeys,Ce=ae===void 0?[]:ae,ze=se.loadingKeys,Ye=ze===void 0?[]:ze,He=ue.props,Ve=He.loadData,Fe=He.onLoad,Ke=fe.key;if(!Ve||Ce.indexOf(Ke)!==-1||Ye.indexOf(Ke)!==-1)return{};var nt=Ve(fe);return nt.then(function(){var de=ue.state,De=de.loadedKeys,Ne=de.loadingKeys,Ue=Object(c.a)(De,Ke),rt=Object(c.b)(Ne,Ke);Fe&&Fe(Ue,{event:"load",node:fe}),ue.setUncontrolledState({loadedKeys:Ue}),ue.setState({loadingKeys:rt}),be()}),{loadingKeys:Object(c.a)(Ye,Ke)}})})},ue.onNodeMouseEnter=function(fe,be){var se=ue.props.onMouseEnter;se&&se({event:fe,node:be})},ue.onNodeMouseLeave=function(fe,be){var se=ue.props.onMouseLeave;se&&se({event:fe,node:be})},ue.onNodeContextMenu=function(fe,be){var se=ue.props.onRightClick;se&&(fe.preventDefault(),se({event:fe,node:be}))},ue.onFocus=function(){var fe=ue.props.onFocus;ue.setState({focused:!0}),fe&&fe.apply(void 0,arguments)},ue.onBlur=function(){var fe=ue.props.onBlur;ue.setState({focused:!1}),ue.onActiveChange(null),fe&&fe.apply(void 0,arguments)},ue.getTreeNodeRequiredProps=function(){var fe=ue.state,be=fe.expandedKeys,se=fe.selectedKeys,ae=fe.loadedKeys,Ce=fe.loadingKeys,ze=fe.checkedKeys,Ye=fe.halfCheckedKeys,He=fe.dragOverNodeKey,Ve=fe.dropPosition,Fe=fe.keyEntities;return{expandedKeys:be||[],selectedKeys:se||[],loadedKeys:ae||[],loadingKeys:Ce||[],checkedKeys:ze||[],halfCheckedKeys:Ye||[],dragOverNodeKey:He,dropPosition:Ve,keyEntities:Fe}},ue.setExpandedKeys=function(fe){var be=ue.state.treeData,se=Object(a.d)(be,fe);ue.setUncontrolledState({expandedKeys:fe,flattenNodes:se},!0)},ue.onNodeExpand=function(fe,be){var se=ue.state.expandedKeys,ae=ue.state.listChanging,Ce=ue.props,ze=Ce.onExpand,Ye=Ce.loadData,He=be.key,Ve=be.expanded;if(ae)return;var Fe=se.indexOf(He),Ke=!Ve;if(Object(I.a)(Ve&&Fe!==-1||!Ve&&Fe===-1,"Expand state not sync with index check"),Ke?se=Object(c.a)(se,He):se=Object(c.b)(se,He),ue.setExpandedKeys(se),ze&&ze(se,{node:be,expanded:Ke,nativeEvent:fe.nativeEvent}),Ke&&Ye){var nt=ue.onNodeLoad(be);nt&&nt.then(function(){var de=Object(a.d)(ue.state.treeData,se);ue.setUncontrolledState({flattenNodes:de})})}},ue.onListChangeStart=function(){ue.setUncontrolledState({listChanging:!0})},ue.onListChangeEnd=function(){setTimeout(function(){ue.setUncontrolledState({listChanging:!1})})},ue.onActiveChange=function(fe){var be=ue.state.activeKey,se=ue.props.onActiveChange;if(be===fe)return;ue.setState({activeKey:fe}),fe!==null&&ue.scrollTo({key:fe}),se&&se(fe)},ue.getActiveItem=function(){var fe=ue.state,be=fe.activeKey,se=fe.flattenNodes;return be===null?null:se.find(function(ae){var Ce=ae.data.key;return Ce===be})||null},ue.offsetActiveKey=function(fe){var be=ue.state,se=be.flattenNodes,ae=be.activeKey,Ce=se.findIndex(function(He){var Ve=He.data.key;return Ve===ae});Ce===-1&&fe<0&&(Ce=se.length),Ce=(Ce+fe+se.length)%se.length;var ze=se[Ce];if(ze){var Ye=ze.data.key;ue.onActiveChange(Ye)}else ue.onActiveChange(null)},ue.onKeyDown=function(fe){var be=ue.state,se=be.activeKey,ae=be.expandedKeys,Ce=be.checkedKeys,ze=ue.props,Ye=ze.onKeyDown,He=ze.checkable,Ve=ze.selectable;switch(fe.which){case n.a.UP:{ue.offsetActiveKey(-1),fe.preventDefault();break}case n.a.DOWN:{ue.offsetActiveKey(1),fe.preventDefault();break}}var Fe=ue.getActiveItem();if(Fe&&Fe.data){var Ke=ue.getTreeNodeRequiredProps(),nt=Fe.data.isLeaf===!1||!!(Fe.data.children||[]).length,de=Object(a.b)(Object(Y.a)(Object(Y.a)({},Object(a.f)(se,Ke)),{},{data:Fe.data,active:!0}));switch(fe.which){case n.a.LEFT:{nt&&ae.includes(se)?ue.onNodeExpand({},de):Fe.parent&&ue.onActiveChange(Fe.parent.data.key),fe.preventDefault();break}case n.a.RIGHT:{nt&&!ae.includes(se)?ue.onNodeExpand({},de):Fe.children&&Fe.children.length&&ue.onActiveChange(Fe.children[0].data.key),fe.preventDefault();break}case n.a.ENTER:case n.a.SPACE:{He&&!de.disabled&&de.checkable!==!1&&!de.disableCheckbox?ue.onNodeCheck({},de,!Ce.includes(se)):!He&&Ve&&!de.disabled&&de.selectable!==!1&&ue.onNodeSelect({},de);break}}}Ye&&Ye(fe)},ue.setUncontrolledState=function(fe){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ue.destroyed)return;var ae=!1,Ce=!0,ze={};Object.keys(fe).forEach(function(Ye){if(Ye in ue.props){Ce=!1;return}ae=!0,ze[Ye]=fe[Ye]}),ae&&(!be||Ce)&&ue.setState(Object(Y.a)(Object(Y.a)({},ze),se))},ue.scrollTo=function(fe){ue.listRef.current.scrollTo(fe)},ue}return Object(P.a)(pe,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var fe,be=this.state,se=be.focused,ae=be.flattenNodes,Ce=be.keyEntities,ze=be.dragging,Ye=be.activeKey,He=this.props,Ve=He.prefixCls,Fe=He.className,Ke=He.style,nt=He.showLine,de=He.focusable,De=He.tabIndex,Ne=De===void 0?0:De,Ue=He.selectable,rt=He.showIcon,lt=He.icon,ft=He.switcherIcon,at=He.draggable,_t=He.checkable,gt=He.checkStrictly,xt=He.disabled,Ze=He.motion,kt=He.loadData,Ot=He.filterTreeNode,qe=He.height,st=He.itemHeight,xe=He.virtual,we=He.titleRender,me=He.onContextMenu,ce=Object(c.f)(this.props);return K.createElement(b.a.Provider,{value:{prefixCls:Ve,selectable:Ue,showIcon:rt,icon:lt,switcherIcon:ft,draggable:at,checkable:_t,checkStrictly:gt,disabled:xt,keyEntities:Ce,loadData:kt,filterTreeNode:Ot,titleRender:we,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}},K.createElement("div",{className:f()(Ve,Fe,(fe={},Object(te.a)(fe,"".concat(Ve,"-show-line"),nt),Object(te.a)(fe,"".concat(Ve,"-focused"),se),Object(te.a)(fe,"".concat(Ve,"-active-focused"),Ye!==null),fe))},K.createElement(m,Object.assign({ref:this.listRef,prefixCls:Ve,style:Ke,data:ae,disabled:xt,selectable:Ue,checkable:!!_t,motion:Ze,dragging:ze,height:qe,itemHeight:st,virtual:xe,focusable:de,focused:se,tabIndex:Ne,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:me},this.getTreeNodeRequiredProps(),ce))))}}],[{key:"getDerivedStateFromProps",value:function(fe,be){var se=be.prevProps,ae={prevProps:fe};function Ce(lt){return!se&&lt in fe||se&&se[lt]!==fe[lt]}var ze;if(Ce("treeData")?ze=fe.treeData:Ce("children")&&(Object(I.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),ze=Object(a.c)(fe.children)),ze){ae.treeData=ze;var Ye=Object(a.a)(ze);ae.keyEntities=Object(Y.a)(Object(te.a)({},h,C),Ye.keyEntities)}var He=ae.keyEntities||be.keyEntities;if(Ce("expandedKeys")||se&&Ce("autoExpandParent"))ae.expandedKeys=fe.autoExpandParent||!se&&fe.defaultExpandParent?Object(c.e)(fe.expandedKeys,He):fe.expandedKeys;else if(!se&&fe.defaultExpandAll){var Ve=Object(Y.a)({},He);delete Ve[h],ae.expandedKeys=Object.keys(Ve).map(function(lt){return Ve[lt].key})}else!se&&fe.defaultExpandedKeys&&(ae.expandedKeys=fe.autoExpandParent||fe.defaultExpandParent?Object(c.e)(fe.defaultExpandedKeys,He):fe.defaultExpandedKeys);if(ae.expandedKeys||delete ae.expandedKeys,ze||ae.expandedKeys){var Fe=Object(a.d)(ze||be.treeData,ae.expandedKeys||be.expandedKeys);ae.flattenNodes=Fe}if(fe.selectable&&(Ce("selectedKeys")?ae.selectedKeys=Object(c.d)(fe.selectedKeys,fe):!se&&fe.defaultSelectedKeys&&(ae.selectedKeys=Object(c.d)(fe.defaultSelectedKeys,fe))),fe.checkable){var Ke;if(Ce("checkedKeys")?Ke=Object(c.j)(fe.checkedKeys)||{}:!se&&fe.defaultCheckedKeys?Ke=Object(c.j)(fe.defaultCheckedKeys)||{}:ze&&(Ke=Object(c.j)(fe.checkedKeys)||{checkedKeys:be.checkedKeys,halfCheckedKeys:be.halfCheckedKeys}),Ke){var nt=Ke,de=nt.checkedKeys,De=de===void 0?[]:de,Ne=nt.halfCheckedKeys,Ue=Ne===void 0?[]:Ne;if(!fe.checkStrictly){var rt=Object(v.a)(De,!0,He);De=rt.checkedKeys,Ue=rt.halfCheckedKeys}ae.checkedKeys=De,ae.halfCheckedKeys=Ue}}return Ce("loadedKeys")&&(ae.loadedKeys=fe.loadedKeys),ae}}]),pe}(K.Component);H.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:[]},H.TreeNode=i.a;var X=H,q=ge.b=X},fcSX:function(ct,ge,U){"use strict";var te=U("Ff2n"),Y=U("1OyB"),N=U("vuIU"),z=U("Ji7U"),P=U("md7G"),F=U("foSv"),G=U("1W/9"),K=U("q1tI"),n=U("rePB"),I=U("JX7q"),E=U("TSYQ"),f=U.n(E),b=U("qx4F"),c=U("4IlW");function a(T){return Array.isArray(T)?T:[T]}var p={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},l=Object.keys(p).filter(function(T){if(typeof document=="undefined")return!1;var M=document.getElementsByTagName("html")[0];return T in(M?M.style:{})})[0],u=p[l];function s(T,M,m,v){T.addEventListener?T.addEventListener(M,m,v):T.attachEvent&&T.attachEvent("on".concat(M),m)}function i(T,M,m,v){T.removeEventListener?T.removeEventListener(M,m,v):T.attachEvent&&T.detachEvent("on".concat(M),m)}function D(T,M){var m=typeof T=="function"?T(M):T;return Array.isArray(m)?m.length===2?m:[m[0],m[1]]:[m]}var A=function(M){return!isNaN(parseFloat(M))&&isFinite(M)},S=!(typeof window!="undefined"&&window.document&&window.document.createElement),R=function T(M,m,v,H){if(!m||m===document||m instanceof Document)return!1;if(m===M.parentNode)return!0;var X=Math.max(Math.abs(v),Math.abs(H))===Math.abs(H),q=Math.max(Math.abs(v),Math.abs(H))===Math.abs(v),re=m.scrollHeight-m.clientHeight,ye=m.scrollWidth-m.clientWidth,pe=document.defaultView.getComputedStyle(m),ue=pe.overflowY==="auto"||pe.overflowY==="scroll",fe=pe.overflowX==="auto"||pe.overflowX==="scroll",be=re&&ue,se=ye&&fe;return X&&(!be||be&&(m.scrollTop>=re&&H<0||m.scrollTop<=0&&H>0))||q&&(!se||se&&(m.scrollLeft>=ye&&v<0||m.scrollLeft<=0&&v>0))?T(M,m.parentNode,v,H):!1};function O(T){var M=g();return function(){var v=Object(F.a)(T),H;if(M){var X=Object(F.a)(this).constructor;H=Reflect.construct(v,arguments,X)}else H=v.apply(this,arguments);return Object(P.a)(this,H)}}function g(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(T){return!1}}var _={},h=function(T){Object(z.a)(m,T);var M=O(m);function m(v){var H;return Object(Y.a)(this,m),H=M.call(this,v),H.domFocus=function(){H.dom&&H.dom.focus()},H.removeStartHandler=function(X){if(X.touches.length>1)return;H.startPos={x:X.touches[0].clientX,y:X.touches[0].clientY}},H.removeMoveHandler=function(X){if(X.changedTouches.length>1)return;var q=X.currentTarget,re=X.changedTouches[0].clientX-H.startPos.x,ye=X.changedTouches[0].clientY-H.startPos.y;(q===H.maskDom||q===H.handlerDom||q===H.contentDom&&R(q,X.target,re,ye))&&X.cancelable&&X.preventDefault()},H.transitionEnd=function(X){var q=X.target;i(q,u,H.transitionEnd),q.style.transition=""},H.onKeyDown=function(X){if(X.keyCode===c.a.ESC){var q=H.props.onClose;X.stopPropagation(),q&&q(X)}},H.onWrapperTransitionEnd=function(X){var q=H.props,re=q.open,ye=q.afterVisibleChange;X.target===H.contentWrapper&&X.propertyName.match(/transform$/)&&(H.dom.style.transition="",!re&&H.getCurrentDrawerSome()&&(document.body.style.overflowX="",H.maskDom&&(H.maskDom.style.left="",H.maskDom.style.width="")),ye&&ye(!!re))},H.openLevelTransition=function(){var X=H.props,q=X.open,re=X.width,ye=X.height,pe=H.getHorizontalBoolAndPlacementName(),ue=pe.isHorizontal,fe=pe.placementName,be=H.contentDom?H.contentDom.getBoundingClientRect()[ue?"width":"height"]:0,se=(ue?re:ye)||be;H.setLevelAndScrolling(q,fe,se)},H.setLevelTransform=function(X,q,re,ye){var pe=H.props,ue=pe.placement,fe=pe.levelMove,be=pe.duration,se=pe.ease,ae=pe.showMask;H.levelDom.forEach(function(Ce){Ce.style.transition="transform ".concat(be," ").concat(se),s(Ce,u,H.transitionEnd);var ze=X?re:0;if(fe){var Ye=D(fe,{target:Ce,open:X});ze=X?Ye[0]:Ye[1]||0}var He=typeof ze=="number"?"".concat(ze,"px"):ze,Ve=ue==="left"||ue==="top"?He:"-".concat(He);Ve=ae&&ue==="right"&&ye?"calc(".concat(Ve," + ").concat(ye,"px)"):Ve,Ce.style.transform=ze?"".concat(q,"(").concat(Ve,")"):""})},H.setLevelAndScrolling=function(X,q,re){var ye=H.props.onChange;if(!S){var pe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(b.a)(!0):0;H.setLevelTransform(X,q,re,pe),H.toggleScrollingToDrawerAndBody(pe)}ye&&ye(X)},H.toggleScrollingToDrawerAndBody=function(X){var q=H.props,re=q.getOpenCount,ye=q.getContainer,pe=q.showMask,ue=q.open,fe=ye&&ye(),be=re&&re();if(fe&&fe.parentNode===document.body&&pe){var se=["touchstart"],ae=[document.body,H.maskDom,H.handlerDom,H.contentDom];ue&&document.body.style.overflow!=="hidden"?(X&&H.addScrollingEffect(X),be===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ae.forEach(function(Ce,ze){if(!Ce)return;s(Ce,se[ze]||"touchmove",ze?H.removeMoveHandler:H.removeStartHandler,H.passive)})):H.getCurrentDrawerSome()&&(be||(document.body.style.overflow=""),document.body.style.touchAction="",X&&H.remScrollingEffect(X),ae.forEach(function(Ce,ze){if(!Ce)return;i(Ce,se[ze]||"touchmove",ze?H.removeMoveHandler:H.removeStartHandler,H.passive)}))}},H.addScrollingEffect=function(X){var q=H.props,re=q.placement,ye=q.duration,pe=q.ease,ue=q.getOpenCount,fe=q.switchScrollingEffect,be=ue&&ue();be===1&&fe();var se="width ".concat(ye," ").concat(pe),ae="transform ".concat(ye," ").concat(pe);H.dom.style.transition="none";switch(re){case"right":H.dom.style.transform="translateX(-".concat(X,"px)");break;case"top":case"bottom":H.dom.style.width="calc(100% - ".concat(X,"px)"),H.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(ae,",").concat(se),H.dom.style.width="",H.dom.style.transform="")})},H.remScrollingEffect=function(X){var q=H.props,re=q.placement,ye=q.duration,pe=q.ease,ue=q.getOpenCount,fe=q.switchScrollingEffect,be=ue&&ue();be||fe(!0),l&&(document.body.style.overflowX="hidden"),H.dom.style.transition="none";var se,ae="width ".concat(ye," ").concat(pe),Ce="transform ".concat(ye," ").concat(pe);switch(re){case"left":{H.dom.style.width="100%",ae="width 0s ".concat(pe," ").concat(ye);break}case"right":{H.dom.style.transform="translateX(".concat(X,"px)"),H.dom.style.width="100%",ae="width 0s ".concat(pe," ").concat(ye),H.maskDom&&(H.maskDom.style.left="-".concat(X,"px"),H.maskDom.style.width="calc(100% + ".concat(X,"px)"));break}case"top":case"bottom":{H.dom.style.width="calc(100% + ".concat(X,"px)"),H.dom.style.height="100%",H.dom.style.transform="translateZ(0)",se="height 0s ".concat(pe," ").concat(ye);break}default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(Ce,",").concat(se?"".concat(se,","):"").concat(ae),H.dom.style.transform="",H.dom.style.width="",H.dom.style.height="")})},H.getCurrentDrawerSome=function(){return!Object.keys(_).some(function(X){return _[X]})},H.getLevelDom=function(X){var q=X.level,re=X.getContainer;if(S)return;var ye=re&&re(),pe=ye?ye.parentNode:null;if(H.levelDom=[],q==="all"){var ue=pe?Array.prototype.slice.call(pe.children):[];ue.forEach(function(fe){fe.nodeName!=="SCRIPT"&&fe.nodeName!=="STYLE"&&fe.nodeName!=="LINK"&&fe!==ye&&H.levelDom.push(fe)})}else q&&a(q).forEach(function(fe){document.querySelectorAll(fe).forEach(function(be){H.levelDom.push(be)})})},H.getHorizontalBoolAndPlacementName=function(){var X=H.props.placement,q=X==="left"||X==="right",re="translate".concat(q?"X":"Y");return{isHorizontal:q,placementName:re}},H.state={_self:Object(I.a)(H)},H}return Object(N.a)(m,[{key:"componentDidMount",value:function(){var H=this;if(!S){var X=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return X=!0,null}}))}catch(ue){}this.passive=X?{passive:!1}:!1}var q=this.props,re=q.open,ye=q.getContainer,pe=ye&&ye();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),re&&(pe&&pe.parentNode===document.body&&(_[this.drawerId]=re),this.openLevelTransition(),this.forceUpdate(function(){H.domFocus()}))}},{key:"componentDidUpdate",value:function(H){var X=this.props,q=X.open,re=X.getContainer,ye=re&&re();q!==H.open&&(q&&this.domFocus(),ye&&ye.parentNode===document.body&&(_[this.drawerId]=!!q),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var H=this.props,X=H.getOpenCount,q=H.open,re=H.switchScrollingEffect,ye=typeof X=="function"&&X();delete _[this.drawerId],q&&(this.setLevelTransform(!1),document.body.style.touchAction=""),ye||(document.body.style.overflow="",re(!0))}},{key:"render",value:function(){var H,X=this,q=this.props,re=q.className,ye=q.children,pe=q.style,ue=q.width,fe=q.height,be=q.defaultOpen,se=q.open,ae=q.prefixCls,Ce=q.placement,ze=q.level,Ye=q.levelMove,He=q.ease,Ve=q.duration,Fe=q.getContainer,Ke=q.handler,nt=q.onChange,de=q.afterVisibleChange,De=q.showMask,Ne=q.maskClosable,Ue=q.maskStyle,rt=q.onClose,lt=q.onHandleClick,ft=q.keyboard,at=q.getOpenCount,_t=q.switchScrollingEffect,gt=Object(te.a)(q,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),xt=this.dom?se:!1,Ze=f()(ae,(H={},Object(n.a)(H,"".concat(ae,"-").concat(Ce),!0),Object(n.a)(H,"".concat(ae,"-open"),xt),Object(n.a)(H,re||"",!!re),Object(n.a)(H,"no-mask",!De),H)),kt=this.getHorizontalBoolAndPlacementName(),Ot=kt.placementName,qe=Ce==="left"||Ce==="top"?"-100%":"100%",st=xt?"":"".concat(Ot,"(").concat(qe,")"),xe=Ke&&K.cloneElement(Ke,{onClick:function(me){Ke.props.onClick&&Ke.props.onClick(),lt&&lt(me)},ref:function(me){X.handlerDom=me}});return K.createElement("div",Object.assign({},gt,{tabIndex:-1,className:Ze,style:pe,ref:function(me){X.dom=me},onKeyDown:xt&&ft?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),De&&K.createElement("div",{className:"".concat(ae,"-mask"),onClick:Ne?rt:void 0,style:Ue,ref:function(me){X.maskDom=me}}),K.createElement("div",{className:"".concat(ae,"-content-wrapper"),style:{transform:st,msTransform:st,width:A(ue)?"".concat(ue,"px"):ue,height:A(fe)?"".concat(fe,"px"):fe},ref:function(me){X.contentWrapper=me}},K.createElement("div",{className:"".concat(ae,"-content"),ref:function(me){X.contentDom=me},onTouchStart:xt&&De?this.removeStartHandler:void 0,onTouchMove:xt&&De?this.removeMoveHandler:void 0},ye),xe))}}],[{key:"getDerivedStateFromProps",value:function(H,X){var q=X.prevProps,re=X._self,ye={prevProps:H};if(q!==void 0){var pe=H.placement,ue=H.level;pe!==q.placement&&(re.contentDom=null),ue!==q.level&&re.getLevelDom(H)}return ye}}]),m}(K.Component);h.defaultProps={switchScrollingEffect:function(){}};var d=h;function C(T){var M=x();return function(){var v=Object(F.a)(T),H;if(M){var X=Object(F.a)(this).constructor;H=Reflect.construct(v,arguments,X)}else H=v.apply(this,arguments);return Object(P.a)(this,H)}}function x(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(T){return!1}}var w=function(T){Object(z.a)(m,T);var M=C(m);function m(v){var H;Object(Y.a)(this,m),H=M.call(this,v),H.onHandleClick=function(q){var re=H.props,ye=re.onHandleClick,pe=re.open;if(ye&&ye(q),typeof pe=="undefined"){var ue=H.state.open;H.setState({open:!ue})}},H.onClose=function(q){var re=H.props,ye=re.onClose,pe=re.open;ye&&ye(q),typeof pe=="undefined"&&H.setState({open:!1})};var X=typeof v.open!="undefined"?v.open:!!v.defaultOpen;return H.state={open:X},"onMaskClick"in v&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),H}return Object(N.a)(m,[{key:"render",value:function(){var H=this,X=this.props,q=X.defaultOpen,re=X.getContainer,ye=X.wrapperClassName,pe=X.forceRender,ue=X.handler,fe=Object(te.a)(X,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),be=this.state.open;if(!re)return K.createElement("div",{className:ye,ref:function(Ce){H.dom=Ce}},K.createElement(d,Object.assign({},fe,{open:be,handler:ue,getContainer:function(){return H.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var se=!!ue||pe;return K.createElement(G.a,{visible:be,forceRender:se,getContainer:re,wrapperClassName:ye},function(ae){var Ce=ae.visible,ze=ae.afterClose,Ye=Object(te.a)(ae,["visible","afterClose"]);return K.createElement(d,Object.assign({},fe,Ye,{open:Ce!==void 0?Ce:be,afterVisibleChange:ze!==void 0?ze:fe.afterVisibleChange,handler:ue,onClose:H.onClose,onHandleClick:H.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(H,X){var q=X.prevProps,re={prevProps:H};return typeof q!="undefined"&&H.open!==q.open&&(re.open=H.open),re}}]),m}(K.Component);w.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:K.createElement("div",{className:"drawer-handle"},K.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var j=w,W=ge.a=j},fjLI:function(ct,ge,U){"use strict";U.d(ge,"f",function(){return b}),U.d(ge,"b",function(){return c}),U.d(ge,"a",function(){return a}),U.d(ge,"d",function(){return p}),U.d(ge,"e",function(){return l}),U.d(ge,"c",function(){return u});var te=U("8HAY"),Y=U("Vhoy"),N=U("MI8n"),z=U("JYp7"),P=U("pmY6"),F=U("24hK"),G=U("nnTU"),K=U("T8No"),n=U("Cg/j"),I=U("t9D7"),E=function(s,i,D,A){var S=arguments.length,R=S<3?i:A===null?A=Object.getOwnPropertyDescriptor(i,D):A,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(s,i,D,A);else for(var g=s.length-1;g>=0;g--)(O=s[g])&&(R=(S<3?O(R):S>3?O(i,D,R):O(i,D))||R);return S>3&&R&&Object.defineProperty(i,D,R),R},f=function(s,i){return function(D,A){i(D,A,s)}};function b(s){return s.command!==void 0}class c{constructor(s){this.id=c._idPool++,this._debugName=s}}c._idPool=0,c.CommandPalette=new c("CommandPalette"),c.EditorContext=new c("EditorContext"),c.SimpleEditorContext=new c("SimpleEditorContext"),c.EditorContextCopy=new c("EditorContextCopy"),c.EditorContextPeek=new c("EditorContextPeek"),c.MenubarEditMenu=new c("MenubarEditMenu"),c.MenubarCopy=new c("MenubarCopy"),c.MenubarGoMenu=new c("MenubarGoMenu"),c.MenubarSelectionMenu=new c("MenubarSelectionMenu"),c.InlineCompletionsActions=new c("InlineCompletionsActions");const a=Object(n.c)("menuService"),p=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new N.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===c.CommandPalette}}addCommand(s){return this.addCommands(z.a.single(s))}addCommands(s){for(const i of s)this._commands.set(i.id,i);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(P.i)(()=>{let i=!1;for(const D of s)i=this._commands.delete(D.id)||i;i&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((i,D)=>s.set(D,i)),s}appendMenuItem(s,i){return this.appendMenuItems(z.a.single({id:s,item:i}))}appendMenuItems(s){const i=new Set,D=new F.a;for(const{id:A,item:S}of s){let R=this._menuItems.get(A);R||(R=new F.a,this._menuItems.set(A,R)),D.push(R.push(S)),i.add(A)}return this._onDidChangeMenu.fire(i),Object(P.i)(()=>{if(D.size>0){for(let A of D)A();this._onDidChangeMenu.fire(i),D.clear()}})}getMenuItems(s){let i;return this._menuItems.has(s)?i=[...this._menuItems.get(s)]:i=[],s===c.CommandPalette&&this._appendImplicitItems(i),i}_appendImplicitItems(s){const i=new Set;for(const D of s)b(D)&&(i.add(D.command.id),D.alt&&i.add(D.alt.id));this._commands.forEach((D,A)=>{i.has(A)||s.push({command:D})})}};class l extends te.e{constructor(s,i,D,A){super(`submenuitem.${s.submenu.id}`,typeof s.title=="string"?s.title:s.title.value,[],"submenu");this.item=s,this._menuService=i,this._contextKeyService=D,this._options=A}get actions(){const s=[],i=this._menuService.createMenu(this.item.submenu,this._contextKeyService),D=i.getActions(this._options);i.dispose();for(const[,A]of D)A.length>0&&(s.push(...A),s.push(new te.d));return s.length&&s.pop(),s}}let u=class s{constructor(i,D,A,S,R){var O,g;if(this._commandService=R,this.id=i.id,this.label=(A==null?void 0:A.renderShortTitle)&&i.shortTitle?typeof i.shortTitle=="string"?i.shortTitle:i.shortTitle.value:typeof i.title=="string"?i.title:i.title.value,this.tooltip=(g=typeof i.tooltip=="string"?i.tooltip:(O=i.tooltip)===null||O===void 0?void 0:O.value)!==null&&g!==void 0?g:"",this.enabled=!i.precondition||S.contextMatchesRules(i.precondition),this.checked=void 0,i.toggled){const _=i.toggled.condition?i.toggled:{condition:i.toggled};this.checked=S.contextMatchesRules(_.condition),this.checked&&_.tooltip&&(this.tooltip=typeof _.tooltip=="string"?_.tooltip:_.tooltip.value),_.title&&(this.label=typeof _.title=="string"?_.title:_.title.value)}this.item=i,this.alt=D?new s(D,void 0,A,S,R):void 0,this._options=A,I.d.isThemeIcon(i.icon)&&(this.class=Y.a.asClassName(i.icon))}dispose(){}run(...i){var D,A;let S=[];return((D=this._options)===null||D===void 0?void 0:D.arg)&&(S=[...S,this._options.arg]),((A=this._options)===null||A===void 0?void 0:A.shouldForwardArgs)&&(S=[...S,...i]),this._commandService.executeCommand(this.id,...S)}};u=E([f(3,K.b),f(4,G.b)],u)},i8i3:function(ct,ge,U){ct.exports={flex_box_center:"flex_box_center___3Vf6o",flex_space_between:"flex_space_between___3kR1x",flex_box_vertical_center:"flex_box_vertical_center___25a0b",flex_box_center_end:"flex_box_center_end___3k_KQ",flex_box_column:"flex_box_column___38BD-",customModal:"customModal___2JXW3",shareModal:"shareModal___1xuLw",content:"content___1yjOV",group:"group___2tJcj",teachGroup:"teachGroup___VMxNc",footer:"footer___1OQG5"}},iNYN:function(ct,ge,U){ct.exports={modalContent:"modalContent___3NP2x",modalContentLeft:"modalContentLeft___ycFEY",green:"green___2njFR",textArea:"textArea___28pXQ",red:"red___2bPlD",row:"row___tW7CE",html:"html___30ord",line:"line___1f3U7"}},ic2d:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return z});var te=U("FWmy"),Y=U("746U");class N{constructor(){this.data=new Map}add(P,F){te.a(Y.l(P)),te.a(Y.k(F)),te.a(!this.data.has(P),"There is already an extension with this id"),this.data.set(P,F)}as(P){return this.data.get(P)||null}}const z=new N},iris:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return b});var te=U("qVdP"),Y=U("jsC+"),N=U("lUTK"),z=U("BvKs"),P=U("tJVT"),F=U("q1tI"),G=U.n(F),K=U("Q0Vu"),n=U.n(K),I=[{name:"\u7F16\u7A0B\u9898",value:"PROGRAM"},{name:"\u5355\u9009\u9898",value:"SINGLE"},{name:"\u591A\u9009\u9898",value:"MULTIPLE"},{name:"\u5224\u65AD\u9898",value:"JUDGMENT"},{name:"\u586B\u7A7A\u9898",value:"COMPLETION"},{name:"\u7B80\u7B54\u9898",value:"SUBJECTIVE"},{name:"\u7EC4\u5408\u9898",value:"COMBINATION"}],E=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],f=[{name:"\u968F\u673A\u7EC4\u5377",value:1},{name:"\u4EBA\u5DE5\u7EC4\u5377",value:2}],b=function(a){var p=a.showSelectAll,l=p===void 0?!1:p,u=a.disciplinesData,s=u===void 0?[]:u,i=a.knowledgeData,D=i===void 0?[]:i,A=a.directionValue,S=a.subDisciplineValue,R=a.typeValue,O=a.knowledgeValue,g=a.showKnowledge,_=g===void 0?!1:g,h=a.showRandomType,d=h===void 0?!1:h,C=a.difficultyValue,x=a.randomValue,w=a.selectAll,j=a.languagesvalue,W=a.className,T=a.languages,M=T===void 0?[]:T,m=a.isprogram_homework,v=a.showShixun,H=v===void 0?!1:v,X=a.showItemType,q=X===void 0?!0:X,re=a.onShixunChange,ye=re===void 0?function(){}:re,pe=a.onDirectionChange,ue=pe===void 0?function(){}:pe,fe=a.onTypeChange,be=fe===void 0?function(){}:fe,se=a.onDifficultyChange,ae=se===void 0?function(){}:se,Ce=a.handlelanguagesChange,ze=Ce===void 0?function(){}:Ce,Ye=a.onKnowledgeChange,He=Ye===void 0?function(){}:Ye,Ve=a.onRandomChange,Fe=Ve===void 0?function(){}:Ve,Ke=a.showTeachGroup,nt=Ke===void 0?!1:Ke,de=a.teachGroupData,De=de===void 0?[]:de,Ne=a.onTeachGroupChange,Ue=Ne===void 0?function(){}:Ne,rt=a.teachGroupValue,lt=Object(F.useState)(0),ft=Object(P.a)(lt,2),at=ft[0],_t=ft[1],gt=Object(F.useRef)(null),xt=Object(F.useState)(0),Ze=Object(P.a)(xt,2),kt=Ze[0],Ot=Ze[1],qe=Object(F.useRef)(null);Object(F.useEffect)(function(){if(s.length!==0){var xe;(gt==null||((xe=gt.current)===null||xe===void 0)?void 0:xe.clientHeight)>108?_t(1):_t(0)}s.length===0&&_t(0)},[s]),Object(F.useEffect)(function(){if(console.log(D.length===0,"\u6570\u91CF"),D.length!==0){var xe,we;console.log(qe==null||((xe=qe.current)===null||xe===void 0)?void 0:xe.clientHeight,"\u9AD8\u5EA6"),(qe==null||((we=qe.current)===null||we===void 0)?void 0:we.clientHeight)>108?Ot(1):Ot(0)}D.length===0&&Ot(0)},[D]);var st=function(){var we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],me=arguments.length>1?arguments[1]:void 0;return G.a.createElement(z.a,{className:n.a.subMenu},we.map(function(ce){return G.a.createElement(z.a.Item,{key:ce.id},G.a.createElement("a",{className:"".concat(n.a.subItem," ").concat(S===ce.id?n.a.subActive:""),onClick:function(){return ue(me,ce.id)}},ce.name))}))};return G.a.createElement("aside",{className:W?"".concat(n.a.main," ").concat(W):n.a.main},G.a.createElement("div",{className:n.a.wrap},m&&G.a.createElement("div",{className:n.a.programName},"\u8BD5\u9898\u5E93-\u7F16\u7A0B\u9898"),nt&&G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u56E2\u961F"),G.a.createElement("div",{className:n.a.directionContentWrap},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(rt?"":n.a.active," "),onClick:function(){return Ue(null)}},"\u5168\u90E8"),De==null?void 0:De.map(function(xe){return G.a.createElement("li",{key:xe.group_id,className:"".concat(n.a.directionItem," ").concat(rt===xe.group_id?n.a.active:""," "),onClick:function(){return Ue(xe.group_id)}},xe.name)}))),G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u65B9\u5411"),G.a.createElement("span",null),G.a.createElement("div",{className:n.a.directionContentWrap,style:{overflow:"hidden",height:at===1?88:"auto"}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A?"":n.a.active," "),onClick:function(){return ue(null)}},"\u5168\u90E8"),s.map(function(xe){var we;return G.a.createElement(G.a.Fragment,{key:xe.id},((we=xe.sub_disciplines)===null||we===void 0?void 0:we.length)>0?G.a.createElement(Y.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(ce){return ce.parentNode},overlay:function(){return st(xe.sub_disciplines,xe.id)}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===xe.id?n.a.active:""," "),onClick:function(){return ue(xe.id)}},xe.name)):G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===xe.id?n.a.active:""," "),onClick:function(){return ue(xe.id)}},xe.name))})),G.a.createElement("div",{className:n.a.directionContentWrap,ref:gt,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},s.map(function(xe){var we;return G.a.createElement(G.a.Fragment,{key:xe.id},((we=xe.sub_disciplines)===null||we===void 0?void 0:we.length)>0?G.a.createElement(Y.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(ce){return ce.parentNode},overlay:function(){return st(xe.sub_disciplines,xe.id)}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===xe.id?n.a.active:""," "),onClick:function(){return ue(xe.id)}},xe.name)):G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===xe.id?n.a.active:""," "),onClick:function(){return ue(xe.id)}},xe.name))})),!!at&&G.a.createElement("div",{className:n.a.action},at===1&&G.a.createElement("span",{onClick:function(){return _t(2)}},"\u5C55\u5F00",G.a.createElement("i",{className:"iconfont icon-xiala"})),at===2&&G.a.createElement("span",{onClick:function(){return _t(1)}},"\u6536\u8D77",G.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),_&&G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u77E5\u8BC6\u70B9"),G.a.createElement("div",{className:n.a.directionContentWrap,style:{overflow:"hidden",height:kt===1?106:"auto"}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(O===-1?n.a.active:""," "),onClick:function(){return He(-1)}},"\u5168\u90E8"),D.map(function(xe){return G.a.createElement("li",{key:xe.id,className:"".concat(n.a.directionItem," ").concat(O===xe.id?n.a.active:""," "),onClick:function(){return He(xe.id)}},xe.name)})),G.a.createElement("div",{ref:qe,className:n.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},D.map(function(xe){return G.a.createElement("li",{key:xe.id,className:"".concat(n.a.directionItem," ").concat(O===xe.id?n.a.active:""," "),onClick:function(){return He(xe.id)}},xe.name)})),!!kt&&G.a.createElement("div",{className:n.a.action},kt===1&&G.a.createElement("span",{onClick:function(){return Ot(2)}},"\u5C55\u5F00",G.a.createElement("i",{className:"iconfont icon-xiala"})),kt===2&&G.a.createElement("span",{onClick:function(){return Ot(1)}},"\u6536\u8D77",G.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),q&&!m&&G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u9898\u578B"),G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(R?"":n.a.active," "),onClick:function(){return be(null)}},"\u5168\u90E8"),G.a.createElement("div",{className:n.a.directionContentWrap},I.map(function(xe){return G.a.createElement("li",{key:xe.name,className:"".concat(n.a.directionItem," ").concat(R===xe.value?n.a.active:""," "),onClick:function(){return be(xe.value)}},xe.name)}),H&&G.a.createElement("li",{key:"\u5B9E\u8BAD\u9898",className:n.a.directionItem,onClick:function(){return ye()}},"\u5B9E\u8BAD\u9898"))),G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u96BE\u5EA6"),G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(C?"":n.a.active," "),onClick:function(){return ae(null)}},"\u5168\u90E8"),G.a.createElement("div",{className:n.a.directionContentWrap},E.map(function(xe){return G.a.createElement("li",{key:xe.name,className:"".concat(n.a.directionItem," ").concat(C===xe.value?n.a.active:""," "),onClick:function(){return ae(xe.value)}},xe.name)}))),d&&G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u7C7B\u578B"),G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(x?"":n.a.active," "),onClick:function(){return Fe(null)}},"\u5168\u90E8"),G.a.createElement("div",{className:n.a.directionContentWrap},f.map(function(xe){return G.a.createElement("li",{key:xe.name,className:"".concat(n.a.directionItem," ").concat(x===xe.value?n.a.active:""," "),onClick:function(){return Fe(xe.value)}},xe.name)})))))}},jcZT:function(ct,ge,U){"use strict";var te=U("2qtc"),Y=U("kLXV"),N=U("5NDa"),z=U("5rEg"),P=U("miYZ"),F=U("tsqr"),G=U("9og8"),K=U("tJVT"),n=U("WmNS"),I=U.n(n),E=U("q1tI"),f=U.n(E),b=U("d5o6"),c=U.n(b),a=U("P/tu"),p=U("WCUW"),l=U("9kvl"),u=function(i){var D=i.problemset,A=i.dispatch,S=i.onOk,R=Object(E.useState)(""),O=Object(K.a)(R,2),g=O[0],_=O[1],h=Object(E.useState)([0]),d=Object(K.a)(h,2),C=d[0],x=d[1],w=function(){A({type:"problemset/setActionTabs",payload:{}})};Object(E.useEffect)(function(){if(D.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var W,T;x([(W=D.actionTabs)===null||W===void 0||((T=W.params)===null||T===void 0)?void 0:T.group_id]),_("")}},[D.actionTabs.key]);var j=function(){var W=Object(G.a)(I.a.mark(function T(){var M,m,v;return I.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:if(M=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],g.trim()){X.next=4;break}return F.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),X.abrupt("return");case 4:if(!(g.charAt(0)===" ")){X.next=7;break}return F.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),X.abrupt("return");case 7:m=0;case 8:if(!(m<g.length)){X.next=15;break}if(!M.includes(g.charAt(m))){X.next=12;break}return F.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),X.abrupt("return",!1);case 12:m++,X.next=8;break;case 15:return X.next=17,Object(p.p)({parent_id:C.length>0?C[0]:0,name:g});case 17:v=X.sent,v.status===0&&(w(),S(v==null?void 0:v.id));case 19:case"end":return X.stop()}},T)}));return function(){return W.apply(this,arguments)}}();return f.a.createElement(Y.a,{centered:!0,title:"\u65B0\u5EFA\u6587\u4EF6\u5939",visible:D.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939",width:500,onCancel:w,onOk:j,destroyOnClose:!0},f.a.createElement("div",{className:c.a.addModal},f.a.createElement("div",{className:c.a.row},f.a.createElement("span",{className:c.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),f.a.createElement(z.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:g,onChange:function(T){return _(T.target.value)}})),f.a.createElement("div",{className:c.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},f.a.createElement("span",{className:c.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),f.a.createElement(a.a,{value:C,onChange:function(T){return x(T)}}))))};ge.a=Object(l.a)(function(s){var i=s.problemset;return{problemset:i}})(u)},k3GJ:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return fo});var te=U("rePB"),Y=U("ODXe"),N=U("Ff2n"),z=U("VTBJ"),P=U("q1tI"),F=U("TSYQ"),G=U.n(F),K=U("Zm9Q"),n=U("6cGi"),I=U("KQm4"),E=U("xEkU"),f=U.n(E),b=U("t23M");function c(Ee){var Le=Object(P.useRef)(),We=Object(P.useRef)(!1);function Se(){for(var ie=arguments.length,ve=new Array(ie),le=0;le<ie;le++)ve[le]=arguments[le];We.current||(f.a.cancel(Le.current),Le.current=f()(function(){Ee.apply(void 0,ve)}))}return Object(P.useEffect)(function(){return function(){We.current=!0,f.a.cancel(Le.current)}},[]),Se}function a(Ee){var Le=Object(P.useRef)([]),We=Object(P.useState)({}),Se=Object(Y.a)(We,2),ie=Se[1],ve=Object(P.useRef)(typeof Ee=="function"?Ee():Ee),le=c(function(){var _e=ve.current;Le.current.forEach(function(Be){_e=Be(_e)}),Le.current=[],ve.current=_e,ie({})});function Ae(_e){Le.current.push(_e),le()}return[ve.current,Ae]}var p=U("4IlW");function l(Ee,Le){var We,Se=Ee.prefixCls,ie=Ee.id,ve=Ee.active,le=Ee.rtl,Ae=Ee.tab,_e=Ae.key,Be=Ae.tab,je=Ae.disabled,Ge=Ae.closeIcon,tt=Ee.tabBarGutter,yt=Ee.tabPosition,Tt=Ee.closable,Nt=Ee.renderWrapper,Rn=Ee.removeAriaLabel,$n=Ee.editable,Bn=Ee.onClick,zn=Ee.onRemove,Xn=Ee.onFocus,Vn="".concat(Se,"-tab");P.useEffect(function(){return zn},[]);var Fn={};yt==="top"||yt==="bottom"?Fn[le?"marginLeft":"marginRight"]=tt:Fn.marginBottom=tt;var Jn=$n&&Tt!==!1&&!je;function er(_n){if(je)return;Bn(_n)}function jr(_n){_n.preventDefault(),_n.stopPropagation(),$n.onEdit("remove",{key:_e,event:_n})}var tr=P.createElement("div",{key:_e,ref:Le,className:G()(Vn,(We={},Object(te.a)(We,"".concat(Vn,"-with-remove"),Jn),Object(te.a)(We,"".concat(Vn,"-active"),ve),Object(te.a)(We,"".concat(Vn,"-disabled"),je),We)),style:Fn,onClick:er},P.createElement("div",{role:"tab","aria-selected":ve,id:ie&&"".concat(ie,"-tab-").concat(_e),className:"".concat(Vn,"-btn"),"aria-controls":ie&&"".concat(ie,"-panel-").concat(_e),"aria-disabled":je,tabIndex:je?null:0,onClick:function(vn){vn.stopPropagation(),er(vn)},onKeyDown:function(vn){[p.a.SPACE,p.a.ENTER].includes(vn.which)&&(vn.preventDefault(),er(vn))},onFocus:Xn},Be),Jn&&P.createElement("button",{type:"button","aria-label":Rn||"remove",tabIndex:0,className:"".concat(Vn,"-remove"),onClick:function(vn){vn.stopPropagation(),jr(vn)}},Ge||$n.removeIcon||"\xD7"));return Nt&&(tr=Nt(tr)),tr}var u=P.forwardRef(l),s={width:0,height:0,left:0,top:0};function i(Ee,Le,We){return Object(P.useMemo)(function(){for(var Se,ie=new Map,ve=Le.get((Se=Ee[0])===null||Se===void 0?void 0:Se.key)||s,le=ve.left+ve.width,Ae=0;Ae<Ee.length;Ae+=1){var _e=Ee[Ae].key,Be=Le.get(_e);if(!Be){var je;Be=Le.get((je=Ee[Ae-1])===null||je===void 0?void 0:je.key)||s}var Ge=ie.get(_e)||Object(z.a)({},Be);Ge.right=le-Ge.left-Ge.width,ie.set(_e,Ge)}return ie},[Ee.map(function(Se){return Se.key}).join("_"),Le,We])}var D={width:0,height:0,left:0,top:0,right:0};function A(Ee,Le,We,Se,ie){var ve=ie.tabs,le=ie.tabPosition,Ae=ie.rtl,_e,Be,je;["top","bottom"].includes(le)?(_e="width",Be=Ae?"right":"left",je=Math.abs(Le.left)):(_e="height",Be="top",je=-Le.top);var Ge=Le[_e],tt=We[_e],yt=Se[_e],Tt=Ge;return tt+yt>Ge&&(Tt=Ge-yt),Object(P.useMemo)(function(){if(!ve.length)return[0,0];for(var Nt=ve.length,Rn=Nt,$n=0;$n<Nt;$n+=1){var Bn=Ee.get(ve[$n].key)||D;if(Bn[Be]+Bn[_e]>je+Tt){Rn=$n-1;break}}for(var zn=0,Xn=Nt-1;Xn>=0;Xn-=1){var Vn=Ee.get(ve[Xn].key)||D;if(Vn[Be]<je){zn=Xn+1;break}}return[zn,Rn]},[Ee,je,Tt,le,ve.map(function(Nt){return Nt.key}).join("_"),Ae])}var S=U("wx14"),R=U("1OyB"),O=U("vuIU"),g=U("JX7q"),_=U("Ji7U"),h=U("LK+K"),d=U("I8Z2"),C=U("bT9E"),x=U("2GS6"),w=U("Gytx"),j=U.n(w),W=U("U8pU"),T=/iPhone/i,M=/iPod/i,m=/iPad/i,v=/\bAndroid(?:.+)Mobile\b/i,H=/Android/i,X=/\bAndroid(?:.+)SD4930UR\b/i,q=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,re=/Windows Phone/i,ye=/\bWindows(?:.+)ARM\b/i,pe=/BlackBerry/i,ue=/BB10/i,fe=/Opera Mini/i,be=/\b(CriOS|Chrome)(?:.+)Mobile/i,se=/Mobile(?:.+)Firefox\b/i;function ae(Ee,Le){return Ee.test(Le)}function Ce(Ee){var Le=Ee||(typeof navigator!="undefined"?navigator.userAgent:""),We=(Le||"").split("[FBAN");if(typeof We[1]!="undefined"){var Se=We,ie=Object(Y.a)(Se,1);Le=ie[0]}if(We=Le.split("Twitter"),typeof We[1]!="undefined"){var ve=We,le=Object(Y.a)(ve,1);Le=le[0]}var Ae={apple:{phone:ae(T,Le)&&!ae(re,Le),ipod:ae(M,Le),tablet:!ae(T,Le)&&ae(m,Le)&&!ae(re,Le),device:(ae(T,Le)||ae(M,Le)||ae(m,Le))&&!ae(re,Le)},amazon:{phone:ae(X,Le),tablet:!ae(X,Le)&&ae(q,Le),device:ae(X,Le)||ae(q,Le)},android:{phone:!ae(re,Le)&&ae(X,Le)||!ae(re,Le)&&ae(v,Le),tablet:!ae(re,Le)&&!ae(X,Le)&&!ae(v,Le)&&(ae(q,Le)||ae(H,Le)),device:!ae(re,Le)&&(ae(X,Le)||ae(q,Le)||ae(v,Le)||ae(H,Le))||ae(/\bokhttp\b/i,Le)},windows:{phone:ae(re,Le),tablet:ae(ye,Le),device:ae(re,Le)||ae(ye,Le)},other:{blackberry:ae(pe,Le),blackberry10:ae(ue,Le),opera:ae(fe,Le),firefox:ae(se,Le),chrome:ae(be,Le),device:ae(pe,Le)||ae(ue,Le)||ae(fe,Le)||ae(se,Le)||ae(be,Le)},any:null,phone:null,tablet:null};return Ae.any=Ae.apple.device||Ae.android.device||Ae.windows.device||Ae.other.device,Ae.phone=Ae.apple.phone||Ae.android.phone||Ae.windows.phone,Ae.tablet=Ae.apple.tablet||Ae.android.tablet||Ae.windows.tablet,Ae}var ze=Object(z.a)(Object(z.a)({},Ce()),{},{isMobile:Ce}),Ye=ze;function He(){}function Ve(Ee,Le,We){var Se=Le||"";return Ee.key||"".concat(Se,"item_").concat(We)}function Fe(Ee){return"".concat(Ee,"-menu-")}function Ke(Ee,Le){var We=-1;P.Children.forEach(Ee,function(Se){We+=1,Se&&Se.type&&Se.type.isMenuItemGroup?P.Children.forEach(Se.props.children,function(ie){We+=1,Le(ie,We)}):Le(Se,We)})}function nt(Ee,Le,We){if(!Ee||We.find)return;P.Children.forEach(Ee,function(Se){if(Se){var ie=Se.type;if(!ie||!(ie.isSubMenu||ie.isMenuItem||ie.isMenuItemGroup))return;Le.indexOf(Se.key)!==-1?We.find=!0:Se.props.children&&nt(Se.props.children,Le,We)}})}var de=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],De=function(Le){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Se=Le&&typeof Le.getBoundingClientRect=="function"&&Le.getBoundingClientRect().width;if(Se){if(We){var ie=getComputedStyle(Le),ve=ie.marginLeft,le=ie.marginRight;Se+=+ve.replace("px","")+ +le.replace("px","")}Se=+Se.toFixed(6)}return Se||0},Ne=function(Le,We,Se){Le&&Object(W.a)(Le.style)==="object"&&(Le.style[We]=Se)},Ue=function(){return Ye.any},rt=U("bdgK"),lt=U("i8i4"),ft=U.n(lt),at=U("wgJM"),_t=U("l4aY"),gt=U("m+aA"),xt=U("c+Xe"),Ze=U("zT1h"),kt=U("QC+M");function Ot(Ee,Le,We){return We?Ee[0]===Le[0]:Ee[0]===Le[0]&&Ee[1]===Le[1]}function qe(Ee,Le,We){var Se=Ee[Le]||{};return Object(z.a)(Object(z.a)({},Se),We)}function st(Ee,Le,We,Se){for(var ie=We.points,ve=Object.keys(Ee),le=0;le<ve.length;le+=1){var Ae=ve[le];if(Ot(Ee[Ae].points,ie,Se))return"".concat(Le,"-placement-").concat(Ae)}return""}var xe=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Ee=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Ee)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Ee==null?void 0:Ee.substr(0,4)))},we=U("MNnm");function me(Ee,Le){var We={};return We[Ee.toLowerCase()]=Le.toLowerCase(),We["Webkit".concat(Ee)]="webkit".concat(Le),We["Moz".concat(Ee)]="moz".concat(Le),We["ms".concat(Ee)]="MS".concat(Le),We["O".concat(Ee)]="o".concat(Le.toLowerCase()),We}function ce(Ee,Le){var We={animationend:me("Animation","AnimationEnd"),transitionend:me("Transition","TransitionEnd")};return Ee&&("AnimationEvent"in Le||delete We.animationend.animation,"TransitionEvent"in Le||delete We.transitionend.transition),We}var he=ce(Object(we.a)(),typeof window!="undefined"?window:{}),Te={};if(Object(we.a)()){var Re=document.createElement("div");Te=Re.style}var Me={};function et(Ee){if(Me[Ee])return Me[Ee];var Le=he[Ee];if(Le)for(var We=Object.keys(Le),Se=We.length,ie=0;ie<Se;ie+=1){var ve=We[ie];if(Object.prototype.hasOwnProperty.call(Le,ve)&&ve in Te)return Me[Ee]=Le[ve],Me[Ee]}return""}var ht=et("animationend"),Ut=et("transitionend"),nn=!!(ht&&Ut),en=ht||"animationend",mn=Ut||"transitionend";function En(Ee,Le){if(!Ee)return null;if(Object(W.a)(Ee)==="object"){var We=Le.replace(/-\w/g,function(Se){return Se[1].toUpperCase()});return Ee[We]}return"".concat(Ee,"-").concat(Le)}var $t="none",rr="appear",Dn="enter",Sr="leave",br="none",Pn="prepare",Dr="start",Or="active",ln="end";function Yr(Ee){var Le=Object(P.useRef)(!1),We=Object(P.useState)(Ee),Se=Object(Y.a)(We,2),ie=Se[0],ve=Se[1];function le(Ae){Le.current||ve(Ae)}return Object(P.useEffect)(function(){return function(){Le.current=!0}},[]),[ie,le]}var tn=Object(we.a)()?P.useLayoutEffect:P.useEffect,sn=tn,Qn=function(){var Ee=P.useRef(null);function Le(){at.a.cancel(Ee.current)}function We(Se){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Le();var ve=Object(at.a)(function(){ie<=1?Se({isCanceled:function(){return ve!==Ee.current}}):We(Se,ie-1)});Ee.current=ve}return P.useEffect(function(){return function(){Le()}},[]),[We,Le]},sr=[Pn,Dr,Or,ln],Nr=!1,hn=!0;function Qt(Ee){return Ee===Or||Ee===ln}var $r=function(Ee,Le){var We=P.useState(br),Se=Object(Y.a)(We,2),ie=Se[0],ve=Se[1],le=Qn(),Ae=Object(Y.a)(le,2),_e=Ae[0],Be=Ae[1];function je(){ve(Pn)}return sn(function(){if(ie!==br&&ie!==ln){var Ge=sr.indexOf(ie),tt=sr[Ge+1],yt=Le(ie);yt===Nr?ve(tt):_e(function(Tt){function Nt(){if(Tt.isCanceled())return;ve(tt)}yt===!0?Nt():Promise.resolve(yt).then(Nt)})}},[Ee,ie]),P.useEffect(function(){return function(){Be()}},[]),[je,ie]},fr=function(Ee){var Le=Object(P.useRef)(),We=Object(P.useRef)(Ee);We.current=Ee;var Se=P.useCallback(function(le){We.current(le)},[]);function ie(le){le&&(le.removeEventListener(mn,Se),le.removeEventListener(en,Se))}function ve(le){Le.current&&Le.current!==le&&ie(Le.current),le&&le!==Le.current&&(le.addEventListener(mn,Se),le.addEventListener(en,Se),Le.current=le)}return P.useEffect(function(){return function(){ie(Le.current)}},[]),[ve,ie]};function Lr(Ee,Le,We,Se){var ie=Se.motionEnter,ve=ie===void 0?!0:ie,le=Se.motionAppear,Ae=le===void 0?!0:le,_e=Se.motionLeave,Be=_e===void 0?!0:_e,je=Se.motionDeadline,Ge=Se.motionLeaveImmediately,tt=Se.onAppearPrepare,yt=Se.onEnterPrepare,Tt=Se.onLeavePrepare,Nt=Se.onAppearStart,Rn=Se.onEnterStart,$n=Se.onLeaveStart,Bn=Se.onAppearActive,zn=Se.onEnterActive,Xn=Se.onLeaveActive,Vn=Se.onAppearEnd,Fn=Se.onEnterEnd,Jn=Se.onLeaveEnd,er=Se.onVisibleChanged,jr=Yr(),tr=Object(Y.a)(jr,2),_n=tr[0],vn=tr[1],Wn=Yr($t),cr=Object(Y.a)(Wn,2),an=cr[0],dr=cr[1],Br=Yr(null),ir=Object(Y.a)(Br,2),Ar=ir[0],xr=ir[1],zr=Object(P.useRef)(!1),Qr=Object(P.useRef)(null),Wr=Object(P.useRef)(!1),yi=Object(P.useRef)(null);function Ii(){var Rr=We();return Rr||yi.current}var Ci=Object(P.useRef)(!1);function Zr(Rr){var yr=Ii();if(Rr&&!Rr.deadline&&Rr.target!==yr)return;var Hr;an===rr&&Ci.current?Hr=Vn==null?void 0:Vn(yr,Rr):an===Dn&&Ci.current?Hr=Fn==null?void 0:Fn(yr,Rr):an===Sr&&Ci.current&&(Hr=Jn==null?void 0:Jn(yr,Rr)),Hr!==!1&&!Wr.current&&(dr($t),xr(null))}var Pr=fr(Zr),Tr=Object(Y.a)(Pr,1),wn=Tr[0],wr=P.useMemo(function(){var Rr,yr,Hr;switch(an){case"appear":return Rr={},Object(te.a)(Rr,Pn,tt),Object(te.a)(Rr,Dr,Nt),Object(te.a)(Rr,Or,Bn),Rr;case"enter":return yr={},Object(te.a)(yr,Pn,yt),Object(te.a)(yr,Dr,Rn),Object(te.a)(yr,Or,zn),yr;case"leave":return Hr={},Object(te.a)(Hr,Pn,Tt),Object(te.a)(Hr,Dr,$n),Object(te.a)(Hr,Or,Xn),Hr;default:return{}}},[an]),Ui=$r(an,function(Rr){if(Rr===Pn){var yr=wr[Pn];return yr?yr(Ii()):Nr}if(Cr in wr){var Hr;xr(((Hr=wr[Cr])===null||Hr===void 0?void 0:Hr.call(wr,Ii(),null))||null)}return Cr===Or&&(wn(Ii()),je>0&&(clearTimeout(Qr.current),Qr.current=setTimeout(function(){Zr({deadline:!0})},je))),hn}),Zi=Object(Y.a)(Ui,2),ia=Zi[0],Cr=Zi[1],Xi=Qt(Cr);Ci.current=Xi,sn(function(){vn(Le);var Rr=zr.current;if(zr.current=!0,!Ee)return;var yr;!Rr&&Le&&Ae&&(yr=rr),Rr&&Le&&ve&&(yr=Dn),(Rr&&!Le&&Be||!Rr&&Ge&&!Le&&Be)&&(yr=Sr),yr&&(dr(yr),ia())},[Le]),Object(P.useEffect)(function(){(an===rr&&!Ae||an===Dn&&!ve||an===Sr&&!Be)&&dr($t)},[Ae,ve,Be]),Object(P.useEffect)(function(){return function(){clearTimeout(Qr.current),Wr.current=!0}},[]),Object(P.useEffect)(function(){_n!==void 0&&an===$t&&(er==null||er(_n))},[_n,an]);var Ji=Ar;return wr[Pn]&&Cr===Dr&&(Ji=Object(z.a)({transition:"none"},Ji)),[an,Cr,Ji,_n!=null?_n:Le]}var kn=function(Ee){Object(_.a)(We,Ee);var Le=Object(h.a)(We);function We(){return Object(R.a)(this,We),Le.apply(this,arguments)}return Object(O.a)(We,[{key:"render",value:function(){return this.props.children}}]),We}(P.Component),Ur=kn;function vi(Ee){var Le=Ee;Object(W.a)(Ee)==="object"&&(Le=Ee.transitionSupport);function We(ie){return!!(ie.motionName&&Le)}var Se=P.forwardRef(function(ie,ve){var le=ie.visible,Ae=le===void 0?!0:le,_e=ie.removeOnLeave,Be=_e===void 0?!0:_e,je=ie.forceRender,Ge=ie.children,tt=ie.motionName,yt=ie.leavedClassName,Tt=ie.eventProps,Nt=We(ie),Rn=Object(P.useRef)(),$n=Object(P.useRef)();function Bn(){try{return Object(gt.a)(Rn.current||$n.current)}catch(dr){return null}}var zn=Lr(Nt,Ae,Bn,ie),Xn=Object(Y.a)(zn,4),Vn=Xn[0],Fn=Xn[1],Jn=Xn[2],er=Xn[3],jr=P.useRef(er);er&&(jr.current=!0);var tr=Object(P.useRef)(ve);tr.current=ve;var _n=P.useCallback(function(dr){Rn.current=dr,Object(xt.b)(tr.current,dr)},[]),vn,Wn=Object(z.a)(Object(z.a)({},Tt),{},{visible:Ae});if(!Ge)vn=null;else if(Vn===$t||!We(ie))er?vn=Ge(Object(z.a)({},Wn),_n):!Be&&jr.current?vn=Ge(Object(z.a)(Object(z.a)({},Wn),{},{className:yt}),_n):je?vn=Ge(Object(z.a)(Object(z.a)({},Wn),{},{style:{display:"none"}}),_n):vn=null;else{var cr,an;Fn===Pn?an="prepare":Qt(Fn)?an="active":Fn===Dr&&(an="start"),vn=Ge(Object(z.a)(Object(z.a)({},Wn),{},{className:G()(En(tt,Vn),(cr={},Object(te.a)(cr,En(tt,"".concat(Vn,"-").concat(an)),an),Object(te.a)(cr,tt,typeof tt=="string"),cr)),style:Jn}),_n)}return P.createElement(Ur,{ref:$n},vn)});return Se.displayName="CSSMotion",Se}var Ai=vi(nn),Et="add",fn="keep",Gi="remove",zi="removed";function na(Ee){var Le;return Ee&&Object(W.a)(Ee)==="object"&&"key"in Ee?Le=Ee:Le={key:Ee},Object(z.a)(Object(z.a)({},Le),{},{key:String(Le.key)})}function Vi(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Ee.map(na)}function Z(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],We=[],Se=0,ie=Le.length,ve=Vi(Ee),le=Vi(Le);ve.forEach(function(Be){for(var je=!1,Ge=Se;Ge<ie;Ge+=1){var tt=le[Ge];if(tt.key===Be.key){Se<Ge&&(We=We.concat(le.slice(Se,Ge).map(function(yt){return Object(z.a)(Object(z.a)({},yt),{},{status:Et})})),Se=Ge),We.push(Object(z.a)(Object(z.a)({},tt),{},{status:fn})),Se+=1,je=!0;break}}je||We.push(Object(z.a)(Object(z.a)({},Be),{},{status:Gi}))}),Se<ie&&(We=We.concat(le.slice(Se).map(function(Be){return Object(z.a)(Object(z.a)({},Be),{},{status:Et})})));var Ae={};We.forEach(function(Be){var je=Be.key;Ae[je]=(Ae[je]||0)+1});var _e=Object.keys(Ae).filter(function(Be){return Ae[Be]>1});return _e.forEach(function(Be){We=We.filter(function(je){var Ge=je.key,tt=je.status;return Ge!==Be||tt!==Gi}),We.forEach(function(je){je.key===Be&&(je.status=fn)})}),We}var L=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function k(Ee){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ai,We=function(Se){Object(_.a)(ve,Se);var ie=Object(h.a)(ve);function ve(){var le;return Object(R.a)(this,ve),le=ie.apply(this,arguments),le.state={keyEntities:[]},le.removeKey=function(Ae){le.setState(function(_e){var Be=_e.keyEntities;return{keyEntities:Be.map(function(je){return je.key!==Ae?je:Object(z.a)(Object(z.a)({},je),{},{status:zi})})}})},le}return Object(O.a)(ve,[{key:"render",value:function(){var Ae=this,_e=this.state.keyEntities,Be=this.props,je=Be.component,Ge=Be.children,tt=Be.onVisibleChanged,yt=Object(N.a)(Be,["component","children","onVisibleChanged"]),Tt=je||P.Fragment,Nt={};return L.forEach(function(Rn){Nt[Rn]=yt[Rn],delete yt[Rn]}),delete yt.keys,P.createElement(Tt,yt,_e.map(function(Rn){var $n=Rn.status,Bn=Object(N.a)(Rn,["status"]),zn=$n===Et||$n===fn;return P.createElement(Le,Object(S.a)({},Nt,{key:Bn.key,visible:zn,eventProps:Bn,onVisibleChanged:function(Vn){tt==null||tt(Vn,{key:Bn.key}),Vn||Ae.removeKey(Bn.key)}}),Ge)}))}}],[{key:"getDerivedStateFromProps",value:function(Ae,_e){var Be=Ae.keys,je=_e.keyEntities,Ge=Vi(Be),tt=Z(je,Ge);return{keyEntities:tt.filter(function(yt){var Tt=je.find(function(Nt){var Rn=Nt.key;return yt.key===Rn});return!(Tt&&Tt.status===zi&&yt.status===Gi)})}}}]),ve}(P.Component);return We.defaultProps={component:"div"},We}var V=k(nn),ne=Ai;function Q(Ee){var Le=Ee.prefixCls,We=Ee.motion,Se=Ee.animation,ie=Ee.transitionName;return We||(Se?{motionName:"".concat(Le,"-").concat(Se)}:ie?{motionName:ie}:null)}function Pe(Ee){var Le=Ee.prefixCls,We=Ee.visible,Se=Ee.zIndex,ie=Ee.mask,ve=Ee.maskMotion,le=Ee.maskAnimation,Ae=Ee.maskTransitionName;if(!ie)return null;var _e={};return(ve||Ae||le)&&(_e=Object(z.a)({motionAppear:!0},Q({motion:ve,prefixCls:Le,transitionName:Ae,animation:le}))),P.createElement(ne,Object(S.a)({},_e,{visible:We,removeOnLeave:!0}),function(Be){var je=Be.className;return P.createElement("div",{style:{zIndex:Se},className:G()("".concat(Le,"-mask"),je)})})}var pt=U("9mu1"),Lt=U("o0o1"),rn=U.n(Lt),vt=U("HaE+"),Gt=["measure","align",null,"motion"],pr=function(Ee,Le){var We=Object(P.useState)(null),Se=Object(Y.a)(We,2),ie=Se[0],ve=Se[1],le=Object(P.useRef)(),Ae=Object(P.useRef)(!1);function _e(Ge){Ae.current||ve(Ge)}function Be(){at.a.cancel(le.current)}function je(Ge){Be(),le.current=Object(at.a)(function(){_e(function(tt){switch(ie){case"align":return"motion";case"motion":return"stable";default:}return tt}),Ge==null||Ge()})}return Object(P.useEffect)(function(){_e("measure")},[Ee]),Object(P.useEffect)(function(){switch(ie){case"measure":Le();break;default:}ie&&(le.current=Object(at.a)(Object(vt.a)(rn.a.mark(function Ge(){var tt,yt;return rn.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:tt=Gt.indexOf(ie),yt=Gt[tt+1],yt&&tt!==-1&&_e(yt);case 3:case"end":return Nt.stop()}},Ge)}))))},[ie]),Object(P.useEffect)(function(){return function(){Ae.current=!0,Be()}},[]),[ie,je]},Ir=function(Ee){var Le=P.useState({width:0,height:0}),We=Object(Y.a)(Le,2),Se=We[0],ie=We[1];function ve(Ae){ie({width:Ae.offsetWidth,height:Ae.offsetHeight})}var le=P.useMemo(function(){var Ae={};if(Ee){var _e=Se.width,Be=Se.height;Ee.indexOf("height")!==-1&&Be?Ae.height=Be:Ee.indexOf("minHeight")!==-1&&Be&&(Ae.minHeight=Be),Ee.indexOf("width")!==-1&&_e?Ae.width=_e:Ee.indexOf("minWidth")!==-1&&_e&&(Ae.minWidth=_e)}return Ae},[Ee,Se]);return[le,ve]},Zt=P.forwardRef(function(Ee,Le){var We=Ee.visible,Se=Ee.prefixCls,ie=Ee.className,ve=Ee.style,le=Ee.children,Ae=Ee.zIndex,_e=Ee.stretch,Be=Ee.destroyPopupOnHide,je=Ee.forceRender,Ge=Ee.align,tt=Ee.point,yt=Ee.getRootDomNode,Tt=Ee.getClassNameFromAlign,Nt=Ee.onAlign,Rn=Ee.onMouseEnter,$n=Ee.onMouseLeave,Bn=Ee.onMouseDown,zn=Ee.onTouchStart,Xn=Object(P.useRef)(),Vn=Object(P.useRef)(),Fn=Object(P.useState)(),Jn=Object(Y.a)(Fn,2),er=Jn[0],jr=Jn[1],tr=Ir(_e),_n=Object(Y.a)(tr,2),vn=_n[0],Wn=_n[1];function cr(){_e&&Wn(yt())}var an=pr(We,cr),dr=Object(Y.a)(an,2),Br=dr[0],ir=dr[1],Ar=Object(P.useRef)();function xr(){return tt||yt}function zr(){var Pr;(Pr=Xn.current)===null||Pr===void 0||Pr.forceAlign()}function Qr(Pr,Tr){var wn=Tt(Tr);er!==wn&&jr(wn),Br==="align"&&(er!==wn?Promise.resolve().then(function(){zr()}):ir(function(){var wr;(wr=Ar.current)===null||wr===void 0||wr.call(Ar)}),Nt==null||Nt(Pr,Tr))}var Wr=Object(z.a)({},Q(Ee));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Pr){var Tr=Wr[Pr];Wr[Pr]=function(wn,wr){return ir(),Tr==null?void 0:Tr(wn,wr)}});function yi(){return new Promise(function(Pr){Ar.current=Pr})}P.useEffect(function(){!Wr.motionName&&Br==="motion"&&ir()},[Wr.motionName,Br]),P.useImperativeHandle(Le,function(){return{forceAlign:zr,getElement:function(){return Vn.current}}});var Ii=Object(z.a)(Object(z.a)({},vn),{},{zIndex:Ae,opacity:Br==="motion"||Br==="stable"||!We?void 0:0,pointerEvents:Br==="stable"?void 0:"none"},ve),Ci=!0;(Ge==null?void 0:Ge.points)&&(Br==="align"||Br==="stable")&&(Ci=!1);var Zr=le;return P.Children.count(le)>1&&(Zr=P.createElement("div",{className:"".concat(Se,"-content")},le)),P.createElement(ne,Object(S.a)({visible:We,ref:Vn,leavedClassName:"".concat(Se,"-hidden")},Wr,{onAppearPrepare:yi,onEnterPrepare:yi,removeOnLeave:Be,forceRender:je}),function(Pr,Tr){var wn=Pr.className,wr=Pr.style,Ui=G()(Se,ie,er,wn);return P.createElement(pt.a,{target:xr(),key:"popup",ref:Xn,monitorWindowResize:!0,disabled:Ci,align:Ge,onAlign:Qr},P.createElement("div",{ref:Tr,className:Ui,onMouseEnter:Rn,onMouseLeave:$n,onMouseDownCapture:Bn,onTouchStartCapture:zn,style:Object(z.a)(Object(z.a)({},wr),Ii)},Zr))})});Zt.displayName="PopupInner";var mt=Zt,Pt=P.forwardRef(function(Ee,Le){var We=Ee.prefixCls,Se=Ee.visible,ie=Ee.zIndex,ve=Ee.children,le=Ee.mobile;le=le===void 0?{}:le;var Ae=le.popupClassName,_e=le.popupStyle,Be=le.popupMotion,je=Be===void 0?{}:Be,Ge=le.popupRender,tt=P.useRef();P.useImperativeHandle(Le,function(){return{forceAlign:function(){},getElement:function(){return tt.current}}});var yt=Object(z.a)({zIndex:ie},_e),Tt=ve;return P.Children.count(ve)>1&&(Tt=P.createElement("div",{className:"".concat(We,"-content")},ve)),Ge&&(Tt=Ge(Tt)),P.createElement(ne,Object(S.a)({visible:Se,ref:tt,removeOnLeave:!0},je),function(Nt,Rn){var $n=Nt.className,Bn=Nt.style,zn=G()(We,Ae,$n);return P.createElement("div",{ref:Rn,className:zn,style:Object(z.a)(Object(z.a)({},Bn),yt)},Tt)})});Pt.displayName="MobilePopupInner";var Rt=Pt,Ht=["visible","mobile"],un=P.forwardRef(function(Ee,Le){var We=Ee.visible,Se=Ee.mobile,ie=Object(N.a)(Ee,Ht),ve=Object(P.useState)(We),le=Object(Y.a)(ve,2),Ae=le[0],_e=le[1],Be=Object(P.useState)(!1),je=Object(Y.a)(Be,2),Ge=je[0],tt=je[1],yt=Object(z.a)(Object(z.a)({},ie),{},{visible:Ae});Object(P.useEffect)(function(){_e(We),We&&Se&&tt(xe())},[We,Se]);var Tt=Ge?P.createElement(Rt,Object(S.a)({},yt,{mobile:Se,ref:Le})):P.createElement(mt,Object(S.a)({},yt,{ref:Le}));return P.createElement("div",null,P.createElement(Pe,yt),Tt)});un.displayName="Popup";var xn=un,Cn=P.createContext(null),gn=Cn;function Ln(){}function Kn(){return""}function dn(Ee){return Ee?Ee.ownerDocument:window.document}var Sn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function hr(Ee){var Le=function(We){Object(_.a)(ie,We);var Se=Object(h.a)(ie);function ie(ve){var le;Object(R.a)(this,ie),le=Se.call(this,ve),le.popupRef=P.createRef(),le.triggerRef=P.createRef(),le.attachId=void 0,le.clickOutsideHandler=void 0,le.touchOutsideHandler=void 0,le.contextMenuOutsideHandler1=void 0,le.contextMenuOutsideHandler2=void 0,le.mouseDownTimeout=void 0,le.focusTime=void 0,le.preClickTime=void 0,le.preTouchTime=void 0,le.delayTimer=void 0,le.hasPopupMouseDown=void 0,le.onMouseEnter=function(_e){var Be=le.props.mouseEnterDelay;le.fireEvents("onMouseEnter",_e),le.delaySetPopupVisible(!0,Be,Be?null:_e)},le.onMouseMove=function(_e){le.fireEvents("onMouseMove",_e),le.setPoint(_e)},le.onMouseLeave=function(_e){le.fireEvents("onMouseLeave",_e),le.delaySetPopupVisible(!1,le.props.mouseLeaveDelay)},le.onPopupMouseEnter=function(){le.clearDelayTimer()},le.onPopupMouseLeave=function(_e){var Be;if(_e.relatedTarget&&!_e.relatedTarget.setTimeout&&Object(_t.a)((Be=le.popupRef.current)===null||Be===void 0?void 0:Be.getElement(),_e.relatedTarget))return;le.delaySetPopupVisible(!1,le.props.mouseLeaveDelay)},le.onFocus=function(_e){le.fireEvents("onFocus",_e),le.clearDelayTimer(),le.isFocusToShow()&&(le.focusTime=Date.now(),le.delaySetPopupVisible(!0,le.props.focusDelay))},le.onMouseDown=function(_e){le.fireEvents("onMouseDown",_e),le.preClickTime=Date.now()},le.onTouchStart=function(_e){le.fireEvents("onTouchStart",_e),le.preTouchTime=Date.now()},le.onBlur=function(_e){le.fireEvents("onBlur",_e),le.clearDelayTimer(),le.isBlurToHide()&&le.delaySetPopupVisible(!1,le.props.blurDelay)},le.onContextMenu=function(_e){_e.preventDefault(),le.fireEvents("onContextMenu",_e),le.setPopupVisible(!0,_e)},le.onContextMenuClose=function(){le.isContextMenuToShow()&&le.close()},le.onClick=function(_e){if(le.fireEvents("onClick",_e),le.focusTime){var Be;if(le.preClickTime&&le.preTouchTime?Be=Math.min(le.preClickTime,le.preTouchTime):le.preClickTime?Be=le.preClickTime:le.preTouchTime&&(Be=le.preTouchTime),Math.abs(Be-le.focusTime)<20)return;le.focusTime=0}le.preClickTime=0,le.preTouchTime=0,le.isClickToShow()&&(le.isClickToHide()||le.isBlurToHide())&&_e&&_e.preventDefault&&_e.preventDefault();var je=!le.state.popupVisible;(le.isClickToHide()&&!je||je&&le.isClickToShow())&&le.setPopupVisible(!le.state.popupVisible,_e)},le.onPopupMouseDown=function(){if(le.hasPopupMouseDown=!0,clearTimeout(le.mouseDownTimeout),le.mouseDownTimeout=window.setTimeout(function(){le.hasPopupMouseDown=!1},0),le.context){var _e;(_e=le.context).onPopupMouseDown.apply(_e,arguments)}},le.onDocumentClick=function(_e){if(le.props.mask&&!le.props.maskClosable)return;var Be=_e.target,je=le.getRootDomNode(),Ge=le.getPopupDomNode();(!Object(_t.a)(je,Be)||le.isContextMenuOnly())&&!Object(_t.a)(Ge,Be)&&!le.hasPopupMouseDown&&le.close()},le.getRootDomNode=function(){var _e=le.props.getTriggerDOMNode;if(_e)return _e(le.triggerRef.current);try{var Be=Object(gt.a)(le.triggerRef.current);if(Be)return Be}catch(je){}return ft.a.findDOMNode(Object(g.a)(le))},le.getPopupClassNameFromAlign=function(_e){var Be=[],je=le.props,Ge=je.popupPlacement,tt=je.builtinPlacements,yt=je.prefixCls,Tt=je.alignPoint,Nt=je.getPopupClassNameFromAlign;return Ge&&tt&&Be.push(st(tt,yt,_e,Tt)),Nt&&Be.push(Nt(_e)),Be.join(" ")},le.getComponent=function(){var _e=le.props,Be=_e.prefixCls,je=_e.destroyPopupOnHide,Ge=_e.popupClassName,tt=_e.onPopupAlign,yt=_e.popupMotion,Tt=_e.popupAnimation,Nt=_e.popupTransitionName,Rn=_e.popupStyle,$n=_e.mask,Bn=_e.maskAnimation,zn=_e.maskTransitionName,Xn=_e.maskMotion,Vn=_e.zIndex,Fn=_e.popup,Jn=_e.stretch,er=_e.alignPoint,jr=_e.mobile,tr=_e.forceRender,_n=le.state,vn=_n.popupVisible,Wn=_n.point,cr=le.getPopupAlign(),an={};return le.isMouseEnterToShow()&&(an.onMouseEnter=le.onPopupMouseEnter),le.isMouseLeaveToHide()&&(an.onMouseLeave=le.onPopupMouseLeave),an.onMouseDown=le.onPopupMouseDown,an.onTouchStart=le.onPopupMouseDown,P.createElement(xn,Object(S.a)({prefixCls:Be,destroyPopupOnHide:je,visible:vn,point:er&&Wn,className:Ge,align:cr,onAlign:tt,animation:Tt,getClassNameFromAlign:le.getPopupClassNameFromAlign},an,{stretch:Jn,getRootDomNode:le.getRootDomNode,style:Rn,mask:$n,zIndex:Vn,transitionName:Nt,maskAnimation:Bn,maskTransitionName:zn,maskMotion:Xn,ref:le.popupRef,motion:yt,mobile:jr,forceRender:tr}),typeof Fn=="function"?Fn():Fn)},le.attachParent=function(_e){at.a.cancel(le.attachId);var Be=le.props,je=Be.getPopupContainer,Ge=Be.getDocument,tt=le.getRootDomNode(),yt;je?(tt||je.length===0)&&(yt=je(tt)):yt=Ge(le.getRootDomNode()).body,yt?yt.appendChild(_e):le.attachId=Object(at.a)(function(){le.attachParent(_e)})},le.getContainer=function(){var _e=le.props.getDocument,Be=_e(le.getRootDomNode()).createElement("div");return Be.style.position="absolute",Be.style.top="0",Be.style.left="0",Be.style.width="100%",le.attachParent(Be),Be},le.setPoint=function(_e){var Be=le.props.alignPoint;if(!Be||!_e)return;le.setState({point:{pageX:_e.pageX,pageY:_e.pageY}})},le.handlePortalUpdate=function(){le.state.prevPopupVisible!==le.state.popupVisible&&le.props.afterPopupVisibleChange(le.state.popupVisible)},le.triggerContextValue={onPopupMouseDown:le.onPopupMouseDown};var Ae;return"popupVisible"in ve?Ae=!!ve.popupVisible:Ae=!!ve.defaultPopupVisible,le.state={prevPopupVisible:Ae,popupVisible:Ae},Sn.forEach(function(_e){le["fire".concat(_e)]=function(Be){le.fireEvents(_e,Be)}}),le}return Object(O.a)(ie,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var le=this.props,Ae=this.state;if(Ae.popupVisible){var _e;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(_e=le.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ze.a)(_e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(_e=_e||le.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ze.a)(_e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(_e=_e||le.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ze.a)(_e,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ze.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),at.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var le;return((le=this.popupRef.current)===null||le===void 0?void 0:le.getElement())||null}},{key:"getPopupAlign",value:function(){var le=this.props,Ae=le.popupPlacement,_e=le.popupAlign,Be=le.builtinPlacements;return Ae&&Be?qe(Be,Ae,_e):_e}},{key:"setPopupVisible",value:function(le,Ae){var _e=this.props.alignPoint,Be=this.state.popupVisible;this.clearDelayTimer(),Be!==le&&("popupVisible"in this.props||this.setState({popupVisible:le,prevPopupVisible:Be}),this.props.onPopupVisibleChange(le)),_e&&Ae&&le&&this.setPoint(Ae)}},{key:"delaySetPopupVisible",value:function(le,Ae,_e){var Be=this,je=Ae*1e3;if(this.clearDelayTimer(),je){var Ge=_e?{pageX:_e.pageX,pageY:_e.pageY}:null;this.delayTimer=window.setTimeout(function(){Be.setPopupVisible(le,Ge),Be.clearDelayTimer()},je)}else this.setPopupVisible(le,_e)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(le){var Ae=this.props.children.props,_e=this.props;return Ae[le]&&_e[le]?this["fire".concat(le)]:Ae[le]||_e[le]}},{key:"isClickToShow",value:function(){var le=this.props,Ae=le.action,_e=le.showAction;return Ae.indexOf("click")!==-1||_e.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var le=this.props.action;return le==="contextMenu"||le.length===1&&le[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var le=this.props,Ae=le.action,_e=le.showAction;return Ae.indexOf("contextMenu")!==-1||_e.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var le=this.props,Ae=le.action,_e=le.hideAction;return Ae.indexOf("click")!==-1||_e.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var le=this.props,Ae=le.action,_e=le.showAction;return Ae.indexOf("hover")!==-1||_e.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var le=this.props,Ae=le.action,_e=le.hideAction;return Ae.indexOf("hover")!==-1||_e.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var le=this.props,Ae=le.action,_e=le.showAction;return Ae.indexOf("focus")!==-1||_e.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var le=this.props,Ae=le.action,_e=le.hideAction;return Ae.indexOf("focus")!==-1||_e.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var le;(le=this.popupRef.current)===null||le===void 0||le.forceAlign()}}},{key:"fireEvents",value:function(le,Ae){var _e=this.props.children.props[le];_e&&_e(Ae);var Be=this.props[le];Be&&Be(Ae)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var le=this.state.popupVisible,Ae=this.props,_e=Ae.children,Be=Ae.forceRender,je=Ae.alignPoint,Ge=Ae.className,tt=Ae.autoDestroy,yt=P.Children.only(_e),Tt={key:"trigger"};this.isContextMenuToShow()?Tt.onContextMenu=this.onContextMenu:Tt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(Tt.onClick=this.onClick,Tt.onMouseDown=this.onMouseDown,Tt.onTouchStart=this.onTouchStart):(Tt.onClick=this.createTwoChains("onClick"),Tt.onMouseDown=this.createTwoChains("onMouseDown"),Tt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(Tt.onMouseEnter=this.onMouseEnter,je&&(Tt.onMouseMove=this.onMouseMove)):Tt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?Tt.onMouseLeave=this.onMouseLeave:Tt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(Tt.onFocus=this.onFocus,Tt.onBlur=this.onBlur):(Tt.onFocus=this.createTwoChains("onFocus"),Tt.onBlur=this.createTwoChains("onBlur"));var Nt=G()(yt&&yt.props&&yt.props.className,Ge);Nt&&(Tt.className=Nt);var Rn=Object(z.a)({},Tt);Object(xt.c)(yt)&&(Rn.ref=Object(xt.a)(this.triggerRef,yt.ref));var $n=P.cloneElement(yt,Rn),Bn;return(le||this.popupRef.current||Be)&&(Bn=P.createElement(Ee,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!le&&tt&&(Bn=null),P.createElement(gn.Provider,{value:this.triggerContextValue},$n,Bn)}}],[{key:"getDerivedStateFromProps",value:function(le,Ae){var _e=le.popupVisible,Be={};return _e!==void 0&&Ae.popupVisible!==_e&&(Be.popupVisible=_e,Be.prevPopupVisible=Ae.popupVisible),Be}}]),ie}(P.Component);return Le.contextType=gn,Le.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Kn,getDocument:dn,onPopupVisibleChange:Ln,afterPopupVisibleChange:Ln,onPopupAlign:Ln,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Le}var Nn=hr(kt.a),Kt={adjustX:1,adjustY:1},An={topLeft:{points:["bl","tl"],overflow:Kt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Kt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Kt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Kt,offset:[4,0]}},lr={topLeft:{points:["bl","tl"],overflow:Kt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Kt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Kt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Kt,offset:[4,0]}},Un=An,zt=0,jt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},yn=function(Le,We,Se){var ie=Fe(We),ve=Le.getState();Le.setState({defaultActiveFirst:Object(z.a)(Object(z.a)({},ve.defaultActiveFirst),{},Object(te.a)({},ie,Se))})},Ct=function(Ee){Object(_.a)(We,Ee);var Le=Object(h.a)(We);function We(Se){var ie;Object(R.a)(this,We),ie=Le.call(this,Se),ie.onDestroy=function(je){ie.props.onDestroy(je)},ie.onKeyDown=function(je){var Ge=je.keyCode,tt=ie.menuInstance,yt=ie.props.store,Tt=ie.getVisible();if(Ge===p.a.ENTER)return ie.onTitleClick(je),yn(yt,ie.props.eventKey,!0),!0;if(Ge===p.a.RIGHT)return Tt?tt.onKeyDown(je):(ie.triggerOpenChange(!0),yn(yt,ie.props.eventKey,!0)),!0;if(Ge===p.a.LEFT){var Nt;if(Tt)Nt=tt.onKeyDown(je);else return;return Nt||(ie.triggerOpenChange(!1),Nt=!0),Nt}return Tt&&(Ge===p.a.UP||Ge===p.a.DOWN)?tt.onKeyDown(je):void 0},ie.onOpenChange=function(je){ie.props.onOpenChange(je)},ie.onPopupVisibleChange=function(je){ie.triggerOpenChange(je,je?"mouseenter":"mouseleave")},ie.onMouseEnter=function(je){var Ge=ie.props,tt=Ge.eventKey,yt=Ge.onMouseEnter,Tt=Ge.store;yn(Tt,ie.props.eventKey,!1),yt({key:tt,domEvent:je})},ie.onMouseLeave=function(je){var Ge=ie.props,tt=Ge.parentMenu,yt=Ge.eventKey,Tt=Ge.onMouseLeave;tt.subMenuInstance=Object(g.a)(ie),Tt({key:yt,domEvent:je})},ie.onTitleMouseEnter=function(je){var Ge=ie.props,tt=Ge.eventKey,yt=Ge.onItemHover,Tt=Ge.onTitleMouseEnter;yt({key:tt,hover:!0}),Tt({key:tt,domEvent:je})},ie.onTitleMouseLeave=function(je){var Ge=ie.props,tt=Ge.parentMenu,yt=Ge.eventKey,Tt=Ge.onItemHover,Nt=Ge.onTitleMouseLeave;tt.subMenuInstance=Object(g.a)(ie),Tt({key:yt,hover:!1}),Nt({key:yt,domEvent:je})},ie.onTitleClick=function(je){var Ge=Object(g.a)(ie),tt=Ge.props;if(tt.onTitleClick({key:tt.eventKey,domEvent:je}),tt.triggerSubMenuAction==="hover")return;ie.triggerOpenChange(!ie.getVisible(),"click"),yn(tt.store,ie.props.eventKey,!1)},ie.onSubMenuClick=function(je){typeof ie.props.onClick=="function"&&ie.props.onClick(ie.addKeyPath(je))},ie.onSelect=function(je){ie.props.onSelect(je)},ie.onDeselect=function(je){ie.props.onDeselect(je)},ie.getPrefixCls=function(){return"".concat(ie.props.rootPrefixCls,"-submenu")},ie.getActiveClassName=function(){return"".concat(ie.getPrefixCls(),"-active")},ie.getDisabledClassName=function(){return"".concat(ie.getPrefixCls(),"-disabled")},ie.getSelectedClassName=function(){return"".concat(ie.getPrefixCls(),"-selected")},ie.getOpenClassName=function(){return"".concat(ie.props.rootPrefixCls,"-submenu-open")},ie.getVisible=function(){return ie.state.isOpen},ie.getMode=function(){return ie.state.mode},ie.saveMenuInstance=function(je){ie.menuInstance=je},ie.addKeyPath=function(je){return Object(z.a)(Object(z.a)({},je),{},{keyPath:(je.keyPath||[]).concat(ie.props.eventKey)})},ie.triggerOpenChange=function(je,Ge){var tt=ie.props.eventKey,yt=function(){ie.onOpenChange({key:tt,item:Object(g.a)(ie),trigger:Ge,open:je})};Ge==="mouseenter"?ie.mouseenterTimeout=setTimeout(function(){yt()},0):yt()},ie.isChildrenSelected=function(){var je={find:!1};return nt(ie.props.children,ie.props.selectedKeys,je),je.find},ie.isInlineMode=function(){return ie.getMode()==="inline"},ie.adjustWidth=function(){if(!ie.subMenuTitle||!ie.menuInstance)return;var je=lt.findDOMNode(ie.menuInstance);if(je.offsetWidth>=ie.subMenuTitle.offsetWidth)return;je.style.minWidth="".concat(ie.subMenuTitle.offsetWidth,"px")},ie.saveSubMenuTitle=function(je){ie.subMenuTitle=je},ie.getBaseProps=function(){var je=Object(g.a)(ie),Ge=je.props,tt=ie.getMode();return{mode:tt==="horizontal"?"vertical":tt,visible:ie.getVisible(),level:Ge.level+1,inlineIndent:Ge.inlineIndent,focusable:!1,onClick:ie.onSubMenuClick,onSelect:ie.onSelect,onDeselect:ie.onDeselect,onDestroy:ie.onDestroy,selectedKeys:Ge.selectedKeys,eventKey:"".concat(Ge.eventKey,"-menu-"),openKeys:Ge.openKeys,motion:Ge.motion,onOpenChange:ie.onOpenChange,subMenuOpenDelay:Ge.subMenuOpenDelay,parentMenu:Object(g.a)(ie),subMenuCloseDelay:Ge.subMenuCloseDelay,forceSubMenuRender:Ge.forceSubMenuRender,triggerSubMenuAction:Ge.triggerSubMenuAction,builtinPlacements:Ge.builtinPlacements,defaultActiveFirst:Ge.store.getState().defaultActiveFirst[Fe(Ge.eventKey)],multiple:Ge.multiple,prefixCls:Ge.rootPrefixCls,id:ie.internalMenuId,manualRef:ie.saveMenuInstance,itemIcon:Ge.itemIcon,expandIcon:Ge.expandIcon,direction:Ge.direction}},ie.getMotion=function(je,Ge){var tt=Object(g.a)(ie),yt=tt.haveRendered,Tt=ie.props,Nt=Tt.motion,Rn=Tt.rootPrefixCls,$n=Object(z.a)(Object(z.a)({},Nt),{},{leavedClassName:"".concat(Rn,"-hidden"),removeOnLeave:!1,motionAppear:yt||!Ge||je!=="inline"});return $n};var ve=Se.store,le=Se.eventKey,Ae=ve.getState(),_e=Ae.defaultActiveFirst;ie.isRootMenu=!1;var Be=!1;return _e&&(Be=_e[le]),yn(ve,le,Be),ie.state={mode:Se.mode,isOpen:Se.isOpen},ie}return Object(O.a)(We,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ie=this,ve=this.props,le=ve.mode,Ae=ve.parentMenu,_e=ve.manualRef,Be=ve.isOpen,je=function(){ie.setState({mode:le,isOpen:Be})},Ge=Be!==this.state.isOpen,tt=le!==this.state.mode;if((tt||Ge)&&(at.a.cancel(this.updateStateRaf),tt?this.updateStateRaf=Object(at.a)(je):je()),_e&&_e(this),le!=="horizontal"||!(Ae==null?void 0:Ae.isRootMenu)||!Be)return;this.minWidthTimeout=setTimeout(function(){return ie.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ie=this.props,ve=ie.onDestroy,le=ie.eventKey;ve&&ve(le),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),at.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(ie,ve){var le=this.getBaseProps();return P.createElement(ur,Object(S.a)({},le,{id:this.internalMenuId,className:ie,style:ve}),this.props.children)}},{key:"renderChildren",value:function(){var ie=this,ve=this.getBaseProps(),le=ve.mode,Ae=ve.visible,_e=ve.forceSubMenuRender,Be=ve.direction,je=this.getMotion(le,Ae);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Ae||_e,!this.haveOpened)return P.createElement("div",null);var Ge=G()("".concat(ve.prefixCls,"-sub"),Object(te.a)({},"".concat(ve.prefixCls,"-rtl"),Be==="rtl"));return this.isInlineMode()?P.createElement(ne,Object(S.a)({visible:ve.visible,forceRender:_e},je),function(tt){var yt=tt.className,Tt=tt.style,Nt=G()(Ge,yt);return ie.renderPopupMenu(Nt,Tt)}):this.renderPopupMenu(Ge)}},{key:"render",value:function(){var ie,ve,le,Ae=Object(z.a)({},this.props),_e=this.getVisible(),Be=this.getPrefixCls(),je=this.isInlineMode(),Ge=this.getMode(),tt=G()(Be,"".concat(Be,"-").concat(Ge),(ie={},Object(te.a)(ie,Ae.className,!!Ae.className),Object(te.a)(ie,this.getOpenClassName(),_e),Object(te.a)(ie,this.getActiveClassName(),Ae.active||_e&&!je),Object(te.a)(ie,this.getDisabledClassName(),Ae.disabled),Object(te.a)(ie,this.getSelectedClassName(),this.isChildrenSelected()),ie));this.internalMenuId||(Ae.eventKey?this.internalMenuId="".concat(Ae.eventKey,"$Menu"):(zt+=1,this.internalMenuId="$__$".concat(zt,"$Menu")));var yt={},Tt={},Nt={};Ae.disabled||(yt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Tt={onClick:this.onTitleClick},Nt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Rn={},$n=Ae.direction,Bn=$n==="rtl";je&&(Bn?Rn.paddingRight=Ae.inlineIndent*Ae.level:Rn.paddingLeft=Ae.inlineIndent*Ae.level);var zn={};this.getVisible()&&(zn={"aria-owns":this.internalMenuId});var Xn=null;Ge!=="horizontal"&&(Xn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Xn=P.createElement(this.props.expandIcon,Object(z.a)({},this.props))));var Vn=P.createElement("div",Object(S.a)({ref:this.saveSubMenuTitle,style:Rn,className:"".concat(Be,"-title"),role:"button"},Nt,Tt,{"aria-expanded":_e},zn,{"aria-haspopup":"true",title:typeof Ae.title=="string"?Ae.title:void 0}),Ae.title,Xn||P.createElement("i",{className:"".concat(Be,"-arrow")})),Fn=this.renderChildren(),Jn=((ve=Ae.parentMenu)===null||ve===void 0?void 0:ve.isRootMenu)?Ae.parentMenu.props.getPopupContainer:function(xr){return xr.parentNode},er=jt[Ge],jr=Ae.popupOffset?{offset:Ae.popupOffset}:{},tr=G()((le={},Object(te.a)(le,Ae.popupClassName,Ae.popupClassName&&!je),Object(te.a)(le,"".concat(Be,"-rtl"),Bn),le)),_n=Ae.disabled,vn=Ae.triggerSubMenuAction,Wn=Ae.subMenuOpenDelay,cr=Ae.forceSubMenuRender,an=Ae.subMenuCloseDelay,dr=Ae.builtinPlacements;de.forEach(function(xr){return delete Ae[xr]}),delete Ae.onClick;var Br=Bn?Object(z.a)(Object(z.a)({},lr),dr):Object(z.a)(Object(z.a)({},An),dr);delete Ae.direction;var ir=this.getBaseProps(),Ar=je?null:this.getMotion(ir.mode,ir.visible);return P.createElement("li",Object(S.a)({},Ae,yt,{className:tt,role:"menuitem"}),P.createElement(Nn,{prefixCls:Be,popupClassName:G()("".concat(Be,"-popup"),tr),getPopupContainer:Jn,builtinPlacements:Br,popupPlacement:er,popupVisible:je?!1:_e,popupAlign:jr,popup:je?null:Fn,action:_n||je?[]:[vn],mouseEnterDelay:Wn,mouseLeaveDelay:an,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:cr,popupMotion:Ar},Vn),je?Fn:null)}}]),We}(P.Component);Ct.defaultProps={onMouseEnter:He,onMouseLeave:He,onTitleMouseEnter:He,onTitleMouseLeave:He,onTitleClick:He,manualRef:He,mode:"vertical",title:""};var Mt=Object(d.b)(function(Ee,Le){var We=Ee.openKeys,Se=Ee.activeKey,ie=Ee.selectedKeys,ve=Le.eventKey,le=Le.subMenuKey;return{isOpen:We.indexOf(ve)>-1,active:Se[le]===ve,selectedKeys:ie}})(Ct);Mt.isSubMenu=!0;var Dt=Mt,ke="menuitem-overflowed",Vt=.5,Tn=function(Ee){Object(_.a)(We,Ee);var Le=Object(h.a)(We);function We(){var Se;return Object(R.a)(this,We),Se=Le.apply(this,arguments),Se.resizeObserver=null,Se.mutationObserver=null,Se.originalTotalWidth=0,Se.overflowedItems=[],Se.menuItemSizes=[],Se.cancelFrameId=null,Se.state={lastVisibleIndex:void 0},Se.childRef=P.createRef(),Se.getMenuItemNodes=function(){var ie=Se.props.prefixCls,ve=Se.childRef.current;return ve?[].slice.call(ve.children).filter(function(le){return le.className.split(" ").indexOf("".concat(ie,"-overflowed-submenu"))<0}):[]},Se.getOverflowedSubMenuItem=function(ie,ve,le){var Ae=Se.props,_e=Ae.overflowedIndicator,Be=Ae.level,je=Ae.mode,Ge=Ae.prefixCls,tt=Ae.theme;if(Be!==1||je!=="horizontal")return null;var yt=Se.props.children[0],Tt=yt.props,Nt=Tt.children,Rn=Tt.title,$n=Tt.style,Bn=Object(N.a)(Tt,["children","title","style"]),zn=Object(z.a)({},$n),Xn="".concat(ie,"-overflowed-indicator"),Vn="".concat(ie,"-overflowed-indicator");ve.length===0&&le!==!0?zn=Object(z.a)(Object(z.a)({},zn),{},{display:"none"}):le&&(zn=Object(z.a)(Object(z.a)({},zn),{},{visibility:"hidden",position:"absolute"}),Xn="".concat(Xn,"-placeholder"),Vn="".concat(Vn,"-placeholder"));var Fn=tt?"".concat(Ge,"-").concat(tt):"",Jn={};return de.forEach(function(er){Bn[er]!==void 0&&(Jn[er]=Bn[er])}),P.createElement(Dt,Object(S.a)({title:_e,className:"".concat(Ge,"-overflowed-submenu"),popupClassName:Fn},Jn,{key:Xn,eventKey:Vn,disabled:!1,style:zn}),ve)},Se.setChildrenWidthAndResize=function(){if(Se.props.mode!=="horizontal")return;var ie=Se.childRef.current;if(!ie)return;var ve=ie.children;if(!ve||ve.length===0)return;var le=ie.children[ve.length-1];Ne(le,"display","inline-block");var Ae=Se.getMenuItemNodes(),_e=Ae.filter(function(Be){return Be.className.split(" ").indexOf(ke)>=0});_e.forEach(function(Be){Ne(Be,"display","inline-block")}),Se.menuItemSizes=Ae.map(function(Be){return De(Be,!0)}),_e.forEach(function(Be){Ne(Be,"display","none")}),Se.overflowedIndicatorWidth=De(ie.children[ie.children.length-1],!0),Se.originalTotalWidth=Se.menuItemSizes.reduce(function(Be,je){return Be+je},0),Se.handleResize(),Ne(le,"display","none")},Se.handleResize=function(){if(Se.props.mode!=="horizontal")return;var ie=Se.childRef.current;if(!ie)return;var ve=De(ie);Se.overflowedItems=[];var le=0,Ae;Se.originalTotalWidth>ve+Vt&&(Ae=-1,Se.menuItemSizes.forEach(function(_e){le+=_e,le+Se.overflowedIndicatorWidth<=ve&&(Ae+=1)})),Se.setState({lastVisibleIndex:Ae})},Se}return Object(O.a)(We,[{key:"componentDidMount",value:function(){var ie=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ve=this.childRef.current;if(!ve)return;this.resizeObserver=new rt.default(function(le){le.forEach(function(){var Ae=ie.cancelFrameId;cancelAnimationFrame(Ae),ie.cancelFrameId=requestAnimationFrame(ie.setChildrenWidthAndResize)})}),[].slice.call(ve.children).concat(ve).forEach(function(le){ie.resizeObserver.observe(le)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ie.resizeObserver.disconnect(),[].slice.call(ve.children).concat(ve).forEach(function(le){ie.resizeObserver.observe(le)}),ie.setChildrenWidthAndResize()}),this.mutationObserver.observe(ve,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(ie){var ve=this,le=this.state.lastVisibleIndex;return(ie||[]).reduce(function(Ae,_e,Be){var je=_e;if(ve.props.mode==="horizontal"){var Ge=ve.getOverflowedSubMenuItem(_e.props.eventKey,[]);le!==void 0&&ve.props.className.indexOf("".concat(ve.props.prefixCls,"-root"))!==-1&&(Be>le&&(je=P.cloneElement(_e,{style:{display:"none"},eventKey:"".concat(_e.props.eventKey,"-hidden"),className:"".concat(ke)})),Be===le+1&&(ve.overflowedItems=ie.slice(le+1).map(function(yt){return P.cloneElement(yt,{key:yt.props.eventKey,mode:"vertical-left"})}),Ge=ve.getOverflowedSubMenuItem(_e.props.eventKey,ve.overflowedItems)));var tt=[].concat(Object(I.a)(Ae),[Ge,je]);return Be===ie.length-1&&tt.push(ve.getOverflowedSubMenuItem(_e.props.eventKey,[],!0)),tt}return[].concat(Object(I.a)(Ae),[je])},[])}},{key:"render",value:function(){var ie=this.props,ve=ie.visible,le=ie.prefixCls,Ae=ie.overflowedIndicator,_e=ie.mode,Be=ie.level,je=ie.tag,Ge=ie.children,tt=ie.theme,yt=Object(N.a)(ie,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Tt=je;return P.createElement(Tt,Object(S.a)({ref:this.childRef},yt),this.renderChildren(Ge))}}]),We}(P.Component);Tn.defaultProps={tag:"div",className:""};var mr=Tn;function On(Ee){return Ee.length?Ee.every(function(Le){return!!Le.props.disabled}):!0}function ii(Ee,Le,We){var Se=Ee.getState();Ee.setState({activeKey:Object(z.a)(Object(z.a)({},Se.activeKey),{},Object(te.a)({},Le,We))})}function ai(Ee){return Ee.eventKey||"0-menu-"}function Kr(Ee,Le){var We=Le,Se=Ee.children,ie=Ee.eventKey;if(We){var ve;if(Ke(Se,function(le,Ae){le&&le.props&&!le.props.disabled&&We===Ve(le,ie,Ae)&&(ve=!0)}),ve)return We}return We=null,Ee.defaultActiveFirst&&Ke(Se,function(le,Ae){!We&&le&&!le.props.disabled&&(We=Ve(le,ie,Ae))}),We}function jn(Ee){if(!Ee)return;var Le=this.instanceArray.indexOf(Ee);Le!==-1?this.instanceArray[Le]=Ee:this.instanceArray.push(Ee)}var Bt=function(Ee){Object(_.a)(We,Ee);var Le=Object(h.a)(We);function We(Se){var ie;return Object(R.a)(this,We),ie=Le.call(this,Se),ie.onKeyDown=function(ve,le){var Ae=ve.keyCode,_e;if(ie.getFlatInstanceArray().forEach(function(je){je&&je.props.active&&je.onKeyDown&&(_e=je.onKeyDown(ve))}),_e)return 1;var Be=null;return(Ae===p.a.UP||Ae===p.a.DOWN)&&(Be=ie.step(Ae===p.a.UP?-1:1)),Be?(ve.preventDefault(),ii(ie.props.store,ai(ie.props),Be.props.eventKey),typeof le=="function"&&le(Be),1):void 0},ie.onItemHover=function(ve){var le=ve.key,Ae=ve.hover;ii(ie.props.store,ai(ie.props),Ae?le:null)},ie.onDeselect=function(ve){ie.props.onDeselect(ve)},ie.onSelect=function(ve){ie.props.onSelect(ve)},ie.onClick=function(ve){ie.props.onClick(ve)},ie.onOpenChange=function(ve){ie.props.onOpenChange(ve)},ie.onDestroy=function(ve){ie.props.onDestroy(ve)},ie.getFlatInstanceArray=function(){return ie.instanceArray},ie.step=function(ve){var le=ie.getFlatInstanceArray(),Ae=ie.props.store.getState().activeKey[ai(ie.props)],_e=le.length;if(!_e)return null;ve<0&&(le=le.concat().reverse());var Be=-1;if(le.every(function(yt,Tt){return yt&&yt.props.eventKey===Ae?(Be=Tt,!1):!0}),!ie.props.defaultActiveFirst&&Be!==-1&&On(le.slice(Be,_e-1)))return;var je=(Be+1)%_e,Ge=je;do{var tt=le[Ge];if(!tt||tt.props.disabled)Ge=(Ge+1)%_e;else return tt}while(Ge!==je);return null},ie.renderCommonMenuItem=function(ve,le,Ae){var _e=ie.props.store.getState(),Be=Object(g.a)(ie),je=Be.props,Ge=Ve(ve,je.eventKey,le),tt=ve.props;if(!tt||typeof ve.type=="string")return ve;var yt=Ge===_e.activeKey,Tt=Object(z.a)(Object(z.a)({mode:tt.mode||je.mode,level:je.level,inlineIndent:je.inlineIndent,renderMenuItem:ie.renderMenuItem,rootPrefixCls:je.prefixCls,index:le,parentMenu:je.parentMenu,manualRef:tt.disabled?void 0:Object(x.a)(ve.ref,jn.bind(Object(g.a)(ie))),eventKey:Ge,active:!tt.disabled&&yt,multiple:je.multiple,onClick:function(Rn){(tt.onClick||He)(Rn),ie.onClick(Rn)},onItemHover:ie.onItemHover,motion:je.motion,subMenuOpenDelay:je.subMenuOpenDelay,subMenuCloseDelay:je.subMenuCloseDelay,forceSubMenuRender:je.forceSubMenuRender,onOpenChange:ie.onOpenChange,onDeselect:ie.onDeselect,onSelect:ie.onSelect,builtinPlacements:je.builtinPlacements,itemIcon:tt.itemIcon||ie.props.itemIcon,expandIcon:tt.expandIcon||ie.props.expandIcon},Ae),{},{direction:je.direction});return(je.mode==="inline"||Ue())&&(Tt.triggerSubMenuAction="click"),P.cloneElement(ve,Object(z.a)(Object(z.a)({},Tt),{},{key:Ge||le}))},ie.renderMenuItem=function(ve,le,Ae){if(!ve)return null;var _e=ie.props.store.getState(),Be={openKeys:_e.openKeys,selectedKeys:_e.selectedKeys,triggerSubMenuAction:ie.props.triggerSubMenuAction,subMenuKey:Ae};return ie.renderCommonMenuItem(ve,le,Be)},Se.store.setState({activeKey:Object(z.a)(Object(z.a)({},Se.store.getState().activeKey),{},Object(te.a)({},Se.eventKey,Kr(Se,Se.activeKey)))}),ie.instanceArray=[],ie}return Object(O.a)(We,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ie){return this.props.visible||ie.visible||this.props.className!==ie.className||!j()(this.props.style,ie.style)}},{key:"componentDidUpdate",value:function(ie){var ve=this.props,le="activeKey"in ve?ve.activeKey:ve.store.getState().activeKey[ai(ve)],Ae=Kr(ve,le);if(Ae!==le)ii(ve.store,ai(ve),Ae);else if("activeKey"in ie){var _e=Kr(ie,ie.activeKey);Ae!==_e&&ii(ve.store,ai(ve),Ae)}}},{key:"render",value:function(){var ie=this,ve=Object(S.a)({},this.props);this.instanceArray=[];var le=G()(ve.prefixCls,ve.className,"".concat(ve.prefixCls,"-").concat(ve.mode)),Ae={className:le,role:ve.role||"menu"};ve.id&&(Ae.id=ve.id),ve.focusable&&(Ae.tabIndex=0,Ae.onKeyDown=this.onKeyDown);var _e=ve.prefixCls,Be=ve.eventKey,je=ve.visible,Ge=ve.level,tt=ve.mode,yt=ve.overflowedIndicator,Tt=ve.theme;return de.forEach(function(Nt){return delete ve[Nt]}),delete ve.onClick,P.createElement(mr,Object(S.a)({},ve,{prefixCls:_e,mode:tt,tag:"ul",level:Ge,theme:Tt,visible:je,overflowedIndicator:yt},Ae),Object(K.a)(ve.children).map(function(Nt,Rn){return ie.renderMenuItem(Nt,Rn,Be||"0-menu-")}))}}]),We}(P.Component);Bt.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:He};var Er=Object(d.b)()(Bt),ur=Er,Yn=U("Kwbf");function oi(Ee,Le,We){var Se=Ee.prefixCls,ie=Ee.motion,ve=Ee.defaultMotions,le=ve===void 0?{}:ve,Ae=Ee.openAnimation,_e=Ee.openTransitionName,Be=Le.switchingModeFromInline;if(ie)return ie;if(Object(W.a)(Ae)==="object"&&Ae)Object(Yn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Ae=="string")return{motionName:"".concat(Se,"-open-").concat(Ae)};if(_e)return{motionName:_e};var je=le[We];return je||(Be?null:le.other)}var Xt=function(Ee){Object(_.a)(We,Ee);var Le=Object(h.a)(We);function We(Se){var ie;Object(R.a)(this,We),ie=Le.call(this,Se),ie.onSelect=function(Ae){var _e=Object(g.a)(ie),Be=_e.props;if(Be.selectable){var je=ie.store.getState(),Ge=je.selectedKeys,tt=Ae.key;Be.multiple?Ge=Ge.concat([tt]):Ge=[tt],"selectedKeys"in Be||ie.store.setState({selectedKeys:Ge}),Be.onSelect(Object(z.a)(Object(z.a)({},Ae),{},{selectedKeys:Ge}))}},ie.onClick=function(Ae){var _e=ie.getRealMenuMode(),Be=Object(g.a)(ie),je=Be.store,Ge=Be.props.onOpenChange;_e!=="inline"&&!("openKeys"in ie.props)&&(je.setState({openKeys:[]}),Ge([])),ie.props.onClick(Ae)},ie.onKeyDown=function(Ae,_e){ie.innerMenu.getWrappedInstance().onKeyDown(Ae,_e)},ie.onOpenChange=function(Ae){var _e=Object(g.a)(ie),Be=_e.props,je=ie.store.getState().openKeys.concat(),Ge=!1,tt=function(Tt){var Nt=!1;if(Tt.open)Nt=je.indexOf(Tt.key)===-1,Nt&&je.push(Tt.key);else{var Rn=je.indexOf(Tt.key);Nt=Rn!==-1,Nt&&je.splice(Rn,1)}Ge=Ge||Nt};Array.isArray(Ae)?Ae.forEach(tt):tt(Ae),Ge&&("openKeys"in ie.props||ie.store.setState({openKeys:je}),Be.onOpenChange(je))},ie.onDeselect=function(Ae){var _e=Object(g.a)(ie),Be=_e.props;if(Be.selectable){var je=ie.store.getState().selectedKeys.concat(),Ge=Ae.key,tt=je.indexOf(Ge);tt!==-1&&je.splice(tt,1),"selectedKeys"in Be||ie.store.setState({selectedKeys:je}),Be.onDeselect(Object(z.a)(Object(z.a)({},Ae),{},{selectedKeys:je}))}},ie.onMouseEnter=function(Ae){ie.restoreModeVerticalFromInline();var _e=ie.props.onMouseEnter;_e&&_e(Ae)},ie.onTransitionEnd=function(Ae){var _e=Ae.propertyName==="width"&&Ae.target===Ae.currentTarget,Be=Ae.target.className,je=Object.prototype.toString.call(Be)==="[object SVGAnimatedString]"?Be.animVal:Be,Ge=Ae.propertyName==="font-size"&&je.indexOf("anticon")>=0;(_e||Ge)&&ie.restoreModeVerticalFromInline()},ie.setInnerMenu=function(Ae){ie.innerMenu=Ae},ie.isRootMenu=!0;var ve=Se.defaultSelectedKeys,le=Se.defaultOpenKeys;return"selectedKeys"in Se&&(ve=Se.selectedKeys||[]),"openKeys"in Se&&(le=Se.openKeys||[]),ie.store=Object(d.c)({selectedKeys:ve,openKeys:le,activeKey:{"0-menu-":Kr(Se,Se.activeKey)}}),ie.state={switchingModeFromInline:!1,prevProps:Se,inlineOpenKeys:[],store:ie.store},ie}return Object(O.a)(We,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ie){var ve=this.props,le=ve.siderCollapsed,Ae=ve.inlineCollapsed,_e=ve.onOpenChange;(!ie.inlineCollapsed&&Ae||!ie.siderCollapsed&&le)&&_e([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var ie=this.props.collapsedWidth,ve=this.store,le=this.prevOpenKeys,Ae=this.getInlineCollapsed()&&(ie===0||ie==="0"||ie==="0px");Ae?(this.prevOpenKeys=ve.getState().openKeys.concat(),this.store.setState({openKeys:[]})):le&&(this.store.setState({openKeys:le}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ie=this.props.mode,ve=this.state.switchingModeFromInline,le=this.getInlineCollapsed();return ve&&le?"inline":le?"vertical":ie}},{key:"getInlineCollapsed",value:function(){var ie=this.props,ve=ie.inlineCollapsed,le=ie.siderCollapsed;return le!==void 0?le:ve}},{key:"restoreModeVerticalFromInline",value:function(){var ie=this.state.switchingModeFromInline;ie&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var ie=Object(z.a)({},Object(C.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ve=this.getRealMenuMode();return ie.className+=" ".concat(ie.prefixCls,"-root"),ie.direction==="rtl"&&(ie.className+=" ".concat(ie.prefixCls,"-rtl")),ie=Object(z.a)(Object(z.a)({},ie),{},{mode:ve,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:oi(this.props,this.state,ve)}),delete ie.openAnimation,delete ie.openTransitionName,P.createElement(d.a,{store:this.store},P.createElement(ur,Object(S.a)({},ie,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(ie,ve){var le=ve.prevProps,Ae=ve.store,_e=Ae.getState(),Be={},je={prevProps:ie};return le.mode==="inline"&&ie.mode!=="inline"&&(je.switchingModeFromInline=!0),"openKeys"in ie?Be.openKeys=ie.openKeys||[]:((ie.inlineCollapsed&&!le.inlineCollapsed||ie.siderCollapsed&&!le.siderCollapsed)&&(je.switchingModeFromInline=!0,je.inlineOpenKeys=_e.openKeys,Be.openKeys=[]),(!ie.inlineCollapsed&&le.inlineCollapsed||!ie.siderCollapsed&&le.siderCollapsed)&&(Be.openKeys=ve.inlineOpenKeys,je.inlineOpenKeys=[])),Object.keys(Be).length&&Ae.setState(Be),je}}]),We}(P.Component);Xt.defaultProps={selectable:!0,onClick:He,onSelect:He,onOpenChange:He,onDeselect:He,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:P.createElement("span",null,"\xB7\xB7\xB7")};var Jt=Xt,Yt=function(Ee){Object(_.a)(We,Ee);var Le=Object(h.a)(We);function We(){var Se;return Object(R.a)(this,We),Se=Le.apply(this,arguments),Se.onKeyDown=function(ie){var ve=ie.keyCode;return ve===p.a.ENTER?(Se.onClick(ie),!0):void 0},Se.onMouseLeave=function(ie){var ve=Se.props,le=ve.eventKey,Ae=ve.onItemHover,_e=ve.onMouseLeave;Ae({key:le,hover:!1}),_e({key:le,domEvent:ie})},Se.onMouseEnter=function(ie){var ve=Se.props,le=ve.eventKey,Ae=ve.onItemHover,_e=ve.onMouseEnter;Ae({key:le,hover:!0}),_e({key:le,domEvent:ie})},Se.onClick=function(ie){var ve=Se.props,le=ve.eventKey,Ae=ve.multiple,_e=ve.onClick,Be=ve.onSelect,je=ve.onDeselect,Ge=ve.isSelected,tt={key:le,keyPath:[le],item:Object(g.a)(Se),domEvent:ie};_e(tt),Ae?Ge?je(tt):Be(tt):Ge||Be(tt)},Se.saveNode=function(ie){Se.node=ie},Se}return Object(O.a)(We,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ie=this.props;ie.onDestroy&&ie.onDestroy(ie.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var ie,ve=Object(z.a)({},this.props),le=G()(this.getPrefixCls(),ve.className,(ie={},Object(te.a)(ie,this.getActiveClassName(),!ve.disabled&&ve.active),Object(te.a)(ie,this.getSelectedClassName(),ve.isSelected),Object(te.a)(ie,this.getDisabledClassName(),ve.disabled),ie)),Ae=Object(z.a)(Object(z.a)({},ve.attribute),{},{title:typeof ve.title=="string"?ve.title:void 0,className:le,role:ve.role||"menuitem","aria-disabled":ve.disabled});ve.role==="option"?Ae=Object(z.a)(Object(z.a)({},Ae),{},{role:"option","aria-selected":ve.isSelected}):(ve.role===null||ve.role==="none")&&(Ae.role="none");var _e={onClick:ve.disabled?null:this.onClick,onMouseLeave:ve.disabled?null:this.onMouseLeave,onMouseEnter:ve.disabled?null:this.onMouseEnter},Be=Object(z.a)({},ve.style);ve.mode==="inline"&&(ve.direction==="rtl"?Be.paddingRight=ve.inlineIndent*ve.level:Be.paddingLeft=ve.inlineIndent*ve.level),de.forEach(function(Ge){return delete ve[Ge]}),delete ve.direction;var je=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(je=P.createElement(this.props.itemIcon,this.props)),P.createElement("li",Object(S.a)({},Object(C.a)(ve,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Ae,_e,{style:Be,ref:this.saveNode}),ve.children,je)}}]),We}(P.Component);Yt.isMenuItem=!0,Yt.defaultProps={onSelect:He,onMouseEnter:He,onMouseLeave:He,manualRef:He};var pn=Object(d.b)(function(Ee,Le){var We=Ee.activeKey,Se=Ee.selectedKeys,ie=Le.eventKey,ve=Le.subMenuKey;return{active:We[ve]===ie,isSelected:Array.isArray(Se)?Se.indexOf(ie)!==-1:Se===ie}})(Yt),Gn=pn,Mn=function(Ee){Object(_.a)(We,Ee);var Le=Object(h.a)(We);function We(){var Se;return Object(R.a)(this,We),Se=Le.apply(this,arguments),Se.renderInnerMenuItem=function(ie){var ve=Se.props,le=ve.renderMenuItem,Ae=ve.index;return le(ie,Ae,Se.props.subMenuKey)},Se}return Object(O.a)(We,[{key:"render",value:function(){var ie=Object(S.a)({},this.props),ve=ie.className,le=ve===void 0?"":ve,Ae=ie.rootPrefixCls,_e="".concat(Ae,"-item-group-title"),Be="".concat(Ae,"-item-group-list"),je=ie.title,Ge=ie.children;return de.forEach(function(tt){return delete ie[tt]}),delete ie.direction,P.createElement("li",Object(S.a)({},ie,{onClick:function(yt){return yt.stopPropagation()},className:"".concat(le," ").concat(Ae,"-item-group")}),P.createElement("div",{className:_e,title:typeof je=="string"?je:void 0},je),P.createElement("ul",{className:Be},P.Children.map(Ge,this.renderInnerMenuItem)))}}]),We}(P.Component);Mn.isMenuItemGroup=!0,Mn.defaultProps={disabled:!0};var qn=Mn,gr=function(Le){var We=Le.className,Se=Le.rootPrefixCls,ie=Le.style;return P.createElement("li",{className:"".concat(We," ").concat(Se,"-item-divider"),style:ie})};gr.defaultProps={disabled:!0,className:"",style:{}};var wi=gr,Zn=Jt,Qi=U("eDIo");function vr(Ee,Le){var We=Ee.prefixCls,Se=Ee.editable,ie=Ee.locale,ve=Ee.style;return!Se||Se.showAdd===!1?null:P.createElement("button",{ref:Le,type:"button",className:"".concat(We,"-nav-add"),style:ve,"aria-label":(ie==null?void 0:ie.addAriaLabel)||"Add tab",onClick:function(Ae){Se.onEdit("add",{event:Ae})}},Se.addIcon||"+")}var fi=P.forwardRef(vr);function si(Ee,Le){var We=Ee.prefixCls,Se=Ee.id,ie=Ee.tabs,ve=Ee.locale,le=Ee.mobile,Ae=Ee.moreIcon,_e=Ae===void 0?"More":Ae,Be=Ee.moreTransitionName,je=Ee.style,Ge=Ee.className,tt=Ee.editable,yt=Ee.tabBarGutter,Tt=Ee.rtl,Nt=Ee.onTabClick,Rn=Object(P.useState)(!1),$n=Object(Y.a)(Rn,2),Bn=$n[0],zn=$n[1],Xn=Object(P.useState)(null),Vn=Object(Y.a)(Xn,2),Fn=Vn[0],Jn=Vn[1],er="".concat(Se,"-more-popup"),jr="".concat(We,"-dropdown"),tr=Fn!==null?"".concat(er,"-").concat(Fn):null,_n=ve==null?void 0:ve.dropdownAriaLabel,vn=P.createElement(Zn,{onClick:function(Ar){var xr=Ar.key,zr=Ar.domEvent;Nt(xr,zr),zn(!1)},id:er,tabIndex:-1,role:"listbox","aria-activedescendant":tr,selectedKeys:[Fn],"aria-label":_n!==void 0?_n:"expanded dropdown"},ie.map(function(ir){return P.createElement(Gn,{key:ir.key,id:"".concat(er,"-").concat(ir.key),role:"option","aria-controls":Se&&"".concat(Se,"-panel-").concat(ir.key),disabled:ir.disabled},ir.tab)}));function Wn(ir){for(var Ar=ie.filter(function(yi){return!yi.disabled}),xr=Ar.findIndex(function(yi){return yi.key===Fn})||0,zr=Ar.length,Qr=0;Qr<zr;Qr+=1){xr=(xr+ir+zr)%zr;var Wr=Ar[xr];if(!Wr.disabled){Jn(Wr.key);return}}}function cr(ir){var Ar=ir.which;if(!Bn){[p.a.DOWN,p.a.SPACE,p.a.ENTER].includes(Ar)&&(zn(!0),ir.preventDefault());return}switch(Ar){case p.a.UP:Wn(-1),ir.preventDefault();break;case p.a.DOWN:Wn(1),ir.preventDefault();break;case p.a.ESC:zn(!1);break;case p.a.SPACE:case p.a.ENTER:Fn!==null&&Nt(Fn,ir);break}}Object(P.useEffect)(function(){var ir=document.getElementById(tr);ir&&ir.scrollIntoView&&ir.scrollIntoView(!1)},[Fn]),Object(P.useEffect)(function(){Bn||Jn(null)},[Bn]);var an=Object(te.a)({},Tt?"marginLeft":"marginRight",yt);ie.length||(an.visibility="hidden",an.order=1);var dr=G()(Object(te.a)({},"".concat(jr,"-rtl"),Tt)),Br=le?null:P.createElement(Qi.a,{prefixCls:jr,overlay:vn,trigger:["hover"],visible:Bn,transitionName:Be,onVisibleChange:zn,overlayClassName:dr,mouseEnterDelay:.1,mouseLeaveDelay:.1},P.createElement("button",{type:"button",className:"".concat(We,"-nav-more"),style:an,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":er,id:"".concat(Se,"-more"),"aria-expanded":Bn,onKeyDown:cr},_e));return P.createElement("div",{className:G()("".concat(We,"-nav-operations"),Ge),style:je,ref:Le},Br,P.createElement(fi,{prefixCls:We,locale:ve,editable:tt}))}var Ni=P.forwardRef(si),ka=Object(P.createContext)(null),Lo=.1,ua=.01,Gr=20,lo=Math.pow(.995,Gr);function uo(){var Ee=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Ee)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Ee.substr(0,4)))}function va(Ee,Le){var We=Object(P.useState)(),Se=Object(Y.a)(We,2),ie=Se[0],ve=Se[1],le=Object(P.useState)(0),Ae=Object(Y.a)(le,2),_e=Ae[0],Be=Ae[1],je=Object(P.useState)(0),Ge=Object(Y.a)(je,2),tt=Ge[0],yt=Ge[1],Tt=Object(P.useState)(),Nt=Object(Y.a)(Tt,2),Rn=Nt[0],$n=Nt[1],Bn=Object(P.useRef)();function zn(_n){var vn=_n.touches[0],Wn=vn.screenX,cr=vn.screenY;ve({x:Wn,y:cr}),window.clearInterval(Bn.current)}function Xn(_n){if(!ie)return;_n.preventDefault();var vn=_n.touches[0],Wn=vn.screenX,cr=vn.screenY;ve({x:Wn,y:cr});var an=Wn-ie.x,dr=cr-ie.y;Le(an,dr);var Br=Date.now();Be(Br),yt(Br-_e),$n({x:an,y:dr})}function Vn(){if(!ie)return;if(ve(null),$n(null),Rn){var _n=Rn.x/tt,vn=Rn.y/tt,Wn=Math.abs(_n),cr=Math.abs(vn);if(Math.max(Wn,cr)<Lo)return;var an=_n,dr=vn;Bn.current=window.setInterval(function(){if(Math.abs(an)<ua&&Math.abs(dr)<ua){window.clearInterval(Bn.current);return}an*=lo,dr*=lo,Le(an*Gr,dr*Gr)},Gr)}}var Fn=Object(P.useRef)(0),Jn=Object(P.useRef)(!1),er=Object(P.useRef)();function jr(_n){var vn=_n.deltaX,Wn=_n.deltaY,cr=0,an=Math.abs(vn),dr=Math.abs(Wn);an===dr?cr=er.current==="x"?vn:Wn:an>dr?(cr=vn,er.current="x"):(cr=Wn,er.current="y");var Br=Date.now();Br-Fn.current>100&&(Jn.current=!1),(Le(-cr,-cr)||Jn.current)&&(_n.preventDefault(),Jn.current=!0),Fn.current=Br}var tr=Object(P.useRef)(null);tr.current={onTouchStart:zn,onTouchMove:Xn,onTouchEnd:Vn,onWheel:jr},P.useEffect(function(){function _n(an){tr.current.onTouchStart(an)}function vn(an){tr.current.onTouchMove(an)}function Wn(an){tr.current.onTouchEnd(an)}function cr(an){tr.current.onWheel(an)}return document.addEventListener("touchmove",vn,{passive:!1}),document.addEventListener("touchend",Wn,{passive:!1}),Ee.current.addEventListener("touchstart",_n,{passive:!1}),Ee.current.addEventListener("wheel",cr),function(){document.removeEventListener("touchmove",vn),document.removeEventListener("touchend",Wn)}},[])}function ya(){var Ee=Object(P.useRef)(new Map);function Le(Se){return Ee.current.has(Se)||Ee.current.set(Se,P.createRef()),Ee.current.get(Se)}function We(Se){Ee.current.delete(Se)}return[Le,We]}function $a(Ee,Le){var We=P.useRef(Ee),Se=P.useState({}),ie=Object(Y.a)(Se,2),ve=ie[1];function le(Ae){var _e=typeof Ae=="function"?Ae(We.current):Ae;_e!==We.current&&Le(_e,We.current),We.current=_e,ve({})}return[We.current,le]}var co=function(Le){var We=Le.position,Se=Le.prefixCls,ie=Le.extra;if(!ie)return null;var ve,le=ie;return We==="right"&&(ve=le.right||!le.left&&le||null),We==="left"&&(ve=le.left||null),ve?P.createElement("div",{className:"".concat(Se,"-extra-content")},ve):null};function Ma(Ee,Le){var We,Se=P.useContext(ka),ie=Se.prefixCls,ve=Se.tabs,le=Ee.className,Ae=Ee.style,_e=Ee.id,Be=Ee.animated,je=Ee.activeKey,Ge=Ee.rtl,tt=Ee.extra,yt=Ee.editable,Tt=Ee.locale,Nt=Ee.tabPosition,Rn=Ee.tabBarGutter,$n=Ee.children,Bn=Ee.onTabClick,zn=Ee.onTabScroll,Xn=Object(P.useRef)(),Vn=Object(P.useRef)(),Fn=Object(P.useRef)(),Jn=Object(P.useRef)(),er=ya(),jr=Object(Y.a)(er,2),tr=jr[0],_n=jr[1],vn=Nt==="top"||Nt==="bottom",Wn=$a(0,function(_r,or){vn&&zn&&zn({direction:_r>or?"left":"right"})}),cr=Object(Y.a)(Wn,2),an=cr[0],dr=cr[1],Br=$a(0,function(_r,or){!vn&&zn&&zn({direction:_r>or?"top":"bottom"})}),ir=Object(Y.a)(Br,2),Ar=ir[0],xr=ir[1],zr=Object(P.useState)(0),Qr=Object(Y.a)(zr,2),Wr=Qr[0],yi=Qr[1],Ii=Object(P.useState)(0),Ci=Object(Y.a)(Ii,2),Zr=Ci[0],Pr=Ci[1],Tr=Object(P.useState)(0),wn=Object(Y.a)(Tr,2),wr=wn[0],Ui=wn[1],Zi=Object(P.useState)(0),ia=Object(Y.a)(Zi,2),Cr=ia[0],Xi=ia[1],Ji=Object(P.useState)(null),Rr=Object(Y.a)(Ji,2),yr=Rr[0],Hr=Rr[1],Ua=Object(P.useState)(null),Za=Object(Y.a)(Ua,2),ca=Za[0],Ea=Za[1],ti=Object(P.useState)(0),Yi=Object(Y.a)(ti,2),ja=Yi[0],Io=Yi[1],Po=Object(P.useState)(0),mo=Object(Y.a)(Po,2),Ja=mo[0],qa=mo[1],da=a(new Map),xa=Object(Y.a)(da,2),go=xa[0],Ba=xa[1],Ta=i(ve,go,Wr),ha="".concat(ie,"-nav-operations-hidden"),kr=0,Pi=0;vn?Ge?(kr=0,Pi=Math.max(0,Wr-yr)):(kr=Math.min(0,yr-Wr),Pi=0):(kr=Math.min(0,ca-Zr),Pi=0);function fa(_r){return _r<kr?[kr,!1]:_r>Pi?[Pi,!1]:[_r,!0]}var aa=Object(P.useRef)(),Sa=Object(P.useState)(),pa=Object(Y.a)(Sa,2),Fa=pa[0],eo=pa[1];function Wa(){eo(Date.now())}function to(){window.clearTimeout(aa.current)}va(Xn,function(_r,or){var ci=!1;function _i(sa,ea){sa(function(Ra){var la=fa(Ra+ea),li=Object(Y.a)(la,2),Da=li[0],it=li[1];return ci=it,Da})}if(vn){if(yr>=Wr)return ci;_i(dr,_r)}else{if(ca>=Zr)return ci;_i(xr,or)}return to(),Wa(),ci}),Object(P.useEffect)(function(){return to(),Fa&&(aa.current=window.setTimeout(function(){eo(0)},100)),to},[Fa]);function qi(){var _r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:je,or=Ta.get(_r);if(!or)return;if(vn){var ci=an;Ge?or.right<an?ci=or.right:or.right+or.width>an+yr&&(ci=or.right+or.width-yr):or.left<-an?ci=-or.left:or.left+or.width>-an+yr&&(ci=-(or.left+or.width-yr)),xr(0),dr(fa(ci)[0])}else{var _i=Ar;or.top<-Ar?_i=-or.top:or.top+or.height>-Ar+ca&&(_i=-(or.top+or.height-ca)),dr(0),xr(fa(_i)[0])}}var oa=A(Ta,{width:yr,height:ca,left:an,top:Ar},{width:wr,height:Cr},{width:ja,height:Ja},Object(z.a)(Object(z.a)({},Ee),{},{tabs:ve})),no=Object(Y.a)(oa,2),ro=no[0],ko=no[1],Mo=ve.map(function(_r){var or=_r.key;return P.createElement(u,{id:_e,prefixCls:ie,key:or,rtl:Ge,tab:_r,closable:_r.closable,editable:yt,active:or===je,tabPosition:Nt,tabBarGutter:Rn,renderWrapper:$n,removeAriaLabel:Tt==null?void 0:Tt.removeAriaLabel,ref:tr(or),onClick:function(_i){Bn(or,_i)},onRemove:function(){_n(or)},onFocus:function(){qi(or),Wa(),Ge||(Xn.current.scrollLeft=0),Xn.current.scrollTop=0}})}),io=c(function(){var _r,or,ci,_i,sa,ea,Ra,la,li,Da=((_r=Xn.current)===null||_r===void 0?void 0:_r.offsetWidth)||0,it=((or=Xn.current)===null||or===void 0?void 0:or.offsetHeight)||0,Je=((ci=Jn.current)===null||ci===void 0?void 0:ci.offsetWidth)||0,$e=((_i=Jn.current)===null||_i===void 0?void 0:_i.offsetHeight)||0,ot=((sa=Fn.current)===null||sa===void 0?void 0:sa.offsetWidth)||0,ut=((ea=Fn.current)===null||ea===void 0?void 0:ea.offsetHeight)||0;Hr(Da),Ea(it),Io(Je),qa($e);var At=(((Ra=Vn.current)===null||Ra===void 0?void 0:Ra.offsetWidth)||0)-Je,St=(((la=Vn.current)===null||la===void 0?void 0:la.offsetHeight)||0)-$e;yi(At),Pr(St);var wt=(li=Fn.current)===null||li===void 0?void 0:li.className.includes(ha);Ui(At-(wt?0:ot)),Xi(St-(wt?0:ut)),Ba(function(){var cn=new Map;return ve.forEach(function(nr){var Oi=nr.key,Hn=tr(Oi).current;Hn&&cn.set(Oi,{width:Hn.offsetWidth,height:Hn.offsetHeight,left:Hn.offsetLeft,top:Hn.offsetTop})}),cn})}),No=ve.slice(0,ro),ni=ve.slice(ko+1),Jr=[].concat(Object(I.a)(No),Object(I.a)(ni)),pi=Object(P.useState)(),qr=Object(Y.a)(pi,2),Aa=qr[0],Ha=qr[1],ki=Ta.get(je),ao=Object(P.useRef)();function Ka(){f.a.cancel(ao.current)}Object(P.useEffect)(function(){var _r={};return ki&&(vn?(Ge?_r.right=ki.right:_r.left=ki.left,_r.width=ki.width):(_r.top=ki.top,_r.height=ki.height)),Ka(),ao.current=f()(function(){Ha(_r)}),Ka},[ki,vn,Ge]),Object(P.useEffect)(function(){qi()},[je,ki,Ta,vn]),Object(P.useEffect)(function(){io()},[Ge,Rn,je,ve.map(function(_r){return _r.key}).join("_")]);var vo=!!Jr.length,ma="".concat(ie,"-nav-wrap"),Ga,Oa,yo,za;return vn?Ge?(Oa=an>0,Ga=an+yr<Wr):(Ga=an<0,Oa=-an+yr<Wr):(yo=Ar<0,za=-Ar+ca<Zr),P.createElement("div",{ref:Le,role:"tablist",className:G()("".concat(ie,"-nav"),le),style:Ae,onKeyDown:function(){Wa()}},P.createElement(co,{position:"left",extra:tt,prefixCls:ie}),P.createElement(b.a,{onResize:io},P.createElement("div",{className:G()(ma,(We={},Object(te.a)(We,"".concat(ma,"-ping-left"),Ga),Object(te.a)(We,"".concat(ma,"-ping-right"),Oa),Object(te.a)(We,"".concat(ma,"-ping-top"),yo),Object(te.a)(We,"".concat(ma,"-ping-bottom"),za),We)),ref:Xn},P.createElement(b.a,{onResize:io},P.createElement("div",{ref:Vn,className:"".concat(ie,"-nav-list"),style:{transform:"translate(".concat(an,"px, ").concat(Ar,"px)"),transition:Fa?"none":void 0}},Mo,P.createElement(fi,{ref:Jn,prefixCls:ie,locale:Tt,editable:yt,style:{visibility:vo?"hidden":null}}),P.createElement("div",{className:G()("".concat(ie,"-ink-bar"),Object(te.a)({},"".concat(ie,"-ink-bar-animated"),Be.inkBar)),style:Aa}))))),P.createElement(Ni,Object.assign({},Ee,{ref:Fn,prefixCls:ie,tabs:Jr,className:!vo&&ha})),P.createElement(co,{position:"right",extra:tt,prefixCls:ie}))}var Ca=P.forwardRef(Ma);function ho(Ee){var Le=Ee.id,We=Ee.activeKey,Se=Ee.animated,ie=Ee.tabPosition,ve=Ee.rtl,le=Ee.destroyInactiveTabPane,Ae=P.useContext(ka),_e=Ae.prefixCls,Be=Ae.tabs,je=Se.tabPane,Ge=Be.findIndex(function(tt){return tt.key===We});return P.createElement("div",{className:G()("".concat(_e,"-content-holder"))},P.createElement("div",{className:G()("".concat(_e,"-content"),"".concat(_e,"-content-").concat(ie),Object(te.a)({},"".concat(_e,"-content-animated"),je)),style:Ge&&je?Object(te.a)({},ve?"marginRight":"marginLeft","-".concat(Ge,"00%")):null},Be.map(function(tt){return P.cloneElement(tt.node,{key:tt.key,prefixCls:_e,tabKey:tt.key,id:Le,animated:je,active:tt.key===We,destroyInactiveTabPane:le})})))}function fo(Ee){var Le=Ee.prefixCls,We=Ee.forceRender,Se=Ee.className,ie=Ee.style,ve=Ee.id,le=Ee.active,Ae=Ee.animated,_e=Ee.destroyInactiveTabPane,Be=Ee.tabKey,je=Ee.children,Ge=P.useState(We),tt=Object(Y.a)(Ge,2),yt=tt[0],Tt=tt[1];P.useEffect(function(){le?Tt(!0):_e&&Tt(!1)},[le,_e]);var Nt={};return le||(Ae?(Nt.visibility="hidden",Nt.height=0,Nt.overflowY="hidden"):Nt.display="none"),P.createElement("div",{id:ve&&"".concat(ve,"-panel-").concat(Be),role:"tabpanel",tabIndex:le?0:-1,"aria-labelledby":ve&&"".concat(ve,"-tab-").concat(Be),"aria-hidden":!le,style:Object(z.a)(Object(z.a)({},Nt),ie),className:G()("".concat(Le,"-tabpane"),le&&"".concat(Le,"-tabpane-active"),Se)},(le||yt||We)&&je)}var Na=0;function po(Ee){return Object(K.a)(Ee).map(function(Le){if(P.isValidElement(Le)){var We=Le.key!==void 0?String(Le.key):void 0;return Object(z.a)(Object(z.a)({key:We},Le.props),{},{node:Le})}return null}).filter(function(Le){return Le})}function Qa(Ee,Le){var We,Se=Ee.id,ie=Ee.prefixCls,ve=ie===void 0?"rc-tabs":ie,le=Ee.className,Ae=Ee.children,_e=Ee.direction,Be=Ee.activeKey,je=Ee.defaultActiveKey,Ge=Ee.editable,tt=Ee.animated,yt=Ee.tabPosition,Tt=yt===void 0?"top":yt,Nt=Ee.tabBarGutter,Rn=Ee.tabBarStyle,$n=Ee.tabBarExtraContent,Bn=Ee.locale,zn=Ee.moreIcon,Xn=Ee.moreTransitionName,Vn=Ee.destroyInactiveTabPane,Fn=Ee.renderTabBar,Jn=Ee.onChange,er=Ee.onTabClick,jr=Ee.onTabScroll,tr=Object(N.a)(Ee,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),_n=po(Ae),vn=_e==="rtl",Wn;tt===!1?Wn={inkBar:!1,tabPane:!1}:Wn=Object(z.a)({inkBar:!0,tabPane:!1},tt!==!0?tt:null);var cr=Object(P.useState)(!1),an=Object(Y.a)(cr,2),dr=an[0],Br=an[1];Object(P.useEffect)(function(){Br(uo())},[]);var ir=Object(n.a)(function(){var Cr;return(Cr=_n[0])===null||Cr===void 0?void 0:Cr.key},{value:Be,defaultValue:je}),Ar=Object(Y.a)(ir,2),xr=Ar[0],zr=Ar[1],Qr=Object(P.useState)(function(){return _n.findIndex(function(Cr){return Cr.key===xr})}),Wr=Object(Y.a)(Qr,2),yi=Wr[0],Ii=Wr[1];Object(P.useEffect)(function(){var Cr=_n.findIndex(function(Ji){return Ji.key===xr});if(Cr===-1){var Xi;Cr=Math.max(0,Math.min(yi,_n.length-1)),zr((Xi=_n[Cr])===null||Xi===void 0?void 0:Xi.key)}Ii(Cr)},[_n.map(function(Cr){return Cr.key}).join("_"),xr,yi]);var Ci=Object(n.a)(null,{value:Se}),Zr=Object(Y.a)(Ci,2),Pr=Zr[0],Tr=Zr[1],wn=Tt;dr&&!["left","right"].includes(Tt)&&(wn="top"),Object(P.useEffect)(function(){Se||(Tr("rc-tabs-".concat(Na)),Na+=1)},[]);function wr(Cr,Xi){er==null||er(Cr,Xi),zr(Cr),Jn==null||Jn(Cr)}var Ui={id:Pr,activeKey:xr,animated:Wn,tabPosition:wn,rtl:vn,mobile:dr},Zi,ia=Object(z.a)(Object(z.a)({},Ui),{},{editable:Ge,locale:Bn,moreIcon:zn,moreTransitionName:Xn,tabBarGutter:Nt,onTabClick:wr,onTabScroll:jr,extra:$n,style:Rn,panes:Ae});return Fn?Zi=Fn(ia,Ca):Zi=P.createElement(Ca,Object.assign({},ia)),P.createElement(ka.Provider,{value:{tabs:_n,prefixCls:ve}},P.createElement("div",Object.assign({ref:Le,id:Se,className:G()(ve,"".concat(ve,"-").concat(wn),(We={},Object(te.a)(We,"".concat(ve,"-mobile"),dr),Object(te.a)(We,"".concat(ve,"-editable"),Ge),Object(te.a)(We,"".concat(ve,"-rtl"),vn),We),le)},tr),Zi,P.createElement(ho,Object.assign({destroyInactiveTabPane:Vn},Ui,{animated:Wn}))))}var _a=P.forwardRef(Qa);_a.TabPane=fo;var ra=_a,ba=ge.b=ra},kSUc:function(ct,ge,U){},lZu9:function(ct,ge,U){(function(te){te(U("VrN/"),U("1eCo"),U("8EBN"))})(function(te){"use strict";te.defineMode("markdown",function(Y,N){var z=te.getMode(Y,"text/html"),P=z.name=="null";function F(m){if(te.findModeByName){var v=te.findModeByName(m);v&&(m=v.mime||v.mimes[0])}var H=te.getMode(Y,m);return H.name=="null"?null:H}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 K in G)G.hasOwnProperty(K)&&N.tokenTypeOverrides[K]&&(G[K]=N.tokenTypeOverrides[K]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,E=/^\[(x| )\](?=\s)/i,f=N.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,b=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,a=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,u=" ";function s(m,v,H){return v.f=v.inline=H,H(m,v)}function i(m,v,H){return v.f=v.block=H,H(m,v)}function D(m){return!m||!/\S/.test(m.string)}function A(m){if(m.linkTitle=!1,m.linkHref=!1,m.linkText=!1,m.em=!1,m.strong=!1,m.strikethrough=!1,m.quote=0,m.indentedCode=!1,m.f==R){var v=P;if(!v){var H=te.innerMode(z,m.htmlState);v=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}v&&(m.f=h,m.block=S,m.htmlState=null)}return m.trailingSpace=0,m.trailingSpaceNewLine=!1,m.prevLine=m.thisLine,m.thisLine={stream:null},null}function S(m,v){var H=m.column()===v.indentation,X=D(v.prevLine.stream),q=v.indentedCode,re=v.prevLine.hr,ye=v.list!==!1,pe=(v.listStack[v.listStack.length-1]||0)+3;v.indentedCode=!1;var ue=v.indentation;if(v.indentationDiff===null&&(v.indentationDiff=v.indentation,ye)){for(v.list=null;ue<v.listStack[v.listStack.length-1];)v.listStack.pop(),v.listStack.length?v.indentation=v.listStack[v.listStack.length-1]:v.list=!1;v.list!==!1&&(v.indentationDiff=ue-v.listStack[v.listStack.length-1])}var fe=!X&&!re&&!v.prevLine.header&&(!ye||!q)&&!v.prevLine.fencedCodeEnd,be=(v.list===!1||re||X)&&v.indentation<=pe&&m.match(n),se=null;if(v.indentationDiff>=4&&(q||v.prevLine.fencedCodeEnd||v.prevLine.header||X))return m.skipToEnd(),v.indentedCode=!0,G.code;if(m.eatSpace())return null;if(H&&v.indentation<=pe&&(se=m.match(f))&&se[1].length<=6)return v.quote=0,v.header=se[1].length,v.thisLine.header=!0,N.highlightFormatting&&(v.formatting="header"),v.f=v.inline,g(v);if(v.indentation<=pe&&m.eat(">"))return v.quote=H?1:v.quote+1,N.highlightFormatting&&(v.formatting="quote"),m.eatSpace(),g(v);if(!be&&!v.setext&&H&&v.indentation<=pe&&(se=m.match(I))){var ae=se[1]?"ol":"ul";return v.indentation=ue+m.current().length,v.list=!0,v.quote=0,v.listStack.push(v.indentation),v.em=!1,v.strong=!1,v.code=!1,v.strikethrough=!1,N.taskLists&&m.match(E,!1)&&(v.taskList=!0),v.f=v.inline,N.highlightFormatting&&(v.formatting=["list","list-"+ae]),g(v)}else{if(H&&v.indentation<=pe&&(se=m.match(a,!0)))return v.quote=0,v.fencedEndRE=new RegExp(se[1]+"+ *$"),v.localMode=N.fencedCodeBlockHighlighting&&F(se[2]||N.fencedCodeBlockDefaultMode),v.localMode&&(v.localState=te.startState(v.localMode)),v.f=v.block=O,N.highlightFormatting&&(v.formatting="code-block"),v.code=-1,g(v);if(v.setext||(!fe||!ye)&&!v.quote&&v.list===!1&&!v.code&&!be&&!p.test(m.string)&&(se=m.lookAhead(1))&&(se=se.match(b)))return v.setext?(v.header=v.setext,v.setext=0,m.skipToEnd(),N.highlightFormatting&&(v.formatting="header")):(v.header=se[0].charAt(0)=="="?1:2,v.setext=v.header),v.thisLine.header=!0,v.f=v.inline,g(v);if(be)return m.skipToEnd(),v.hr=!0,v.thisLine.hr=!0,G.hr;if(m.peek()==="[")return s(m,v,j)}return s(m,v,v.inline)}function R(m,v){var H=z.token(m,v.htmlState);if(!P){var X=te.innerMode(z,v.htmlState);(X.mode.name=="xml"&&X.state.tagStart===null&&!X.state.context&&X.state.tokenize.isInText||v.md_inside&&m.current().indexOf(">")>-1)&&(v.f=h,v.block=S,v.htmlState=null)}return H}function O(m,v){var H=v.listStack[v.listStack.length-1]||0,X=v.indentation<H,q=H+3;if(v.fencedEndRE&&v.indentation<=q&&(X||m.match(v.fencedEndRE))){N.highlightFormatting&&(v.formatting="code-block");var re;return X||(re=g(v)),v.localMode=v.localState=null,v.block=S,v.f=h,v.fencedEndRE=null,v.code=0,v.thisLine.fencedCodeEnd=!0,X?i(m,v,v.block):re}else return v.localMode?v.localMode.token(m,v.localState):(m.skipToEnd(),G.code)}function g(m){var v=[];if(m.formatting){v.push(G.formatting),typeof m.formatting=="string"&&(m.formatting=[m.formatting]);for(var H=0;H<m.formatting.length;H++)v.push(G.formatting+"-"+m.formatting[H]),m.formatting[H]==="header"&&v.push(G.formatting+"-"+m.formatting[H]+"-"+m.header),m.formatting[H]==="quote"&&(!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=m.quote?v.push(G.formatting+"-"+m.formatting[H]+"-"+m.quote):v.push("error"))}if(m.taskOpen)return v.push("meta"),v.length?v.join(" "):null;if(m.taskClosed)return v.push("property"),v.length?v.join(" "):null;if(m.linkHref?v.push(G.linkHref,"url"):(m.strong&&v.push(G.strong),m.em&&v.push(G.em),m.strikethrough&&v.push(G.strikethrough),m.emoji&&v.push(G.emoji),m.linkText&&v.push(G.linkText),m.code&&v.push(G.code),m.image&&v.push(G.image),m.imageAltText&&v.push(G.imageAltText,"link"),m.imageMarker&&v.push(G.imageMarker)),m.header&&v.push(G.header,G.header+"-"+m.header),m.quote&&(v.push(G.quote),!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=m.quote?v.push(G.quote+"-"+m.quote):v.push(G.quote+"-"+N.maxBlockquoteDepth)),m.list!==!1){var X=(m.listStack.length-1)%3;X?X===1?v.push(G.list2):v.push(G.list3):v.push(G.list1)}return m.trailingSpaceNewLine?v.push("trailing-space-new-line"):m.trailingSpace&&v.push("trailing-space-"+(m.trailingSpace%2?"a":"b")),v.length?v.join(" "):null}function _(m,v){return m.match(c,!0)?g(v):void 0}function h(m,v){var H=v.text(m,v);if(typeof H!="undefined")return H;if(v.list)return v.list=null,g(v);if(v.taskList){var X=m.match(E,!0)[1]===" ";return X?v.taskOpen=!0:v.taskClosed=!0,N.highlightFormatting&&(v.formatting="task"),v.taskList=!1,g(v)}if(v.taskOpen=!1,v.taskClosed=!1,v.header&&m.match(/^#+$/,!0))return N.highlightFormatting&&(v.formatting="header"),g(v);var q=m.next();if(v.linkTitle){v.linkTitle=!1;var re=q;q==="("&&(re=")"),re=(re+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ye="^\\s*(?:[^"+re+"\\\\]+|\\\\\\\\|\\\\.)"+re;if(m.match(new RegExp(ye),!0))return G.linkHref}if(q==="`"){var pe=v.formatting;N.highlightFormatting&&(v.formatting="code"),m.eatWhile("`");var ue=m.current().length;if(v.code==0&&(!v.quote||ue==1))return v.code=ue,g(v);if(ue==v.code){var fe=g(v);return v.code=0,fe}else return v.formatting=pe,g(v)}else if(v.code)return g(v);if(q==="\\"&&(m.next(),N.highlightFormatting)){var be=g(v),se=G.formatting+"-escape";return be?be+" "+se:se}if(q==="!"&&m.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return v.imageMarker=!0,v.image=!0,N.highlightFormatting&&(v.formatting="image"),g(v);if(q==="["&&v.imageMarker&&m.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return v.imageMarker=!1,v.imageAltText=!0,N.highlightFormatting&&(v.formatting="image"),g(v);if(q==="]"&&v.imageAltText){N.highlightFormatting&&(v.formatting="image");var be=g(v);return v.imageAltText=!1,v.image=!1,v.inline=v.f=C,be}if(q==="["&&!v.image)return v.linkText&&m.match(/^.*?\]/)||(v.linkText=!0,N.highlightFormatting&&(v.formatting="link")),g(v);if(q==="]"&&v.linkText){N.highlightFormatting&&(v.formatting="link");var be=g(v);return v.linkText=!1,v.inline=v.f=m.match(/\(.*?\)| ?\[.*?\]/,!1)?C:h,be}if(q==="<"&&m.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=d,N.highlightFormatting&&(v.formatting="link");var be=g(v);return be?be+=" ":be="",be+G.linkInline}if(q==="<"&&m.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=d,N.highlightFormatting&&(v.formatting="link");var be=g(v);return be?be+=" ":be="",be+G.linkEmail}if(N.xml&&q==="<"&&m.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ae=m.string.indexOf(">",m.pos);if(ae!=-1){var Ce=m.string.substring(m.start,ae);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ce)&&(v.md_inside=!0)}return m.backUp(1),v.htmlState=te.startState(z),i(m,v,R)}if(N.xml&&q==="<"&&m.match(/^\/\w*?>/))return v.md_inside=!1,"tag";if(q==="*"||q==="_"){for(var ze=1,Ye=m.pos==1?" ":m.string.charAt(m.pos-2);ze<3&&m.eat(q);)ze++;var He=m.peek()||" ",Ve=!/\s/.test(He)&&(!l.test(He)||/\s/.test(Ye)||l.test(Ye)),Fe=!/\s/.test(Ye)&&(!l.test(Ye)||/\s/.test(He)||l.test(He)),Ke=null,nt=null;if(ze%2&&(!v.em&&Ve&&(q==="*"||!Fe||l.test(Ye))?Ke=!0:v.em==q&&Fe&&(q==="*"||!Ve||l.test(He))&&(Ke=!1)),ze>1&&(!v.strong&&Ve&&(q==="*"||!Fe||l.test(Ye))?nt=!0:v.strong==q&&Fe&&(q==="*"||!Ve||l.test(He))&&(nt=!1)),nt!=null||Ke!=null){N.highlightFormatting&&(v.formatting=Ke==null?"strong":nt==null?"em":"strong em"),Ke===!0&&(v.em=q),nt===!0&&(v.strong=q);var fe=g(v);return Ke===!1&&(v.em=!1),nt===!1&&(v.strong=!1),fe}}else if(q===" "&&(m.eat("*")||m.eat("_"))){if(m.peek()===" ")return g(v);m.backUp(1)}if(N.strikethrough){if(q==="~"&&m.eatWhile(q)){if(v.strikethrough){N.highlightFormatting&&(v.formatting="strikethrough");var fe=g(v);return v.strikethrough=!1,fe}else if(m.match(/^[^\s]/,!1))return v.strikethrough=!0,N.highlightFormatting&&(v.formatting="strikethrough"),g(v)}else if(q===" "&&m.match(/^~~/,!0)){if(m.peek()===" ")return g(v);m.backUp(2)}}if(N.emoji&&q===":"&&m.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){v.emoji=!0,N.highlightFormatting&&(v.formatting="emoji");var de=g(v);return v.emoji=!1,de}return q===" "&&(m.match(/^ +$/,!1)?v.trailingSpace++:v.trailingSpace&&(v.trailingSpaceNewLine=!0)),g(v)}function d(m,v){var H=m.next();if(H===">"){v.f=v.inline=h,N.highlightFormatting&&(v.formatting="link");var X=g(v);return X?X+=" ":X="",X+G.linkInline}return m.match(/^[^>]+/,!0),G.linkInline}function C(m,v){if(m.eatSpace())return null;var H=m.next();return H==="("||H==="["?(v.f=v.inline=w(H==="("?")":"]"),N.highlightFormatting&&(v.formatting="link-string"),v.linkHref=!0,g(v)):"error"}var x={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function w(m){return function(v,H){var X=v.next();if(X===m){H.f=H.inline=h,N.highlightFormatting&&(H.formatting="link-string");var q=g(H);return H.linkHref=!1,q}return v.match(x[m]),H.linkHref=!0,g(H)}}function j(m,v){return m.match(/^([^\]\\]|\\.)*\]:/,!1)?(v.f=W,m.next(),N.highlightFormatting&&(v.formatting="link"),v.linkText=!0,g(v)):s(m,v,h)}function W(m,v){if(m.match(/^\]:/,!0)){v.f=v.inline=T,N.highlightFormatting&&(v.formatting="link");var H=g(v);return v.linkText=!1,H}return m.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function T(m,v){return m.eatSpace()?null:(m.match(/^[^\s]+/,!0),m.peek()===void 0?v.linkTitle=!0:m.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),v.f=v.inline=h,G.linkHref+" url")}var M={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:h,text:_,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(m){return{f:m.f,prevLine:m.prevLine,thisLine:m.thisLine,block:m.block,htmlState:m.htmlState&&te.copyState(z,m.htmlState),indentation:m.indentation,localMode:m.localMode,localState:m.localMode?te.copyState(m.localMode,m.localState):null,inline:m.inline,text:m.text,formatting:!1,linkText:m.linkText,linkTitle:m.linkTitle,linkHref:m.linkHref,code:m.code,em:m.em,strong:m.strong,strikethrough:m.strikethrough,emoji:m.emoji,header:m.header,setext:m.setext,hr:m.hr,taskList:m.taskList,list:m.list,listStack:m.listStack.slice(0),quote:m.quote,indentedCode:m.indentedCode,trailingSpace:m.trailingSpace,trailingSpaceNewLine:m.trailingSpaceNewLine,md_inside:m.md_inside,fencedEndRE:m.fencedEndRE}},token:function(m,v){if(v.formatting=!1,m!=v.thisLine.stream){if(v.header=0,v.hr=!1,m.match(/^\s*$/,!0))return A(v),null;if(v.prevLine=v.thisLine,v.thisLine={stream:m},v.taskList=!1,v.trailingSpace=0,v.trailingSpaceNewLine=!1,!v.localState&&(v.f=v.block,v.f!=R)){var H=m.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(v.indentation=H,v.indentationDiff=null,H>0)return null}}return v.f(m,v)},innerMode:function(m){return m.block==R?{state:m.htmlState,mode:z}:m.localState?{state:m.localState,mode:m.localMode}:{state:m,mode:M}},indent:function(m,v,H){return m.block==R&&z.indent?z.indent(m.htmlState,v,H):m.localState&&m.localMode.indent?m.localMode.indent(m.localState,v,H):te.Pass},blankLine:A,getType:g,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return M},"xml"),te.defineMIME("text/markdown","markdown"),te.defineMIME("text/x-markdown","markdown")})},mgmH:function(ct,ge,U){"use strict";U.d(ge,"d",function(){return b}),U.d(ge,"b",function(){return c}),U.d(ge,"e",function(){return a}),U.d(ge,"c",function(){return p}),U.d(ge,"n",function(){return l}),U.d(ge,"g",function(){return u}),U.d(ge,"h",function(){return s}),U.d(ge,"j",function(){return D}),U.d(ge,"a",function(){return A}),U.d(ge,"l",function(){return S}),U.d(ge,"f",function(){return R}),U.d(ge,"k",function(){return O}),U.d(ge,"m",function(){return g}),U.d(ge,"i",function(){return _}),U.d(ge,"o",function(){return h}),U.d(ge,"t",function(){return d}),U.d(ge,"s",function(){return C}),U.d(ge,"p",function(){return x}),U.d(ge,"q",function(){return w}),U.d(ge,"r",function(){return j}),U.d(ge,"v",function(){return W}),U.d(ge,"u",function(){return T});var te=U("miYZ"),Y=U("tsqr"),N=U("k1fw"),z=U("9og8"),P=U("WmNS"),F=U.n(P),G=U("oUNq"),K=U("9kvl"),n=U("1vsH"),I=U("m3rI"),E=function(){Object(K.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},f=function(){Object(K.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},b=function(){var M=Object(z.a)(F.a.mark(function m(v){var H;return F.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return E(),q.next=3,Object(G.t)(Object(N.a)({},v));case 3:if(H=q.sent,!(H.status===0)){q.next=7;break}return q.next=7,Object(n.w)("",Object(n.Y)({url:I.a.API_SERVER+"/api/courses/".concat(v.coursesId,"/export_couser_info.json"),query:v}));case 7:f();case 8:case"end":return q.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),c=function(){var M=Object(z.a)(F.a.mark(function m(v){var H;return F.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(G.r)(Object(N.a)({},v));case 2:if(H=q.sent,!(H.status===0)){q.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_member_act_score")),q.next=13;break;case 8:if(!(H.status===-2)){q.next=12;break}return q.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return q.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),a=function(){var M=Object(z.a)(F.a.mark(function m(v){var H;return F.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(G.u)(Object(N.a)({},v));case 2:if(H=q.sent,!(H.status===0)){q.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_total_score")),q.next=13;break;case 8:if(!(H.status===-2)){q.next=12;break}return q.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_total_score")));case 13:case"end":return q.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),p=function(){var M=Object(z.a)(F.a.mark(function m(v){var H;return F.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(G.s)(Object(N.a)({},v));case 2:if(H=q.sent,!(H.status===0)){q.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_total_exercise_and_other")),q.next=13;break;case 8:if(!(H.status===-2)){q.next=12;break}return q.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return q.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),l=function(){var M=Object(z.a)(F.a.mark(function m(v){var H;return F.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(G.z)(Object(N.a)({},v));case 2:if(H=q.sent,!(H.status===0)){q.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_total_exercise_and_other")),q.next=13;break;case 8:if(!(H.status===-2)){q.next=12;break}return q.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return q.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),u=function(){var M=Object(z.a)(F.a.mark(function m(v){var H;return F.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(G.v)(Object(N.a)({},v));case 2:if(H=q.sent,!(H.status===0)){q.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_total_homework")),q.next=13;break;case 8:if(!(H.status===-2)){q.next=12;break}return q.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return q.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),s=function(){var M=Object(z.a)(F.a.mark(function m(v,H){var X;return F.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Object(G.x)(Object(N.a)({},v));case 2:X=re.sent,X.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(v.coursesId,"/exportlist/").concat(H))):X.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(v.coursesId,"/exportlist/").concat(H)));case 4:case"end":return re.stop()}},m)}));return function(v,H){return M.apply(this,arguments)}}(),i=function(){var M=Object(z.a)(F.a.mark(function m(v){var H;return F.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return E(),q.next=3,Object(G.w)(Object(N.a)({},v));case 3:if(H=q.sent,!(H.status===0)){q.next=7;break}return q.next=7,Object(n.w)("",Object(n.Y)({url:I.a.API_SERVER+"/api/homework_commons/".concat(v.categoryId,"/works_list.zip"),query:v}));case 7:f();case 8:case"end":return q.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),D=function(){var M=Object(z.a)(F.a.mark(function m(v){var H;return F.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return E(),q.next=3,Object(G.A)(Object(N.a)({},v));case 3:if(H=q.sent,!(H.status===0)){q.next=7;break}return q.next=7,Object(n.w)("",Object(n.Y)({url:I.a.API_SERVER+"/api/polls/".concat(v.categoryId,"/commit_result.xlsx"),query:v}));case 7:f();case 8:case"end":return q.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),A=function(){var M=Object(z.a)(F.a.mark(function m(v){return F.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(n.v)("",Object(n.Y)({url:I.a.API_SERVER+"/api/courses/".concat(v.coursesId,"/attendances/export_xlsx_data.xlsx"),query:v}));case 2:case"end":return X.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),S=function(){var M=Object(z.a)(F.a.mark(function m(v){return F.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(n.v)("",Object(n.Y)({url:I.a.API_SERVER+"/api/courses/".concat(v.coursesId,"/video_study_statics.xlsx"),query:v}));case 2:case"end":return X.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),R=function(){var M=Object(z.a)(F.a.mark(function m(v){return F.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(n.v)("",Object(n.Y)({url:I.a.API_SERVER+"/api/courses/".concat(v.coursesId,"/export_course_students_info.xlsx"),query:v}));case 2:case"end":return X.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),O=function(){var M=Object(z.a)(F.a.mark(function m(v){return F.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(n.v)("",Object(n.Y)({url:I.a.API_SERVER+"/api/item_banks/export.xlsx",query:v}));case 2:case"end":return X.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),g=function(){var M=Object(z.a)(F.a.mark(function m(v){return F.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(n.v)("",Object(n.Y)({url:I.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:v}));case 2:case"end":return X.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),_=function(){var M=Object(z.a)(F.a.mark(function m(v){var H;return F.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(G.y)(Object(N.a)({},v));case 2:H=q.sent,H.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(v.coursesId,"/exportlist/exercise_score"))):H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(v.coursesId,"/exportlist/exercise_score")));case 4:case"end":return q.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),h=function(){var M=Object(z.a)(F.a.mark(function m(v){return F.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),X.next=3,Object(n.v)("",Object(n.Y)({url:I.a.API_SERVER+"/api/export_records/".concat(v.id,".xlsx"),query:v}));case 3:case"end":return X.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),d=function(){var M=Object(z.a)(F.a.mark(function m(v){return F.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(n.v)("",Object(n.Y)({url:I.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:v}));case 2:case"end":return X.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),C=function(){var M=Object(z.a)(F.a.mark(function m(v){return F.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(n.v)("",Object(n.Y)({url:I.a.API_SERVER+"/api/ec_years/".concat(v==null?void 0:v.ec_year_id,"/ec_training_objectives.xlsx"),query:v}));case 2:case"end":return X.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),x=function(){var M=Object(z.a)(F.a.mark(function m(v){return F.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(n.v)(v==null?void 0:v.name,Object(n.Y)({url:I.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:v}));case 2:case"end":return X.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),w=function(){var M=Object(z.a)(F.a.mark(function m(v){return F.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(n.v)("",Object(n.Y)({url:I.a.API_SERVER+"/api/ec_years/".concat(v==null?void 0:v.ec_year_id,"/ec_courses.xlsx"),query:v}));case 2:case"end":return X.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),j=function(){var M=Object(z.a)(F.a.mark(function m(v){return F.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(n.v)("",Object(n.Y)({url:I.a.API_SERVER+"/api/ec_years/".concat(v==null?void 0:v.ec_year_id,"/ec_graduation_requirements.xlsx"),query:v}));case 2:case"end":return X.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),W=function(){var M=Object(z.a)(F.a.mark(function m(v){return F.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(n.v)("",Object(n.Y)({url:I.a.API_SERVER+"/api/courses/rank_list.xlsx",query:v}));case 2:case"end":return X.stop()}},m)}));return function(v){return M.apply(this,arguments)}}(),T=function(){var M=Object(z.a)(F.a.mark(function m(v){return F.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(n.v)("",Object(n.Y)({url:I.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:v}));case 2:case"end":return X.stop()}},m)}));return function(v){return M.apply(this,arguments)}}()},nEHx:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return te});var te;(function(Y){Y.DARK="dark",Y.LIGHT="light",Y.HIGH_CONTRAST="hc"})(te||(te={}))},nSDg:function(ct,ge,U){ct.exports={flex_box_center:"flex_box_center___2lqeg",flex_space_between:"flex_space_between___RuZ2s",flex_box_vertical_center:"flex_box_vertical_center___2AGHP",flex_box_center_end:"flex_box_center_end___FDazu",flex_box_column:"flex_box_column___1Yqjx",wrp:"wrp____lZAZ",drawer:"drawer___2XpEN",menu:"menu___fZQrG",actived:"actived___1Yg9q",actived2:"actived2___2KHN5",subTag:"subTag___3AbgU",directionName:"directionName___2Xp-L",menuDirection:"menuDirection___1ZMmo",listItem:"listItem___g9W0X",info:"info___1FHWU",title:"title___1VzwI",titleLeft:"titleLeft___yvqaz",titleRight:"titleRight___2Dqm5",search:"search___3pcQt",description:"description___3yQGh",menuCourse:"menuCourse___3iBFc",paginationWrap:"paginationWrap___KxpDN"}},nnTU:function(ct,ge,U){"use strict";U.d(ge,"b",function(){return G}),U.d(ge,"a",function(){return K});var te=U("MI8n"),Y=U("JYp7"),N=U("pmY6"),z=U("24hK"),P=U("746U"),F=U("Cg/j");const G=Object(F.c)("commandService"),K=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new te.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,I){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!I)throw new Error("invalid command");return this.registerCommand({id:n,handler:I})}if(n.description){const a=[];for(let l of n.description.args)a.push(l.constraint);const p=n.handler;n.handler=function(l,...u){return Object(P.o)(u,a),p(l,...u)}}const{id:E}=n;let f=this._commands.get(E);f||(f=new z.a,this._commands.set(E,f));let b=f.unshift(n),c=Object(N.i)(()=>{b();const a=this._commands.get(E);(a==null?void 0:a.isEmpty())&&this._commands.delete(E)});return this._onDidRegisterCommand.fire(E),c}registerCommandAlias(n,I){return K.registerCommand(n,(E,...f)=>E.get(G).executeCommand(I,...f))}getCommand(n){const I=this._commands.get(n);return!I||I.isEmpty()?void 0:Y.a.first(I)}getCommands(){const n=new Map;for(const I of this._commands.keys()){const E=this.getCommand(I);E&&n.set(I,E)}return n}};K.registerCommand("noop",()=>{})},osHv:function(ct,ge,U){(function(te){te(U("VrN/"))})(function(te){"use strict";var Y=te.Pos;function N(l,u){return l.line-u.line||l.ch-u.ch}var z="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",P=z+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",F=new RegExp("<(/?)(["+z+"]["+P+"]*)","g");function G(l,u,s,i){this.line=u,this.ch=s,this.cm=l,this.text=l.getLine(u),this.min=i?Math.max(i.from,l.firstLine()):l.firstLine(),this.max=i?Math.min(i.to-1,l.lastLine()):l.lastLine()}function K(l,u){var s=l.cm.getTokenTypeAt(Y(l.line,u));return s&&/\btag\b/.test(s)}function n(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function I(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function E(l){for(;;){var u=l.text.indexOf(">",l.ch);if(u==-1){if(n(l))continue;return}if(!K(l,u+1)){l.ch=u+1;continue}var s=l.text.lastIndexOf("/",u),i=s>-1&&!/\S/.test(l.text.slice(s+1,u));return l.ch=u+1,i?"selfClose":"regular"}}function f(l){for(;;){var u=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(u==-1){if(I(l))continue;return}if(!K(l,u+1)){l.ch=u;continue}F.lastIndex=u,l.ch=u;var s=F.exec(l.text);if(s&&s.index==u)return s}}function b(l){for(;;){F.lastIndex=l.ch;var u=F.exec(l.text);if(!u){if(n(l))continue;return}if(!K(l,u.index+1)){l.ch=u.index+1;continue}return l.ch=u.index+u[0].length,u}}function c(l){for(;;){var u=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(u==-1){if(I(l))continue;return}if(!K(l,u+1)){l.ch=u;continue}var s=l.text.lastIndexOf("/",u),i=s>-1&&!/\S/.test(l.text.slice(s+1,u));return l.ch=u+1,i?"selfClose":"regular"}}function a(l,u){for(var s=[];;){var i=b(l),D,A=l.line,S=l.ch-(i?i[0].length:0);if(!i||!(D=E(l)))return;if(D=="selfClose")continue;if(i[1]){for(var R=s.length-1;R>=0;--R)if(s[R]==i[2]){s.length=R;break}if(R<0&&(!u||u==i[2]))return{tag:i[2],from:Y(A,S),to:Y(l.line,l.ch)}}else s.push(i[2])}}function p(l,u){for(var s=[];;){var i=c(l);if(!i)return;if(i=="selfClose"){f(l);continue}var D=l.line,A=l.ch,S=f(l);if(!S)return;if(S[1])s.push(S[2]);else{for(var R=s.length-1;R>=0;--R)if(s[R]==S[2]){s.length=R;break}if(R<0&&(!u||u==S[2]))return{tag:S[2],from:Y(l.line,l.ch),to:Y(D,A)}}}}te.registerHelper("fold","xml",function(l,u){for(var s=new G(l,u.line,0);;){var i=b(s);if(!i||s.line!=u.line)return;var D=E(s);if(!D)return;if(!i[1]&&D!="selfClose"){var A=Y(s.line,s.ch),S=a(s,i[2]);return S&&N(S.from,A)>0?{from:A,to:S.from}:null}}}),te.findMatchingTag=function(l,u,s){var i=new G(l,u.line,u.ch,s);if(i.text.indexOf(">")==-1&&i.text.indexOf("<")==-1)return;var D=E(i),A=D&&Y(i.line,i.ch),S=D&&f(i);if(!D||!S||N(i,u)>0)return;var R={from:Y(i.line,i.ch),to:A,tag:S[2]};return D=="selfClose"?{open:R,close:null,at:"open"}:S[1]?{open:p(i,S[2]),close:R,at:"close"}:(i=new G(l,A.line,A.ch,s),{open:R,close:a(i,S[2]),at:"open"})},te.findEnclosingTag=function(l,u,s,i){for(var D=new G(l,u.line,u.ch,s);;){var A=p(D,i);if(!A)break;var S=new G(l,u.line,u.ch,s),R=a(S,A.tag);if(R)return{open:A,close:R}}},te.scanForClosingTag=function(l,u,s,i){var D=new G(l,u.line,u.ch,i?{from:0,to:i}:null);return a(D,s)}})},p5ED:function(ct,ge,U){"use strict";var te=U("+L6B"),Y=U("2/Rp"),N=U("5Dmo"),z=U("3S7+"),P=U("k1fw"),F=U("9og8"),G=U("tJVT"),K=U("WmNS"),n=U.n(K),I=U("q1tI"),E=U.n(I),f=U("vHTk"),b=U.n(f),c=U("yEEn"),a=U("ZW9T"),p=U("1vsH"),l=U("V0Rq"),u=U("m3rI");ge.a=function(s){var i,D,A,S,R,O,g,_=s.editOffice,h=_===void 0?"view":_,d=s.data,C=s.theme,x=s.type,w=s.filename,j=s.monacoEditor,W=s.className,T=s.style,M=s.close,m=s.onClose,v=s.hasMask,H=s.disabledDownload,X=Object(I.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),q=Object(G.a)(X,2),re=q[0],ye=q[1],pe=Object(I.useState)(""),ue=Object(G.a)(pe,2),fe=ue[0],be=ue[1],se=Object(I.useState)(),ae=Object(G.a)(se,2),Ce=ae[0],ze=ae[1],Ye=window.ENV==="build"?"/react/build":"",He=u.a.PROXY_SERVER||location.origin,Ve,Fe=1024*1024,Ke=10*Fe,nt=Object(I.useRef)();(i=d)!==null&&i!==void 0&&i.startsWith("/api")&&x!=="txt"&&(d=u.a.API_SERVER+d),x==="office"&&(Ve=Object(p.T)(d).filesize,Ve>Ke&&(x="other")),w&&j&&(j.filename=w),Object(I.useEffect)(function(){var Ue,rt,lt=(Ue=document.cookie)===null||Ue===void 0||((rt=Ue.replace(/\s/g,""))===null||rt===void 0)?void 0:rt.split(";");lt==null||lt.map(function(ft){var at=ft.split("=");at[0]==="_educoder_session"&&be(at[1])})},[]),Object(I.useEffect)(function(){x==="office"&&de()},[x,d]);var de=function(){var Ue=Object(F.a)(n.a.mark(function rt(){var lt,ft,at;return n.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return console.log("data:",d),lt=d,d.startsWith("http")||(lt=location.origin+lt),ft=new URL(lt).pathname.split("/").pop(),gt.next=6,Object(l.W)({attachment_id:ft});case 6:at=gt.sent,ze(at);case 8:case"end":return gt.stop()}},rt)}));return function(){return Ue.apply(this,arguments)}}(),De=function(){if(d.startsWith("http")||d.startsWith("blob:")){Ne();return}Object(p.z)(w||"educoder",d,w)},Ne=function(){Object(p.x)(w||"educoder",decodeURIComponent(d))};return E.a.createElement("div",{style:Object(P.a)({},T||{}),className:"".concat(v&&b.a.bgBlack," ").concat(x?b.a.wrp:"hide")},M&&E.a.createElement("div",{className:b.a.close,ref:nt},!H&&E.a.createElement(z.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return nt.current}},E.a.createElement("span",{onClick:Ne},E.a.createElement("i",{className:"icon-quxiaozhiding"}))),E.a.createElement(z.a,{title:"\u5173\u95ED",getPopupContainer:function(){return nt.current}},E.a.createElement("span",{className:"",onClick:m},E.a.createElement("i",{className:"icon-guanbi1"})))),E.a.createElement("div",{className:"".concat(b.a[W]," ").concat(W," ").concat(b.a.monaco," ").concat(x==="txt"?"show":"hide")},x==="txt"&&E.a.createElement(a.b,j)),x==="audio"&&E.a.createElement("audio",{src:"".concat(((D=d)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((A=d)===null||A===void 0?void 0:A.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(d),autoPlay:!0}),x==="video"&&E.a.createElement(E.a.Fragment,null,((S=d)===null||S===void 0?void 0:S.indexOf("http"))>-1?E.a.createElement("video",{controls:!0,src:"".concat(d),autoPlay:!0}):E.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(d),autoPlay:!0})),x==="office"&&Ce&&E.a.createElement("iframe",{src:"".concat(Ye,"/office.html?key=").concat(Ce.key,"&url=").concat(He+Ce.url,"&callbackUrl=").concat(He+Ce.callbackUrl,"&fileType=").concat(Ce.fileType,"&title=").concat(Ce.title,"&model=").concat(h,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!H)}),x==="html"&&E.a.createElement("iframe",{src:d+"&disposition=inline"}),x==="pdf"&&E.a.createElement("iframe",{src:"".concat(Ye,"/js/pdfview/index.html?url=").concat(d,"&disabledDownload=").concat(!!H)}),x==="image"&&E.a.createElement("img",{src:"".concat(((R=d)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((O=d)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(g=d)!==null&&g!==void 0&&g.startsWith("/api")?"":"data:image/png;base64,").concat(d)}),x==="other"&&E.a.createElement("div",null,E.a.createElement(Y.a,{type:"primary",size:"large",onClick:De},E.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),x==="download"&&E.a.createElement(Y.a,{type:"primary",size:"large",onClick:De},E.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ct,ge,U){},pmY6:function(ct,ge,U){"use strict";U.d(ge,"h",function(){return I}),U.d(ge,"g",function(){return f}),U.d(ge,"f",function(){return b}),U.d(ge,"e",function(){return c}),U.d(ge,"i",function(){return a}),U.d(ge,"b",function(){return p}),U.d(ge,"a",function(){return l}),U.d(ge,"d",function(){return u}),U.d(ge,"c",function(){return s});var te=U("C/vA"),Y=U("JYp7");const N=!1;let z=null;function P(i){z=i}if(N){const i="__is_disposable_tracked__";P(new class{trackDisposable(D){const A=new Error("Potentially leaked disposable").stack;setTimeout(()=>{D[i]||console.log(A)},3e3)}setParent(D,A){if(D&&D!==l.None)try{D[i]=!0}catch(S){}}markAsDisposed(D){if(D&&D!==l.None)try{D[i]=!0}catch(A){}}markAsSingleton(D){}})}function F(i){return z==null||z.trackDisposable(i),i}function G(i){z==null||z.markAsDisposed(i)}function K(i,D){z==null||z.setParent(i,D)}function n(i,D){if(!z)return;for(const A of i)z.setParent(A,D)}function I(i){return z==null||z.markAsSingleton(i),i}class E extends Error{constructor(i){super(`Encountered errors while disposing of store. Errors: [${i.join(", ")}]`);this.errors=i}}function f(i){return typeof i.dispose=="function"&&i.dispose.length===0}function b(i){if(Y.a.is(i)){let D=[];for(const A of i)if(A)try{A.dispose()}catch(S){D.push(S)}if(D.length===1)throw D[0];if(D.length>1)throw new E(D);return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function c(...i){const D=a(()=>b(i));return n(i,D),D}function a(i){const D=F({dispose:Object(te.a)(()=>{G(D),i()})});return D}class p{constructor(){this._toDispose=new Set,this._isDisposed=!1,F(this)}dispose(){if(this._isDisposed)return;G(this),this._isDisposed=!0,this.clear()}clear(){try{b(this._toDispose.values())}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return K(i,this),this._isDisposed?p.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(i),i}}p.DISABLE_DISPOSED_WARNING=!1;class l{constructor(){this._store=new p,F(this),K(this._store,this)}dispose(){G(this),this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}}l.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,F(this)}get value(){return this._isDisposed?void 0:this._value}set value(i){var D;if(this._isDisposed||i===this._value)return;(D=this._value)===null||D===void 0||D.dispose(),i&&K(i,this),this._value=i}clear(){this.value=void 0}dispose(){var i;this._isDisposed=!0,G(this),(i=this._value)===null||i===void 0||i.dispose(),this._value=void 0}clearAndLeak(){const i=this._value;return this._value=void 0,i&&K(i,null),i}}class s{constructor(i){this.object=i}dispose(){}}},psGv:function(ct,ge,U){var te,Y;(function(){var N;(function(){"use strict";var G=[,,function(E){function f(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=[]}f.prototype.clone_empty=function(){var a=new f(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},f.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},f.prototype.has_match=function(a){for(var p=this.__items.length-1;p>=0;p--)if(this.__items[p].match(a))return!0;return!1},f.prototype.set_indent=function(a,p){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=p||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},f.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)},f.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},f.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},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(a){this.__items.push(a);var p=a.lastIndexOf(`
`);p!==-1?this.__character_count=a.length-p:this.__character_count+=a.length},f.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.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 b(a,p){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)),p=p||"",a.indent_level>0&&(p=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=p,this.__base_string_length=p.length}b.prototype.get_indent_size=function(a,p){var l=this.__base_string_length;return p=p||0,a<0&&(l=0),l+=a*this.__indent_size,l+=p,l},b.prototype.get_indent_string=function(a,p){var l=this.__base_string;return p=p||0,a<0&&(a=0,l=""),p+=a*this.__indent_size,this.__ensure_cache(p),l+=this.__cache[p],l},b.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var a=this.__cache.length,p=0,l="";this.__indent_size&&a>=this.__indent_size&&(p=Math.floor(a/this.__indent_size),a-=p*this.__indent_size,l=new Array(p+1).join(this.__indent_string)),a&&(l+=new Array(a+1).join(" ")),this.__cache.push(l)};function c(a,p){this.__indent_cache=new b(a,p),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 f(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(a,p){return this.__indent_cache.get_indent_string(a,p)},c.prototype.get_indent_size=function(a,p){return this.__indent_cache.get_indent_size(a,p)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(a){return this.is_empty()||!a&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(a){this.trim(!0);var p=this.current_line.pop();p&&(p[p.length-1]===`
`&&(p=p.replace(/\n+$/g,"")),this.current_line.push(p)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
`);return a!==`
`&&(l=l.replace(/[\n]/g,a)),l},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(a,p){return a=a||0,p=p||0,this.next_line.set_indent(a,p),this.__lines.length>1?(this.current_line.set_indent(a,p),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(a){for(var p=0;p<a.newlines;p++)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},c.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()},c.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(" "))},c.prototype.remove_indent=function(a){for(var p=this.__lines.length;a<p;)this.__lines[a]._remove_indent(),a++;this.current_line._remove_wrap_indent()},c.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},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(a,p){for(var l=this.__lines.length-2;l>=0;){var u=this.__lines[l];if(u.is_empty())break;if(u.item(0).indexOf(a)!==0&&u.item(-1)!==p){this.__lines.splice(l+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},E.exports.Output=c},function(E){function f(b,c,a,p){this.type=b,this.text=c,this.comments_before=null,this.newlines=a||0,this.whitespace_before=p||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}E.exports.Token=f},,,function(E){function f(a,p){this.raw_options=b(a,p),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"])}f.prototype._get_array=function(a,p){var l=this.raw_options[a],u=p||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(u=l.concat()):typeof l=="string"&&(u=l.split(/[^a-zA-Z0-9_\/\-]+/)),u},f.prototype._get_boolean=function(a,p){var l=this.raw_options[a],u=l===void 0?!!p:!!l;return u},f.prototype._get_characters=function(a,p){var l=this.raw_options[a],u=p||"";return typeof l=="string"&&(u=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},f.prototype._get_number=function(a,p){var l=this.raw_options[a];p=parseInt(p,10),isNaN(p)&&(p=0);var u=parseInt(l,10);return isNaN(u)&&(u=p),u},f.prototype._get_selection=function(a,p,l){var u=this._get_selection_list(a,p,l);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
`+p+`
You passed in: '`+this.raw_options[a]+"'");return u[0]},f.prototype._get_selection_list=function(a,p,l){if(!p||p.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[p[0]],!this._is_valid_selection(l,p))throw new Error("Invalid Default Value!");var u=this._get_array(a,l);if(!this._is_valid_selection(u,p))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
`+p+`
You passed in: '`+this.raw_options[a]+"'");return u},f.prototype._is_valid_selection=function(a,p){return a.length&&p.length&&!a.some(function(l){return p.indexOf(l)===-1})};function b(a,p){var l={};a=c(a);var u;for(u in a)u!==p&&(l[u]=a[u]);if(p&&a[p])for(u in a[p])l[u]=a[p][u];return l}function c(a){var p={},l;for(l in a){var u=l.replace(/-/g,"_");p[u]=a[l]}return p}E.exports.Options=f,E.exports.normalizeOpts=c,E.exports.mergeOpts=b},,function(E){var f=RegExp.prototype.hasOwnProperty("sticky");function b(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},b.prototype.peek=function(c){var a=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(a=this.__input.charAt(c)),a},b.prototype.__match=function(c,a){c.lastIndex=a;var p=c.exec(this.__input);return p&&!(f&&c.sticky)&&(p.index!==a&&(p=null)),p},b.prototype.test=function(c,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(c,a):!1},b.prototype.testChar=function(c,a){var p=this.peek(a);return c.lastIndex=0,p!==null&&c.test(p)},b.prototype.match=function(c){var a=this.__match(c,this.__position);return a?this.__position+=a[0].length:a=null,a},b.prototype.read=function(c,a,p){var l="",u;return c&&(u=this.match(c),u&&(l+=u[0])),a&&(u||!c)&&(l+=this.readUntil(a,p)),l},b.prototype.readUntil=function(c,a){var p="",l=this.__position;c.lastIndex=this.__position;var u=c.exec(this.__input);return u?(l=u.index,a&&(l+=u[0].length)):l=this.__input_length,p=this.__input.substring(this.__position,l),this.__position=l,p},b.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},b.prototype.get_regexp=function(c,a){var p=null,l="g";return a&&f&&(l="y"),typeof c=="string"&&c!==""?p=new RegExp(c,l):c&&(p=new RegExp(c.source,l)),p},b.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(c){var a=this.__position,p=this.readUntilAfter(c);return this.__position=a,p},b.prototype.lookBack=function(c){var a=this.__position-1;return a>=c.length&&this.__input.substring(a-c.length,a).toLowerCase()===c},E.exports.InputScanner=b},function(E,f,b){var c=b(8).InputScanner,a=b(3).Token,p=b(10).TokenStream,l=b(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(i,D){this._input=new c(i),this._options=D||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new p,this._reset();for(var i,D=new a(u.START,""),A=null,S=[],R=new p;D.type!==u.EOF;){for(i=this._get_next_token(D,A);this._is_comment(i);)R.add(i),i=this._get_next_token(D,A);R.isEmpty()||(i.comments_before=R,R=new p),i.parent=A,this._is_opening(i)?(S.push(A),A=i):A&&this._is_closing(i,A)&&(i.opened=A,A.closed=i,A=S.pop(),i.parent=A),i.previous=D,D.next=i,this.__tokens.add(i),D=i}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(i,D){this._readWhitespace();var A=this._input.read(/.+/g);return A?this._create_token(u.RAW,A):this._create_token(u.EOF,"")},s.prototype._is_comment=function(i){return!1},s.prototype._is_opening=function(i){return!1},s.prototype._is_closing=function(i,D){return!1},s.prototype._create_token=function(i,D){var A=new a(i,D,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return A},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},E.exports.Tokenizer=s,E.exports.TOKEN=u},function(E){function f(b){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=b}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position<this.__tokens_length},f.prototype.next=function(){var b=null;return this.hasNext()&&(b=this.__tokens[this.__position],this.__position+=1),b},f.prototype.peek=function(b){var c=null;return b=b||0,b+=this.__position,b>=0&&b<this.__tokens_length&&(c=this.__tokens[b]),c},f.prototype.add=function(b){this.__parent_token&&(b.parent=this.__parent_token),this.__tokens.push(b),this.__tokens_length+=1},E.exports.TokenStream=f},function(E,f,b){var c=b(12).Pattern;function a(p,l){c.call(this,p,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}a.prototype=new c,a.prototype.__set_whitespace_patterns=function(p,l){p+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+p+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},a.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var p=this._input.read(this._match_pattern);if(p===" ")this.whitespace_before_token=" ";else if(p){var l=this.__split(this._newline_regexp,p);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return p},a.prototype.matching=function(p,l){var u=this._create();return u.__set_whitespace_patterns(p,l),u._update(),u},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(p,l){p.lastIndex=0;for(var u=0,s=[],i=p.exec(l);i;)s.push(l.substring(u,i.index)),u=i.index+i[0].length,i=p.exec(l);return u<l.length?s.push(l.substring(u,l.length)):s.push(""),s},E.exports.WhitespacePattern=a},function(E){function f(b,c){this._input=b,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,c&&(this._starting_pattern=this._input.get_regexp(c._starting_pattern,!0),this._match_pattern=this._input.get_regexp(c._match_pattern,!0),this._until_pattern=this._input.get_regexp(c._until_pattern),this._until_after=c._until_after)}f.prototype.read=function(){var b=this._input.read(this._starting_pattern);return(!this._starting_pattern||b)&&(b+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),b},f.prototype.read_match=function(){return this._input.match(this._match_pattern)},f.prototype.until_after=function(b){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(b),c._update(),c},f.prototype.until=function(b){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(b),c._update(),c},f.prototype.starting_with=function(b){var c=this._create();return c._starting_pattern=this._input.get_regexp(b,!0),c._update(),c},f.prototype.matching=function(b){var c=this._create();return c._match_pattern=this._input.get_regexp(b,!0),c._update(),c},f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){},E.exports.Pattern=f},function(E){function f(b,c){b=typeof b=="string"?b:b.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+c,"g")}f.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(b);a;)c[a[1]]=a[2],a=this.__directive_pattern.exec(b);return c},f.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},E.exports.Directives=f},function(E,f,b){var c=b(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function p(l,u){c.call(this,l,u),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var s=new c(l);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}p.prototype=new c,p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){this.__set_templated_pattern()},p.prototype.disable=function(l){var u=this._create();return u._disabled[l]=!0,u._update(),u},p.prototype.read_options=function(l){var u=this._create();for(var s in a)u._disabled[s]=l.templating.indexOf(s)===-1;return u._update(),u},p.prototype.exclude=function(l){var u=this._create();return u._excluded[l]=!0,u._update(),u},p.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),l+=u,u=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},p.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},p.prototype._read_template=function(){var l="",u=this._input.peek();if(u==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(l=l||this.__patterns.erb.read())}else u==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},E.exports.TemplatablePattern=p},,,,function(E,f,b){var c=b(19).Beautifier,a=b(20).Options;function p(l,u,s,i){var D=new c(l,u,s,i);return D.beautify()}E.exports=p,E.exports.defaultOptions=function(){return new a}},function(E,f,b){var c=b(20).Options,a=b(2).Output,p=b(21).Tokenizer,l=b(21).TOKEN,u=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,i=function(C,x){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=C.max_preserve_newlines,this.preserve_newlines=C.preserve_newlines,this._output=new a(C,x)};i.prototype.current_line_has_match=function(C){return this._output.current_line.has_match(C)},i.prototype.set_space_before_token=function(C,x){this._output.space_before_token=C,this._output.non_breaking_space=x},i.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},i.prototype.add_raw_token=function(C){this._output.add_raw_token(C)},i.prototype.print_preserved_newlines=function(C){var x=0;C.type!==l.TEXT&&C.previous.type!==l.TEXT&&(x=C.newlines?1:0),this.preserve_newlines&&(x=C.newlines<this.max_preserve_newlines+1?C.newlines:this.max_preserve_newlines+1);for(var w=0;w<x;w++)this.print_newline(w>0);return x!==0},i.prototype.traverse_whitespace=function(C){return C.whitespace_before||C.newlines?(this.print_preserved_newlines(C)||(this._output.space_before_token=!0),!0):!1},i.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},i.prototype.print_newline=function(C){this._output.add_new_line(C)},i.prototype.print_token=function(C){C.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(C.text))},i.prototype.indent=function(){this.indent_level++},i.prototype.get_full_indent=function(C){return C=this.indent_level+(C||0),C<1?"":this._output.get_indent_string(C)};var D=function(C){for(var x=null,w=C.next;w.type!==l.EOF&&C.closed!==w;){if(w.type===l.ATTRIBUTE&&w.text==="type"){w.next&&w.next.type===l.EQUALS&&w.next.next&&w.next.next.type===l.VALUE&&(x=w.next.next.text);break}w=w.next}return x},A=function(C,x){var w=null,j=null;return x.closed?(C==="script"?w="text/javascript":C==="style"&&(w="text/css"),w=D(x)||w,w.search("text/css")>-1?j="css":w.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?j="javascript":w.search(/(text|application|dojo)\/(x-)?(html)/)>-1?j="html":w.search(/test\/null/)>-1&&(j="null"),j):null};function S(C,x){return x.indexOf(C)!==-1}function R(C,x,w){this.parent=C||null,this.tag=x?x.tag_name:"",this.indent_level=w||0,this.parser_token=x||null}function O(C){this._printer=C,this._current_frame=null}O.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},O.prototype.record_tag=function(C){var x=new R(this._current_frame,C,this._printer.indent_level);this._current_frame=x},O.prototype._try_pop_frame=function(C){var x=null;return C&&(x=C.parser_token,this._printer.indent_level=C.indent_level,this._current_frame=C.parent),x},O.prototype._get_frame=function(C,x){for(var w=this._current_frame;w&&!(C.indexOf(w.tag)!==-1);){if(x&&x.indexOf(w.tag)!==-1){w=null;break}w=w.parent}return w},O.prototype.try_pop=function(C,x){var w=this._get_frame([C],x);return this._try_pop_frame(w)},O.prototype.indent_to_tag=function(C){var x=this._get_frame(C);x&&(this._printer.indent_level=x.indent_level)};function g(C,x,w,j){this._source_text=C||"",x=x||{},this._js_beautify=w,this._css_beautify=j,this._tag_stack=null;var W=new c(x,"html");this._options=W,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"}g.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,x=this._options.eol;this._options.eol==="auto"&&(x=`
`,C&&u.test(C)&&(x=C.match(u)[0])),C=C.replace(s,`
`);var w=C.match(/^[\t ]*/)[0],j={text:"",type:""},W=new _,T=new i(this._options,w),M=new p(C,this._options).tokenize();this._tag_stack=new O(T);for(var m=null,v=M.next();v.type!==l.EOF;)v.type===l.TAG_OPEN||v.type===l.COMMENT?(m=this._handle_tag_open(T,v,W,j),W=m):v.type===l.ATTRIBUTE||v.type===l.EQUALS||v.type===l.VALUE||v.type===l.TEXT&&!W.tag_complete?m=this._handle_inside_tag(T,v,W,M):v.type===l.TAG_CLOSE?m=this._handle_tag_close(T,v,W):v.type===l.TEXT?m=this._handle_text(T,v,W):T.add_raw_token(v),j=m,v=M.next();var H=T._output.get_code(x);return H},g.prototype._handle_tag_close=function(C,x,w){var j={text:x.text,type:x.type};return C.alignment_size=0,w.tag_complete=!0,C.set_space_before_token(x.newlines||x.whitespace_before!=="",!0),w.is_unformatted?C.add_raw_token(x):(w.tag_start_char==="<"&&(C.set_space_before_token(x.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&w.has_wrapped_attrs&&C.print_newline(!1)),C.print_token(x)),w.indent_content&&!(w.is_unformatted||w.is_content_unformatted)&&(C.indent(),w.indent_content=!1),!w.is_inline_element&&!(w.is_unformatted||w.is_content_unformatted)&&C.set_wrap_point(),j},g.prototype._handle_inside_tag=function(C,x,w,j){var W=w.has_wrapped_attrs,T={text:x.text,type:x.type};if(C.set_space_before_token(x.newlines||x.whitespace_before!=="",!0),w.is_unformatted)C.add_raw_token(x);else if(w.tag_start_char==="{"&&x.type===l.TEXT)C.print_preserved_newlines(x)?(x.newlines=0,C.add_raw_token(x)):C.print_token(x);else{if(x.type===l.ATTRIBUTE?(C.set_space_before_token(!0),w.attr_count+=1):(x.type===l.EQUALS||x.type===l.VALUE&&x.previous.type===l.EQUALS)&&C.set_space_before_token(!1),x.type===l.ATTRIBUTE&&w.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(C.traverse_whitespace(x),W=W||x.newlines!==0),this._is_wrap_attributes_force)){var M=w.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&w.attr_count===1){var m=!0,v=0,H;do{if(H=j.peek(v),H.type===l.ATTRIBUTE){m=!1;break}v+=1}while(v<4&&H.type!==l.EOF&&H.type!==l.TAG_CLOSE);M=!m}M&&(C.print_newline(!1),W=!0)}C.print_token(x),W=W||C.previous_token_wrapped(),w.has_wrapped_attrs=W}return T},g.prototype._handle_text=function(C,x,w){var j={text:x.text,type:"TK_CONTENT"};return w.custom_beautifier_name?this._print_custom_beatifier_text(C,x,w):w.is_unformatted||w.is_content_unformatted?C.add_raw_token(x):(C.traverse_whitespace(x),C.print_token(x)),j},g.prototype._print_custom_beatifier_text=function(C,x,w){var j=this;if(x.text!==""){var W=x.text,T,M=1,m="",v="";w.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?T=this._js_beautify:w.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?T=this._css_beautify:w.custom_beautifier_name==="html"&&(T=function(pe,ue){var fe=new g(pe,ue,j._js_beautify,j._css_beautify);return fe.beautify()}),this._options.indent_scripts==="keep"?M=0:this._options.indent_scripts==="separate"&&(M=-C.indent_level);var H=C.get_full_indent(M);if(W=W.replace(/\n[ \t]*$/,""),w.custom_beautifier_name!=="html"&&W[0]==="<"&&W.match(/^(<!--|<!\[CDATA\[)/)){var X=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(W);if(!X){C.add_raw_token(x);return}m=H+X[1]+`
`,W=X[4],X[5]&&(v=H+X[5]),W=W.replace(/\n[ \t]*$/,""),(X[2]||X[3].indexOf(`
`)!==-1)&&(X=X[3].match(/[ \t]+$/),X&&(x.whitespace_before=X[0]))}if(W)if(T){var q=function(){this.eol=`
`};q.prototype=this._options.raw_options;var re=new q;W=T(H+W,re)}else{var ye=x.whitespace_before;ye&&(W=W.replace(new RegExp(`
(`+ye+")?","g"),`
`)),W=H+W.replace(/\n/g,`
`+H)}m&&(W?W=m+W+`
`+v:W=m+v),C.print_newline(!1),W&&(x.text=W,x.whitespace_before="",x.newlines=0,C.add_raw_token(x),C.print_newline(!0))}},g.prototype._handle_tag_open=function(C,x,w,j){var W=this._get_tag_open_token(x);return(w.is_unformatted||w.is_content_unformatted)&&!w.is_empty_element&&x.type===l.TAG_OPEN&&x.text.indexOf("</")===0?(C.add_raw_token(x),W.start_tag_token=this._tag_stack.try_pop(W.tag_name)):(C.traverse_whitespace(x),this._set_tag_position(C,x,W,w,j),W.is_inline_element||C.set_wrap_point(),C.print_token(x)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(W.alignment_size=x.text.length+1),!W.tag_complete&&!W.is_unformatted&&(C.alignment_size=W.alignment_size),W};var _=function(C,x){if(this.parent=C||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="",!x)this.tag_complete=!0;else{var w;this.tag_start_char=x.text[0],this.text=x.text,this.tag_start_char==="<"?(w=x.text.match(/^<([^\s>]*)/),this.tag_check=w?w[1]:""):(w=x.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=w?w[1]:"",(x.text.startsWith("{{#>")||x.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&x.next!==null?this.tag_check=x.next.text.split(" ")[0]:this.tag_check=x.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),x.type===l.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||x.closed&&x.closed.text==="/>";var j=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(j=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(j)))}};g.prototype._get_tag_open_token=function(C){var x=new _(this._tag_stack.get_parser_token(),C);return x.alignment_size=this._options.wrap_attributes_indent_size,x.is_end_tag=x.is_end_tag||S(x.tag_check,this._options.void_elements),x.is_empty_element=x.tag_complete||x.is_start_tag&&x.is_end_tag,x.is_unformatted=!x.tag_complete&&S(x.tag_check,this._options.unformatted),x.is_content_unformatted=!x.is_empty_element&&S(x.tag_check,this._options.content_unformatted),x.is_inline_element=S(x.tag_name,this._options.inline)||x.tag_name.includes("-")||x.tag_start_char==="{",x},g.prototype._set_tag_position=function(C,x,w,j,W){if(w.is_empty_element||(w.is_end_tag?w.start_tag_token=this._tag_stack.try_pop(w.tag_name):(this._do_optional_end_element(w)&&(w.is_inline_element||C.print_newline(!1)),this._tag_stack.record_tag(w),(w.tag_name==="script"||w.tag_name==="style")&&!(w.is_unformatted||w.is_content_unformatted)&&(w.custom_beautifier_name=A(w.tag_check,x)))),S(w.tag_check,this._options.extra_liners)&&(C.print_newline(!1),C._output.just_added_blankline()||C.print_newline(!0)),w.is_empty_element){if(w.tag_start_char==="{"&&w.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),w.indent_content=!0;var T=C.current_line_has_match(/{{#if/);T||C.print_newline(!1)}w.tag_name==="!--"&&W.type===l.TAG_CLOSE&&j.is_end_tag&&w.text.indexOf(`
`)===-1||(w.is_inline_element||w.is_unformatted||C.print_newline(!1),this._calcluate_parent_multiline(C,w))}else if(w.is_end_tag){var M=!1;M=w.start_tag_token&&w.start_tag_token.multiline_content,M=M||!w.is_inline_element&&!(j.is_inline_element||j.is_unformatted)&&!(W.type===l.TAG_CLOSE&&w.start_tag_token===j)&&W.type!=="TK_CONTENT",(w.is_content_unformatted||w.is_unformatted)&&(M=!1),M&&C.print_newline(!1)}else w.indent_content=!w.custom_beautifier_name,w.tag_start_char==="<"&&(w.tag_name==="html"?w.indent_content=this._options.indent_inner_html:w.tag_name==="head"?w.indent_content=this._options.indent_head_inner_html:w.tag_name==="body"&&(w.indent_content=this._options.indent_body_inner_html)),!(w.is_inline_element||w.is_unformatted)&&(W.type!=="TK_CONTENT"||w.is_content_unformatted)&&C.print_newline(!1),this._calcluate_parent_multiline(C,w)},g.prototype._calcluate_parent_multiline=function(C,x){x.parent&&C._output.just_added_newline()&&!((x.is_inline_element||x.is_unformatted)&&x.parent.is_inline_element)&&(x.parent.multiline_content=!0)};var h=["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"],d=["a","audio","del","ins","map","noscript","video"];g.prototype._do_optional_end_element=function(C){var x=null;if(C.is_empty_element||!C.is_start_tag||!C.parent)return;if(C.tag_name==="body")x=x||this._tag_stack.try_pop("head");else if(C.tag_name==="li")x=x||this._tag_stack.try_pop("li",["ol","ul"]);else if(C.tag_name==="dd"||C.tag_name==="dt")x=x||this._tag_stack.try_pop("dt",["dl"]),x=x||this._tag_stack.try_pop("dd",["dl"]);else if(C.parent.tag_name==="p"&&h.indexOf(C.tag_name)!==-1){var w=C.parent.parent;(!w||d.indexOf(w.tag_name)===-1)&&(x=x||this._tag_stack.try_pop("p"))}else C.tag_name==="rp"||C.tag_name==="rt"?(x=x||this._tag_stack.try_pop("rt",["ruby","rtc"]),x=x||this._tag_stack.try_pop("rp",["ruby","rtc"])):C.tag_name==="optgroup"?x=x||this._tag_stack.try_pop("optgroup",["select"]):C.tag_name==="option"?x=x||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):C.tag_name==="colgroup"?x=x||this._tag_stack.try_pop("caption",["table"]):C.tag_name==="thead"?(x=x||this._tag_stack.try_pop("caption",["table"]),x=x||this._tag_stack.try_pop("colgroup",["table"])):C.tag_name==="tbody"||C.tag_name==="tfoot"?(x=x||this._tag_stack.try_pop("caption",["table"]),x=x||this._tag_stack.try_pop("colgroup",["table"]),x=x||this._tag_stack.try_pop("thead",["table"]),x=x||this._tag_stack.try_pop("tbody",["table"])):C.tag_name==="tr"?(x=x||this._tag_stack.try_pop("caption",["table"]),x=x||this._tag_stack.try_pop("colgroup",["table"]),x=x||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(C.tag_name==="th"||C.tag_name==="td")&&(x=x||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),x=x||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return C.parent=this._tag_stack.get_parser_token(),x},E.exports.Beautifier=g},function(E,f,b){var c=b(6).Options;function a(p){c.call(this,p,"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 c,E.exports.Options=a},function(E,f,b){var c=b(9).Tokenizer,a=b(9).TOKEN,p=b(13).Directives,l=b(14).TemplatablePattern,u=b(12).Pattern,s={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:a.START,RAW:a.RAW,EOF:a.EOF},i=new p(/<\!--/,/-->/),D=function(A,S){c.call(this,A,S),this._current_tag_name="";var R=new l(this._input).read_options(this._options),O=new u(this._input);if(this.__patterns={word:R.until(/[\n\r\t <]/),single_quote:R.until_after(/'/),double_quote:R.until_after(/"/),attribute:R.until(/[\n\r\t =>]|\/>/),element_name:R.until(/[\n\r\t >\/]/),handlebars_comment:O.starting_with(/{{!--/).until_after(/--}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),handlebars_open:O.until(/[\n\r\t }]/),handlebars_raw_close:O.until(/}}/),comment:O.starting_with(/<!--/).until_after(/-->/),cdata:O.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:O.starting_with(/<!\[/).until_after(/]>/),processing:O.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var g=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(g).until_after(g)}};D.prototype=new c,D.prototype._is_comment=function(A){return!1},D.prototype._is_opening=function(A){return A.type===s.TAG_OPEN},D.prototype._is_closing=function(A,S){return A.type===s.TAG_CLOSE&&S&&((A.text===">"||A.text==="/>")&&S.text[0]==="<"||A.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},D.prototype._reset=function(){this._current_tag_name=""},D.prototype._get_next_token=function(A,S){var R=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(s.EOF,""):(R=R||this._read_open_handlebars(O,S),R=R||this._read_attribute(O,A,S),R=R||this._read_close(O,S),R=R||this._read_raw_content(O,A,S),R=R||this._read_content_word(O),R=R||this._read_comment_or_cdata(O),R=R||this._read_processing(O),R=R||this._read_open(O,S),R=R||this._create_token(s.UNKNOWN,this._input.next()),R)},D.prototype._read_comment_or_cdata=function(A){var S=null,R=null,O=null;if(A==="<"){var g=this._input.peek(1);g==="!"&&(R=this.__patterns.comment.read(),R?(O=i.get_directives(R),O&&O.ignore==="start"&&(R+=i.readIgnored(this._input))):R=this.__patterns.cdata.read()),R&&(S=this._create_token(s.COMMENT,R),S.directives=O)}return S},D.prototype._read_processing=function(A){var S=null,R=null,O=null;if(A==="<"){var g=this._input.peek(1);(g==="!"||g==="?")&&(R=this.__patterns.conditional_comment.read(),R=R||this.__patterns.processing.read()),R&&(S=this._create_token(s.COMMENT,R),S.directives=O)}return S},D.prototype._read_open=function(A,S){var R=null,O=null;return S||A==="<"&&(R=this._input.next(),this._input.peek()==="/"&&(R+=this._input.next()),R+=this.__patterns.element_name.read(),O=this._create_token(s.TAG_OPEN,R)),O},D.prototype._read_open_handlebars=function(A,S){var R=null,O=null;return S||this._options.indent_handlebars&&A==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(R=this.__patterns.handlebars_comment.read(),R=R||this.__patterns.handlebars.read(),O=this._create_token(s.COMMENT,R)):(R=this.__patterns.handlebars_open.read(),O=this._create_token(s.TAG_OPEN,R))),O},D.prototype._read_close=function(A,S){var R=null,O=null;return S&&(S.text[0]==="<"&&(A===">"||A==="/"&&this._input.peek(1)===">")?(R=this._input.next(),A==="/"&&(R+=this._input.next()),O=this._create_token(s.TAG_CLOSE,R)):S.text[0]==="{"&&A==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(s.TAG_CLOSE,"}}"))),O},D.prototype._read_attribute=function(A,S,R){var O=null,g="";if(R&&R.text[0]==="<")if(A==="=")O=this._create_token(s.EQUALS,this._input.next());else if(A==='"'||A==="'"){var _=this._input.next();A==='"'?_+=this.__patterns.double_quote.read():_+=this.__patterns.single_quote.read(),O=this._create_token(s.VALUE,_)}else g=this.__patterns.attribute.read(),g&&(S.type===s.EQUALS?O=this._create_token(s.VALUE,g):O=this._create_token(s.ATTRIBUTE,g));return O},D.prototype._is_content_unformatted=function(A){return this._options.void_elements.indexOf(A)===-1&&(this._options.content_unformatted.indexOf(A)!==-1||this._options.unformatted.indexOf(A)!==-1)},D.prototype._read_raw_content=function(A,S,R){var O="";if(R&&R.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(S.type===s.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var g=S.opened.text.substr(1).toLowerCase();if(g==="script"||g==="style"){var _=this._read_comment_or_cdata(A);if(_)return _.type=s.TEXT,_;O=this._input.readUntil(new RegExp("</"+g+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(g)&&(O=this._input.readUntil(new RegExp("</"+g+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(s.TEXT,O):null},D.prototype._read_content_word=function(A){var S="";if(this._options.unformatted_content_delimiter&&(A===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(s.TEXT,S)},E.exports.Tokenizer=D,E.exports.TOKEN=s}],K={};function n(E){var f=K[E];if(f!==void 0)return f.exports;var b=K[E]={exports:{}};return G[E](b,b.exports,n),b.exports}var I=n(18);N=I})();var z=N;if(!0)!(te=[U,U("6UM0"),U("TXwP")],Y=function(G){var K=U("6UM0"),n=U("TXwP");return{html_beautify:function(I,E){return z(I,E,K.js_beautify,n.css_beautify)}}}.apply(ge,te),Y!==void 0&&(ct.exports=Y));else var P,F})()},"rAM+":function(ct,ge,U){"use strict";U.d(ge,"a",function(){return Y});var te=U("Qw5x");function Y(N,z){var P;if(typeof Symbol=="undefined"||N[Symbol.iterator]==null){if(Array.isArray(N)||(P=Object(te.a)(N))||z&&N&&typeof N.length=="number"){P&&(N=P);var F=0,G=function(){};return{s:G,n:function(){return F>=N.length?{done:!0}:{done:!1,value:N[F++]}},e:function(f){throw f},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 K=!0,n=!1,I;return{s:function(){P=N[Symbol.iterator]()},n:function(){var f=P.next();return K=f.done,f},e:function(f){n=!0,I=f},f:function(){try{!K&&P.return!=null&&P.return()}finally{if(n)throw I}}}}},rUJ1:function(ct,ge){const U=/[&<>"']/,te=/[&<>"']/g,Y=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},P=O=>z[O];function F(O,g){if(g){if(U.test(O))return O.replace(te,P)}else if(Y.test(O))return O.replace(N,P);return O}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function K(O){return O.replace(G,(g,_)=>(_=_.toLowerCase(),_==="colon"?":":_.charAt(0)==="#"?_.charAt(1)==="x"?String.fromCharCode(parseInt(_.substring(2),16)):String.fromCharCode(+_.substring(1)):""))}const n=/(^|[^\[])\^/g;function I(O,g){O=O.source||O,g=g||"";const _={replace:(h,d)=>(d=d.source||d,d=d.replace(n,"$1"),O=O.replace(h,d),_),getRegex:()=>new RegExp(O,g)};return _}const E=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(O,g,_){if(O){let h;try{h=decodeURIComponent(K(_)).replace(E,"").toLowerCase()}catch(d){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}g&&!f.test(_)&&(_=u(g,_));try{_=encodeURI(_).replace(/%25/g,"%")}catch(h){return null}return _}const c={},a=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(O,g){c[" "+O]||(a.test(O)?c[" "+O]=O+"/":c[" "+O]=A(O,"/",!0)),O=c[" "+O];const _=O.indexOf(":")===-1;return g.substring(0,2)==="//"?_?g:O.replace(p,"$1")+g:g.charAt(0)==="/"?_?g:O.replace(l,"$1")+g:O+g}const s={exec:function(){}};function i(O){let g=1,_,h;for(;g<arguments.length;g++){_=arguments[g];for(h in _)Object.prototype.hasOwnProperty.call(_,h)&&(O[h]=_[h])}return O}function D(O,g){const _=O.replace(/\|/g,(C,x,w)=>{let j=!1,W=x;for(;--W>=0&&w[W]==="\\";)j=!j;return j?"|":" |"}),h=_.split(/ \|/);let d=0;if(h.length>g)h.splice(g);else for(;h.length<g;)h.push("");for(;d<h.length;d++)h[d]=h[d].trim().replace(/\\\|/g,"|");return h}function A(O,g,_){const h=O.length;if(h===0)return"";let d=0;for(;d<h;){const C=O.charAt(h-d-1);if(C===g&&!_)d++;else if(C!==g&&_)d++;else break}return O.substr(0,h-d)}function S(O,g){if(O.indexOf(g[1])===-1)return-1;const _=O.length;let h=0,d=0;for(;d<_;d++)if(O[d]==="\\")d++;else if(O[d]===g[0])h++;else if(O[d]===g[1]&&(h--,h<0))return d;return-1}function R(O){O&&O.sanitize&&!O.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}ct.exports={escape:F,unescape:K,edit:I,cleanUrl:b,resolveUrl:u,noopTest:s,merge:i,splitCells:D,rtrim:A,findClosingBracket:S,checkSanitizeDeprecation:R}},sboe:function(ct,ge,U){"use strict";U.d(ge,"a",function(){return N});var te=U("q1tI"),Y=U.n(te),N=te.createContext(null)},sesT:function(ct,ge){ct.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAoCAYAAACb3CikAAAAAXNSR0IArs4c6QAABJFJREFUWEftWF1oHFUU/u7MZmazm4Q0tS/RmARSba0tDVazqyB9sVYlDzWRllopErWlER9EFFGRIuqDT0UoQaO0adKkQqui+FKhQmqSQn8o1cbYQH9Iia3QNN387Pwemdmdyd472Z0kRMhD7ssddu4997vnfOc7Z5YRkYwlMNgyECEKyx4RabmEPfL39mdham0EqgIYAEJmDg7xrbfSmZ3BGECUmZ3hPWfnFCB/gbXHP3PXillDf754lQhVsxrKQvIO8jHm/SEUKiQluhYPHb0SAGJdajYzXuBvMKtHGAMRgXlXnqceOXsjUrQJj3b9KAD5jZkXDxqePQKBgcGZXQ9ln53ZBSq8DxAwZL1rT2JvFq0/1iYA+TKiXzidnjEY5lr+aMczuR7ynp0572DS58rG7o94IKP7VW10aNLbKJItQN5c9mVcxnE78FoMpRNWST6s1He28ECG3oulUyP3/NAQoNS+Drl0zTyj76UND8y6NwjjWrubPV4yADgZ3dT1HA/kwlsVU8bYbf9UIqhVjZDj1XmAzC901uR1aCM/+7ZcpjF2tvjxjgQHZPqP1kp7YuKGLxuiMATgBJSDd0EAZ1ZUfM4wR0CG4g0d6zgg2vnWWkObuJIvDiIZxXVzImfOpqxHbsYTh6o5IPr5fesMffKiH0SBfcF0FnWXd0FY+ru7mTQeTxxayQFJn9uTNPWp3nw6EaYjhQtCMK0coBKYGUt2RDkgU2dbtpCh/+Ipq5OPal0LImWLkzXm+CC04W+zPMpmDpgWSx6J82Qd2N1sk9XjhdG5ofJgIyIli5M15sQ1aNd/8qtgthZOxJKd5bxHBl55A2Qf9JVQULSwZA0PDU/vTM6xu7Fk5308R87s+sC27P1e+gaVMX9Zn0VYg8VZSDP3nmC348muSt4j/S8fAOzWXOXL7ScClkNdEKb5LvzLseTRDTxH+nYcI6DJ54hYxAL9iChQC6gEDL/Gkj1bRSADYNiUWy3V1Xsglz2ygBOCRdAavwx9+KucCkKQZOlItKH7VR5I//ZREFbNSDxBqd4GuaR2cWpN6ir0Gz/w/Y3EPo0lej6eAXJpX9l06t87fIcappSCshZqUvNcRZbVl5SGzu99IOaZnUnD1Ho9W16Z5sgqGJt3VonNNIDi4hU1qG8f8YFo/U2vEdlt3FniSWLnM19hEe1J0j/R5IkH3Et7Xbzev+0bsq3duUBCinzh74W50JtF2tUnT+zlgfQ1/gWiukL7w9qTMFkRHSJH1GciieOnZoCca16tp6cGuS+g2RAFm1hBswVdKfyFdVN56t0aYLPbOLqhMfteeJ/I+iQARDAkNj4BD+RZb7BSjKeLUEK3XJbpKEdRRf3h0voPW3zxJPpOMU5/PQxQVRj35hL2QNcG4K6pYnLsFmyDYKQJKzfstVZtfHoF8PCUD8T8fcsOss3uhRwStseCjRQB2nQaZtoCiqpRvv5tirKxd9T7nz+Qu58ZvZv7GZBwfgxr7ebSk1pQYbAYdNuEIREiJXWAUoNI+RNQKh6DfOdUj1K5dZd4iSX8t0SYv/+n98seER37H8mkzkc00C7pAAAAAElFTkSuQmCC"},spXi:function(ct,ge,U){ct.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(ct,ge,U){"use strict";var te=U("VTBJ"),Y=U("1OyB"),N=U("vuIU"),z=U("Ji7U"),P=U("LK+K"),F=U("q1tI"),G=U.n(F),K=U("m+aA"),n=U("Zm9Q"),I=U("Kwbf"),E=U("c+Xe"),f=U("bdgK"),b="rc-observer-key",c=function(a){Object(z.a)(l,a);var p=Object(P.a)(l);function l(){var u;return Object(Y.a)(this,l),u=p.apply(this,arguments),u.resizeObserver=null,u.childNode=null,u.currentElement=null,u.state={width:0,height:0,offsetHeight:0,offsetWidth:0},u.onResize=function(s){var i=u.props.onResize,D=s[0].target,A=D.getBoundingClientRect(),S=A.width,R=A.height,O=D.offsetWidth,g=D.offsetHeight,_=Math.floor(S),h=Math.floor(R);if(u.state.width!==_||u.state.height!==h||u.state.offsetWidth!==O||u.state.offsetHeight!==g){var d={width:_,height:h,offsetWidth:O,offsetHeight:g};u.setState(d),i&&Promise.resolve().then(function(){i(Object(te.a)(Object(te.a)({},d),{},{offsetWidth:O,offsetHeight:g}))})}},u.setChildNode=function(s){u.childNode=s},u}return Object(N.a)(l,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var s=this.props.disabled;if(s){this.destroyObserver();return}var i=Object(K.a)(this.childNode||this),D=i!==this.currentElement;D&&(this.destroyObserver(),this.currentElement=i),!this.resizeObserver&&i&&(this.resizeObserver=new f.default(this.onResize),this.resizeObserver.observe(i))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var s=this.props.children,i=Object(n.a)(s);if(i.length>1)Object(I.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(i.length===0)return Object(I.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var D=i[0];if(F.isValidElement(D)&&Object(E.c)(D)){var A=D.ref;i[0]=F.cloneElement(D,{ref:Object(E.a)(A,this.setChildNode)})}return i.length===1?i[0]:i.map(function(S,R){return!F.isValidElement(S)||"key"in S&&S.key!==null?S:F.cloneElement(S,{key:"".concat(b,"-").concat(R)})})}}]),l}(F.Component);c.displayName="ResizeObserver",ge.a=c},t9D7:function(ct,ge,U){"use strict";U.d(ge,"b",function(){return G}),U.d(ge,"g",function(){return n}),U.d(ge,"d",function(){return I}),U.d(ge,"e",function(){return E}),U.d(ge,"a",function(){return f}),U.d(ge,"f",function(){return a}),U.d(ge,"c",function(){return p});var te=U("Vhoy"),Y=U("MI8n"),N=U("pmY6"),z=U("Cg/j"),P=U("ic2d"),F=U("nEHx");const G=Object(z.c)("themeService");var K;(function(l){function u(s){return s&&typeof s=="object"&&typeof s.id=="string"}l.isThemeColor=u})(K||(K={}));function n(l){return{id:l}}var I;(function(l){function u(R){return R&&typeof R=="object"&&typeof R.id=="string"&&(typeof R.color=="undefined"||K.isThemeColor(R.color))}l.isThemeIcon=u;const s=new RegExp(`^\\$\\((${te.a.iconNameExpression}(?:${te.a.iconModifierExpression})?)\\)$`);function i(R){const O=s.exec(R);if(!O)return;let[,g]=O;return{id:g}}l.fromString=i;function D(R,O){let g=R.id;const _=g.lastIndexOf("~");return _!==-1&&(g=g.substring(0,_)),O&&(g=`${g}~${O}`),{id:g}}l.modify=D;function A(R,O){var g,_;return R.id===O.id&&((g=R.color)===null||g===void 0?void 0:g.id)===((_=O.color)===null||_===void 0?void 0:_.id)}l.isEqual=A;function S(R,O){return{id:R.id,color:O?n(O):void 0}}l.asThemeIcon=S,l.asClassNameArray=te.a.asClassNameArray,l.asClassName=te.a.asClassName,l.asCSSSelector=te.a.asCSSSelector})(I||(I={}));function E(l){switch(l){case F.a.DARK:return"vs-dark";case F.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const f={ThemingContribution:"base.contributions.theming"};class b{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Y.b}onColorThemeChange(l){return this.themingParticipants.push(l),this.onThemingParticipantAddedEmitter.fire(l),Object(N.i)(()=>{const u=this.themingParticipants.indexOf(l);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let c=new b;P.a.add(f.ThemingContribution,c);function a(l){return c.onColorThemeChange(l)}class p extends N.a{constructor(l){super();this.themeService=l,this.theme=l.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(u=>this.onThemeChange(u)))}onThemeChange(l){this.theme=l,this.updateStyles()}updateStyles(){}}},tK3L:function(ct,ge,U){ct.exports={flex_box_center:"flex_box_center___3uV00",flex_space_between:"flex_space_between___253zc",flex_box_vertical_center:"flex_box_vertical_center___3Nn4F",flex_box_center_end:"flex_box_center_end___3N00E",flex_box_column:"flex_box_column___wngbD",page:"page___1qj_b",wrap:"wrap___1vIxE",title:"title___3EB7K",select:"select___3yoep",contentWrap:"contentWrap___2vBaG",pngIcon:"pngIcon___3tbYk",tabsWrap:"tabsWrap___35WZr",searchWrap:"searchWrap___3zxJK",addQuestionBtn:"addQuestionBtn___3pN4A",search:"search___Qt6zp",searchIcon:"searchIcon___1fYTO",batchWrap:"batchWrap___1QFBy",customTable:"customTable___4pmq7",row:"row___mgwpl",contentListWrap:"contentListWrap___sfO91",li:"li___2kFZ7",bottom:"bottom___1-hPm",actionLeftItem:"actionLeftItem___3mz5t",questionTypeName:"questionTypeName___2Vr34",more:"more___Oo-pR",btnAdd:"btnAdd___3ROdW",cancelC:"cancelC___3SmK1",addC:"addC___3VFkF",actonBtn:"actonBtn___3j8EO",batch:"batch___1YJ8c",btns:"btns___33g-Q",btn:"btn___3yAUt",treeWrapper:"treeWrapper___3Sn4Z",treeHeader:"treeHeader___1fITD",treeContent:"treeContent___3wYv9",action:"action___2Ys8R",sendModal:"sendModal___3kKOa",line:"line___2PBOX",del:"del___1X0CN",divider:"divider___3XDiC",headerWrapper:"headerWrapper___3F2Wp",exportBtn:"exportBtn___3nux1"}},ulZh:function(ct,ge,U){typeof window!="undefined"&&function(Y,N){ct.exports=N()}(this,function(){return function(te){var Y={};function N(z){if(Y[z])return Y[z].exports;var P=Y[z]={i:z,l:!1,exports:{}};return te[z].call(P.exports,P,P.exports,N),P.l=!0,P.exports}return N.m=te,N.c=Y,N.d=function(z,P,F){N.o(z,P)||Object.defineProperty(z,P,{enumerable:!0,get:F})},N.r=function(z){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(z,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(z,"__esModule",{value:!0})},N.t=function(z,P){if(P&1&&(z=N(z)),P&8)return z;if(P&4&&typeof z=="object"&&z&&z.__esModule)return z;var F=Object.create(null);if(N.r(F),Object.defineProperty(F,"default",{enumerable:!0,value:z}),P&2&&typeof z!="string")for(var G in z)N.d(F,G,function(K){return z[K]}.bind(null,G));return F},N.n=function(z){var P=z&&z.__esModule?function(){return z.default}:function(){return z};return N.d(P,"a",P),P},N.o=function(z,P){return Object.prototype.hasOwnProperty.call(z,P)},N.p="/dist/",N(N.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(te,Y,N){"use strict";var z=Object.prototype.hasOwnProperty,P="~";function F(){}Object.create&&(F.prototype=Object.create(null),new F().__proto__||(P=!1));function G(E,f,b){this.fn=E,this.context=f,this.once=b||!1}function K(E,f,b,c,a){if(typeof b!="function")throw new TypeError("The listener must be a function");var p=new G(b,c||E,a),l=P?P+f:f;return E._events[l]?E._events[l].fn?E._events[l]=[E._events[l],p]:E._events[l].push(p):(E._events[l]=p,E._eventsCount++),E}function n(E,f){--E._eventsCount===0?E._events=new F:delete E._events[f]}function I(){this._events=new F,this._eventsCount=0}I.prototype.eventNames=function(){var f=[],b,c;if(this._eventsCount===0)return f;for(c in b=this._events)z.call(b,c)&&f.push(P?c.slice(1):c);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(b)):f},I.prototype.listeners=function(f){var b=P?P+f:f,c=this._events[b];if(!c)return[];if(c.fn)return[c.fn];for(var a=0,p=c.length,l=new Array(p);a<p;a++)l[a]=c[a].fn;return l},I.prototype.listenerCount=function(f){var b=P?P+f:f,c=this._events[b];return c?c.fn?1:c.length:0},I.prototype.emit=function(f,b,c,a,p,l){var u=P?P+f:f;if(!this._events[u])return!1;var s=this._events[u],i=arguments.length,D,A;if(s.fn){s.once&&this.removeListener(f,s.fn,void 0,!0);switch(i){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,b),!0;case 3:return s.fn.call(s.context,b,c),!0;case 4:return s.fn.call(s.context,b,c,a),!0;case 5:return s.fn.call(s.context,b,c,a,p),!0;case 6:return s.fn.call(s.context,b,c,a,p,l),!0}for(A=1,D=new Array(i-1);A<i;A++)D[A-1]=arguments[A];s.fn.apply(s.context,D)}else{var S=s.length,R;for(A=0;A<S;A++){s[A].once&&this.removeListener(f,s[A].fn,void 0,!0);switch(i){case 1:s[A].fn.call(s[A].context);break;case 2:s[A].fn.call(s[A].context,b);break;case 3:s[A].fn.call(s[A].context,b,c);break;case 4:s[A].fn.call(s[A].context,b,c,a);break;default:if(!D)for(R=1,D=new Array(i-1);R<i;R++)D[R-1]=arguments[R];s[A].fn.apply(s[A].context,D)}}}return!0},I.prototype.on=function(f,b,c){return K(this,f,b,c,!1)},I.prototype.once=function(f,b,c){return K(this,f,b,c,!0)},I.prototype.removeListener=function(f,b,c,a){var p=P?P+f:f;if(!this._events[p])return this;if(!b)return n(this,p),this;var l=this._events[p];if(l.fn)l.fn===b&&(!a||l.once)&&(!c||l.context===c)&&n(this,p);else{for(var u=0,s=[],i=l.length;u<i;u++)(l[u].fn!==b||a&&!l[u].once||c&&l[u].context!==c)&&s.push(l[u]);s.length?this._events[p]=s.length===1?s[0]:s:n(this,p)}return this},I.prototype.removeAllListeners=function(f){var b;return f?(b=P?P+f:f,this._events[b]&&n(this,b)):(this._events=new F,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=P,I.EventEmitter=I,te.exports=I},"./node_modules/url-toolkit/src/url-toolkit.js":function(te,Y,N){(function(z){var P=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,F=/^([^\/?#]*)([^]*)$/,G=/(?:\/|^)\.(?=\/)/g,K=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(I,E,f){if(f=f||{},I=I.trim(),E=E.trim(),!E){if(!f.alwaysNormalize)return I;var b=n.parseURL(I);if(!b)throw new Error("Error trying to parse base URL.");return b.path=n.normalizePath(b.path),n.buildURLFromParts(b)}var c=n.parseURL(E);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return f.alwaysNormalize?(c.path=n.normalizePath(c.path),n.buildURLFromParts(c)):E;var a=n.parseURL(I);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var p=F.exec(a.path);a.netLoc=p[1],a.path=p[2]}a.netLoc&&!a.path&&(a.path="/");var l={scheme:a.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(l.netLoc=a.netLoc,c.path[0]!=="/"))if(!c.path)l.path=a.path,c.params||(l.params=a.params,c.query||(l.query=a.query));else{var u=a.path,s=u.substring(0,u.lastIndexOf("/")+1)+c.path;l.path=n.normalizePath(s)}return l.path===null&&(l.path=f.alwaysNormalize?n.normalizePath(c.path):c.path),n.buildURLFromParts(l)},parseURL:function(I){var E=P.exec(I);return E?{scheme:E[1]||"",netLoc:E[2]||"",path:E[3]||"",params:E[4]||"",query:E[5]||"",fragment:E[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(G,"");I.length!==(I=I.replace(K,"")).length;);return I.split("").reverse().join("")},buildURLFromParts:function(I){return I.scheme+I.netLoc+I.path+I.params+I.query+I.fragment}};te.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(te,Y,N){function z(f){var b={};function c(p){if(b[p])return b[p].exports;var l=b[p]={i:p,l:!1,exports:{}};return f[p].call(l.exports,l,l.exports,c),l.l=!0,l.exports}c.m=f,c.c=b,c.i=function(p){return p},c.d=function(p,l,u){c.o(p,l)||Object.defineProperty(p,l,{configurable:!1,enumerable:!0,get:u})},c.r=function(p){Object.defineProperty(p,"__esModule",{value:!0})},c.n=function(p){var l=p&&p.__esModule?function(){return p.default}:function(){return p};return c.d(l,"a",l),l},c.o=function(p,l){return Object.prototype.hasOwnProperty.call(p,l)},c.p="/",c.oe=function(p){throw console.error(p),p};var a=c(c.s=ENTRY_MODULE);return a.default||a}var P="[\\.|\\-|\\+|\\w|/|@]+",F="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+P+").*?\\)";function G(f){return(f+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function K(f){return!isNaN(1*f)}function n(f,b,c){var a={};a[c]=[];var p=b.toString(),l=p.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return a;for(var u=l[1],s=new RegExp("(\\\\n|\\W)"+G(u)+F,"g"),i;i=s.exec(p);){if(i[3]==="dll-reference")continue;a[c].push(i[3])}for(s=new RegExp("\\("+G(u)+'\\("(dll-reference\\s('+P+'))"\\)\\)'+F,"g");i=s.exec(p);)f[i[2]]||(a[c].push(i[1]),f[i[2]]=N(i[1]).m),a[i[2]]=a[i[2]]||[],a[i[2]].push(i[4]);for(var D=Object.keys(a),A=0;A<D.length;A++)for(var S=0;S<a[D[A]].length;S++)K(a[D[A]][S])&&(a[D[A]][S]=1*a[D[A]][S]);return a}function I(f){var b=Object.keys(f);return b.reduce(function(c,a){return c||f[a].length>0},!1)}function E(f,b){for(var c={main:[b]},a={main:[]},p={main:{}};I(c);)for(var l=Object.keys(c),u=0;u<l.length;u++){var s=l[u],i=c[s],D=i.pop();if(p[s]=p[s]||{},p[s][D]||!f[s][D])continue;p[s][D]=!0,a[s]=a[s]||[],a[s].push(D);for(var A=n(f,f[s][D],s),S=Object.keys(A),R=0;R<S.length;R++)c[S[R]]=c[S[R]]||[],c[S[R]]=c[S[R]].concat(A[S[R]])}return a}te.exports=function(f,b){b=b||{};var c={main:N.m},a=b.all?{main:Object.keys(c.main)}:E(c,f),p="";Object.keys(a).filter(function(D){return D!=="main"}).forEach(function(D){for(var A=0;a[D][A];)A++;a[D].push(A),c[D][A]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",p=p+"var "+D+" = ("+z.toString().replace("ENTRY_MODULE",JSON.stringify(A))+")({"+a[D].map(function(S){return""+JSON.stringify(S)+": "+c[D][S].toString()}).join(",")+`});
`}),p=p+"new (("+z.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+a.main.map(function(D){return""+JSON.stringify(D)+": "+c.main[D].toString()}).join(",")+"}))(self);";var l=new window.Blob([p],{type:"text/javascript"});if(b.bare)return l;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,s=u.createObjectURL(l),i=new window.Worker(s);return i.objectURL=s,i}},"./src/config.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"hlsDefaultConfig",function(){return R}),N.d(Y,"mergeConfig",function(){return g}),N.d(Y,"enableStreamingMode",function(){return _});var z=N("./src/controller/abr-controller.ts"),P=N("./src/controller/audio-stream-controller.ts"),F=N("./src/controller/audio-track-controller.ts"),G=N("./src/controller/subtitle-stream-controller.ts"),K=N("./src/controller/subtitle-track-controller.ts"),n=N("./src/controller/buffer-controller.ts"),I=N("./src/controller/timeline-controller.ts"),E=N("./src/controller/cap-level-controller.ts"),f=N("./src/controller/fps-controller.ts"),b=N("./src/controller/eme-controller.ts"),c=N("./src/controller/cmcd-controller.ts"),a=N("./src/utils/xhr-loader.ts"),p=N("./src/utils/fetch-loader.ts"),l=N("./src/utils/cues.ts"),u=N("./src/utils/mediakeys-helper.ts"),s=N("./src/utils/logger.ts");function i(){return i=Object.assign||function(h){for(var d=1;d<arguments.length;d++){var C=arguments[d];for(var x in C)Object.prototype.hasOwnProperty.call(C,x)&&(h[x]=C[x])}return h},i.apply(this,arguments)}function D(h,d){var C=Object.keys(h);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(h);d&&(x=x.filter(function(w){return Object.getOwnPropertyDescriptor(h,w).enumerable})),C.push.apply(C,x)}return C}function A(h){for(var d=1;d<arguments.length;d++){var C=arguments[d]!=null?arguments[d]:{};d%2?D(Object(C),!0).forEach(function(x){S(h,x,C[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(C)):D(Object(C)).forEach(function(x){Object.defineProperty(h,x,Object.getOwnPropertyDescriptor(C,x))})}return h}function S(h,d,C){return d in h?Object.defineProperty(h,d,{value:C,enumerable:!0,configurable:!0,writable:!0}):h[d]=C,h}var R=A(A({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:z.default,bufferController:n.default,capLevelController:E.default,fpsController:f.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:u.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:K.default,timelineController:I.TimelineController,audioStreamController:P.default,audioTrackController:F.default,emeController:b.default,cmcdController:c.default});function O(){return{cueHandler:l.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function g(h,d){if((d.liveSyncDurationCount||d.liveMaxLatencyDurationCount)&&(d.liveSyncDuration||d.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(d.liveMaxLatencyDurationCount!==void 0&&(d.liveSyncDurationCount===void 0||d.liveMaxLatencyDurationCount<=d.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(d.liveMaxLatencyDuration!==void 0&&(d.liveSyncDuration===void 0||d.liveMaxLatencyDuration<=d.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return i({},h,d)}function _(h){var d=h.loader;if(d!==p.default&&d!==a.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),h.progressive=!1;else{var C=Object(p.fetchSupported)();C&&(h.loader=p.default,h.progressive=!0,h.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/polyfills/number.ts"),P=N("./src/utils/ewma-bandwidth-estimator.ts"),F=N("./src/events.ts"),G=N("./src/utils/buffer-helper.ts"),K=N("./src/errors.ts"),n=N("./src/types/loader.ts"),I=N("./src/utils/logger.ts");function E(c,a){for(var p=0;p<a.length;p++){var l=a[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(c,l.key,l)}}function f(c,a,p){return a&&E(c.prototype,a),p&&E(c,p),c}var b=function(){function c(p){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=p;var l=p.config;this.bwEstimator=new P.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var a=c.prototype;return a.registerListeners=function(){var l=this.hls;l.on(F.Events.FRAG_LOADING,this.onFragLoading,this),l.on(F.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(F.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var l=this.hls;l.off(F.Events.FRAG_LOADING,this.onFragLoading,this),l.off(F.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(F.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},a.onFragLoading=function(l,u){var s=u.frag;if(s.type===n.PlaylistLevelType.MAIN&&!this.timer){var i;this.fragCurrent=s,this.partCurrent=(i=u.part)!=null?i:null,this.timer=self.setInterval(this.onCheck,100)}},a.onLevelLoaded=function(l,u){var s=this.hls.config;u.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},a._abandonRulesCheck=function(){var l=this.fragCurrent,u=this.partCurrent,s=this.hls,i=s.autoLevelEnabled,D=s.config,A=s.media;if(!l||!A)return;var S=u?u.stats:l.stats,R=u?u.duration:l.duration;if(S.aborted){I.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!i||A.paused||!A.playbackRate||!A.readyState)return;var O=performance.now()-S.loading.start,g=Math.abs(A.playbackRate);if(O<=500*R/g)return;var _=s.levels,h=s.minAutoLevel,d=_[l.level],C=S.total||Math.max(S.loaded,Math.round(R*d.maxBitrate/8)),x=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/O),w=(C-S.loaded)/x,j=A.currentTime,W=(G.BufferHelper.bufferInfo(A,j,D.maxBufferHole).end-j)/g;if(W>=2*R/g||w<=W)return;var T=Number.POSITIVE_INFINITY,M;for(M=l.level-1;M>h;M--){var m=_[M].maxBitrate;if(T=R*m/(8*.8*x),T<W)break}if(T>=w)return;var v=this.bwEstimator.getEstimate();I.logger.warn("Fragment "+l.sn+(u?" part "+u.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+M+`
Current BW estimate: `+(Object(z.isFiniteNumber)(v)?(v/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+w.toFixed(3)+` s
Estimated load time for the next fragment: `+T.toFixed(3)+` s
Time to underbuffer: `+W.toFixed(3)+" s"),s.nextLoadLevel=M,this.bwEstimator.sample(O,S.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),s.trigger(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:u,stats:S})},a.onFragLoaded=function(l,u){var s=u.frag,i=u.part;if(s.type===n.PlaylistLevelType.MAIN&&Object(z.isFiniteNumber)(s.sn)){var D=i?i.stats:s.stats,A=i?i.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[s.level],R=(S.loaded?S.loaded.bytes:0)+D.loaded,O=(S.loaded?S.loaded.duration:0)+A;S.loaded={bytes:R,duration:O},S.realBitrate=Math.round(8*R/O)}if(s.bitrateTest){var g={stats:D,frag:s,part:i,id:s.type};this.onFragBuffered(F.Events.FRAG_BUFFERED,g),s.bitrateTest=!1}}},a.onFragBuffered=function(l,u){var s=u.frag,i=u.part,D=i?i.stats:s.stats;if(D.aborted)return;if(s.type!==n.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var A=D.parsing.end-D.loading.start;this.bwEstimator.sample(A,D.loaded),D.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=A/1e3:this.bitrateTestDelay=0},a.onError=function(l,u){switch(u.details){case K.ErrorDetails.FRAG_LOAD_ERROR:case K.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var l=this.fragCurrent,u=this.partCurrent,s=this.hls,i=s.maxAutoLevel,D=s.config,A=s.minAutoLevel,S=s.media,R=u?u.duration:l?l.duration:0,O=S?S.currentTime:0,g=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,_=this.bwEstimator?this.bwEstimator.getEstimate():D.abrEwmaDefaultEstimate,h=(G.BufferHelper.bufferInfo(S,O,D.maxBufferHole).end-O)/g,d=this.findBestLevel(_,A,i,h,D.abrBandWidthFactor,D.abrBandWidthUpFactor);if(d>=0)return d;I.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var C=R?Math.min(R,D.maxStarvationDelay):D.maxStarvationDelay,x=D.abrBandWidthFactor,w=D.abrBandWidthUpFactor;if(!h){var j=this.bitrateTestDelay;if(j){var W=R?Math.min(R,D.maxLoadingDelay):D.maxLoadingDelay;C=W-j,I.logger.trace("bitrate test took "+Math.round(1e3*j)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*C)+" ms"),x=w=1}}return d=this.findBestLevel(_,A,i,h+C,x,w),Math.max(d,0)},a.findBestLevel=function(l,u,s,i,D,A){for(var S,R=this.fragCurrent,O=this.partCurrent,g=this.lastLoadedFragLevel,_=this.hls.levels,h=_[g],d=!!(h!=null&&(S=h.details)!==null&&S!==void 0&&S.live),C=h==null?void 0:h.codecSet,x=O?O.duration:R?R.duration:0,w=s;w>=u;w--){var j=_[w];if(!j||C&&j.codecSet!==C)continue;var W=j.details,T=(O?W==null?void 0:W.partTarget:W==null?void 0:W.averagetargetduration)||x,M=void 0;w<=g?M=D*l:M=A*l;var m=_[w].maxBitrate,v=m*T/M;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+w+"/"+Math.round(M)+"/"+m+"/"+T+"/"+i+"/"+v),M>m&&(!v||d&&!this.bitrateTestDelay||v<i))return w}return-1},f(c,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,u=this.bwEstimator;if(l!==-1&&(!u||!u.canEstimate()))return l;var s=this.getNextABRAutoLevel();return l!==-1&&(s=Math.min(l,s)),s},set:function(l){this._nextAutoLevel=l}}]),c}();Y.default=b},"./src/controller/audio-stream-controller.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/polyfills/number.ts"),P=N("./src/controller/base-stream-controller.ts"),F=N("./src/events.ts"),G=N("./src/utils/buffer-helper.ts"),K=N("./src/controller/fragment-tracker.ts"),n=N("./src/types/level.ts"),I=N("./src/types/loader.ts"),E=N("./src/loader/fragment.ts"),f=N("./src/demux/chunk-cache.ts"),b=N("./src/demux/transmuxer-interface.ts"),c=N("./src/types/transmuxer.ts"),a=N("./src/controller/fragment-finders.ts"),p=N("./src/utils/discontinuities.ts"),l=N("./src/errors.ts"),u=N("./src/utils/logger.ts");function s(){return s=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var g=arguments[O];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(R[_]=g[_])}return R},s.apply(this,arguments)}function i(R,O){R.prototype=Object.create(O.prototype),R.prototype.constructor=R,D(R,O)}function D(R,O){return D=Object.setPrototypeOf||function(_,h){return _.__proto__=h,_},D(R,O)}var A=100,S=function(R){i(O,R);function O(_,h){var d;return d=R.call(this,_,h,"[audio-stream-controller]")||this,d.videoBuffer=null,d.videoTrackCC=-1,d.waitingVideoCC=-1,d.audioSwitch=!1,d.trackId=-1,d.waitingData=null,d.mainDetails=null,d.bufferFlushed=!1,d._registerListeners(),d}var g=O.prototype;return g.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},g._registerListeners=function(){var h=this.hls;h.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(F.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.on(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(F.Events.ERROR,this.onError,this),h.on(F.Events.BUFFER_RESET,this.onBufferReset,this),h.on(F.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g._unregisterListeners=function(){var h=this.hls;h.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(F.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.off(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(F.Events.ERROR,this.onError,this),h.off(F.Events.BUFFER_RESET,this.onBufferReset,this),h.off(F.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g.onInitPtsFound=function(h,d){var C=d.frag,x=d.id,w=d.initPTS;if(x==="main"){var j=C.cc;this.initPTS[C.cc]=w,this.log("InitPTS for cc: "+j+" found from main: "+w),this.videoTrackCC=j,this.state===P.State.WAITING_INIT_PTS&&this.tick()}},g.startLoad=function(h){if(!this.levels){this.startPosition=h,this.state=P.State.STOPPED;return}var d=this.lastCurrentTime;this.stopLoad(),this.setInterval(A),this.fragLoadError=0,d>0&&h===-1?(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),this.state=P.State.IDLE):(this.loadedmetadata=!1,this.state=P.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()},g.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_TRACK:{var h,d=this.levels,C=this.trackId,x=d==null||((h=d[C])===null||h===void 0)?void 0:h.details;if(x){if(this.waitForCdnTuneIn(x))break;this.state=P.State.WAITING_INIT_PTS}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var w,j=performance.now(),W=this.retryDate;(!W||j>=W||(w=this.media)!==null&&w!==void 0&&w.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=P.State.IDLE);break}case P.State.WAITING_INIT_PTS:{var T=this.waitingData;if(T){var M=T.frag,m=T.part,v=T.cache,H=T.complete;if(this.initPTS[M.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var X=v.flush(),q={frag:M,part:m,payload:X,networkDetails:null};this._handleFragmentLoadProgress(q),H&&R.prototype._handleFragmentLoadComplete.call(this,q)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+M.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var re=this.getLoadPosition(),ye=G.BufferHelper.bufferInfo(this.mediaBuffer,re,this.config.maxBufferHole),pe=Object(a.fragmentWithinToleranceTest)(ye.end,this.config.maxFragLookUpTolerance,M);pe<0&&(u.logger.log("Waiting fragment cc ("+M.cc+") @ "+M.start+" cancelled because another fragment at "+ye.end+" is needed"),this.clearWaitingFragment())}}else this.state=P.State.IDLE}}this.onTickEnd()},g.clearWaitingFragment=function(){var h=this.waitingData;h&&(this.fragmentTracker.removeFragment(h.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.IDLE)},g.onTickEnd=function(){var h=this.media;if(!h||!h.readyState)return;var d=this.mediaBuffer?this.mediaBuffer:h,C=d.buffered;!this.loadedmetadata&&C.length&&(this.loadedmetadata=!0),this.lastCurrentTime=h.currentTime},g.doTickIdle=function(){var h,d,C=this.hls,x=this.levels,w=this.media,j=this.trackId,W=C.config;if(!x||!x[j])return;if(!w&&(this.startFragRequested||!W.startFragPrefetch))return;var T=x[j],M=T.details;if(!M||M.live&&this.levelLastLoaded!==j||this.waitForCdnTuneIn(M)){this.state=P.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,E.ElementaryStreamTypes.AUDIO,I.PlaylistLevelType.AUDIO));var m=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(m===null)return;var v=m.len,H=this.getMaxBufferLength(),X=this.audioSwitch;if(v>=H&&!X)return;if(!X&&this._streamEnded(m,M)){C.trigger(F.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var q=M.fragments,re=q[0].start,ye=m.end;if(X){var pe=this.getLoadPosition();ye=pe,M.PTSKnown&&pe<re&&((m.end>re||m.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),w.currentTime=re+.05))}var ue=this.getNextFragment(ye,M);if(!ue){this.bufferFlushed=!0;return}((h=ue.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((d=ue.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(ue,M):this.loadFragment(ue,M,ye)},g.getMaxBufferLength=function(){var h=R.prototype.getMaxBufferLength.call(this),d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return d===null?h:Math.max(h,d.len)},g.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},g.onAudioTracksUpdated=function(h,d){var C=d.audioTracks;this.resetTransmuxer(),this.levels=C.map(function(x){return new n.Level(x)})},g.onAudioTrackSwitching=function(h,d){var C=!!d.url;this.trackId=d.id;var x=this.fragCurrent;x!=null&&x.loader&&x.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),C?this.setInterval(A):this.resetTransmuxer(),C?(this.audioSwitch=!0,this.state=P.State.IDLE):this.state=P.State.STOPPED,this.tick()},g.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},g.onLevelLoaded=function(h,d){this.mainDetails=d.details},g.onAudioTrackLoaded=function(h,d){var C,x=this.levels,w=d.details,j=d.id;if(!x){this.warn("Audio tracks were reset while loading level "+j);return}this.log("Track "+j+" loaded ["+w.startSN+","+w.endSN+"],duration:"+w.totalduration);var W=x[j],T=0;if(w.live||(C=W.details)!==null&&C!==void 0&&C.live){var M=this.mainDetails;if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed||!M)return;!W.details&&w.hasProgramDateTime&&M.hasProgramDateTime?(Object(p.alignMediaPlaylistByPDT)(w,M),T=w.fragments[0].start):T=this.alignPlaylists(w,W.details)}W.details=w,this.levelLastLoaded=j,!this.startFragRequested&&(this.mainDetails||!w.live)&&this.setStartPosition(W.details,T),this.state===P.State.WAITING_TRACK&&!this.waitForCdnTuneIn(w)&&(this.state=P.State.IDLE),this.tick()},g._handleFragmentLoadProgress=function(h){var d,C=h.frag,x=h.part,w=h.payload,j=this.config,W=this.trackId,T=this.levels;if(!T){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+C.sn+" of level "+C.level+" will not be buffered");return}var M=T[W];console.assert(M,"Audio track is defined on fragment load progress");var m=M.details;console.assert(m,"Audio track details are defined on fragment load progress");var v=j.defaultAudioCodec||M.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new b.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var X=this.initPTS[C.cc],q=(d=C.initSegment)===null||d===void 0?void 0:d.data;if(X!==void 0){var re=!1,ye=x?x.index:-1,pe=ye!==-1,ue=new c.ChunkMetadata(C.level,C.sn,C.stats.chunkCount,w.byteLength,ye,pe);H.push(w,q,v,"",C,x,m.totalduration,re,ue,X)}else{u.logger.log("Unknown video PTS for cc "+C.cc+", waiting for video PTS before demuxing audio frag "+C.sn+" of ["+m.startSN+" ,"+m.endSN+"],track "+W);var fe=this.waitingData=this.waitingData||{frag:C,part:x,cache:new f.default,complete:!1},be=fe.cache;be.push(new Uint8Array(w)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},g._handleFragmentLoadComplete=function(h){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,h)},g.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},g.onBufferCreated=function(h,d){var C=d.tracks.audio;C&&(this.mediaBuffer=C.buffer),d.tracks.video&&(this.videoBuffer=d.tracks.video.buffer)},g.onFragBuffered=function(h,d){var C=d.frag,x=d.part;if(C.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(C)){this.warn("Fragment "+C.sn+(x?" p: "+x.index:"")+" of level "+C.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}C.sn!=="initSegment"&&(this.fragPrevious=C,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(C,x)},g.onError=function(h,d){switch(d.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.AUDIO,d);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==P.State.ERROR&&this.state!==P.State.STOPPED&&(this.state=d.fatal?P.State.ERROR:P.State.IDLE,this.warn(d.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="audio"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var C=!0,x=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);x&&x.len>.5&&(C=!this.reduceMaxBufferLength(x.len)),C&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},g.onBufferFlushed=function(h,d){var C=d.type;C===E.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},g._handleTransmuxComplete=function(h){var d,C="audio",x=this.hls,w=h.remuxResult,j=h.chunkMeta,W=this.getCurrentContext(j);if(!W){this.warn("The loading context changed while buffering fragment "+j.sn+" of level "+j.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(j.level);return}var T=W.frag,M=W.part,m=w.audio,v=w.text,H=w.id3,X=w.initSegment;if(this.fragContextChanged(T))return;if(this.state=P.State.PARSING,this.audioSwitch&&m&&this.completeAudioSwitch(),X!=null&&X.tracks&&(this._bufferInitSegment(X.tracks,T,j),x.trigger(F.Events.FRAG_PARSING_INIT_SEGMENT,{frag:T,id:C,tracks:X.tracks})),m){var q=m.startPTS,re=m.endPTS,ye=m.startDTS,pe=m.endDTS;M&&(M.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:q,endPTS:re,startDTS:ye,endDTS:pe}),T.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,q,re,ye,pe),this.bufferFragmentData(m,T,M,j)}if(H!=null&&(d=H.samples)!==null&&d!==void 0&&d.length){var ue=s({frag:T,id:C},H);x.trigger(F.Events.FRAG_PARSING_METADATA,ue)}if(v){var fe=s({frag:T,id:C},v);x.trigger(F.Events.FRAG_PARSING_USERDATA,fe)}},g._bufferInitSegment=function(h,d,C){if(this.state!==P.State.PARSING)return;h.video&&delete h.video;var x=h.audio;if(!x)return;x.levelCodec=x.codec,x.id="audio",this.log("Init audio buffer, container:"+x.container+", codecs[parsed]=["+x.codec+"]"),this.hls.trigger(F.Events.BUFFER_CODECS,h);var w=x.initSegment;if(w!=null&&w.byteLength){var j={type:"audio",frag:d,part:null,chunkMeta:C,parent:d.type,data:w};this.hls.trigger(F.Events.BUFFER_APPENDING,j)}this.tick()},g.loadFragment=function(h,d,C){var x=this.fragmentTracker.getState(h);this.fragCurrent=h,(this.audioSwitch||x===K.FragmentState.NOT_LOADED||x===K.FragmentState.PARTIAL)&&(h.sn==="initSegment"?this._loadInitSegment(h):d.live&&!Object(z.isFiniteNumber)(this.initPTS[h.cc])?(this.log("Waiting for video PTS in continuity counter "+h.cc+" of live stream before loading audio fragment "+h.sn+" of level "+this.trackId),this.state=P.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,h,d,C)))},g.completeAudioSwitch=function(){var h=this.hls,d=this.media,C=this.trackId;d&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,h.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:C})},O}(P.default);Y.default=S},"./src/controller/audio-track-controller.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts"),P=N("./src/errors.ts"),F=N("./src/controller/base-playlist-controller.ts"),G=N("./src/types/loader.ts");function K(b,c){for(var a=0;a<c.length;a++){var p=c[a];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(b,p.key,p)}}function n(b,c,a){return c&&K(b.prototype,c),a&&K(b,a),b}function I(b,c){b.prototype=Object.create(c.prototype),b.prototype.constructor=b,E(b,c)}function E(b,c){return E=Object.setPrototypeOf||function(p,l){return p.__proto__=l,p},E(b,c)}var f=function(b){I(c,b);function c(p){var l;return l=b.call(this,p,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var a=c.prototype;return a.registerListeners=function(){var l=this.hls;l.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(z.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var l=this.hls;l.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(z.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,b.prototype.destroy.call(this)},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},a.onManifestParsed=function(l,u){this.tracks=u.audioTracks||[]},a.onAudioTrackLoaded=function(l,u){var s=u.id,i=u.details,D=this.tracksInGroup[s];if(!D){this.warn("Invalid audio track id "+s);return}var A=D.details;D.details=u.details,this.log("audioTrack "+s+" loaded ["+i.startSN+"-"+i.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,u,A))},a.onLevelLoading=function(l,u){this.switchLevel(u.level)},a.onLevelSwitching=function(l,u){this.switchLevel(u.level)},a.switchLevel=function(l){var u=this.hls.levels[l];if(!(u!=null&&u.audioGroupIds))return;var s=u.audioGroupIds[u.urlId];if(this.groupId!==s){this.groupId=s;var i=this.tracks.filter(function(A){return!s||A.groupId===s});this.selectDefaultTrack&&!i.some(function(A){return A.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;var D={audioTracks:i};this.log("Updating audio tracks, "+i.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(z.Events.AUDIO_TRACKS_UPDATED,D),this.selectInitialTrack()}},a.onError=function(l,u){if(b.prototype.onError.call(this,l,u),u.fatal||!u.context)return;u.context.type===G.PlaylistContextType.AUDIO_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},a.setAudioTrack=function(l){var u=this.tracksInGroup;if(l<0||l>=u.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=u[this.trackId];this.log("Now switching to audio-track index "+l);var i=u[l],D=i.id,A=i.groupId,S=A===void 0?"":A,R=i.name,O=i.type,g=i.url;if(this.trackId=l,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(z.Events.AUDIO_TRACK_SWITCHING,{id:D,groupId:S,name:R,type:O,url:g}),i.details&&!i.details.live)return;var _=this.switchParams(i.url,s==null?void 0:s.details);this.loadPlaylist(_)},a.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var u=this.trackName,s=this.findTrackId(u)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(l){for(var u=this.tracksInGroup,s=0;s<u.length;s++){var i=u[s];if((!this.selectDefaultTrack||i.default)&&(!l||l===i.name))return i.id}return-1},a.loadPlaylist=function(l){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var s=u.id,i=u.groupId,D=u.url;if(l)try{D=l.addDirectives(D)}catch(A){this.warn("Could not construct new URL with HLS Delivery Directives: "+A)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(z.Events.AUDIO_TRACK_LOADING,{url:D,id:s,groupId:i,deliveryDirectives:l||null})}},n(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),c}(F.default);Y.default=f},"./src/controller/base-playlist-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return n});var z=N("./src/polyfills/number.ts"),P=N("./src/types/level.ts"),F=N("./src/controller/level-helper.ts"),G=N("./src/utils/logger.ts"),K=N("./src/errors.ts"),n=function(){function I(f,b){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,b+":"),this.warn=G.logger.warn.bind(G.logger,b+":"),this.hls=f}var E=I.prototype;return E.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},E.onError=function(b,c){c.fatal&&c.type===K.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},E.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},E.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},E.stopLoad=function(){this.canLoad=!1,this.clearTimer()},E.switchParams=function(b,c){var a=c==null?void 0:c.renditionReports;if(a)for(var p=0;p<a.length;p++){var l=a[p],u=""+l.URI;if(u===b.substr(-u.length)){var s=parseInt(l["LAST-MSN"]),i=parseInt(l["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var D=Math.min(c.age-c.partTarget,c.targetduration);i!==void 0&&D>c.partTarget&&(i+=1)}if(Object(z.isFiniteNumber)(s))return new P.HlsUrlParameters(s,Object(z.isFiniteNumber)(i)?i:void 0,P.HlsSkip.No)}}},E.loadPlaylist=function(b){},E.shouldLoadTrack=function(b){return this.canLoad&&b&&!!b.url&&(!b.details||b.details.live)},E.playlistLoaded=function(b,c,a){var p=this,l=c.details,u=c.stats,s=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(l.advancedDateTime=Date.now()-s,l.live||a!=null&&a.live){if(l.reloaded(a),a&&this.log("live playlist "+b+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),a&&l.fragments.length>0&&Object(F.mergeDetails)(a,l),!this.canLoad||!l.live)return;var i,D=void 0,A=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var S=this.hls.config.lowLatencyMode,R=l.lastPartSn,O=l.endSN,g=l.lastPartIndex,_=g!==-1,h=R===O,d=S?0:g;_?(D=h?O+1:R,A=h?d:g+1):D=O+1;var C=l.age,x=C+l.ageHeader,w=Math.min(x-l.partTarget,l.targetduration*1.5);if(w>0){if(a&&w>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+w+" with playlist age: "+l.age),w=0;else{var j=Math.floor(w/l.targetduration);if(D+=j,A!==void 0){var W=Math.round(w%l.targetduration/l.partTarget);A+=W}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+C.toFixed(2)+"s goal: "+w+" skip sn "+j+" to part "+A)}l.tuneInGoal=w}if(i=this.getDeliveryDirectives(l,c.deliveryDirectives,D,A),S||!h){this.loadPlaylist(i);return}}else i=this.getDeliveryDirectives(l,c.deliveryDirectives,D,A);var T=Object(F.computeReloadInterval)(l,u);D!==void 0&&l.canBlockReload&&(T-=l.partTarget||1),this.log("reload live playlist "+b+" in "+Math.round(T)+" ms"),this.timer=self.setTimeout(function(){return p.loadPlaylist(i)},T)}else this.clearTimer()},E.getDeliveryDirectives=function(b,c,a,p){var l=Object(P.getSkipValue)(b,a);return c!=null&&c.skip&&b.deltaUpdateFailed&&(a=c.msn,p=c.part,l=P.HlsSkip.No),new P.HlsUrlParameters(a,p,l)},E.retryLoadingOrFail=function(b){var c=this,a=this.hls.config,p=this.retryCount<a.levelLoadingMaxRetry;if(p){var l;if(this.retryCount++,b.details.indexOf("LoadTimeOut")>-1&&(l=b.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+b.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+b.details+'"')}}else this.warn('cannot recover from error "'+b.details+'"'),this.clearTimer(),b.fatal=!0;return p},I}()},"./src/controller/base-stream-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"State",function(){return O}),N.d(Y,"default",function(){return g});var z=N("./src/polyfills/number.ts"),P=N("./src/task-loop.ts"),F=N("./src/controller/fragment-tracker.ts"),G=N("./src/utils/buffer-helper.ts"),K=N("./src/utils/logger.ts"),n=N("./src/events.ts"),I=N("./src/errors.ts"),E=N("./src/types/transmuxer.ts"),f=N("./src/utils/mp4-tools.ts"),b=N("./src/utils/discontinuities.ts"),c=N("./src/controller/fragment-finders.ts"),a=N("./src/controller/level-helper.ts"),p=N("./src/loader/fragment-loader.ts"),l=N("./src/crypt/decrypter.ts"),u=N("./src/utils/time-ranges.ts"),s=N("./src/types/loader.ts");function i(_,h){for(var d=0;d<h.length;d++){var C=h[d];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(_,C.key,C)}}function D(_,h,d){return h&&i(_.prototype,h),d&&i(_,d),_}function A(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function S(_,h){_.prototype=Object.create(h.prototype),_.prototype.constructor=_,R(_,h)}function R(_,h){return R=Object.setPrototypeOf||function(C,x){return C.__proto__=x,C},R(_,h)}var O={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},g=function(_){S(h,_);function h(C,x,w){var j;return j=_.call(this)||this,j.hls=void 0,j.fragPrevious=null,j.fragCurrent=null,j.fragmentTracker=void 0,j.transmuxer=null,j._state=O.STOPPED,j.media=void 0,j.mediaBuffer=void 0,j.config=void 0,j.bitrateTest=!1,j.lastCurrentTime=0,j.nextLoadPosition=0,j.startPosition=0,j.loadedmetadata=!1,j.fragLoadError=0,j.retryDate=0,j.levels=null,j.fragmentLoader=void 0,j.levelLastLoaded=null,j.startFragRequested=!1,j.decrypter=void 0,j.initPTS=[],j.onvseeking=null,j.onvended=null,j.logPrefix="",j.log=void 0,j.warn=void 0,j.logPrefix=w,j.log=K.logger.log.bind(K.logger,w+":"),j.warn=K.logger.warn.bind(K.logger,w+":"),j.hls=C,j.fragmentLoader=new p.default(C.config),j.fragmentTracker=x,j.config=C.config,j.decrypter=new l.default(C,C.config),C.on(n.Events.KEY_LOADED,j.onKeyLoaded,A(j)),j}var d=h.prototype;return d.doTick=function(){this.onTickEnd()},d.onTickEnd=function(){},d.startLoad=function(x){},d.stopLoad=function(){this.fragmentLoader.abort();var x=this.fragCurrent;x&&this.fragmentTracker.removeFragment(x),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},d._streamEnded=function(x,w){var j=this.fragCurrent,W=this.fragmentTracker;if(!w.live&&j&&j.sn===w.endSN&&!x.nextStart){var T=W.getState(j);return T===F.FragmentState.PARTIAL||T===F.FragmentState.OK}return!1},d.onMediaAttached=function(x,w){var j=this.media=this.mediaBuffer=w.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),j.addEventListener("seeking",this.onvseeking),j.addEventListener("ended",this.onvended);var W=this.config;this.levels&&W.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(W.startPosition)},d.onMediaDetaching=function(){var x=this.media;x!=null&&x.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),x&&(x.removeEventListener("seeking",this.onvseeking),x.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},d.onMediaSeeking=function(){var x=this.config,w=this.fragCurrent,j=this.media,W=this.mediaBuffer,T=this.state,M=j?j.currentTime:0,m=G.BufferHelper.bufferInfo(W||j,M,x.maxBufferHole);if(this.log("media seeking to "+(Object(z.isFiniteNumber)(M)?M.toFixed(3):M)+", state: "+T),T===O.ENDED)this.resetLoadingState();else if(w&&!m.len){var v=x.maxFragLookUpTolerance,H=w.start-v,X=w.start+w.duration+v,q=M>X;(M<H||q)&&(q&&w.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),w.loader.abort()),this.resetLoadingState())}j&&(this.lastCurrentTime=M),!this.loadedmetadata&&!m.len&&(this.nextLoadPosition=this.startPosition=M),this.tickImmediate()},d.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},d.onKeyLoaded=function(x,w){if(this.state!==O.KEY_LOADING||w.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var j=this.levels[w.frag.level].details;j&&this.loadFragment(w.frag,j,w.frag.start)},d.onHandlerDestroying=function(){this.stopLoad(),_.prototype.onHandlerDestroying.call(this)},d.onHandlerDestroyed=function(){this.state=O.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,_.prototype.onHandlerDestroyed.call(this)},d.loadKey=function(x,w){this.log("Loading key for "+x.sn+" of ["+w.startSN+"-"+w.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+x.level),this.state=O.KEY_LOADING,this.fragCurrent=x,this.hls.trigger(n.Events.KEY_LOADING,{frag:x})},d.loadFragment=function(x,w,j){this._loadFragForPlayback(x,w,j)},d._loadFragForPlayback=function(x,w,j){var W=this,T=function(m){if(W.fragContextChanged(x)){W.warn("Fragment "+x.sn+(m.part?" p: "+m.part.index:"")+" of level "+x.level+" was dropped during download."),W.fragmentTracker.removeFragment(x);return}x.stats.chunkCount++,W._handleFragmentLoadProgress(m)};this._doFragLoad(x,w,j,T).then(function(M){if(!M)return;W.fragLoadError=0;var m=W.state;if(W.fragContextChanged(x)){(m===O.FRAG_LOADING||m===O.BACKTRACKING||!W.fragCurrent&&m===O.PARSING)&&(W.fragmentTracker.removeFragment(x),W.state=O.IDLE);return}if("payload"in M&&(W.log("Loaded fragment "+x.sn+" of level "+x.level),W.hls.trigger(n.Events.FRAG_LOADED,M),W.state===O.BACKTRACKING)){W.fragmentTracker.backtrack(x,M),W.resetFragmentLoading(x);return}W._handleFragmentLoadComplete(M)}).catch(function(M){W.warn(M),W.resetFragmentLoading(x)})},d.flushMainBuffer=function(x,w,j){if(j===void 0&&(j=null),!(x-w))return;var W={startOffset:x,endOffset:w,type:j};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,W)},d._loadInitSegment=function(x){var w=this;this._doFragLoad(x).then(function(j){if(!j||w.fragContextChanged(x)||!w.levels)throw new Error("init load aborted");return j}).then(function(j){var W=w.hls,T=j.payload,M=x.decryptdata;if(T&&T.byteLength>0&&M&&M.key&&M.iv&&M.method==="AES-128"){var m=self.performance.now();return w.decrypter.webCryptoDecrypt(new Uint8Array(T),M.key.buffer,M.iv.buffer).then(function(v){var H=self.performance.now();return W.trigger(n.Events.FRAG_DECRYPTED,{frag:x,payload:v,stats:{tstart:m,tdecrypt:H}}),j.payload=v,j})}return j}).then(function(j){var W=w.fragCurrent,T=w.hls,M=w.levels;if(!M)throw new Error("init load aborted, missing levels");var m=M[x.level].details;console.assert(m,"Level details are defined when init segment is loaded");var v=x.stats;w.state=O.IDLE,w.fragLoadError=0,x.data=new Uint8Array(j.payload),v.parsing.start=v.buffering.start=self.performance.now(),v.parsing.end=v.buffering.end=self.performance.now(),j.frag===W&&T.trigger(n.Events.FRAG_BUFFERED,{stats:v,frag:W,part:null,id:x.type}),w.tick()}).catch(function(j){w.warn(j),w.resetFragmentLoading(x)})},d.fragContextChanged=function(x){var w=this.fragCurrent;return!x||!w||x.level!==w.level||x.sn!==w.sn||x.urlId!==w.urlId},d.fragBufferedComplete=function(x,w){var j=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+x.type+" sn: "+x.sn+(w?" part: "+w.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+x.level+" "+u.default.toString(G.BufferHelper.getBuffered(j))),this.state=O.IDLE,this.tick()},d._handleFragmentLoadComplete=function(x){var w=this.transmuxer;if(!w)return;var j=x.frag,W=x.part,T=x.partsLoaded,M=!T||T.length===0||T.some(function(v){return!v}),m=new E.ChunkMetadata(j.level,j.sn,j.stats.chunkCount+1,0,W?W.index:-1,!M);w.flush(m)},d._handleFragmentLoadProgress=function(x){},d._doFragLoad=function(x,w,j,W){var T=this;if(j===void 0&&(j=null),!this.levels)throw new Error("frag load aborted, missing levels");if(j=Math.max(x.start,j||0),this.config.lowLatencyMode&&w){var M=w.partList;if(M&&W){j>x.end&&w.fragmentHint&&(x=w.fragmentHint);var m=this.getNextPart(M,x,j);if(m>-1){var v=M[m];return this.log("Loading part sn: "+x.sn+" p: "+v.index+" cc: "+x.cc+" of playlist ["+w.startSN+"-"+w.endSN+"] parts [0-"+m+"-"+(M.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+x.level+", target: "+parseFloat(j.toFixed(3))),this.nextLoadPosition=v.start+v.duration,this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:x,part:M[m],targetBufferTime:j}),this.doFragPartsLoad(x,M,m,W).catch(function(H){return T.handleFragLoadError(H)})}else if(!x.url||this.loadedEndOfParts(M,j))return Promise.resolve(null)}}return this.log("Loading fragment "+x.sn+" cc: "+x.cc+" "+(w?"of ["+w.startSN+"-"+w.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+x.level+", target: "+parseFloat(j.toFixed(3))),Object(z.isFiniteNumber)(x.sn)&&!this.bitrateTest&&(this.nextLoadPosition=x.start+x.duration),this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:x,targetBufferTime:j}),this.fragmentLoader.load(x,W).catch(function(H){return T.handleFragLoadError(H)})},d.doFragPartsLoad=function(x,w,j,W){var T=this;return new Promise(function(M,m){var v=[],H=function X(q){var re=w[q];T.fragmentLoader.loadPart(x,re,W).then(function(ye){v[re.index]=ye;var pe=ye.part;T.hls.trigger(n.Events.FRAG_LOADED,ye);var ue=w[q+1];if(ue&&ue.fragment===x)X(q+1);else return M({frag:x,part:pe,partsLoaded:v})}).catch(m)};H(j)})},d.handleFragLoadError=function(x){var w=x.data;return w&&w.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(w.frag,w.part):this.hls.trigger(n.Events.ERROR,w),null},d._handleTransmuxerFlush=function(x){var w=this.getCurrentContext(x);if(!w||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var j=w.frag,W=w.part,T=w.level,M=self.performance.now();j.stats.parsing.end=M,W&&(W.stats.parsing.end=M),this.updateLevelTiming(j,W,T,x.partial)},d.getCurrentContext=function(x){var w=this.levels,j=x.level,W=x.sn,T=x.part;if(!w||!w[j])return this.warn("Levels object was unset while buffering fragment "+W+" of level "+j+". The current chunk will not be buffered."),null;var M=w[j],m=T>-1?Object(a.getPartWith)(M,W,T):null,v=m?m.fragment:Object(a.getFragmentWithSN)(M,W,this.fragCurrent);return v?{frag:v,part:m,level:M}:null},d.bufferFragmentData=function(x,w,j,W){if(!x||this.state!==O.PARSING)return;var T=x.data1,M=x.data2,m=T;if(T&&M&&(m=Object(f.appendUint8Array)(T,M)),!m||!m.length)return;var v={type:x.type,frag:w,part:j,chunkMeta:W,parent:w.type,data:m};this.hls.trigger(n.Events.BUFFER_APPENDING,v),x.dropped&&x.independent&&!j&&this.flushBufferGap(w)},d.flushBufferGap=function(x){var w=this.media;if(!w)return;if(!G.BufferHelper.isBuffered(w,w.currentTime)){this.flushMainBuffer(0,x.start);return}var j=w.currentTime,W=G.BufferHelper.bufferInfo(w,j,0),T=x.duration,M=Math.min(this.config.maxFragLookUpTolerance*2,T*.25),m=Math.max(Math.min(x.start-M,W.end-M),j+M);x.start-m>M&&this.flushMainBuffer(m,x.start)},d.getFwdBufferInfo=function(x,w){var j=this.config,W=this.getLoadPosition();if(!Object(z.isFiniteNumber)(W))return null;var T=G.BufferHelper.bufferInfo(x,W,j.maxBufferHole);if(T.len===0&&T.nextStart!==void 0){var M=this.fragmentTracker.getBufferedFrag(W,w);if(M&&T.nextStart<M.end)return G.BufferHelper.bufferInfo(x,W,Math.max(T.nextStart,j.maxBufferHole))}return T},d.getMaxBufferLength=function(x){var w=this.config,j;return x?j=Math.max(8*w.maxBufferSize/x,w.maxBufferLength):j=w.maxBufferLength,Math.min(j,w.maxMaxBufferLength)},d.reduceMaxBufferLength=function(x){var w=this.config,j=x||w.maxBufferLength;return w.maxMaxBufferLength>=j?(w.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+w.maxMaxBufferLength+"s"),!0):!1},d.getNextFragment=function(x,w){var j,W,T=w.fragments,M=T.length;if(!M)return null;var m=this.config,v=T[0].start,H;if(w.live){var X=m.initialLiveManifestSize;if(M<X)return this.warn("Not enough fragments to start playback (have: "+M+", need: "+X+")"),null;!w.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(w,T),this.startPosition=H?this.hls.liveSyncPosition||H.start:x)}else x<=v&&(H=T[0]);if(!H){var q=m.lowLatencyMode?w.partEnd:w.fragmentEnd;H=this.getFragmentAtPosition(x,q,w)}return(j=H)!==null&&j!==void 0&&j.initSegment&&!((W=H)!==null&&W!==void 0&&W.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},d.getNextPart=function(x,w,j){for(var W=-1,T=!1,M=!0,m=0,v=x.length;m<v;m++){var H=x[m];if(M=M&&!H.independent,W>-1&&j<H.start)break;var X=H.loaded;!X&&(T||H.independent||M)&&H.fragment===w&&(W=m),T=X}return W},d.loadedEndOfParts=function(x,w){var j=x[x.length-1];return j&&w>j.start&&j.loaded},d.getInitialLiveFragment=function(x,w){var j=this.fragPrevious,W=null;if(j){if(x.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+j.programDateTime),W=Object(c.findFragmentByPDT)(w,j.endProgramDateTime,this.config.maxFragLookUpTolerance)),!W){var T=j.sn+1;if(T>=x.startSN&&T<=x.endSN){var M=w[T-x.startSN];j.cc===M.cc&&(W=M,this.log("Live playlist, switching playlist, load frag with next SN: "+W.sn))}W||(W=Object(c.findFragWithCC)(w,j.cc),W&&this.log("Live playlist, switching playlist, load frag with same CC: "+W.sn))}}else{var m=this.hls.liveSyncPosition;m!==null&&(W=this.getFragmentAtPosition(m,this.bitrateTest?x.fragmentEnd:x.edge,x))}return W},d.getFragmentAtPosition=function(x,w,j){var W=this.config,T=this.fragPrevious,M=j.fragments,m=j.endSN,v=j.fragmentHint,H=W.maxFragLookUpTolerance,X=!!(W.lowLatencyMode&&j.partList&&v);X&&v&&!this.bitrateTest&&(M=M.concat(v),m=v.sn);var q;if(x<w){var re=x>w-H?0:H;q=Object(c.findFragmentByPTS)(T,M,x,re)}else q=M[M.length-1];if(q){var ye=q.sn-j.startSN,pe=T&&q.level===T.level,ue=M[ye+1],fe=this.fragmentTracker.getState(q);if(fe===F.FragmentState.BACKTRACKED){q=null;for(var be=ye;M[be]&&this.fragmentTracker.getState(M[be])===F.FragmentState.BACKTRACKED;)T?q=M[be--]:q=M[--be];q||(q=ue)}else T&&q.sn===T.sn&&!X&&(pe&&(q.sn<m&&this.fragmentTracker.getState(ue)!==F.FragmentState.OK?(this.log("SN "+q.sn+" just loaded, load next one: "+ue.sn),q=ue):q=null))}return q},d.synchronizeToLiveEdge=function(x){var w=this.config,j=this.media;if(!j)return;var W=this.hls.liveSyncPosition,T=j.currentTime,M=x.fragments[0].start,m=x.edge,v=T>=M-w.maxFragLookUpTolerance&&T<=m;if(W!==null&&j.duration>W&&(T<W||!v)){var H=w.liveMaxLatencyDuration!==void 0?w.liveMaxLatencyDuration:w.liveMaxLatencyDurationCount*x.targetduration;(!v&&j.readyState<4||T<m-H)&&(this.loadedmetadata||(this.nextLoadPosition=W),j.readyState&&(this.warn("Playback: "+T.toFixed(3)+" is located too far from the end of live sliding playlist: "+m+", reset currentTime to : "+W.toFixed(3)),j.currentTime=W))}},d.alignPlaylists=function(x,w){var j=this.levels,W=this.levelLastLoaded,T=this.fragPrevious,M=W!==null?j[W]:null,m=x.fragments.length;if(!m)return this.warn("No fragments in live playlist"),0;var v=x.fragments[0].start,H=!w,X=x.alignedSliding&&Object(z.isFiniteNumber)(v);if(H||!X&&!v){Object(b.alignStream)(T,M,x);var q=x.fragments[0].start;return this.log("Live playlist sliding: "+q.toFixed(2)+" start-sn: "+(w?w.startSN:"na")+"->"+x.startSN+" prev-sn: "+(T?T.sn:"na")+" fragments: "+m),q}return v},d.waitForCdnTuneIn=function(x){var w=3;return x.live&&x.canBlockReload&&x.tuneInGoal>Math.max(x.partHoldBack,x.partTarget*w)},d.setStartPosition=function(x,w){var j=this.startPosition;if(j<w&&(j=-1),j===-1||this.lastCurrentTime===-1){var W=x.startTimeOffset;Object(z.isFiniteNumber)(W)?(j=w+W,W<0&&(j+=x.totalduration),j=Math.min(Math.max(w,j),w+x.totalduration),this.log("Start time offset "+W+" found in playlist, adjust startPosition to "+j),this.startPosition=j):x.live?j=this.hls.liveSyncPosition||w:this.startPosition=j=0,this.lastCurrentTime=j}this.nextLoadPosition=j},d.getLoadPosition=function(){var x=this.media,w=0;return this.loadedmetadata&&x?w=x.currentTime:this.nextLoadPosition&&(w=this.nextLoadPosition),w},d.handleFragLoadAborted=function(x,w){this.transmuxer&&x.sn!=="initSegment"&&x.stats.aborted&&(this.warn("Fragment "+x.sn+(w?" part"+w.index:"")+" of level "+x.level+" was aborted"),this.resetFragmentLoading(x))},d.resetFragmentLoading=function(x){(!this.fragCurrent||!this.fragContextChanged(x))&&(this.state=O.IDLE)},d.onFragmentOrKeyLoadError=function(x,w){if(w.fatal)return;var j=w.frag;if(!j||j.type!==x)return;var W=this.fragCurrent;console.assert(W&&j.sn===W.sn&&j.level===W.level&&j.urlId===W.urlId,"Frag load error must match current frag to retry");var T=this.config;if(this.fragLoadError+1<=T.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(j.level))return;var M=Math.min(Math.pow(2,this.fragLoadError)*T.fragLoadingRetryDelay,T.fragLoadingMaxRetryTimeout);this.warn("Fragment "+j.sn+" of "+x+" "+j.level+" failed to load, retrying in "+M+"ms"),this.retryDate=self.performance.now()+M,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else w.levelRetry?(x===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(K.logger.error(w.details+" reaches max retry, redispatch as fatal ..."),w.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},d.afterBufferFlushed=function(x,w,j){if(!x)return;var W=G.BufferHelper.getBuffered(x);this.fragmentTracker.detectEvictedFragments(w,W,j),this.state===O.ENDED&&this.resetLoadingState()},d.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},d.resetLiveStartWhenNotLoaded=function(x){if(!this.loadedmetadata){this.startFragRequested=!1;var w=this.levels?this.levels[x].details:null;if(w!=null&&w.live)return this.startPosition=-1,this.setStartPosition(w,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},d.updateLevelTiming=function(x,w,j,W){var T=this,M=j.details;console.assert(!!M,"level.details must be defined");var m=Object.keys(x.elementaryStreams).reduce(function(v,H){var X=x.elementaryStreams[H];if(X){var q=X.endPTS-X.startPTS;if(q<=0)return T.warn("Could not parse fragment "+x.sn+" "+H+" duration reliably ("+q+") resetting transmuxer to fallback to playlist timing"),T.resetTransmuxer(),v||!1;var re=W?0:Object(a.updateFragPTSDTS)(M,x,X.startPTS,X.endPTS,X.startDTS,X.endDTS);return T.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:M,level:j,drift:re,type:H,frag:x,start:X.startPTS,end:X.endPTS}),!0}return v},!1);m?(this.state=O.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:x,part:w})):this.resetLoadingState()},d.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},D(h,[{key:"state",get:function(){return this._state},set:function(x){var w=this._state;w!==x&&(this._state=x,this.log(w+"->"+x))}}]),h}(P.default)},"./src/controller/buffer-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return c});var z=N("./src/polyfills/number.ts"),P=N("./src/events.ts"),F=N("./src/utils/logger.ts"),G=N("./src/errors.ts"),K=N("./src/utils/buffer-helper.ts"),n=N("./src/utils/mediasource-helper.ts"),I=N("./src/loader/fragment.ts"),E=N("./src/controller/buffer-operation-queue.ts"),f=Object(n.getMediaSource)(),b=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function a(l){var u=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var s=u.hls,i=u.media,D=u.mediaSource;F.logger.log("[buffer-controller]: Media source opened"),i&&(u.updateMediaElementDuration(),s.trigger(P.Events.MEDIA_ATTACHED,{media:i})),D&&D.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){F.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){F.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var p=a.prototype;return p.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},p.destroy=function(){this.unregisterListeners(),this.details=null},p.registerListeners=function(){var u=this.hls;u.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(P.Events.BUFFER_RESET,this.onBufferReset,this),u.on(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(P.Events.BUFFER_EOS,this.onBufferEos,this),u.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(P.Events.FRAG_PARSED,this.onFragParsed,this),u.on(P.Events.FRAG_CHANGED,this.onFragChanged,this)},p.unregisterListeners=function(){var u=this.hls;u.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(P.Events.BUFFER_RESET,this.onBufferReset,this),u.off(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(P.Events.BUFFER_EOS,this.onBufferEos,this),u.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(P.Events.FRAG_PARSED,this.onFragParsed,this),u.off(P.Events.FRAG_CHANGED,this.onFragChanged,this)},p._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new E.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},p.onManifestParsed=function(u,s){var i=2;(s.audio&&!s.video||!s.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.details=null,F.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},p.onMediaAttaching=function(u,s){var i=this.media=s.media;if(i&&f){var D=this.mediaSource=new f;D.addEventListener("sourceopen",this._onMediaSourceOpen),D.addEventListener("sourceended",this._onMediaSourceEnded),D.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(D),this._objectUrl=i.src}},p.onMediaDetaching=function(){var u=this.media,s=this.mediaSource,i=this._objectUrl;if(s){if(F.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(D){F.logger.warn("[buffer-controller]: onMediaDetaching: "+D.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),u&&(i&&self.URL.revokeObjectURL(i),u.src===i?(u.removeAttribute("src"),u.load()):F.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(P.Events.MEDIA_DETACHED,void 0)},p.onBufferReset=function(){var u=this;this.getSourceBufferTypes().forEach(function(s){var i=u.sourceBuffer[s];try{i&&(u.removeBufferListeners(s),u.mediaSource&&u.mediaSource.removeSourceBuffer(i),u.sourceBuffer[s]=void 0)}catch(D){F.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",D)}}),this._initSourceBuffer()},p.onBufferCodecs=function(u,s){var i=this,D=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(A){if(D){var S=i.tracks[A];if(S&&typeof S.buffer.changeType=="function"){var R=s[A],O=R.codec,g=R.levelCodec,_=R.container,h=(S.levelCodec||S.codec).replace(b,"$1"),d=(g||O).replace(b,"$1");if(h!==d){var C=_+";codecs="+(g||O);i.appendChangeType(A,C)}}}else i.pendingTracks[A]=s[A]}),D)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},p.appendChangeType=function(u,s){var i=this,D=this.operationQueue,A={execute:function(){var R=i.sourceBuffer[u];R&&(F.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+s),R.changeType(s)),D.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(R){F.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",R)}};D.append(A,u)},p.onBufferAppending=function(u,s){var i=this,D=this.hls,A=this.operationQueue,S=this.tracks,R=s.data,O=s.type,g=s.frag,_=s.part,h=s.chunkMeta,d=h.buffering[O],C=self.performance.now();d.start=C;var x=g.stats.buffering,w=_?_.stats.buffering:null;x.start===0&&(x.start=C),w&&w.start===0&&(w.start=C);var j=S.audio,W=O==="audio"&&h.id===1&&(j==null?void 0:j.container)==="audio/mpeg",T={execute:function(){if(d.executeStart=self.performance.now(),W){var m=i.sourceBuffer[O];if(m){var v=g.start-m.timestampOffset;Math.abs(v)>=.1&&(F.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+g.start+" (delta: "+v+") sn: "+g.sn+")"),m.timestampOffset=g.start)}}i.appendExecutor(R,O)},onStart:function(){},onComplete:function(){var m=self.performance.now();d.executeEnd=d.end=m,x.first===0&&(x.first=m),w&&w.first===0&&(w.first=m);var v=i.sourceBuffer,H={};for(var X in v)H[X]=K.BufferHelper.getBuffered(v[X]);i.appendError=0,i.hls.trigger(P.Events.BUFFER_APPENDED,{type:O,frag:g,part:_,chunkMeta:h,parent:g.type,timeRanges:H})},onError:function(m){F.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",m);var v={type:G.ErrorTypes.MEDIA_ERROR,parent:g.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:m,fatal:!1};m.code===DOMException.QUOTA_EXCEEDED_ERR?v.details=G.ErrorDetails.BUFFER_FULL_ERROR:(i.appendError++,v.details=G.ErrorDetails.BUFFER_APPEND_ERROR,i.appendError>D.config.appendErrorMaxRetry&&(F.logger.error("[buffer-controller]: Failed "+D.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),v.fatal=!0)),D.trigger(P.Events.ERROR,v)}};A.append(T,O)},p.onBufferFlushing=function(u,s){var i=this,D=this.operationQueue,A=function(R){return{execute:i.removeExecutor.bind(i,R,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){i.hls.trigger(P.Events.BUFFER_FLUSHED,{type:R})},onError:function(g){F.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",g)}}};s.type?D.append(A(s.type),s.type):this.getSourceBufferTypes().forEach(function(S){D.append(A(S),S)})},p.onFragParsed=function(u,s){var i=this,D=s.frag,A=s.part,S=[],R=A?A.elementaryStreams:D.elementaryStreams;R[I.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(R[I.ElementaryStreamTypes.AUDIO]&&S.push("audio"),R[I.ElementaryStreamTypes.VIDEO]&&S.push("video"));var O=function(){var _=self.performance.now();D.stats.buffering.end=_,A&&(A.stats.buffering.end=_);var h=A?A.stats:D.stats;i.hls.trigger(P.Events.FRAG_BUFFERED,{frag:D,part:A,stats:h,id:D.type})};S.length===0&&F.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+D.type+" level: "+D.level+" sn: "+D.sn),this.blockBuffers(O,S)},p.onFragChanged=function(u,s){this.flushBackBuffer()},p.onBufferEos=function(u,s){var i=this,D=this.getSourceBufferTypes().reduce(function(A,S){var R=i.sourceBuffer[S];return(!s.type||s.type===S)&&(R&&!R.ended&&(R.ended=!0,F.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),A&&!!(!R||R.ended)},!0);D&&this.blockBuffers(function(){var A=i.mediaSource;if(!A||A.readyState!=="open")return;A.endOfStream()})},p.onLevelUpdated=function(u,s){var i=s.details;if(!i.fragments.length)return;this.details=i,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},p.flushBackBuffer=function(){var u=this.hls,s=this.details,i=this.media,D=this.sourceBuffer;if(!i||s===null)return;var A=this.getSourceBufferTypes();if(!A.length)return;var S=s.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(z.isFiniteNumber)(S)||S<0)return;var R=i.currentTime,O=s.levelTargetDuration,g=Math.max(S,O),_=Math.floor(R/O)*O-g;A.forEach(function(h){var d=D[h];if(d){var C=K.BufferHelper.getBuffered(d);C.length>0&&_>C.start(0)&&(u.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:_}),s.live&&u.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:_}),u.trigger(P.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:_,type:h}))}})},p.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,s=this.hls,i=this.media,D=this.mediaSource,A=u.fragments[0].start+u.totalduration,S=i.duration,R=Object(z.isFiniteNumber)(D.duration)?D.duration:0;u.live&&s.config.liveDurationInfinity?(F.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),D.duration=Infinity,this.updateSeekableRange(u)):(A>R&&A>S||!Object(z.isFiniteNumber)(S))&&(F.logger.log("[buffer-controller]: Updating Media Source duration to "+A.toFixed(3)),D.duration=A)},p.updateSeekableRange=function(u){var s=this.mediaSource,i=u.fragments,D=i.length;if(D&&u.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var A=Math.max(0,i[0].start),S=Math.max(A,A+u.totalduration);s.setLiveSeekableRange(A,S)}},p.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,s=this.operationQueue,i=this.pendingTracks,D=Object.keys(i).length;if(D&&!u||D===2){this.createSourceBuffers(i),this.pendingTracks={};var A=this.getSourceBufferTypes();if(A.length===0){this.hls.trigger(P.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}A.forEach(function(S){s.executeNext(S)})}},p.createSourceBuffers=function(u){var s=this.sourceBuffer,i=this.mediaSource;if(!i)throw Error("createSourceBuffers called when mediaSource was null");var D=0;for(var A in u)if(!s[A]){var S=u[A];if(!S)throw Error("source buffer exists for track "+A+", however track does not");var R=S.levelCodec||S.codec,O=S.container+";codecs="+R;F.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var g=s[A]=i.addSourceBuffer(O),_=A;this.addBufferListener(_,"updatestart",this._onSBUpdateStart),this.addBufferListener(_,"updateend",this._onSBUpdateEnd),this.addBufferListener(_,"error",this._onSBUpdateError),this.tracks[A]={buffer:g,codec:R,container:S.container,levelCodec:S.levelCodec,id:S.id},D++}catch(h){F.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+h.message),this.hls.trigger(P.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,mimeType:O})}}D&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},p._onSBUpdateStart=function(u){var s=this.operationQueue,i=s.current(u);i.onStart()},p._onSBUpdateEnd=function(u){var s=this.operationQueue,i=s.current(u);i.onComplete(),s.shiftAndExecuteNext(u)},p._onSBUpdateError=function(u,s){F.logger.error("[buffer-controller]: "+u+" SourceBuffer error",s),this.hls.trigger(P.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var i=this.operationQueue.current(u);i&&i.onError(s)},p.removeExecutor=function(u,s,i){var D=this.media,A=this.mediaSource,S=this.operationQueue,R=this.sourceBuffer,O=R[u];if(!D||!A||!O){F.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(u);return}var g=Object(z.isFiniteNumber)(D.duration)?D.duration:Infinity,_=Object(z.isFiniteNumber)(A.duration)?A.duration:Infinity,h=Math.max(0,s),d=Math.min(i,g,_);d>h?(F.logger.log("[buffer-controller]: Removing ["+h+","+d+"] from the "+u+" SourceBuffer"),console.assert(!O.updating,u+" sourceBuffer must not be updating"),O.remove(h,d)):S.shiftAndExecuteNext(u)},p.appendExecutor=function(u,s){var i=this.operationQueue,D=this.sourceBuffer,A=D[s];if(!A){F.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),i.shiftAndExecuteNext(s);return}A.ended=!1,console.assert(!A.updating,s+" sourceBuffer must not be updating"),A.appendBuffer(u)},p.blockBuffers=function(u,s){var i=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){F.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var D=this.operationQueue,A=s.map(function(S){return D.appendBlocker(S)});Promise.all(A).then(function(){u(),s.forEach(function(S){var R=i.sourceBuffer[S];(!R||!R.updating)&&D.shiftAndExecuteNext(S)})})},p.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},p.addBufferListener=function(u,s,i){var D=this.sourceBuffer[u];if(!D)return;var A=i.bind(this,u);this.listeners[u].push({event:s,listener:A}),D.addEventListener(s,A)},p.removeBufferListeners=function(u){var s=this.sourceBuffer[u];if(!s)return;this.listeners[u].forEach(function(i){s.removeEventListener(i.event,i.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return P});var z=N("./src/utils/logger.ts"),P=function(){function F(K){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=K}var G=F.prototype;return G.append=function(n,I){var E=this.queues[I];E.push(n),E.length===1&&this.buffers[I]&&this.executeNext(I)},G.insertAbort=function(n,I){var E=this.queues[I];E.unshift(n),this.executeNext(I)},G.appendBlocker=function(n){var I,E=new Promise(function(b){I=b}),f={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,n),E},G.executeNext=function(n){var I=this.buffers,E=this.queues,f=I[n],b=E[n];if(b.length){var c=b[0];try{c.execute()}catch(a){z.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(a),(!f||!f.updating)&&(b.shift(),this.executeNext(n))}}},G.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},G.current=function(n){return this.queues[n][0]},F}()},"./src/controller/cap-level-controller.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts");function P(K,n){for(var I=0;I<n.length;I++){var E=n[I];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(K,E.key,E)}}function F(K,n,I){return n&&P(K.prototype,n),I&&P(K,I),K}var G=function(){function K(I){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=I,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var n=K.prototype;return n.setStreamController=function(E){this.streamController=E},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 E=this.hls;E.on(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),E.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),E.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),E.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var E=this.hls;E.off(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),E.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),E.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),E.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(E,f){K.isLevelAllowed(f.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(f.droppedLevel)},n.onMediaAttaching=function(E,f){this.media=f.media instanceof HTMLVideoElement?f.media:null},n.onManifestParsed=function(E,f){var b=this.hls;this.restrictedLevels=[],this.firstLevel=f.firstLevel,b.config.capLevelToPlayerSize&&f.video&&this.startCapping()},n.onBufferCodecs=function(E,f){var b=this.hls;b.config.capLevelToPlayerSize&&f.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var E=this.hls.levels;if(E.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(E.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},n.getMaxLevel=function(E){var f=this,b=this.hls.levels;if(!b.length)return-1;var c=b.filter(function(a,p){return K.isLevelAllowed(p,f.restrictedLevels)&&p<=E});return this.clientRect=null,K.getMaxLevelByMediaSize(c,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 E=this.media,f={width:0,height:0};if(E){var b=E.getBoundingClientRect();f.width=b.width,f.height=b.height,!f.width&&!f.height&&(f.width=b.right-b.left||E.width||0,f.height=b.bottom-b.top||E.height||0)}return this.clientRect=f,f},K.isLevelAllowed=function(E,f){return f===void 0&&(f=[]),f.indexOf(E)===-1},K.getMaxLevelByMediaSize=function(E,f,b){if(!E||!E.length)return-1;for(var c=function(s,i){return i?s.width!==i.width||s.height!==i.height:!0},a=E.length-1,p=0;p<E.length;p+=1){var l=E[p];if((l.width>=f||l.height>=b)&&c(l,E[p+1])){a=p;break}}return a},F(K,[{key:"mediaWidth",get:function(){return this.getDimensions().width*K.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*K.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var E=1;try{E=self.devicePixelRatio}catch(f){}return E}}]),K}();Y.default=G},"./src/controller/cmcd-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return c});var z=N("./src/events.ts"),P=N("./src/types/cmcd.ts"),F=N("./src/utils/buffer-helper.ts"),G=N("./src/utils/logger.ts");function K(a,p){for(var l=0;l<p.length;l++){var u=p[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(a,u.key,u)}}function n(a,p,l){return p&&K(a.prototype,p),l&&K(a,l),a}function I(a,p){var l=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(l)return(l=l.call(a)).next.bind(l);if(Array.isArray(a)||(l=E(a))||p&&a&&typeof a.length=="number"){l&&(a=l);var u=0;return function(){return u>=a.length?{done:!0}:{done:!1,value:a[u++]}}}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 E(a,p){if(!a)return;if(typeof a=="string")return f(a,p);var l=Object.prototype.toString.call(a).slice(8,-1);if(l==="Object"&&a.constructor&&(l=a.constructor.name),l==="Map"||l==="Set")return Array.from(a);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return f(a,p)}function f(a,p){(p==null||p>a.length)&&(p=a.length);for(var l=0,u=new Array(p);l<p;l++)u[l]=a[l];return u}function b(){return b=Object.assign||function(a){for(var p=1;p<arguments.length;p++){var l=arguments[p];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},b.apply(this,arguments)}var c=function(){function a(l){var u=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(){u.initialized&&(u.starved=!0),u.buffering=!0},this.onPlaying=function(){u.initialized||(u.initialized=!0),u.buffering=!1},this.applyPlaylistData=function(D){try{u.apply(D,{ot:P.CMCDObjectType.MANIFEST,su:!u.initialized})}catch(A){G.logger.warn("Could not generate manifest CMCD data.",A)}},this.applyFragmentData=function(D){try{var A=D.frag,S=u.hls.levels[A.level],R=u.getObjectType(A),O={d:A.duration*1e3,ot:R};(R===P.CMCDObjectType.VIDEO||R===P.CMCDObjectType.AUDIO||R==P.CMCDObjectType.MUXED)&&(O.br=S.bitrate/1e3,O.tb=u.getTopBandwidth(R),O.bl=u.getBufferLength(R)),u.apply(D,O)}catch(g){G.logger.warn("Could not generate segment CMCD data.",g)}},this.hls=l;var s=this.config=l.config,i=s.cmcd;i!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||a.uuid(),this.cid=i.contentId,this.useHeaders=i.useHeaders===!0,this.registerListeners())}var p=a.prototype;return p.registerListeners=function(){var u=this.hls;u.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.on(z.Events.BUFFER_CREATED,this.onBufferCreated,this)},p.unregisterListeners=function(){var u=this.hls;u.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.off(z.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},p.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},p.onMediaAttached=function(u,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},p.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},p.onBufferCreated=function(u,s){var i,D;this.audioBuffer=(i=s.tracks.audio)===null||i===void 0?void 0:i.buffer,this.videoBuffer=(D=s.tracks.video)===null||D===void 0?void 0:D.buffer},p.createData=function(){var u;return{v:P.CMCDVersion,sf:P.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(u=this.media)===null||u===void 0?void 0:u.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},p.apply=function(u,s){s===void 0&&(s={}),b(s,this.createData());var i=s.ot===P.CMCDObjectType.INIT||s.ot===P.CMCDObjectType.VIDEO||s.ot===P.CMCDObjectType.MUXED;if(this.starved&&i&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var D=a.toHeaders(s);if(!Object.keys(D).length)return;u.headers||(u.headers={}),b(u.headers,D)}else{var A=a.toQuery(s);if(!A)return;u.url=a.appendQueryToUri(u.url,A)}},p.getObjectType=function(u){var s=u.type;return s==="subtitle"?P.CMCDObjectType.TIMED_TEXT:u.sn==="initSegment"?P.CMCDObjectType.INIT:s==="audio"?P.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?P.CMCDObjectType.VIDEO:P.CMCDObjectType.MUXED:void 0},p.getTopBandwidth=function(u){for(var s=0,i=u===P.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,D=I(i),A;!(A=D()).done;){var S=A.value;S.bitrate>s&&(s=S.bitrate)}return s>0?s:NaN},p.getBufferLength=function(u){var s=this.hls.media,i=u===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!i||!s)return NaN;var D=F.BufferHelper.bufferInfo(i,s.currentTime,this.config.maxBufferHole);return D.len*1e3},p.createPlaylistLoader=function(){var u=this.config.pLoader,s=this.applyPlaylistData,i=u||this.config.loader;return function(){function D(S){this.loader=void 0,this.loader=new i(S)}var A=D.prototype;return A.destroy=function(){this.loader.destroy()},A.abort=function(){this.loader.abort()},A.load=function(R,O,g){s(R),this.loader.load(R,O,g)},n(D,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),D}()},p.createFragmentLoader=function(){var u=this.config.fLoader,s=this.applyFragmentData,i=u||this.config.loader;return function(){function D(S){this.loader=void 0,this.loader=new i(S)}var A=D.prototype;return A.destroy=function(){this.loader.destroy()},A.abort=function(){this.loader.abort()},A.load=function(R,O,g){s(R),this.loader.load(R,O,g)},n(D,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),D}()},a.uuid=function(){var u=URL.createObjectURL(new Blob),s=u.toString();return URL.revokeObjectURL(u),s.substr(s.lastIndexOf("/")+1)},a.serialize=function(u){for(var s=[],i=function(W){return!Number.isNaN(W)&&W!=null&&W!==""&&W!==!1},D=function(W){return Math.round(W)},A=function(W){return D(W/100)*100},S=function(W){return encodeURIComponent(W)},R={br:D,d:D,bl:A,dl:A,mtp:A,nor:S,rtp:A,tb:D},O=Object.keys(u||{}).sort(),g=I(O),_;!(_=g()).done;){var h=_.value,d=u[h];if(!i(d))continue;if(h==="v"&&d===1)continue;if(h=="pr"&&d===1)continue;var C=R[h];C&&(d=C(d));var x=typeof d,w=void 0;h==="ot"||h==="sf"||h==="st"?w=h+"="+d:x==="boolean"?w=h:x==="number"?w=h+"="+d:w=h+"="+JSON.stringify(d),s.push(w)}return s.join(",")},a.toHeaders=function(u){for(var s=Object.keys(u),i={},D=["Object","Request","Session","Status"],A=[{},{},{},{}],S={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},R=0,O=s;R<O.length;R++){var g=O[R],_=S[g]!=null?S[g]:1;A[_][g]=u[g]}for(var h=0;h<A.length;h++){var d=a.serialize(A[h]);d&&(i["CMCD-"+D[h]]=d)}return i},a.toQuery=function(u){return"CMCD="+encodeURIComponent(a.serialize(u))},a.appendQueryToUri=function(u,s){if(!s)return u;var i=u.includes("?")?"&":"?";return""+u+i+s},a}()},"./src/controller/eme-controller.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts"),P=N("./src/errors.ts"),F=N("./src/utils/logger.ts"),G=N("./src/utils/mediakeys-helper.ts");function K(c,a){for(var p=0;p<a.length;p++){var l=a[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(c,l.key,l)}}function n(c,a,p){return a&&K(c.prototype,a),p&&K(c,p),c}var I=3,E=function(a,p,l){var u={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(s){u.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:l.audioRobustness||""})}),p.forEach(function(s){u.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:l.videoRobustness||""})}),[u]},f=function(a,p,l,u){switch(a){case G.KeySystems.WIDEVINE:return E(p,l,u);default:throw new Error("Unknown key-system: "+a)}},b=function(){function c(p){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=p,this._config=p.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=c.prototype;return a.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},a._registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a._unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a.getLicenseServerUrl=function(l){switch(l){case G.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},a._attemptKeySystemAccess=function(l,u,s){var i=this,D=f(l,u,s,this._drmSystemOptions);F.logger.log("Requesting encrypted media key-system access");var A=this.requestMediaKeySystemAccess(l,D);this.mediaKeysPromise=A.then(function(S){return i._onMediaKeySystemAccessObtained(l,S)}),A.catch(function(S){F.logger.error('Failed to obtain key-system "'+l+'" access:',S)})},a._onMediaKeySystemAccessObtained=function(l,u){var s=this;F.logger.log('Access for key-system "'+l+'" obtained');var i={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:u,mediaKeySystemDomain:l};this._mediaKeysList.push(i);var D=Promise.resolve().then(function(){return u.createMediaKeys()}).then(function(A){return i.mediaKeys=A,F.logger.log('Media-keys created for key-system "'+l+'"'),s._onMediaKeysCreated(),A});return D.catch(function(A){F.logger.error("Failed to create media-keys:",A)}),D},a._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(u){u.mediaKeysSession||(u.mediaKeysSession=u.mediaKeys.createSession(),l._onNewMediaKeySession(u.mediaKeysSession))})},a._onNewMediaKeySession=function(l){var u=this;F.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(s){u._onKeySessionMessage(l,s.message)},!1)},a._onKeySessionMessage=function(l,u){F.logger.log("Got EME message event, creating license request"),this._requestLicense(u,function(s){F.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),l.update(s)})},a.onMediaEncrypted=function(l){var u=this;if(F.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){F.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(D){if(!u._media)return;u._attemptSetMediaKeys(D),u._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(s).catch(s)},a._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var u=this._mediaKeysList[0];if(!u||!u.mediaKeys){F.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}F.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(u.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(l,u){var s=this,i=this._mediaKeysList[0];if(!i){F.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(i.mediaKeysSessionInitialized){F.logger.warn("Key-Session already initialized but requested again");return}var D=i.mediaKeysSession;if(!D){F.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!u){F.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}F.logger.log('Generating key-session request for "'+l+'" init data type'),i.mediaKeysSessionInitialized=!0,D.generateRequest(l,u).then(function(){F.logger.debug("Key-session generation succeeded")}).catch(function(A){F.logger.error("Error generating key-session request:",A),s.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._createLicenseXhr=function(l,u,s){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,i,l,u,s);var D=this._licenseXhrSetup;if(D)try{D.call(this.hls,i,l),D=void 0}catch(A){F.logger.error(A)}try{i.readyState||i.open("POST",l,!0),D&&D.call(this.hls,i,l)}catch(A){throw new Error("issue setting up KeySystem license XHR "+A)}return i},a._onLicenseRequestReadyStageChange=function(l,u,s,i){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,F.logger.log("License request succeeded");var D=l.response,A=this._licenseResponseCallback;if(A)try{D=A.call(this.hls,l,u)}catch(R){F.logger.error(R)}i(D)}else{if(F.logger.error("License Request XHR failed ("+u+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>I){this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=I-this._requestLicenseFailureCount+1;F.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(s,i)}break}},a._generateLicenseRequestChallenge=function(l,u){switch(l.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},a._requestLicense=function(l,u){F.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){F.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var i=this.getLicenseServerUrl(s.mediaKeySystemDomain),D=this._createLicenseXhr(i,l,u);F.logger.log("Sending license request to URL: "+i);var A=this._generateLicenseRequestChallenge(s,l);D.send(A)}catch(S){F.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(l,u){if(!this._emeEnabled)return;var s=u.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},a.onMediaDetached=function(){var l=this._media,u=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(u.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},a.onManifestParsed=function(l,u){if(!this._emeEnabled)return;var s=u.levels.map(function(D){return D.audioCodec}).filter(function(D){return!!D}),i=u.levels.map(function(D){return D.videoCodec}).filter(function(D){return!!D});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,s,i)},n(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();Y.default=b},"./src/controller/fps-controller.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts"),P=N("./src/utils/logger.ts"),F=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 K=G.prototype;return K.setStreamController=function(I){this.streamController=I},K.registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},K.unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching)},K.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},K.onMediaAttaching=function(I,E){var f=this.hls.config;if(f.capLevelOnFPSDrop){var b=E.media instanceof self.HTMLVideoElement?E.media:null;this.media=b,b&&typeof b.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),f.fpsDroppedMonitoringPeriod)}},K.checkFPS=function(I,E,f){var b=performance.now();if(E){if(this.lastTime){var c=b-this.lastTime,a=f-this.lastDroppedFrames,p=E-this.lastDecodedFrames,l=1e3*a/c,u=this.hls;if(u.trigger(z.Events.FPS_DROP,{currentDropped:a,currentDecoded:p,totalDroppedFrames:f}),l>0&&a>u.config.fpsDroppedMonitoringThreshold*p){var s=u.currentLevel;P.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=s)&&(s=s-1,u.trigger(z.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:u.currentLevel}),u.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=b,this.lastDroppedFrames=f,this.lastDecodedFrames=E}},K.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var E=I.getVideoPlaybackQuality();this.checkFPS(I,E.totalVideoFrames,E.droppedVideoFrames)}else this.checkFPS(I,I.webkitDecodedFrameCount,I.webkitDroppedFrameCount)},G}();Y.default=F},"./src/controller/fragment-finders.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"findFragmentByPDT",function(){return F}),N.d(Y,"findFragmentByPTS",function(){return G}),N.d(Y,"fragmentWithinToleranceTest",function(){return K}),N.d(Y,"pdtWithinToleranceTest",function(){return n}),N.d(Y,"findFragWithCC",function(){return I});var z=N("./src/polyfills/number.ts"),P=N("./src/utils/binary-search.ts");function F(E,f,b){if(f===null||!Array.isArray(E)||!E.length||!Object(z.isFiniteNumber)(f))return null;var c=E[0].programDateTime;if(f<(c||0))return null;var a=E[E.length-1].endProgramDateTime;if(f>=(a||0))return null;b=b||0;for(var p=0;p<E.length;++p){var l=E[p];if(n(f,b,l))return l}return null}function G(E,f,b,c){b===void 0&&(b=0),c===void 0&&(c=0);var a=null;if(E?a=f[E.sn-f[0].sn+1]||null:b===0&&f[0].start===0&&(a=f[0]),a&&K(b,c,a)===0)return a;var p=P.default.search(f,K.bind(null,b,c));return p||a}function K(E,f,b){E===void 0&&(E=0),f===void 0&&(f=0);var c=Math.min(f,b.duration+(b.deltaPTS?b.deltaPTS:0));return b.start+b.duration-c<=E?1:b.start-c>E&&b.start?-1:0}function n(E,f,b){var c=Math.min(f,b.duration+(b.deltaPTS?b.deltaPTS:0))*1e3,a=b.endProgramDateTime||0;return a-c>E}function I(E,f){return P.default.search(E,function(b){return b.cc<f?1:b.cc>f?-1:0})}},"./src/controller/fragment-tracker.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"FragmentState",function(){return F}),N.d(Y,"FragmentTracker",function(){return G});var z=N("./src/events.ts"),P=N("./src/types/loader.ts"),F;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(F||(F={}));var G=function(){function I(f){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=f,this._registerListeners()}var E=I.prototype;return E._registerListeners=function(){var b=this.hls;b.on(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),b.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),b.on(z.Events.FRAG_LOADED,this.onFragLoaded,this)},E._unregisterListeners=function(){var b=this.hls;b.off(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),b.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),b.off(z.Events.FRAG_LOADED,this.onFragLoaded,this)},E.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},E.getAppendedFrag=function(b,c){if(c===P.PlaylistLevelType.MAIN){var a=this.activeFragment,p=this.activeParts;if(!a)return null;if(p)for(var l=p.length;l--;){var u=p[l],s=u?u.end:a.appendedPTS;if(u.start<=b&&s!==void 0&&b<=s)return l>9&&(this.activeParts=p.slice(l-9)),u}else if(a.start<=b&&a.appendedPTS!==void 0&&b<=a.appendedPTS)return a}return this.getBufferedFrag(b,c)},E.getBufferedFrag=function(b,c){for(var a=this.fragments,p=Object.keys(a),l=p.length;l--;){var u=a[p[l]];if((u==null?void 0:u.body.type)===c&&u.buffered){var s=u.body;if(s.start<=b&&b<=s.end)return s}}return null},E.detectEvictedFragments=function(b,c,a){var p=this;Object.keys(this.fragments).forEach(function(l){var u=p.fragments[l];if(!u)return;if(!u.buffered){u.body.type===a&&p.removeFragment(u.body);return}var s=u.range[b];if(!s)return;s.time.some(function(i){var D=!p.isTimeBuffered(i.startPTS,i.endPTS,c);return D&&p.removeFragment(u.body),D})})},E.detectPartialFragments=function(b){var c=this,a=this.timeRanges,p=b.frag,l=b.part;if(!a||p.sn==="initSegment")return;var u=n(p),s=this.fragments[u];if(!s)return;Object.keys(a).forEach(function(i){var D=p.elementaryStreams[i];if(!D)return;var A=a[i],S=l!==null||D.partial===!0;s.range[i]=c.getBufferedTimes(p,l,S,A)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},E.fragBuffered=function(b){var c=n(b),a=this.fragments[c];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},E.getBufferedTimes=function(b,c,a,p){for(var l={time:[],partial:a},u=c?c.start:b.start,s=c?c.end:b.end,i=b.minEndPTS||s,D=b.maxStartPTS||u,A=0;A<p.length;A++){var S=p.start(A)-this.bufferPadding,R=p.end(A)+this.bufferPadding;if(D>=S&&i<=R){l.time.push({startPTS:Math.max(u,p.start(A)),endPTS:Math.min(s,p.end(A))});break}else if(u<R&&s>S)l.partial=!0,l.time.push({startPTS:Math.max(u,p.start(A)),endPTS:Math.min(s,p.end(A))});else if(s<=S)break}return l},E.getPartialFragment=function(b){var c=null,a,p,l,u=0,s=this.bufferPadding,i=this.fragments;return Object.keys(i).forEach(function(D){var A=i[D];if(!A)return;K(A)&&(p=A.body.start-s,l=A.body.end+s,b>=p&&b<=l&&(a=Math.min(b-p,l-b),u<=a&&(c=A.body,u=a)))}),c},E.getState=function(b){var c=n(b),a=this.fragments[c];return a?a.buffered?K(a)?F.PARTIAL:F.OK:a.backtrack?F.BACKTRACKED:F.APPENDING:F.NOT_LOADED},E.backtrack=function(b,c){var a=n(b),p=this.fragments[a];if(!p||p.backtrack)return null;var l=p.backtrack=c||p.loaded;return p.loaded=null,l},E.getBacktrackData=function(b){var c=n(b),a=this.fragments[c];if(a){var p,l=a.backtrack;if(l!=null&&(p=l.payload)!==null&&p!==void 0&&p.byteLength)return l;this.removeFragment(b)}return null},E.isTimeBuffered=function(b,c,a){for(var p,l,u=0;u<a.length;u++){if(p=a.start(u)-this.bufferPadding,l=a.end(u)+this.bufferPadding,b>=p&&c<=l)return!0;if(c<=p)return!1}return!1},E.onFragLoaded=function(b,c){var a=c.frag,p=c.part;if(a.sn==="initSegment"||a.bitrateTest||p)return;var l=n(a);this.fragments[l]={body:a,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},E.onBufferAppended=function(b,c){var a=this,p=c.frag,l=c.part,u=c.timeRanges;if(p.type===P.PlaylistLevelType.MAIN)if(this.activeFragment=p,l){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(l)}else this.activeParts=null;this.timeRanges=u,Object.keys(u).forEach(function(i){var D=u[i];if(a.detectEvictedFragments(i,D),!l)for(var A=0;A<D.length;A++)p.appendedPTS=Math.max(D.end(A),p.appendedPTS||0)})},E.onFragBuffered=function(b,c){this.detectPartialFragments(c)},E.hasFragment=function(b){var c=n(b);return!!this.fragments[c]},E.removeFragmentsInRange=function(b,c,a){var p=this;Object.keys(this.fragments).forEach(function(l){var u=p.fragments[l];if(!u)return;if(u.buffered){var s=u.body;s.type===a&&s.start<c&&s.end>b&&p.removeFragment(s)}})},E.removeFragment=function(b){var c=n(b);b.stats.loaded=0,b.clearElementaryStreamInfo(),delete this.fragments[c]},E.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function K(I){var E,f;return I.buffered&&(((E=I.range.video)===null||E===void 0?void 0:E.partial)||((f=I.range.audio)===null||f===void 0?void 0:f.partial))}function n(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"STALL_MINIMUM_DURATION_MS",function(){return K}),N.d(Y,"MAX_START_GAP_JUMP",function(){return n}),N.d(Y,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),N.d(Y,"SKIP_BUFFER_RANGE_START",function(){return E}),N.d(Y,"default",function(){return f});var z=N("./src/utils/buffer-helper.ts"),P=N("./src/errors.ts"),F=N("./src/events.ts"),G=N("./src/utils/logger.ts"),K=250,n=2,I=.1,E=.05,f=function(){function b(a,p,l,u){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=p,this.fragmentTracker=l,this.hls=u}var c=b.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(p){var l=this.config,u=this.media,s=this.stalled,i=u.currentTime,D=u.seeking,A=this.seeking&&!D,S=!this.seeking&&D;if(this.seeking=D,i!==p){if(this.moved=!0,s!==null){if(this.stallReported){var R=self.performance.now()-s;G.logger.warn("playback not stuck anymore @"+i+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||A)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!z.BufferHelper.getBuffered(u).length)return;var O=z.BufferHelper.bufferInfo(u,i,0),g=O.len>0,_=O.nextStart||0;if(!g&&!_)return;if(D){var h=O.len>n,d=!_||_-i>n&&!this.fragmentTracker.getPartialFragment(i);if(h||d)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var C,x=Math.max(_,O.start||0)-i,w=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,j=w==null||((C=w.details)===null||C===void 0)?void 0:C.live,W=j?w.details.targetduration*2:n;if(x>0&&x<=W){this._trySkipBufferHole(null);return}}var T=self.performance.now();if(s===null){this.stalled=T;return}var M=T-s;!D&&M>=K&&this._reportStall(O.len);var m=z.BufferHelper.bufferInfo(u,i,l.maxBufferHole);this._tryFixBufferStall(m,M)},c._tryFixBufferStall=function(p,l){var u=this.config,s=this.fragmentTracker,i=this.media,D=i.currentTime,A=s.getPartialFragment(D);if(A){var S=this._trySkipBufferHole(A);if(S)return}p.len>u.maxBufferHole&&l>u.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(p){var l=this.hls,u=this.media,s=this.stallReported;s||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+p+")"),l.trigger(F.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p}))},c._trySkipBufferHole=function(p){for(var l=this.config,u=this.hls,s=this.media,i=s.currentTime,D=0,A=z.BufferHelper.getBuffered(s),S=0;S<A.length;S++){var R=A.start(S);if(i+l.maxBufferHole>=D&&i<R){var O=Math.max(R+E,s.currentTime+I);return G.logger.warn("skipping hole, adjusting currentTime from "+i+" to "+O),this.moved=!0,this.stalled=null,s.currentTime=O,p&&u.trigger(F.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+i+" to "+O,frag:p}),O}D=A.end(S)}return 0},c._tryNudgeBuffer=function(){var p=this.config,l=this.hls,u=this.media,s=u.currentTime,i=(this.nudgeRetry||0)+1;if(this.nudgeRetry=i,i<p.nudgeMaxRetry){var D=s+i*p.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+s+" to "+D),u.currentTime=D,l.trigger(F.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else G.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+p.nudgeMaxRetry+" nudges"),l.trigger(F.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},b}()},"./src/controller/id3-track-controller.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts"),P=N("./src/utils/texttrack-utils.ts"),F=N("./src/demux/id3.ts"),G=.25,K=function(){function n(E){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=E,this._registerListeners()}var I=n.prototype;return I.destroy=function(){this._unregisterListeners()},I._registerListeners=function(){var f=this.hls;f.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I._unregisterListeners=function(){var f=this.hls;f.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I.onMediaAttached=function(f,b){this.media=b.media},I.onMediaDetaching=function(){if(!this.id3Track)return;Object(P.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},I.getID3Track=function(f){if(!this.media)return;for(var b=0;b<f.length;b++){var c=f[b];if(c.kind==="metadata"&&c.label==="id3")return Object(P.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},I.onFragParsingMetadata=function(f,b){if(!this.media)return;var c=b.frag,a=b.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var p=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<a.length;l++){var u=F.getID3Frames(a[l].data);if(u){var s=a[l].pts,i=l<a.length-1?a[l+1].pts:c.end,D=i-s;D<=0&&(i=s+G);for(var A=0;A<u.length;A++){var S=u[A];if(!F.isTimeStampFrame(S)){var R=new p(s,i,"");R.value=S,this.id3Track.addCue(R)}}}}},I.onBufferFlushing=function(f,b){var c=b.startOffset,a=b.endOffset,p=b.type;if(!p||p==="audio"){var l=this.id3Track;l&&Object(P.removeCuesInRange)(l,c,a)}},n}();Y.default=K},"./src/controller/latency-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return n});var z=N("./src/errors.ts"),P=N("./src/events.ts"),F=N("./src/utils/logger.ts");function G(I,E){for(var f=0;f<E.length;f++){var b=E[f];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(I,b.key,b)}}function K(I,E,f){return E&&G(I.prototype,E),f&&G(I,f),I}var n=function(){function I(f){var b=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 b.timeupdate()},this.hls=f,this.config=f.config,this.registerListeners()}var E=I.prototype;return E.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},E.registerListeners=function(){this.hls.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(P.Events.ERROR,this.onError,this)},E.unregisterListeners=function(){this.hls.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(P.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(P.Events.ERROR,this.onError)},E.onMediaAttached=function(b,c){this.media=c.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},E.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},E.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},E.onLevelUpdated=function(b,c){var a=c.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},E.onError=function(b,c){if(c.details!==z.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,F.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},E.timeupdate=function(){var b=this.media,c=this.levelDetails;if(!b||!c)return;this.currentTime=b.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var p=this.config,l=p.lowLatencyMode,u=p.maxLiveSyncPlaybackRate;if(!l||u===1)return;var s=this.targetLatency;if(s===null)return;var i=a-s,D=Math.min(this.maxLatency,s+c.targetduration),A=i<D;if(c.live&&A&&i>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,u)),R=Math.round(2/(1+Math.exp(-.75*i-this.edgeStalled))*20)/20;b.playbackRate=Math.min(S,Math.max(1,R))}else b.playbackRate!==1&&b.playbackRate!==0&&(b.playbackRate=1)},E.estimateLiveEdge=function(){var b=this.levelDetails;return b===null?null:b.edge+b.age},E.computeLatency=function(){var b=this.estimateLiveEdge();return b===null?null:b-this.currentTime},K(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var b=this.config,c=this.levelDetails;return b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:c?b.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var b=this.levelDetails;if(b===null)return null;var c=b.holdBack,a=b.partHoldBack,p=b.targetduration,l=this.config,u=l.liveSyncDuration,s=l.liveSyncDurationCount,i=l.lowLatencyMode,D=this.hls.userConfig,A=i&&a||c;(D.liveSyncDuration||D.liveSyncDurationCount||A===0)&&(A=u!==void 0?u:s*p);var S=p,R=1;return A+Math.min(this.stallCount*R,S)}},{key:"liveSyncPosition",get:function(){var b=this.estimateLiveEdge(),c=this.targetLatency,a=this.levelDetails;if(b===null||c===null||a===null)return null;var p=a.edge,l=b-c-this.edgeStalled,u=p-a.totalduration,s=p-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(u,l),s)}},{key:"drift",get:function(){var b=this.levelDetails;return b===null?1:b.drift}},{key:"edgeStalled",get:function(){var b=this.levelDetails;if(b===null)return 0;var c=(this.config.lowLatencyMode&&b.partTarget||b.targetduration)*3;return Math.max(b.age-c,0)}},{key:"forwardBufferLength",get:function(){var b=this.media,c=this.levelDetails;if(!b||!c)return 0;var a=b.buffered.length;return a?b.buffered.end(a-1):c.edge-this.currentTime}}]),I}()},"./src/controller/level-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return l});var z=N("./src/types/level.ts"),P=N("./src/events.ts"),F=N("./src/errors.ts"),G=N("./src/utils/codecs.ts"),K=N("./src/controller/level-helper.ts"),n=N("./src/controller/base-playlist-controller.ts"),I=N("./src/types/loader.ts");function E(){return E=Object.assign||function(u){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var D in i)Object.prototype.hasOwnProperty.call(i,D)&&(u[D]=i[D])}return u},E.apply(this,arguments)}function f(u,s){for(var i=0;i<s.length;i++){var D=s[i];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(u,D.key,D)}}function b(u,s,i){return s&&f(u.prototype,s),i&&f(u,i),u}function c(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,a(u,s)}function a(u,s){return a=Object.setPrototypeOf||function(D,A){return D.__proto__=A,D},a(u,s)}var p=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(u){c(s,u);function s(D){var A;return A=u.call(this,D,"[level-controller]")||this,A._levels=[],A._firstLevel=-1,A._startLevel=void 0,A.currentLevelIndex=-1,A.manualLevelIndex=-1,A.onParsedComplete=void 0,A._registerListeners(),A}var i=s.prototype;return i._registerListeners=function(){var A=this.hls;A.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),A.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),A.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),A.on(P.Events.ERROR,this.onError,this)},i._unregisterListeners=function(){var A=this.hls;A.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),A.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),A.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),A.off(P.Events.ERROR,this.onError,this)},i.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,u.prototype.destroy.call(this)},i.startLoad=function(){var A=this._levels;A.forEach(function(S){S.loadError=0}),u.prototype.startLoad.call(this)},i.onManifestLoaded=function(A,S){var R=[],O=[],g=[],_,h={},d,C=!1,x=!1,w=!1;if(S.levels.forEach(function(M){var m=M.attrs;C=C||!!(M.width&&M.height),x=x||!!M.videoCodec,w=w||!!M.audioCodec,p&&M.audioCodec&&M.audioCodec.indexOf("mp4a.40.34")!==-1&&(M.audioCodec=void 0);var v=M.bitrate+"-"+M.attrs.RESOLUTION+"-"+M.attrs.CODECS;d=h[v],d?d.url.push(M.url):(d=new z.Level(M),h[v]=d,R.push(d)),m&&(m.AUDIO&&Object(K.addGroupId)(d,"audio",m.AUDIO),m.SUBTITLES&&Object(K.addGroupId)(d,"text",m.SUBTITLES))}),(C||x)&&w&&(R=R.filter(function(M){var m=M.videoCodec,v=M.width,H=M.height;return!!m||!!(v&&H)})),R=R.filter(function(M){var m=M.audioCodec,v=M.videoCodec;return(!m||Object(G.isCodecSupportedInMp4)(m,"audio"))&&(!v||Object(G.isCodecSupportedInMp4)(v,"video"))}),S.audioTracks&&(O=S.audioTracks.filter(function(M){return!M.audioCodec||Object(G.isCodecSupportedInMp4)(M.audioCodec,"audio")}),Object(K.assignTrackIdsByGroup)(O)),S.subtitles&&(g=S.subtitles,Object(K.assignTrackIdsByGroup)(g)),R.length>0){_=R[0].bitrate,R.sort(function(M,m){return M.bitrate-m.bitrate}),this._levels=R;for(var j=0;j<R.length;j++)if(R[j].bitrate===_){this._firstLevel=j,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+_);break}var W=w&&!x,T={levels:R,audioTracks:O,subtitleTracks:g,firstLevel:this._firstLevel,stats:S.stats,audio:w,video:x,altAudio:!W&&O.some(function(M){return!!M.url})};this.hls.trigger(P.Events.MANIFEST_PARSED,T),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(P.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},i.onError=function(A,S){if(u.prototype.onError.call(this,A,S),S.fatal)return;var R=S.context,O=this._levels[this.currentLevelIndex];if(R&&(R.type===I.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&R.groupId===O.audioGroupIds[O.urlId]||R.type===I.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&R.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var g=!1,_=!0,h;switch(S.details){case F.ErrorDetails.FRAG_LOAD_ERROR:case F.ErrorDetails.FRAG_LOAD_TIMEOUT:case F.ErrorDetails.KEY_LOAD_ERROR:case F.ErrorDetails.KEY_LOAD_TIMEOUT:if(S.frag){var d=this._levels[S.frag.level];d?(d.fragmentError++,d.fragmentError>this.hls.config.fragLoadingMaxRetry&&(h=S.frag.level)):h=S.frag.level}break;case F.ErrorDetails.LEVEL_LOAD_ERROR:case F.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(_=!1),h=R.level),g=!0;break;case F.ErrorDetails.REMUX_ALLOC_ERROR:h=S.level,g=!0;break}h!==void 0&&this.recoverLevel(S,h,g,_)},i.recoverLevel=function(A,S,R,O){var g=A.details,_=this._levels[S];if(_.loadError++,R){var h=this.retryLoadingOrFail(A);if(h)A.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var d=_.url.length;if(d>1&&_.loadError<d)A.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var C=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==C&&this._levels[C].loadError===0&&(this.warn(g+": switch to "+C),A.levelRetry=!0,this.hls.nextAutoLevel=C)}}},i.redundantFailover=function(A){var S=this._levels[A],R=S.url.length;if(R>1){var O=(S.urlId+1)%R;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(g){g.urlId=O}),this.level=A}},i.onFragLoaded=function(A,S){var R=S.frag;if(R!==void 0&&R.type===I.PlaylistLevelType.MAIN){var O=this._levels[R.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},i.onLevelLoaded=function(A,S){var R,O=S.level,g=S.details,_=this._levels[O];if(!_){var h;this.warn("Invalid level index "+O),(h=S.deliveryDirectives)!==null&&h!==void 0&&h.skip&&(g.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(_.fragmentError===0&&(_.loadError=0,this.retryCount=0),this.playlistLoaded(O,S,_.details)):(R=S.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(g.deltaUpdateFailed=!0)},i.onAudioTrackSwitched=function(A,S){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var O=-1,g=this.hls.audioTracks[S.id].groupId,_=0;_<R.audioGroupIds.length;_++)if(R.audioGroupIds[_]===g){O=_;break}O!==R.urlId&&(R.urlId=O,this.startLoad())}},i.loadPlaylist=function(A){var S=this.currentLevelIndex,R=this._levels[S];if(this.canLoad&&R&&R.url.length>0){var O=R.urlId,g=R.url[O];if(A)try{g=A.addDirectives(g)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("Attempt loading level index "+S+(A?" at sn "+A.msn+" part "+A.part:"")+" with URL-id "+O+" "+g),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:g,level:S,id:O,deliveryDirectives:A||null})}},i.removeLevel=function(A,S){var R=function(_,h){return h!==S},O=this._levels.filter(function(g,_){return _!==A?!0:g.url.length>1&&S!==void 0?(g.url=g.url.filter(R),g.audioGroupIds&&(g.audioGroupIds=g.audioGroupIds.filter(R)),g.textGroupIds&&(g.textGroupIds=g.textGroupIds.filter(R)),g.urlId=0,!0):!1}).map(function(g,_){var h=g.details;return h!=null&&h.fragments&&h.fragments.forEach(function(d){d.level=_}),g});this._levels=O,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:O})},b(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(A){var S,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===A&&(S=R[A])!==null&&S!==void 0&&S.details)return;if(A<0||A>=R.length){var O=A<0;if(this.hls.trigger(P.Events.ERROR,{type:F.ErrorTypes.OTHER_ERROR,details:F.ErrorDetails.LEVEL_SWITCH_ERROR,level:A,fatal:O,reason:"invalid level idx"}),O)return;A=Math.min(A,R.length-1)}this.clearTimer();var g=this.currentLevelIndex,_=R[g],h=R[A];this.log("switching to level "+A+" from "+g),this.currentLevelIndex=A;var d=E({},h,{level:A,maxBitrate:h.maxBitrate,uri:h.uri,urlId:h.urlId});delete d._urlId,this.hls.trigger(P.Events.LEVEL_SWITCHING,d);var C=h.details;if(!C||C.live){var x=this.switchParams(h.uri,_==null?void 0:_.details);this.loadPlaylist(x)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(A){this.manualLevelIndex=A,this._startLevel===void 0&&(this._startLevel=A),A!==-1&&(this.level=A)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(A){this._firstLevel=A}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var A=this.hls.config.startLevel;return A!==void 0?A:this._firstLevel}else return this._startLevel},set:function(A){this._startLevel=A}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(A){this.level=A,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=A)}}]),s}(n.default)},"./src/controller/level-helper.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"addGroupId",function(){return F}),N.d(Y,"assignTrackIdsByGroup",function(){return G}),N.d(Y,"updatePTS",function(){return K}),N.d(Y,"updateFragPTSDTS",function(){return I}),N.d(Y,"mergeDetails",function(){return E}),N.d(Y,"mapPartIntersection",function(){return f}),N.d(Y,"mapFragmentIntersection",function(){return b}),N.d(Y,"adjustSliding",function(){return c}),N.d(Y,"addSliding",function(){return a}),N.d(Y,"computeReloadInterval",function(){return p}),N.d(Y,"getFragmentWithSN",function(){return l}),N.d(Y,"getPartWith",function(){return u});var z=N("./src/polyfills/number.ts"),P=N("./src/utils/logger.ts");function F(s,i,D){switch(i){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(D);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(D);break}}function G(s){var i={};s.forEach(function(D){var A=D.groupId||"";D.id=i[A]=i[A]||0,i[A]++})}function K(s,i,D){var A=s[i],S=s[D];n(A,S)}function n(s,i){var D=i.startPTS;if(Object(z.isFiniteNumber)(D)){var A=0,S;i.sn>s.sn?(A=D-s.start,S=s):(A=s.start-D,S=i),S.duration!==A&&(S.duration=A)}else if(i.sn>s.sn){var R=s.cc===i.cc;R&&s.minEndPTS?i.start=s.start+(s.minEndPTS-s.start):i.start=s.start+s.duration}else i.start=Math.max(s.start-i.duration,0)}function I(s,i,D,A,S,R){var O=A-D;O<=0&&(P.logger.warn("Fragment should have a positive duration",i),A=D+i.duration,R=S+i.duration);var g=D,_=A,h=i.startPTS,d=i.endPTS;if(Object(z.isFiniteNumber)(h)){var C=Math.abs(h-D);Object(z.isFiniteNumber)(i.deltaPTS)?i.deltaPTS=Math.max(C,i.deltaPTS):i.deltaPTS=C,g=Math.max(D,h),D=Math.min(D,h),S=Math.min(S,i.startDTS),_=Math.min(A,d),A=Math.max(A,d),R=Math.max(R,i.endDTS)}i.duration=A-D;var x=D-i.start;i.appendedPTS=A,i.start=i.startPTS=D,i.maxStartPTS=g,i.startDTS=S,i.endPTS=A,i.minEndPTS=_,i.endDTS=R;var w=i.sn;if(!s||w<s.startSN||w>s.endSN)return 0;var j,W=w-s.startSN,T=s.fragments;for(T[W]=i,j=W;j>0;j--)n(T[j],T[j-1]);for(j=W;j<T.length-1;j++)n(T[j],T[j+1]);return s.fragmentHint&&n(T[T.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,x}function E(s,i){for(var D=null,A=s.fragments,S=A.length-1;S>=0;S--){var R=A[S].initSegment;if(R){D=R;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var O=0,g;if(b(s,i,function(j,W){j.relurl&&(O=j.cc-W.cc),Object(z.isFiniteNumber)(j.startPTS)&&Object(z.isFiniteNumber)(j.endPTS)&&(W.start=W.startPTS=j.startPTS,W.startDTS=j.startDTS,W.appendedPTS=j.appendedPTS,W.maxStartPTS=j.maxStartPTS,W.endPTS=j.endPTS,W.endDTS=j.endDTS,W.minEndPTS=j.minEndPTS,W.duration=j.endPTS-j.startPTS,W.duration&&(g=W),i.PTSKnown=i.alignedSliding=!0),W.elementaryStreams=j.elementaryStreams,W.loader=j.loader,W.stats=j.stats,W.urlId=j.urlId,j.initSegment&&(W.initSegment=j.initSegment,D=j.initSegment)}),D){var _=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments;_.forEach(function(j){var W;(!j.initSegment||j.initSegment.relurl===((W=D)===null||W===void 0?void 0:W.relurl))&&(j.initSegment=D)})}if(i.skippedSegments&&(i.deltaUpdateFailed=i.fragments.some(function(j){return!j}),i.deltaUpdateFailed)){P.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=i.skippedSegments;h--;)i.fragments.shift();i.startSN=i.fragments[0].sn,i.startCC=i.fragments[0].cc}var d=i.fragments;if(O){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var C=0;C<d.length;C++)d[C].cc+=O}i.skippedSegments&&(i.startCC=i.fragments[0].cc),f(s.partList,i.partList,function(j,W){W.elementaryStreams=j.elementaryStreams,W.stats=j.stats}),g?I(i,g,g.startPTS,g.endPTS,g.startDTS,g.endDTS):c(s,i),d.length&&(i.totalduration=i.edge-d[0].start),i.driftStartTime=s.driftStartTime,i.driftStart=s.driftStart;var x=i.advancedDateTime;if(i.advanced&&x){var w=i.edge;i.driftStart||(i.driftStartTime=x,i.driftStart=w),i.driftEndTime=x,i.driftEnd=w}else i.driftEndTime=s.driftEndTime,i.driftEnd=s.driftEnd,i.advancedDateTime=s.advancedDateTime}function f(s,i,D){if(s&&i)for(var A=0,S=0,R=s.length;S<=R;S++){var O=s[S],g=i[S+A];O&&g&&O.index===g.index&&O.fragment.sn===g.fragment.sn?D(O,g):A--}}function b(s,i,D){for(var A=i.skippedSegments,S=Math.max(s.startSN,i.startSN)-i.startSN,R=(s.fragmentHint?1:0)+(A?i.endSN:Math.min(s.endSN,i.endSN))-i.startSN,O=i.startSN-s.startSN,g=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,_=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,h=S;h<=R;h++){var d=_[O+h],C=g[h];A&&!C&&h<A&&(C=i.fragments[h]=d),d&&C&&D(d,C)}}function c(s,i){var D=i.startSN+i.skippedSegments-s.startSN,A=s.fragments;if(D<0||D>=A.length)return;a(i,A[D].start)}function a(s,i){if(i){for(var D=s.fragments,A=s.skippedSegments;A<D.length;A++)D[A].start+=i;s.fragmentHint&&(s.fragmentHint.start+=i)}}function p(s,i){var D=1e3*s.levelTargetDuration,A=D/2,S=s.age,R=S>0&&S<D*3,O=i.loading.end-i.loading.start,g,_=s.availabilityDelay;if(s.updated===!1)if(R){var h=333*s.misses;g=Math.max(Math.min(A,O*2),h),s.availabilityDelay=(s.availabilityDelay||0)+g}else g=A;else R?(_=Math.min(_||D/2,S),s.availabilityDelay=_,g=_+D-S):g=D-O;return Math.round(g)}function l(s,i,D){if(!s||!s.details)return null;var A=s.details,S=A.fragments[i-A.startSN];return S||(S=A.fragmentHint,S&&S.sn===i?S:i<A.startSN&&D&&D.sn===i?D:null)}function u(s,i,D){if(!s||!s.details)return null;var A=s.details.partList;if(A)for(var S=A.length;S--;){var R=A[S];if(R.index===D&&R.fragment.sn===i)return R}return null}},"./src/controller/stream-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return A});var z=N("./src/polyfills/number.ts"),P=N("./src/controller/base-stream-controller.ts"),F=N("./src/is-supported.ts"),G=N("./src/events.ts"),K=N("./src/utils/buffer-helper.ts"),n=N("./src/controller/fragment-tracker.ts"),I=N("./src/types/loader.ts"),E=N("./src/loader/fragment.ts"),f=N("./src/demux/transmuxer-interface.ts"),b=N("./src/types/transmuxer.ts"),c=N("./src/controller/gap-controller.ts"),a=N("./src/errors.ts"),p=N("./src/utils/logger.ts");function l(S,R){for(var O=0;O<R.length;O++){var g=R[O];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(S,g.key,g)}}function u(S,R,O){return R&&l(S.prototype,R),O&&l(S,O),S}function s(S,R){S.prototype=Object.create(R.prototype),S.prototype.constructor=S,i(S,R)}function i(S,R){return i=Object.setPrototypeOf||function(g,_){return g.__proto__=_,g},i(S,R)}var D=100,A=function(S){s(R,S);function R(g,_){var h;return h=S.call(this,g,_,"[stream-controller]")||this,h.audioCodecSwap=!1,h.gapController=null,h.level=-1,h._forceStartLoad=!1,h.altAudio=!1,h.audioOnly=!1,h.fragPlaying=null,h.onvplaying=null,h.onvseeked=null,h.fragLastKbps=0,h.stalled=!1,h.couldBacktrack=!1,h.audioCodecSwitch=!1,h.videoBuffer=null,h._registerListeners(),h}var O=R.prototype;return O._registerListeners=function(){var _=this.hls;_.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),_.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),_.on(G.Events.ERROR,this.onError,this),_.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),_.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),_.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var _=this.hls;_.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),_.off(G.Events.ERROR,this.onError,this),_.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),_.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),_.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(_){if(this.levels){var h=this.lastCurrentTime,d=this.hls;if(this.stopLoad(),this.setInterval(D),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var C=d.startLevel;C===-1&&(d.config.testBandwidth?(C=0,this.bitrateTest=!0):C=d.nextAutoLevel),this.level=d.nextLoadLevel=C,this.loadedmetadata=!1}h>0&&_===-1&&(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),_=h),this.state=P.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=_,this.tick()}else this._forceStartLoad=!0,this.state=P.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_LEVEL:{var _,h=this.levels,d=this.level,C=h==null||((_=h[d])===null||_===void 0)?void 0:_.details;if(C&&(!C.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(C))break;this.state=P.State.IDLE;break}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var x,w=self.performance.now(),j=this.retryDate;(!j||w>=j||(x=this.media)!==null&&x!==void 0&&x.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=P.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var _,h,d=this.hls,C=this.levelLastLoaded,x=this.levels,w=this.media,j=d.config,W=d.nextLoadLevel;if(C===null||!w&&(this.startFragRequested||!j.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!x||!x[W])return;var T=x[W];this.level=d.nextLoadLevel=W;var M=T.details;if(!M||this.state===P.State.WAITING_LEVEL||M.live&&this.levelLastLoaded!==W){this.state=P.State.WAITING_LEVEL;return}var m=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:w,I.PlaylistLevelType.MAIN);if(m===null)return;var v=m.len,H=this.getMaxBufferLength(T.maxBitrate);if(v>=H)return;if(this._streamEnded(m,M)){var X={};this.altAudio&&(X.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,X),this.state=P.State.ENDED;return}var q=m.end,re=this.getNextFragment(q,M);if(this.couldBacktrack&&!this.fragPrevious&&re&&re.sn!=="initSegment"){var ye=re.sn-M.startSN;ye>1&&(re=M.fragments[ye-1],this.fragmentTracker.removeFragment(re))}if(re&&this.fragmentTracker.getState(re)===n.FragmentState.OK&&this.nextLoadPosition>q){var pe=this.audioOnly&&!this.altAudio?E.ElementaryStreamTypes.AUDIO:E.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(w,pe,I.PlaylistLevelType.MAIN),re=this.getNextFragment(this.nextLoadPosition,M)}if(!re)return;re.initSegment&&!re.initSegment.data&&!this.bitrateTest&&(re=re.initSegment),((_=re.decryptdata)===null||_===void 0?void 0:_.keyFormat)==="identity"&&!((h=re.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(re,M):this.loadFragment(re,M,q)},O.loadFragment=function(_,h,d){var C,x=this.fragmentTracker.getState(_);if(this.fragCurrent=_,x===n.FragmentState.BACKTRACKED){var w=this.fragmentTracker.getBacktrackData(_);if(w){this._handleFragmentLoadProgress(w),this._handleFragmentLoadComplete(w);return}else x=n.FragmentState.NOT_LOADED}x===n.FragmentState.NOT_LOADED||x===n.FragmentState.PARTIAL?_.sn==="initSegment"?this._loadInitSegment(_):this.bitrateTest?(_.bitrateTest=!0,this.log("Fragment "+_.sn+" of level "+_.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(_)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,_,h,d)):x===n.FragmentState.APPENDING?this.reduceMaxBufferLength(_.duration)&&this.fragmentTracker.removeFragment(_):((C=this.media)===null||C===void 0?void 0:C.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(_){var h=this.fragmentTracker.getAppendedFrag(_,I.PlaylistLevelType.MAIN);return h&&"fragment"in h?h.fragment:h},O.getBufferedFrag=function(_){return this.fragmentTracker.getBufferedFrag(_,I.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(_){return _?this.getBufferedFrag(_.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var _=this.levels,h=this.media;if(h!=null&&h.readyState){var d,C=this.getAppendedFrag(h.currentTime);if(C&&C.start>1&&this.flushMainBuffer(0,C.start-1),!h.paused&&_){var x=this.hls.nextLoadLevel,w=_[x],j=this.fragLastKbps;j&&this.fragCurrent?d=this.fragCurrent.duration*w.maxBitrate/(1e3*j)+1:d=0}else d=0;var W=this.getBufferedFrag(h.currentTime+d);if(W){var T=this.followingBufferedFrag(W);if(T){this.abortCurrentFrag();var M=T.maxStartPTS?T.maxStartPTS:T.start,m=T.duration,v=Math.max(W.end,M+Math.min(Math.max(m-this.config.maxFragLookUpTolerance,m*.5),m*.75));this.flushMainBuffer(v,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var _=this.fragCurrent;this.fragCurrent=null,_!=null&&_.loader&&_.loader.abort(),this.state===P.State.KEY_LOADING&&(this.state=P.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(_,h){S.prototype.flushMainBuffer.call(this,_,h,this.altAudio?"video":null)},O.onMediaAttached=function(_,h){S.prototype.onMediaAttached.call(this,_,h);var d=h.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),d.addEventListener("playing",this.onvplaying),d.addEventListener("seeked",this.onvseeked),this.gapController=new c.default(this.config,d,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var _=this.media;_&&(_.removeEventListener("playing",this.onvplaying),_.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var _=this.media,h=_?_.currentTime:null;Object(z.isFiniteNumber)(h)&&this.log("Media seeked to "+h.toFixed(3)),this.tick()},O.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},O.onManifestParsed=function(_,h){var d=!1,C=!1,x;h.levels.forEach(function(w){x=w.audioCodec,x&&(x.indexOf("mp4a.40.2")!==-1&&(d=!0),x.indexOf("mp4a.40.5")!==-1&&(C=!0))}),this.audioCodecSwitch=d&&C&&!Object(F.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=h.levels,this.startFragRequested=!1},O.onLevelLoading=function(_,h){var d=this.levels;if(!d||this.state!==P.State.IDLE)return;var C=d[h.level];(!C.details||C.details.live&&this.levelLastLoaded!==h.level||this.waitForCdnTuneIn(C.details))&&(this.state=P.State.WAITING_LEVEL)},O.onLevelLoaded=function(_,h){var d,C=this.levels,x=h.level,w=h.details,j=w.totalduration;if(!C){this.warn("Levels were reset while loading level "+x);return}this.log("Level "+x+" loaded ["+w.startSN+","+w.endSN+"], cc ["+w.startCC+", "+w.endCC+"] duration:"+j);var W=this.fragCurrent;W&&(this.state===P.State.FRAG_LOADING||this.state===P.State.FRAG_LOADING_WAITING_RETRY)&&(W.level!==h.level&&W.loader&&(this.state=P.State.IDLE,W.loader.abort()));var T=C[x],M=0;if(w.live||(d=T.details)!==null&&d!==void 0&&d.live){if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed)return;M=this.alignPlaylists(w,T.details)}if(T.details=w,this.levelLastLoaded=x,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:w,level:x}),this.state===P.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(w))return;this.state=P.State.IDLE}this.startFragRequested?w.live&&this.synchronizeToLiveEdge(w):this.setStartPosition(w,M),this.tick()},O._handleFragmentLoadProgress=function(_){var h,d=_.frag,C=_.part,x=_.payload,w=this.levels;if(!w){this.warn("Levels were reset while fragment load was in progress. Fragment "+d.sn+" of level "+d.level+" will not be buffered");return}var j=w[d.level],W=j.details;if(!W){this.warn("Dropping fragment "+d.sn+" of level "+d.level+" after level details were reset");return}var T=j.videoCodec,M=W.PTSKnown||!W.live,m=(h=d.initSegment)===null||h===void 0?void 0:h.data,v=this._getAudioCodec(j),H=this.transmuxer=this.transmuxer||new f.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),X=C?C.index:-1,q=X!==-1,re=new b.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,x.byteLength,X,q),ye=this.initPTS[d.cc];H.push(x,m,v,T,d,C,W.totalduration,M,re,ye)},O.onAudioTrackSwitching=function(_,h){var d=this.altAudio,C=!!h.url,x=h.id;if(!C){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var w=this.fragCurrent;w!=null&&w.loader&&(this.log("Switching to main audio track, cancel main fragment load"),w.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var j=this.hls;d&&j.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:x})}},O.onAudioTrackSwitched=function(_,h){var d=h.id,C=!!this.hls.audioTracks[d].url;if(C){var x=this.videoBuffer;x&&this.mediaBuffer!==x&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=x)}this.altAudio=C,this.tick()},O.onBufferCreated=function(_,h){var d=h.tracks,C,x,w=!1;for(var j in d){var W=d[j];if(W.id==="main"){if(x=j,C=W,j==="video"){var T=d[j];T&&(this.videoBuffer=T.buffer)}}else w=!0}w&&C?(this.log("Alternate track found, use "+x+".buffered to schedule main fragment loading"),this.mediaBuffer=C.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(_,h){var d=h.frag,C=h.part;if(d&&d.type!==I.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(d)){this.warn("Fragment "+d.sn+(C?" p: "+C.index:"")+" of level "+d.level+" finished buffering, but was aborted. state: "+this.state),this.state===P.State.PARSED&&(this.state=P.State.IDLE);return}var x=C?C.stats:d.stats;this.fragLastKbps=Math.round(8*x.total/(x.buffering.end-x.loading.first)),d.sn!=="initSegment"&&(this.fragPrevious=d),this.fragBufferedComplete(d,C)},O.onError=function(_,h){switch(h.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(I.PlaylistLevelType.MAIN,h);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==P.State.ERROR&&(h.fatal?(this.warn(""+h.details),this.state=P.State.ERROR):!h.levelRetry&&this.state===P.State.WAITING_LEVEL&&(this.state=P.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="main"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var d=!0,C=this.getFwdBufferInfo(this.media,I.PlaylistLevelType.MAIN);C&&C.len>.5&&(d=!this.reduceMaxBufferLength(C.len)),d&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var _=this.media,h=this.gapController;if(!_||!h||!_.readyState)return;var d=K.BufferHelper.getBuffered(_);!this.loadedmetadata&&d.length?(this.loadedmetadata=!0,this.seekToStartPos()):h.poll(this.lastCurrentTime),this.lastCurrentTime=_.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(_,h){var d=h.type;if(d!==E.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var C=(d===E.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(C,d,I.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(_,h){this.levels=h.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var _=this.media,h=_.currentTime,d=this.startPosition;if(d>=0&&h<d){if(_.seeking){p.logger.log("could not seek to "+d+", already seeking at "+h);return}var C=K.BufferHelper.getBuffered(_),x=C.length?C.start(0):0,w=x-d;w>0&&(w<this.config.maxBufferHole||w<this.config.maxFragLookUpTolerance)&&(p.logger.log("adjusting start position by "+w+" to match buffer start"),d+=w,this.startPosition=d),this.log("seek to target start position "+d+" from current time "+h),_.currentTime=d}},O._getAudioCodec=function(_){var h=this.config.defaultAudioCodec||_.audioCodec;return this.audioCodecSwap&&h&&(this.log("Swapping audio codec"),h.indexOf("mp4a.40.5")!==-1?h="mp4a.40.2":h="mp4a.40.5"),h},O._loadBitrateTestFrag=function(_){var h=this;this._doFragLoad(_).then(function(d){var C=h.hls;if(!d||C.nextLoadLevel||h.fragContextChanged(_))return;h.fragLoadError=0,h.state=P.State.IDLE,h.startFragRequested=!1,h.bitrateTest=!1;var x=_.stats;x.parsing.start=x.parsing.end=x.buffering.start=x.buffering.end=self.performance.now(),C.trigger(G.Events.FRAG_LOADED,d)})},O._handleTransmuxComplete=function(_){var h,d="main",C=this.hls,x=_.remuxResult,w=_.chunkMeta,j=this.getCurrentContext(w);if(!j){this.warn("The loading context changed while buffering fragment "+w.sn+" of level "+w.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(w.level);return}var W=j.frag,T=j.part,M=j.level,m=x.video,v=x.text,H=x.id3,X=x.initSegment,q=this.altAudio?void 0:x.audio;if(this.fragContextChanged(W))return;if(this.state=P.State.PARSING,X){X.tracks&&(this._bufferInitSegment(M,X.tracks,W,w),C.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:d,tracks:X.tracks}));var re=X.initPTS,ye=X.timescale;Object(z.isFiniteNumber)(re)&&(this.initPTS[W.cc]=re,C.trigger(G.Events.INIT_PTS_FOUND,{frag:W,id:d,initPTS:re,timescale:ye}))}if(m&&x.independent!==!1){if(M.details){var pe=m.startPTS,ue=m.endPTS,fe=m.startDTS,be=m.endDTS;if(T)T.elementaryStreams[m.type]={startPTS:pe,endPTS:ue,startDTS:fe,endDTS:be};else if(m.firstKeyFrame&&m.independent&&(this.couldBacktrack=!0),m.dropped&&m.independent){var se=this.getLoadPosition()+this.config.maxBufferHole;if(se<pe){this.backtrack(W);return}W.setElementaryStreamInfo(m.type,W.start,ue,W.start,be,!0)}W.setElementaryStreamInfo(m.type,pe,ue,fe,be),this.bufferFragmentData(m,W,T,w)}}else if(x.independent===!1){this.backtrack(W);return}if(q){var ae=q.startPTS,Ce=q.endPTS,ze=q.startDTS,Ye=q.endDTS;T&&(T.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:Ce,startDTS:ze,endDTS:Ye}),W.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,ae,Ce,ze,Ye),this.bufferFragmentData(q,W,T,w)}if(H!=null&&(h=H.samples)!==null&&h!==void 0&&h.length){var He={frag:W,id:d,samples:H.samples};C.trigger(G.Events.FRAG_PARSING_METADATA,He)}if(v){var Ve={frag:W,id:d,samples:v.samples};C.trigger(G.Events.FRAG_PARSING_USERDATA,Ve)}},O._bufferInitSegment=function(_,h,d,C){var x=this;if(this.state!==P.State.PARSING)return;this.audioOnly=!!h.audio&&!h.video,this.altAudio&&!this.audioOnly&&delete h.audio;var w=h.audio,j=h.video,W=h.audiovideo;if(w){var T=_.audioCodec,M=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(T&&(T.indexOf("mp4a.40.5")!==-1?T="mp4a.40.2":T="mp4a.40.5"),w.metadata.channelCount!==1&&M.indexOf("firefox")===-1&&(T="mp4a.40.5")),M.indexOf("android")!==-1&&w.container!=="audio/mpeg"&&(T="mp4a.40.2",this.log("Android: force audio codec to "+T)),_.audioCodec&&_.audioCodec!==T&&this.log('Swapping manifest audio codec "'+_.audioCodec+'" for "'+T+'"'),w.levelCodec=T,w.id="main",this.log("Init audio buffer, container:"+w.container+", codecs[selected/level/parsed]=["+(T||"")+"/"+(_.audioCodec||"")+"/"+w.codec+"]")}j&&(j.levelCodec=_.videoCodec,j.id="main",this.log("Init video buffer, container:"+j.container+", codecs[level/parsed]=["+(_.videoCodec||"")+"/"+j.codec+"]")),W&&this.log("Init audiovideo buffer, container:"+W.container+", codecs[level/parsed]=["+(_.attrs.CODECS||"")+"/"+W.codec+"]"),this.hls.trigger(G.Events.BUFFER_CODECS,h),Object.keys(h).forEach(function(m){var v=h[m],H=v.initSegment;H!=null&&H.byteLength&&x.hls.trigger(G.Events.BUFFER_APPENDING,{type:m,data:H,frag:d,part:null,chunkMeta:C,parent:d.type})}),this.tick()},O.backtrack=function(_){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(_);var h=this.fragmentTracker.backtrack(_);this.fragPrevious=null,this.nextLoadPosition=_.start,h?this.resetFragmentLoading(_):this.state=P.State.BACKTRACKING},O.checkFragmentChanged=function(){var _=this.media,h=null;if(_&&_.readyState>1&&_.seeking===!1){var d=_.currentTime;if(K.BufferHelper.isBuffered(_,d)?h=this.getAppendedFrag(d):K.BufferHelper.isBuffered(_,d+.1)&&(h=this.getAppendedFrag(d+.1)),h){var C=this.fragPlaying,x=h.level;(!C||h.sn!==C.sn||C.level!==x||h.urlId!==C.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:h}),(!C||C.level!==x)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:x}),this.fragPlaying=h)}}},u(R,[{key:"nextLevel",get:function(){var _=this.nextBufferedFrag;return _?_.level:-1}},{key:"currentLevel",get:function(){var _=this.media;if(_){var h=this.getAppendedFrag(_.currentTime);if(h)return h.level}return-1}},{key:"nextBufferedFrag",get:function(){var _=this.media;if(_){var h=this.getAppendedFrag(_.currentTime);return this.followingBufferedFrag(h)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(P.default)},"./src/controller/subtitle-stream-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"SubtitleStreamController",function(){return s});var z=N("./src/events.ts"),P=N("./src/utils/logger.ts"),F=N("./src/utils/buffer-helper.ts"),G=N("./src/controller/fragment-finders.ts"),K=N("./src/utils/discontinuities.ts"),n=N("./src/controller/level-helper.ts"),I=N("./src/controller/fragment-tracker.ts"),E=N("./src/controller/base-stream-controller.ts"),f=N("./src/types/loader.ts"),b=N("./src/types/level.ts");function c(i,D){for(var A=0;A<D.length;A++){var S=D[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(i,S.key,S)}}function a(i,D,A){return D&&c(i.prototype,D),A&&c(i,A),i}function p(i,D){i.prototype=Object.create(D.prototype),i.prototype.constructor=i,l(i,D)}function l(i,D){return l=Object.setPrototypeOf||function(S,R){return S.__proto__=R,S},l(i,D)}var u=500,s=function(i){p(D,i);function D(S,R){var O;return O=i.call(this,S,R,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var A=D.prototype;return A.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},A._registerListeners=function(){var R=this.hls;R.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(z.Events.ERROR,this.onError,this),R.on(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A._unregisterListeners=function(){var R=this.hls;R.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(z.Events.ERROR,this.onError,this),R.off(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A.startLoad=function(){this.stopLoad(),this.state=E.State.IDLE,this.setInterval(u),this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},A.onLevelLoaded=function(R,O){this.mainDetails=O.details},A.onSubtitleFragProcessed=function(R,O){var g=O.frag,_=O.success;if(this.fragPrevious=g,this.state=E.State.IDLE,!_)return;var h=this.tracksBuffered[this.currentTrackId];if(!h)return;for(var d,C=g.start,x=0;x<h.length;x++)if(C>=h[x].start&&C<=h[x].end){d=h[x];break}var w=g.start+g.duration;d?d.end=w:(d={start:C,end:w},h.push(d)),this.fragmentTracker.fragBuffered(g)},A.onBufferFlushing=function(R,O){var g=O.startOffset,_=O.endOffset;if(g===0&&_!==Number.POSITIVE_INFINITY){var h=this.currentTrackId,d=this.levels;if(!d.length||!d[h]||!d[h].details)return;var C=d[h].details,x=C.targetduration,w=_-x;if(w<=0)return;O.endOffsetSubtitles=Math.max(0,w),this.tracksBuffered.forEach(function(j){for(var W=0;W<j.length;){if(j[W].end<=w){j.shift();continue}else if(j[W].start<w)j[W].start=w;else break;W++}}),this.fragmentTracker.removeFragmentsInRange(g,w,f.PlaylistLevelType.SUBTITLE)}},A.onError=function(R,O){var g,_=O.frag;if(!_||_.type!==f.PlaylistLevelType.SUBTITLE)return;(g=this.fragCurrent)!==null&&g!==void 0&&g.loader&&this.fragCurrent.loader.abort(),this.state=E.State.IDLE},A.onSubtitleTracksUpdated=function(R,O){var g=this,_=O.subtitleTracks;this.tracksBuffered=[],this.levels=_.map(function(h){return new b.Level(h)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(h){g.tracksBuffered[h.id]=[]}),this.mediaBuffer=null},A.onSubtitleTrackSwitch=function(R,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var g=this.levels[this.currentTrackId];g!=null&&g.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,g&&this.setInterval(u)},A.onSubtitleTrackLoaded=function(R,O){var g,_=O.details,h=O.id,d=this.currentTrackId,C=this.levels;if(!C.length)return;var x=C[d];if(h>=C.length||h!==d||!x)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,_.live||(g=x.details)!==null&&g!==void 0&&g.live){var w=this.mainDetails;if(_.deltaUpdateFailed||!w)return;var j=w.fragments[0];if(!x.details)_.hasProgramDateTime&&w.hasProgramDateTime?Object(K.alignMediaPlaylistByPDT)(_,w):j&&Object(n.addSliding)(_,j.start);else{var W=this.alignPlaylists(_,x.details);W===0&&j&&Object(n.addSliding)(_,j.start)}}if(x.details=_,this.levelLastLoaded=h,this.tick(),_.live&&!this.fragCurrent&&this.media&&this.state===E.State.IDLE){var T=Object(G.findFragmentByPTS)(null,_.fragments,this.media.currentTime,0);T||(this.warn("Subtitle playlist not aligned with playback"),x.details=void 0)}},A._handleFragmentLoadComplete=function(R){var O=R.frag,g=R.payload,_=O.decryptdata,h=this.hls;if(this.fragContextChanged(O))return;if(g&&g.byteLength>0&&_&&_.key&&_.iv&&_.method==="AES-128"){var d=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(g),_.key.buffer,_.iv.buffer).then(function(C){var x=performance.now();h.trigger(z.Events.FRAG_DECRYPTED,{frag:O,payload:C,stats:{tstart:d,tdecrypt:x}})})}},A.doTick=function(){if(!this.media){this.state=E.State.IDLE;return}if(this.state===E.State.IDLE){var R,O=this.currentTrackId,g=this.levels;if(!g.length||!g[O]||!g[O].details)return;var _=g[O].details,h=_.targetduration,d=this.config,C=this.media,x=F.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,C.currentTime-h,d.maxBufferHole),w=x.end,j=x.len,W=this.getMaxBufferLength()+h;if(j>W)return;console.assert(_,"Subtitle track details are defined on idle subtitle stream controller tick");var T=_.fragments,M=T.length,m=_.edge,v,H=this.fragPrevious;if(w<m){var X=d.maxFragLookUpTolerance;H&&_.hasProgramDateTime&&(v=Object(G.findFragmentByPDT)(T,H.endProgramDateTime,X)),v||(v=Object(G.findFragmentByPTS)(H,T,w,X),!v&&H&&H.start<T[0].start&&(v=T[0]))}else v=T[M-1];(R=v)!==null&&R!==void 0&&R.encrypted?(P.logger.log("Loading key for "+v.sn),this.state=E.State.KEY_LOADING,this.hls.trigger(z.Events.KEY_LOADING,{frag:v})):v&&this.fragmentTracker.getState(v)===I.FragmentState.NOT_LOADED&&this.loadFragment(v,_,w)}},A.loadFragment=function(R,O,g){this.fragCurrent=R,i.prototype.loadFragment.call(this,R,O,g)},a(D,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),D}(E.default)},"./src/controller/subtitle-track-controller.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts"),P=N("./src/utils/texttrack-utils.ts"),F=N("./src/controller/base-playlist-controller.ts"),G=N("./src/types/loader.ts");function K(c,a){for(var p=0;p<a.length;p++){var l=a[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(c,l.key,l)}}function n(c,a,p){return a&&K(c.prototype,a),p&&K(c,p),c}function I(c,a){c.prototype=Object.create(a.prototype),c.prototype.constructor=c,E(c,a)}function E(c,a){return E=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},E(c,a)}var f=function(c){I(a,c);function a(l){var u;return u=c.call(this,l,"[subtitle-track-controller]")||this,u.media=null,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.selectDefaultTrack=!0,u.queuedDefaultTrack=-1,u.trackChangeListener=function(){return u.onTextTracksChanged()},u.asyncPollTrackChange=function(){return u.pollTrackChange(0)},u.useTextTrackPolling=!1,u.subtitlePollingInterval=-1,u.subtitleDisplay=!0,u.registerListeners(),u}var p=a.prototype;return p.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,c.prototype.destroy.call(this)},p.registerListeners=function(){var u=this.hls;u.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.on(z.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){var u=this.hls;u.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.off(z.Events.ERROR,this.onError,this)},p.onMediaAttached=function(u,s){if(this.media=s.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},p.pollTrackChange=function(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},p.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 u=b(this.media.textTracks);u.forEach(function(s){Object(P.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},p.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},p.onManifestParsed=function(u,s){this.tracks=s.subtitleTracks},p.onSubtitleTrackLoaded=function(u,s){var i=s.id,D=s.details,A=this.trackId,S=this.tracksInGroup[A];if(!S){this.warn("Invalid subtitle track id "+i);return}var R=S.details;S.details=s.details,this.log("subtitle track "+i+" loaded ["+D.startSN+"-"+D.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,s,R))},p.onLevelLoading=function(u,s){this.switchLevel(s.level)},p.onLevelSwitching=function(u,s){this.switchLevel(s.level)},p.switchLevel=function(u){var s=this.hls.levels[u];if(!(s!=null&&s.textGroupIds))return;var i=s.textGroupIds[s.urlId];if(this.groupId!==i){var D=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,A=this.tracks.filter(function(O){return!i||O.groupId===i});this.tracksInGroup=A;var S=this.findTrackId(D==null?void 0:D.name)||this.findTrackId();this.groupId=i;var R={subtitleTracks:A};this.log("Updating subtitle tracks, "+A.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(z.Events.SUBTITLE_TRACKS_UPDATED,R),S!==-1&&this.setSubtitleTrack(S,D)}},p.findTrackId=function(u){for(var s=this.tracksInGroup,i=0;i<s.length;i++){var D=s[i];if((!this.selectDefaultTrack||D.default)&&(!u||u===D.name))return D.id}return-1},p.onError=function(u,s){if(c.prototype.onError.call(this,u,s),s.fatal||!s.context)return;s.context.type===G.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},p.loadPlaylist=function(u){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var i=s.id,D=s.groupId,A=s.url;if(u)try{A=u.addDirectives(A)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+i),this.hls.trigger(z.Events.SUBTITLE_TRACK_LOADING,{url:A,id:i,groupId:D,deliveryDirectives:u||null})}},p.toggleTrackModes=function(u){var s=this,i=this.media,D=this.subtitleDisplay,A=this.trackId;if(!i)return;var S=b(i.textTracks),R=S.filter(function(_){return _.groupId===s.groupId});if(u===-1)[].slice.call(S).forEach(function(_){_.mode="disabled"});else{var O=R[A];O&&(O.mode="disabled")}var g=R[u];g&&(g.mode=D?"showing":"hidden")},p.setSubtitleTrack=function(u,s){var i,D=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=u;return}if(this.trackId!==u&&this.toggleTrackModes(u),this.trackId===u&&(u===-1||(i=D[u])!==null&&i!==void 0&&i.details)||u<-1||u>=D.length)return;this.clearTimer();var A=D[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,A){var S=A.id,R=A.groupId,O=R===void 0?"":R,g=A.name,_=A.type,h=A.url;this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:O,name:g,type:_,url:h});var d=this.switchParams(A.url,s==null?void 0:s.details);this.loadPlaylist(d)}else this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:u})},p.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,s=b(this.media.textTracks),i=0;i<s.length;i++)if(s[i].mode==="hidden")u=i;else if(s[i].mode==="showing"){u=i;break}this.subtitleTrack!==u&&(this.subtitleTrack=u)},n(a,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(u,s)}}]),a}(F.default);function b(c){for(var a=[],p=0;p<c.length;p++){var l=c[p];l.kind==="subtitles"&&l.label&&a.push(c[p])}return a}Y.default=f},"./src/controller/timeline-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"TimelineController",function(){return b});var z=N("./src/polyfills/number.ts"),P=N("./src/events.ts"),F=N("./src/utils/cea-608-parser.ts"),G=N("./src/utils/output-filter.ts"),K=N("./src/utils/webvtt-parser.ts"),n=N("./src/utils/texttrack-utils.ts"),I=N("./src/utils/imsc1-ttml-parser.ts"),E=N("./src/types/loader.ts"),f=N("./src/utils/logger.ts"),b=function(){function l(s){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=p(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var i=new G.default(this,"textTrack1"),D=new G.default(this,"textTrack2"),A=new G.default(this,"textTrack3"),S=new G.default(this,"textTrack4");this.cea608Parser1=new F.default(1,i,D),this.cea608Parser2=new F.default(3,A,S)}s.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(P.Events.FRAG_LOADING,this.onFragLoading,this),s.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=l.prototype;return u.destroy=function(){var i=this.hls;i.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.off(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.off(P.Events.FRAG_LOADING,this.onFragLoading,this),i.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.off(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.off(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(i,D,A,S,R){for(var O=!1,g=R.length;g--;){var _=R[g],h=a(_[0],_[1],D,A);if(h>=0&&(_[0]=Math.min(_[0],D),_[1]=Math.max(_[1],A),O=!0,h/(A-D)>.5))return}if(O||R.push([D,A]),this.config.renderTextTracksNatively){var d=this.captionsTracks[i];this.Cues.newCue(d,D,A,S)}else{var C=this.Cues.newCue(null,D,A,S);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:C,track:i})}},u.onInitPtsFound=function(i,D){var A=this,S=D.frag,R=D.id,O=D.initPTS,g=D.timescale,_=this.unparsedVttFrags;R==="main"&&(this.initPTS[S.cc]=O,this.timescale[S.cc]=g),_.length&&(this.unparsedVttFrags=[],_.forEach(function(h){A.onFragLoaded(P.Events.FRAG_LOADED,h)}))},u.getExistingTrack=function(i){var D=this.media;if(D)for(var A=0;A<D.textTracks.length;A++){var S=D.textTracks[A];if(S[i])return S}return null},u.createCaptionsTrack=function(i){this.config.renderTextTracksNatively?this.createNativeTrack(i):this.createNonNativeTrack(i)},u.createNativeTrack=function(i){if(this.captionsTracks[i])return;var D=this.captionsProperties,A=this.captionsTracks,S=this.media,R=D[i],O=R.label,g=R.languageCode,_=this.getExistingTrack(i);if(_)A[i]=_,Object(n.clearCurrentCues)(A[i]),Object(n.sendAddTrackEvent)(A[i],S);else{var h=this.createTextTrack("captions",O,g);h&&(h[i]=!0,A[i]=h)}},u.createNonNativeTrack=function(i){if(this.nonNativeCaptionsTracks[i])return;var D=this.captionsProperties[i];if(!D)return;var A=D.label,S={_id:i,label:A,kind:"captions",default:D.media?!!D.media.default:!1,closedCaptions:D.media};this.nonNativeCaptionsTracks[i]=S,this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},u.createTextTrack=function(i,D,A){var S=this.media;return S?S.addTextTrack(i,D,A):void 0},u.onMediaAttaching=function(i,D){this.media=D.media,this._cleanTracks()},u.onMediaDetaching=function(){var i=this.captionsTracks;Object.keys(i).forEach(function(D){Object(n.clearCurrentCues)(i[D]),delete i[D]}),this.nonNativeCaptionsTracks={}},u.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=p(),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())},u._cleanTracks=function(){var i=this.media;if(!i)return;var D=i.textTracks;if(D)for(var A=0;A<D.length;A++)Object(n.clearCurrentCues)(D[A])},u.onSubtitleTracksUpdated=function(i,D){var A=this;this.textTracks=[];var S=D.subtitleTracks||[],R=S.some(function(h){return h.textCodec===I.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var O=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var g=this.media?this.media.textTracks:[];this.tracks.forEach(function(h,d){var C;if(d<g.length){for(var x=null,w=0;w<g.length;w++)if(c(g[w],h)){x=g[w];break}x&&(C=x)}C?Object(n.clearCurrentCues)(C):(C=A.createTextTrack("subtitles",h.name,h.lang),C&&(C.mode="disabled")),C&&(C.groupId=h.groupId,A.textTracks.push(C))})}else if(!O&&this.tracks&&this.tracks.length){var _=this.tracks.map(function(h){return{label:h.name,kind:h.type.toLowerCase(),default:h.default,subtitleTrack:h}});this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:_})}}},u.onManifestLoaded=function(i,D){var A=this;this.config.enableCEA708Captions&&D.captions&&D.captions.forEach(function(S){var R=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!R)return;var O="textTrack"+R[1],g=A.captionsProperties[O];if(!g)return;g.label=S.name,S.lang&&(g.languageCode=S.lang),g.media=S})},u.onFragLoading=function(i,D){var A=this.cea608Parser1,S=this.cea608Parser2,R=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(A&&S))return;if(D.frag.type===E.PlaylistLevelType.MAIN){var g,_,h=D.frag.sn,d=(g=D==null||((_=D.part)===null||_===void 0)?void 0:_.index)!=null?g:-1;h===R+1||h===R&&d===O+1||(A.reset(),S.reset()),this.lastSn=h,this.lastPartIndex=d}},u.onFragLoaded=function(i,D){var A=D.frag,S=D.payload,R=this.initPTS,O=this.unparsedVttFrags;if(A.type===E.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(z.isFiniteNumber)(R[A.cc])){O.push(D),R.length&&this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:A,error:new Error("Missing initial subtitle PTS")});return}var g=A.decryptdata;if(g==null||g.key==null||g.method!=="AES-128"){var _=this.tracks[A.level],h=this.vttCCs;h[A.cc]||(h[A.cc]={start:A.start,prevCC:this.prevCC,new:!0},this.prevCC=A.cc),_&&_.textCodec===I.IMSC1_CODEC?this._parseIMSC1(A,S):this._parseVTTs(A,S,h)}}else this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:A,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(i,D){var A=this,S=this.hls;Object(I.parseIMSC1)(D,this.initPTS[i.cc],this.timescale[i.cc],function(R){A._appendCues(R,i.level),S.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(R){f.logger.log("Failed to parse IMSC1: "+R),S.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:R})})},u._parseVTTs=function(i,D,A){var S=this,R=this.hls;Object(K.parseWebVTT)(D,this.initPTS[i.cc],this.timescale[i.cc],A,i.cc,i.start,function(O){S._appendCues(O,i.level),R.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(O){S._fallbackToIMSC1(i,D),f.logger.log("Failed to parse VTT cue: "+O),R.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:O})})},u._fallbackToIMSC1=function(i,D){var A=this,S=this.tracks[i.level];S.textCodec||Object(I.parseIMSC1)(D,this.initPTS[i.cc],this.timescale[i.cc],function(){S.textCodec=I.IMSC1_CODEC,A._parseIMSC1(i,D)},function(){S.textCodec="wvtt"})},u._appendCues=function(i,D){var A=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[D];if(S.mode==="disabled")return;i.forEach(function(g){return Object(n.addCueToTrack)(S,g)})}else{var R=this.tracks[D],O=R.default?"default":"subtitles"+D;A.trigger(P.Events.CUES_PARSED,{type:"subtitles",cues:i,track:O})}},u.onFragDecrypted=function(i,D){var A=D.frag;if(A.type===E.PlaylistLevelType.SUBTITLE){if(!Object(z.isFiniteNumber)(this.initPTS[A.cc])){this.unparsedVttFrags.push(D);return}this.onFragLoaded(P.Events.FRAG_LOADED,D)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(i,D){var A=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(A&&S))return;for(var R=0;R<D.samples.length;R++){var O=D.samples[R].bytes;if(O){var g=this.extractCea608Data(O);A.addData(D.samples[R].pts,g[0]),S.addData(D.samples[R].pts,g[1])}}},u.onBufferFlushing=function(i,D){var A=D.startOffset,S=D.endOffset,R=D.endOffsetSubtitles,O=D.type,g=this.media;if(!g||g.currentTime<S)return;if(!O||O==="video"){var _=this.captionsTracks;Object.keys(_).forEach(function(d){return Object(n.removeCuesInRange)(_[d],A,S)})}if(this.config.renderTextTracksNatively&&(A===0&&R!==void 0)){var h=this.textTracks;Object.keys(h).forEach(function(d){return Object(n.removeCuesInRange)(h[d],A,R)})}},u.extractCea608Data=function(i){for(var D=i[0]&31,A=2,S=[[],[]],R=0;R<D;R++){var O=i[A++],g=127&i[A++],_=127&i[A++],h=(4&O)!==0,d=3&O;if(g===0&&_===0)continue;h&&((d===0||d===1)&&(S[d].push(g),S[d].push(_)))}return S},l}();function c(l,u){return l&&l.label===u.name&&!(l.textTrack1||l.textTrack2)}function a(l,u,s,i){return Math.min(u,i)-Math.max(l,s)}function p(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return z});var z=function(){function P(G,K){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=K}var F=P.prototype;return F.decrypt=function(K,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,K)},P}()},"./src/crypt/aes-decryptor.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"removePadding",function(){return P}),N.d(Y,"default",function(){return F});var z=N("./src/utils/typed-array.ts");function P(G){var K=G.byteLength,n=K&&new DataView(G.buffer).getUint8(K-1);return n?Object(z.sliceUint8)(G,0,K-n):G}var F=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 K=G.prototype;return K.uint8ArrayToUint32Array_=function(I){for(var E=new DataView(I),f=new Uint32Array(4),b=0;b<4;b++)f[b]=E.getUint32(b*4);return f},K.initTable=function(){var I=this.sBox,E=this.invSBox,f=this.subMix,b=f[0],c=f[1],a=f[2],p=f[3],l=this.invSubMix,u=l[0],s=l[1],i=l[2],D=l[3],A=new Uint32Array(256),S=0,R=0,O=0;for(O=0;O<256;O++)O<128?A[O]=O<<1:A[O]=O<<1^283;for(O=0;O<256;O++){var g=R^R<<1^R<<2^R<<3^R<<4;g=g>>>8^g&255^99,I[S]=g,E[g]=S;var _=A[S],h=A[_],d=A[h],C=A[g]*257^g*16843008;b[S]=C<<24|C>>>8,c[S]=C<<16|C>>>16,a[S]=C<<8|C>>>24,p[S]=C,C=d*16843009^h*65537^_*257^S*16843008,u[g]=C<<24|C>>>8,s[g]=C<<16|C>>>16,i[g]=C<<8|C>>>24,D[g]=C,S?(S=_^A[A[A[d^_]]],R^=A[A[R]]):S=R=1}},K.expandKey=function(I){for(var E=this.uint8ArrayToUint32Array_(I),f=!0,b=0;b<E.length&&f;)f=E[b]===this.key[b],b++;if(f)return;this.key=E;var c=this.keySize=E.length;if(c!==4&&c!==6&&c!==8)throw new Error("Invalid aes key size="+c);var a=this.ksRows=(c+6+1)*4,p,l,u=this.keySchedule=new Uint32Array(a),s=this.invKeySchedule=new Uint32Array(a),i=this.sBox,D=this.rcon,A=this.invSubMix,S=A[0],R=A[1],O=A[2],g=A[3],_,h;for(p=0;p<a;p++){if(p<c){_=u[p]=E[p];continue}h=_,p%c===0?(h=h<<8|h>>>24,h=i[h>>>24]<<24|i[h>>>16&255]<<16|i[h>>>8&255]<<8|i[h&255],h^=D[p/c|0]<<24):c>6&&p%c===4&&(h=i[h>>>24]<<24|i[h>>>16&255]<<16|i[h>>>8&255]<<8|i[h&255]),u[p]=_=(u[p-c]^h)>>>0}for(l=0;l<a;l++)p=a-l,l&3?h=u[p]:h=u[p-4],l<4||p<=4?s[l]=h:s[l]=S[i[h>>>24]]^R[i[h>>>16&255]]^O[i[h>>>8&255]]^g[i[h&255]],s[l]=s[l]>>>0},K.networkToHostOrderSwap=function(I){return I<<24|(I&65280)<<8|(I&16711680)>>8|I>>>24},K.decrypt=function(I,E,f){for(var b=this.keySize+6,c=this.invKeySchedule,a=this.invSBox,p=this.invSubMix,l=p[0],u=p[1],s=p[2],i=p[3],D=this.uint8ArrayToUint32Array_(f),A=D[0],S=D[1],R=D[2],O=D[3],g=new Int32Array(I),_=new Int32Array(g.length),h,d,C,x,w,j,W,T,M,m,v,H,X,q,re=this.networkToHostOrderSwap;E<g.length;){for(M=re(g[E]),m=re(g[E+1]),v=re(g[E+2]),H=re(g[E+3]),w=M^c[0],j=H^c[1],W=v^c[2],T=m^c[3],X=4,q=1;q<b;q++)h=l[w>>>24]^u[j>>16&255]^s[W>>8&255]^i[T&255]^c[X],d=l[j>>>24]^u[W>>16&255]^s[T>>8&255]^i[w&255]^c[X+1],C=l[W>>>24]^u[T>>16&255]^s[w>>8&255]^i[j&255]^c[X+2],x=l[T>>>24]^u[w>>16&255]^s[j>>8&255]^i[W&255]^c[X+3],w=h,j=d,W=C,T=x,X=X+4;h=a[w>>>24]<<24^a[j>>16&255]<<16^a[W>>8&255]<<8^a[T&255]^c[X],d=a[j>>>24]<<24^a[W>>16&255]<<16^a[T>>8&255]<<8^a[w&255]^c[X+1],C=a[W>>>24]<<24^a[T>>16&255]<<16^a[w>>8&255]<<8^a[j&255]^c[X+2],x=a[T>>>24]<<24^a[w>>16&255]<<16^a[j>>8&255]<<8^a[W&255]^c[X+3],_[E]=re(h^A),_[E+1]=re(x^S),_[E+2]=re(C^R),_[E+3]=re(d^O),A=M,S=m,R=v,O=H,E=E+4}return _.buffer},G}()},"./src/crypt/decrypter.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return E});var z=N("./src/crypt/aes-crypto.ts"),P=N("./src/crypt/fast-aes-key.ts"),F=N("./src/crypt/aes-decryptor.ts"),G=N("./src/utils/logger.ts"),K=N("./src/utils/mp4-tools.ts"),n=N("./src/utils/typed-array.ts"),I=16,E=function(){function f(c,a,p){var l=p===void 0?{}:p,u=l.removePKCS7Padding,s=u===void 0?!0:u;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=c,this.config=a,this.removePKCS7Padding=s,s)try{var i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch(D){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var b=f.prototype;return b.destroy=function(){this.observer=null},b.isSync=function(){return this.config.enableSoftwareAES},b.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var p=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(F.removePadding)(p):p},b.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},b.decrypt=function(a,p,l,u){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),p,l);var s=this.flush();s&&u(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),p,l).then(u)},b.softwareDecrypt=function(a,p,l){var u=this.currentIV,s=this.currentResult,i=this.remainderData;this.logOnce("JS AES decrypt"),i&&(a=Object(K.appendUint8Array)(i,a),this.remainderData=null);var D=this.getValidChunk(a);if(!D.length)return null;u&&(l=u);var A=this.softwareDecrypter;A||(A=this.softwareDecrypter=new F.default),A.expandKey(p);var S=s;return this.currentResult=A.decrypt(D.buffer,0,l),this.currentIV=Object(n.sliceUint8)(D,-16).buffer,S||null},b.webCryptoDecrypt=function(a,p,l){var u=this,s=this.subtle;return(this.key!==p||!this.fastAesKey)&&(this.key=p,this.fastAesKey=new P.default(s,p)),this.fastAesKey.expandKey().then(function(i){if(!s)return Promise.reject(new Error("web crypto not initialized"));var D=new z.default(s,l);return D.decrypt(a.buffer,i)}).catch(function(i){return u.onWebCryptoError(i,a,p,l)})},b.onWebCryptoError=function(a,p,l,u){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(p,l,u)},b.getValidChunk=function(a){var p=a,l=a.length-a.length%I;return l!==a.length&&(p=Object(n.sliceUint8)(a,0,l),this.remainderData=Object(n.sliceUint8)(a,l)),p},b.logOnce=function(a){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},f}()},"./src/crypt/fast-aes-key.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return z});var z=function(){function P(G,K){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=K}var F=P.prototype;return F.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},P}()},"./src/demux/aacdemuxer.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/demux/base-audio-demuxer.ts"),P=N("./src/demux/adts.ts"),F=N("./src/utils/logger.ts"),G=N("./src/demux/id3.ts");function K(E,f){E.prototype=Object.create(f.prototype),E.prototype.constructor=E,n(E,f)}function n(E,f){return n=Object.setPrototypeOf||function(c,a){return c.__proto__=a,c},n(E,f)}var I=function(E){K(f,E);function f(c,a){var p;return p=E.call(this)||this,p.observer=void 0,p.config=void 0,p.observer=c,p.config=a,p}var b=f.prototype;return b.resetInitSegment=function(a,p,l){E.prototype.resetInitSegment.call(this,a,p,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:l,inputTimeScale:9e4,dropped:0}},f.probe=function(a){if(!a)return!1;for(var p=G.getID3Data(a,0)||[],l=p.length,u=a.length;l<u;l++)if(P.probe(a,l))return F.logger.log("ADTS sync word found !"),!0;return!1},b.canParse=function(a,p){return P.canParse(a,p)},b.appendFrame=function(a,p,l){P.initTrackConfig(a,this.observer,p,l,a.manifestCodec);var u=P.appendFrame(a,p,l,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},f}(z.default);I.minProbeByteLength=9,Y.default=I},"./src/demux/adts.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"getAudioConfig",function(){return G}),N.d(Y,"isHeaderPattern",function(){return K}),N.d(Y,"getHeaderLength",function(){return n}),N.d(Y,"getFullFrameLength",function(){return I}),N.d(Y,"canGetFrameLength",function(){return E}),N.d(Y,"isHeader",function(){return f}),N.d(Y,"canParse",function(){return b}),N.d(Y,"probe",function(){return c}),N.d(Y,"initTrackConfig",function(){return a}),N.d(Y,"getFrameDuration",function(){return p}),N.d(Y,"parseFrameHeader",function(){return l}),N.d(Y,"appendFrame",function(){return u});var z=N("./src/utils/logger.ts"),P=N("./src/errors.ts"),F=N("./src/events.ts");function G(s,i,D,A){var S,R,O,g,_=navigator.userAgent.toLowerCase(),h=A,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((i[D+2]&192)>>>6)+1;var C=(i[D+2]&60)>>>2;if(C>d.length-1){s.trigger(F.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+C});return}return O=(i[D+2]&1)<<2,O|=(i[D+3]&192)>>>6,z.logger.log("manifest codec:"+A+", ADTS type:"+S+", samplingIndex:"+C),/firefox/i.test(_)?C>=6?(S=5,g=new Array(4),R=C-3):(S=2,g=new Array(2),R=C):_.indexOf("android")!==-1?(S=2,g=new Array(2),R=C):(S=5,g=new Array(4),A&&(A.indexOf("mp4a.40.29")!==-1||A.indexOf("mp4a.40.5")!==-1)||!A&&C>=6?R=C-3:((A&&A.indexOf("mp4a.40.2")!==-1&&(C>=6&&O===1||/vivaldi/i.test(_))||!A&&O===1)&&(S=2,g=new Array(2)),R=C)),g[0]=S<<3,g[0]|=(C&14)>>1,g[1]|=(C&1)<<7,g[1]|=O<<3,S===5&&(g[1]|=(R&14)>>1,g[2]=(R&1)<<7,g[2]|=2<<2,g[3]=0),{config:g,samplerate:d[C],channelCount:O,codec:"mp4a.40."+S,manifestCodec:h}}function K(s,i){return s[i]===255&&(s[i+1]&246)===240}function n(s,i){return s[i+1]&1?7:9}function I(s,i){return(s[i+3]&3)<<11|s[i+4]<<3|(s[i+5]&224)>>>5}function E(s,i){return i+5<s.length}function f(s,i){return i+1<s.length&&K(s,i)}function b(s,i){return E(s,i)&&K(s,i)&&I(s,i)<=s.length-i}function c(s,i){if(f(s,i)){var D=n(s,i);if(i+D>=s.length)return!1;var A=I(s,i);if(A<=D)return!1;var S=i+A;return S===s.length||f(s,S)}return!1}function a(s,i,D,A,S){if(!s.samplerate){var R=G(i,D,A,S);if(!R)return;s.config=R.config,s.samplerate=R.samplerate,s.channelCount=R.channelCount,s.codec=R.codec,s.manifestCodec=R.manifestCodec,z.logger.log("parsed codec:"+s.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function p(s){return 1024*9e4/s}function l(s,i,D,A,S){var R=n(s,i),O=I(s,i);if(O-=R,O>0){var g=D+A*S;return{headerLength:R,frameLength:O,stamp:g}}}function u(s,i,D,A,S){var R=p(s.samplerate),O=l(i,D,A,S,R);if(O){var g=O.frameLength,_=O.headerLength,h=O.stamp,d=_+g,C=Math.max(0,D+d-i.length),x;C?(x=new Uint8Array(d-_),x.set(i.subarray(D+_,i.length),0)):x=i.subarray(D+_,D+d);var w={unit:x,pts:h};return C||s.samples.push(w),{sample:w,length:d,missing:C}}}},"./src/demux/base-audio-demuxer.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"initPTSFn",function(){return I});var z=N("./src/polyfills/number.ts"),P=N("./src/demux/id3.ts"),F=N("./src/demux/dummy-demuxed-track.ts"),G=N("./src/utils/mp4-tools.ts"),K=N("./src/utils/typed-array.ts"),n=function(){function E(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=E.prototype;return f.resetInitSegment=function(c,a,p){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(c,a){return!1},f.appendFrame=function(c,a,p){},f.demux=function(c,a){this.cachedData&&(c=Object(G.appendUint8Array)(this.cachedData,c),this.cachedData=null);var p=P.getID3Data(c,0),l=p?p.length:0,u,s,i=this._audioTrack,D=this._id3Track,A=p?P.getTimeStamp(p):void 0,S=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(A,a)),p&&p.length>0&&D.samples.push({pts:this.initPTS,dts:this.initPTS,data:p}),s=this.initPTS;l<S;){if(this.canParse(c,l)){var R=this.appendFrame(i,c,l);R?(this.frameIndex++,s=R.sample.pts,l+=R.length,u=l):l=S}else P.canParse(c,l)?(p=P.getID3Data(c,l),D.samples.push({pts:s,dts:s,data:p}),l+=p.length,u=l):l++;if(l===S&&u!==S){var O=Object(K.sliceUint8)(c,u);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:i,avcTrack:Object(F.dummyTrack)(),id3Track:D,textTrack:Object(F.dummyTrack)()}},f.demuxSampleAes=function(c,a,p){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},f.flush=function(c){var a=this.cachedData;return a&&(this.cachedData=null,this.demux(a,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(F.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(F.dummyTrack)()}},f.destroy=function(){},E}(),I=function(f,b){return Object(z.isFiniteNumber)(f)?f*90:b*9e4};Y.default=n},"./src/demux/chunk-cache.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return z});var z=function(){function F(){this.chunks=[],this.dataLength=0}var G=F.prototype;return G.push=function(n){this.chunks.push(n),this.dataLength+=n.length},G.flush=function(){var n=this.chunks,I=this.dataLength,E;if(n.length)n.length===1?E=n[0]:E=P(n,I);else return new Uint8Array(0);return this.reset(),E},G.reset=function(){this.chunks.length=0,this.dataLength=0},F}();function P(F,G){for(var K=new Uint8Array(G),n=0,I=0;I<F.length;I++){var E=F[I];K.set(E,n),n+=E.length}return K}},"./src/demux/dummy-demuxed-track.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"dummyTrack",function(){return z});function z(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/utils/logger.ts"),P=function(){function F(K){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=K,this.bytesAvailable=K.byteLength,this.word=0,this.bitsAvailable=0}var G=F.prototype;return G.loadWord=function(){var n=this.data,I=this.bytesAvailable,E=n.byteLength-I,f=new Uint8Array(4),b=Math.min(4,I);if(b===0)throw new Error("no bytes available");f.set(n.subarray(E,E+b)),this.word=new DataView(f.buffer).getUint32(0),this.bitsAvailable=b*8,this.bytesAvailable-=b},G.skipBits=function(n){var I;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,I=n>>3,n-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},G.readBits=function(n){var I=Math.min(this.bitsAvailable,n),E=this.word>>>32-I;return n>32&&z.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=I,this.bitsAvailable>0?this.word<<=I:this.bytesAvailable>0&&this.loadWord(),I=n-I,I>0&&this.bitsAvailable?E<<I|this.readBits(I):E},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 I=8,E=8,f,b=0;b<n;b++)E!==0&&(f=this.readEG(),E=(I+f+256)%256),I=E===0?I:E},G.readSPS=function(){var n=0,I=0,E=0,f=0,b,c,a,p=this.readUByte.bind(this),l=this.readBits.bind(this),u=this.readUEG.bind(this),s=this.readBoolean.bind(this),i=this.skipBits.bind(this),D=this.skipEG.bind(this),A=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);p();var R=p();if(l(5),i(3),p(),A(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var O=u();if(O===3&&i(1),A(),A(),i(1),s())for(c=O!==3?8:12,a=0;a<c;a++)s()&&(a<6?S(16):S(64))}A();var g=u();if(g===0)u();else if(g===1)for(i(1),D(),D(),b=u(),a=0;a<b;a++)D();A(),i(1);var _=u(),h=u(),d=l(1);d===0&&i(1),i(1),s()&&(n=u(),I=u(),E=u(),f=u());var C=[1,1];if(s()&&s()){var x=p();switch(x){case 1:C=[1,1];break;case 2:C=[12,11];break;case 3:C=[10,11];break;case 4:C=[16,11];break;case 5:C=[40,33];break;case 6:C=[24,11];break;case 7:C=[20,11];break;case 8:C=[32,11];break;case 9:C=[80,33];break;case 10:C=[18,11];break;case 11:C=[15,11];break;case 12:C=[64,33];break;case 13:C=[160,99];break;case 14:C=[4,3];break;case 15:C=[3,2];break;case 16:C=[2,1];break;case 255:{C=[p()<<8|p(),p()<<8|p()];break}}}return{width:Math.ceil((_+1)*16-n*2-I*2),height:(2-d)*(h+1)*16-(d?2:4)*(E+f),pixelRatio:C}},G.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},F}();Y.default=P},"./src/demux/id3.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"isHeader",function(){return z}),N.d(Y,"isFooter",function(){return P}),N.d(Y,"getID3Data",function(){return F}),N.d(Y,"canParse",function(){return K}),N.d(Y,"getTimeStamp",function(){return n}),N.d(Y,"isTimeStampFrame",function(){return I}),N.d(Y,"getID3Frames",function(){return f}),N.d(Y,"decodeFrame",function(){return b}),N.d(Y,"utf8ArrayToStr",function(){return u}),N.d(Y,"testables",function(){return s});var z=function(S,R){return R+10<=S.length&&(S[R]===73&&S[R+1]===68&&S[R+2]===51&&(S[R+3]<255&&S[R+4]<255&&(S[R+6]<128&&S[R+7]<128&&S[R+8]<128&&S[R+9]<128)))},P=function(S,R){return R+10<=S.length&&(S[R]===51&&S[R+1]===68&&S[R+2]===73&&(S[R+3]<255&&S[R+4]<255&&(S[R+6]<128&&S[R+7]<128&&S[R+8]<128&&S[R+9]<128)))},F=function(S,R){for(var O=R,g=0;z(S,R);){g+=10;var _=G(S,R+6);g+=_,P(S,R+10)&&(g+=10),R+=g}return g>0?S.subarray(O,O+g):void 0},G=function(S,R){var O=0;return O=(S[R]&127)<<21,O|=(S[R+1]&127)<<14,O|=(S[R+2]&127)<<7,O|=S[R+3]&127,O},K=function(S,R){return z(S,R)&&G(S,R+6)+10<=S.length-R},n=function(S){for(var R=f(S),O=0;O<R.length;O++){var g=R[O];if(I(g))return l(g)}return},I=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},E=function(S){var R=String.fromCharCode(S[0],S[1],S[2],S[3]),O=G(S,4),g=10;return{type:R,size:O,data:S.subarray(g,g+O)}},f=function(S){for(var R=0,O=[];z(S,R);){var g=G(S,R+6);R+=10;for(var _=R+g;R+8<_;){var h=E(S.subarray(R)),d=b(h);d&&O.push(d),R+=h.size+10}P(S,R)&&(R+=10)}return O},b=function(S){return S.type==="PRIV"?c(S):S.type[0]==="W"?p(S):a(S)},c=function(S){if(S.size<2)return;var R=u(S.data,!0),O=new Uint8Array(S.data.subarray(R.length+1));return{key:S.type,info:R,data:O.buffer}},a=function(S){if(S.size<2)return;if(S.type==="TXXX"){var R=1,O=u(S.data.subarray(R),!0);R+=O.length+1;var g=u(S.data.subarray(R));return{key:S.type,info:O,data:g}}var _=u(S.data.subarray(1));return{key:S.type,data:_}},p=function(S){if(S.type==="WXXX"){if(S.size<2)return;var R=1,O=u(S.data.subarray(R),!0);R+=O.length+1;var g=u(S.data.subarray(R));return{key:S.type,info:O,data:g}}var _=u(S.data);return{key:S.type,data:_}},l=function(S){if(S.data.byteLength===8){var R=new Uint8Array(S.data),O=R[3]&1,g=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return g/=45,O&&(g+=4772185884e-2),Math.round(g)}return},u=function(S,R){R===void 0&&(R=!1);var O=D();if(O){var g=O.decode(S);if(R){var _=g.indexOf("\0");return _!==-1?g.substring(0,_):g}return g.replace(/\0/g,"")}for(var h=S.length,d,C,x,w="",j=0;j<h;){if(d=S[j++],d===0&&R)return w;if(d===0||d===3)continue;switch(d>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:w+=String.fromCharCode(d);break;case 12:case 13:C=S[j++],w+=String.fromCharCode((d&31)<<6|C&63);break;case 14:C=S[j++],x=S[j++],w+=String.fromCharCode((d&15)<<12|(C&63)<<6|(x&63)<<0);break;default:}}return w},s={decodeTextFrame:a},i;function D(){return!i&&typeof self.TextDecoder!="undefined"&&(i=new self.TextDecoder("utf-8")),i}},"./src/demux/mp3demuxer.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/demux/base-audio-demuxer.ts"),P=N("./src/demux/id3.ts"),F=N("./src/utils/logger.ts"),G=N("./src/demux/mpegaudio.ts");function K(E,f){E.prototype=Object.create(f.prototype),E.prototype.constructor=E,n(E,f)}function n(E,f){return n=Object.setPrototypeOf||function(c,a){return c.__proto__=a,c},n(E,f)}var I=function(E){K(f,E);function f(){return E.apply(this,arguments)||this}var b=f.prototype;return b.resetInitSegment=function(a,p,l){E.prototype.resetInitSegment.call(this,a,p,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:l,inputTimeScale:9e4,dropped:0}},f.probe=function(a){if(!a)return!1;for(var p=P.getID3Data(a,0)||[],l=p.length,u=a.length;l<u;l++)if(G.probe(a,l))return F.logger.log("MPEG Audio sync word found !"),!0;return!1},b.canParse=function(a,p){return G.canParse(a,p)},b.appendFrame=function(a,p,l){return this.initPTS===null?void 0:G.appendFrame(a,p,l,this.initPTS,this.frameIndex)},f}(z.default);I.minProbeByteLength=4,Y.default=I},"./src/demux/mp4demuxer.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/utils/mp4-tools.ts"),P=N("./src/demux/dummy-demuxed-track.ts"),F=function(){function G(n,I){this.remainderData=null,this.config=void 0,this.config=I}var K=G.prototype;return K.resetTimeStamp=function(){},K.resetInitSegment=function(){},K.resetContiguity=function(){},G.probe=function(I){return Object(z.findBox)({data:I,start:0,end:Math.min(I.length,16384)},["moof"]).length>0},K.demux=function(I){var E=I,f=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(E=Object(z.appendUint8Array)(this.remainderData,I));var b=Object(z.segmentValidRange)(E);this.remainderData=b.remainder,f.samples=b.valid||new Uint8Array}else f.samples=E;return{audioTrack:Object(P.dummyTrack)(),avcTrack:f,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},K.flush=function(){var I=Object(P.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(P.dummyTrack)(),avcTrack:I,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},K.demuxSampleAes=function(I,E,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},K.destroy=function(){},G}();F.minProbeByteLength=1024,Y.default=F},"./src/demux/mpegaudio.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"appendFrame",function(){return n}),N.d(Y,"parseHeader",function(){return I}),N.d(Y,"isHeaderPattern",function(){return E}),N.d(Y,"isHeader",function(){return f}),N.d(Y,"canParse",function(){return b}),N.d(Y,"probe",function(){return c});var z=null,P=[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],F=[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]],K=[0,1,1,4];function n(a,p,l,u,s){if(l+24>p.length)return;var i=I(p,l);if(i&&l+i.frameLength<=p.length){var D=i.samplesPerFrame*9e4/i.sampleRate,A=u+s*D,S={unit:p.subarray(l,l+i.frameLength),pts:A,dts:A};return a.config=[],a.channelCount=i.channelCount,a.samplerate=i.sampleRate,a.samples.push(S),{sample:S,length:i.frameLength,missing:0}}}function I(a,p){var l=a[p+1]>>3&3,u=a[p+1]>>1&3,s=a[p+2]>>4&15,i=a[p+2]>>2&3;if(l!==1&&s!==0&&s!==15&&i!==3){var D=a[p+2]>>1&1,A=a[p+3]>>6,S=l===3?3-u:u===3?3:4,R=P[S*14+s-1]*1e3,O=l===3?0:l===2?1:2,g=F[O*3+i],_=A===3?1:2,h=G[l][u],d=K[u],C=h*8*d,x=Math.floor(h*R/g+D)*d;if(z===null){var w=navigator.userAgent||"",j=w.match(/Chrome\/(\d+)/i);z=j?parseInt(j[1]):0}var W=!!z&&z<=87;return W&&u===2&&R>=224e3&&A===0&&(a[p+3]=a[p+3]|128),{sampleRate:g,channelCount:_,frameLength:x,samplesPerFrame:C}}}function E(a,p){return a[p]===255&&(a[p+1]&224)===224&&(a[p+1]&6)!==0}function f(a,p){return p+1<a.length&&E(a,p)}function b(a,p){var l=4;return E(a,p)&&l<=a.length-p}function c(a,p){if(p+1<a.length&&E(a,p)){var l=4,u=I(a,p),s=l;u!=null&&u.frameLength&&(s=u.frameLength);var i=p+s;return i===a.length||f(a,i)}return!1}},"./src/demux/sample-aes.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/crypt/decrypter.ts"),P=N("./src/demux/tsdemuxer.ts"),F=function(){function G(n,I,E){this.keyData=void 0,this.decrypter=void 0,this.keyData=E,this.decrypter=new z.default(n,I,{removePKCS7Padding:!1})}var K=G.prototype;return K.decryptBuffer=function(I,E){this.decrypter.decrypt(I,this.keyData.key.buffer,this.keyData.iv.buffer,E)},K.decryptAacSample=function(I,E,f,b){var c=I[E].unit,a=c.subarray(16,c.length-c.length%16),p=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),l=this;this.decryptBuffer(p,function(u){var s=new Uint8Array(u);c.set(s,16),b||l.decryptAacSamples(I,E+1,f)})},K.decryptAacSamples=function(I,E,f){for(;;E++){if(E>=I.length){f();return}if(I[E].unit.length<32)continue;var b=this.decrypter.isSync();if(this.decryptAacSample(I,E,f,b),!b)return}},K.getAvcEncryptedData=function(I){for(var E=Math.floor((I.length-48)/160)*16+16,f=new Int8Array(E),b=0,c=32;c<=I.length-16;c+=160,b+=16)f.set(I.subarray(c,c+16),b);return f},K.getAvcDecryptedUnit=function(I,E){for(var f=new Uint8Array(E),b=0,c=32;c<=I.length-16;c+=160,b+=16)I.set(f.subarray(b,b+16),c);return I},K.decryptAvcSample=function(I,E,f,b,c,a){var p=Object(P.discardEPB)(c.data),l=this.getAvcEncryptedData(p),u=this;this.decryptBuffer(l.buffer,function(s){c.data=u.getAvcDecryptedUnit(p,s),a||u.decryptAvcSamples(I,E,f+1,b)})},K.decryptAvcSamples=function(I,E,f,b){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;E++,f=0){if(E>=I.length){b();return}for(var c=I[E].units;!(f>=c.length);f++){var a=c[f];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var p=this.decrypter.isSync();if(this.decryptAvcSample(I,E,f,b,a,p),!p)return}}},G}();Y.default=F},"./src/demux/transmuxer-interface.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return c});var z=N("./node_modules/webworkify-webpack/index.js"),P=N.n(z),F=N("./src/events.ts"),G=N("./src/demux/transmuxer.ts"),K=N("./src/utils/logger.ts"),n=N("./src/errors.ts"),I=N("./src/utils/mediasource-helper.ts"),E=N("./node_modules/eventemitter3/index.js"),f=N.n(E),b=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function a(l,u,s,i){var D=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=l,this.id=u,this.onTransmuxComplete=s,this.onFlush=i;var A=l.config,S=function(h,d){d=d||{},d.frag=D.frag,d.id=D.id,l.trigger(h,d)};this.observer=new E.EventEmitter,this.observer.on(F.Events.FRAG_DECRYPTED,S),this.observer.on(F.Events.ERROR,S);var R={mp4:b.isTypeSupported("video/mp4"),mpeg:b.isTypeSupported("audio/mpeg"),mp3:b.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(A.enableWorker&&typeof Worker!="undefined"){K.logger.log("demuxing in webworker");var g;try{g=this.worker=z("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),g.addEventListener("message",this.onwmsg),g.onerror=function(_){l.trigger(F.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(_.message+" ("+_.filename+":"+_.lineno+")")})},g.postMessage({cmd:"init",typeSupported:R,vendor:O,id:u,config:JSON.stringify(A)})}catch(_){K.logger.warn("Error in worker:",_),K.logger.error("Error while initializing DemuxerWorker, fallback to inline"),g&&self.URL.revokeObjectURL(g.objectURL),this.transmuxer=new G.default(this.observer,R,A,O,u),this.worker=null}}else this.transmuxer=new G.default(this.observer,R,A,O,u)}var p=a.prototype;return p.destroy=function(){var u=this.worker;if(u)u.removeEventListener("message",this.onwmsg),u.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var i=this.observer;i&&i.removeAllListeners(),this.observer=null},p.push=function(u,s,i,D,A,S,R,O,g,_){var h=this;g.transmuxing.start=self.performance.now();var d=this.transmuxer,C=this.worker,x=S?S.start:A.start,w=A.decryptdata,j=this.frag,W=!(j&&A.cc===j.cc),T=!(j&&g.level===j.level),M=j?g.sn-j.sn:-1,m=this.part?g.part-this.part.index:1,v=!T&&(M===1||M===0&&m===1),H=self.performance.now();(T||M||A.stats.parsing.start===0)&&(A.stats.parsing.start=H),S&&(m||!v)&&(S.stats.parsing.start=H);var X=new G.TransmuxState(W,v,O,T,x);if(!v||W){K.logger.log("[transmuxer-interface, "+A.type+"]: Starting new transmux session for sn: "+g.sn+" p: "+g.part+" level: "+g.level+" id: "+g.id+`
discontinuity: `+W+`
trackSwitch: `+T+`
contiguous: `+v+`
accurateTimeOffset: `+O+`
timeOffset: `+x);var q=new G.TransmuxConfig(i,D,s,R,_);this.configureTransmuxer(q)}if(this.frag=A,this.part=S,C)C.postMessage({cmd:"demux",data:u,decryptdata:w,chunkMeta:g,state:X},u instanceof ArrayBuffer?[u]:[]);else if(d){var re=d.push(u,w,g,X);Object(G.isPromise)(re)?re.then(function(ye){h.handleTransmuxComplete(ye)}):this.handleTransmuxComplete(re)}},p.flush=function(u){var s=this;u.transmuxing.start=self.performance.now();var i=this.transmuxer,D=this.worker;if(D)D.postMessage({cmd:"flush",chunkMeta:u});else if(i){var A=i.flush(u);Object(G.isPromise)(A)?A.then(function(S){s.handleFlushResult(S,u)}):this.handleFlushResult(A,u)}},p.handleFlushResult=function(u,s){var i=this;u.forEach(function(D){i.handleTransmuxComplete(D)}),this.onFlush(s)},p.onWorkerMessage=function(u){var s=u.data,i=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,i.trigger(s.event,s.data);break}}},p.configureTransmuxer=function(u){var s=this.worker,i=this.transmuxer;s?s.postMessage({cmd:"configure",config:u}):i&&i.configure(u)},p.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},a}()},"./src/demux/transmuxer-worker.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return n});var z=N("./src/demux/transmuxer.ts"),P=N("./src/events.ts"),F=N("./src/utils/logger.ts"),G=N("./node_modules/eventemitter3/index.js"),K=N.n(G);function n(c){var a=new G.EventEmitter,p=function(u,s){c.postMessage({event:u,data:s})};a.on(P.Events.FRAG_DECRYPTED,p),a.on(P.Events.ERROR,p),c.addEventListener("message",function(l){var u=l.data;switch(u.cmd){case"init":{var s=JSON.parse(u.config);c.transmuxer=new z.default(a,u.typeSupported,s,u.vendor,u.id),Object(F.enableLogs)(s.debug),p("init",null);break}case"configure":{c.transmuxer.configure(u.config);break}case"demux":{var i=c.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(z.isPromise)(i)?i.then(function(S){I(c,S)}):I(c,i);break}case"flush":{var D=u.chunkMeta,A=c.transmuxer.flush(D);Object(z.isPromise)(A)?A.then(function(S){f(c,S,D)}):f(c,A,D);break}default:break}})}function I(c,a){if(b(a.remuxResult))return;var p=[],l=a.remuxResult,u=l.audio,s=l.video;u&&E(p,u),s&&E(p,s),c.postMessage({event:"transmuxComplete",data:a},p)}function E(c,a){a.data1&&c.push(a.data1.buffer),a.data2&&c.push(a.data2.buffer)}function f(c,a,p){a.forEach(function(l){I(c,l)}),c.postMessage({event:"flush",data:p})}function b(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return s}),N.d(Y,"isPromise",function(){return A}),N.d(Y,"TransmuxConfig",function(){return S}),N.d(Y,"TransmuxState",function(){return R});var z=N("./src/events.ts"),P=N("./src/errors.ts"),F=N("./src/crypt/decrypter.ts"),G=N("./src/demux/aacdemuxer.ts"),K=N("./src/demux/mp4demuxer.ts"),n=N("./src/demux/tsdemuxer.ts"),I=N("./src/demux/mp3demuxer.ts"),E=N("./src/remux/mp4-remuxer.ts"),f=N("./src/remux/passthrough-remuxer.ts"),b=N("./src/demux/chunk-cache.ts"),c=N("./src/utils/mp4-tools.ts"),a=N("./src/utils/logger.ts"),p;try{p=self.performance.now.bind(self.performance)}catch(O){a.logger.debug("Unable to use Performance API on this environment"),p=self.Date.now}var l=[{demux:n.default,remux:E.default},{demux:K.default,remux:f.default},{demux:G.default,remux:E.default},{demux:I.default,remux:E.default}],u=1024;l.forEach(function(O){var g=O.demux;u=Math.max(u,g.minProbeByteLength)});var s=function(){function O(_,h,d,C,x){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 b.default,this.observer=_,this.typeSupported=h,this.config=d,this.vendor=C,this.id=x}var g=O.prototype;return g.configure=function(h){this.transmuxConfig=h,this.decrypter&&this.decrypter.reset()},g.push=function(h,d,C,x){var w=this,j=C.transmuxing;j.executeStart=p();var W=new Uint8Array(h),T=this.cache,M=this.config,m=this.currentTransmuxState,v=this.transmuxConfig;x&&(this.currentTransmuxState=x);var H=i(W,d);if(H&&H.method==="AES-128"){var X=this.getDecrypter();if(M.enableSoftwareAES){var q=X.softwareDecrypt(W,H.key.buffer,H.iv.buffer);if(!q)return j.executeEnd=p(),D(C);W=new Uint8Array(q)}else return this.decryptionPromise=X.webCryptoDecrypt(W,H.key.buffer,H.iv.buffer).then(function(Ke){var nt=w.push(Ke,null,C);return w.decryptionPromise=null,nt}),this.decryptionPromise}var re=x||m,ye=re.contiguous,pe=re.discontinuity,ue=re.trackSwitch,fe=re.accurateTimeOffset,be=re.timeOffset,se=v.audioCodec,ae=v.videoCodec,Ce=v.defaultInitPts,ze=v.duration,Ye=v.initSegmentData;if((pe||ue)&&this.resetInitSegment(Ye,se,ae,ze),pe&&this.resetInitialTimestamp(Ce),ye||this.resetContiguity(),this.needsProbing(W,pe,ue)){if(T.dataLength){var He=T.flush();W=Object(c.appendUint8Array)(He,W)}this.configureTransmuxer(W,v)}var Ve=this.transmux(W,H,be,fe,C),Fe=this.currentTransmuxState;return Fe.contiguous=!0,Fe.discontinuity=!1,Fe.trackSwitch=!1,j.executeEnd=p(),Ve},g.flush=function(h){var d=this,C=h.transmuxing;C.executeStart=p();var x=this.decrypter,w=this.cache,j=this.currentTransmuxState,W=this.decryptionPromise;if(W)return W.then(function(){return d.flush(h)});var T=[],M=j.timeOffset;if(x){var m=x.flush();m&&T.push(this.push(m,null,h))}var v=w.dataLength;w.reset();var H=this.demuxer,X=this.remuxer;if(!H||!X)return v>=u&&this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),C.executeEnd=p(),[D(h)];var q=H.flush(M);return A(q)?q.then(function(re){return d.flushRemux(T,re,h),T}):(this.flushRemux(T,q,h),T)},g.flushRemux=function(h,d,C){var x=d.audioTrack,w=d.avcTrack,j=d.id3Track,W=d.textTrack,T=this.currentTransmuxState,M=T.accurateTimeOffset,m=T.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+C.sn+(C.part>-1?" p: "+C.part:"")+" of level "+C.level);var v=this.remuxer.remux(x,w,j,W,m,M,!0,this.id);h.push({remuxResult:v,chunkMeta:C}),C.transmuxing.executeEnd=p()},g.resetInitialTimestamp=function(h){var d=this.demuxer,C=this.remuxer;if(!d||!C)return;d.resetTimeStamp(h),C.resetTimeStamp(h)},g.resetContiguity=function(){var h=this.demuxer,d=this.remuxer;if(!h||!d)return;h.resetContiguity(),d.resetNextTimestamp()},g.resetInitSegment=function(h,d,C,x){var w=this.demuxer,j=this.remuxer;if(!w||!j)return;w.resetInitSegment(d,C,x),j.resetInitSegment(h,d,C)},g.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},g.transmux=function(h,d,C,x,w){var j;return d&&d.method==="SAMPLE-AES"?j=this.transmuxSampleAes(h,d,C,x,w):j=this.transmuxUnencrypted(h,C,x,w),j},g.transmuxUnencrypted=function(h,d,C,x){var w=this.demuxer.demux(h,d,!1,!this.config.progressive),j=w.audioTrack,W=w.avcTrack,T=w.id3Track,M=w.textTrack,m=this.remuxer.remux(j,W,T,M,d,C,!1,this.id);return{remuxResult:m,chunkMeta:x}},g.transmuxSampleAes=function(h,d,C,x,w){var j=this;return this.demuxer.demuxSampleAes(h,d,C).then(function(W){var T=j.remuxer.remux(W.audioTrack,W.avcTrack,W.id3Track,W.textTrack,C,x,!1,j.id);return{remuxResult:T,chunkMeta:w}})},g.configureTransmuxer=function(h,d){for(var C=this.config,x=this.observer,w=this.typeSupported,j=this.vendor,W=d.audioCodec,T=d.defaultInitPts,M=d.duration,m=d.initSegmentData,v=d.videoCodec,H,X=0,q=l.length;X<q;X++)if(l[X].demux.probe(h)){H=l[X];break}H||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),H={demux:K.default,remux:f.default});var re=this.demuxer,ye=this.remuxer,pe=H.remux,ue=H.demux;(!ye||!(ye instanceof pe))&&(this.remuxer=new pe(x,C,w,j)),(!re||!(re instanceof ue))&&(this.demuxer=new ue(x,C,w),this.probe=ue.probe),this.resetInitSegment(m,W,v,M),this.resetInitialTimestamp(T)},g.needsProbing=function(h,d,C){return!this.demuxer||!this.remuxer||d||C},g.getDecrypter=function(){var h=this.decrypter;return h||(h=this.decrypter=new F.default(this.observer,this.config)),h},O}();function i(O,g){var _=null;return O.byteLength>0&&g!=null&&g.key!=null&&g.iv!==null&&g.method!=null&&(_=g),_}var D=function(g){return{remuxResult:{},chunkMeta:g}};function A(O){return"then"in O&&O.then instanceof Function}var S=function(g,_,h,d,C){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=g,this.videoCodec=_,this.initSegmentData=h,this.duration=d,this.defaultInitPts=C},R=function(g,_,h,d,C){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=g,this.contiguous=_,this.accurateTimeOffset=h,this.trackSwitch=d,this.timeOffset=C}},"./src/demux/tsdemuxer.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"discardEPB",function(){return D});var z=N("./src/demux/adts.ts"),P=N("./src/demux/mpegaudio.ts"),F=N("./src/demux/exp-golomb.ts"),G=N("./src/demux/id3.ts"),K=N("./src/demux/sample-aes.ts"),n=N("./src/events.ts"),I=N("./src/utils/mp4-tools.ts"),E=N("./src/utils/logger.ts"),f=N("./src/errors.ts"),b={video:1,audio:2,id3:3,text:4},c=function(){function A(R,O,g){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=R,this.config=O,this.typeSupported=g}A.probe=function(O){var g=A.syncOffset(O);return g<0?!1:(g&&E.logger.warn("MPEG2-TS detected but first sync word found @ offset "+g+", junk ahead ?"),!0)},A.syncOffset=function(O){for(var g=Math.min(1e3,O.length-3*188),_=0;_<g;){if(O[_]===71&&O[_+188]===71&&O[_+2*188]===71)return _;_++}return-1},A.createTrack=function(O,g){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:b[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?g:void 0}};var S=A.prototype;return S.resetInitSegment=function(O,g,_){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=A.createTrack("video",_),this._audioTrack=A.createTrack("audio",_),this._id3Track=A.createTrack("id3",_),this._txtTrack=A.createTrack("text",_),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=g,this._duration=_},S.resetTimeStamp=function(){},S.resetContiguity=function(){var O=this._audioTrack,g=this._avcTrack,_=this._id3Track;O&&(O.pesData=null),g&&(g.pesData=null),_&&(_.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(O,g,_,h){_===void 0&&(_=!1),h===void 0&&(h=!1),_||(this.sampleAes=null);var d,C=this._avcTrack,x=this._audioTrack,w=this._id3Track,j=C.pid,W=C.pesData,T=x.pid,M=w.pid,m=x.pesData,v=w.pesData,H=!1,X=this.pmtParsed,q=this._pmtId,re=O.length;if(this.remainderData&&(O=Object(I.appendUint8Array)(this.remainderData,O),re=O.length,this.remainderData=null),re<188&&!h)return this.remainderData=O,{audioTrack:x,avcTrack:C,id3Track:w,textTrack:this._txtTrack};var ye=Math.max(0,A.syncOffset(O));re-=(re+ye)%188,re<O.byteLength&&!h&&(this.remainderData=new Uint8Array(O.buffer,re,O.buffer.byteLength-re));for(var pe=ye;pe<re;pe+=188)if(O[pe]===71){var ue=!!(O[pe+1]&64),fe=((O[pe+1]&31)<<8)+O[pe+2],be=(O[pe+3]&48)>>4,se=void 0;if(be>1){if(se=pe+5+O[pe+4],se===pe+188)continue}else se=pe+4;switch(fe){case j:ue&&(W&&(d=u(W))&&this.parseAVCPES(d,!1),W={data:[],size:0}),W&&(W.data.push(O.subarray(se,pe+188)),W.size+=pe+188-se);break;case T:ue&&(m&&(d=u(m))&&(x.isAAC?this.parseAACPES(d):this.parseMPEGPES(d)),m={data:[],size:0}),m&&(m.data.push(O.subarray(se,pe+188)),m.size+=pe+188-se);break;case M:ue&&(v&&(d=u(v))&&this.parseID3PES(d),v={data:[],size:0}),v&&(v.data.push(O.subarray(se,pe+188)),v.size+=pe+188-se);break;case 0:ue&&(se+=O[se]+1),q=this._pmtId=p(O,se);break;case q:{ue&&(se+=O[se]+1);var ae=l(O,se,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,_);j=ae.avc,j>0&&(C.pid=j),T=ae.audio,T>0&&(x.pid=T,x.isAAC=ae.isAAC),M=ae.id3,M>0&&(w.pid=M),H&&!X&&(E.logger.log("reparse from beginning"),H=!1,pe=ye-188),X=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});C.pesData=W,x.pesData=m,w.pesData=v;var Ce={audioTrack:x,avcTrack:C,id3Track:w,textTrack:this._txtTrack};return h&&this.extractRemainingSamples(Ce),Ce},S.flush=function(){var O=this.remainderData;this.remainderData=null;var g;return O?g=this.demux(O,-1,!1,!0):g={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(g),this.sampleAes?this.decrypt(g,this.sampleAes):g},S.extractRemainingSamples=function(O){var g=O.audioTrack,_=O.avcTrack,h=O.id3Track,d=_.pesData,C=g.pesData,x=h.pesData,w;d&&(w=u(d))?(this.parseAVCPES(w,!0),_.pesData=null):_.pesData=d,C&&(w=u(C))?(g.isAAC?this.parseAACPES(w):this.parseMPEGPES(w),g.pesData=null):(C!=null&&C.size&&E.logger.log("last AAC PES packet truncated,might overlap between fragments"),g.pesData=C),x&&(w=u(x))?(this.parseID3PES(w),h.pesData=null):h.pesData=x},S.demuxSampleAes=function(O,g,_){var h=this.demux(O,_,!0,!this.config.progressive),d=this.sampleAes=new K.default(this.observer,this.config,g);return this.decrypt(h,d)},S.decrypt=function(O,g){return new Promise(function(_){var h=O.audioTrack,d=O.avcTrack;h.samples&&h.isAAC?g.decryptAacSamples(h.samples,0,function(){d.samples?g.decryptAvcSamples(d.samples,0,0,function(){_(O)}):_(O)}):d.samples&&g.decryptAvcSamples(d.samples,0,0,function(){_(O)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(O,g){var _=this,h=this._avcTrack,d=this.parseAVCNALu(O.data),C=!1,x=this.avcSample,w,j=!1;O.data=null,x&&d.length&&!h.audFound&&(s(x,h),x=this.avcSample=a(!1,O.pts,O.dts,"")),d.forEach(function(W){switch(W.type){case 1:{w=!0,x||(x=_.avcSample=a(!0,O.pts,O.dts,"")),C&&(x.debug+="NDR "),x.frame=!0;var T=W.data;if(j&&T.length>4){var M=new F.default(T).readSliceType();(M===2||M===4||M===7||M===9)&&(x.key=!0)}break}case 5:w=!0,x||(x=_.avcSample=a(!0,O.pts,O.dts,"")),C&&(x.debug+="IDR "),x.key=!0,x.frame=!0;break;case 6:{w=!0,C&&x&&(x.debug+="SEI ");var m=new F.default(D(W.data));m.readUByte();for(var v=0,H=0,X=!1,q=0;!X&&m.bytesAvailable>1;){v=0;do q=m.readUByte(),v+=q;while(q===255);H=0;do q=m.readUByte(),H+=q;while(q===255);if(v===4&&m.bytesAvailable!==0){X=!0;var re=m.readUByte();if(re===181){var ye=m.readUShort();if(ye===49){var pe=m.readUInt();if(pe===1195456820){var ue=m.readUByte();if(ue===3){for(var fe=m.readUByte(),be=m.readUByte(),se=31&fe,ae=[fe,be],Ce=0;Ce<se;Ce++)ae.push(m.readUByte()),ae.push(m.readUByte()),ae.push(m.readUByte());i(_._txtTrack.samples,{type:3,pts:O.pts,bytes:ae})}}}}}else if(v===5&&m.bytesAvailable!==0){if(X=!0,H>16){for(var ze=[],Ye=0;Ye<16;Ye++)ze.push(m.readUByte().toString(16)),(Ye===3||Ye===5||Ye===7||Ye===9)&&ze.push("-");for(var He=H-16,Ve=new Uint8Array(He),Fe=0;Fe<He;Fe++)Ve[Fe]=m.readUByte();i(_._txtTrack.samples,{pts:O.pts,payloadType:v,uuid:ze.join(""),userData:Object(G.utf8ArrayToStr)(Ve),userDataBytes:Ve})}}else if(H<m.bytesAvailable)for(var Ke=0;Ke<H;Ke++)m.readUByte()}break}case 7:if(w=!0,j=!0,C&&x&&(x.debug+="SPS "),!h.sps){var nt=new F.default(W.data),de=nt.readSPS();h.width=de.width,h.height=de.height,h.pixelRatio=de.pixelRatio,h.sps=[W.data],h.duration=_._duration;for(var De=W.data.subarray(1,4),Ne="avc1.",Ue=0;Ue<3;Ue++){var rt=De[Ue].toString(16);rt.length<2&&(rt="0"+rt),Ne+=rt}h.codec=Ne}break;case 8:w=!0,C&&x&&(x.debug+="PPS "),h.pps||(h.pps=[W.data]);break;case 9:w=!1,h.audFound=!0,x&&s(x,h),x=_.avcSample=a(!1,O.pts,O.dts,C?"AUD ":"");break;case 12:w=!1;break;default:w=!1,x&&(x.debug+="unknown NAL "+W.type+" ");break}if(x&&w){var lt=x.units;lt.push(W)}}),g&&x&&(s(x,h),this.avcSample=null)},S.getLastNalUnit=function(){var O,g=this.avcSample,_;if(!g||g.units.length===0){var h=this._avcTrack.samples;g=h[h.length-1]}if((O=g)!==null&&O!==void 0&&O.units){var d=g.units;_=d[d.length-1]}return _},S.parseAVCNALu=function(O){var g=O.byteLength,_=this._avcTrack,h=_.naluState||0,d=h,C=[],x=0,w,j,W,T=-1,M=0;for(h===-1&&(T=0,M=O[0]&31,h=0,x=1);x<g;){if(w=O[x++],!h){h=w?0:1;continue}if(h===1){h=w?0:2;continue}if(!w)h=3;else if(w===1){if(T>=0){var m={data:O.subarray(T,x-h-1),type:M};C.push(m)}else{var v=this.getLastNalUnit();if(v&&(d&&x<=4-d&&(v.state&&(v.data=v.data.subarray(0,v.data.byteLength-d))),j=x-h-1,j>0)){var H=new Uint8Array(v.data.byteLength+j);H.set(v.data,0),H.set(O.subarray(0,j),v.data.byteLength),v.data=H,v.state=0}}x<g?(W=O[x]&31,T=x,M=W,h=0):h=-1}else h=0}if(T>=0&&h>=0){var X={data:O.subarray(T,g),type:M,state:h};C.push(X)}if(C.length===0){var q=this.getLastNalUnit();if(q){var re=new Uint8Array(q.data.byteLength+O.byteLength);re.set(q.data,0),re.set(O,q.data.byteLength),q.data=re}}return _.naluState=h,C},S.parseAACPES=function(O){var g=0,_=this._audioTrack,h=this.aacOverFlow,d=O.data;if(h){this.aacOverFlow=null;var C=h.sample.unit.byteLength,x=Math.min(h.missing,C),w=C-x;h.sample.unit.set(d.subarray(0,x),w),_.samples.push(h.sample),g=h.missing}var j,W;for(j=g,W=d.length;j<W-1&&!z.isHeader(d,j);j++);if(j!==g){var T,M;if(j<W-1?(T="AAC PES did not start with ADTS header,offset:"+j,M=!1):(T="no ADTS header found in AAC PES",M=!0),E.logger.warn("parsing error:"+T),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:M,reason:T}),M)return}z.initTrackConfig(_,this.observer,d,j,this.audioCodec);var m;if(O.pts!==void 0)m=O.pts;else if(h){var v=z.getFrameDuration(_.samplerate);m=h.sample.pts+v}else{E.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var H=0;j<W;)if(z.isHeader(d,j)){if(j+5<W){var X=z.appendFrame(_,d,j,m,H);if(X)if(X.missing)this.aacOverFlow=X;else{j+=X.length,H++;continue}}break}else j++},S.parseMPEGPES=function(O){var g=O.data,_=g.length,h=0,d=0,C=O.pts;if(C===void 0){E.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;d<_;)if(P.isHeader(g,d)){var x=P.appendFrame(this._audioTrack,g,d,C,h);if(x)d+=x.length,h++;else break}else d++},S.parseID3PES=function(O){if(O.pts===void 0){E.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},A}();c.minProbeByteLength=188;function a(A,S,R,O){return{key:A,frame:!1,pts:S,dts:R,units:[],debug:O,length:0}}function p(A,S){return(A[S+10]&31)<<8|A[S+11]}function l(A,S,R,O){var g={audio:-1,avc:-1,id3:-1,isAAC:!0},_=(A[S+1]&15)<<8|A[S+2],h=S+3+_-4,d=(A[S+10]&15)<<8|A[S+11];for(S+=12+d;S<h;){var C=(A[S+1]&31)<<8|A[S+2];switch(A[S]){case 207:if(!O){E.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:g.audio===-1&&(g.audio=C);break;case 21:g.id3===-1&&(g.id3=C);break;case 219:if(!O){E.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:g.avc===-1&&(g.avc=C);break;case 3:case 4:R?g.audio===-1&&(g.audio=C,g.isAAC=!1):E.logger.log("MPEG audio found, not supported in this browser");break;case 36:E.logger.warn("Unsupported HEVC stream type found");break;default:break}S+=((A[S+3]&15)<<8|A[S+4])+5}return g}function u(A){var S=0,R,O,g,_,h,d=A.data;if(!A||A.size===0)return null;for(;d[0].length<19&&d.length>1;){var C=new Uint8Array(d[0].length+d[1].length);C.set(d[0]),C.set(d[1],d[0].length),d[0]=C,d.splice(1,1)}R=d[0];var x=(R[0]<<16)+(R[1]<<8)+R[2];if(x===1){if(O=(R[4]<<8)+R[5],O&&O>A.size-6)return null;var w=R[7];w&192&&(_=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,w&64?(h=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,_-h>60*9e4&&(E.logger.warn(Math.round((_-h)/9e4)+"s delta between PTS and DTS, align them"),_=h)):h=_),g=R[8];var j=g+9;if(A.size<=j)return null;A.size-=j;for(var W=new Uint8Array(A.size),T=0,M=d.length;T<M;T++){R=d[T];var m=R.byteLength;if(j)if(j>m){j-=m;continue}else R=R.subarray(j),m-=j,j=0;W.set(R,S),S+=m}return O&&(O-=g+3),{data:W,pts:_,dts:h,len:O}}return null}function s(A,S){if(A.units.length&&A.frame){if(A.pts===void 0){var R=S.samples,O=R.length;if(O){var g=R[O-1];A.pts=g.pts,A.dts=g.dts}else{S.dropped++;return}}S.samples.push(A)}A.debug.length&&E.logger.log(A.pts+"/"+A.dts+":"+A.debug)}function i(A,S){var R=A.length;if(R>0){if(S.pts>=A[R-1].pts)A.push(S);else for(var O=R-1;O>=0;O--)if(S.pts<A[O].pts){A.splice(O,0,S);break}}else A.push(S)}function D(A){for(var S=A.byteLength,R=[],O=1;O<S-2;)A[O]===0&&A[O+1]===0&&A[O+2]===3?(R.push(O+2),O+=2):O++;if(R.length===0)return A;var g=S-R.length,_=new Uint8Array(g),h=0;for(O=0;O<g;h++,O++)h===R[0]&&(h++,R.shift()),_[O]=A[h];return _}Y.default=c},"./src/errors.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"ErrorTypes",function(){return z}),N.d(Y,"ErrorDetails",function(){return P});var z;(function(F){F.NETWORK_ERROR="networkError",F.MEDIA_ERROR="mediaError",F.KEY_SYSTEM_ERROR="keySystemError",F.MUX_ERROR="muxError",F.OTHER_ERROR="otherError"})(z||(z={}));var P;(function(F){F.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",F.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",F.KEY_SYSTEM_NO_SESSION="keySystemNoSession",F.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",F.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",F.MANIFEST_LOAD_ERROR="manifestLoadError",F.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",F.MANIFEST_PARSING_ERROR="manifestParsingError",F.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",F.LEVEL_EMPTY_ERROR="levelEmptyError",F.LEVEL_LOAD_ERROR="levelLoadError",F.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",F.LEVEL_SWITCH_ERROR="levelSwitchError",F.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",F.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",F.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",F.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",F.FRAG_LOAD_ERROR="fragLoadError",F.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",F.FRAG_DECRYPT_ERROR="fragDecryptError",F.FRAG_PARSING_ERROR="fragParsingError",F.REMUX_ALLOC_ERROR="remuxAllocError",F.KEY_LOAD_ERROR="keyLoadError",F.KEY_LOAD_TIMEOUT="keyLoadTimeOut",F.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",F.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",F.BUFFER_APPEND_ERROR="bufferAppendError",F.BUFFER_APPENDING_ERROR="bufferAppendingError",F.BUFFER_STALLED_ERROR="bufferStalledError",F.BUFFER_FULL_ERROR="bufferFullError",F.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",F.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",F.INTERNAL_EXCEPTION="internalException",F.INTERNAL_ABORTED="aborted",F.UNKNOWN="unknown"})(P||(P={}))},"./src/events.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"Events",function(){return z});var z;(function(P){P.MEDIA_ATTACHING="hlsMediaAttaching",P.MEDIA_ATTACHED="hlsMediaAttached",P.MEDIA_DETACHING="hlsMediaDetaching",P.MEDIA_DETACHED="hlsMediaDetached",P.BUFFER_RESET="hlsBufferReset",P.BUFFER_CODECS="hlsBufferCodecs",P.BUFFER_CREATED="hlsBufferCreated",P.BUFFER_APPENDING="hlsBufferAppending",P.BUFFER_APPENDED="hlsBufferAppended",P.BUFFER_EOS="hlsBufferEos",P.BUFFER_FLUSHING="hlsBufferFlushing",P.BUFFER_FLUSHED="hlsBufferFlushed",P.MANIFEST_LOADING="hlsManifestLoading",P.MANIFEST_LOADED="hlsManifestLoaded",P.MANIFEST_PARSED="hlsManifestParsed",P.LEVEL_SWITCHING="hlsLevelSwitching",P.LEVEL_SWITCHED="hlsLevelSwitched",P.LEVEL_LOADING="hlsLevelLoading",P.LEVEL_LOADED="hlsLevelLoaded",P.LEVEL_UPDATED="hlsLevelUpdated",P.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",P.LEVELS_UPDATED="hlsLevelsUpdated",P.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",P.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",P.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",P.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",P.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",P.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",P.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",P.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",P.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",P.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",P.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",P.CUES_PARSED="hlsCuesParsed",P.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",P.INIT_PTS_FOUND="hlsInitPtsFound",P.FRAG_LOADING="hlsFragLoading",P.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",P.FRAG_LOADED="hlsFragLoaded",P.FRAG_DECRYPTED="hlsFragDecrypted",P.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",P.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",P.FRAG_PARSING_METADATA="hlsFragParsingMetadata",P.FRAG_PARSED="hlsFragParsed",P.FRAG_BUFFERED="hlsFragBuffered",P.FRAG_CHANGED="hlsFragChanged",P.FPS_DROP="hlsFpsDrop",P.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",P.ERROR="hlsError",P.DESTROYING="hlsDestroying",P.KEY_LOADING="hlsKeyLoading",P.KEY_LOADED="hlsKeyLoaded",P.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",P.BACK_BUFFER_REACHED="hlsBackBufferReached"})(z||(z={}))},"./src/hls.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return A});var z=N("./node_modules/url-toolkit/src/url-toolkit.js"),P=N.n(z),F=N("./src/loader/playlist-loader.ts"),G=N("./src/loader/key-loader.ts"),K=N("./src/controller/id3-track-controller.ts"),n=N("./src/controller/latency-controller.ts"),I=N("./src/controller/level-controller.ts"),E=N("./src/controller/fragment-tracker.ts"),f=N("./src/controller/stream-controller.ts"),b=N("./src/is-supported.ts"),c=N("./src/utils/logger.ts"),a=N("./src/config.ts"),p=N("./node_modules/eventemitter3/index.js"),l=N.n(p),u=N("./src/events.ts"),s=N("./src/errors.ts");function i(S,R){for(var O=0;O<R.length;O++){var g=R[O];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(S,g.key,g)}}function D(S,R,O){return R&&i(S.prototype,R),O&&i(S,O),S}var A=function(){S.isSupported=function(){return Object(b.isSupported)()};function S(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new p.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 g=this.config=Object(a.mergeConfig)(S.DefaultConfig,O);this.userConfig=O,Object(c.enableLogs)(g.debug),this._autoLevelCapping=-1,g.progressive&&Object(a.enableStreamingMode)(g);var _=g.abrController,h=g.bufferController,d=g.capLevelController,C=g.fpsController,x=this.abrController=new _(this),w=this.bufferController=new h(this),j=this.capLevelController=new d(this),W=new C(this),T=new F.default(this),M=new G.default(this),m=new K.default(this),v=this.levelController=new I.default(this),H=new E.FragmentTracker(this),X=this.streamController=new f.default(this,H);j.setStreamController(X),W.setStreamController(X);var q=[v,X];this.networkControllers=q;var re=[T,M,x,w,j,W,m,H];this.audioTrackController=this.createController(g.audioTrackController,null,q),this.createController(g.audioStreamController,H,q),this.subtitleTrackController=this.createController(g.subtitleTrackController,null,q),this.createController(g.subtitleStreamController,H,q),this.createController(g.timelineController,null,re),this.emeController=this.createController(g.emeController,null,re),this.cmcdController=this.createController(g.cmcdController,null,re),this.latencyController=this.createController(n.default,null,re),this.coreComponents=re}var R=S.prototype;return R.createController=function(g,_,h){if(g){var d=_?new g(this,_):new g(this);return h&&h.push(d),d}return null},R.on=function(g,_,h){h===void 0&&(h=this),this._emitter.on(g,_,h)},R.once=function(g,_,h){h===void 0&&(h=this),this._emitter.once(g,_,h)},R.removeAllListeners=function(g){this._emitter.removeAllListeners(g)},R.off=function(g,_,h,d){h===void 0&&(h=this),this._emitter.off(g,_,h,d)},R.listeners=function(g){return this._emitter.listeners(g)},R.emit=function(g,_,h){return this._emitter.emit(g,_,h)},R.trigger=function(g,_){if(this.config.debug)return this.emit(g,g,_);try{return this.emit(g,g,_)}catch(h){c.logger.error("An internal error happened while handling event "+g+'. Error message: "'+h.message+'". Here is a stacktrace:',h),this.trigger(u.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:g,error:h})}return!1},R.listenerCount=function(g){return this._emitter.listenerCount(g)},R.destroy=function(){c.logger.log("destroy"),this.trigger(u.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(g){return g.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(g){return g.destroy()}),this.coreComponents.length=0},R.attachMedia=function(g){c.logger.log("attachMedia"),this._media=g,this.trigger(u.Events.MEDIA_ATTACHING,{media:g})},R.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(u.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(g){this.stopLoad();var _=this.media,h=this.url,d=this.url=z.buildAbsoluteURL(self.location.href,g,{alwaysNormalize:!0});c.logger.log("loadSource:"+d),_&&h&&h!==d&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(_)),this.trigger(u.Events.MANIFEST_LOADING,{url:g})},R.startLoad=function(g){g===void 0&&(g=-1),c.logger.log("startLoad("+g+")"),this.networkControllers.forEach(function(_){_.startLoad(g)})},R.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(g){g.stopLoad()})},R.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){c.logger.log("recoverMediaError");var g=this._media;this.detachMedia(),g&&this.attachMedia(g)},R.removeLevel=function(g,_){_===void 0&&(_=0),this.levelController.removeLevel(g,_)},D(S,[{key:"levels",get:function(){var g=this.levelController.levels;return g||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(g){c.logger.log("set currentLevel:"+g),this.loadLevel=g,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(g){c.logger.log("set nextLevel:"+g),this.levelController.manualLevel=g,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(g){c.logger.log("set loadLevel:"+g),this.levelController.manualLevel=g}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(g){this.levelController.nextLoadLevel=g}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(g){c.logger.log("set firstLevel:"+g),this.levelController.firstLevel=g}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(g){c.logger.log("set startLevel:"+g),g!==-1&&(g=Math.max(g,this.minAutoLevel)),this.levelController.startLevel=g}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(g){var _=!!g;_!==this.config.capLevelToPlayerSize&&(_?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=_)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(g){this._autoLevelCapping!==g&&(c.logger.log("set autoLevelCapping:"+g),this._autoLevelCapping=g)}},{key:"bandwidthEstimate",get:function(){var g=this.abrController.bwEstimator;return g?g.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var g=this.levels,_=this.config.minAutoBitrate;if(!g)return 0;for(var h=g.length,d=0;d<h;d++)if(g[d].maxBitrate>_)return d;return 0}},{key:"maxAutoLevel",get:function(){var g=this.levels,_=this.autoLevelCapping,h;return _===-1&&g&&g.length?h=g.length-1:h=_,h}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(g){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,g)}},{key:"audioTracks",get:function(){var g=this.audioTrackController;return g?g.audioTracks:[]}},{key:"audioTrack",get:function(){var g=this.audioTrackController;return g?g.audioTrack:-1},set:function(g){var _=this.audioTrackController;_&&(_.audioTrack=g)}},{key:"subtitleTracks",get:function(){var g=this.subtitleTrackController;return g?g.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var g=this.subtitleTrackController;return g?g.subtitleTrack:-1},set:function(g){var _=this.subtitleTrackController;_&&(_.subtitleTrack=g)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var g=this.subtitleTrackController;return g?g.subtitleDisplay:!1},set:function(g){var _=this.subtitleTrackController;_&&(_.subtitleDisplay=g)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(g){this.config.lowLatencyMode=g}},{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 u.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:a.hlsDefaultConfig},set:function(g){S.defaultConfig=g}}]),S}();A.defaultConfig=void 0},"./src/is-supported.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"isSupported",function(){return F}),N.d(Y,"changeTypeSupported",function(){return G});var z=N("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function F(){var K=Object(z.getMediaSource)();if(!K)return!1;var n=P(),I=K&&typeof K.isTypeSupported=="function"&&K.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),E=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!I&&!!E}function G(){var K,n=P();return typeof(n==null||((K=n.prototype)===null||K===void 0)?void 0:K.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return c}),N.d(Y,"LoadError",function(){return p});var z=N("./src/polyfills/number.ts"),P=N("./src/errors.ts");function F(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,E(l,u)}function G(l){var u=typeof Map=="function"?new Map:void 0;return G=function(i){if(i===null||!I(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof u!="undefined"){if(u.has(i))return u.get(i);u.set(i,D)}function D(){return K(i,arguments,f(this).constructor)}return D.prototype=Object.create(i.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),E(D,i)},G(l)}function K(l,u,s){return n()?K=Reflect.construct:K=function(D,A,S){var R=[null];R.push.apply(R,A);var O=Function.bind.apply(D,R),g=new O;return S&&E(g,S.prototype),g},K.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(l){return!1}}function I(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function E(l,u){return E=Object.setPrototypeOf||function(i,D){return i.__proto__=D,i},E(l,u)}function f(l){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},f(l)}var b=Math.pow(2,17),c=function(){function l(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var u=l.prototype;return u.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},u.abort=function(){this.loader&&this.loader.abort()},u.load=function(i,D){var A=this,S=i.url;if(!S)return Promise.reject(new p({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var R=this.config,O=R.fLoader,g=R.loader;return new Promise(function(_,h){A.loader&&A.loader.destroy();var d=A.loader=i.loader=O?new O(R):new g(R),C=a(i),x={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:b};i.stats=d.stats,d.load(C,x,{onSuccess:function(j,W,T,M){A.resetLoader(i,d),_({frag:i,part:null,payload:j.data,networkDetails:M})},onError:function(j,W,T){A.resetLoader(i,d),h(new p({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,response:j,networkDetails:T}))},onAbort:function(j,W,T){A.resetLoader(i,d),h(new p({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,networkDetails:T}))},onTimeout:function(j,W,T){A.resetLoader(i,d),h(new p({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,networkDetails:T}))},onProgress:function(j,W,T,M){D&&D({frag:i,part:null,payload:T,networkDetails:M})}})})},u.loadPart=function(i,D,A){var S=this;this.abort();var R=this.config,O=R.fLoader,g=R.loader;return new Promise(function(_,h){S.loader&&S.loader.destroy();var d=S.loader=i.loader=O?new O(R):new g(R),C=a(i,D),x={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:b};D.stats=d.stats,d.load(C,x,{onSuccess:function(j,W,T,M){S.resetLoader(i,d),S.updateStatsFromPart(i,D);var m={frag:i,part:D,payload:j.data,networkDetails:M};A(m),_(m)},onError:function(j,W,T){S.resetLoader(i,d),h(new p({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,part:D,response:j,networkDetails:T}))},onAbort:function(j,W,T){i.stats.aborted=D.stats.aborted,S.resetLoader(i,d),h(new p({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,part:D,networkDetails:T}))},onTimeout:function(j,W,T){S.resetLoader(i,d),h(new p({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,part:D,networkDetails:T}))}})})},u.updateStatsFromPart=function(i,D){var A=i.stats,S=D.stats,R=S.total;if(A.loaded+=S.loaded,R){var O=Math.round(i.duration/D.duration),g=Math.min(Math.round(A.loaded/R),O),_=O-g,h=_*Math.round(A.loaded/g);A.total=A.loaded+h}else A.total=Math.max(A.loaded,A.total);var d=A.loading,C=S.loading;d.start?d.first+=C.first-C.start:(d.start=C.start,d.first=C.first),d.end=C.end},u.resetLoader=function(i,D){i.loader=null,this.loader===D&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),D.destroy()},l}();function a(l,u){u===void 0&&(u=null);var s=u||l,i={frag:l,part:u,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},D=s.byteRangeStartOffset,A=s.byteRangeEndOffset;return Object(z.isFiniteNumber)(D)&&Object(z.isFiniteNumber)(A)&&(i.rangeStart=D,i.rangeEnd=A),i}var p=function(l){F(u,l);function u(s){for(var i,D=arguments.length,A=new Array(D>1?D-1:0),S=1;S<D;S++)A[S-1]=arguments[S];return i=l.call.apply(l,[this].concat(A))||this,i.data=void 0,i.data=s,i}return u}(G(Error))},"./src/loader/fragment.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"ElementaryStreamTypes",function(){return c}),N.d(Y,"BaseSegment",function(){return a}),N.d(Y,"Fragment",function(){return p}),N.d(Y,"Part",function(){return l});var z=N("./src/polyfills/number.ts"),P=N("./node_modules/url-toolkit/src/url-toolkit.js"),F=N.n(P),G=N("./src/utils/logger.ts"),K=N("./src/loader/level-key.ts"),n=N("./src/loader/load-stats.ts");function I(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,E(u,s)}function E(u,s){return E=Object.setPrototypeOf||function(D,A){return D.__proto__=A,D},E(u,s)}function f(u,s){for(var i=0;i<s.length;i++){var D=s[i];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(u,D.key,D)}}function b(u,s,i){return s&&f(u.prototype,s),i&&f(u,i),u}var c;(function(u){u.AUDIO="audio",u.VIDEO="video",u.AUDIOVIDEO="audiovideo"})(c||(c={}));var a=function(){function u(i){var D;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(D={},D[c.AUDIO]=null,D[c.VIDEO]=null,D[c.AUDIOVIDEO]=null,D),this.baseurl=i}var s=u.prototype;return s.setByteRange=function(D,A){var S=D.split("@",2),R=[];S.length===1?R[0]=A?A.byteRangeEndOffset:0:R[0]=parseInt(S[1]),R[1]=parseInt(S[0])+R[0],this._byteRange=R},b(u,[{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(P.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(D){this._url=D}}]),u}(),p=function(u){I(s,u);function s(D,A){var S;return S=u.call(this,A)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new n.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=D,S}var i=s.prototype;return i.createInitializationVector=function(A){for(var S=new Uint8Array(16),R=12;R<16;R++)S[R]=A>>8*(15-R)&255;return S},i.setDecryptDataFromLevelKey=function(A,S){var R=A;return(A==null?void 0:A.method)==="AES-128"&&A.uri&&!A.iv&&(R=K.LevelKey.fromURI(A.uri),R.method=A.method,R.iv=this.createInitializationVector(S),R.keyFormat="identity"),R},i.setElementaryStreamInfo=function(A,S,R,O,g,_){_===void 0&&(_=!1);var h=this.elementaryStreams,d=h[A];if(!d){h[A]={startPTS:S,endPTS:R,startDTS:O,endDTS:g,partial:_};return}d.startPTS=Math.min(d.startPTS,S),d.endPTS=Math.max(d.endPTS,R),d.startDTS=Math.min(d.startDTS,O),d.endDTS=Math.max(d.endDTS,g)},i.clearElementaryStreamInfo=function(){var A=this.elementaryStreams;A[c.AUDIO]=null,A[c.VIDEO]=null,A[c.AUDIOVIDEO]=null},b(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var A=this.sn;typeof A!="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'),A=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,A)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(z.isFiniteNumber)(this.programDateTime))return null;var A=Object(z.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+A*1e3}},{key:"encrypted",get:function(){var A;return!!((A=this.decryptdata)!==null&&A!==void 0&&A.keyFormat&&this.decryptdata.uri)}}]),s}(a),l=function(u){I(s,u);function s(i,D,A,S,R){var O;O=u.call(this,A)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new n.LoadStats,O.duration=i.decimalFloatingPoint("DURATION"),O.gap=i.bool("GAP"),O.independent=i.bool("INDEPENDENT"),O.relurl=i.enumeratedString("URI"),O.fragment=D,O.index=S;var g=i.enumeratedString("BYTERANGE");return g&&O.setByteRange(g,R),R&&(O.fragOffset=R.fragOffset+R.duration),O}return b(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var D=this.elementaryStreams;return!!(D.audio||D.video||D.audiovideo)}}]),s}(a)},"./src/loader/key-loader.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return G});var z=N("./src/events.ts"),P=N("./src/errors.ts"),F=N("./src/utils/logger.ts"),G=function(){function K(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var n=K.prototype;return n._registerListeners=function(){this.hls.on(z.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(z.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var E in this.loaders){var f=this.loaders[E];f&&f.destroy()}this.loaders={}},n.onKeyLoading=function(E,f){var b=f.frag,c=b.type,a=this.loaders[c];if(!b.decryptdata){F.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var p=b.decryptdata.uri;if(p!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(a&&(F.logger.warn("abort previous key loader for type:"+c),a.abort()),!p){F.logger.warn("key uri is falsy");return}var u=l.loader,s=b.loader=this.loaders[c]=new u(l);this.decrypturl=p,this.decryptkey=null;var i={url:p,frag:b,responseType:"arraybuffer"},D={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},A={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(i,D,A)}else this.decryptkey&&(b.decryptdata.key=this.decryptkey,this.hls.trigger(z.Events.KEY_LOADED,{frag:b}))},n.loadsuccess=function(E,f,b){var c=b.frag;if(!c.decryptdata){F.logger.error("after key load, decryptdata unset");return}this.decryptkey=c.decryptdata.key=new Uint8Array(E.data),c.loader=null,delete this.loaders[c.type],this.hls.trigger(z.Events.KEY_LOADED,{frag:c})},n.loaderror=function(E,f){var b=f.frag,c=b.loader;c&&c.abort(),delete this.loaders[b.type],this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:b,response:E})},n.loadtimeout=function(E,f){var b=f.frag,c=b.loader;c&&c.abort(),delete this.loaders[b.type],this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:b})},K}()},"./src/loader/level-details.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"LevelDetails",function(){return K});var z=N("./src/polyfills/number.ts");function P(n,I){for(var E=0;E<I.length;E++){var f=I[E];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(n,f.key,f)}}function F(n,I,E){return I&&P(n.prototype,I),E&&P(n,E),n}var G=10,K=function(){function n(E){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=E}var I=n.prototype;return I.reloaded=function(f){if(!f){this.advanced=!0,this.updated=!0;return}var b=this.lastPartSn-f.lastPartSn,c=this.lastPartIndex-f.lastPartIndex;this.updated=this.endSN!==f.endSN||!!c||!!b,this.advanced=this.endSN>f.endSN||b>0||b===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},F(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(z.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||G}},{key:"drift",get:function(){var f=this.driftEndTime-this.driftStartTime;if(f>0){var b=this.driftEnd-this.driftStart;return b*1e3/f}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var f;return(f=this.fragments)!==null&&f!==void 0&&f.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 f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),n}()},"./src/loader/level-key.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"LevelKey",function(){return K});var z=N("./node_modules/url-toolkit/src/url-toolkit.js"),P=N.n(z);function F(n,I){for(var E=0;E<I.length;E++){var f=I[E];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(n,f.key,f)}}function G(n,I,E){return I&&F(n.prototype,I),E&&F(n,E),n}var K=function(){n.fromURL=function(E,f){return new n(E,f)},n.fromURI=function(E){return new n(E)};function n(I,E){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,E?this._uri=Object(z.buildAbsoluteURL)(I,E,{alwaysNormalize:!0}):this._uri=I}return G(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"LoadStats",function(){return z});var z=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(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return s});var z=N("./src/polyfills/number.ts"),P=N("./node_modules/url-toolkit/src/url-toolkit.js"),F=N.n(P),G=N("./src/loader/fragment.ts"),K=N("./src/loader/level-details.ts"),n=N("./src/loader/level-key.ts"),I=N("./src/utils/attr-list.ts"),E=N("./src/utils/logger.ts"),f=N("./src/utils/codecs.ts"),b=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,c=/#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"),p=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function u(R){var O,g;return l.test((O=(g=P.parseURL(R))===null||g===void 0?void 0:g.path)!=null?O:"")}var s=function(){function R(){}return R.findGroup=function(g,_){for(var h=0;h<g.length;h++){var d=g[h];if(d.id===_)return d}},R.convertAVC1ToAVCOTI=function(g){var _=g.split(".");if(_.length>2){var h=_.shift()+".";return h+=parseInt(_.shift()).toString(16),h+=("000"+parseInt(_.shift()).toString(16)).substr(-4),h}return g},R.resolve=function(g,_){return P.buildAbsoluteURL(_,g,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(g,_){var h=[],d={},C=!1;b.lastIndex=0;for(var x;(x=b.exec(g))!=null;)if(x[1]){var w=new I.AttrList(x[1]),j={attrs:w,bitrate:w.decimalInteger("AVERAGE-BANDWIDTH")||w.decimalInteger("BANDWIDTH"),name:w.NAME,url:R.resolve(x[2],_)},W=w.decimalResolution("RESOLUTION");W&&(j.width=W.width,j.height=W.height),i((w.CODECS||"").split(/[ ,]+/).filter(function(M){return M}),j),j.videoCodec&&j.videoCodec.indexOf("avc1")!==-1&&(j.videoCodec=R.convertAVC1ToAVCOTI(j.videoCodec)),h.push(j)}else if(x[3]){var T=new I.AttrList(x[3]);T["DATA-ID"]&&(C=!0,d[T["DATA-ID"]]=T)}return{levels:h,sessionData:C?d:null}},R.parseMasterPlaylistMedia=function(g,_,h,d){d===void 0&&(d=[]);var C,x=[],w=0;for(c.lastIndex=0;(C=c.exec(g))!==null;){var j=new I.AttrList(C[1]);if(j.TYPE===h){var W={attrs:j,bitrate:0,id:w++,groupId:j["GROUP-ID"],instreamId:j["INSTREAM-ID"],name:j.NAME||j.LANGUAGE||"",type:h,default:j.bool("DEFAULT"),autoselect:j.bool("AUTOSELECT"),forced:j.bool("FORCED"),lang:j.LANGUAGE,url:j.URI?R.resolve(j.URI,_):""};if(d.length){var T=R.findGroup(d,W.groupId)||d[0];D(W,T,"audioCodec"),D(W,T,"textCodec")}x.push(W)}}return x},R.parseLevelPlaylist=function(g,_,h,d,C){var x=new K.LevelDetails(_),w=x.fragments,j=null,W=0,T=0,M=0,m=0,v=null,H=new G.Fragment(d,_),X,q,re,ye=-1,pe=!1;for(a.lastIndex=0,x.m3u8=g;(X=a.exec(g))!==null;){pe&&(pe=!1,H=new G.Fragment(d,_),H.start=M,H.sn=W,H.cc=m,H.level=h,j&&(H.initSegment=j,H.rawProgramDateTime=j.rawProgramDateTime));var ue=X[1];if(ue){H.duration=parseFloat(ue);var fe=(" "+X[2]).slice(1);H.title=fe||null,H.tagList.push(fe?["INF",ue,fe]:["INF",ue])}else if(X[3])Object(z.isFiniteNumber)(H.duration)&&(H.start=M,re&&(H.levelkey=re),H.sn=W,H.level=h,H.cc=m,H.urlId=C,w.push(H),H.relurl=(" "+X[3]).slice(1),S(H,v),v=H,M+=H.duration,W++,T=0,pe=!0);else if(X[4]){var be=(" "+X[4]).slice(1);v?H.setByteRange(be,v):H.setByteRange(be)}else if(X[5])H.rawProgramDateTime=(" "+X[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),ye===-1&&(ye=w.length);else{if(X=X[0].match(p),!X){E.logger.warn("No matches on slow regex match for level playlist!");continue}for(q=1;q<X.length&&!(typeof X[q]!="undefined");q++);var se=(" "+X[q]).slice(1),ae=(" "+X[q+1]).slice(1),Ce=X[q+2]?(" "+X[q+2]).slice(1):"";switch(se){case"PLAYLIST-TYPE":x.type=ae.toUpperCase();break;case"MEDIA-SEQUENCE":W=x.startSN=parseInt(ae);break;case"SKIP":{var ze=new I.AttrList(ae),Ye=ze.decimalInteger("SKIPPED-SEGMENTS");if(Object(z.isFiniteNumber)(Ye)){x.skippedSegments=Ye;for(var He=Ye;He--;)w.unshift(null);W+=Ye}var Ve=ze.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ve&&(x.recentlyRemovedDateranges=Ve.split(" "));break}case"TARGETDURATION":x.targetduration=parseFloat(ae);break;case"VERSION":x.version=parseInt(ae);break;case"EXTM3U":break;case"ENDLIST":x.live=!1;break;case"#":(ae||Ce)&&H.tagList.push(Ce?[ae,Ce]:[ae]);break;case"DIS":m++;case"GAP":H.tagList.push([se]);break;case"BITRATE":H.tagList.push([se,ae]);break;case"DISCONTINUITY-SEQ":m=parseInt(ae);break;case"KEY":{var Fe,Ke=new I.AttrList(ae),nt=Ke.enumeratedString("METHOD"),de=Ke.URI,De=Ke.hexadecimalInteger("IV"),Ne=Ke.enumeratedString("KEYFORMATVERSIONS"),Ue=Ke.enumeratedString("KEYID"),rt=(Fe=Ke.enumeratedString("KEYFORMAT"))!=null?Fe:"identity",lt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(lt.indexOf(rt)>-1){E.logger.warn("Keyformat "+rt+" is not supported from the manifest");continue}else if(rt!=="identity")continue;nt&&(re=n.LevelKey.fromURL(_,de),de&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(nt)>=0&&(re.method=nt,re.keyFormat=rt,Ue&&(re.keyID=Ue),Ne&&(re.keyFormatVersions=Ne),re.iv=De));break}case"START":{var ft=new I.AttrList(ae),at=ft.decimalFloatingPoint("TIME-OFFSET");Object(z.isFiniteNumber)(at)&&(x.startTimeOffset=at);break}case"MAP":{var _t=new I.AttrList(ae);H.relurl=_t.URI,_t.BYTERANGE&&H.setByteRange(_t.BYTERANGE),H.level=h,H.sn="initSegment",re&&(H.levelkey=re),H.initSegment=null,j=H,pe=!0;break}case"SERVER-CONTROL":{var gt=new I.AttrList(ae);x.canBlockReload=gt.bool("CAN-BLOCK-RELOAD"),x.canSkipUntil=gt.optionalFloat("CAN-SKIP-UNTIL",0),x.canSkipDateRanges=x.canSkipUntil>0&&gt.bool("CAN-SKIP-DATERANGES"),x.partHoldBack=gt.optionalFloat("PART-HOLD-BACK",0),x.holdBack=gt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var xt=new I.AttrList(ae);x.partTarget=xt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ze=x.partList;Ze||(Ze=x.partList=[]);var kt=T>0?Ze[Ze.length-1]:void 0,Ot=T++,qe=new G.Part(new I.AttrList(ae),H,_,Ot,kt);Ze.push(qe),H.duration+=qe.duration;break}case"PRELOAD-HINT":{var st=new I.AttrList(ae);x.preloadHint=st;break}case"RENDITION-REPORT":{var xe=new I.AttrList(ae);x.renditionReports=x.renditionReports||[],x.renditionReports.push(xe);break}default:E.logger.warn("line parsed but not handled: "+X);break}}}v&&!v.relurl?(w.pop(),M-=v.duration,x.partList&&(x.fragmentHint=v)):x.partList&&(S(H,v),H.cc=m,x.fragmentHint=H);var we=w.length,me=w[0],ce=w[we-1];if(M+=x.skippedSegments*x.targetduration,M>0&&we&&ce){x.averagetargetduration=M/we;var he=ce.sn;x.endSN=he!=="initSegment"?he:0,me&&(x.startCC=me.cc,me.initSegment||x.fragments.every(function(Te){return Te.relurl&&u(Te.relurl)})&&(E.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new G.Fragment(d,_),H.relurl=ce.relurl,H.level=h,H.sn="initSegment",me.initSegment=H,x.needSidxRanges=!0))}else x.endSN=0,x.startCC=0;return x.fragmentHint&&(M+=x.fragmentHint.duration),x.totalduration=M,x.endCC=m,ye>0&&A(w,ye),x},R}();function i(R,O){["video","audio","text"].forEach(function(g){var _=R.filter(function(d){return Object(f.isCodecType)(d,g)});if(_.length){var h=_.filter(function(d){return d.lastIndexOf("avc1",0)===0||d.lastIndexOf("mp4a",0)===0});O[g+"Codec"]=h.length>0?h[0]:_[0],R=R.filter(function(d){return _.indexOf(d)===-1})}}),O.unknownCodecs=R}function D(R,O,g){var _=O[g];_&&(R[g]=_)}function A(R,O){for(var g=R[O],_=O;_--;){var h=R[_];if(!h)return;h.programDateTime=g.programDateTime-h.duration*1e3,g=h}}function S(R,O){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):O!=null&&O.programDateTime&&(R.programDateTime=O.endProgramDateTime),Object(z.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/polyfills/number.ts"),P=N("./src/events.ts"),F=N("./src/errors.ts"),G=N("./src/utils/logger.ts"),K=N("./src/utils/mp4-tools.ts"),n=N("./src/loader/m3u8-parser.ts"),I=N("./src/types/loader.ts"),E=N("./src/utils/attr-list.ts");function f(a){var p=a.type;switch(p){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function b(a,p){var l=a.url;return(l===void 0||l.indexOf("data:")===0)&&(l=p.url),l}var c=function(){function a(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var p=a.prototype;return p.registerListeners=function(){var u=this.hls;u.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(P.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.unregisterListeners=function(){var u=this.hls;u.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(P.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.createInternalLoader=function(u){var s=this.hls.config,i=s.pLoader,D=s.loader,A=i||D,S=new A(s);return u.loader=S,this.loaders[u.type]=S,S},p.getInternalLoader=function(u){return this.loaders[u.type]},p.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},p.destroyInternalLoaders=function(){for(var u in this.loaders){var s=this.loaders[u];s&&s.destroy(),this.resetInternalLoader(u)}},p.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},p.onManifestLoading=function(u,s){var i=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:i,deliveryDirectives:null})},p.onLevelLoading=function(u,s){var i=s.id,D=s.level,A=s.url,S=s.deliveryDirectives;this.load({id:i,groupId:null,level:D,responseType:"text",type:I.PlaylistContextType.LEVEL,url:A,deliveryDirectives:S})},p.onAudioTrackLoading=function(u,s){var i=s.id,D=s.groupId,A=s.url,S=s.deliveryDirectives;this.load({id:i,groupId:D,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:A,deliveryDirectives:S})},p.onSubtitleTrackLoading=function(u,s){var i=s.id,D=s.groupId,A=s.url,S=s.deliveryDirectives;this.load({id:i,groupId:D,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:A,deliveryDirectives:S})},p.load=function(u){var s,i=this.hls.config,D=this.getInternalLoader(u);if(D){var A=D.context;if(A&&A.url===u.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),D.abort()}var S,R,O,g;switch(u.type){case I.PlaylistContextType.MANIFEST:S=i.manifestLoadingMaxRetry,R=i.manifestLoadingTimeOut,O=i.manifestLoadingRetryDelay,g=i.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:S=0,R=i.levelLoadingTimeOut;break;default:S=i.levelLoadingMaxRetry,R=i.levelLoadingTimeOut,O=i.levelLoadingRetryDelay,g=i.levelLoadingMaxRetryTimeout;break}if(D=this.createInternalLoader(u),(s=u.deliveryDirectives)!==null&&s!==void 0&&s.part){var _;if(u.type===I.PlaylistContextType.LEVEL&&u.level!==null?_=this.hls.levels[u.level].details:u.type===I.PlaylistContextType.AUDIO_TRACK&&u.id!==null?_=this.hls.audioTracks[u.id].details:u.type===I.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(_=this.hls.subtitleTracks[u.id].details),_){var h=_.partTarget,d=_.targetduration;h&&d&&(R=Math.min(Math.max(h*3,d*.8)*1e3,R))}}var C={timeout:R,maxRetry:S,retryDelay:O,maxRetryDelay:g,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};D.load(u,C,x)},p.loadsuccess=function(u,s,i,D){if(D===void 0&&(D=null),i.isSidxRequest){this.handleSidxRequest(u,i),this.handlePlaylistLoaded(u,s,i,D);return}this.resetInternalLoader(i.type);var A=u.data;if(A.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,i,"no EXTM3U delimiter",D);return}s.parsing.start=performance.now(),A.indexOf("#EXTINF:")>0||A.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,s,i,D):this.handleMasterPlaylist(u,s,i,D)},p.loaderror=function(u,s,i){i===void 0&&(i=null),this.handleNetworkError(s,i,!1,u)},p.loadtimeout=function(u,s,i){i===void 0&&(i=null),this.handleNetworkError(s,i,!0)},p.handleMasterPlaylist=function(u,s,i,D){var A=this.hls,S=u.data,R=b(u,i),O=n.default.parseMasterPlaylist(S,R),g=O.levels,_=O.sessionData;if(!g.length){this.handleManifestParsingError(u,i,"no level found in manifest",D);return}var h=g.map(function(W){return{id:W.attrs.AUDIO,audioCodec:W.audioCodec}}),d=g.map(function(W){return{id:W.attrs.SUBTITLES,textCodec:W.textCodec}}),C=n.default.parseMasterPlaylistMedia(S,R,"AUDIO",h),x=n.default.parseMasterPlaylistMedia(S,R,"SUBTITLES",d),w=n.default.parseMasterPlaylistMedia(S,R,"CLOSED-CAPTIONS");if(C.length){var j=C.some(function(W){return!W.url});!j&&g[0].audioCodec&&!g[0].attrs.AUDIO&&(G.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),C.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new E.AttrList({}),bitrate:0,url:""}))}A.trigger(P.Events.MANIFEST_LOADED,{levels:g,audioTracks:C,subtitles:x,captions:w,url:R,stats:s,networkDetails:D,sessionData:_})},p.handleTrackOrLevelPlaylist=function(u,s,i,D){var A=this.hls,S=i.id,R=i.level,O=i.type,g=b(u,i),_=Object(z.isFiniteNumber)(S)?S:0,h=Object(z.isFiniteNumber)(R)?R:_,d=f(i),C=n.default.parseLevelPlaylist(u.data,g,h,d,_);if(!C.fragments.length){A.trigger(P.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:g,reason:"no fragments found in level",level:typeof i.level=="number"?i.level:void 0});return}if(O===I.PlaylistContextType.MANIFEST){var x={attrs:new E.AttrList({}),bitrate:0,details:C,name:"",url:g};A.trigger(P.Events.MANIFEST_LOADED,{levels:[x],audioTracks:[],url:g,stats:s,networkDetails:D,sessionData:null})}if(s.parsing.end=performance.now(),C.needSidxRanges){var w,j=(w=C.fragments[0].initSegment)===null||w===void 0?void 0:w.url;this.load({url:j,isSidxRequest:!0,type:O,level:R,levelDetails:C,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}i.levelDetails=C,this.handlePlaylistLoaded(u,s,i,D)},p.handleSidxRequest=function(u,s){var i=Object(K.parseSegmentIndex)(new Uint8Array(u.data));if(!i)return;var D=i.references,A=s.levelDetails;D.forEach(function(S,R){var O=S.info,g=A.fragments[R];g.byteRange.length===0&&g.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),g.initSegment&&g.initSegment.setByteRange(String(i.moovEndOffset)+"@0")})},p.handleManifestParsingError=function(u,s,i,D){this.hls.trigger(P.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===I.PlaylistContextType.MANIFEST,url:u.url,reason:i,response:u,context:s,networkDetails:D})},p.handleNetworkError=function(u,s,i,D){i===void 0&&(i=!1),G.logger.warn("[playlist-loader]: A network "+(i?"timeout":"error")+" occurred while loading "+u.type+" level: "+u.level+" id: "+u.id+' group-id: "'+u.groupId+'"');var A=F.ErrorDetails.UNKNOWN,S=!1,R=this.getInternalLoader(u);switch(u.type){case I.PlaylistContextType.MANIFEST:A=i?F.ErrorDetails.MANIFEST_LOAD_TIMEOUT:F.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case I.PlaylistContextType.LEVEL:A=i?F.ErrorDetails.LEVEL_LOAD_TIMEOUT:F.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case I.PlaylistContextType.AUDIO_TRACK:A=i?F.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:F.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:A=i?F.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:F.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}R&&this.resetInternalLoader(u.type);var O={type:F.ErrorTypes.NETWORK_ERROR,details:A,fatal:S,url:u.url,loader:R,context:u,networkDetails:s};D&&(O.response=D),this.hls.trigger(P.Events.ERROR,O)},p.handlePlaylistLoaded=function(u,s,i,D){var A=i.type,S=i.level,R=i.id,O=i.groupId,g=i.loader,_=i.levelDetails,h=i.deliveryDirectives;if(!(_!=null&&_.targetduration)){this.handleManifestParsingError(u,i,"invalid target duration",D);return}if(!g)return;_.live&&(g.getCacheAge&&(_.ageHeader=g.getCacheAge()||0),(!g.getCacheAge||isNaN(_.ageHeader))&&(_.ageHeader=0));switch(A){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:_,level:S||0,id:R||0,stats:s,networkDetails:D,deliveryDirectives:h});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:_,id:R||0,groupId:O||"",stats:s,networkDetails:D,deliveryDirectives:h});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADED,{details:_,id:R||0,groupId:O||"",stats:s,networkDetails:D,deliveryDirectives:h});break}},a}();Y.default=c},"./src/polyfills/number.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"isFiniteNumber",function(){return z}),N.d(Y,"MAX_SAFE_INTEGER",function(){return P});var z=Number.isFinite||function(F){return typeof F=="number"&&isFinite(F)},P=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(te,Y,N){"use strict";N.r(Y);var z=function(){function P(){}return P.getSilentFrame=function(G,K){switch(G){case"mp4a.40.2":if(K===1)return new Uint8Array([0,200,0,128,35,128]);if(K===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(K===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(K===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(K===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(K===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(K===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(K===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(K===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},P}();Y.default=z},"./src/remux/mp4-generator.ts":function(te,Y,N){"use strict";N.r(Y);var z=Math.pow(2,32)-1,P=function(){function F(){}return F.init=function(){F.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 K;for(K in F.types)F.types.hasOwnProperty(K)&&(F.types[K]=[K.charCodeAt(0),K.charCodeAt(1),K.charCodeAt(2),K.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]),I=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]);F.HDLR_TYPES={video:n,audio:I};var E=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);F.STTS=F.STSC=F.STCO=f,F.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),F.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),F.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),F.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var b=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);F.FTYP=F.box(F.types.ftyp,b,a,b,c),F.DINF=F.box(F.types.dinf,F.box(F.types.dref,E))},F.box=function(K){for(var n=8,I=arguments.length,E=new Array(I>1?I-1:0),f=1;f<I;f++)E[f-1]=arguments[f];for(var b=E.length,c=b;b--;)n+=E[b].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(K,4),b=0,n=8;b<c;b++)a.set(E[b],n),n+=E[b].byteLength;return a},F.hdlr=function(K){return F.box(F.types.hdlr,F.HDLR_TYPES[K])},F.mdat=function(K){return F.box(F.types.mdat,K)},F.mdhd=function(K,n){n*=K;var I=Math.floor(n/(z+1)),E=Math.floor(n%(z+1));return F.box(F.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,K>>24&255,K>>16&255,K>>8&255,K&255,I>>24,I>>16&255,I>>8&255,I&255,E>>24,E>>16&255,E>>8&255,E&255,85,196,0,0]))},F.mdia=function(K){return F.box(F.types.mdia,F.mdhd(K.timescale,K.duration),F.hdlr(K.type),F.minf(K))},F.mfhd=function(K){return F.box(F.types.mfhd,new Uint8Array([0,0,0,0,K>>24,K>>16&255,K>>8&255,K&255]))},F.minf=function(K){return K.type==="audio"?F.box(F.types.minf,F.box(F.types.smhd,F.SMHD),F.DINF,F.stbl(K)):F.box(F.types.minf,F.box(F.types.vmhd,F.VMHD),F.DINF,F.stbl(K))},F.moof=function(K,n,I){return F.box(F.types.moof,F.mfhd(K),F.traf(I,n))},F.moov=function(K){for(var n=K.length,I=[];n--;)I[n]=F.trak(K[n]);return F.box.apply(null,[F.types.moov,F.mvhd(K[0].timescale,K[0].duration)].concat(I).concat(F.mvex(K)))},F.mvex=function(K){for(var n=K.length,I=[];n--;)I[n]=F.trex(K[n]);return F.box.apply(null,[F.types.mvex].concat(I))},F.mvhd=function(K,n){n*=K;var I=Math.floor(n/(z+1)),E=Math.floor(n%(z+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,K>>24&255,K>>16&255,K>>8&255,K&255,I>>24,I>>16&255,I>>8&255,I&255,E>>24,E>>16&255,E>>8&255,E&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 F.box(F.types.mvhd,f)},F.sdtp=function(K){var n=K.samples||[],I=new Uint8Array(4+n.length),E,f;for(E=0;E<n.length;E++)f=n[E].flags,I[E+4]=f.dependsOn<<4|f.isDependedOn<<2|f.hasRedundancy;return F.box(F.types.sdtp,I)},F.stbl=function(K){return F.box(F.types.stbl,F.stsd(K),F.box(F.types.stts,F.STTS),F.box(F.types.stsc,F.STSC),F.box(F.types.stsz,F.STSZ),F.box(F.types.stco,F.STCO))},F.avc1=function(K){var n=[],I=[],E,f,b;for(E=0;E<K.sps.length;E++)f=K.sps[E],b=f.byteLength,n.push(b>>>8&255),n.push(b&255),n=n.concat(Array.prototype.slice.call(f));for(E=0;E<K.pps.length;E++)f=K.pps[E],b=f.byteLength,I.push(b>>>8&255),I.push(b&255),I=I.concat(Array.prototype.slice.call(f));var c=F.box(F.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|K.sps.length].concat(n).concat([K.pps.length]).concat(I))),a=K.width,p=K.height,l=K.pixelRatio[0],u=K.pixelRatio[1];return F.box(F.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,p>>8&255,p&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]),c,F.box(F.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),F.box(F.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,u>>24,u>>16&255,u>>8&255,u&255])))},F.esds=function(K){var n=K.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(K.config).concat([6,1,2]))},F.mp4a=function(K){var n=K.samplerate;return F.box(F.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,K.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),F.box(F.types.esds,F.esds(K)))},F.mp3=function(K){var n=K.samplerate;return F.box(F.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,K.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},F.stsd=function(K){return K.type==="audio"?!K.isAAC&&K.codec==="mp3"?F.box(F.types.stsd,F.STSD,F.mp3(K)):F.box(F.types.stsd,F.STSD,F.mp4a(K)):F.box(F.types.stsd,F.STSD,F.avc1(K))},F.tkhd=function(K){var n=K.id,I=K.duration*K.timescale,E=K.width,f=K.height,b=Math.floor(I/(z+1)),c=Math.floor(I%(z+1));return F.box(F.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,b>>24,b>>16&255,b>>8&255,b&255,c>>24,c>>16&255,c>>8&255,c&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,E>>8&255,E&255,0,0,f>>8&255,f&255,0,0]))},F.traf=function(K,n){var I=F.sdtp(K),E=K.id,f=Math.floor(n/(z+1)),b=Math.floor(n%(z+1));return F.box(F.types.traf,F.box(F.types.tfhd,new Uint8Array([0,0,0,0,E>>24,E>>16&255,E>>8&255,E&255])),F.box(F.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,b>>24,b>>16&255,b>>8&255,b&255])),F.trun(K,I.length+16+20+8+16+8+8),I)},F.trak=function(K){return K.duration=K.duration||4294967295,F.box(F.types.trak,F.tkhd(K),F.mdia(K))},F.trex=function(K){var n=K.id;return F.box(F.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]))},F.trun=function(K,n){var I=K.samples||[],E=I.length,f=12+16*E,b=new Uint8Array(f),c,a,p,l,u,s;for(n+=8+f,b.set([0,0,15,1,E>>>24&255,E>>>16&255,E>>>8&255,E&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),c=0;c<E;c++)a=I[c],p=a.duration,l=a.size,u=a.flags,s=a.cts,b.set([p>>>24&255,p>>>16&255,p>>>8&255,p&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&240<<8,u.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*c);return F.box(F.types.trun,b)},F.initSegment=function(K){F.types||F.init();var n=F.moov(K),I=new Uint8Array(F.FTYP.byteLength+n.byteLength);return I.set(F.FTYP),I.set(n,F.FTYP.byteLength),I},F}();P.types=void 0,P.HDLR_TYPES=void 0,P.STTS=void 0,P.STSC=void 0,P.STCO=void 0,P.STSZ=void 0,P.VMHD=void 0,P.SMHD=void 0,P.STSD=void 0,P.FTYP=void 0,P.DINF=void 0,Y.default=P},"./src/remux/mp4-remuxer.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return s}),N.d(Y,"normalizePts",function(){return i});var z=N("./src/polyfills/number.ts"),P=N("./src/remux/aac-helper.ts"),F=N("./src/remux/mp4-generator.ts"),G=N("./src/events.ts"),K=N("./src/errors.ts"),n=N("./src/utils/logger.ts"),I=N("./src/types/loader.ts"),E=N("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var g=arguments[O];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(R[_]=g[_])}return R},f.apply(this,arguments)}var b=10*1e3,c=1024,a=1152,p=null,l=null,u=!1,s=function(){function R(g,_,h,d){if(d===void 0&&(d=""),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=g,this.config=_,this.typeSupported=h,this.ISGenerated=!1,p===null){var C=navigator.userAgent||"",x=C.match(/Chrome\/(\d+)/i);p=x?parseInt(x[1]):0}if(l===null){var w=navigator.userAgent.match(/Safari\/(\d+)/i);l=w?parseInt(w[1]):0}u=!!p&&p<75||!!l&&l<600}var O=R.prototype;return O.destroy=function(){},O.resetTimeStamp=function(_){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=_},O.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(_){var h=!1,d=_.reduce(function(C,x){var w=x.pts-C;return w<-4294967296?(h=!0,i(C,x.pts)):w>0?C:x.pts},_[0].pts);return h&&n.logger.debug("PTS rollover detected"),d},O.remux=function(_,h,d,C,x,w,j,W){var T,M,m,v,H,X,q=x,re=x,ye=_.pid>-1,pe=h.pid>-1,ue=h.samples.length,fe=_.samples.length>0,be=ue>1,se=(!ye||fe)&&(!pe||be)||this.ISGenerated||j;if(se){this.ISGenerated||(m=this.generateIS(_,h,x));var ae=this.isVideoContiguous,Ce=-1;if(be&&(Ce=D(h.samples),!ae&&this.config.forceKeyFrameOnDiscontinuity))if(X=!0,Ce>0){n.logger.warn("[mp4-remuxer]: Dropped "+Ce+" out of "+ue+" video samples due to a missing keyframe");var ze=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(Ce),h.dropped+=Ce,re+=(h.samples[0].pts-ze)/(h.timescale||9e4)}else Ce===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+ue+" video samples"),X=!1);if(this.ISGenerated){if(fe&&be){var Ye=this.getVideoStartPts(h.samples),He=i(_.samples[0].pts,Ye)-Ye,Ve=He/h.inputTimeScale;q+=Math.max(0,Ve),re+=Math.max(0,-Ve)}if(fe){if(_.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),m=this.generateIS(_,h,x)),M=this.remuxAudio(_,q,this.isAudioContiguous,w,pe||be||W===I.PlaylistLevelType.AUDIO?re:void 0),be){var Fe=M?M.endPTS-M.startPTS:0;h.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),m=this.generateIS(_,h,x)),T=this.remuxVideo(h,re,ae,Fe)}}else be&&(T=this.remuxVideo(h,re,ae,0));T&&(T.firstKeyFrame=Ce,T.independent=Ce!==-1)}}return this.ISGenerated&&(d.samples.length&&(H=this.remuxID3(d,x)),C.samples.length&&(v=this.remuxText(C,x))),{audio:M,video:T,initSegment:m,independent:X,text:v,id3:H}},O.generateIS=function(_,h,d){var C=_.samples,x=h.samples,w=this.typeSupported,j={},W=!Object(z.isFiniteNumber)(this._initPTS),T="audio/mp4",M,m,v;if(W&&(M=m=Infinity),_.config&&C.length&&(_.timescale=_.samplerate,_.isAAC||(w.mpeg?(T="audio/mpeg",_.codec=""):w.mp3&&(_.codec="mp3")),j.audio={id:"audio",container:T,codec:_.codec,initSegment:!_.isAAC&&w.mpeg?new Uint8Array(0):F.default.initSegment([_]),metadata:{channelCount:_.channelCount}},W&&(v=_.inputTimeScale,M=m=C[0].pts-Math.round(v*d))),h.sps&&h.pps&&x.length&&(h.timescale=h.inputTimeScale,j.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:F.default.initSegment([h]),metadata:{width:h.width,height:h.height}},W)){v=h.inputTimeScale;var H=this.getVideoStartPts(x),X=Math.round(v*d);m=Math.min(m,i(x[0].dts,H)-X),M=Math.min(M,H-X)}if(Object.keys(j).length)return this.ISGenerated=!0,W&&(this._initPTS=M,this._initDTS=m),{tracks:j,initPTS:M,timescale:v}},O.remuxVideo=function(_,h,d,C){var x=_.inputTimeScale,w=_.samples,j=[],W=w.length,T=this._initPTS,M=this.nextAvcDts,m=8,v,H,X,q=Number.POSITIVE_INFINITY,re=Number.NEGATIVE_INFINITY,ye=0,pe=!1;if(!d||M===null){var ue=h*x,fe=w[0].pts-i(w[0].dts,w[0].pts);M=ue-fe}for(var be=0;be<W;be++){var se=w[be];if(se.pts=i(se.pts-T,M),se.dts=i(se.dts-T,M),se.dts>se.pts){var ae=9e4*.2;ye=Math.max(Math.min(ye,se.pts-se.dts),-1*ae)}se.dts<w[be>0?be-1:be].dts&&(pe=!0)}pe&&w.sort(function(mn,En){var $t=mn.dts-En.dts,rr=mn.pts-En.pts;return $t||rr}),H=w[0].dts,X=w[w.length-1].dts;var Ce=Math.round((X-H)/(W-1));if(ye<0){if(ye<Ce*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(E.toMsFromMpegTsClock)(-Ce,!0)+" ms");for(var ze=ye,Ye=0;Ye<W;Ye++)w[Ye].dts=ze=Math.max(ze,w[Ye].pts-Ce),w[Ye].pts=Math.max(ze,w[Ye].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(E.toMsFromMpegTsClock)(ye,!0)+" ms to overcome this issue");for(var He=0;He<W;He++)w[He].dts=w[He].dts+ye}H=w[0].dts}if(d){var Ve=H-M,Fe=Ve>Ce,Ke=Ve<-1;if(Fe||Ke){Fe?n.logger.warn("AVC: "+Object(E.toMsFromMpegTsClock)(Ve,!0)+" ms ("+Ve+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(E.toMsFromMpegTsClock)(-Ve,!0)+" ms ("+Ve+"dts) overlapping between fragments detected"),H=M;var nt=w[0].pts-Ve;w[0].dts=H,w[0].pts=nt,n.logger.log("Video: First PTS/DTS adjusted: "+Object(E.toMsFromMpegTsClock)(nt,!0)+"/"+Object(E.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(E.toMsFromMpegTsClock)(Ve,!0)+" ms")}}u&&(H=Math.max(0,H));for(var de=0,De=0,Ne=0;Ne<W;Ne++){for(var Ue=w[Ne],rt=Ue.units,lt=rt.length,ft=0,at=0;at<lt;at++)ft+=rt[at].data.length;De+=ft,de+=lt,Ue.length=ft,Ue.dts=Math.max(Ue.dts,H),Ue.pts=Math.max(Ue.pts,Ue.dts,0),q=Math.min(Ue.pts,q),re=Math.max(Ue.pts,re)}X=w[W-1].dts;var _t=De+4*de+8,gt;try{gt=new Uint8Array(_t)}catch(mn){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:K.ErrorTypes.MUX_ERROR,details:K.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:_t,reason:"fail allocating video mdat "+_t});return}var xt=new DataView(gt.buffer);xt.setUint32(0,_t),gt.set(F.default.types.mdat,4);for(var Ze=0;Ze<W;Ze++){for(var kt=w[Ze],Ot=kt.units,qe=0,st=0,xe=Ot.length;st<xe;st++){var we=Ot[st],me=we.data,ce=we.data.byteLength;xt.setUint32(m,ce),m+=4,gt.set(me,m),m+=ce,qe+=4+ce}if(Ze<W-1)v=w[Ze+1].dts-kt.dts;else{var he=this.config,Te=kt.dts-w[Ze>0?Ze-1:Ze].dts;if(he.stretchShortVideoTrack&&this.nextAudioPts!==null){var Re=Math.floor(he.maxBufferHole*x),Me=(C?q+C*x:this.nextAudioPts)-kt.pts;Me>Re?(v=Me-Te,v<0&&(v=Te),n.logger.log("[mp4-remuxer]: It is approximately "+Me/90+" ms to the next segment; using duration "+v/90+" ms for the last video frame.")):v=Te}else v=Te}var et=Math.round(kt.pts-kt.dts);j.push(new A(kt.key,v,qe,et))}if(j.length&&p&&p<70){var ht=j[0].flags;ht.dependsOn=2,ht.isNonSync=0}console.assert(v!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=M=X+v,this.isVideoContiguous=!0;var Ut=F.default.moof(_.sequenceNumber++,H,f({},_,{samples:j})),nn="video",en={data1:Ut,data2:gt,startPTS:q/x,endPTS:(re+v)/x,startDTS:H/x,endDTS:M/x,type:nn,hasAudio:!1,hasVideo:!0,nb:j.length,dropped:_.dropped};return _.samples=[],_.dropped=0,console.assert(gt.length,"MDAT length must not be zero"),en},O.remuxAudio=function(_,h,d,C,x){var w=_.inputTimeScale,j=_.samplerate?_.samplerate:w,W=w/j,T=_.isAAC?c:a,M=T*W,m=this._initPTS,v=!_.isAAC&&this.typeSupported.mpeg,H=[],X=_.samples,q=v?0:8,re=this.nextAudioPts||-1,ye=h*w;if(this.isAudioContiguous=d=d||X.length&&re>0&&(C&&Math.abs(ye-re)<9e3||Math.abs(i(X[0].pts-m,ye)-re)<20*M),X.forEach(function(me){me.pts=i(me.pts-m,ye)}),!d||re<0){if(X=X.filter(function(me){return me.pts>=0}),!X.length)return;x===0?re=0:C?re=Math.max(0,ye):re=X[0].pts}if(_.isAAC)for(var pe=x!==void 0,ue=this.config.maxAudioFramesDrift,fe=0,be=re;fe<X.length;fe++){var se=X[fe],ae=se.pts,Ce=ae-be,ze=Math.abs(1e3*Ce/w);if(Ce<=-ue*M&&pe)fe===0&&(n.logger.warn("Audio frame @ "+(ae/w).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ce/w)+" ms."),this.nextAudioPts=re=be=ae);else if(Ce>=ue*M&&ze<b&&pe){var Ye=Math.round(Ce/M);be=ae-Ye*M,be<0&&(Ye--,be+=M),fe===0&&(this.nextAudioPts=re=be),n.logger.warn("[mp4-remuxer]: Injecting "+Ye+" audio frame @ "+(be/w).toFixed(3)+"s due to "+Math.round(1e3*Ce/w)+" ms gap.");for(var He=0;He<Ye;He++){var Ve=Math.max(be,0),Fe=P.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);Fe||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Fe=se.unit.subarray()),X.splice(fe,0,{unit:Fe,pts:Ve}),be+=M,fe++}}se.pts=be,be+=M}for(var Ke=null,nt=null,de,De=0,Ne=X.length;Ne--;)De+=X[Ne].unit.byteLength;for(var Ue=0,rt=X.length;Ue<rt;Ue++){var lt=X[Ue],ft=lt.unit,at=lt.pts;if(nt!==null){var _t=H[Ue-1];_t.duration=Math.round((at-nt)/W)}else if(d&&_.isAAC&&(at=re),Ke=at,De>0){De+=q;try{de=new Uint8Array(De)}catch(me){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:K.ErrorTypes.MUX_ERROR,details:K.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:De,reason:"fail allocating audio mdat "+De});return}if(!v){var gt=new DataView(de.buffer);gt.setUint32(0,De),de.set(F.default.types.mdat,4)}}else return;de.set(ft,q);var xt=ft.byteLength;q+=xt,H.push(new A(!0,T,xt,0)),nt=at}var Ze=H.length;if(!Ze)return;var kt=H[H.length-1];this.nextAudioPts=re=nt+W*kt.duration;var Ot=v?new Uint8Array(0):F.default.moof(_.sequenceNumber++,Ke/W,f({},_,{samples:H}));_.samples=[];var qe=Ke/w,st=re/w,xe="audio",we={data1:Ot,data2:de,startPTS:qe,endPTS:st,startDTS:qe,endDTS:st,type:xe,hasAudio:!0,hasVideo:!1,nb:Ze};return this.isAudioContiguous=!0,console.assert(de.length,"MDAT length must not be zero"),we},O.remuxEmptyAudio=function(_,h,d,C){var x=_.inputTimeScale,w=_.samplerate?_.samplerate:x,j=x/w,W=this.nextAudioPts,T=(W!==null?W:C.startDTS*x)+this._initDTS,M=C.endDTS*x+this._initDTS,m=j*c,v=Math.ceil((M-T)/m),H=P.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var X=[],q=0;q<v;q++){var re=T+q*m;X.push({unit:H,pts:re,dts:re})}return _.samples=X,this.remuxAudio(_,h,d,!1)},O.remuxID3=function(_,h){var d=_.samples.length;if(!d)return;for(var C=_.inputTimeScale,x=this._initPTS,w=this._initDTS,j=0;j<d;j++){var W=_.samples[j];W.pts=i(W.pts-x,h*C)/C,W.dts=i(W.dts-w,h*C)/C}var T=_.samples;return _.samples=[],{samples:T}},O.remuxText=function(_,h){var d=_.samples.length;if(!d)return;for(var C=_.inputTimeScale,x=this._initPTS,w=0;w<d;w++){var j=_.samples[w];j.pts=i(j.pts-x,h*C)/C}_.samples.sort(function(T,M){return T.pts-M.pts});var W=_.samples;return _.samples=[],{samples:W}},R}();function i(R,O){var g;if(O===null)return R;for(O<R?g=-8589934592:g=8589934592;Math.abs(R-O)>4294967296;)R+=g;return R}function D(R){for(var O=0;O<R.length;O++)if(R[O].key)return O;return-1}var A=function(O,g,_,h){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=g,this.size=_,this.cts=h,this.flags=new S(O)},S=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/polyfills/number.ts"),P=N("./src/utils/mp4-tools.ts"),F=N("./src/loader/fragment.ts"),G=N("./src/utils/logger.ts"),K=function(){function E(){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 f=E.prototype;return f.destroy=function(){},f.resetTimeStamp=function(c){this.initPTS=c,this.lastEndDTS=null},f.resetNextTimestamp=function(){this.lastEndDTS=null},f.resetInitSegment=function(c,a,p){this.audioCodec=a,this.videoCodec=p,this.generateInitSegment(c),this.emitInitSegment=!0},f.generateInitSegment=function(c){var a=this.audioCodec,p=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(P.parseInitSegment)(c);a||(a=I(l.audio,F.ElementaryStreamTypes.AUDIO)),p||(p=I(l.video,F.ElementaryStreamTypes.VIDEO));var u={};l.audio&&l.video?u.audiovideo={container:"video/mp4",codec:a+","+p,initSegment:c,id:"main"}:l.audio?u.audio={container:"audio/mp4",codec:a,initSegment:c,id:"audio"}:l.video?u.video={container:"video/mp4",codec:p,initSegment:c,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},f.remux=function(c,a,p,l,u){var s=this.initPTS,i=this.lastEndDTS,D={audio:void 0,video:void 0,text:l,id3:p,initSegment:void 0};Object(z.isFiniteNumber)(i)||(i=this.lastEndDTS=u||0);var A=a.samples;if(!A||!A.length)return D;var S={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(A),R=this.initData),!R||!R.length)return G.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),D;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(z.isFiniteNumber)(s)||(this.initPTS=S.initPTS=s=n(R,A,i));var O=Object(P.getDuration)(A,R),g=i,_=O+g;Object(P.offsetStartDTS)(R,A,s),O>0?this.lastEndDTS=_:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!R.audio,d=!!R.video,C="";h&&(C+="audio"),d&&(C+="video");var x={data1:A,startPTS:g,startDTS:g,endPTS:_,endDTS:_,type:C,hasAudio:h,hasVideo:d,nb:1,dropped:0};return D.audio=x.type==="audio"?x:void 0,D.video=x.type!=="audio"?x:void 0,D.text=l,D.id3=p,D.initSegment=S,D},E}(),n=function(f,b,c){return Object(P.getStartDTS)(f,b)-c};function I(E,f){var b=E==null?void 0:E.codec;return b&&b.length>4?b:b==="hvc1"?"hvc1.1.c.L120.90":b==="av01"?"av01.0.04M.08":b==="avc1"||f===F.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=K},"./src/task-loop.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return z});var z=function(){function P(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var F=P.prototype;return F.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},F.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},F.onHandlerDestroyed=function(){},F.hasInterval=function(){return!!this._tickInterval},F.hasNextTick=function(){return!!this._tickTimer},F.setInterval=function(K){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,K),!0)},F.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},F.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},F.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},F.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},F.doTick=function(){},P}()},"./src/types/cmcd.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"CMCDVersion",function(){return z}),N.d(Y,"CMCDObjectType",function(){return P}),N.d(Y,"CMCDStreamingFormat",function(){return F}),N.d(Y,"CMCDStreamType",function(){return G});var z=1,P;(function(K){K.MANIFEST="m",K.AUDIO="a",K.VIDEO="v",K.MUXED="av",K.INIT="i",K.CAPTION="c",K.TIMED_TEXT="tt",K.KEY="k",K.OTHER="o"})(P||(P={}));var F;(function(K){K.DASH="d",K.HLS="h",K.SMOOTH="s",K.OTHER="o"})(F||(F={}));var G;(function(K){K.VOD="v",K.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"HlsSkip",function(){return F}),N.d(Y,"getSkipValue",function(){return G}),N.d(Y,"HlsUrlParameters",function(){return K}),N.d(Y,"Level",function(){return n});function z(I,E){for(var f=0;f<E.length;f++){var b=E[f];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(I,b.key,b)}}function P(I,E,f){return E&&z(I.prototype,E),f&&z(I,f),I}var F;(function(I){I.No="",I.Yes="YES",I.v2="v2"})(F||(F={}));function G(I,E){var f=I.canSkipUntil,b=I.canSkipDateRanges,c=I.endSN,a=E!==void 0?E-c:0;return f&&a<f?b?F.v2:F.Yes:F.No}var K=function(){function I(f,b,c){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=f,this.part=b,this.skip=c}var E=I.prototype;return E.addDirectives=function(b){var c=new self.URL(b);return this.msn!==void 0&&c.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&c.searchParams.set("_HLS_part",this.part.toString()),this.skip&&c.searchParams.set("_HLS_skip",this.skip),c.toString()},I}(),n=function(){function I(E){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=[E.url],this.attrs=E.attrs,this.bitrate=E.bitrate,E.details&&(this.details=E.details),this.id=E.id||0,this.name=E.name,this.width=E.width||0,this.height=E.height||0,this.audioCodec=E.audioCodec,this.videoCodec=E.videoCodec,this.unknownCodecs=E.unknownCodecs,this.codecSet=[E.videoCodec,E.audioCodec].filter(function(f){return f}).join(",").replace(/\.[^.,]+/g,"")}return P(I,[{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(f){var b=f%this.url.length;this._urlId!==b&&(this.details=void 0,this._urlId=b)}}]),I}()},"./src/types/loader.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"PlaylistContextType",function(){return z}),N.d(Y,"PlaylistLevelType",function(){return P});var z;(function(F){F.MANIFEST="manifest",F.LEVEL="level",F.AUDIO_TRACK="audioTrack",F.SUBTITLE_TRACK="subtitleTrack"})(z||(z={}));var P;(function(F){F.MAIN="main",F.AUDIO="audio",F.SUBTITLE="subtitle"})(P||(P={}))},"./src/types/transmuxer.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"ChunkMetadata",function(){return z});var z=function(G,K,n,I,E,f){I===void 0&&(I=0),E===void 0&&(E=-1),f===void 0&&(f=!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=P(),this.buffering={audio:P(),video:P(),audiovideo:P()},this.level=G,this.sn=K,this.id=n,this.size=I,this.part=E,this.partial=f};function P(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"AttrList",function(){return F});var z=/^(\d+)x(\d+)$/,P=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,F=function(){function G(n){typeof n=="string"&&(n=G.parseAttrList(n));for(var I in n)n.hasOwnProperty(I)&&(this[I]=n[I])}var K=G.prototype;return K.decimalInteger=function(I){var E=parseInt(this[I],10);return E>Number.MAX_SAFE_INTEGER?Infinity:E},K.hexadecimalInteger=function(I){if(this[I]){var E=(this[I]||"0x").slice(2);E=(E.length&1?"0":"")+E;for(var f=new Uint8Array(E.length/2),b=0;b<E.length/2;b++)f[b]=parseInt(E.slice(b*2,b*2+2),16);return f}else return null},K.hexadecimalIntegerAsNumber=function(I){var E=parseInt(this[I],16);return E>Number.MAX_SAFE_INTEGER?Infinity:E},K.decimalFloatingPoint=function(I){return parseFloat(this[I])},K.optionalFloat=function(I,E){var f=this[I];return f?parseFloat(f):E},K.enumeratedString=function(I){return this[I]},K.bool=function(I){return this[I]==="YES"},K.decimalResolution=function(I){var E=z.exec(this[I]);return E===null?void 0:{width:parseInt(E[1],10),height:parseInt(E[2],10)}},G.parseAttrList=function(I){var E,f={},b='"';for(P.lastIndex=0;(E=P.exec(I))!==null;){var c=E[2];c.indexOf(b)===0&&c.lastIndexOf(b)===c.length-1&&(c=c.slice(1,-1)),f[E[1]]=c}return f},G}()},"./src/utils/binary-search.ts":function(te,Y,N){"use strict";N.r(Y);var z={search:function(F,G){for(var K=0,n=F.length-1,I=null,E=null;K<=n;){I=(K+n)/2|0,E=F[I];var f=G(E);if(f>0)K=I+1;else if(f<0)n=I-1;else return E}return null}};Y.default=z},"./src/utils/buffer-helper.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"BufferHelper",function(){return F});var z=N("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},F=function(){function G(){}return G.isBuffered=function(n,I){try{if(n){for(var E=G.getBuffered(n),f=0;f<E.length;f++)if(I>=E.start(f)&&I<=E.end(f))return!0}}catch(b){}return!1},G.bufferInfo=function(n,I,E){try{if(n){var f=G.getBuffered(n),b=[],c;for(c=0;c<f.length;c++)b.push({start:f.start(c),end:f.end(c)});return this.bufferedInfo(b,I,E)}}catch(a){}return{len:0,start:I,end:I,nextStart:void 0}},G.bufferedInfo=function(n,I,E){I=Math.max(0,I),n.sort(function(S,R){var O=S.start-R.start;return O||R.end-S.end});var f=[];if(E)for(var b=0;b<n.length;b++){var c=f.length;if(c){var a=f[c-1].end;n[b].start-a<E?n[b].end>a&&(f[c-1].end=n[b].end):f.push(n[b])}else f.push(n[b])}else f=n;for(var p=0,l,u=I,s=I,i=0;i<f.length;i++){var D=f[i].start,A=f[i].end;if(I+E>=D&&I<A)u=D,s=A,p=s-I;else if(I+E<D){l=D;break}}return{len:p,start:u||0,end:s||0,nextStart:l}},G.getBuffered=function(n){try{return n.buffered}catch(I){return z.logger.log("failed to get media.buffered",I),P}},G}()},"./src/utils/cea-608-parser.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"Row",function(){return s}),N.d(Y,"CaptionScreen",function(){return i});var z=N("./src/utils/logger.ts"),P={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},F=function(_){var h=_;return P.hasOwnProperty(_)&&(h=P[_]),String.fromCharCode(h)},G=15,K=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},I={17:2,18:4,21:6,22:8,23:10,19:13,20:15},E={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},f={25:2,26:4,29:6,30:8,31:10,27:13,28:15},b=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c;(function(g){g[g.ERROR=0]="ERROR",g[g.TEXT=1]="TEXT",g[g.WARNING=2]="WARNING",g[g.INFO=2]="INFO",g[g.DEBUG=3]="DEBUG",g[g.DATA=3]="DATA"})(c||(c={}));var a=function(){function g(){this.time=null,this.verboseLevel=c.ERROR}var _=g.prototype;return _.log=function(d,C){this.verboseLevel>=d&&z.logger.log(this.time+" ["+d+"] "+C)},g}(),p=function(_){for(var h=[],d=0;d<_.length;d++)h.push(_[d].toString(16));return h},l=function(){function g(h,d,C,x,w){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=h||"white",this.underline=d||!1,this.italics=C||!1,this.background=x||"black",this.flash=w||!1}var _=g.prototype;return _.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},_.setStyles=function(d){for(var C=["foreground","underline","italics","background","flash"],x=0;x<C.length;x++){var w=C[x];d.hasOwnProperty(w)&&(this[w]=d[w])}},_.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},_.equals=function(d){return this.foreground===d.foreground&&this.underline===d.underline&&this.italics===d.italics&&this.background===d.background&&this.flash===d.flash},_.copy=function(d){this.foreground=d.foreground,this.underline=d.underline,this.italics=d.italics,this.background=d.background,this.flash=d.flash},_.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},g}(),u=function(){function g(h,d,C,x,w,j){this.uchar=void 0,this.penState=void 0,this.uchar=h||" ",this.penState=new l(d,C,x,w,j)}var _=g.prototype;return _.reset=function(){this.uchar=" ",this.penState.reset()},_.setChar=function(d,C){this.uchar=d,this.penState.copy(C)},_.setPenState=function(d){this.penState.copy(d)},_.equals=function(d){return this.uchar===d.uchar&&this.penState.equals(d.penState)},_.copy=function(d){this.uchar=d.uchar,this.penState.copy(d.penState)},_.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},g}(),s=function(){function g(h){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var d=0;d<K;d++)this.chars.push(new u);this.logger=h,this.pos=0,this.currPenState=new l}var _=g.prototype;return _.equals=function(d){for(var C=!0,x=0;x<K;x++)if(!this.chars[x].equals(d.chars[x])){C=!1;break}return C},_.copy=function(d){for(var C=0;C<K;C++)this.chars[C].copy(d.chars[C])},_.isEmpty=function(){for(var d=!0,C=0;C<K;C++)if(!this.chars[C].isEmpty()){d=!1;break}return d},_.setCursor=function(d){this.pos!==d&&(this.pos=d),this.pos<0?(this.logger.log(c.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>K&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=K)},_.moveCursor=function(d){var C=this.pos+d;if(d>1)for(var x=this.pos+1;x<C+1;x++)this.chars[x].setPenState(this.currPenState);this.setCursor(C)},_.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},_.insertChar=function(d){d>=144&&this.backSpace();var C=F(d);if(this.pos>=K){this.logger.log(c.ERROR,"Cannot insert "+d.toString(16)+" ("+C+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(C,this.currPenState),this.moveCursor(1)},_.clearFromPos=function(d){var C;for(C=d;C<K;C++)this.chars[C].reset()},_.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},_.clearToEndOfRow=function(){this.clearFromPos(this.pos)},_.getTextString=function(){for(var d=[],C=!0,x=0;x<K;x++){var w=this.chars[x].uchar;w!==" "&&(C=!1),d.push(w)}return C?"":d.join("")},_.setPenStyles=function(d){this.currPenState.setStyles(d);var C=this.chars[this.pos];C.setPenState(this.currPenState)},g}(),i=function(){function g(h){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var d=0;d<G;d++)this.rows.push(new s(h));this.logger=h,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var _=g.prototype;return _.reset=function(){for(var d=0;d<G;d++)this.rows[d].clear();this.currRow=G-1},_.equals=function(d){for(var C=!0,x=0;x<G;x++)if(!this.rows[x].equals(d.rows[x])){C=!1;break}return C},_.copy=function(d){for(var C=0;C<G;C++)this.rows[C].copy(d.rows[C])},_.isEmpty=function(){for(var d=!0,C=0;C<G;C++)if(!this.rows[C].isEmpty()){d=!1;break}return d},_.backSpace=function(){var d=this.rows[this.currRow];d.backSpace()},_.clearToEndOfRow=function(){var d=this.rows[this.currRow];d.clearToEndOfRow()},_.insertChar=function(d){var C=this.rows[this.currRow];C.insertChar(d)},_.setPen=function(d){var C=this.rows[this.currRow];C.setPenStyles(d)},_.moveCursor=function(d){var C=this.rows[this.currRow];C.moveCursor(d)},_.setCursor=function(d){this.logger.log(c.INFO,"setCursor: "+d);var C=this.rows[this.currRow];C.setCursor(d)},_.setPAC=function(d){this.logger.log(c.INFO,"pacData = "+JSON.stringify(d));var C=d.row-1;if(this.nrRollUpRows&&C<this.nrRollUpRows-1&&(C=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==C){for(var x=0;x<G;x++)this.rows[x].clear();var w=this.currRow+1-this.nrRollUpRows,j=this.lastOutputScreen;if(j){var W=j.rows[w].cueStartTime,T=this.logger.time;if(W&&T!==null&&W<T)for(var M=0;M<this.nrRollUpRows;M++)this.rows[C-this.nrRollUpRows+M+1].copy(j.rows[w+M])}}this.currRow=C;var m=this.rows[this.currRow];if(d.indent!==null){var v=d.indent,H=Math.max(v-1,0);m.setCursor(d.indent),d.color=m.chars[H].penState.foreground}var X={foreground:d.color,underline:d.underline,italics:d.italics,background:"black",flash:!1};this.setPen(X)},_.setBkgData=function(d){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(d)),this.backSpace(),this.setPen(d),this.insertChar(32)},_.setRollUpRows=function(d){this.nrRollUpRows=d},_.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(c.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(c.TEXT,this.getDisplayText());var d=this.currRow+1-this.nrRollUpRows,C=this.rows.splice(d,1)[0];C.clear(),this.rows.splice(this.currRow,0,C),this.logger.log(c.INFO,"Rolling up")},_.getDisplayText=function(d){d=d||!1;for(var C=[],x="",w=-1,j=0;j<G;j++){var W=this.rows[j].getTextString();W&&(w=j+1,d?C.push("Row "+w+": '"+W+"'"):C.push(W.trim()))}return C.length>0&&(d?x="["+C.join(" | ")+"]":x=C.join(`
`)),x},_.getTextAndFormat=function(){return this.rows},g}(),D=function(){function g(h,d,C){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=h,this.outputFilter=d,this.mode=null,this.verbose=0,this.displayedMemory=new i(C),this.nonDisplayedMemory=new i(C),this.lastOutputScreen=new i(C),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=C}var _=g.prototype;return _.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},_.getHandler=function(){return this.outputFilter},_.setHandler=function(d){this.outputFilter=d},_.setPAC=function(d){this.writeScreen.setPAC(d)},_.setBkgData=function(d){this.writeScreen.setBkgData(d)},_.setMode=function(d){if(d===this.mode)return;this.mode=d,this.logger.log(c.INFO,"MODE="+d),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=d},_.insertChars=function(d){for(var C=0;C<d.length;C++)this.writeScreen.insertChar(d[C]);var x=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(c.INFO,x+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(c.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},_.ccRCL=function(){this.logger.log(c.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},_.ccBS=function(){if(this.logger.log(c.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},_.ccAOF=function(){},_.ccAON=function(){},_.ccDER=function(){this.logger.log(c.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},_.ccRU=function(d){this.logger.log(c.INFO,"RU("+d+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(d)},_.ccFON=function(){this.logger.log(c.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},_.ccRDC=function(){this.logger.log(c.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},_.ccTR=function(){this.logger.log(c.INFO,"TR"),this.setMode("MODE_TEXT")},_.ccRTD=function(){this.logger.log(c.INFO,"RTD"),this.setMode("MODE_TEXT")},_.ccEDM=function(){this.logger.log(c.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},_.ccCR=function(){this.logger.log(c.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},_.ccENM=function(){this.logger.log(c.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},_.ccEOC=function(){if(this.logger.log(c.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var d=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=d,this.writeScreen=this.nonDisplayedMemory,this.logger.log(c.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},_.ccTO=function(d){this.logger.log(c.INFO,"TO("+d+") - Tab Offset"),this.writeScreen.moveCursor(d)},_.ccMIDROW=function(d){var C={flash:!1};if(C.underline=d%2===1,C.italics=d>=46,C.italics)C.foreground="white";else{var x=Math.floor(d/2)-16,w=["white","green","blue","cyan","red","yellow","magenta"];C.foreground=w[x]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(C)),this.writeScreen.setPen(C)},_.outputDataUpdate=function(d){d===void 0&&(d=!1);var C=this.logger.time;if(C===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=C:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,C,this.lastOutputScreen),d&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:C),this.lastOutputScreen.copy(this.displayedMemory))},_.cueSplitAtTime=function(d){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,d,this.displayedMemory),this.cueStartTime=d))},g}(),A=function(){function g(h,d,C){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var x=new a;this.channels=[null,new D(h,d,x),new D(h+1,C,x)],this.cmdHistory=O(),this.logger=x}var _=g.prototype;return _.getHandler=function(d){return this.channels[d].getHandler()},_.setHandler=function(d,C){this.channels[d].setHandler(C)},_.addData=function(d,C){var x,w,j,W=!1;this.logger.time=d;for(var T=0;T<C.length;T+=2){if(w=C[T]&127,j=C[T+1]&127,w===0&&j===0)continue;if(this.logger.log(c.DATA,"["+p([C[T],C[T+1]])+"] -> ("+p([w,j])+")"),x=this.parseCmd(w,j),x||(x=this.parseMidrow(w,j)),x||(x=this.parsePAC(w,j)),x||(x=this.parseBackgroundAttributes(w,j)),!x&&(W=this.parseChars(w,j),W)){var M=this.currentChannel;if(M&&M>0){var m=this.channels[M];m.insertChars(W)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!x&&!W&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+p([w,j])+" orig: "+p([C[T],C[T+1]]))}},_.parseCmd=function(d,C){var x=this.cmdHistory,w=(d===20||d===28||d===21||d===29)&&C>=32&&C<=47,j=(d===23||d===31)&&C>=33&&C<=35;if(!(w||j))return!1;if(R(d,C,x))return S(null,null,x),this.logger.log(c.DEBUG,"Repeated command ("+p([d,C])+") is dropped"),!0;var W=d===20||d===21||d===23?1:2,T=this.channels[W];return d===20||d===21||d===28||d===29?C===32?T.ccRCL():C===33?T.ccBS():C===34?T.ccAOF():C===35?T.ccAON():C===36?T.ccDER():C===37?T.ccRU(2):C===38?T.ccRU(3):C===39?T.ccRU(4):C===40?T.ccFON():C===41?T.ccRDC():C===42?T.ccTR():C===43?T.ccRTD():C===44?T.ccEDM():C===45?T.ccCR():C===46?T.ccENM():C===47&&T.ccEOC():T.ccTO(C-32),S(d,C,x),this.currentChannel=W,!0},_.parseMidrow=function(d,C){var x=0;if((d===17||d===25)&&C>=32&&C<=47){if(d===17?x=1:x=2,x!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var w=this.channels[x];return w?(w.ccMIDROW(C),this.logger.log(c.DEBUG,"MIDROW ("+p([d,C])+")"),!0):!1}return!1},_.parsePAC=function(d,C){var x,w=this.cmdHistory,j=(d>=17&&d<=23||d>=25&&d<=31)&&C>=64&&C<=127,W=(d===16||d===24)&&C>=64&&C<=95;if(!(j||W))return!1;if(R(d,C,w))return S(null,null,w),!0;var T=d<=23?1:2;C>=64&&C<=95?x=T===1?n[d]:E[d]:x=T===1?I[d]:f[d];var M=this.channels[T];return M?(M.setPAC(this.interpretPAC(x,C)),S(d,C,w),this.currentChannel=T,!0):!1},_.interpretPAC=function(d,C){var x,w={color:null,italics:!1,indent:null,underline:!1,row:d};return C>95?x=C-96:x=C-64,w.underline=(x&1)===1,x<=13?w.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(x/2)]:x<=15?(w.italics=!0,w.color="white"):w.indent=Math.floor((x-16)/2)*4,w},_.parseChars=function(d,C){var x,w=null,j=null;if(d>=25?(x=2,j=d-8):(x=1,j=d),j>=17&&j<=19){var W;j===17?W=C+80:j===18?W=C+112:W=C+144,this.logger.log(c.INFO,"Special char '"+F(W)+"' in channel "+x),w=[W]}else d>=32&&d<=127&&(w=C===0?[d]:[d,C]);if(w){var T=p(w);this.logger.log(c.DEBUG,"Char codes = "+T.join(",")),S(d,C,this.cmdHistory)}return w},_.parseBackgroundAttributes=function(d,C){var x=(d===16||d===24)&&C>=32&&C<=47,w=(d===23||d===31)&&C>=45&&C<=47;if(!(x||w))return!1;var j,W={};d===16||d===24?(j=Math.floor((C-32)/2),W.background=b[j],C%2===1&&(W.background=W.background+"_semi")):C===45?W.background="transparent":(W.foreground="black",C===47&&(W.underline=!0));var T=d<=23?1:2,M=this.channels[T];return M.setBkgData(W),S(d,C,this.cmdHistory),!0},_.reset=function(){for(var d=0;d<Object.keys(this.channels).length;d++){var C=this.channels[d];C&&C.reset()}this.cmdHistory=O()},_.cueSplitAtTime=function(d){for(var C=0;C<this.channels.length;C++){var x=this.channels[C];x&&x.cueSplitAtTime(d)}},g}();function S(g,_,h){h.a=g,h.b=_}function R(g,_,h){return h.a===g&&h.b===_}function O(){return{a:null,b:null}}Y.default=A},"./src/utils/codecs.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"isCodecType",function(){return P}),N.d(Y,"isCodecSupportedInMp4",function(){return F});var z={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 P(G,K){var n=z[K];return!!n&&n[G.slice(0,4)]===!0}function F(G,K){return MediaSource.isTypeSupported((K||"video")+'/mp4;codecs="'+G+'"')}},"./src/utils/cues.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/utils/vttparser.ts"),P=N("./src/utils/webvtt-parser.ts"),F=N("./src/utils/texttrack-utils.ts"),G=/\s/,K={newCue:function(I,E,f,b){for(var c=[],a,p,l,u,s,i=self.VTTCue||self.TextTrackCue,D=0;D<b.rows.length;D++)if(a=b.rows[D],l=!0,u=0,s="",!a.isEmpty()){for(var A=0;A<a.chars.length;A++)G.test(a.chars[A].uchar)&&l?u++:(s+=a.chars[A].uchar,l=!1);a.cueStartTime=E,E===f&&(f+=1e-4),u>=16?u--:u++;var S=Object(z.fixLineBreaks)(s.trim()),R=Object(P.generateCueId)(E,f,S);(!I||!I.cues||!I.cues.getCueById(R))&&(p=new i(E,f,S),p.id=R,p.line=D+1,p.align="left",p.position=10+Math.min(80,Math.floor(u*8/32)*10),c.push(p))}return I&&c.length&&(c.sort(function(O,g){return O.line==="auto"||g.line==="auto"?0:O.line>8&&g.line>8?g.line-O.line:O.line-g.line}),c.forEach(function(O){return Object(F.addCueToTrack)(I,O)})),c}};Y.default=K},"./src/utils/discontinuities.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"findFirstFragWithCC",function(){return G}),N.d(Y,"shouldAlignOnDiscontinuities",function(){return K}),N.d(Y,"findDiscontinuousReferenceFrag",function(){return n}),N.d(Y,"adjustSlidingStart",function(){return E}),N.d(Y,"alignStream",function(){return f}),N.d(Y,"alignPDT",function(){return c}),N.d(Y,"alignFragmentByPDTDelta",function(){return a}),N.d(Y,"alignMediaPlaylistByPDT",function(){return p});var z=N("./src/polyfills/number.ts"),P=N("./src/utils/logger.ts"),F=N("./src/controller/level-helper.ts");function G(l,u){for(var s=null,i=0,D=l.length;i<D;i++){var A=l[i];if(A&&A.cc===u){s=A;break}}return s}function K(l,u,s){return!!(u.details&&(s.endCC>s.startCC||l&&l.cc<s.startCC))}function n(l,u){var s=l.fragments,i=u.fragments;if(!i.length||!s.length){P.logger.log("No fragments to align");return}var D=G(s,i[0].cc);if(!D||D&&!D.startPTS){P.logger.log("No frag in previous level to align on");return}return D}function I(l,u){if(l){var s=l.start+u;l.start=l.startPTS=s,l.endPTS=s+l.duration}}function E(l,u){for(var s=u.fragments,i=0,D=s.length;i<D;i++)I(s[i],l);u.fragmentHint&&I(u.fragmentHint,l),u.alignedSliding=!0}function f(l,u,s){if(!u)return;b(l,s,u),!s.alignedSliding&&u.details&&c(s,u.details),!s.alignedSliding&&u.details&&!s.skippedSegments&&Object(F.adjustSliding)(u.details,s)}function b(l,u,s){if(K(l,s,u)){var i=n(s.details,u);i&&Object(z.isFiniteNumber)(i.start)&&(P.logger.log("Adjusting PTS using last level due to CC increase within current level "+u.url),E(i.start,u))}}function c(l,u){if(!u.fragments.length||!l.hasProgramDateTime||!u.hasProgramDateTime)return;var s=u.fragments[0].programDateTime,i=l.fragments[0].programDateTime,D=(i-s)/1e3+u.fragments[0].start;D&&Object(z.isFiniteNumber)(D)&&(P.logger.log("Adjusting PTS using programDateTime delta "+(i-s)+"ms, sliding:"+D.toFixed(3)+" "+l.url+" "),E(D,l))}function a(l,u){var s=l.programDateTime;if(!s)return;var i=(s-u)/1e3;l.start=l.startPTS=i,l.endPTS=i+l.duration}function p(l,u){if(!u.fragments.length||!l.hasProgramDateTime||!u.hasProgramDateTime)return;var s=u.fragments[0].programDateTime,i=u.fragments[0].start,D=s-i*1e3;l.fragments.forEach(function(A){a(A,D)}),l.fragmentHint&&a(l.fragmentHint,D),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/utils/ewma.ts"),P=function(){function F(K,n,I){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=I,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new z.default(K),this.fast_=new z.default(n)}var G=F.prototype;return G.update=function(n,I){var E=this.slow_,f=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new z.default(n,E.getEstimate(),E.getTotalWeight())),this.fast_.halfLife!==I&&(this.fast_=new z.default(I,f.getEstimate(),f.getTotalWeight()))},G.sample=function(n,I){n=Math.max(n,this.minDelayMs_);var E=8*I,f=n/1e3,b=E/f;this.fast_.sample(f,b),this.slow_.sample(f,b)},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(){},F}();Y.default=P},"./src/utils/ewma.ts":function(te,Y,N){"use strict";N.r(Y);var z=function(){function P(G,K,n){K===void 0&&(K=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_=K,this.totalWeight_=n}var F=P.prototype;return F.sample=function(K,n){var I=Math.pow(this.alpha_,K);this.estimate_=n*(1-I)+I*this.estimate_,this.totalWeight_+=K},F.getTotalWeight=function(){return this.totalWeight_},F.getEstimate=function(){if(this.alpha_){var K=1-Math.pow(this.alpha_,this.totalWeight_);if(K)return this.estimate_/K}return this.estimate_},P}();Y.default=z},"./src/utils/fetch-loader.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"fetchSupported",function(){return a});var z=N("./src/polyfills/number.ts"),P=N("./src/loader/load-stats.ts"),F=N("./src/demux/chunk-cache.ts");function G(i,D){i.prototype=Object.create(D.prototype),i.prototype.constructor=i,f(i,D)}function K(i){var D=typeof Map=="function"?new Map:void 0;return K=function(S){if(S===null||!E(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof D!="undefined"){if(D.has(S))return D.get(S);D.set(S,R)}function R(){return n(S,arguments,b(this).constructor)}return R.prototype=Object.create(S.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),f(R,S)},K(i)}function n(i,D,A){return I()?n=Reflect.construct:n=function(R,O,g){var _=[null];_.push.apply(_,O);var h=Function.bind.apply(R,_),d=new h;return g&&f(d,g.prototype),d},n.apply(null,arguments)}function I(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function E(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function f(i,D){return f=Object.setPrototypeOf||function(S,R){return S.__proto__=R,S},f(i,D)}function b(i){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},b(i)}function c(){return c=Object.assign||function(i){for(var D=1;D<arguments.length;D++){var A=arguments[D];for(var S in A)Object.prototype.hasOwnProperty.call(A,S)&&(i[S]=A[S])}return i},c.apply(this,arguments)}function a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(i){}return!1}var p=function(){function i(A){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=A.fetchSetup||u,this.controller=new self.AbortController,this.stats=new P.LoadStats}var D=i.prototype;return D.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},D.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},D.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},D.load=function(S,R,O){var g=this,_=this.stats;if(_.loading.start)throw new Error("Loader can only be used once.");_.loading.start=self.performance.now();var h=l(S,this.controller.signal),d=O.onProgress,C=S.responseType==="arraybuffer",x=C?"byteLength":"length";this.context=S,this.config=R,this.callbacks=O,this.request=this.fetchSetup(S,h),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){g.abortInternal(),O.onTimeout(_,S,g.response)},R.timeout),self.fetch(this.request).then(function(w){if(g.response=g.loader=w,!w.ok){var j=w.status,W=w.statusText;throw new s(W||"fetch, bad network response",j,w)}return _.loading.first=Math.max(self.performance.now(),_.loading.start),_.total=parseInt(w.headers.get("Content-Length")||"0"),d&&Object(z.isFiniteNumber)(R.highWaterMark)?g.loadProgressively(w,_,S,R.highWaterMark,d):C?w.arrayBuffer():w.text()}).then(function(w){var j=g.response;self.clearTimeout(g.requestTimeout),_.loading.end=Math.max(self.performance.now(),_.loading.first),_.loaded=_.total=w[x];var W={url:j.url,data:w};d&&!Object(z.isFiniteNumber)(R.highWaterMark)&&d(_,S,w,j),O.onSuccess(W,_,S,j)}).catch(function(w){if(self.clearTimeout(g.requestTimeout),_.aborted)return;var j=w.code||0;O.onError({code:j,text:w.message},S,w.details)})},D.getCacheAge=function(){var S=null;if(this.response){var R=this.response.headers.get("age");S=R?parseFloat(R):null}return S},D.loadProgressively=function(S,R,O,g,_){g===void 0&&(g=0);var h=new F.default,d=S.body.getReader(),C=function x(){return d.read().then(function(w){if(w.done)return h.dataLength&&_(R,O,h.flush(),S),Promise.resolve(new ArrayBuffer(0));var j=w.value,W=j.length;return R.loaded+=W,W<g||h.dataLength?(h.push(j),h.dataLength>=g&&_(R,O,h.flush(),S)):_(R,O,j,S),x()}).catch(function(){return Promise.reject()})};return C()},i}();function l(i,D){var A={method:"GET",mode:"cors",credentials:"same-origin",signal:D,headers:new self.Headers(c({},i.headers))};return i.rangeEnd&&A.headers.set("Range","bytes="+i.rangeStart+"-"+String(i.rangeEnd-1)),A}function u(i,D){return new self.Request(i.url,D)}var s=function(i){G(D,i);function D(A,S,R){var O;return O=i.call(this,A)||this,O.code=void 0,O.details=void 0,O.code=S,O.details=R,O}return D}(K(Error));Y.default=p},"./src/utils/imsc1-ttml-parser.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"IMSC1_CODEC",function(){return E}),N.d(Y,"parseIMSC1",function(){return a});var z=N("./src/utils/mp4-tools.ts"),P=N("./src/utils/vttparser.ts"),F=N("./src/utils/vttcue.ts"),G=N("./src/demux/id3.ts"),K=N("./src/utils/timescale-conversion.ts"),n=N("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(g){for(var _=1;_<arguments.length;_++){var h=arguments[_];for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(g[d]=h[d])}return g},I.apply(this,arguments)}var E="stpp.ttml.im1t",f=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,b=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,c={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(g,_,h,d,C){var x=Object(z.findBox)(new Uint8Array(g),["mdat"]);if(x.length===0){C(new Error("Could not parse IMSC1 mdat"));return}var w=x[0],j=Object(G.utf8ArrayToStr)(new Uint8Array(g,w.start,w.end-w.start)),W=Object(K.toTimescaleFromScale)(_,1,h);try{d(p(j,W))}catch(T){C(T)}}function p(g,_){var h=new DOMParser,d=h.parseFromString(g,"text/xml"),C=d.getElementsByTagName("tt")[0];if(!C)throw new Error("Invalid ttml");var x={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},w=Object.keys(x).reduce(function(m,v){return m[v]=C.getAttribute("ttp:"+v)||x[v],m},{}),j=C.getAttribute("xml:space")!=="preserve",W=u(l(C,"styling","style")),T=u(l(C,"layout","region")),M=l(C,"body","[begin]");return[].map.call(M,function(m){var v=s(m,j);if(!v||!m.hasAttribute("begin"))return null;var H=S(m.getAttribute("begin"),w),X=S(m.getAttribute("dur"),w),q=S(m.getAttribute("end"),w);if(H===null)throw A(m);if(q===null){if(X===null)throw A(m);q=H+X}var re=new F.default(H-_,q-_,v);re.id=Object(n.generateCueId)(re.startTime,re.endTime,re.text);var ye=T[m.getAttribute("region")],pe=W[m.getAttribute("style")];re.position=10,re.size=80;var ue=i(ye,pe),fe=ue.textAlign;if(fe){var be=c[fe];be&&(re.lineAlign=be),re.align=fe}return I(re,ue),re}).filter(function(m){return m!==null})}function l(g,_,h){var d=g.getElementsByTagName(_)[0];return d?[].slice.call(d.querySelectorAll(h)):[]}function u(g){return g.reduce(function(_,h){var d=h.getAttribute("xml:id");return d&&(_[d]=h),_},{})}function s(g,_){return[].slice.call(g.childNodes).reduce(function(h,d,C){var x;return d.nodeName==="br"&&C?h+`
`:(x=d.childNodes)!==null&&x!==void 0&&x.length?s(d,_):_?h+d.textContent.trim().replace(/\s+/g," "):h+d.textContent},"")}function i(g,_){var h="http://www.w3.org/ns/ttml#styling",d=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return d.reduce(function(C,x){var w=D(_,h,x)||D(g,h,x);return w&&(C[x]=w),C},{})}function D(g,_,h){return g.hasAttributeNS(_,h)?g.getAttributeNS(_,h):null}function A(g){return new Error("Could not parse ttml timestamp "+g)}function S(g,_){if(!g)return null;var h=Object(P.parseTimeStamp)(g);return h===null&&(f.test(g)?h=R(g,_):b.test(g)&&(h=O(g,_))),h}function R(g,_){var h=f.exec(g),d=(h[4]|0)+(h[5]|0)/_.subFrameRate;return(h[1]|0)*3600+(h[2]|0)*60+(h[3]|0)+d/_.frameRate}function O(g,_){var h=b.exec(g),d=Number(h[1]),C=h[2];switch(C){case"h":return d*3600;case"m":return d*60;case"ms":return d*1e3;case"f":return d/_.frameRate;case"t":return d/_.tickRate}return d}},"./src/utils/logger.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"enableLogs",function(){return n}),N.d(Y,"logger",function(){return I});var z=function(){},P={trace:z,debug:z,log:z,warn:z,info:z,error:z},F=P;function G(E){var f=self.console[E];return f?f.bind(self.console,"["+E+"] >"):z}function K(E){for(var f=arguments.length,b=new Array(f>1?f-1:0),c=1;c<f;c++)b[c-1]=arguments[c];b.forEach(function(a){F[a]=E[a]?E[a].bind(E):G(a)})}function n(E){if(self.console&&E===!0||typeof E=="object"){K(E,"debug","log","info","warn","error");try{F.log()}catch(f){F=P}}else F=P}var I=F},"./src/utils/mediakeys-helper.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"KeySystems",function(){return z}),N.d(Y,"requestMediaKeySystemAccess",function(){return P});var z;(function(F){F.WIDEVINE="com.widevine.alpha",F.PLAYREADY="com.microsoft.playready"})(z||(z={}));var P=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"getMediaSource",function(){return z});function z(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"bin2str",function(){return K}),N.d(Y,"readUint16",function(){return n}),N.d(Y,"readUint32",function(){return I}),N.d(Y,"writeUint32",function(){return E}),N.d(Y,"findBox",function(){return f}),N.d(Y,"parseSegmentIndex",function(){return b}),N.d(Y,"parseInitSegment",function(){return c}),N.d(Y,"getStartDTS",function(){return a}),N.d(Y,"getDuration",function(){return p}),N.d(Y,"computeRawDurationFromSamples",function(){return l}),N.d(Y,"offsetStartDTS",function(){return u}),N.d(Y,"segmentValidRange",function(){return s}),N.d(Y,"appendUint8Array",function(){return i});var z=N("./src/utils/typed-array.ts"),P=N("./src/loader/fragment.ts"),F=Math.pow(2,32)-1,G=[].push;function K(D){return String.fromCharCode.apply(null,D)}function n(D,A){"data"in D&&(A+=D.start,D=D.data);var S=D[A]<<8|D[A+1];return S<0?65536+S:S}function I(D,A){"data"in D&&(A+=D.start,D=D.data);var S=D[A]<<24|D[A+1]<<16|D[A+2]<<8|D[A+3];return S<0?4294967296+S:S}function E(D,A,S){"data"in D&&(A+=D.start,D=D.data),D[A]=S>>24,D[A+1]=S>>16&255,D[A+2]=S>>8&255,D[A+3]=S&255}function f(D,A){var S=[];if(!A.length)return S;var R,O,g;"data"in D?(R=D.data,O=D.start,g=D.end):(R=D,O=0,g=R.byteLength);for(var _=O;_<g;){var h=I(R,_),d=K(R.subarray(_+4,_+8)),C=h>1?_+h:g;if(d===A[0])if(A.length===1)S.push({data:R,start:_+8,end:C});else{var x=f({data:R,start:_+8,end:C},A.slice(1));x.length&&G.apply(S,x)}_=C}return S}function b(D){var A=f(D,["moov"]),S=A[0],R=S?S.end:null,O=f(D,["sidx"]);if(!O||!O[0])return null;var g=[],_=O[0],h=_.data[0],d=h===0?8:16,C=I(_,d);d+=4;var x=0,w=0;h===0?d+=8:d+=16,d+=2;var j=_.end+w,W=n(_,d);d+=2;for(var T=0;T<W;T++){var M=d,m=I(_,M);M+=4;var v=m&2147483647,H=(m&2147483648)>>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var X=I(_,M);M+=4,g.push({referenceSize:v,subsegmentDuration:X,info:{duration:X/C,start:j,end:j+v-1}}),j+=v,M+=4,d=M}return{earliestPresentationTime:x,timescale:C,version:h,referencesCount:W,references:g,moovEndOffset:R}}function c(D){for(var A=[],S=f(D,["moov","trak"]),R=0;R<S.length;R++){var O=S[R],g=f(O,["tkhd"])[0];if(g){var _=g.data[g.start],h=_===0?12:20,d=I(g,h),C=f(O,["mdia","mdhd"])[0];if(C){_=C.data[C.start],h=_===0?12:20;var x=I(C,h),w=f(O,["mdia","hdlr"])[0];if(w){var j=K(w.data.subarray(w.start+8,w.start+12)),W={soun:P.ElementaryStreamTypes.AUDIO,vide:P.ElementaryStreamTypes.VIDEO}[j];if(W){var T=f(O,["mdia","minf","stbl","stsd"])[0],M=void 0;T&&(M=K(T.data.subarray(T.start+12,T.start+16))),A[d]={timescale:x,type:W},A[W]={timescale:x,id:d,codec:M}}}}}}var m=f(D,["moov","mvex","trex"]);return m.forEach(function(v){var H=I(v,4),X=A[H];X&&(X.default={duration:I(v,12),flags:I(v,20)})}),A}function a(D,A){return f(A,["moof","traf"]).reduce(function(S,R){var O=f(R,["tfdt"])[0],g=O.data[O.start],_=f(R,["tfhd"]).reduce(function(h,d){var C=I(d,4),x=D[C];if(x){var w=I(O,4);g===1&&(w*=Math.pow(2,32),w+=I(O,8));var j=x.timescale||9e4,W=w/j;if(isFinite(W)&&(h===null||W<h))return W}return h},null);return _!==null&&isFinite(_)&&(S===null||_<S)?_:S},null)||0}function p(D,A){for(var S=0,R=0,O=0,g=f(D,["moof","traf"]),_=0;_<g.length;_++){var h=g[_],d=f(h,["tfhd"])[0],C=I(d,4),x=A[C];if(!x)continue;var w=x.default,j=I(d,0)|(w==null?void 0:w.flags),W=w==null?void 0:w.duration;j&8&&(j&2?W=I(d,12):W=I(d,8));for(var T=x.timescale||9e4,M=f(h,["trun"]),m=0;m<M.length;m++){if(W){var v=I(M[m],4);S=W*v}else S=l(M[m]);x.type===P.ElementaryStreamTypes.VIDEO?R+=S/T:x.type===P.ElementaryStreamTypes.AUDIO&&(O+=S/T)}}if(R===0&&O===0){var H=b(D);if(H!=null&&H.references)return H.references.reduce(function(X,q){return X+q.info.duration||0},0)}return R||O}function l(D){var A=I(D,0),S=8;A&1&&(S+=4),A&4&&(S+=4);for(var R=0,O=I(D,4),g=0;g<O;g++){if(A&256){var _=I(D,S);R+=_,S+=4}A&512&&(S+=4),A&1024&&(S+=4),A&2048&&(S+=4)}return R}function u(D,A,S){f(A,["moof","traf"]).forEach(function(R){f(R,["tfhd"]).forEach(function(O){var g=I(O,4),_=D[g];if(!_)return;var h=_.timescale||9e4;f(R,["tfdt"]).forEach(function(d){var C=d.data[d.start],x=I(d,4);if(C===0)E(d,4,x-S*h);else{x*=Math.pow(2,32),x+=I(d,8),x-=S*h,x=Math.max(x,0);var w=Math.floor(x/(F+1)),j=Math.floor(x%(F+1));E(d,4,w),E(d,8,j)}})})})}function s(D){var A={valid:null,remainder:null},S=f(D,["moof"]);if(S){if(S.length<2)return A.remainder=D,A}else return A;var R=S[S.length-1];return A.valid=Object(z.sliceUint8)(D,0,R.start-8),A.remainder=Object(z.sliceUint8)(D,R.start-8),A}function i(D,A){var S=new Uint8Array(D.length+A.length);return S.set(D),S.set(A,D.length),S}},"./src/utils/output-filter.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return z});var z=function(){function P(G,K){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=K}var F=P.prototype;return F.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},F.newCue=function(K,n,I){(this.startTime===null||this.startTime>K)&&(this.startTime=K),this.endTime=n,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},F.reset=function(){this.cueRanges=[]},P}()},"./src/utils/texttrack-utils.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"sendAddTrackEvent",function(){return P}),N.d(Y,"addCueToTrack",function(){return F}),N.d(Y,"clearCurrentCues",function(){return G}),N.d(Y,"removeCuesInRange",function(){return K}),N.d(Y,"getCuesInRange",function(){return I});var z=N("./src/utils/logger.ts");function P(E,f){var b;try{b=new Event("addtrack")}catch(c){b=document.createEvent("Event"),b.initEvent("addtrack",!1,!1)}b.track=E,f.dispatchEvent(b)}function F(E,f){var b=E.mode;if(b==="disabled"&&(E.mode="hidden"),E.cues&&!E.cues.getCueById(f.id))try{if(E.addCue(f),!E.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(a){z.logger.debug("[texttrack-utils]: "+a);var c=new self.TextTrackCue(f.startTime,f.endTime,f.text);c.id=f.id,E.addCue(c)}b==="disabled"&&(E.mode=b)}function G(E){var f=E.mode;if(f==="disabled"&&(E.mode="hidden"),E.cues)for(var b=E.cues.length;b--;)E.removeCue(E.cues[b]);f==="disabled"&&(E.mode=f)}function K(E,f,b){var c=E.mode;if(c==="disabled"&&(E.mode="hidden"),E.cues&&E.cues.length>0)for(var a=I(E.cues,f,b),p=0;p<a.length;p++)E.removeCue(a[p]);c==="disabled"&&(E.mode=c)}function n(E,f){if(f<E[0].startTime)return 0;var b=E.length-1;if(f>E[b].endTime)return-1;for(var c=0,a=b;c<=a;){var p=Math.floor((a+c)/2);if(f<E[p].startTime)a=p-1;else if(f>E[p].startTime&&c<b)c=p+1;else return p}return E[c].startTime-f<f-E[a].startTime?c:a}function I(E,f,b){var c=[],a=n(E,f);if(a>-1)for(var p=a,l=E.length;p<l;p++){var u=E[p];if(u.startTime>=f&&u.endTime<=b)c.push(u);else if(u.startTime>b)return c}return c}},"./src/utils/time-ranges.ts":function(te,Y,N){"use strict";N.r(Y);var z={toString:function(F){for(var G="",K=F.length,n=0;n<K;n++)G+="["+F.start(n).toFixed(3)+","+F.end(n).toFixed(3)+"]";return G}};Y.default=z},"./src/utils/timescale-conversion.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"toTimescaleFromBase",function(){return P}),N.d(Y,"toTimescaleFromScale",function(){return F}),N.d(Y,"toMsFromMpegTsClock",function(){return G}),N.d(Y,"toMpegTsClockFromTimescale",function(){return K});var z=9e4;function P(n,I,E,f){E===void 0&&(E=1),f===void 0&&(f=!1);var b=n*I*E;return f?Math.round(b):b}function F(n,I,E,f){return E===void 0&&(E=1),f===void 0&&(f=!1),P(n,I,1/E,f)}function G(n,I){return I===void 0&&(I=!1),P(n,1e3,1/z,I)}function K(n,I){return I===void 0&&(I=1),P(n,z,1/I)}},"./src/utils/typed-array.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"sliceUint8",function(){return z});function z(P,F,G){return Uint8Array.prototype.slice?P.slice(F,G):new Uint8Array(Array.prototype.slice.call(P,F,G))}},"./src/utils/vttcue.ts":function(te,Y,N){"use strict";N.r(Y),Y.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var z=["","lr","rl"],P=["start","middle","end","left","right"];function F(E,f){if(typeof f!="string")return!1;if(!Array.isArray(E))return!1;var b=f.toLowerCase();return~E.indexOf(b)?b:!1}function G(E){return F(z,E)}function K(E){return F(P,E)}function n(E){for(var f=arguments.length,b=new Array(f>1?f-1:0),c=1;c<f;c++)b[c-1]=arguments[c];for(var a=1;a<arguments.length;a++){var p=arguments[a];for(var l in p)E[l]=p[l]}return E}function I(E,f,b){var c=this,a={enumerable:!0};c.hasBeenReset=!1;var p="",l=!1,u=E,s=f,i=b,D=null,A="",S=!0,R="auto",O="start",g=50,_="middle",h=50,d="middle";Object.defineProperty(c,"id",n({},a,{get:function(){return p},set:function(x){p=""+x}})),Object.defineProperty(c,"pauseOnExit",n({},a,{get:function(){return l},set:function(x){l=!!x}})),Object.defineProperty(c,"startTime",n({},a,{get:function(){return u},set:function(x){if(typeof x!="number")throw new TypeError("Start time must be set to a number.");u=x,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",n({},a,{get:function(){return s},set:function(x){if(typeof x!="number")throw new TypeError("End time must be set to a number.");s=x,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",n({},a,{get:function(){return i},set:function(x){i=""+x,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",n({},a,{get:function(){return D},set:function(x){D=x,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",n({},a,{get:function(){return A},set:function(x){var w=G(x);if(w===!1)throw new SyntaxError("An invalid or illegal string was specified.");A=w,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",n({},a,{get:function(){return S},set:function(x){S=!!x,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",n({},a,{get:function(){return R},set:function(x){if(typeof x!="number"&&x!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=x,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",n({},a,{get:function(){return O},set:function(x){var w=K(x);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");O=w,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",n({},a,{get:function(){return g},set:function(x){if(x<0||x>100)throw new Error("Position must be between 0 and 100.");g=x,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",n({},a,{get:function(){return _},set:function(x){var w=K(x);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");_=w,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",n({},a,{get:function(){return h},set:function(x){if(x<0||x>100)throw new Error("Size must be between 0 and 100.");h=x,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",n({},a,{get:function(){return d},set:function(x){var w=K(x);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");d=w,this.hasBeenReset=!0}})),c.displayState=void 0}return I.prototype.getCueAsHTML=function(){var E=self.WebVTT;return E.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"parseTimeStamp",function(){return F}),N.d(Y,"fixLineBreaks",function(){return f}),N.d(Y,"VTTParser",function(){return b});var z=N("./src/utils/vttcue.ts"),P=function(){function c(){}var a=c.prototype;return a.decode=function(l,u){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},c}();function F(c){function a(l,u,s,i){return(l|0)*3600+(u|0)*60+(s|0)+parseFloat(i||0)}var p=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return p?parseFloat(p[2])>59?a(p[2],p[3],0,p[4]):a(p[1],p[2],p[3],p[4]):null}var G=function(){function c(){this.values=Object.create(null)}var a=c.prototype;return a.set=function(l,u){!this.get(l)&&u!==""&&(this.values[l]=u)},a.get=function(l,u,s){return s?this.has(l)?this.values[l]:u[s]:this.has(l)?this.values[l]:u},a.has=function(l){return l in this.values},a.alt=function(l,u,s){for(var i=0;i<s.length;++i)if(u===s[i]){this.set(l,u);break}},a.integer=function(l,u){/^-?\d+$/.test(u)&&this.set(l,parseInt(u,10))},a.percent=function(l,u){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(u)){var s=parseFloat(u);if(s>=0&&s<=100)return this.set(l,s),!0}return!1},c}();function K(c,a,p,l){var u=l?c.split(l):[c];for(var s in u){if(typeof u[s]!="string")continue;var i=u[s].split(p);if(i.length!==2)continue;var D=i[0],A=i[1];a(D,A)}}var n=new z.default(0,0,""),I=n.align==="middle"?"middle":"center";function E(c,a,p){var l=c;function u(){var D=F(c);if(D===null)throw new Error("Malformed timestamp: "+l);return c=c.replace(/^[^\sa-zA-Z-]+/,""),D}function s(D,A){var S=new G;K(D,function(g,_){var h;switch(g){case"region":for(var d=p.length-1;d>=0;d--)if(p[d].id===_){S.set(g,p[d].region);break}break;case"vertical":S.alt(g,_,["rl","lr"]);break;case"line":h=_.split(","),S.integer(g,h[0]),S.percent(g,h[0])&&S.set("snapToLines",!1),S.alt(g,h[0],["auto"]),h.length===2&&S.alt("lineAlign",h[1],["start",I,"end"]);break;case"position":h=_.split(","),S.percent(g,h[0]),h.length===2&&S.alt("positionAlign",h[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":S.percent(g,_);break;case"align":S.alt(g,_,["start",I,"end","left","right"]);break}},/:/,/\s/),A.region=S.get("region",null),A.vertical=S.get("vertical","");var R=S.get("line","auto");R==="auto"&&n.line===-1&&(R=-1),A.line=R,A.lineAlign=S.get("lineAlign","start"),A.snapToLines=S.get("snapToLines",!0),A.size=S.get("size",100),A.align=S.get("align",I);var O=S.get("position","auto");O==="auto"&&n.position===50&&(O=A.align==="start"||A.align==="left"?0:A.align==="end"||A.align==="right"?100:50),A.position=O}function i(){c=c.replace(/^\s+/,"")}if(i(),a.startTime=u(),i(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);c=c.substr(3),i(),a.endTime=u(),i(),s(c,a)}function f(c){return c.replace(/<br(?: \/)?>/gi,`
`)}var b=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new P,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var a=c.prototype;return a.parse=function(l){var u=this;l&&(u.buffer+=u.decoder.decode(l,{stream:!0}));function s(){var O=u.buffer,g=0;for(O=f(O);g<O.length&&O[g]!=="\r"&&O[g]!==`
`;)++g;var _=O.substr(0,g);return O[g]==="\r"&&++g,O[g]===`
`&&++g,u.buffer=O.substr(g),_}function i(O){K(O,function(g,_){},/:/)}try{var D="";if(u.state==="INITIAL"){if(!/\r\n|\n/.test(u.buffer))return this;D=s();var A=D.match(/^()?WEBVTT([ \t].*)?$/);if(!A||!A[0])throw new Error("Malformed WebVTT signature.");u.state="HEADER"}for(var S=!1;u.buffer;){if(!/\r\n|\n/.test(u.buffer))return this;S?S=!1:D=s();switch(u.state){case"HEADER":/:/.test(D)?i(D):D||(u.state="ID");continue;case"NOTE":D||(u.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(D)){u.state="NOTE";break}if(!D)continue;if(u.cue=new z.default(0,0,""),u.state="CUE",D.indexOf("-->")===-1){u.cue.id=D;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{E(D,u.cue,u.regionList)}catch(O){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var R=D.indexOf("-->")!==-1;if(!D||R&&(S=!0)){u.oncue&&u.cue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}if(u.cue===null)continue;u.cue.text&&(u.cue.text+=`
`),u.cue.text+=D}continue;case"BADCUE":D||(u.state="ID")}}}catch(O){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(u){l.onparsingerror&&l.onparsingerror(u)}return l.onflush&&l.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"generateCueId",function(){return b}),N.d(Y,"parseWebVTT",function(){return a});var z=N("./src/polyfills/number.ts"),P=N("./src/utils/vttparser.ts"),F=N("./src/demux/id3.ts"),G=N("./src/utils/timescale-conversion.ts"),K=N("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,I=function(l,u,s){return s===void 0&&(s=0),l.substr(s,u.length)===u},E=function(l){var u=parseInt(l.substr(-3)),s=parseInt(l.substr(-6,2)),i=parseInt(l.substr(-9,2)),D=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(z.isFiniteNumber)(u)||!Object(z.isFiniteNumber)(s)||!Object(z.isFiniteNumber)(i)||!Object(z.isFiniteNumber)(D))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return u+=1e3*s,u+=60*1e3*i,u+=60*60*1e3*D,u},f=function(l){for(var u=5381,s=l.length;s;)u=u*33^l.charCodeAt(--s);return(u>>>0).toString()};function b(p,l,u){return f(p.toString())+f(l.toString())+f(u)}var c=function(l,u,s){var i=l[u],D=l[i.prevCC];if(!D||!D.new&&i.new){l.ccOffset=l.presentationOffset=i.start,i.new=!1;return}for(;(A=D)!==null&&A!==void 0&&A.new;){var A;l.ccOffset+=i.start-D.start,i.new=!1,i=D,D=l[i.prevCC]}l.presentationOffset=s};function a(p,l,u,s,i,D,A,S){var R=new P.VTTParser,O=Object(F.utf8ArrayToStr)(new Uint8Array(p)).trim().replace(n,`
`).split(`
`),g=[],_=Object(G.toMpegTsClockFromTimescale)(l,u),h="00:00.000",d=0,C=0,x,w=!0,j=!1;R.oncue=function(W){var T=s[i],M=s.ccOffset,m=(d-_)/9e4;if(T!=null&&T.new&&(C!==void 0?M=s.ccOffset=T.start:c(s,i,m)),m&&(M=m-s.presentationOffset),j){var v=W.endTime-W.startTime,H=Object(K.normalizePts)((W.startTime+M-C)*9e4,D*9e4)/9e4;W.startTime=H,W.endTime=H+v}var X=W.text.trim();W.text=decodeURIComponent(encodeURIComponent(X)),W.id||(W.id=b(W.startTime,W.endTime,X)),W.endTime>0&&g.push(W)},R.onparsingerror=function(W){x=W},R.onflush=function(){if(x){S(x);return}A(g)},O.forEach(function(W){if(w)if(I(W,"X-TIMESTAMP-MAP=")){w=!1,j=!0,W.substr(16).split(",").forEach(function(T){I(T,"LOCAL:")?h=T.substr(6):I(T,"MPEGTS:")&&(d=parseInt(T.substr(7)))});try{C=E(h)/1e3}catch(T){j=!1,x=T}return}else W===""&&(w=!1);R.parse(W+`
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(te,Y,N){"use strict";N.r(Y);var z=N("./src/utils/logger.ts"),P=N("./src/loader/load-stats.ts"),F=/^age:\s*[\d.]+\s*$/m,G=function(){function K(I){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=I?I.xhrSetup:null,this.stats=new P.LoadStats,this.retryDelay=0}var n=K.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var E=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),E&&(E.onreadystatechange=null,E.onprogress=null,E.readyState!==4&&(this.stats.aborted=!0,E.abort()))},n.abort=function(){var E;this.abortInternal(),(E=this.callbacks)!==null&&E!==void 0&&E.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(E,f,b){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=E,this.config=f,this.callbacks=b,this.retryDelay=f.retryDelay,this.loadInternal()},n.loadInternal=function(){var E=this.config,f=this.context;if(!E)return;var b=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var a=this.xhrSetup;try{if(a)try{a(b,f.url)}catch(u){b.open("GET",f.url,!0),a(b,f.url)}b.readyState||b.open("GET",f.url,!0);var p=this.context.headers;if(p)for(var l in p)b.setRequestHeader(l,p[l])}catch(u){this.callbacks.onError({code:b.status,text:u.message},f,b);return}f.rangeEnd&&b.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),b.onreadystatechange=this.readystatechange.bind(this),b.onprogress=this.loadprogress.bind(this),b.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),E.timeout),b.send()},n.readystatechange=function(){var E=this.context,f=this.loader,b=this.stats;if(!E||!f)return;var c=f.readyState,a=this.config;if(b.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),b.loading.first===0&&(b.loading.first=Math.max(self.performance.now(),b.loading.start)),c===4){f.onreadystatechange=null,f.onprogress=null;var p=f.status;if(p>=200&&p<300){b.loading.end=Math.max(self.performance.now(),b.loading.first);var l,u;if(E.responseType==="arraybuffer"?(l=f.response,u=l.byteLength):(l=f.responseText,u=l.length),b.loaded=b.total=u,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(b,E,l,f),!this.callbacks)return;var i={url:f.responseURL,data:l};this.callbacks.onSuccess(i,b,E,f)}else b.retry>=a.maxRetry||p>=400&&p<499?(z.logger.error(p+" while loading "+E.url),this.callbacks.onError({code:p,text:f.statusText},E,f)):(z.logger.warn(p+" while loading "+E.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),b.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},n.loadtimeout=function(){z.logger.warn("timeout while loading "+this.context.url);var E=this.callbacks;E&&(this.abortInternal(),E.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(E){var f=this.stats;f.loaded=E.loaded,E.lengthComputable&&(f.total=E.total)},n.getCacheAge=function(){var E=null;if(this.loader&&F.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");E=f?parseFloat(f):null}return E},K}();Y.default=G}}).default})},vHTk:function(ct,ge,U){ct.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vkP9:function(ct,ge,U){"use strict";var te=U("+L6B"),Y=U("2/Rp"),N=U("5NDa"),z=U("5rEg"),P=U("y8nQ"),F=U("Vl3Y"),G=U("tJVT"),K=U("q1tI"),n=U.n(K),I=U("a+yL"),E=U.n(I),f=function(c){var a=c.value,p=c.onChange,l=F.a.useForm(),u=Object(G.a)(l,1),s=u[0];Object(K.useEffect)(function(){a&&s.setFieldsValue(a)},a);var i=function(A){p(A)};return n.a.createElement("div",{className:E.a.search},n.a.createElement(F.a,{className:E.a.formWrap,colon:!1,form:s,size:"large",layout:"inline",onFinish:i},n.a.createElement(F.a.Item,{label:"\u5B9E\u8BAD\u4FE1\u606F",name:"keyword",initialValue:""},n.a.createElement(z.a,{style:{width:280,height:40}})),n.a.createElement(F.a.Item,{label:"\u5B66\u6821/\u5355\u4F4D",name:"schools",initialValue:"",style:{margin:"0 40px"}},n.a.createElement(z.a,{style:{width:280,height:40}})),n.a.createElement(F.a.Item,{label:"\u521B\u5EFA\u8005",name:"creator",initialValue:""},n.a.createElement(z.a,{style:{width:200,height:40}})),n.a.createElement(Y.a,{className:E.a.btn,type:"primary",htmlType:"submit"},"\u641C\u7D22")))};ge.a=f},wNkr:function(ct,ge){ct.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAoCAYAAACFFRgXAAAAAXNSR0IArs4c6QAABIdJREFUWEftWGtMm1UYfg5taScYNhbt5qAFioMRE6aRkGiQP8vEJcZFZ5YYr9Fd3NTID/3hdS5xXoKZZpvrNsBtJotZlkxHyOIIZjLnLiSGxUWHQKXQsoGAjmAp7dcecw609Lt5GN/XTLOdP6f9Lud73ud93ve85yWUUgv+w4MQEkuFR24CNtlbNx7DvmCshtKYFxR5lAKEAGxmI/GbzYYHQYAQy0ZPnrXZkIZ7ApFeBtYwIAAUFASEz9zg6d9sZoOCBu50OfKNAe6flNjS2oN9mN2bAiD/pwY0G6OLXXbZx645S/SkAFZKgFIKQgjYPC2SFNhaJighJ4xNYKQodjnMAKzNjYZLZS5XwZs2jhnJzVEZDHMA631AyY8yCpWAEt7QXY8QePINSsIXYBrWUbAia6gZncooySyiFvmM8DnjZjGsG3KKqFe4XPWaADCLWo9RDftY0M02zyoBKfOGIHEzCRW75hkLOl9/WEr6VLlzCDSgygHKIFOnHXjmCrhgZ2V1SJp45+ya89UziT0162rp5N99rk5i6o2k8kjF9xZYtlyp7TjJNxdRtZYACqCavXBuTbv+zqRgTJQFknuMjsQYMZVHKhJMcOBCwAvO23Wzwmx2KrOfuQnYbEZVcSzSsJ4kOsovoW/Sn1xvs28d9noOYH3PM+iP9OHzogY0jR7FybFWfOTejqWOUuRYc9AwuAf1Q14cLP4KC223IUanFPdxcBtWLXgYh0cOoePvn3TtnrMkLpR3ovxCiWzhlTkPYdOiV/DlH19gde5jeKp7Ld5Y8i4P0g+CW2GBBV+XHseLvuexx7Mf67qfxkA0mFxjd1Ej9g/tw7nxM+YD/v2eK9hxeTtfOBQPwTu4g//+rGA3Vsx/EFUXKzAqjaCl7BQ2+V5AV7hTBqJ5WSvax89iTBrj1xuH9mKbuw4HhurTA/jScj/W+57lH4vGIzgzfppXZk2lLXDanHiu+wlcnPgZJ8ra8LJvAzrDv/Jnc60LMRkP43DJMTQMejEsDfPrDPwnBTvTB1hLEq8ufg2325w4NHwQuwr3YeUvD6D2jtdhJ3a8F3gL2RnZOFF2Cmt/Ww2vp1ElCab7tDHcdlc7/pJGk25m8tjg3Iwnux5HmIbx0qJaTMRDXM9b8t/H3Vn3wpHhQN3Ah2j+8xvsKqyHy+4GRZyvwZ4rmbcM991aBYlG+bVPL9fhu6stMinNOejSnb701hcCzj2dFaY2yXq9AKZ+l0StkhCws2nxm9HcsbevN2gOdiR7qxCwktneYEhKVGti1q/xFK0o31g9XJiXZawengKsPYTHeg1AqadsrUOsYcD+YGj2BbzIBRoFu7KVVLDkFmMM+wdC0nSfZKZ6n2kjyCt6dYUuqvjlKYwQuI0C7uq9KmXabCLu+H0VgbK+kNjeyGQUS4vmG2O49YcOyZ1XiMxMm0YrSnZKTx7pk40g8RtJkyKRKPqCfqyoWm4M8NHjbb3UpGagyE2EIPDoqmpjzcBj3/5YE4tL3nSDZmAtGdaNj9Tcb6zdKmLF7Ps3XgfebAZF6/3vGf4HhYa6OsTsTGoAAAAASUVORK5CYII="},xTzM:function(ct,ge){ct.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAqRJREFUWEfNmE1o02AYx/9JzJaltHatZRVR5hSRXHYYbCpMmTIRexAsDD0L8+Rphx10DIQddvDowbugCB68iWOKDqeb7tKD+MGKA8vo3Nzch7ZLlsibJjPrkjRvE8hySUiej9/7/PO+b54wmqZx2IMH4wqWv3kIS19HIcTOgVUP1uRX2XmUVl+DxX10vHpX097FwBmMQC3kP4JtSFElYPiKefnLGJrSd+sFdAb70PMQm8o1KiirMR8D5FXv7pzwE5wyjuSJQbQ9KDiDvWwrgIu2eI8ckOXWWhGtvZ3OYONHlYBS0YeJtT52BnueVMAYMTVAvyZnu8N85mS/67kGMAygGQHNa/PcEC+6gCUqFUueBaQRgD9AP3IaD3kR+HQbWHqje9UG63wE7GumSVG/rbIMTF+nAKs/Fb2nd7An9MH9eEz3eaxY11O39dmYEUHNEgBTWY9gp575GT+97/srFrDl0QGo6h1Ai9JH8lFQNQXwJ3cG2Aab7T+CaPNcoEBUwY4Bje3/PSYvGRUjYGIkPDAmDjRdNsBUYBuMfI9968tBbJGoBhqksXgV4Iy3aPKi5R37nB1CJDUcZC6qWEIHIJ6puEx0W8EyEoR0Tt+7nPYwqkyGsdd4wn4gesMGjNwicrKN4cmZ7Af4RFXFCBiRk+PDkzN+oSLnDil1sIwERsjVo1ggPmIKSNyyATPl3PwbnpyHh6qWC3PIRE55Izw501lgZtBmryRylkvhyjn7wmETJ7NzvRienL/m9O5q9xcskXNjPhw5VRlQSsDvgh1YRsLaQnhybpWBP+sOzchU+1toWlfNnaB6ZaddN6zdEfE14ynymH0zMtNzGivfJ8CH1FpGjnc7d0lkhi7m76H8o5e2EL7sGW4E51eG3f/2+Mrgz3nPgv0D9Cc+LoUg84gAAAAASUVORK5CYII="},xlxt:function(ct,ge,U){ct.exports={flex_box_center:"flex_box_center___1qaRn",flex_space_between:"flex_space_between___3tOTR",flex_box_vertical_center:"flex_box_vertical_center___2XsRs",flex_box_center_end:"flex_box_center_end___3O9De",flex_box_column:"flex_box_column___3bx6a",exportModal:"exportModal___29rdj"}},"yTi+":function(ct,ge,U){ct.exports=U.p+"static/AssistantCode3.fdd8db3c.jpeg"}}]);